summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-12-26 21:52:04 -0200
committerJesusaves <cpntb1@ymail.com>2018-12-26 21:52:04 -0200
commitb80f1aabc1e7fa5755bd3e0a5958787cda426a76 (patch)
tree4a97f42e2cac038b43424ce205d635c900069c17 /npc/functions
parent025844f134357d5bf6d339851a5afe734ea04408 (diff)
downloadserverdata-b80f1aabc1e7fa5755bd3e0a5958787cda426a76.tar.gz
serverdata-b80f1aabc1e7fa5755bd3e0a5958787cda426a76.tar.bz2
serverdata-b80f1aabc1e7fa5755bd3e0a5958787cda426a76.tar.xz
serverdata-b80f1aabc1e7fa5755bd3e0a5958787cda426a76.zip
Change bow ID to something more logic.
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/util.txt15
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