Jump to content
  • 0
Sign in to follow this  
Takumirai

Run or Die by AnnieRuru

Question

 

prontera,146,231,5 script Run Or Die 100,{
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$, 0,0;
.register_aid[ .register_count ] = getcharid(3);
.register_count+++;
end;
OnCommand:
// put all your start timer here
OnClock0500:
OnClock1100:
OnClock1700:
OnClock2300:
if ( .start ) end;
announce "Run or Die event registration start", bc_all;
.start = 1;
sleep 10000; // registration timer here
announce "Run or Die event registration close", bc_all;
.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 ( .start == 2 ) {
monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;
monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;
monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;
sleep 5000;
}
end;
OnPCDieEvent:
OnPCLogoutEvent:
if ( !.start || strcharinfo(3) != .map$ ) end;
while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;
if ( .@i == .register_count ) end;
deletearray .register_aid[.@i], 1;
.register_count--;
warp "SavePoint", 0,0;
if ( .register_count > 1 ) end;
killmonsterall .map$;
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:
     waitingroom "Run or Die",0;
.map$ = "poring_w01";
.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 = 30802; // reward item id
.reward_item_amount = 1; // reward item amount to the sole winner
bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99;
end;
}
poring_w01 mapflag nosave SavePoint
poring_w01 mapflag nowarp
poring_w01 mapflag nowarpto
poring_w01 mapflag noteleport
poring_w01 mapflag nomemo
poring_w01 mapflag nopenalty
poring_w01 mapflag noicewall
poring_w01 mapflag nobranch
poring_w01 mapflag noskill

 

- The problem is when the NPC Announce 

announce "Run or Die event registration start", bc_all;

- It will Announce 

announce "Run or Die event registration close", bc_all;

 

- Even if not yet 2 sec. or 3sec it close the registration, i want it 3 minutes registration before closing

 

announce "Run or Die event registration is open in 3 minute", bc_all;

announce "Run or Die event registration is open in 2 minute", bc_all;

announce "Run or Die event registration is open in 1 minute", bc_all;

then 

announce "Run or Die event registration close", bc_all;

 

 

- Thanks in advance.

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

change

sleep 10000; // registration timer here

 


to

for (.@c = 3; .@c > 0; .@c--) {	announce "Run or Die event registration is open in "+.@c+" minute", bc_all;	sleep 60000;}

Share this post


Link to post
Share on other sites
  • 0

i just want to ask about this script if you don't mind

 

 

prontera,146,231,5 script Run Or Die 100,{

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$, 104,103;

.register_aid[ .register_count ] = getcharid(3);

.register_count+++;

end;

OnCommand:

// put all your start timer here

OnClock0500:

OnClock1100:

OnClock1700:

OnClock2300:

if ( .start ) end;

announce "Run or Die event registration start", bc_all;

.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;

.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 ( .start == 2 ) {

monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;

monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;

monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;

sleep 5000;

}

end;

OnPCDieEvent:

OnPCLogoutEvent:

if ( !.start || strcharinfo(3) != .map$ ) end;

while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;

if ( .@i == .register_count ) end;

deletearray .register_aid[.@i], 1;

.register_count--;

warp "SavePoint", 0,0;

if ( .register_count > 1 ) end;

killmonsterall .map$;

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:

waitingroom "Run or Die",0;

.map$ = "poring_w01";

.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 = 30802; // reward item id

.reward_item_amount = 1; // reward item amount to the sole winner

 

bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99;

end;

}

poring_w01 mapflag nosave SavePoint

poring_w01 mapflag nowarp

poring_w01 mapflag nowarpto

poring_w01 mapflag noteleport

poring_w01 mapflag nomemo

poring_w01 mapflag nopenalty

poring_w01 mapflag noicewall

poring_w01 mapflag nobranch

poring_w01 mapflag noskill

the problem here, when all player die the npc didn't recognize the winner.

- hope you can check the problem thanks

Share this post


Link to post
Share on other sites
  • 0

Here fixed script

