diff options
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 |