summaryrefslogtreecommitdiff
path: root/npc/guild
diff options
context:
space:
mode:
Diffstat (limited to 'npc/guild')
-rw-r--r--npc/guild/gldfunc_treasure.txt49
1 files changed, 21 insertions, 28 deletions
diff --git a/npc/guild/gldfunc_treasure.txt b/npc/guild/gldfunc_treasure.txt
index ab885d149..d296397ff 100644
--- a/npc/guild/gldfunc_treasure.txt
+++ b/npc/guild/gldfunc_treasure.txt
@@ -1,12 +1,11 @@
//===== eAthena Script =======================================
//= War of Emperium Guild Treasure Room Functions
//===== By: ==================================================
-//= holyAngelX (1.0)
-//= 1.1 by Akaru and ho|yAnge|X
+//= holyAngelX (1.0) Akaru and ho|yAnge|X (1.1)
//===== Current Version: =====================================
-//= 1.4
+//= 1.6
//===== Compatible With: =====================================
-//= eAthena 0.1+; RO Episode 4+
+//= eAthena 1+; RO Episode 4+
//===== Description: =========================================
//= F_GldTreas spawns treasure chests used by the guild master.
//= F_GldTreasSw allows the player to get out of the treasure room.
@@ -14,28 +13,29 @@
//= Break down of arguments used in the F_GldTreas:
//= arg(0): name of guild castle
//= arg(1): name of script that called the function
-//= arg(2): $variable for number of boxes to spawn for specific castle
-//= arg(2): $variable to be used as a counter
-//= arg(4): $variable for box/monster id number.
+//= arg(2): not used
+//= arg(3): not used
+//= arg(4): not used
//= arg(5): box/monster id#
//= arg(6): x1 coordinate for areamonster call
//= arg(7): y1 coordinate for areamonster call
//= arg(8): x2 coordinate for areamonster call
//= arg(9): y1 coordinate for areamonster call
-//= arg(10):
+//=
//= Break down of arguments used in the F_GldTreasSw:
//= arg(0): name of guild castle.
//= arg(1): x1 coordinate for warp back to guild castle
//= arg(2): y1 coordinate for warp back to guild castle
//===== Additional Comments: =================================
-//= v1.2 Treasure room Spawn, and Treasure room Switch scripts now use these functions.[kobra_k88]
-//= v1.2a Function now returns to script that called it. Removed TreasureSpawn2.
+//= 1.2 Treasure room Spawn, and Treasure room Switch scripts now use these functions.[kobra_k88]
+//= 1.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.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]
//= 1.4 New number of Treasure Boxes per castle: 25 at 100 Economic pts [Lupus]
-//= So you get your first chest only when your Economic Pts >= 4
+//= So you get your first chest only when your Economic Pts >= 4
//= 1.5 Fixed treasure number 'round exploit' [Lupus]
+//= 1.6 to Aegis X.2 formula 4..24 Treasure Chests [Lupus]
//============================================================
@@ -45,23 +45,16 @@
function script F_GldTreas {
if(getarg(10) == 1) goto L_SPAWN;
- SetCastleData getarg(0)+".gat",4,0;
- SetCastleData getarg(0)+".gat",5,0;
- KillMonster getarg(0)+".gat","Treasure_"+getarg(1)+"::OnDied";
- if (GetCastleData(getarg(0)+".gat",2) > 100) return;
- if (GetCastleData(getarg(0)+".gat",1) == 0) return;
-//[New] correct formula for 25 boxes at 100 pts:
- set getarg(2),GetCastleData(getarg(0)+".gat",2)>>2;
- if (getarg(2) <= 0) return;
- set getarg(3), getarg(2); //sets the counter variable = to the box number amount
-
+ setcastledata getarg(0)+".gat",4,0;
+ setcastledata getarg(0)+".gat",5,0;
+ killmonster getarg(0)+".gat","Treasure_"+getarg(1)+"::OnDied";
+ if(GetCastleData(getarg(0)+".gat",2) > 100 || GetCastleData(getarg(0)+".gat",1) == 0) return;
+ //sets the counter variable = to the box number amount
+ set $@n,GetCastleData(getarg(0)+".gat",2)/5+4;
L_SPAWN:
- 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) goto L_SPAWN;
+ areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(5)+($@n & 1),1,"Treasure_"+getarg(1)+"::OnDied";
+ set $@n, $@n - 1;
+ if($@n > 0) goto L_SPAWN;
return;
}