summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-18 18:29:49 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-18 18:29:49 -0300
commite7ca648973cbb587901133a42c699d3358b53167 (patch)
treeb9195433d2166f2cf428c312f1ce1b7e53a0d802 /npc
parent362320aca6b8c44c4180c352aca28bdea67f5f1e (diff)
downloadserverdata-e7ca648973cbb587901133a42c699d3358b53167.tar.gz
serverdata-e7ca648973cbb587901133a42c699d3358b53167.tar.bz2
serverdata-e7ca648973cbb587901133a42c699d3358b53167.tar.xz
serverdata-e7ca648973cbb587901133a42c699d3358b53167.zip
Declare ReplaceSkillFromEveryPlayer()
Will be needed by Magic v3 to dispose from old skills
Diffstat (limited to 'npc')
-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 624491d9a..6f21fb536 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -115,6 +115,17 @@ function script ReplaceItemFromEveryPlayer {
return;
}
+// Replaces a skill with another ID.
+// ReplaceSkillFromEveryPlayer( OldID, NewID )
+function script ReplaceSkillFromEveryPlayer {
+ if (getarg(0, -1) < 0)
+ return;
+ debugmes("* Server update: skill %d was replaced by %d", getarg(0), getarg(1));
+ // If new ID already exists, it will skip
+ query_sql("UPDATE IGNORE `skill` SET `id`='"+getarg(1)+"' WHERE `id`="+getarg(0));
+ return;
+}
+
/////////////////////////////////////////////////////////////////////////////////
// Returns Nard reputation for discounts