Jump to content

  •  

Photo

Disguise Event


This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 RyokoMVP

RyokoMVP

    Marin

  • Members
  • PipPipPipPipPip
  • 204 posts

Posted 19 January 2012 - 05:50 AM

helo , sorry for ask again :) i have problem with this script

[codebox]/*==============================================================================//
//--- Script By Masao ----------------------------------------------------------//
//--- Disguise Event NPC -------------------------------------------------------//
//--- Ver: Suram ---------------------------------------------------------------//
//==============================================================================*/

comodo,0,0,0 script DisguiseAnnouncer -1,{
OnWhisperGlobal:
if(getgmlevel()<99){end;}
OnClock0100:
OnClock0200:
OnClock0300:
OnClock0500:
OnClock0600:
OnClock0700:
OnClock0800:
OnClock0900:
OnClock1000:
OnClock1100:
OnClock1200:
OnClock1300:
OnClock1400:
OnClock1500:
OnClock1600:
OnClock1700:
OnClock1800:
OnClock1900:
OnClock2000:
OnClock2100:
OnClock2200:
OnClock2300:
set $@startdisguise,1;
l_remake:
set $@Monster,1000+rand(1,200);
if($@Monster == 1003 || $@Monster == 1006 || $@Monster == 1017 || $@Monster == 1021 || $@Monster == 1027 || $@Monster == 1043 || $@Monster == 1136 || $@Monster == 1137 || $@Monster == 1168 || $@Monster == 1171 || $@Monster == 1172 || $@Monster == 1173 || $@Monster == 1181){ goto l_remake; }
set $MonsterName$,getmonsterinfo($@Monster,0);
setnpcdisplay "Disguise Event",$@Monster;
set $@startdisguise,1;
announce "The [Disguise Event] starts now in Comodo!",0;
initnpctimer;
end;
}

