Jump to content
  • 0

AnnieRuru's Bg emp Client crashed & no prize given


kitty14

Question


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.03
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

Guess I need to post new thread for this..
Hello! im using this script in my server

-    script    bg_emp#control    -1,{
OnInit:
    .min2start = 1; // minimum players to start (ex. if 3vs3, set to 3)
    .eventlasting = 20*60; // event duration before auto-reset (20 minutes * seconds)
    setarray .rewarditem[0], // rewards for the winning team: <item>,<amount>,...
        501, 10;

    .rewardsize = getarraysize( .rewarditem );
    .team1name$ = "Red";
    .team2name$ = "Blue";
    bindatcmd "joinbg", strnpcinfo(0)+"::OnJoin";
    bindatcmd "leavebg", strnpcinfo(0)+"::OnLeave";
    .min2start = .min2start *2;
    end;
OnLeave:
    while ( .signup_aid[.@i] != getcharid(3) && .@i < .signup_count )
        .@i++;
    if ( .@i == .signup_count ) {
        dispbottom "you not yet sign up in this event";
        end;
    }
    deletearray .signup_aid[.@i], 1;
    .signup_count--;
    dispbottom "You have leave the registration of this event";
    end;
OnJoin:
    if ( getmapflag( strcharinfo(3), mf_nowarp ) || getmapflag( strcharinfo(3), mf_nowarpto ) ) {
        dispbottom "you can't sign up for this event from the map you are in";
        end;
    }
    while ( .signup_aid[.@i] != getcharid(3) && .@i < .signup_count )
        .@i++;
    if ( .@i < .signup_count ) {
        dispbottom "you have already sign up in this event";
        end;
    }
    .signup_aid[ .signup_count ] = getcharid(3);
    .signup_count++;
    dispbottom "You are now signed to the BG event";
    .@i = 1; // DEBUG
    .@signup_name$ = rid2name( .signup_aid[0] );
    while ( .signup_aid[.@i] ) {
        .@signup_name$ = .@signup_name$ +","+ rid2name( .signup_aid[.@i] );
        .@i++;
    }
    dispbottom "Currently have "+ .signup_count +" sign-in and they are "+ .@signup_name$;
