summaryrefslogtreecommitdiff
path: root/npc/guild/gldfunc_treasure.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/guild/gldfunc_treasure.txt')
-rw-r--r--npc/guild/gldfunc_treasure.txt32
1 files changed, 31 insertions, 1 deletions
diff --git a/npc/guild/gldfunc_treasure.txt b/npc/guild/gldfunc_treasure.txt
index 8f4235556..c1d0f62bd 100644
--- a/npc/guild/gldfunc_treasure.txt
+++ b/npc/guild/gldfunc_treasure.txt
@@ -4,7 +4,7 @@
//= holyAngelX (1.0)
//= 1.1 by Akaru and ho|yAnge|X
//===== Current Version: =====================================
-//= 1.2b
+//= 1.3
//===== Compatible With: =====================================
//= eAthena 0.1+; RO Episode 4+
//===== Description: =========================================
@@ -32,6 +32,7 @@
//= v1.2a Function now returns to script that called it. Removed TreasureSpawn2.
//= Changed back to using specific global variables for number of boxes and the box id. [kobra_k88]
//= v1.2b Added a check to allow un broken treasure chests to respawn after map server restart.[kobra_k88]
+//= 1.3 Fixed treasure boxes spawn. (Unrolled one loop a bit) [Lupus]
//============================================================
@@ -51,6 +52,35 @@ function script F_GldTreas {
set getarg(3), getarg(2); //sets the counter variable = to the box number amount
TreasureSpawn:
+
+ set getarg(4), getarg(5); //sets the box id variable = to the box id
+ set $@temp, rand(4);
+ if ($@temp > 2) set getarg(4), getarg(4) + 1;
+ areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+ set getarg(3), getarg(3) - 1;
+ if(getarg(3) <= 0) return;
+
+ set getarg(4), getarg(5); //sets the box id variable = to the box id
+ set $@temp, rand(4);
+ if ($@temp > 2) set getarg(4), getarg(4) + 1;
+ areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+ set getarg(3), getarg(3) - 1;
+ if(getarg(3) <= 0) return;
+
+ set getarg(4), getarg(5); //sets the box id variable = to the box id
+ set $@temp, rand(4);
+ if ($@temp > 2) set getarg(4), getarg(4) + 1;
+ areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+ set getarg(3), getarg(3) - 1;
+ if(getarg(3) <= 0) return;
+
+ set getarg(4), getarg(5); //sets the box id variable = to the box id
+ set $@temp, rand(4);
+ if ($@temp > 2) set getarg(4), getarg(4) + 1;
+ areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+ set getarg(3), getarg(3) - 1;
+ if(getarg(3) <= 0) return;
+
set getarg(4), getarg(5); //sets the box id variable = to the box id
set $@temp, rand(4);
if ($@temp > 2) set getarg(4), getarg(4) + 1;