Jump to content
  • 0

help How to make it automatic give the prize


GM Takumirai

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

i want this script to be automatic giving a prize to the winner, without using the npc to give to the winner

Last Man Standing Script


- script LMS#disable -1,{

OnInit:
disablenpc "Mr. Banker";
disablenpc "All Job Manager";
end;
}

- script LMS -1,{

OnTue0800:
OnTue1100:
OnTue1400:
OnTue1700:
OnThu0800:
OnThu1100:
OnThu1400:
OnThu1700:
goto startlmsevent;

startlmsevent:
announce "Mr. Manager: The Last Man Standing event will be starting shortly.",0;
enablenpc "All Job Manager";
sleep2 10000;
announce "Mr. Manager: Those who want to play, please proceed to ''gonryun 123 161'' and Register.",0;
sleep2 10000;
announce "Mr. Manager: Note: Other Pots/MvP/Mini Boss Card is Disabled.",0;
sleep2 10000;
announce "Mr. Manager: Those who want to play, please proceed to ''gonryun 123 161'' and Register.",0;
sleep2 10000;
announce "Mr. Manager: Note: Other Pots/MvP/Mini Boss Card is Disabled.",0;
sleep2 10000;
announce "Mr. Manager: After 3 Minute the Registration will close. go to ''gonryun 123 161''.",0;
sleep2 10000;
announce "Mr. Manager: After 2 Minute the Registration will close. go to ''gonryun 123 161''.",0;
sleep2 10000;
announce "Mr. Manager: After 1 Minute the Registration will close. go to ''gonryun 123 161''.",0;
sleep2 10000;
announce "Mr. Manager: Please go to ''gonryun 123 161'' and Register now if you want to join.",0;
initnpctimer;
end;

OnTimer30000:
announce "Mr. Manager: Last 30 seconds.",0;
sleep2 5000;
announce "Mr. Manager: If you want to join please Register in ''gonryun 123 161''.",0;
end;

OnTimer50000:
announce "Mr. Manager: Last 10 seconds.",0;
end;

OnTimer55000:
announce "Mr. Manager: 5.",0;
end;

OnTimer56000:
announce "Mr. Manager: 4.",0;
end;

OnTimer57000:
announce "Mr. Manager: 3.",0;
end;

OnTimer58000:
announce "Mr. Manager: 2.",0;
end;

OnTimer59000:
announce "Mr. Manager: 1.",0;
end;

OnTimer60000:
announce "Mr. Manager: Time's up.",0;
end;

OnTimer61000:
disablenpc "All Job Manager";
donpcevent "Mr. Banker::OnEnable";
stopnpctimer;
end;
}
//---------All Job Registration---------------
gonryun,123,161,3 script All Job Manager 106,{

mes "[Mr. Manager]";
mes "Hello What can I do for you?";
next;
menu "Register",-,"What is LMS?",what,"Leave",leave;
next;
mes "[Mr. Manager]";
mes "Thankyou for registering Mr. " + strcharinfo(0) + ", Have fun!";
warp "guild_vs5",48,50;
end;
what:
mes "[Mr. Manager]";
mes "LMS is also known as Last Man Standing Event";
next;
mes "[Mr. Manager]";
mes "LMS is also like a PvP.";
mes "The only difference is at LMS you will get 10 Gold Coin + 1 Event Ticket if you are the Last Man Standing at the arena.";
next;
mes "[Mr. Manager]";
mes "You can Also Get 5 Gold Coin for 4 consecutive kills.";
next;
mes "[Mr. Manager]";
mes "That's all";
close;
leave:
mes "[Mr. Manager]";
mes "I hope you will register next time";
close;


}

//--------------------------

