summaryrefslogtreecommitdiff
path: root/npc/guild/gldfunc_treasure.txt
diff options
context:
space:
mode:
authorL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-02 01:15:07 +0000
committerL0ne_W0lf <L0ne_W0lf@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-02 01:15:07 +0000
commite8c89d85b61e53646b8a243618a27bd4b06cb7f1 (patch)
treed8f7a41c9fd45c58bf4013566cc3425434abedb6 /npc/guild/gldfunc_treasure.txt
parent95667bfa39da665dc6da8fd4fc354c658774824e (diff)
downloadhercules-e8c89d85b61e53646b8a243618a27bd4b06cb7f1.tar.gz
hercules-e8c89d85b61e53646b8a243618a27bd4b06cb7f1.tar.bz2
hercules-e8c89d85b61e53646b8a243618a27bd4b06cb7f1.tar.xz
hercules-e8c89d85b61e53646b8a243618a27bd4b06cb7f1.zip
* Rather large update to the WoE scripts.
- Eliminated unofficial map-broadcasts (opening treasures/guardian death.) - Fixed several errors in guardian spawning (script-wise.) - Treasure spawning itself is done weird... What exactly is the last paramater for anyway? Near as I can see it's ALWAYS 1. Why is it used? what does it do? Why is it undocumented? Mysteries and more! - Updated dialog and restructured several NPCs. * Created a unique function for novice WoE as the new manager does not support it. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11633 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc/guild/gldfunc_treasure.txt')
-rw-r--r--npc/guild/gldfunc_treasure.txt58
1 files changed, 32 insertions, 26 deletions
diff --git a/npc/guild/gldfunc_treasure.txt b/npc/guild/gldfunc_treasure.txt
index 1d728b376..2b6b1ab8a 100644
--- a/npc/guild/gldfunc_treasure.txt
+++ b/npc/guild/gldfunc_treasure.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= holyAngelX (1.0) Akaru and ho|yAnge|X (1.1)
//===== Current Version: =====================================
-//= 1.9
+//= 2.0
//===== Compatible With: =====================================
//= eAthena 1+; RO Episode 4+
//===== Description: =========================================
@@ -46,6 +46,7 @@
//= 1.7 Box Count fix by Zoc. Now it spawns 1st/2nd Treasure Chest 50%/50% [Lupus]
//= 1.8 Official Treasure Spawn in Novice Castles. Had to add +1 in odd/even formula to leave correct ID of NG Treasure Box 8) [Lupus]
//= 1.9 Added F_TreasProtect to remove players who are not guild master from treasure room. [L0ne_W0lf]
+//= 2.0 Updated F_GldTreas, no longer uses gotos, swapped out for a 'for' loop. [L0ne_W0lf]
//============================================================
@@ -53,26 +54,32 @@
// Treasure Spawning Function
//================================================
function script F_GldTreas {
- if(getarg(10) == 1) goto L_SPAWN;
- setcastledata getarg(0),4,0;
- setcastledata getarg(0),5,0;
- killmonster getarg(0),"Treasure_"+getarg(1)+"::OnDied";
- if(GetCastleData(getarg(0),2) > 100 || GetCastleData(getarg(0),1) == 0) return;
- //sets the counter variable = to the box number amount
- if(getarg(0) == "nguild_prt" || getarg(0) == "nguild_alde" || getarg(0) == "nguild_gef" || getarg(0) == "nguild_pay" ) {
- //Novice Castles can't have more than 1 Treasure Chest
- set getarg(2),1;
- }else{
- set getarg(2),GetCastleData(getarg(0),2)/5+4;
- }
- if (getarg(2) <= 0) return;
- set getarg(3), getarg(2); //sets the counter variable = to the box number amount
+ if(getarg(10) != 1) {
+ setcastledata getarg(0),4,0;
+ setcastledata getarg(0),5,0;
+
+ // Why on earth are we killing old treasure chest spawns?
+ //killmonster getarg(0),"Treasure_"+getarg(1)+"::OnDied";
+
+ // Don't spawn treasures if Castle is empty, or Eco is greater than 100
+ if(GetCastleData(getarg(0),2) > 100 || GetCastleData(getarg(0),1) == 0) return;
-L_SPAWN:
- set getarg(4), getarg(5)+((getarg(3)+1) & 1); //sets the box id variable = to the box id
- areamonster getarg(0),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;
+ // Only spawn one treasure chest for notice castles.
+ if (compare(getarg(0),"nguild"))
+ set getarg(2),1;
+ else
+ set getarg(2),GetCastleData(getarg(0),2)/5+4;
+
+ if (getarg(2) <= 0) return;
+
+ //sets the counter variable = to the box number amount
+ set getarg(3), getarg(2);
+ }
+ for (set .@i,1; .@i <= getarg(3) ; set .@i,.@i+1) {
+ // set treasure box ID
+ set getarg(4), getarg(5)+((getarg(3)+1) & 1);
+ areamonster getarg(0),getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+ }
return;
}
@@ -81,15 +88,14 @@ L_SPAWN:
//===============================================================
function script F_GldTreasSw {
mes " ";
- mes "There is little switch over here";
- mes "Would you like to pull the switch down?";
+ mes "There's a small lever. Will you pull it? ";
next;
- menu "Yes",M_1,"No",-;
- close;
-
- M_1:
+
+ if (select("Pull.:Do not.") == 1) {
warp getarg(0),getarg(1),getarg(2);
return;
+ }
+ close;
}
//==============================================================