From f376988cedf2da4529d95317f3b5f73a38dfa5f9 Mon Sep 17 00:00:00 2001 From: AnnieRuru Date: Mon, 14 Jan 2019 03:22:24 +0800 Subject: Fix a bug that causes the event to run indefinitely - the .RoundCount only increase when having players answer correctly if nobody playing this event, or players give up before .Rounds(10) rounds, it will continue run forever --- npc/custom/events/disguise.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/npc/custom/events/disguise.txt b/npc/custom/events/disguise.txt index b9071d162..fde5e544a 100644 --- a/npc/custom/events/disguise.txt +++ b/npc/custom/events/disguise.txt @@ -8,6 +8,7 @@ //= Note: This script requires PCRE to run properly. //= 5.0 Last update by GmOcean. //= 5.1 Cleaned and standardized, mostly. [Euphy] +//= 5.2 Fix a bug that causes this event run indefinitely [AnnieRuru] //============================================================ prontera,160,155,4 script Disguise Event 4_M_NFDEADMAN,{ @@ -183,6 +184,15 @@ OnTimer30000: deletepset 1; stopnpctimer; setnpctimer 0; + ++.RoundCount; + if (.RoundCount >= .Rounds) { + setnpcdisplay "Disguise Event", 4_M_NFDEADMAN; + .RoundCount = 0; + .Change = 0; + .EventON = 0; + npctalk "Thank you all for playing. That was the last round of the Disguise Event. Come play again later."; + end; + } initnpctimer; end; OnTimer60000: -- cgit v1.2.3-60-g2f50