Dice Event 3x

Hadeszeus

New member
Messages
651
Points
0
Location
Philippines
Can someone help me to loop this Dice event 3x? 

The Idea is if there is a winner count 15 seconds to claim the price else the winner will warp back without getting the prize and start the 2 and 3 dice. 

 
Code:
//##########################################################################//By: ____                    _      __        __           ____    _____  #//   |       ___ __    __ _ | |            / /_  _   _  / ___  / ____| #//   | ||  | / _    / /| || |           / /| ||  | || | ___ | (___   #//   | ||  ||  __/  / / | || |__      // / | ||  | || |___| ___   #// __|____/_____|____/__|_||____|______/_/__|_||_|__|______/_____) | #//|_____________________________________________________________________/  #//                                                                         #//##########################################################################//                                                                         #//== Dice Event                                                            #//                                                                         #//##########################################################################//                                                                         #//== Automatically starts a dice event every 30 minutes of every hour      #//                                                                         #//== Prize- Change 13723 to any item ID you want the winner to recieved    #//                                                                         #                                         // Code Modify by : WordsUp// Credit still for mAisakaTaiga                                //##########################################################################-    script    Dice#announcer    -1,{OnInit:        disablenpc "prtevent";        hideonnpc "Dice#evnt1";        end;OnClock2141:        announce "Dice Guru: We are going to have a Dice event.",0;        sleep2 10000;        announce "Dice Guru: For those who wants to join, Please proceed Prontera 161 , 179 and enter the Warp Portal.",0;        sleep2 10000;        announce "Dice Guru: After 1 Minute the Portal will close.",0;        sleep2 10000;        announce "Dice Guru: So please go to Prontera 161 , 179 and enter the Warp Portal now if you want to join.",0;        enablenpc "prtevent";        initnpctimer;        end;OnTimer30000:        announce "Dice Guru: Last 30 seconds.",0;        sleep2 5000;        announce "Dice Guru: If you want to join please enter the Warp Portal in Prontera City 109 ,96.",0;        end;       OnTimer50000:        announce "Dice: Last 10 seconds.",0;        end;       OnTimer55000:        announce "Dice: 5.",0;        end;       OnTimer56000:        announce "Dice: 4.",0;        end;       OnTimer57000:        announce "Dice: 3.",0;        end;       OnTimer58000:        announce "Dice: 2.",0;        end;       OnTimer59000:        announce "Dice: 1.",0;        end;       OnTimer60000:        announce "Dice: Time's up.",0;        end;       OnTimer61000:        disablenpc "prtevent";        donpcevent "Dice#evnt1::OnEnable";        stopnpctimer;        end;              //--------------------------------------------------       prontera,109,97,0    warp    prtevent    2,2,quiz_01,204,90            //--------------------------------------------------quiz_01,204,93,6    script    Dice#evnt1    715,{//--------------------------------------------------        mes "[Dice]";        mes "Please tell me your name";        next;        input .@name$;        if(.@name$ != strcharinfo(0)) {                mes "[Dice]";                mes "Are you sure thats your character name?";                close;        }        mes "[Dice]";        mes "Congrats. You've won.";        close2;        announce "Dice: We have a winner, "+.@name$+".",0;        getitem 675,3;        warp "prontera",131,97;        hideonnpc "Dice#evnt1";        end;       OnEnable:        mapannounce "quiz_01","Dice: We are about to start the Dice event.",0;        sleep2 10000;        mapannounce "quiz_01","Dice: You MUST GO INSIDE THE BOX, because if you're caught standing on the stairs you'll be automatically disqualified.",0;        sleep2 10000;        mapannounce "quiz_01","Dice: That's it.. Now let's play...",0;        sleep2 10000;        goto L_Start;        end;       L_Start:        if(getmapusers("quiz_01") == 1) goto L_Champ;        if(getmapusers("quiz_01") == 0) goto L_None;        if(getmapusers("quiz_01") > 1) {        announce "Dice: . . . . .",0;        set $@number, rand(1,4);        sleep2 10000;        announce "Dice: I have a number now. Please go to the box of the number you want.... GO!",0;        sleep2 10000;        announce "Dice: 5",0;        sleep2 5000;        announce "Dice: 4",0;        sleep2 4000;        announce "Dice: 3",0;        sleep2 3000;        announce "Dice: 2",0;        sleep2 2000;        announce "Dice: 1",0;        sleep2 1000;        announce "Dice: Time's up.",0;        donpcevent "evnt#1::OnEnable";        announce "Dice: Winning number "+$@number+".",0;        if(($@number != 1) && ($@number != 2) && ($@number != 3)) goto L_Lose1;        if(($@number != 1) && ($@number != 2) && ($@number != 4)) goto L_Lose2;        if(($@number != 1) && ($@number != 3) && ($@number != 4)) goto L_Lose3;        if(($@number != 2) && ($@number != 3) && ($@number != 4)) goto L_Lose4;        end;        }       L_Lose1:        areawarp "quiz_01",183,81,191,59,"prontera",131,97;        areawarp "quiz_01",195,81,203,59,"prontera",131,97;        areawarp "quiz_01",207,81,215,59,"prontera",131,97;        goto L_Start;        end;L_Lose2:        areawarp "quiz_01",183,81,191,59,"prontera",131,97;        areawarp "quiz_01",195,81,203,59,"prontera",131,97;        areawarp "quiz_01",219,81,227,59,"prontera",131,97;        goto L_Start;        end;       L_Lose3:        areawarp "quiz_01",183,81,191,59,"prontera",131,97;        areawarp "quiz_01",207,81,215,59,"prontera",131,97;        areawarp "quiz_01",219,81,227,59,"prontera",131,97;        goto L_Start;        end;       L_Lose4:        areawarp "quiz_01",195,81,203,59,"prontera",131,97;        areawarp "quiz_01",207,81,215,59,"prontera",131,97;        areawarp "quiz_01",219,81,227,59,"prontera",131,97;        goto L_Start;        end;       L_Champ:        mapannounce "quiz_01","Dice: Come to me and tell me your name.",0;        hideoffnpc "Dice#evnt1";        end;       L_None:        announce "No One Entered the Dice Event. Event Closed",0;        hideonnpc "Dice#evnt1";        end;}       -    script    evnt#1    -1,{OnEnable:        areawarp "quiz_01",182,94,228,88,"prontera",109,97;        areawarp "quiz_01",185,87,188,82,"prontera",109,97;        areawarp "quiz_01",197,87,200,82,"prontera",109,97;        areawarp "quiz_01",209,87,212,82,"prontera",109,97;        areawarp "quiz_01",221,87,224,82,"prontera",109,97;        end;        }
 