//--------------------------
guild_vs5,49,51,6 script Mr. Banker 56,{

mes "[banker]";
mes "Congrats. You've won.";
next;
announce "Mr. Manager: We have a winner! well done "+strcharinfo(0)+".",0;
getitem 7711,2;
mes "You will return now";
warp "prontera",155,182;
disablenpc "Mr. Banker";
close;
end;
OnEnable:
pvpoff "guild_vs5";
mapannounce "guild_vs5","Mr. Manager:The Last Man Standing Event will start shortly",0;
sleep2 10000;
mapannounce "guild_vs5","Mr. Manager:But before we start this is just a few reminders..",0;
sleep2 10000;
mapannounce "guild_vs5","Mr. Manager:Using Cloaking , Hiding is strictly not allowed..",0;
sleep2 10000;
mapannounce "guild_vs5","Mr. Manager: Only the Last Man Standing will win this event!!",0;
sleep2 10000;
mapannounce "guild_vs5","Mr. Manager: What are we waiting for?..Let's Get Ready to Rumble!!...",0;
sleep2 10000;
goto L_Start;
end;
L_Start:
if(getmapusers("guild_vs5") == 1) goto L_None;
if(getmapusers("guild_vs5") == 0) goto L_None;
if(getmapusers("guild_vs5") > 1) {
mapannounce "guild_vs5","Mr. Manager: Get ready at the count of 5 we will start!....",0;
sleep2 10000;
mapannounce "guild_vs5","Mr. Manager: 5",0;
sleep2 5000;
mapannounce "guild_vs5","Mr. Manager: 4",0;
sleep2 4000;
mapannounce "guild_vs5","Mr. Manager: 3",0;
sleep2 3000;
mapannounce "guild_vs5","Mr. Manager: 2",0;
sleep2 2000;
mapannounce "guild_vs5","Mr. Manager: 1",0;
sleep2 1000;
pvpon "guild_vs5";
goto timer;
end;
}
timer:
initnpctimer;
end;

OnTimer1000:
end;

OnTimer1100:
if(getmapusers("guild_vs5") == 1) goto L_Champ;
if(getmapusers("guild_vs5") > 2) goto timer;
if(getmapusers("guild_vs5") == 2) goto champ;
stopnpctimer;
end;

champ:
announce "Mr. Manager: Last 2 Brave warriors are still alive!",0;
sleep2 10000;
if(getmapusers("guild_vs5") == 1) goto L_Champ;
if(getmapusers("guild_vs5") > 1) goto timer;
end;

L_Champ:
mapannounce "guild_vs5","Mr. Banker: Please talk to me to get your prize..",0;
pvpoff "guild_vs5";
enablenpc "Mr. Banker";
end;

L_None:
disablenpc "Banker";
announce "Mr. Manager: Sorry No Participants Available.",0;
warp "prontera",155,182;
pvpoff "guild_vs5";
end;
}
//----- Die = warp prt -----
- script Killa_warp -1,{

OnPCDieEvent:
getmapxy(.@map$,.@x,.@y,0);
if(.@map$=="guild_vs5")
{
set #kill_point, 0;
announce ""+strcharinfo(0)+" died, and out of the game!.",bc_all;
warp "prontera",0,0;
end;
}
OnPCKillEvent:
getmapxy(.@map$,.@x,.@y,0);
if(.@map$=="guild_vs5")
{
set #kill_point,#kill_point+1;
if ( #kill_point % 4 == 0) {
announce ""+strcharinfo(0)+" have made 4 Consecutive Kills!!He will be granted an item",bc_all;
getitem 671,1;
end;
}
}
}


// == Mapflags
guild_vs5 mapflag nowarp
guild_vs5 mapflag nowarpto
guild_vs5 mapflag noteleport
guild_vs5 mapflag nosave
guild_vs5 mapflag nomemo
guild_vs5 mapflag nobranch
guild_vs5 mapflag pvp_noparty
guild_vs5 mapflag nocommand 80
guild_vs5 mapflag restricted 1

and

Zombie v.s. Novice Script


sec_pri mapflag nowarpto
sec_pri mapflag nowarp
sec_pri mapflag noteleport
sec_pri mapflag nomemo
sec_pri mapflag nosave SavePoint
sec_pri mapflag nobranch
sec_pri mapflag noicewall
sec_pri mapflag nopenalty
sec_pri mapflag nobranch
sec_pri mapflag noexp
sec_pri mapflag noreturn
sec_pri mapflag pvp_noparty
sec_pri mapflag restricted 1

- script RFYL#disable -1,{

OnInit:
disablenpc "Zombie Master";
disablenpc "Present For You";
}

