summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-11-06 16:06:56 -0300
committerJesusaves <cpntb1@ymail.com>2019-11-06 16:06:56 -0300
commit23b797e25ebdbe1af200bdc0f10f62e22b966e52 (patch)
tree6558e8ee1afb8dad7fd284d86a83b76ce35bae65 /npc/functions/util.txt
parentf7dc10cf26e1b746ba6524255bcf8713ded841b1 (diff)
downloadserverdata-23b797e25ebdbe1af200bdc0f10f62e22b966e52.tar.gz
serverdata-23b797e25ebdbe1af200bdc0f10f62e22b966e52.tar.bz2
serverdata-23b797e25ebdbe1af200bdc0f10f62e22b966e52.tar.xz
serverdata-23b797e25ebdbe1af200bdc0f10f62e22b966e52.zip
You can now also invoke the quest deletor from script runtime.
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index f89c3a992..aa0ad8249 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -81,6 +81,17 @@ function script DelQuestFromEveryPlayer {
return;
query_sql("DELETE FROM `quest` WHERE `quest_id`="+getarg(0));
+
+ // Del quests which SQL can't reach
+ .@a=playerattached();
+ if (.@a) detachrid();
+ .@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
+ for (.@i = 0; .@i < .@c; .@i++) {
+ attachrid(.@players[.@i]);
+ setq(getarg(0), 0, 0, 0, 0);
+ detachrid();
+ }
+ if (.@a) attachrid(.@a);
return;
}