diff options
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r-- | npc/functions/util.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 589a73262..99ba16bfc 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -44,6 +44,21 @@ function script DelQuestFromEveryPlayer { return; } +// Transforms an item in something else. +// ReplaceItemFromEveryPlayer( OldID, NewID ) +function script ReplaceItemFromEveryPlayer { + if (getarg(0, -1) < 0) + return; + debugmes("* Server update: %d item was replaced by %d"); + query_sql("UPDATE `inventory` SET `nameid`='"+getarg(1)+"' WHERE `nameid`="+getarg(0)); + query_sql("UPDATE `cart_inventory` SET `nameid`='"+getarg(1)+"' WHERE `nameid`="+getarg(0)); + query_sql("UPDATE `storage` SET `nameid`='"+getarg(1)+"' WHERE `nameid`="+getarg(0)); + query_sql("UPDATE `guild_storage` SET `nameid`='"+getarg(1)+"' WHERE `nameid`="+getarg(0)); + query_sql("UPDATE `rodex_items` SET `nameid`='"+getarg(1)+"' WHERE `nameid`="+getarg(0)); + query_sql("UPDATE `auction` SET `nameid`='"+getarg(1)+"' WHERE `nameid`="+getarg(0)); + return; +} + ///////////////////////////////////////////////////////////////////////////////// // Returns Nard reputation for discounts |