summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNetSysFire <59517351+NetSysFire@users.noreply.github.com>2023-02-24 00:21:23 +0100
committerNetSysFire <59517351+NetSysFire@users.noreply.github.com>2023-02-24 00:21:23 +0100
commit2ef3e7daf56875c6ffe697702679cc8219ef37f6 (patch)
tree0d0e582c7d908afa4f4ca3eac42e4c50f0b265a2
parentcfa4af6e3b5988801665e19726e410e813e5c290 (diff)
downloadserverdata-2ef3e7daf56875c6ffe697702679cc8219ef37f6.tar.gz
serverdata-2ef3e7daf56875c6ffe697702679cc8219ef37f6.tar.bz2
serverdata-2ef3e7daf56875c6ffe697702679cc8219ef37f6.tar.xz
serverdata-2ef3e7daf56875c6ffe697702679cc8219ef37f6.zip
initial version of finding money inside chests
-rw-r--r--npc/functions/treasure.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/npc/functions/treasure.txt b/npc/functions/treasure.txt
index 419afaac6..a5fd6d6be 100644
--- a/npc/functions/treasure.txt
+++ b/npc/functions/treasure.txt
@@ -47,14 +47,18 @@ function script TreasureBox {
// There's also rares (14%), uncommons (36%) and commons (48%)
.@ur_rate=min(15, (TREASURE_OPEN/10));
.@count=1;
+ .@money=0;
// ultra rare
if (.@t % 149 == 0 || .@r < .@ur_rate)
+ .@money=rand(1000, 2000)
.@loot=any(ScrollMagnusHealC, SaviorBlueprint, DivineApple, MercBoxE, ScrollSDragon, Shemagh, Shemagh, EverburnPowder, IridiumOre, PlatinumOre, SacredImmortalityPotion, MagicApple, ElixirOfLife);
// super rare
else if (.@t % 50 == 0 || .@r < 200)
+ .@money=rand(500, 750)
.@loot=any(MercBoxC, ScrollMagnusHealB, SnakeEgg, LachesisBrew, ArrowAmmoBox, GoldPieces, SilverGift, TerraniteOre, LeadOre, TinOre, SilverOre, GoldOre, TitaniumOre, FluoPowder, Lockpicks, EquipmentBlueprintC, AlchemyBlueprintC, AlchemyBlueprintD, AncientBlueprint, YerbaMate, JasmineTea, DeathPotion, SacredLifePotion, SacredManaPotion, BrokenWarpCrystal, PurificationPotion, GoldenApple);
// rare
else if (.@r < 1600 || .@t == 0)
+ .@money=rand(100, 300)
.@loot=any(MercBoxB, MoubooSteak, ClothoLiquor, Coal, RedPlushWine, PrecisionPotion, CoinBag, DodgePotion, MoveSpeedPotion, Dagger, Lockpicks, BronzeGift, IronOre, CopperOre, BlueDye, EquipmentBlueprintB, AlchemyBlueprintB, AlchemyBlueprintC, OolongTea, Curshroom);
if (.@loot == Coal)
.@count=rand(6, 10);
@@ -62,6 +66,7 @@ function script TreasureBox {
.@count=rand(1, 3);
// uncommon
else if (.@r < 5200)
+ .@money=rand(20, 80)
.@loot=any(MercBoxA, SmokeGrenade, Potatoz, MoubooSteak, ClothoLiquor, Coal, SmallMushroom, HastePotion, StrengthPotion, WoodenLog, LeatherPatch, Lockpicks, Beer, StrangeCoin, EquipmentBlueprintA, EquipmentBlueprintB, AlchemyBlueprintA, SpearmintTea, TreasureMap, DungeonMap, IcedBottle);
if (.@loot == Coal || .@loot == Potatoz)
.@count=rand(4, 6);
@@ -85,8 +90,9 @@ function script TreasureBox {
inventoryplace .@loot, .@count;
- mesc l("You find @@ x@@ inside!", getitemlink(.@loot), .@count);
+ mesc l("You find %s x%d inside!", getitemlink(.@loot), .@count);
getitem .@loot, 1;
+ Zeny+=.@money
// Get Monster points for treasure hunting (20% from job level)
if (MPQUEST)
Mobpt+=(JobLevel/5);