summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/script_commands.txt54
1 files changed, 43 insertions, 11 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 7e7014673..1cca99f28 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1480,16 +1480,48 @@ you like, to save space and time, without creating extra NPC objects which are
needed with 'callfunc'. A label is not callable in this manner from another
script.
- mes "[Woman]"
- mes "Lets see if you win";
- callsub Check;
- mes "Well done you have won";
- close;
- Check:
- set @win, rand(2);
- if(@win==0) return;
- mes "Sorry you lost";
+Example 1: callsub for checking (if checks pass, return to script)
+ callsub S_CheckFull, "guild_vs2",50;
+ switch( rand(4) ) {
+ case 0: warp "guild_vs2",9,50; end;
+ case 1: warp "guild_vs2",49,90; end;
+ case 2: warp "guild_vs2",90,50; end;
+ case 3: warp "guild_vs2",49,9; end;
+ }
+
+...
+
+S_CheckFull:
+ if (getmapusers(getarg(0)) >= getarg(1)) {
+ mes "I'm sorry, this arena is full. Please try again later.";
close;
+ }
+ return;
+
+Example 2: callsub used repeatedly, with different arguments
+// notice how the zeny check/delete is reused, instead of copy-pasting for every warp
+ switch(select("Abyss Lake:Amatsu Dungeon:Anthell:Ayothaya Dungeon:Beacon Island, Pharos") {
+ case 1: callsub S_DunWarp,"hu_fild05",192,207;
+ case 2: callsub S_DunWarp,"ama_in02",119,181;
+ case 3: callsub S_DunWarp,"moc_fild20",164,145;
+ case 4: callsub S_DunWarp,"ayo_fild02",279,150;
+ case 5: callsub S_DunWarp,"cmd_fild07",132,125;
+ // etc
+ }
+
+...
+
+S_DunWarp:
+// getarg(0) = "mapname"
+// getarg(1) = x
+// getarg(2) = y
+ if (Zeny >= 100) {
+ set Zeny, Zeny-100;
+ warp getarg(0),getarg(1),getarg(2);
+ } else {
+ mes "Dungeon warp costs 100 zeny.";
+ }
+ close;
---------------------------------------
@@ -5624,8 +5656,8 @@ Example(s):
//will set the base experience rate to 20x (2000%)
setBattleFlag "base_exp_rate",2000;
-//will return the value of the base experience rate (when used after the above example, it would return 2000).
- getBattleFlag "base_exp_rate";
+//will return the value of the base experience rate (when used after the above example, it would print 2000).
+ mes getBattleFlag("base_exp_rate");
---------------------------------------