Hi guys.. this is my dice event and its working perfectly fine however sometimes when there's only 2 people that joins the event, the npc sometimes pick a number that the players are not choosing,
like if player A choose number 1 and player B choose number 3.
the npc sometimes choose number 4 which makes the dice event no winner at all.
how do i make this script to make sure that there's a winner regarding the numbers of the player
Like if there is 3 player left and 2 people choose number 1 and the other player choose number 4, the NPC should or would make sure that the only number it rolls will only be between 1 and 4 so that there's a definitive winner.
thank you in advance guys.
- script Dice#announcer -1,{
OnInit:
disablenpc "diceevent";
hideonnpc "Dice#evnt1";
end;
OnMinute30:
announce "[Dice Event] : We are going to have a dice event.",0,0x00FFFF;
sleep2 10000;
announce "[Dice Event] : The prize for the winner will be 1 million zeny and 20 event cards.",0,0x00FFFF;
sleep2 10000;
announce "[Dice Event] : For those who wants to join, click the event area warper.",0,0x00FFFF;
sleep2 10000;
announce "[Dice Event] : The portal will close after one minute.",0,0x00FFFF;
sleep2 10000;
announce "[Dice Event] : Proceed to the event area now if you want to join.",0,0x00FFFF;
enablenpc "diceevent";
initnpctimer;
end;
OnTimer30000:
announce "[Dice Event] : Last 30 seconds.",0,0x00FFFF;
sleep2 5000;
announce "[Dice Event] : Please hurry, if you want to join.",0,0x00FFFF;
end;
OnTimer50000:
announce "[Dice Event] : Last 10 seconds.",0,0x00FFFF;
end;
OnTimer55000:
announce "[Dice Event] : 5",0,0x00FFFF;
end;
OnTimer56000:
announce "[Dice Event] : 4",0,0x00FFFF;
end;
OnTimer57000:
announce "[Dice Event] : 3",0,0x00FFFF;
end;
OnTimer58000:
announce "[Dice Event] : 2",0,0x00FFFF;
end;
OnTimer59000:
announce "[Dice Event] : 1",0,0x00FFFF;
end;
OnTimer60000:
announce "[Dice Event] : Time's up.",0,0x00FFFF;
end;
OnTimer61000:
disablenpc "diceevent";
donpcevent "Dice#evnt1::OnEnable";
stopnpctimer;
end;
OnTimer62000:
announce "[Dice Event] : The next dice event will begin later.",0,0x00FFFF;
end;
}
//--------------------------------------------------
poring_c01,111,93,3 script diceevent 546,{
menu "Join",godice,"^ff0000Exit^000000",nodice;
nodice:
close;
godice:
warp "quiz_01",204,90;
end;
}
//--------------------------------------------------
quiz_01,204,93,3 script Dice#evnt1 546,{
//--------------------------------------------------
mes "[ Dice ]";
mes " ";
mes "• ^0000ffInput Name^000000";
next;
input .@desyo$;
if(.@desyo$ != strcharinfo(0)) {
mes "[ Dice ]";
mes "Are you sure that's your character's name?";
close;
}
mes "[ Dice ]";
announce "[Dice Event] : Congratulations to '"+.@desyo$+"' for winning the event.",0,0x00FFFF;
mes "Congratulation on winning";
mes "the event!";
set Zeny,zeny+1000000;
getitem 21017,20; //
next;
warp "poring_c01",108,107;
hideonnpc "Dice#evnt1";
end;
OnEnable:
mapannounce "quiz_01","[Dice Event] : Alright, we are about to start the dice event.",bc_map,0x00FFFF;
sleep2 10000;
mapannounce "quiz_01","[Reminder] : Before anything else, just a quick reminder.",bc_map,0x00FFFF;
sleep2 5000;
mapannounce "quiz_01","[Reminder] : When choosing a number, make sure that you are inside the BOX. otherwise you will be disqualifed immediately!",bc_map,0x00FFFF;
sleep2 10000;
mapannounce "quiz_01","[Dice Event] : Alright, let's play the game.",bc_map,0x00FFFF;
sleep2 10000;
goto L_Start2;
end;
L_Start2:
if(getmapusers("quiz_01") == 1) goto L_Champ;
if(getmapusers("quiz_01") == 0) goto L_None;
if(getmapusers("quiz_01") > 1) {
mapannounce "quiz_01","(*Rolling the DICE*). . . . .",bc_map,0x00FFFF;
set $@number, rand(1,4);
sleep2 10000;
mapannounce "quiz_01","[Dice Event] : I have a number now, Please go to the box number you want.",bc_map,0x00FFFF;
sleep2 10000;
mapannounce "quiz_01","[Dice Event] : 5",bc_map,0x00FFFF;
sleep2 5000;
mapannounce "quiz_01","[Dice Event] : 4",bc_map,0x00FFFF;
sleep2 4000;
mapannounce "quiz_01","[Dice Event] : 3",bc_map,0x00FFFF;
sleep2 3000;
mapannounce "quiz_01","[Dice Event] : 2",bc_map,0x00FFFF;
sleep2 2000;
mapannounce "quiz_01","[Dice Event] : 1",bc_map,0x00FFFF;
sleep2 1000;
mapannounce "quiz_01","[Dice Event] : Time's up.",bc_map,0x00FFFF;
donpcevent "evnt#1::OnEnable";
mapannounce "quiz_01","[Dice Event] : The winning number is "+$@number+".",bc_map,0x00FFFF;
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,60,"poring_c01",106,96;
areawarp "quiz_01",195,81,203,60,"poring_c01",106,96;
areawarp "quiz_01",207,81,215,60,"poring_c01",106,96;
goto L_Start2;
end;
L_Lose2:
areawarp "quiz_01",183,81,191,60,"poring_c01",106,96;
areawarp "quiz_01",195,81,203,60,"poring_c01",106,96;
areawarp "quiz_01",219,81,227,60,"poring_c01",106,96;;
goto L_Start2;
end;
L_Lose3:
areawarp "quiz_01",183,81,191,60,"poring_c01",106,96;
areawarp "quiz_01",207,81,215,60,"poring_c01",106,96;
areawarp "quiz_01",219,81,227,60,"poring_c01",106,96;
goto L_Start2;
end;
L_Lose4:
areawarp "quiz_01",195,81,203,60,"poring_c01",106,96;
areawarp "quiz_01",207,81,215,60,"poring_c01",106,96;
areawarp "quiz_01",219,81,227,60,"poring_c01",106,96;
goto L_Start2;
end;
L_Champ:
mapannounce "quiz_01","[Dice Event] : Well done, please come here and tell me your name.",bc_map,0x00FFFF;
hideoffnpc "Dice#evnt1";
end;
L_None:
announce "[Dice Event] : The event has ended, nobody wins.",0,0x00FFFF;
hideonnpc "Dice#evnt1";
end;
}
- script evnt#1 -1,{
OnEnable:
areawarp "quiz_01",182,94,228,88,"poring_c01",106,96;
areawarp "quiz_01",185,87,188,82,"poring_c01",106,96;
areawarp "quiz_01",197,87,200,82,"poring_c01",106,96;
areawarp "quiz_01",209,87,212,82,"poring_c01",106,96;
areawarp "quiz_01",221,87,224,82,"poring_c01",106,96;
end;
}
// -- Mapflags
quiz_01 mapflag nowarp
quiz_01 mapflag nowarpto
quiz_01 mapflag noteleport
quiz_01 mapflag nosave
quiz_01 mapflag nomemo
quiz_01 mapflag nobranch
quiz_01 mapflag noloot
quiz_01 mapflag noskill
quiz_01 mapflag nopenalty
Question
caspa
Hi guys.. this is my dice event and its working perfectly fine however sometimes when there's only 2 people that joins the event, the npc sometimes pick a number that the players are not choosing,
like if player A choose number 1 and player B choose number 3.
the npc sometimes choose number 4 which makes the dice event no winner at all.
how do i make this script to make sure that there's a winner regarding the numbers of the player
Like if there is 3 player left and 2 people choose number 1 and the other player choose number 4, the NPC should or would make sure that the only number it rolls will only be between 1 and 4 so that there's a definitive winner.
thank you in advance guys.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.