summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-25 00:38:24 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-25 00:38:24 -0300
commit52b7971f12a526bb0529a16e11865100b29d8a6c (patch)
tree77dede567252df9166ffa6dc4da87c57701bf05b /npc
parent6dfeb56b6444da449ebb8188c479b77be8064a9a (diff)
downloadserverdata-52b7971f12a526bb0529a16e11865100b29d8a6c.tar.gz
serverdata-52b7971f12a526bb0529a16e11865100b29d8a6c.tar.bz2
serverdata-52b7971f12a526bb0529a16e11865100b29d8a6c.tar.xz
serverdata-52b7971f12a526bb0529a16e11865100b29d8a6c.zip
Handle quest end by cooldown expired in Main Gate
Diffstat (limited to 'npc')
-rw-r--r--npc/014-4/kamelot.txt22
1 files changed, 17 insertions, 5 deletions
diff --git a/npc/014-4/kamelot.txt b/npc/014-4/kamelot.txt
index b95d4b720..401d8532c 100644
--- a/npc/014-4/kamelot.txt
+++ b/npc/014-4/kamelot.txt
@@ -26,6 +26,15 @@
// $KAMELOT_KEYMASK [ guild_id ] = Which bit was assigned as the key
// $KAMELOT_COOLDOWN [ guild_id ] = Last attempt (weekly attempts)
+// KamelotCleanup(guildid)
+function script KamelotCleanup {
+ .@g=getarg(0);
+ //$KAMELOT_ID[.@g]=0;
+ $KAMELOT_QUEST[.@g]=0;
+ $KAMELOT_KEYMASK[.@g]=0;
+ return;
+}
+
014-4,67,26,0 script #KamelotEnter NPC_HIDDEN,0,0,{
end;
@@ -43,13 +52,16 @@ OnTouch:
// Save your GID for reference
.@g=getcharid(2);
- // TODO: Quest started, Cooldown expired
- // Needs to cleanup - wipe all variables
-
// Quest already started
if ($KAMELOT_QUEST[.@g] & 1) {
- dispbottom l("The gates are firmly shut by some weird magical power.");
- end;
+ // Quest started but Cooldown expired
+ // Needs to cleanup - wipe all variables
+ if ($KAMELOT_COOLDOWN[.@g] < gettimeparam(GETTIME_WEEKDAY)) {
+ KamelotCleanup();
+ } else {
+ dispbottom l("The gates are firmly shut by some weird magical power.");
+ end;
+ }
}
// Build instance if it doesn't exists or has been reallocated