summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-06-16 23:18:20 -0300
committerJesusaves <cpntb1@ymail.com>2019-06-16 23:18:20 -0300
commitcd928385d26a8e3b99543711ec601738c6e50bac (patch)
treef78189fdb23f6cd3c41b8b31b1b12fe255160e38
parentea406ac0a4dbe92e02fd75ff24c242e656f35ba8 (diff)
downloadserverdata-cd928385d26a8e3b99543711ec601738c6e50bac.tar.gz
serverdata-cd928385d26a8e3b99543711ec601738c6e50bac.tar.bz2
serverdata-cd928385d26a8e3b99543711ec601738c6e50bac.tar.xz
serverdata-cd928385d26a8e3b99543711ec601738c6e50bac.zip
Fix bugs on treasure chests, like animation not playing, missing return(), and
also bad ident
-rw-r--r--npc/003-1-1/treasure.txt1
-rw-r--r--npc/007-1/treasure.txt1
-rw-r--r--npc/010-1-1/treasure.txt1
-rw-r--r--npc/015-5/treasure.txt1
-rw-r--r--npc/015-6/treasure.txt1
-rw-r--r--npc/018-3/treasure.txt1
-rw-r--r--npc/functions/treasure.txt96
7 files changed, 48 insertions, 54 deletions
diff --git a/npc/003-1-1/treasure.txt b/npc/003-1-1/treasure.txt
index ead0cfeaa..59c236453 100644
--- a/npc/003-1-1/treasure.txt
+++ b/npc/003-1-1/treasure.txt
@@ -9,7 +9,6 @@
if (!.busy && !.empty) {
TreasureBox();
- .empty=true;
specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing
.dir = .dir == 0 ? 2 : 6; // closed ? opening : closing
.busy = true; // lock until available again
diff --git a/npc/007-1/treasure.txt b/npc/007-1/treasure.txt
index 9a3bc273f..21d4631bd 100644
--- a/npc/007-1/treasure.txt
+++ b/npc/007-1/treasure.txt
@@ -33,7 +33,6 @@ OnInit:
if (!.busy && !.empty) {
TreasureBox();
- .empty=true;
specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing
.dir = .dir == 0 ? 2 : 6; // closed ? opening : closing
.busy = true; // lock until available again
diff --git a/npc/010-1-1/treasure.txt b/npc/010-1-1/treasure.txt
index dfa86c9ea..5f2c1fb82 100644
--- a/npc/010-1-1/treasure.txt
+++ b/npc/010-1-1/treasure.txt
@@ -9,7 +9,6 @@
if (!.busy && !.empty) {
TreasureBox();
- .empty=true;
specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing
.dir = .dir == 0 ? 2 : 6; // closed ? opening : closing
.busy = true; // lock until available again
diff --git a/npc/015-5/treasure.txt b/npc/015-5/treasure.txt
index 105d4264f..0fb2a8595 100644
--- a/npc/015-5/treasure.txt
+++ b/npc/015-5/treasure.txt
@@ -9,7 +9,6 @@
if (!.busy && !.empty) {
TreasureBox();
- .empty=true;
specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing
.dir = .dir == 0 ? 2 : 6; // closed ? opening : closing
.busy = true; // lock until available again
diff --git a/npc/015-6/treasure.txt b/npc/015-6/treasure.txt
index 5fc1a1c0f..8b7723cfb 100644
--- a/npc/015-6/treasure.txt
+++ b/npc/015-6/treasure.txt
@@ -9,7 +9,6 @@
if (!.busy && !.empty) {
TreasureBox();
- .empty=true;
specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing
.dir = .dir == 0 ? 2 : 6; // closed ? opening : closing
.busy = true; // lock until available again
diff --git a/npc/018-3/treasure.txt b/npc/018-3/treasure.txt
index 002f16b67..c61aee72c 100644
--- a/npc/018-3/treasure.txt
+++ b/npc/018-3/treasure.txt
@@ -9,7 +9,6 @@
if (!.busy && !.empty) {
TreasureBox();
- .empty=true;
specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing
.dir = .dir == 0 ? 2 : 6; // closed ? opening : closing
.busy = true; // lock until available again
diff --git a/npc/functions/treasure.txt b/npc/functions/treasure.txt
index 297bf5491..cd7324af8 100644
--- a/npc/functions/treasure.txt
+++ b/npc/functions/treasure.txt
@@ -5,53 +5,53 @@
// Random Treasure Box Utils
function script TreasureBox {
- .@id=getnpcid();
- if (RNGTREASURE_DATE[.@id] > gettimetick(2)) {
- mesc l("The chest is unlocked and empty.");
- close;
- }
-
- mesc l("Open the chest?");
- mesc l("Cost: 1 @@", getitemlink(TreasureKey)), 1;
- if (!countitem(TreasureKey))
- close;
- next;
- if (askyesno() == ASK_NO)
- close;
-
- delitem TreasureKey, 1;
- mesc l("You open the chest!");
- RNGTREASURE_DATE[.@id]=gettimetick(2)+60*4; // Minimum 4 hours
-
- .@empty=getvariableofnpc(.empty, strnpcinfo(0));
- if (!.@empty) {
- TREASURE_OPEN=TREASURE_OPEN+1;
- .@t=TREASURE_OPEN;
- .@r=rand(0,10000)-(readparam(bLuk)*2);
-
- // Select treasure list
- // You're warranted an ultra rare (0.1%) every 149 open chests
- // You're warranted a super rare (1%) every 50 open chests
- // There's also rares (9%), uncommons (30%) and commons (60%)
- .@ur_rate=min(10, (TREASURE_OPEN/10));
- if (.@t % 149 == 0 || .@r < .@ur_rate)
- .@loot=any(AtroposMixture, GoldenApple, DivineApple, MercBoxA, MoveSpeedPotion, Shemagh, EverburnPowder, IridiumOre, PlatinumOre);
- else if (.@t % 50 == 0 || .@r < 100)
- .@loot=any(Grenade, SnakeEgg, LachesisBrew, ArrowAmmoBox, CoinBag, SilverGift, TerraniteOre, LeadOre, TinOre, SilverOre, GoldOre, TitaniumOre, FluoPowder, AlchemyBlueprintB);
- else if (.@r < 1000 || .@t == 0)
- .@loot=any(MoubooSteak, ClothoLiquor, Coal, RedPlushWine, HastePotion, StrengthPotion, Dagger, BronzeGift, IronOre, CopperOre, AlchemyBlueprintA);
- else if (.@r < 4000)
- .@loot=any(Croconut, Potatoz, MoubooSteak, ClothoLiquor, Coal, SmallMushroom, HastePotion, StrengthPotion, Beer);
- else
- .@loot=any(FatesPotion, ChocolateBar, Plushroom, Chagashroom, RawLog, LeatherPatch, BugLeg, ScorpionStinger, SmallKnife, StrangeCoin);
-
-
- inventoryplace .@loot, 1;
- mesc l("You find @@ inside!", getitemlink(.@loot));
- getitem .@loot, 1;
- } else {
- mesc l("You find @@ inside!", l("nothing"));
- }
-
+ .@id=getnpcid();
+ if (RNGTREASURE_DATE[.@id] > gettimetick(2)) {
+ mesc l("The chest is unlocked and empty.");
+ close;
+ }
+
+ mesc l("Open the chest?");
+ mesc l("Cost: 1 @@", getitemlink(TreasureKey)), 1;
+ if (!countitem(TreasureKey))
+ close;
+ next;
+ if (askyesno() == ASK_NO)
+ close;
+
+ delitem TreasureKey, 1;
+ mesc l("You open the chest!");
+ RNGTREASURE_DATE[.@id]=gettimetick(2)+60*4; // Minimum 4 hours
+
+ .@empty=getvariableofnpc(.empty, strnpcinfo(0));
+ if (!.@empty) {
+ TREASURE_OPEN=TREASURE_OPEN+1;
+ .@t=TREASURE_OPEN;
+ .@r=rand(0,10000)-(readparam(bLuk)*2);
+
+ // Select treasure list
+ // You're warranted an ultra rare (0.1%) every 149 open chests
+ // You're warranted a super rare (1%) every 50 open chests
+ // There's also rares (9%), uncommons (30%) and commons (60%)
+ .@ur_rate=min(10, (TREASURE_OPEN/10));
+ if (.@t % 149 == 0 || .@r < .@ur_rate)
+ .@loot=any(AtroposMixture, GoldenApple, DivineApple, MercBoxA, MoveSpeedPotion, Shemagh, EverburnPowder, IridiumOre, PlatinumOre);
+ else if (.@t % 50 == 0 || .@r < 100)
+ .@loot=any(Grenade, SnakeEgg, LachesisBrew, ArrowAmmoBox, CoinBag, SilverGift, TerraniteOre, LeadOre, TinOre, SilverOre, GoldOre, TitaniumOre, FluoPowder, AlchemyBlueprintB);
+ else if (.@r < 1000 || .@t == 0)
+ .@loot=any(MoubooSteak, ClothoLiquor, Coal, RedPlushWine, HastePotion, StrengthPotion, Dagger, BronzeGift, IronOre, CopperOre, AlchemyBlueprintA);
+ else if (.@r < 4000)
+ .@loot=any(Croconut, Potatoz, MoubooSteak, ClothoLiquor, Coal, SmallMushroom, HastePotion, StrengthPotion, Beer);
+ else
+ .@loot=any(FatesPotion, ChocolateBar, Plushroom, Chagashroom, RawLog, LeatherPatch, BugLeg, ScorpionStinger, SmallKnife, StrangeCoin);
+
+
+ inventoryplace .@loot, 1;
+ mesc l("You find @@ inside!", getitemlink(.@loot));
+ getitem .@loot, 1;
+ } else {
+ mesc l("You find @@ inside!", l("nothing"));
+ }
+ return;
}