Removed extra tabs/spaces in script_commands.txt
This commit is contained in:
parent
045f4be573
commit
4b8720b44c
@ -7,7 +7,7 @@
|
|||||||
//===== Description:=========================================
|
//===== Description:=========================================
|
||||||
//= A reference manual for the rAthena scripting language.
|
//= A reference manual for the rAthena scripting language.
|
||||||
//= Commands are sorted depending on their functionality.
|
//= Commands are sorted depending on their functionality.
|
||||||
//============================================================
|
//===========================================================
|
||||||
|
|
||||||
This document is a reference manual for all the scripting commands and functions
|
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
|
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
|
versions are perfectly equivalent. It is the normal way to end a script which
|
||||||
does not use 'mes'.
|
does not use 'mes'.
|
||||||
|
|
||||||
if (BaseLevel<=10) goto L_Lvl10;
|
if (BaseLevel <= 10)
|
||||||
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:
|
|
||||||
npctalk "Look at that you are still a n00b";
|
npctalk "Look at that you are still a n00b";
|
||||||
end;
|
else if (BaseLevel <= 20)
|
||||||
L_Lvl20:
|
|
||||||
npctalk "Look at that you are getting better, but still a n00b";
|
npctalk "Look at that you are getting better, but still a n00b";
|
||||||
end;
|
else if (BaseLevel <= 30)
|
||||||
L_Lvl30:
|
|
||||||
npctalk "Look at that you are getting there, you are almost 2nd profession now right???";
|
npctalk "Look at that you are getting there, you are almost 2nd profession now right???";
|
||||||
end;
|
else if (BaseLevel <= 40)
|
||||||
L_Lvl40:
|
|
||||||
npctalk "Look at that you are almost 2nd profession";
|
npctalk "Look at that you are almost 2nd profession";
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1311,9 +1301,12 @@ with other command, such as "if", but often used on its own.
|
|||||||
|
|
||||||
...
|
...
|
||||||
goto Label;
|
goto Label;
|
||||||
|
|
||||||
mes "This will not be seen";
|
mes "This will not be seen";
|
||||||
|
end;
|
||||||
Label:
|
Label:
|
||||||
mes "This will be seen";
|
mes "This will be seen";
|
||||||
|
end;
|
||||||
|
|
||||||
This command should be avoided and only used if there is no other option.
|
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.
|
This number is consistent with empty options and grouped options.
|
||||||
|
|
||||||
menu "A::B",L_Wrong,"",L_Impossible,"C",L_Right;
|
menu "A::B",L_Wrong,"",L_Impossible,"C",L_Right;
|
||||||
|
|
||||||
L_Wrong:
|
L_Wrong:
|
||||||
// If they click "A" or "B" they will end up here
|
// If they click "A" or "B" they will end up here
|
||||||
// @menu == 1 if "A"
|
// @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
|
Like 'menu', it will also set the variable @menu to contain the option the user
|
||||||
picked.
|
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 like 'menu', the selected option is consistent with grouped options
|
||||||
and empty options.
|
and empty options.
|
||||||
@ -1550,7 +1545,8 @@ the place that called it.
|
|||||||
}
|
}
|
||||||
function%TAB%script%TAB%funcNPC%TAB%{
|
function%TAB%script%TAB%funcNPC%TAB%{
|
||||||
.@win = rand(2);
|
.@win = rand(2);
|
||||||
if (.@win == 0) return;
|
if (.@win == 0)
|
||||||
|
return;
|
||||||
mes "Sorry, you lost.";
|
mes "Sorry, you lost.";
|
||||||
close;
|
close;
|
||||||
}
|
}
|
||||||
@ -1572,7 +1568,8 @@ generally cleaner:
|
|||||||
close;
|
close;
|
||||||
}
|
}
|
||||||
function%TAB%script%TAB%OddFunc%TAB%{
|
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
|
return 1;// it's odd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1929,7 +1926,7 @@ See 'strcharinfo' for an explanation of what this function does.
|
|||||||
Example 6: Using complex conditions.
|
Example 6: Using complex conditions.
|
||||||
|
|
||||||
mes "[Multiple Checks]";
|
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.";
|
mes "Well done, you have started the quest and brought me 5 Apples.";
|
||||||
@queststarted = 0;
|
@queststarted = 0;
|
||||||
delitem 512,5;
|
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
|
Can be used to check if you have something equipped, or if you haven't got
|
||||||
something equipped:
|
something equipped:
|
||||||
|
|
||||||
if(getequipid(EQI_HEAD_TOP)==2234) goto L_WearingTiara;
|
if (getequipid(EQI_HEAD_TOP) == 2234)
|
||||||
mes "Come back when you have a Tiara on";
|
|
||||||
close;
|
|
||||||
L_WearingTiara:
|
|
||||||
mes "What a lovely Tiara you have on";
|
mes "What a lovely Tiara you have on";
|
||||||
|
else
|
||||||
|
mes "Come back when you have a Tiara on";
|
||||||
close;
|
close;
|
||||||
|
|
||||||
You can also use it to make sure people don't pass a point before removing an
|
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
|
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:
|
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
|
// 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.
|
// 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;
|
close2;
|
||||||
warp "place",50,50;
|
warp "place",50,50;
|
||||||
end;
|
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.
|
will return the second one, etc. Will return 0 if no such item is found.
|
||||||
|
|
||||||
// Let's see if they have anything broken:
|
// 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:
|
// 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!";
|
mes "Oh, I see you have a broken " + getitemname(getbrokenid(1)) + " here!";
|
||||||
Skip:
|
end;
|
||||||
mes "You don't have anything broken, quit bothering me.";
|
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
@ -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
|
equipment slot and 0 otherwise. For a list of equipment slots
|
||||||
see 'getequipid'. Function originally used by the refining NPCs:
|
see 'getequipid'. Function originally used by the refining NPCs:
|
||||||
|
|
||||||
if (getequipisequiped(EQI_HEAD_TOP)) goto L_equipped;
|
if (getequipisequiped(EQI_HEAD_TOP)) {
|
||||||
mes "[Refiner]";
|
|
||||||
mes "Do you want me to refine your dumb head?";
|
|
||||||
close;
|
|
||||||
L_equipped:
|
|
||||||
mes "[Refiner]";
|
mes "[Refiner]";
|
||||||
mes "That's a fine hat you are wearing there...";
|
mes "That's a fine hat you are wearing there...";
|
||||||
close;
|
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
|
equipment slot is refinable, and 0 if it isn't. For a list of equipment slots
|
||||||
see 'getequipid'.
|
see 'getequipid'.
|
||||||
|
|
||||||
if (getequipisenableref(EQI_HEAD_TOP)) goto L_Refine;
|
if (getequipisenableref(EQI_HEAD_TOP)) {
|
||||||
mes "[Refiner]";
|
|
||||||
mes "I can't refine this hat!...";
|
|
||||||
close;
|
|
||||||
L_Refine:
|
|
||||||
mes "[Refiner]";
|
mes "[Refiner]";
|
||||||
mes "Ok I can refine this";
|
mes "Ok I can refine this";
|
||||||
close;
|
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
|
Can be used to check if you have reached a maximum refine value, default for
|
||||||
this is +10:
|
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";
|
mes "Sorry, it's not possible to refine hats better than +10";
|
||||||
close;
|
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.
|
// 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.";
|
mes "Seems you have nothing equipped here.";
|
||||||
close;
|
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.
|
has a skill or not, and it can tell you if the level is high enough.
|
||||||
|
|
||||||
Example 1:
|
Example 1:
|
||||||
|
if (getskilllv(152))
|
||||||
if (getskilllv(152)) goto L_HasSkillThrowStone;
|
|
||||||
mes "You don't have Throw Stone";
|
|
||||||
close;
|
|
||||||
L_HasSkillThrowStone:
|
|
||||||
mes "You have got the skill Throw Stone";
|
mes "You have got the skill Throw Stone";
|
||||||
|
else
|
||||||
|
mes "You don't have Throw Stone";
|
||||||
close;
|
close;
|
||||||
|
|
||||||
Example 2:
|
Example 2:
|
||||||
|
if (getskilllv(28) >= 5)
|
||||||
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:
|
|
||||||
mes "Your heal lvl is 5 or more";
|
mes "Your heal lvl is 5 or more";
|
||||||
close;
|
else if (getskilllv(28) == 10)
|
||||||
L_HasSkillHealMaxed:
|
|
||||||
mes "Your heal lvl has been maxed";
|
mes "Your heal lvl has been maxed";
|
||||||
|
else
|
||||||
|
mes "You heal skill is below lvl 5";
|
||||||
close;
|
close;
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
@ -5896,12 +5890,10 @@ Simple monster killing script:
|
|||||||
|
|
||||||
OnPoringKilled:
|
OnPoringKilled:
|
||||||
$PoringKilled++;
|
$PoringKilled++;
|
||||||
if ($PoringKilled >= 10) goto L_AllDead;
|
if ($PoringKilled >= 10) {
|
||||||
end;
|
|
||||||
|
|
||||||
L_AllDead:
|
|
||||||
announce "Summon Man: Well done. All the Porings are dead!",3;
|
announce "Summon Man: Well done. All the Porings are dead!",3;
|
||||||
$PoringKilled = 0;
|
$PoringKilled = 0;
|
||||||
|
}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
For more good examples see just about any official 2-1 or 2-2 job quest script.
|
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!";
|
mes "NPC2 copies my actions!";
|
||||||
close2;
|
close2;
|
||||||
donpcevent "NPC2::OnEmote";
|
donpcevent "NPC2::OnEmote";
|
||||||
|
end;
|
||||||
OnEmote:
|
OnEmote:
|
||||||
emotion rand(1,30);
|
emotion rand(1,30);
|
||||||
end;
|
end;
|
||||||
@ -6163,6 +6156,7 @@ the invoking NPC's actions, such as using an emotion or talking.
|
|||||||
mes "NPC1 copies my actions!";
|
mes "NPC1 copies my actions!";
|
||||||
close2;
|
close2;
|
||||||
donpcevent "NPC1::OnEmote";
|
donpcevent "NPC1::OnEmote";
|
||||||
|
end;
|
||||||
OnEmote:
|
OnEmote:
|
||||||
emotion rand(1,30);
|
emotion rand(1,30);
|
||||||
end;
|
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'
|
// This will ask the invoker for a character name and then use the '@nuke'
|
||||||
// GM command on them, killing them mercilessly.
|
// GM command on them, killing them mercilessly.
|
||||||
input @player$;
|
input .@player$;
|
||||||
atcommand "@nuke "+@player$;
|
atcommand "@nuke " + .@player$;
|
||||||
|
|
||||||
Note that for atcommands bound using 'bindatcmd', this command will execute the
|
Note that for atcommands bound using 'bindatcmd', this command will execute the
|
||||||
original atcommand, not the script-bound atcommand.
|
original atcommand, not the script-bound atcommand.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user