- script RFYL -1,{

OnSat0800:
OnSat1100:
OnSat1400:
OnSat1700:
OnSun0800:
OnSun1100:
OnSun1400:
OnSun1700:
set $@offvar,1;
goto StartEvent;


StartEvent:
announce "Zombie Vs. Novice event Will be open in 3 minutes! locate me at gonryun,148,190",0;
killmonsterall "sec_pri";
sleep 55000;
announce "Zombie Vs. Novice event Will be open in 2 minutes! locate me at gonryun,148,190",0;
sleep 5000;
announce "Zombie Master: I have now appeared in gonryun,148,190!",0;
enablenpc "Zombie Master";
sleep 60000;
announce "Zombie Vs. Novice event will begin in 1 minute! Please Register Now!",0;
sleep 30000;
mapannounce "sec_pri","In 30 seconds we will close the Registration!",0;
sleep 25000;
announce "Zombie Vs. Novice event will closed in ~5~",0;
sleep 1000;
announce "Zombie Vs. Novice event will closed in ~4~",0;
sleep 1000;
announce "Zombie Vs. Novice event will closed in ~3~",0;
sleep 1000;
announce "Zombie Vs. Novice event will closed in ~2~",0;
sleep 1000;
announce "Zombie Vs. Novice event will closed in ~1~",0;
sleep 1000;
announce "Zombie Vs. Novice event has now closed.!!",0,0x00FF00;
disablenpc "Zombie Master";
disablenpc "Present For You";
if(getmapusers("sec_pri") == 1) goto L_None;
if(getmapusers("sec_pri") == 0) goto L_None;
announce "Zombie Vs. Novice event will spawn in ~5~",0;
sleep 1000;
announce "Zombie Vs. Novice event will spawn in ~4~",0;
sleep 1000;
announce "Zombie Vs. Novice event will spawn in ~3~",0;
sleep 1000;
announce "Zombie Vs. Novice event will spawn in ~2~",0;
sleep 1000;
announce "Zombie Vs. Novice event will spawn in ~1~",0;
sleep 10000;
announce "Zombie Vs. Novice event is now Started.",0;
sleep 10000;
monster "sec_pri",24,76,"Zombie",1015,1;
sleep 10000;
monster "sec_pri",24,76,"Zombie-2",1015,1;
sleep 10000;
monster "sec_pri",24,76,"Zombie-3",1015,1;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 55000;
mapannounce "quiz_01","Round 2!",0;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 55000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
mapannounce "sec_pri","Round 3!",0;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 55000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
mapannounce "sec_pri","Round 4!",0;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 55000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
mapannounce "sec_pri","Round 5!",0;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 55000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
mapannounce "sec_pri","Round 6!",0;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 55000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
mapannounce "sec_pri","Round 7! Final Round!",0;
sleep 10000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 20000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 30000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
sleep 40000;
monster "sec_pri",24,76,"Zombie-4",1036,1;
sleep 50000;
monster "sec_pri",24,76,"Zombie-4",1036,1;
sleep 60000;
monster "sec_pri",24,76,"Zombie-4",1015,1;
initnpctimer;
end;

OnTimer0500:
if ( getmapusers("sec_pri") == 0 )
{
killmonsterall "sec_pri";
announce "'Zombie Vs. Novice' event has ended. No one joined.",0;
stopnpctimer;
end;
}
else if ( getmapusers("sec_pri") > 1 )
{
mapannounce "sec_pri",getmapusers("sec_pri") +"has survived the event.",0,0x00FF00;;
initnpctimer;
end;
}
initnpctimer;
end;

OnPCDieEvent:
getmapxy .@mapnvz$,.@xnvz,.@ynvz,0;
if ( .@mapnvz$ == "sec_pri") {
sleep2 1;
warp "gonryun",159,104;
atcommand "@alive "+ strcharinfo(0);
dispbottom "you have lost...";
}
sleep2 0500;
if ( .@mapnvz$ == "sec_pri" && getmapusers("sec_pri") == 1 ) {
killmonsterall "sec_pri";
mapannounce "sec_pri","You have won, approach the Present For You Npc please.",0;
enablenpc "Present For You";
stopnpctimer;
end;
}
end;

L_None:
disablenpc "Zombie Master";
disablenpc "Present For You";
announce "Manager: Event End! Lack of Participants..!",0;
end;
}

