summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-08-27 05:14:42 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-08-27 05:14:42 +0000
commit46311a784a46d1f1afb3173e73aff722f2208958 (patch)
tree9e2994a1e7b73e49cde2b6ff7b266673b9c29c40 /doc/script_commands.txt
parenta81c829b99bfd0ace0fa49c682cc0e04e2711dbe (diff)
downloadhercules-46311a784a46d1f1afb3173e73aff722f2208958.tar.gz
hercules-46311a784a46d1f1afb3173e73aff722f2208958.tar.bz2
hercules-46311a784a46d1f1afb3173e73aff722f2208958.tar.xz
hercules-46311a784a46d1f1afb3173e73aff722f2208958.zip
- Fixed typo in Hyegun_Hat (5367). (bugreport:1935)
- Added missing bonuses to Mask_Of_Ifrit (5420). (bugreport:2188) - Added better examples for some documentation. - Fixed item loss from mail if you are OVER 100% overweight. (bugreport:1862) - Fixed 'waitingroom2bg' checking wrong parameter. (bugreport:3330) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14034 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc/script_commands.txt')
-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");
---------------------------------------