Last edited by a moderator:
the problem is

areawarp "quiz_01",183,81,191,59,"prontera",131,97;if the player step in the wrong box, they are immediately warp back to townso how to make 3 rounds when the players is already outside of the map ?

also, although I never play with this event before,

but I think this event will take quite some time to finish depends on how large your server is

if there are many players who are very lucky to keep guessing right number, how long will the player have to wait for the next round ?

because this event will keep going on until 1 player left

 
Last edited by a moderator:
You mean 3 consecutive rounds?

What you can do is warp all the losing players in a waiting area and warp them back when the next round starts but like Annie said this event will take time to finish.

 
Last edited by a moderator:
the problem is

areawarp "quiz_01",183,81,191,59,"prontera",131,97;if the player step in the wrong box, they are immediately warp back to townso how to make 3 rounds when the players is already outside of the map ?

also, although I never play with this event before,

but I think this event will take quite some time to finish depends on how large your server is

if there are many players who are very lucky to keep guessing right number, how long will the player have to wait for the next round ?

because this event will keep going on until 1 player left
so how to make 3 rounds when the players is already outside of the map ?  - You are correct. That's why I need to make sure that all players including the winner are already warp back outside the quiz_01.  Then, when all are outside the game will start again for second round. 

That's were the 10 secs count down occur to get the rewards inside the event map (quiz_01) before the winner warp outside. By doing this the event will force to continue the 2nd and 3rd.

