Removed extra tabs/spaces in script_commands.txt
This commit is contained in:
parent
045f4be573
commit
4b8720b44c
@ -7,7 +7,7 @@
|
||||
//===== Description:=========================================
|
||||
//= A reference manual for the rAthena scripting language.
|
||||
//= Commands are sorted depending on their functionality.
|
||||
//============================================================
|
||||
//===========================================================
|
||||
|
||||
This document is a reference manual for all the scripting commands and functions
|
||||
available in rAthena. It is not a simple tutorial. When people tell you to
|
||||
@ -1189,23 +1189,13 @@ This command will stop the execution for this particular script. The two
|
||||
versions are perfectly equivalent. It is the normal way to end a script which
|
||||
does not use 'mes'.
|
||||
|
||||
if (BaseLevel<=10) goto L_Lvl10;
|
||||
if (BaseLevel<=20) goto L_Lvl20;
|
||||
if (BaseLevel<=30) goto L_Lvl30;
|
||||
if (BaseLevel<=40) goto L_Lvl40;
|
||||
if (BaseLevel<=50) goto L_Lvl50;
|
||||
if (BaseLevel<=60) goto L_Lvl60;
|
||||
if (BaseLevel<=70) goto L_Lvl70;
|
||||
L_Lvl10:
|
||||
if (BaseLevel <= 10)
|
||||
npctalk "Look at that you are still a n00b";
|
||||
end;
|
||||
L_Lvl20:
|
||||
else if (BaseLevel <= 20)
|
||||
npctalk "Look at that you are getting better, but still a n00b";
|
||||
end;
|
||||
L_Lvl30:
|
||||
else if (BaseLevel <= 30)
|
||||
npctalk "Look at that you are getting there, you are almost 2nd profession now right???";
|
||||
end;
|
||||
L_Lvl40:
|
||||
else if (BaseLevel <= 40)
|
||||
npctalk "Look at that you are almost 2nd profession";
|
||||
end;
|
||||
|
||||
@ -1311,9 +1301,12 @@ with other command, such as "if", but often used on its own.
|
||||
|
||||
...
|
||||
goto Label;
|
||||
|
||||
mes "This will not be seen";
|
||||
end;
|
||||
Label:
|
||||
mes "This will be seen";
|
||||
end;
|
||||
|
||||
This command should be avoided and only used if there is no other option.
|
||||
|
||||
@ -1337,6 +1330,7 @@ number of option the player picked. (Numbering of options starts at 1.)
|
||||
This number is consistent with empty options and grouped options.
|
||||
|
||||
menu "A::B",L_Wrong,"",L_Impossible,"C",L_Right;
|
||||
|
||||
L_Wrong:
|
||||
// If they click "A" or "B" they will end up here
|
||||
// @menu == 1 if "A"
|
||||
@ -1469,7 +1463,8 @@ no questions. It will return the number of menu option picked, starting with 1.
|
||||
Like 'menu', it will also set the variable @menu to contain the option the user
|
||||
picked.
|
||||
|
||||
if (select("Yes:No")==1) mes "You said yes, I know.";
|
||||
if (select("Yes:No" ) == 1)
|
||||
mes "You said yes, I know.";
|
||||
|
||||
And like 'menu', the selected option is consistent with grouped options
|
||||
and empty options.
|
||||
@ -1550,7 +1545,8 @@ the place that called it.
|
||||
}
|
||||
function%TAB%script%TAB%funcNPC%TAB%{
|
||||
.@win = rand(2);
|
||||
if (.@win == 0) return;
|
||||
if (.@win == 0)
|
||||
return;
|
||||
mes "Sorry, you lost.";
|
||||
close;
|
||||
}
|
||||
@ -1572,7 +1568,8 @@ generally cleaner:
|
||||
close;
|
||||
}
|
||||
function%TAB%script%TAB%OddFunc%TAB%{
|
||||
if (getarg(0)%2==0) return 0;// it's even
|
||||
if (getarg(0)%2 == 0)
|
||||
return 0;// it's even
|
||||
return 1;// it's odd
|
||||
}
|
||||
|
||||
@ -1929,7 +1926,7 @@ See 'strcharinfo' for an explanation of what this function does.
|
||||
Example 6: Using complex conditions.
|
||||
|
||||
mes "[Multiple Checks]";
|
||||
if ( (@queststarted == 1) && (countitem(512) >= 5) ) {
|
||||
if (@queststarted == 1 && countitem(512) >= 5) {
|
||||
mes "Well done, you have started the quest and brought me 5 Apples.";
|
||||
@queststarted = 0;
|
||||
delitem 512,5;
|
||||
@ -2553,31 +2550,31 @@ wearing such an item, 'getequipid' will return its ID number for either slot.
|
||||
Can be used to check if you have something equipped, or if you haven't got
|
||||
something equipped:
|
||||
|
||||
if(getequipid(EQI_HEAD_TOP)==2234) goto L_WearingTiara;
|
||||
mes "Come back when you have a Tiara on";
|
||||
close;
|
||||
L_WearingTiara:
|
||||
if (getequipid(EQI_HEAD_TOP) == 2234)
|
||||
mes "What a lovely Tiara you have on";
|
||||
else
|
||||
mes "Come back when you have a Tiara on";
|
||||
close;
|
||||
|
||||
You can also use it to make sure people don't pass a point before removing an
|
||||
item totally from them. Let's say you don't want people to wear Legion Plate
|
||||
armor, but also don't want them to equip if after the check, you would do this:
|
||||
|
||||
if ((getequipid(EQI_ARMOR) == 2341) || (getequipid(EQI_ARMOR) == 2342) goto L_EquipedLegionPlate;
|
||||
if (getequipid(EQI_ARMOR) == 2341 || getequipid(EQI_ARMOR) == 2342) {
|
||||
mes "You are wearing some Legion Plate Armor, please drop that in your stash before continuing";
|
||||
close;
|
||||
}
|
||||
// the || is used as an or argument, there is 2341 and 2342 cause there are
|
||||
// two different legion plate armors, one with a slot one without.
|
||||
if ((countitem(2341) > 0) || (countitem(2432) > 0) goto L_InventoryLegionPlate;
|
||||
mes "I will lets you pass";
|
||||
|
||||
if (countitem(2341) > 0 || countitem(2432) > 0) {
|
||||
mes "You have some Legion Plate Armor in your inventory, please drop that in your stash before continuing";
|
||||
close;
|
||||
}
|
||||
mes "I will lets you pass.";
|
||||
close2;
|
||||
warp "place",50,50;
|
||||
end;
|
||||
L_EquipedLegionPlate:
|
||||
mes "You are wearing some Legion Plate Armor, please drop that in your stash before continuing";
|
||||
close;
|
||||
L_InventoryLegionPlate:
|
||||
mes "You have some Legion Plate Armor in your inventory, please drop that in your stash before continuing";
|
||||
close;
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@ -2620,11 +2617,12 @@ several broken items, 1 given as an argument will return the first one found, 2
|
||||
will return the second one, etc. Will return 0 if no such item is found.
|
||||
|
||||
// Let's see if they have anything broken:
|
||||
if (getbrokenid(1)==0) goto Skip;
|
||||
if (getbrokenid(1) == 0)
|
||||
mes "You don't have anything broken, quit bothering me.";
|
||||
else
|
||||
// They do, so let's print the name of the first broken item:
|
||||
mes "Oh, I see you have a broken " + getitemname(getbrokenid(1)) + " here!";
|
||||
Skip:
|
||||
mes "You don't have anything broken, quit bothering me.";
|
||||
end;
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@ -2634,14 +2632,15 @@ This functions will return 1 if there is an equipment placed on the specified
|
||||
equipment slot and 0 otherwise. For a list of equipment slots
|
||||
see 'getequipid'. Function originally used by the refining NPCs:
|
||||
|
||||
if (getequipisequiped(EQI_HEAD_TOP)) goto L_equipped;
|
||||
mes "[Refiner]";
|
||||
mes "Do you want me to refine your dumb head?";
|
||||
close;
|
||||
L_equipped:
|
||||
if (getequipisequiped(EQI_HEAD_TOP)) {
|
||||
mes "[Refiner]";
|
||||
mes "That's a fine hat you are wearing there...";
|
||||
close;
|
||||
} else {
|
||||
mes "[Refiner]";
|
||||
mes "Do you want me to refine your dumb head?";
|
||||
close;
|
||||
}
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@ -2651,14 +2650,15 @@ Will return 1 if the item equipped on the invoking character in the specified
|
||||
equipment slot is refinable, and 0 if it isn't. For a list of equipment slots
|
||||
see 'getequipid'.
|
||||
|
||||
if (getequipisenableref(EQI_HEAD_TOP)) goto L_Refine;
|
||||
mes "[Refiner]";
|
||||
mes "I can't refine this hat!...";
|
||||
close;
|
||||
L_Refine:
|
||||
if (getequipisenableref(EQI_HEAD_TOP)) {
|
||||
mes "[Refiner]";
|
||||
mes "Ok I can refine this";
|
||||
close;
|
||||
} else {
|
||||
mes "[Refiner]";
|
||||
mes "I can't refine this hat!...";
|
||||
close;
|
||||
}
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@ -2670,11 +2670,11 @@ slot. For a list of equipment slots see 'getequipid'.
|
||||
Can be used to check if you have reached a maximum refine value, default for
|
||||
this is +10:
|
||||
|
||||
if(getequiprefinerycnt(EQI_HEAD_TOP) < 10) goto L_Refine_HeadGear;
|
||||
if (getequiprefinerycnt(EQI_HEAD_TOP) < 10)
|
||||
mes "I will now upgrade your " + getequipname(EQI_HEAD_TOP);
|
||||
else
|
||||
mes "Sorry, it's not possible to refine hats better than +10";
|
||||
close;
|
||||
L_Refine_HeadGear:
|
||||
mes "I will now upgrade your "+getequipname(EQI_HEAD_TOP);
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@ -2704,7 +2704,7 @@ Examples:
|
||||
}
|
||||
|
||||
// Left hand can hold either a weapon or shield.
|
||||
if (!getequipisequiped(EQI_HAND_R)) {
|
||||
if (getequipid(EQI_HAND_R) == 0) {
|
||||
mes "Seems you have nothing equipped here.";
|
||||
close;
|
||||
}
|
||||
@ -3244,25 +3244,19 @@ There are two main uses for this function, it can check whether the character
|
||||
has a skill or not, and it can tell you if the level is high enough.
|
||||
|
||||
Example 1:
|
||||
|
||||
if (getskilllv(152)) goto L_HasSkillThrowStone;
|
||||
mes "You don't have Throw Stone";
|
||||
close;
|
||||
L_HasSkillThrowStone:
|
||||
if (getskilllv(152))
|
||||
mes "You have got the skill Throw Stone";
|
||||
else
|
||||
mes "You don't have Throw Stone";
|
||||
close;
|
||||
|
||||
Example 2:
|
||||
|
||||
if (getskilllv(28) >= 5) goto L_HasSkillHeallvl5orMore;
|
||||
if (getskilllv(28) == 10) goto L_HasSkillHealMaxed;
|
||||
mes "You heal skill is below lvl 5";
|
||||
close;
|
||||
L_HasSkillHeallvl6orMore:
|
||||
if (getskilllv(28) >= 5)
|
||||
mes "Your heal lvl is 5 or more";
|
||||
close;
|
||||
L_HasSkillHealMaxed:
|
||||
else if (getskilllv(28) == 10)
|
||||
mes "Your heal lvl has been maxed";
|
||||
else
|
||||
mes "You heal skill is below lvl 5";
|
||||
close;
|
||||
|
||||
---------------------------------------
|
||||
@ -5896,12 +5890,10 @@ Simple monster killing script:
|
||||
|
||||
OnPoringKilled:
|
||||
$PoringKilled++;
|
||||
if ($PoringKilled >= 10) goto L_AllDead;
|
||||
end;
|
||||
|
||||
L_AllDead:
|
||||
if ($PoringKilled >= 10) {
|
||||
announce "Summon Man: Well done. All the Porings are dead!",3;
|
||||
$PoringKilled = 0;
|
||||
}
|
||||
end;
|
||||
|
||||
For more good examples see just about any official 2-1 or 2-2 job quest script.
|
||||
@ -6154,6 +6146,7 @@ the invoking NPC's actions, such as using an emotion or talking.
|
||||
mes "NPC2 copies my actions!";
|
||||
close2;
|
||||
donpcevent "NPC2::OnEmote";
|
||||
end;
|
||||
OnEmote:
|
||||
emotion rand(1,30);
|
||||
end;
|
||||
@ -6163,6 +6156,7 @@ the invoking NPC's actions, such as using an emotion or talking.
|
||||
mes "NPC1 copies my actions!";
|
||||
close2;
|
||||
donpcevent "NPC1::OnEmote";
|
||||
end;
|
||||
OnEmote:
|
||||
emotion rand(1,30);
|
||||
end;
|
||||
@ -7251,8 +7245,8 @@ character belonged to an account which had GM level 99.
|
||||
|
||||
// This will ask the invoker for a character name and then use the '@nuke'
|
||||
// GM command on them, killing them mercilessly.
|
||||
input @player$;
|
||||
atcommand "@nuke "+@player$;
|
||||
input .@player$;
|
||||
atcommand "@nuke " + .@player$;
|
||||
|
||||
Note that for atcommands bound using 'bindatcmd', this command will execute the
|
||||
original atcommand, not the script-bound atcommand.
|
||||
|
Loading…
x
Reference in New Issue
Block a user