comodo,214,151,4 script Disguise Event 795,{

set .@npcname$,"[^0000FFDisguise NPC^000000]";

if (getgmlevel() >= 90) goto DisguiseAdmin;
if ($@startdisguise==1) goto l_disguise;

mes .@npcname$;
mes "Hi, how can i help you?";
next;
menu "How does it work?",-,"Cancel.",Nothing;

mes .@npcname$;
mes "This is an very easy Event.";
mes "At the beginning of the Event i will disguise myself into a randomly chosen Monster.";
mes "After i've done that, you've to put the correct Name into the Box.";
next;
mes "If the name was correct, you win a Prize! if it was wrong, just try again /shy";
mes "And that's it! Good luck.";
close;

Nothing:
close;

DisguiseAdmin:

mes .@npcname$;
mes "^FF0000~Hi GM " + strcharinfo(0) + ", what can i do for you?~^000000";
switch(select("Start Event:End Event:Check Prize:Set Prizes:Rounds:Nothing")) {

case 1:
next;
mes .@npcname$;
mes "Would you like to start the Event now?";
switch(select("Yes:No")) {

case 1:
set $@Monster,1000+rand(1,200);
set $MonsterName$,getmonsterinfo($@Monster,0);
setnpcdisplay "Disguise Event",$@Monster;
set $@startdisguise,1;
announce "The [Disguise Event] starts now in Comodo!",0;
close;

case 2:
mes .@npcname$;
mes "Ok, bye.";
close;
}

case 2:
next;
mes .@npcname$;
mes "Would you like to End the Event now?";
switch(select("Yes:No")) {

case 1:
setnpcdisplay "Disguise Event",795;
set $@Round,0;
set $@startdisguise,0;
announce "The [Disguise Event] has been ended by an GM! There will be no prizes!",0;
close;

case 2:
mes .@npcname$;
mes "Ok, bye.";
close;
}

case 3:
mes .@npcname$;
mes "^FF0000~The current winning Prize is ^000000 ^008000"+ $prize_item_amount +" "+ getitemname($prize_item_id) +".^000000";
next;
goto disguiseadmin;

case 4:
mes .@npcname$;
mes "^FF0000~What should the Prize be? Please insert the Item ID.~^000000";
input $prize_item_id;
next;
mes .@npcname$;
mes "^FF0000~Now the amount?~^000000";
input $prize_item_amount;
mes .@npcname$;
mes "^FF0000~So, the Prize is^000000 ^008000"+ $prize_item_amount +" "+ getitemname($prize_item_id) +"^000000? ^FF0000Great.~^000000";
emotion 33;
next;
goto disguiseadmin;

case 5:
mes .@npcname$;
mes "Here you can set how many Rounds will be played each time the Event Starts";
input $@Rounds;
mes "^FF0000~So, there will be ^FF0000"+ $Rounds +" Rounds played.^000000";
next;
goto disguiseadmin;

case 6:
mes .@npcname$;
mes "Ok, bye.";
close;
}

l_disguise:
input .@MonsterInput$;
if ($@disguisewin==1) {
mes "Someone already won this Round!!";
close;
}
if(.@MonsterInput$==$MonsterName$) goto Correct;
if(.@MonsterInput$!=$MonsterName$) goto Nothing;
end;

OnTimer30000:
stopnpctimer;
setnpctimer 0;
npctalk "Too Late, Time Out !";
set $@Round,$@Round+1;
if($@round>=$rounds)goto l_gameover;
goto l_round;
end;

Correct:
stopnpctimer;
setnpctimer 0;
announce ""+strcharinfo(0)+" is correct! I was disguised as: "+$MonsterName$+"",bc_map;
mapannounce "comodo","Disguise Event: "+strcharinfo(0)+" won the Disguise Event! He won a "+ $prize_item_amount +" "+getitemname($prize_item_id)+" !",0;
getitem $prize_item_id,$prize_item_amount;
set $@Round,$@Round+1;
set $@disguisewin,1;
sleep2 3000;
if($@round>=$rounds)goto l_gameover;
goto l_round;
end;

l_round:
set $@Monster,1000+rand(1,200);
if($@Monster == 1003 || $@Monster == 1006 || $@Monster == 1017 || $@Monster == 1021 || $@Monster == 1027 || $@Monster == 1043 || $@Monster == 1136 || $@Monster == 1137 || $@Monster == 1168 || $@Monster == 1171 || $@Monster == 1172 || $@Monster == 1173 || $@Monster == 1181){ goto l_round; }
set $MonsterName$,getmonsterinfo($@Monster,0);
set $@disguisewin,0;
setnpcdisplay "Disguise Event",$@Monster;
initnpctimer;
end;

l_gameover:
setnpcdisplay "Disguise Event",795;
set $@Round,0;
set $@startdisguise,0;
set $@disguisewin,0;
npctalk "Thank you all for playing. That was the last round of the Disguise Event. See you next time.";
end;
}

- script EDDisguiseAnnouncer -1,{
OnClock2202:
announce "Disguise Event : Wah , Ayam Sama Cowo Maho Uda Pamit~ Gua Ikutan Pamit AH....Bye2 aLL~",bc_all;
disablenpc "Disguise Event";
end;
OnClock0902:
announce "Disguise Event : Wah Uda Pagi Ayam & Cowo Maho Juga Udah Panggil2~ Saatnya Saya Kerja Kembali, Morning All",bc_all;
enablenpc "Disguise Event";
end;
}[/codebox]

1. when i set 10 rounds~ sometimes it's will end at 1-2 rounds
2. sometimes , if i set 10 rounds , it's will be more than 10 rounds
3. how to make this script will auto disguise again if no one can't answer in 30 second or more ?

thanks for help me ^^

Edited by Arcenciel, 19 January 2012 - 09:36 AM.
Codeboxed


#2 Emistry

Emistry

    ▬▬▬ E M I S T R Y ▬▬▬

  • Global Moderators
  • 6886 posts

User's Awards

     

Posted 20 January 2012 - 10:09 AM

in your script...i guess it is because of the letter inside the variable that caused this problem....

i found that there are variable look like this..
$@Round
and
$@round


try fix it into the same...( follow the capital letter usage as well )

and there is surely error in your script also...
such as...
if( $@round>=$rounds )

and to ensure the correct round for the event...make sure your other npc script didnt using the same variable that you have used in this Disguise Event Scripts