I believe the counting and the trigger to LOOP the script will start in the code below.

announce "Dice: We have a winner, "+.@name$+".",0; getitem 675,3; warp "prontera",131,97; hideonnpc "Dice#evnt1"; end;







You mean 3 consecutive rounds?

What you can do is warp all the losing players in a waiting area and warp them back when the next round starts but like Annie said this event will take time to finish.
Yes 3 consecutive rounds and yes 2nd and 3rd rounds only start when all the players are outside the event map.

 
Try this: http://upaste.me/6d04105897060cd9b

I tested it and everything seems fine.
default_biggrin.png


Let me know if it works for you. 

 
Last edited by a moderator:
Try this: http://upaste.me/6d04105897060cd9b

I tested it and everything seems fine.
default_biggrin.png


Let me know if it works for you. 
Tested it and works like a charm. Thanks bro!
default_smile.png


The only down side of this is other players who didn't enter or late to enter the event has no chance. 

If you can open again the portal so everyone can enter for round 2 and 3 instead of using mapwarp.

also, what if the players didn't get the prize.

But over all good job bro! Appreciate it!

 
Last edited by a moderator:
 
Try this: http://upaste.me/6d04105897060cd9b

I tested it and everything seems fine. 
default_biggrin.png


Let me know if it works for you. 
Tested it and works like a charm. Thanks bro! 
default_smile.png


The only down side of this is other players who didn't enter or late to enter the event has no chance. 

If you can open again the portal so everyone can enter for round 2 and 3 instead of using mapwarp.

also, what if the players didn't get the prize.

But over all good job bro! Appreciate it!

How about creating a portal going to waiting area and it will stay open until 3 rounds are done?

Players not getting the prize? What do you mean?

 
Last edited by a moderator:
How about creating a portal going to waiting area and it will stay open until 3 rounds are done? - Yeah thats okay.

Players not getting the prize? What do you mean? - I mean what if the WINNER didn't get the prize intentionally to delay the event? There should be a 10 to 15 seconds timer to get the prize else? winner will be warp back to waiting area and never get the prize. then round 2 should continue and 3.

 
Last edited by a moderator:
On this line:

How warp all players outside (quiz_01).

L_Champ:mapannounce "quiz_01","Dice: Come to me and tell me your name.",0;hideoffnpc "Dice#evnt1";end;

I tried this and got error script_rid2sd: fatal error ! player not attached.