L_start:
    for ( .@i = 0; .@i < .signup_count; .@i++ ) {
        if ( attachrid( .signup_aid[.@i] ) ) {
            if ( getmapflag( strcharinfo(3), mf_nowarp ) ) { // player has went into another event
                deletearray .signup_aid[.@i], 1;
                .signup_count--;
                .@i--;
            }
        }
        else {
            deletearray .signup_aid[.@i], 1;
            .signup_count--;
            .@i--;
        }    
    }
    if ( .start || .signup_count < .min2start ) {
        announce "Currently there are "+ .signup_count +" players registered in Battle Ground", bc_all;
        end;
    }
    .start = 1;
    // create Battleground and teams
    .red = createbgid( "bat_a01", 157,347, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead" );
    .blue = createbgid( "bat_a01", 142,51, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead" );
    callfunc "rand__", .min2start, $@r;
    .@modulus = rand(2);
    for ( .@i = 0; .@i < .signup_count; .@i++ )
        setbgid ( .@i %2 == .@modulus )? .red : .blue, .signup_aid[ $@r[.@i] ];
    deletearray .signup_aid, .min2start;
    .signup_count -= .min2start;
    setwall "bat_a01", 164,347, 6, 4, 0, "bg_emp_town_red";
    setwall "bat_a01", 154,51, 6, 4, 0, "bg_emp_town_blue";
    bg_warp .red, "bat_a01", 171,346;
    bg_warp .blue, "bat_a01", 162,50;
    bg_updatescore "bat_a01", 0, 0;

    // delay before match begins
    sleep 6000;
    mapannounce "bat_a01", "The rules are simple. The first team to break the opponent's Emperium wins!", bc_map;
    sleep 3000;
    for ( .@i = 5; .@i > 0; .@i-- ) {
        mapannounce "bat_a01", "["+ .@i +"]", bc_map;
        sleep 1000;
    }
    mapannounce "bat_a01", "Start!", bc_map;

    // spawn Emperiums
    bg_monster .red,"bat_a01",171,346, "--ja--",1288, strnpcinfo(3)+"::OnRedDown";
    bg_monster .blue,"bat_a01",162,50, "--ja--",1288, strnpcinfo(3)+"::OnBlueDown";
    delwall "bg_emp_town_red";
    delwall "bg_emp_town_blue";

    // match duration
    sleep .eventlasting * 1000;

    // end match, destroy Battleground, reset NPCs
    killmonster "bat_a01", strnpcinfo(3)+"::OnRedDown";
    killmonster "bat_a01", strnpcinfo(3)+"::OnBlueDown";
    if ( .winside ) {
        mapannounce "bat_a01", "- "+ getd( ".team"+ .winside +"name$" ) +" Team is victorious! -", bc_map;
        callsub L_reward, ( .winside == 1 )? .red : .blue, .rewarditem, .rewardsize;
    } else
        mapannounce "bat_a01", "- The match has ended in a draw! -", bc_map;
    sleep 5000;
    bg_warp .red, "caspen", 86,80;
    bg_warp .blue, "caspen", 86,80;
    bg_destroy .red;
    bg_destroy .blue;
    delwall "bg_emp_town_red";
    delwall "bg_emp_town_blue";
    .winside = .start = 0;
    goto L_start;

L_reward:
    getbgusers getarg(0);
    for ( .@i = 0; .@i < $@arenamembersnum; .@i++ )
        for ( .@j = 0; .@j < getarg(2); .@j += 2 )
            getitem getelementofarray( getarg(1), .@j ), getelementofarray( getarg(1), .@j +1 ), $@arenamembers[.@i];
    return;

// Emperium destroyed
OnRedDown: callsub L_EmpDown, 1, 2;
OnBlueDown: callsub L_EmpDown, 2, 1;
L_EmpDown:
    mapannounce "bat_a01", strcharinfo(0) +" has destroyed "+ getd( ".team"+ getarg(0) +"name$" ) +" Team's Emperium.", bc_map;
    .winside = getarg(1);
    awake strnpcinfo(0);
    end;

// "OnDeath" event
OnRedDead:
OnBlueDead:
    sleep2 1250;
    percentheal 100,100;
    end;

// "OnQuit" event
OnRedQuit: callsub L_Quit, 1, .red;
OnBlueQuit: callsub L_Quit, 2, .blue;
L_Quit:
    percentheal 100, 100;
    if ( bg_get_data( getarg(1), 0 ) ) end;
    mapannounce "bat_a01", "All "+ getd( ".team"+ getarg(0) +"name$" ) +" team members have quit!", bc_map, 0xff3333;
    end;
}

bat_a01    mapflag    battleground
bat_a01    mapflag    nosave    SavePoint
bat_a01    mapflag    nowarp
bat_a01    mapflag    nowarpto
bat_a01    mapflag    noreturn
bat_a01    mapflag    noteleport
bat_a01    mapflag    nomemo
bat_a01    mapflag    nopenalty
bat_a01    mapflag    nobranch
bat_a01    mapflag    noicewall 

Work fine..

but when switched to this cuz it has been customized well
 

AnnieRuru, on 31 Aug 2014 - 06:03 AM, said:snapback.png

 

tested in our test server
once I join 2 account and started to warp, one or both will get error/crashed..
and if it will work, got no prize after all..

but i didn't get any error in the script.. how can i fix it?

10516737_833477383359519_878324844728952
don't mind the debug sql, that's for pvp ladder, didn't add it since its a test server.
just updated my git today..
thank you!

even if i change it to this.. still no prize after the event even if red team won or quit.. no prize..

	setarray .rewardwin = 501,10, 502,5, 503,3; // reward to winning team
	setarray .rewardlose = 501,5, 502,3, 503,1; // reward to losing team
Edited by kitty14
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  295
  • Reputation:   6
  • Joined:  10/14/12
  • Last Seen:  

You might wanna do it manually though. Could be a lot easier to troubleshoot.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.03
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

thanks much for the responds Fresh Prince: Yup i did patched this Paste: 7207eo0p96gx , however for this patch  i get error like

(Stripping trailing CRs from patch.)
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|src/map/script.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|1 file changed, 70 insertions(+)
|
|diff --git a/src/map/script.c b/src/map/script.c
|index ecd12a3..e547b32 100644
|--- a/src/map/script.c
|+++ b/src/map/script.c
--------------------------
File to patch:

have any Idea?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.03
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

well i tried to do it manually, but unfortunately

i can't seem to find the first line, 

       return script->add_builtin(&buildin, true);
 }

+//     createbgid <respawn map>, <respawn x>, <respawn y>, <On Quit event>, <On Death event>;

and i tried to add it above this line, and i got error
 

+
 #define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args }
 #define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args }
 void script_parse_builtin(void) {

/sob

 

10676397_835996443107613_296642231753479


FIX!

Edited by kitty14
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  164
  • Reputation:   12
  • Joined:  01/03/12
  • Last Seen:  

willing to share how you fix the issue?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

http://rathena.org/board/topic/97602-annierurus-bg-emp-edit-request/#entry267419

I don't see what's so hard about it

just download the patch

[paste=7207eo0p96gx]

then put rand__ function somewhere

then install the script

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.03
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

sorry, I really don't know what went wrong, I followed everything. still getting client crashes and no prize. some times it works fine. some times not.

but if I use the first script above, everything works fine,. /sob

Edited by kitty14
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  164
  • Reputation:   12
  • Joined:  01/03/12
  • Last Seen:  

I think i know what makes the client crashed...
Annie herself answer this a year ago..

hope can help

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...