Jump to content
  • 0
MikZ

Run or Die event DRAW

Question

Hello Hercules master scripters,
Help me with this script, I found out that if players died in same time, meaning no one survived. but the script keeps summoning monster..
How or where can I add this :
 

 

if ( getmapusers( "quiz_01" ) < 1 ) {announce "Event RUN and SURVIVE DRAW.. NO one survive LOL!!",0,0x00FF00;

or any other idea? please do help me.. thank you!
Here's the script..

 

izlude,125,139,5	script	Run Or Die	4_M_NOFEARGUY,{    if (!.start) {        mes "Check Schedule NPC, Event is Offline.";        close;    }    if (.start == 2) {        mes "Event in Progress..";        close;    }    if (.register_count >= .register_limit) {    mes "this event has reach the maximum player participations";    close;    }    percentheal 100,100;    warp .map$, 42,285;    .register_aid[.register_count] = getcharid(3);    .register_count++;    end;OnCommand:// put all your start timer hereOnClock1047:OnClock1055:    if (.start) end;	announce "Run or Die event registration start", bc_all;	enablenpc("Run Or Die");    .start = 1;    for (.@c = 3; .@c > 0; .@c--) {        announce "Run or Die event registration is open in "+.@c+" minute", bc_all;        sleep 60000;    }    announce "Run or Die event registration close", bc_all;		disablenpc("Run Or Die");    .start = 2;    sleep 3000;    mapannounce .map$, "Survive as long as you can !", bc_map;    if (.register_count < .register_min) {        announce "Not enough participants for Run or Die event", 0;        getmapxy .@map$, .@x, .@y, 1;        mapwarp .map$, .@map$, .@x, .@y;        goto L_reset;    }    while (.register_count > 1) {        monster .map$, 30,285, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;        monster .map$, 52,285, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;        monster .map$, 42,285, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;        sleep 5000;    }    killmonsterall .map$;    end;OnPCDieEvent:OnPCLogoutEvent:    if ( !.start || strcharinfo(3) != .map$ ) end;    while (.@i < .register_count && .register_aid[.@i] != getcharid(3)) .@i++;    if ( .@i == .register_count ) end;    deletearray .register_aid[.@i], 1;    .register_count--;    warp "SavePoint", 0,0;    if ( !.start || .register_count > 1 ) end;    announce "Congratulations ~ the winner of Run Or Die event is "+ rid2name( .register_aid ), bc_all;    getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize    warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) );L_reset:    deletearray .register_aid;    .start = .register_count = 0;    end;OnInit:	disablenpc("Run Or Die");//    waitingroom "Run or Die",0;    .map$ = "quiz_01";    .register_min = 2; // minimum amount of players to start this event, or else it auto-abort    .register_limit = 100; // maximum amount of players able to participate in this event    .reward_item_id = 615; // reward item id    .reward_item_amount = 1; // reward item amount to the sole winner    bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99;    end;}

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

add killmonsterall to end of OnPCDieEvent and set .register_count to 0 so the while () no longer works

Share this post


Link to post
Share on other sites
  • 0

add killmonsterall to end of OnPCDieEvent and set .register_count to 0 so the while () no longer works

@@Z3R0 how? sorry im a bit confuse im noob. /sob

Share this post


Link to post
Share on other sites
  • 0

 

add killmonsterall to end of OnPCDieEvent and set .register_count to 0 so the while () no longer works

@@Z3R0 how? sorry im a bit confuse im noob. /sob

 

 

while (.register_count > 1) {monster .map$, 30,285, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;monster .map$, 52,285, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;monster .map$, 42,285, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;sleep 5000;,register_count = 0;}

 

add the last line to the file.

 

and on the event for OnPCDieEvent add as suggested killmonsterall;

 

http://ea.dj-yhn.com/index.php?c=killmonsterall

 

Share this post


Link to post
Share on other sites
  • 0

no do not set register_count inside the loop itself both things I mentioned go on the OnPCDieEvent

Share this post


Link to post
Share on other sites
  • 0

@Aeromesi 

    parse_line: need ';'    47:         monster .map$, 42,285, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;    48:         sleep 5000;    49:         .register_count = 0*   50:     }        ~~~~^    51:     killmonsterall .map$;    52:     end;

@@Z3R0 I tried this (not working), still summoning
 

OnPCDieEvent:if ( getmapusers( "quiz_01" ) == 0 ) {announce "Event RUN and SURVIVE DRAW.. NO one survive LOL!!",0,0x00FF00;killmonsterall .map$;.register_count = 0;                }        end;OnPCLogoutEvent:    if ( !.start || strcharinfo(3) != .map$ ) end;    while (.@i < .register_count && .register_aid[.@i] != getcharid(3)) .@i++;    if ( .@i == .register_count ) end;    deletearray .register_aid[.@i], 1;    .register_count--;    warp "SavePoint", 0,0;    if ( !.start || .register_count > 1 ) end;    announce "Congratulations ~ the winner of Run Or Die event is "+ rid2name( .register_aid ), bc_all;    getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize    warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) );

 


im trying to use this from Novice Versus zombie (but its not working)
 

              OnPCLogoutEvent:        OnPCDieEvent:                if( .nvzEventRunning  == 0 || strcharinfo(PC_MAP) != "quiz_01" ) end;                               warp("izlude", 127,142);                atcommand("@alive");                dispbottom("You have lost...");                 if( getmapusers("quiz_01") > 1 ) {                        announce(getmapusers("quiz_01") + " people still fight for their lives.", bc_map, 0x00FF00);                        end;                }                               if( getmapusers("quiz_01") == 1 ){                        killmonsterall("quiz_01");                        announce("You have won! Please claim your price at the Prize NPC!", bc_map);                        enablenpc("Prize");                        .nvzEventRunning = 0;                }                 if( getmapusers("quiz_01") == 0 ){                        killmonsterall("quiz_01");                        .nvzEventRunning = 0;                }        end;
Edited by MikZ

Share this post


Link to post
Share on other sites
  • 0

ah you have == 0 for getmapusers... that is wrong...

 

when a player dies... he is still on the map... you have the first check for greater than 1... your next check has to be <= 1....

Share this post


Link to post
Share on other sites
  • 0

@@Z3R0 so what should it be? I also tried 

OnPCDieEvent:killmonsterall .map$;.register_count = 0;

 

Then I place both test player in same place , died same time, but monster keep re-spawning.. how would i stop the script? 


 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.