diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-06-09 18:23:20 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-06-09 18:23:20 -0300 |
commit | 015f6ff2e1945010658fe1c338315b7a72e8d867 (patch) | |
tree | 5f8a5e5ffc910db5d0e71119449de40a9ecf1404 /npc/items/shovel.txt | |
parent | e085598c816de7d0ee8656b0763507e64aac279f (diff) | |
download | serverdata-015f6ff2e1945010658fe1c338315b7a72e8d867.tar.gz serverdata-015f6ff2e1945010658fe1c338315b7a72e8d867.tar.bz2 serverdata-015f6ff2e1945010658fe1c338315b7a72e8d867.tar.xz serverdata-015f6ff2e1945010658fe1c338315b7a72e8d867.zip |
Fix bugs, Treasure Map should also work now but untested and risky.
Diffstat (limited to 'npc/items/shovel.txt')
-rw-r--r-- | npc/items/shovel.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt index b0b3553c6..7814acd5a 100644 --- a/npc/items/shovel.txt +++ b/npc/items/shovel.txt @@ -331,6 +331,18 @@ OnHour00: } +function script shovel_randomtreasure { + .@id=any(TreasureKey,CoinBag,TreasureKey,SulfurPowder,Coal, + IronOre,CopperOre,LeadOre,TinOre,SilverOre,GoldOre,PlatinumOre,IridiumOre,TitaniumOre, + Diamond,Ruby,Emerald,Sapphire,Topaz,Amethyst); + .@amount=any(1,1,2); + getitem .@id, .@amount; + narrator S_FIRST_BLANK_LINE, + l("You found something!"), + l("It's @@ @@.", .@amount, getitemname(.@id)); + return; +} + function script shovel_addquest { if (getargcount() < 4) { @@ -369,4 +381,21 @@ function script shovel_adddigrect { return 1; } +function script shovel_genrandtreasure { + .@m$=any_of("007-1", "011-1", "015-1", "018-1"); + // Dangerous + do { + .@x=rand2(20, getmapinfo(MAPINFO_SIZE_X, .@m$)-20); + .@y=rand2(20, getmapinfo(MAPINFO_SIZE_Y, .@m$)-20); + } while (!checkcell(.@m$, .@x, .@y, cell_chkpass)); + + // Success + if (checkcell(.@m$, .@x, .@y, cell_chkpass)) { + shovel_addquest(.@m$, .@x, .@y, "shovel_randomtreasure"); + ShovelQuests_AssignedMAP$=.@m$; + ShovelQuests_AssignedX=.@x; + ShovelQuests_AssignedY=.@y; + } + return; +} |