diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-06-17 11:55:54 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-06-17 11:55:54 -0300 |
commit | dbed3c309bab024c43810368a71d087e3f4373f6 (patch) | |
tree | bc4e9ed1df921516725a2ea1791f08092e119791 | |
parent | c3f49473f62374b4697dfccc81bdadeb330f9e52 (diff) | |
download | serverdata-dbed3c309bab024c43810368a71d087e3f4373f6.tar.gz serverdata-dbed3c309bab024c43810368a71d087e3f4373f6.tar.bz2 serverdata-dbed3c309bab024c43810368a71d087e3f4373f6.tar.xz serverdata-dbed3c309bab024c43810368a71d087e3f4373f6.zip |
Ease my worries with Easter and Golden/Silver Eggs!
Starting Easter will automatically delete every egg on all tables, including
auction, rodex_mail, storages, carts and inventories.
Technically I need to run @kickall before running these scripts, though.
-rw-r--r-- | npc/commands/event.txt | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/npc/commands/event.txt b/npc/commands/event.txt index 46b9737ae..c3d21b329 100644 --- a/npc/commands/event.txt +++ b/npc/commands/event.txt @@ -1,3 +1,19 @@ +// Delete item ID on inventories, storages, guild storages and carts. Also affects mails. +// WARNING, irreversible and dangerous! +// DelItemFromEveryPlayer( ID ) +function script DelItemFromEveryPlayer { + if (getarg(0, -1) < 0) + return; + + query_sql("DELETE FROM `inventory` WHERE `nameid`="+getarg(0)); + query_sql("DELETE FROM `cart_inventory` WHERE `nameid`="+getarg(0)); + query_sql("DELETE FROM `storage` WHERE `nameid`="+getarg(0)); + query_sql("DELETE FROM `guild_storage` WHERE `nameid`="+getarg(0)); + query_sql("DELETE FROM `rodex_items` WHERE `nameid`="+getarg(0)); + query_sql("DELETE FROM `auction` WHERE `nameid`="+getarg(0)); + return; +} + function script GlobalEventMenu { function rateManagement { @@ -28,6 +44,37 @@ function script GlobalEventMenu { return; } + function sEaster { + // Delete all GoldenEasteregg and SilverEasteregg from every player + // WARNING, possibly dangerous. + DelItemFromEveryPlayer(GoldenEasteregg); + DelItemFromEveryPlayer(GoldenEasteregg); + + // Enable event + set $EVENT$, "Easter"; + logmes "Enabled EASTER event.", LOGMES_ATCOMMAND; + return; + } + + + + + + + + + + + + + + + + + + + + function seasonManagement { clear; mes l("Current event: @@", $EVENT$); @@ -39,7 +86,7 @@ function script GlobalEventMenu { switch (@menu) { case 1: set $EVENT$, ""; logmes "Disabled events.", LOGMES_ATCOMMAND; break; - case 2: set $EVENT$, "Easter"; logmes "Enabled EASTER event.", LOGMES_ATCOMMAND; break; + case 2: sEaster(); break; case 3: set $EVENT$, "Worker Day"; logmes "Enabled WORKERS DAY event.", LOGMES_ATCOMMAND; |