diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-06-18 18:29:49 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-06-18 18:29:49 -0300 |
commit | e7ca648973cbb587901133a42c699d3358b53167 (patch) | |
tree | b9195433d2166f2cf428c312f1ce1b7e53a0d802 /npc/functions/util.txt | |
parent | 362320aca6b8c44c4180c352aca28bdea67f5f1e (diff) | |
download | serverdata-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/functions/util.txt')
-rw-r--r-- | npc/functions/util.txt | 11 |
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 |