From e7ca648973cbb587901133a42c699d3358b53167 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 18 Jun 2020 18:29:49 -0300 Subject: Declare ReplaceSkillFromEveryPlayer() Will be needed by Magic v3 to dispose from old skills --- npc/functions/util.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'npc/functions/util.txt') 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 -- cgit v1.2.3-70-g09d2