sec_pri,24,76,3 script Present For You 72,{

mes "[Present For You]";
mes "Please tell me your name.";
next;
input .@name$;
if(.@name$ != strcharinfo(0)) {
mes "[Present For You]";
mes "Are you sure that is your name?";
close;
}
mes "[Present For You]";
mes "Congrats. You've won.";
close2;
announce "Present For You: We have a winner! "+.@name$+" has won the Novice vs Zombie event!",0;
getitem 7711, 2; // Change This item id to what ever you want
warp "gonryun",159,104;
disablenpc "Present For You";
end;
}

gonryun,148,190,4 script Zombie Master 1298,{
if (BaseLevel > 1) goto NO;
if (class == 0) goto event;
if (class > 0) goto NO;
event:
mes "[^0000FFZombie Master^000000]";
mes "You wish to participate the Zombie Vs. Novice event?";
next;
switch(select("Yes","No")) {
case 1:
sc_end SC_ALL;
sc_start SC_DECREASEAGI,1200000,10;
percentheal 100,100;
sc_start SC_STRIPSHIELD,1200000,5;
sc_start SC_STRIPWEAPON,1200000,5;
sc_start SC_STRIPARMOR,1200000,5;
sc_start SC_STRIPHELM,1200000,5;
statusup2 bStr,-999;
statusup2 bAgi,-999;
statusup2 bVit,-999;
statusup2 bInt,-999;
statusup2 bDex,-999;
statusup2 bLuk,-999;
warp "sec_pri",24,76;
end;
break;
case 2:
mes "[^0000FFZombie Master^000000]";
mes "Come back when your ready.";
close;
break;
NO:
mes "[^0000FFZombie Master^000000]";
mes "You are not a Novice, level 1.";
close;
}
OnInit:
disablenpc "Zombie Master";
disablenpc "Present For You";
end;
}

- thanks

Edited by GM Takumirai
Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

This is a little hackish, but here's what I use -- when there is only one player left on the map (auto-checking timer is already in the scripts), enable an OnTouch NPC somewhere on the map and 'mapwarp' the map (which should only have 1 player) to that NPC. When that NPC script is executed, give rewards, kick the player out, and disable the NPC.

You could use an SQL query to find the one player on the map, but from past experience I've had cases where `last_map` doesn't update in time.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

The best way is to use an old function called 'addrid'. I've seen someone else here comment that it causes lag, which I have never noticed lag as the command is being called. It may need some work, but I have it working currently as intended so I know it can be made to work. Powerful script command for event situations like yours.

http://www.eathena.ws/board/index.php?showtopic=186459&st=0&start=0

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

i see, the only solution is what Euphy said checking a number of player in the map is good idea..

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

another method....save the data of players who joined the event...and check the data from time to time...during the event..

when the warper warped the users to the event map..add this..

set .Participant$[ getarraysize( .Participant$ ) ],strcharinfo(0);

then add this...

OnPCDieEvent:
if( getarraysize( .Participant$ ) > 1 ){
for( set .@i,0; .@i < getarraysize( .Participant$ ); set .@i,.@i + 1 )
 if( strcharinfo(0) == .Participant$[.@i] )
  deletearray .Participant$[.@i],1;
}else{
if( attachrid( getcharid( 3,.Participant$[.@i] ) ) ){
 getitem 607,1;
 getitem 608,2;
 getitem 512,3;
 announce "LMS Winner : "+.Participant$[.@i],0;
 mapwarp "guild_vs5","prontera",155,181;
}
}
end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

thanks Emistry hope you can edit where to put it.. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

Make sure you check for characters that log out during the event as well with Emistry's method. Otherwise values won't be correctly updated, if someone logs out, and you could have a broken or cheated finish.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Akinari

thx for inform about the logout event...

should be fixed..and proper check for winner...

http://pastebin.com/raw.php?i=3AwaJ9N0

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

thanks. @emistry which part should i put it?

- and what to remove in the script?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

add into the warper npc..and remove the banker...and remove the rest of the part that determine /find for winner ...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@Emistry: You'd need to be careful about the array size limit using that method, since anything over 128 might prevent the script from finding a winner. It also creates a lot of large loops, so you should probably 'freeloop' to be safe.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Euphy

erm..ya...i know about that ... just that...i believe not all event could even have more than 70 ~ 100 player to join...at least i didnt saw this happen in 99% of server out there..

i know some server did have this much of player to join...but..not really happen everytime..

and yes i should add a check on it...just quite lazy to add alot checking stuff while write it in hurry..>.<

  • Upvote 1
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...