diff options
Diffstat (limited to 'npc')
-rw-r--r-- | npc/003-3/malindou.txt | 18 | ||||
-rw-r--r-- | npc/functions/util.txt | 15 |
2 files changed, 33 insertions, 0 deletions
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt index 3655d3eaa..1a1d64f7a 100644 --- a/npc/003-3/malindou.txt +++ b/npc/003-3/malindou.txt @@ -183,6 +183,24 @@ OnInit: debugmes "* Fix critical bug with Nard (not needed on Main Server)"; debugmes ""; } + // Current UPDATE value: Qua Dez 26 21:45:10 -02 2018 + // Update players position + if ($UPDATE < 1545867910) { + ReplaceItemFromEveryPlayer(6000, 9990); + ReplaceItemFromEveryPlayer(6001, 9991); + ReplaceItemFromEveryPlayer(6004, 9994); + ReplaceItemFromEveryPlayer(6005, 9995); + + ReplaceItemFromEveryPlayer(9990, 6001); + ReplaceItemFromEveryPlayer(9991, 6000); + ReplaceItemFromEveryPlayer(9994, 6005); + ReplaceItemFromEveryPlayer(9995, 6004); + + $UPDATE=1545867910; + debugmes ""; + debugmes "* Update Bows IDs"; + debugmes ""; + } 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 |