Code:
if(getmapusers("quiz_01") == 1) {        mapwarp "quiz_01","prontera",132,97;
 
Last edited by a moderator:
Sorry bro there's a bug on the timer part. But I tried to fixed it and it didn't work.. 

Anyway I got this script from eAthena. The script is pretty old http://www.eathena.ws/board/index.php?showtopic=207896&view=findpost&p=1150077

prontera,168,179,3 script Event Master::evntmst 946,{ // config ----------------------------------- set .evt_reward_item,505; set .rtrn_map$,"prontera" set .rtrn_x,155; set .rtrn_y,180; // config ----------------------------------- if(getgmlvl()>=40){ mes "The dice event is a random panel warping event"; mes "Are you sure you want to start this event?"; if(select("Yes lets start:No thanks")==2)close; mes "Ok starting now"; close2; set $@dice_event,1; announce "A game master has started a dice event",bc_all; sleep2 5000; enablenpc "dc001"; announce "Please speak to the event master to join.",bc_all; sleep2 10000; hideonnpc "dc001"; announce "Ok im starting the event now.",bc_all; donpcevent "dc001::OnEnable"; } else if($@dice_event==1){ mes "There's a Dice event currently active would you like to join?"; if(select("Yes:No")==2)close; close2; warp "quiz_01",204,93; } end;}quiz_01,204,93,6 script Dice::dc001 715,{ if($@dice_event==2&&getusers(0)==1){ mes "[Mr. Dice]"; mes "Congrats. You've won."; getitem getvariableofnpc(.evt_reward_item,"evntmst"),rand(1,20); close2; announce "We have a winner! well done "+strcharinfo(0)+".",0; set $@dice_event,0; warp getvariableofnpc(.rtrn_map$,"evntmst"),getvariableofnpc(.rtrn_x,"evntmst"),getvariableofnpc(.rtrn_y,"evntmst"); disablenpc "dc001"; } end;OnEnable: setarray .@talking$[0],"We are about to start the Dice event." ,"But before we start the event here's how to play the game..." ,"I'm only gonna say this once so read carefully." ,"I'm going to roll a number, 1 to 4. Then I'll do a count down from 5 to 0." ,"All you have to do is go stand on the box of the number you want." ,"For example, If I roll a number 4, All the players standing on numbers 1 to 3 will be warped back to town." ,"We will do it until we only have 1 player left on the map." ,"Oh yeah! Before I forget you MUST GO INSIDE THE BOX, because if you're caught standing on the stairs you'll be automatically disqualified." ,"Simple huh?.. Let's play..."; while(.@i<10){ mapannounce "quiz_01",.@talking$[.@i],0; set .@i,.@i+1; sleep2 7000-(100*.@i);} if(getmapusers("quiz_01")>1)set $@dice_event,3; while($@dice_event==3) { if(getmapusers("quiz_01") == 1){ mapannounce "quiz_01","Your the only one left, come and claim your prize",0; set $@dice_event,2; hideoffnpc "dc001"; end;} else if(getmapusers("quiz_01") == 0){ set $@dice_event,0; disablenpc "dc001"; end;} set .@number, rand(1,4); mapannounce "quiz_01","I have rolled. Please pick a number and go stand there.... GO!",0; sleep2 13000; set .@i,10; while(.@i>0) { mapannounce "quiz_01",.@i,0; sleep2 1000; set .@i,.@i-1;} mapannounce "quiz_01","Time's up.",0; donpcevent "dc001::OnReEnable"; mapannounce "quiz_01","Box Numer "+.@number+" survived the warp.",0; switch(.@number){ case 1: callsub L_motion,1,0,1,1; break; case 2: callsub L_motion,1,1,0,1; break; case 3: callsub L_motion,0,1,1,1; break; case 4: callsub L_motion,1,1,1,0; break; } } mapannounce "quiz_01","There needs to be more than one person to start this event",0; set $@dice_event,0; disablenpc "dc001"; end;L_motion: if(getarg(0)==1)areawarp "quiz_01",195,81,203,59,getvariableofnpc(.rtrn_map$,"evntmst"),getvariableofnpc(.rtrn_x,"evntmst"),getvariableofnpc(.rtrn_y,"evntmst"); if(getarg(1)==1)areawarp "quiz_01",183,81,191,59,getvariableofnpc(.rtrn_map$,"evntmst"),getvariableofnpc(.rtrn_x,"evntmst"),getvariableofnpc(.rtrn_y,"evntmst"); if(getarg(2)==1)areawarp "quiz_01",207,81,215,59,getvariableofnpc(.rtrn_map$,"evntmst"),getvariableofnpc(.rtrn_x,"evntmst"),getvariableofnpc(.rtrn_y,"evntmst"); if(getarg(3)==1)areawarp "quiz_01",219,81,227,59,getvariableofnpc(.rtrn_map$,"evntmst"),getvariableofnpc(.rtrn_x,"evntmst"),getvariableofnpc(.rtrn_y,"evntmst"); return;OnReEnable: areawarp "quiz_01",182,94,228,88,"prontera",155,182; areawarp "quiz_01",185,87,188,82,"prontera",155,182; areawarp "quiz_01",197,87,200,82,"prontera",155,182; areawarp "quiz_01",209,87,212,82,"prontera",155,182; areawarp "quiz_01",221,87,224,82,"prontera",155,182; end;}


I'm trying to make it work for Hercules without using NPC to enable the event.

And I come up with this. 

- script Dice#announcer -1,{ OnInit: disablenpc "prtevent"; disablenpc "prtevent2"; hideonnpc "Dice#dc001"; end; OnClock0643: announce "Dice Guru: We are going to have a Dice event.",0,0x66AAFF, 0x190, 26; sleep2 1000; announce "Dice: For those who wants to join, Please proceed Prontera 161 , 179 and enter the Warp Portal.",0; sleep2 1000; announce "Dice: After 1 Minute the Portal will close.",0; sleep2 1000; announce "Dice: So please go to Prontera 161 , 179 and enter the Warp Portal now if you want to join.",0; enablenpc "prtevent"; initnpctimer; end; OnTimer3000: announce "Dice: Last 30 seconds.",0; //sleep2 5000; announce "Dice: If you want to join please enter the Warp Portal in Prontera 155 , 179.",0; end; OnTimer5000: announce "Dice: Last 10 seconds.",0; end; OnTimer5500: announce "Dice: 5.",0; end; OnTimer5600: announce "Dice: 4.",0; end; OnTimer5700: announce "Dice: 3.",0; end; OnTimer5800: announce "Dice: 2.",0; end; OnTimer5900: announce "Dice: 1.",0; end; OnTimer6000: announce "Dice: Time's up.",0; end; OnTimer6100: disablenpc "prtevent"; donpcevent "Dice#dc001::OnEnable"; stopnpctimer; end; } //-------------------------------------------------- prontera,109,97,0 warp prtevent 2,2,quiz_01,204,90 prontera,109,97,0 warp prtevent2 2,2,quiz_01,204,90 //--------------------------------------------------quiz_01,204,93,6 script Dice#dc001 715,{//--------------------------------------------------OnInit: set .evt_reward_item,505; set .rtrn_map$,"prontera"; set .rtrn_x,113; set .rtrn_y,97; set $@dice_event,1; end; if($@dice_event==2&&getusers(0)==1){ mes "[Mr. Dice]"; mes "Congrats. You've won."; getitem .evt_reward_item,rand(1,20); close2; announce "We have a winner! well done "+strcharinfo(0)+".",0; set $@dice_event,0; warp .rtrn_map$,.rtrn_x,.rtrn_y; disablenpc "Dice#dc001"; } end; OnEnable: setarray .@talking$[0],"We are about to start the Dice event." ,"But before we start the event here's how to play the game..." ,"I'm only gonna say this once so read carefully." ,"I'm going to roll a number, 1 to 4. Then I'll do a count down from 5 to 0." ,"All you have to do is go stand on the box of the number you want." ,"For example, If I roll a number 4, All the players standing on numbers 1 to 3 will be warped back to town." ,"We will do it until we only have 1 player left on the map." ,"Oh yeah! Before I forget you MUST GO INSIDE THE BOX, because if you're caught standing on the stairs you'll be automatically disqualified." ,"Simple huh?.. Let's play..."; while(.@i<10){ mapannounce "quiz_01",.@talking$[.@i],0; set .@i,.@i+1; sleep2 7000-(100*.@i);} if(getmapusers("quiz_01")>1) set $@dice_event,3; while($@dice_event==3) { if(getmapusers("quiz_01") == 1){ mapannounce "quiz_01","Your the only one left, come and claim your prize",0; set $@dice_event,2; hideoffnpc "Dice#dc001"; end;} else if(getmapusers("quiz_01") == 0){ set $@dice_event,0; disablenpc "Dice#dc001"; end;} set .@number, rand(1,1); mapannounce "quiz_01","I have rolled. Please pick a number and go stand there.... GO!",0; sleep2 13000; set .@i,10; while(.@i>0) { mapannounce "quiz_01",.@i,0; sleep2 1000; set .@i,.@i-1;} mapannounce "quiz_01","Time's up.",0; donpcevent "Dice#dc002::OnEnable"; mapannounce "quiz_01","Box Numer "+.@number+" survived the warp.",0; switch(.@number){ case 1: callsub L_motion,1,0,1,1; break; case 2: callsub L_motion,1,1,0,1; break; case 3: callsub L_motion,0,1,1,1; break; case 4: callsub L_motion,1,1,1,0; break; } } mapannounce "quiz_01","There needs to be more than one person to start this event",0; set $@dice_event,0; disablenpc "Dice#dc001"; end;L_motion: if(getarg(0)==1)areawarp "quiz_01",195,81,203,59,.rtrn_map$,.rtrn_x,.rtrn_y; if(getarg(1)==1)areawarp "quiz_01",183,81,191,59,.rtrn_map$,.rtrn_x,.rtrn_y; if(getarg(2)==1)areawarp "quiz_01",207,81,215,59,.rtrn_map$,.rtrn_x,.rtrn_y; if(getarg(3)==1)areawarp "quiz_01",219,81,227,59,.rtrn_map$,.rtrn_x,.rtrn_y; return;} - script Dice#dc002 -1,{ OnEnable: areawarp "quiz_01",182,94,228,88,"prontera",131,97; areawarp "quiz_01",185,87,188,82,"prontera",131,97; areawarp "quiz_01",197,87,200,82,"prontera",131,97; areawarp "quiz_01",209,87,212,82,"prontera",131,97; areawarp "quiz_01",221,87,224,82,"prontera",131,97; end;} 

But the problem is, my client crash after this line.

while(.@i<10){ mapannounce "quiz_01",.@talking$[.@i],0; set .@i,.@i+1; sleep2 7000-(100*.@i);}

Kindly help me fixed this.. Thanks!

 
Last edited by a moderator:
I'm not sure what's causing the problem. I tried your code and yes my client froze after that line.

 
how come both of you client can freeze ?

screenHercules009.jpg

I'm trying to make it work for Hercules without using NPC to enable the event.

And I come up with this.

...

But the problem is, my client crash after this line.

Code:
while(.@i<10){mapannounce "quiz_01",.@talking$[.@i],0;set .@i,.@i+1;sleep2 7000-(100*.@i);}
Kindly help me fixed this.. Thanks!
using hercules of course
 
Last edited by a moderator:
Nyay! Thats the question.. How come.. Are you using the latest rev?? How would I know the problem if theres no error in map server.. Im using 30140115 client...

 
Im using 30140115 client...
back from the future !
default_biggrin.png
how come your client is 1000 years ahead of us ?

.

.

anyways, yes I just update to use latest client, and I also crash

.

.

simple

prontera,156,184,5 script kjdhfksdjf 100,{ announce "", bc_all; end;}click this npceveryone gonna crash

you cannot announce something with empty string

.

.

.

while(.@i<10){ mapannounce "quiz_01",.@talking$[.@i],0; set .@i,.@i+1; sleep2 7000-(100*.@i);}change into
Code:
	while ( .@i < getarraysize( .@talking$ ) ){		mapannounce "quiz_01",.@talking$[.@i],0;		set .@i,.@i+1;		sleep2 7000-(100*.@i);	}
the .@talking$ array only has 9 elements, but you did while(.@i<10), means send 1 announcement as empty stringcaused everyone in the map to crash their clients

 
Last edited by a moderator:
Hi Annie,

Upon testing I got this error in map-server, when claiming the price. 

I'm suspecting this line. if($@dice_event == 2 && getusers(0)== 1){


errordice.png

 
nah ...

Code:
    mapannounce "quiz_01","I have rolled. Please pick a number and go stand there.... GO!",0;    sleep2 13000;    set .@i,10;    while(.@i>0) {    mapannounce "quiz_01",.@i,0; // <-- here    sleep2 1000;
change into
Code:
    mapannounce "quiz_01","I have rolled. Please pick a number and go stand there.... GO!",0;    sleep2 13000;    set .@i,10;    while(.@i>0) {    mapannounce "quiz_01",.@i+"",0; // <-- here    sleep2 1000;
 
Working fine without error. 

BUT still I can't talk to NPC after winning. Even I click it no error message in Map server.

Looks like this line is not working

Code:
      if($@dice_event == 2 && getusers(0)== 1){        mes "[Mr. Dice]";        mes "Congrats. You've won.";        getitem .evt_reward_item,rand(1,20);        close2;        announce "We have a winner! well done "+strcharinfo(0)+".",0;        set $@dice_event,0;        warp .rtrn_map$,.rtrn_x,.rtrn_y;        disablenpc "Dice#dc001";    }    end;
 
Back
Top