Jump to content
  • 0

Help with disguise event


HristDead

Question


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Hi again. I'm using Masao's Disguise Event script: http://www.eathena.w...pe=post&id=8504

I'm wondering if someone could make a few changes if possible, I'm a real nub with scripting. :(

change #1:

instead of this:

donpcevent "Disguise Event::OnStart";
announce "The [Disguise Event] starts now!",0;
end;

were the script starts like right away...

I'd like this event to announce it a minute (or 30 seconds) before the event starts, so the players have a little time to get there. Is it possible?

change #2:

then this part:

L_Disguise:
mes .@n$;
mes "Insert the correct Monstername!";
input .@MonsterInput$;
if (.disguisewin == 1) {
mes "Someone already won this Round!!";
close;
}
if(.@MonsterInput$==.MonsterName$) goto L_Correct;
if(.@MonsterInput$!=.MonsterName$) goto L_Cancel;

It doesn't have a timer. The NPC remains in its disguise even after a few minutes. Is it possible to give this like a 10 or 15 seconds timer before it proceeds in his next disguise?

change #3 (not desperately needed but would be nice!) ^^

L_Disguise:
mes .@n$;
mes "Insert the correct Monstername!";
input .@MonsterInput$;

Would it be possible to make it read public chat instead of the input? Like if player types the name in the chat the NPC is able to read it.

Help would be extremely appreciated!

Edited by HristDead
Link to comment
Share on other sites

21 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  03/22/12
  • Last Seen:  

1. Go to NPC Disguise Event then find label OnStart

2.

sleep2 {<milliseconds>};

3.

defpattern <set number>,"<regular expression pattern>","<event label>";
activatepset <set number>;
deactivatepset <set number>;
deletepset <set number>;

Edited by Jellopy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

@ 2:

Like this? It still doesn't work, it instantly disguises as soon as the event starts....

OnStart:
sleep2 30000;
set .Monster,1000+rand(1,323);
set .MonsterName$,getmonsterinfo(.Monster,0);
set .Round,0;
set .disguisewin,0;
set $startdisguise,1;
setnpcdisplay "Disguise Event",.Monster;
end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  03/22/12
  • Last Seen:  

Should be

L_Round:
sleep2 30000;
set .Monster,1000+rand(1,323);
set .MonsterName$,getmonsterinfo(.Monster,0);
set .disguisewin,0;
setnpcdisplay "Disguise Event",.Monster;
close;

and i suggest remove this line because it's useless. (nothing to do with .Disguise_Delay variable)

set .Disguise_Delay,gettimetick(2)+5;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

It's not working sir. :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  03/22/12
  • Last Seen:  

try this

Find:

L_Disguise:

Add after:

if(gettimetick(2) < .Disguise_Delay)
{
 mes .@n$;
 mes "Please wait for next round";
 close;
}

Find:

L_Round:

Replace with:

close2;
set .Disguise_Delay,gettimetick(2)+5;
sleep2 5000;
set .Monster,1000+rand(1,323);
set .MonsterName$,getmonsterinfo(.Monster,0);
set .disguisewin,0;
setnpcdisplay "Disguise Event",.Monster;
close;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Thanks for the efford sir but its still not working. :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  03/22/12
  • Last Seen:  

try full code (i tested with 5 round and it work /hmm )

//===== Athena Script ========================================
//= Disguise Event NPC
//===== By: ==================================================
//= Masao
//===== Current Version: =====================================
//= 2.0
//===== Compatible With: =====================================
//= eAthena SVN
//===== Description: =========================================
//= Disguise Event
//===== Additional Comments: =================================
//= Version 1.0 if there are any Bugs please let me know.
//= Version 1.2 Added Check if someone already guessed the Monster Name.
//= Version 1.5 Fixed so the NPC will display it's originial View ID when the Event ends.
//= Version 2.0 Changed some Global / Temporary Variables into NPC Variables.
//============================================================
- script DisguiseAnnouncer -1,{
OnClock0300:
OnClock0700:
OnClock1100:
OnClock1500:
OnClock1900:
OnClock2300:
donpcevent "Disguise Event::OnStart";
announce "The [Disguise Event] starts now!",0;
end;
}
quiz_02,305,245,4 script Disguise Event 795,{
set .@n$,"[^0000FFDisguise NPC^000000]";
if (getgmlevel() >= 60) goto L_DisguiseAdmin;
if ($startdisguise==1) goto L_Disguise;
mes .@n$;
mes "Hi, how can i help you?";
next;
menu "How does it work?",-,"Cancel.",L_Cancel;
mes .@n$;
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 ";
mes "And that's it! Good luck.";
close;
L_DisguiseAdmin:
mes .@n$;
mes "^FF0000~Hi "+strcharinfo(0)+", what can i do for you?~^000000";
switch(select("Start Event:End Event:Check Prize:Set Prizes:Rounds:Nothing:Player Menu")) {
case 1:
next;
mes .@n$;
mes "Would you like to start the Event now?";
switch(select("Yes:No")) {
 case 1:
  next;
set .Monster,1000+rand(1,323);
set .MonsterName$,getmonsterinfo(.Monster,0);
set .Round,0;
set .disguisewin,0;
set $startdisguise,1;
setnpcdisplay "Disguise Event",.Monster;
announce "The [Disguise Event] starts now!",0;
close;
 case 2:
  next;
  mes .@n$;
  mes "Ok, bye.";
  close;
}
case 2:
next;
mes .@n$;
mes "Would you like to End the Event now?";
switch(select("Yes:No")) {
 case 1:
  next;
set .Monster,0;
set .MonsterName$,"";
set .Round,0;
set .disguisewin,0;
set $startdisguise,0;
setnpcdisplay "Disguise Event",795;
announce "The [Disguise Event] has been ended by an GM! There will be no prizes!",0;
close;  
 case 2:
  next;
  mes .@n$;
  mes "Ok, bye.";
  close;
}
case 3:
next;
mes .@n$;
mes "^FF0000~The current winning Prize is ^000000 ^008000"+$prize_item_amount+" "+getitemname($prize_item_id)+".^000000";
next;
goto L_DisguiseAdmin;
case 4:
next;
mes .@n$;
mes "^FF0000~What should the Prize be? Please insert the Item ID.~^000000";
input $prize_item_id;
next;
mes .@n$;
mes "^FF0000~Now the amount?~^000000";
input $prize_item_amount;
next;
mes .@n$;
mes "^FF0000~So, the Prize is^000000 ^008000"+$prize_item_amount+" "+getitemname($prize_item_id)+"^000000? ^FF0000Great.~^000000";
emotion 33;
next;
goto L_DisguiseAdmin;
case 5:
next;
mes .@n$;
mes "Here you can set how many Rounds will be played each time the Event Starts";
input $Rounds;
next;
mes "^FF0000~So, there will be ^FF0000"+$Rounds+" Rounds played.^000000";
next;
goto L_DisguiseAdmin;

case 6:
next;
mes .@n$;
mes "Ok, bye.";
close;
case 7:
next;
goto L_Disguise;
}
OnStart:
set .Monster,1000+rand(1,323);
set .MonsterName$,getmonsterinfo(.Monster,0);
set .Round,0;
set .disguisewin,0;
set $startdisguise,1;
setnpcdisplay "Disguise Event",.Monster;
end;
L_Disguise:
if(gettimetick(2) < .Disguise_Delay)
{
 mes .@n$;
 mes "Please wait for next round";
 close;
}
mes .@n$;
mes "Insert the correct Monstername!";
input .@MonsterInput$;
if (.disguisewin == 1) {
mes "Someone already won this Round!!";
close;
}
if(.@MonsterInput$==.MonsterName$) goto L_Correct;
if(.@MonsterInput$!=.MonsterName$) goto L_Cancel;
L_Correct:
set .disguisewin,1;
mapannounce "quiz_02",""+strcharinfo(0)+" won! I was disguised as: "+.MonsterName$+"",0;
getitem $prize_item_id,$prize_item_amount;
set .Round,.Round+1;
if (.Round<$Rounds) goto L_Round;
set $startdisguise,0;
setnpcdisplay "Disguise Event",795;
npctalk "Thank you all for playing. That was the last round of the Disguise Event. See you next time.";
close;
L_Round:
close2;
set .Disguise_Delay,gettimetick(2)+5;
sleep2 5000;
set .Monster,1000+rand(1,323);
set .MonsterName$,getmonsterinfo(.Monster,0);
set .disguisewin,0;
setnpcdisplay "Disguise Event",.Monster;
close;
L_Cancel:
close;
}

Edited by Joseph
Codebox-ed.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

I've tried the whole code. Really not working for me. =[

Monster doesnt re-disguise and event still starts right away.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   0
  • Joined:  03/22/12
  • Last Seen:  

I've tried the whole code. Really not working for me. =[

Monster doesnt re-disguise and event still starts right away.

have any error on map-server ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

No error at all. it's like nothing changed compared to the authors original version

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Cannot click the NPC. >.<

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

Its working for me.

Map server showing any errors?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

The map server is not showing errors and the event starts just fine, but the NPC isn't clickable and doesn't disguises at all, it just broadcasts every few seconds "no one knew the answer" while he didnt disguise.

Edited by HristDead
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

Try @reloadscript.

And btw, players just have to write out the answer without clicking it.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Done that, not clickable and the NPC doesn't disguise.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

Probably you have NPCs with the same name.

http://upaste.me/58fd957ade0615f

If its still the same, try the default one.

https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/npc/custom/events/disguise.txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

I've tried that one but it doesn't work thats why I went with Masao's.

Same story, NPC isn't clickable, maybe my revision isn't reading the functions properly or something...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

i think you have error on pcre.! [ defpattern ]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

i think you have error on pcre.! [ defpattern ]

I don't know, and i figured it's not just this script.

It's every disguise script including the one by GmOcean one that comes with the latest rAthena.

I wonder why Masao's works though...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

open the disguise then check the mapserver if there's a error!

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