From 46311a784a46d1f1afb3173e73aff722f2208958 Mon Sep 17 00:00:00 2001 From: brianluau Date: Thu, 27 Aug 2009 05:14:42 +0000 Subject: - 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 --- doc/script_commands.txt | 54 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 11 deletions(-) (limited to 'doc/script_commands.txt') 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"); --------------------------------------- -- cgit v1.2.3-60-g2f50