Jump to content
  • 0

Disguise event script help


Question

9 answers to this question

Recommended Posts

  • 0
Posted (edited)
17 minutes ago, vilkhl said:

Hi, how can I make the event runs only for 40mins? here's my current script that im using.

 

disguise.txt

change

OnClock0200:
OnClock0800:
OnClock1400:
OnClock2000:

to

OnMinute40:

 

Edited by maken06
  • 0
Posted
6 minutes ago, maken06 said:

change


OnClock0200:
OnClock0800:
OnClock1400:
OnClock2000:

to


OnMinute40:

 

so if using this,event will start every 40mins right? if that so, the event will clash with my other event script. I set onclock because want every event runs 1 by 1 sir

  • 0
Posted
12 minutes ago, maken06 said:

organize the hours of the events so that they do not collide

I mean sir,the event duration..for example, disguise event has started. and I want that event runs only for 40mins. after 40mins with or without participants, the event will automatically ends.

  • 0
Posted
25 minutes ago, vilkhl said:

I mean sir,the event duration..for example, disguise event has started. and I want that event runs only for 40mins. after 40mins with or without participants, the event will automatically ends.

set .Rounds,5;

specifies how many rounds the event should last.

  • 0
Posted
OnClock0240:
OnClock0840:
OnClock1440:
OnClock2040:
	setnpcdisplay "Disguise Event",795;
	set .RoundCount,0; set .Change,0; set .EventON,0;
	setnpctimer 0; stopnpctimer;
	npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
	disablenpc "Disguise Event";
	announce "The Disguise Event has ended",bc_all | bc_blue;
	end;
	

you could add this part into your script.

  • 0
Posted (edited)

I made a little modify in my Disguise Event script. all worked as I wanted. but 1 problem is, when the event's triggered by OnClock that i setted, how to make the event's duration runs only for 40mins or automatically stop/end if no participants joined? current script now is when triggered, it never stop if no participants joined and can't be triggered again on next OnClock. im much appreciated with your help and here's my script

disguise.txt

Edited by Emistry
Merged + Hidden duplicated content.
  • Like 1
  • 0
Posted (edited)
18 hours ago, vilkhl said:

I got 1 last request. I made a little modify in my Disguise Event script. all worked as I wanted. but 1 problem is, when the event's triggered by OnClock that i setted, how to make the event's duration runs only for 40mins or automatically stop/end if no participants joined? current script now is when triggered, it never stop if no participants joined and can't be triggered again on next OnClock. im much appreciated with your help and here's my script 

disguise.txt

yes, this script has a bug, good job on pointing this out
this event can only ends when someone ACTUALLY play this event,
the .RoundCount variable only increase when someone answer it right
if nobody ever participate in this event, or players give up after 9 correct guess,  the npc will continue non-stop

instead of ending after 40 minutes, its better to make it stop at exactly 10 rounds (.Rounds), including wrong guesses or nobody actually playing it

change the code under OnTimer30000: into something like this

OnTimer30000:
	if (.Timer) end;
	set .Change,0;
	setnpcdisplay "Disguise Event",795;
	npctalk "Disguise Event : You took too long to guess what I was. Please wait 10 seconds while I disguise again.";
	specialeffect EF_DETECT2;
	set $MonsterName$,"";
	deletepset 1;
	stopnpctimer;
	setnpctimer 0;
	set .RoundCount,.RoundCount+1;
	if (.RoundCount>=.Rounds) {
		setnpcdisplay "Disguise Event",795;
		set .RoundCount,0; set .Change,0; set .EventON,0;
		setnpctimer 0; stopnpctimer;
		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
		end;
	}
	initnpctimer;
	end;

honestly speaking ... the way euphy rewrite this script is still not very optimize ...
if he actually learn to use sleep command, the script will be extremely clean ... I dislike using npc timers because of this reason

Edited by AnnieRuru
  • Upvote 1
  • Love 1
  • 0
Posted
5 hours ago, AnnieRuru said:

yes, this script has a bug, good job on pointing this out
this event can only ends when someone ACTUALLY play this event,
the .RoundCount variable only increase when someone answer it right
if nobody ever participate in this event, or players give up after 9 correct guess,  the npc will continue non-stop

instead of ending after 40 minutes, its better to make it stop at exactly 10 rounds (.Rounds), including wrong guesses or nobody actually playing it

change the code under OnTimer30000: into something like this


OnTimer30000:
	if (.Timer) end;
	set .Change,0;
	setnpcdisplay "Disguise Event",795;
	npctalk "Disguise Event : You took too long to guess what I was. Please wait 10 seconds while I disguise again.";
	specialeffect EF_DETECT2;
	set $MonsterName$,"";
	deletepset 1;
	stopnpctimer;
	setnpctimer 0;
	set .RoundCount,.RoundCount+1;
	if (.RoundCount>=.Rounds) {
		setnpcdisplay "Disguise Event",795;
		set .RoundCount,0; set .Change,0; set .EventON,0;
		setnpctimer 0; stopnpctimer;
		npctalk "Disguise Event : Thank you all for playing. That was the last round of the Disguise Event. Come play again later.";
		end;
	}
	initnpctimer;
	end;

honestly speaking ... the way euphy rewrite this script is still not very optimize ...
if he actually learn to use sleep command, the script will be extremely clean ... I dislike using npc timers because of this reason

thanks Annie. u helped me a lot. all my problem solved. 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...