prontera,146,231,5 script Run Or Die 100,{    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$, 104,103;    .register_aid[.register_count] = getcharid(3);    .register_count++;    end;OnCommand:// put all your start timer hereOnClock0500:OnClock1100:OnClock1700:OnClock2300:    if (.start) end;    announce "Run or Die event registration start", bc_all;    .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;    .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$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;        monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;        monster .map$, 0,0, "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 ( .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:    waitingroom "Run or Die",0;    .map$ = "poring_w01";    .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 = 30802; // reward item id    .reward_item_amount = 1; // reward item amount to the sole winner    bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99;    end;}poring_w01 mapflag nosave SavePointporing_w01 mapflag nowarpporing_w01 mapflag nowarptoporing_w01 mapflag noteleportporing_w01 mapflag nomemoporing_w01 mapflag nopenaltyporing_w01 mapflag noicewallporing_w01 mapflag nobranchporing_w01 mapflag noskill
Edited by Litro

Share this post


Link to post
Share on other sites
  • 0

Line 17: .register_count+++;  ( it have 3 '+' idk if it will gift diferent result so i change it to 2 '+' .register_count++;)

Line 52: while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;  (On this idk if it was right, firstly it was maam annie script and her script knowledge is superior than me and i didn't understand her way, so i change it to way i understand while (.@i < .register_count && .register_aid[.@i] != getcharid(3)) .@i++;

Line 42: the condition to win and condition to spawning monster i think it colided, you should make if it was there more than one registered player on event map as spawning mob condition and if thereis only one left so script will immediately kill all monster spawned, so the script likely be changed like this, move killmonsterall .map$; in line 58 to line 48, i have updated the script in my previous post

while (.register_count > 1) {	monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;	monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;	monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;	sleep 5000;}killmonsterall .map$;end;

Share this post


Link to post
Share on other sites
  • 0

 

Line 17: .register_count+++;  ( it have 3 '+' idk if it will gift diferent result so i change it to 2 '+' .register_count++;)

Line 52: while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++;  (On this idk if it was right, firstly it was maam annie script and her script knowledge is superior than me and i didn't understand her way, so i change it to way i understand while (.@i < .register_count && .register_aid[.@i] != getcharid(3)) .@i++;

Line 42: the condition to win and condition to spawning monster i think it colided, you should make if it was there more than one registered player on event map as spawning mob condition and if thereis only one left so script will immediately kill all monster spawned, so the script likely be changed like this, move killmonsterall .map$; in line 58 to line 48, i have updated the script in my previous post

while (.register_count > 1) {	monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;	monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;	monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;	sleep 5000;}killmonsterall .map$;end;

 

there's a problem again on the event, if in the next period of events , sometimes the NPC broadcast that the event is On but when player click the NPC it say  mes "Check Schedule NPC, Event is Offline."; but the NPC broadcast it's time for the event

Share this post


Link to post
Share on other sites
  • 0

Try it

prontera,146,231,5	script	Run Or Die	100,{	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$, 104,103;	.register_aid[.register_count] = getcharid(3);	.register_count++;	end;OnCommand:// put all your start timer hereOnClock0500:OnClock1100:OnClock1700:OnClock2300:	if (.start) end;	announce "Run or Die event registration start", bc_all;	.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;	.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;		callsub L_reset;		end;	}	while (.register_count > 1) {		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 0;		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 1;		monster .map$, 0,0, "Come On Baby!!!", 1904, 5 + rand(5), "", 2;		sleep 5000;	}	killmonsterall .map$;	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 ) );	callsub L_reset;	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;	end; L_reset:	deletearray .register_aid;	.start = .register_count = 0;	return;OnInit:	waitingroom "Run or Die",0;	.map$ = "poring_w01";	.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 = 30802; // reward item id	.reward_item_amount = 1; // reward item amount to the sole winner	bindatcmd "runordie", strnpcinfo(0)+"::OnCommand", 99,99;	end;}poring_w01 mapflag nosave SavePointporing_w01 mapflag nowarpporing_w01 mapflag nowarptoporing_w01 mapflag noteleportporing_w01 mapflag nomemoporing_w01 mapflag nopenaltyporing_w01 mapflag noicewallporing_w01 mapflag nobranchporing_w01 mapflag noskill

Share this post


Link to post
Share on other sites
  • 0

moving the statement winner to the end of the spawning monster loop and change the goto's to callsub and if the proble still there try to separate

.start = .register_count = 0;

into two line

.start = 0;.register_count = 0;

but from what i learn from the tutorial script @GmOcean that would do it, any way try all script offline before make it run on live server so it will not be harmfull

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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