public class 0300_Checking_Commands extends Object
=========================== |0300.- Checking commands.| ===========================
| 构造器和说明 |
|---|
0300_Checking_Commands() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
agitcheck()
agitcheck()
agitcheck2()
agitcheck3()
These function will let you check whether the server is currently in WoE:FE mode
(agitcheck()), WoE:SE mode (agitcheck2()), or WoE:TE mode (agitcheck3()) and will
return true if War of Emperium is on and false if it isn't.
|
void |
basicskillcheck()
basicskillcheck()
This function will return the state of the configuration option
'basic_skill_check' in 'battle_athena.conf'.
|
void |
checkchatting()
checkchatting({"<Player Name>"})
Checks if the player is in a chatroom.
|
void |
checkidle()
checkidle({"<Player Name>"})
Returns the time, in seconds, that the specified player has been idle.
|
void |
checkoption()
checkoption(<option number>{,<char_id>})
checkoption1(<option number>{,<char_id>})
checkoption2(<option number>{,<char_id>})
setoption <option number>{,<flag>{,<char_id>}};
The 'setoption' series of functions check for a so-called option that is set on
the invoking character.
|
void |
checkre()
checkre(<type>)
Checks if a renewal feature is enabled or not in renewal.hpp, and returns 1 if
enabled and 0 for disabled.
|
void |
checkvending()
checkvending({"<Player Name>"})
Checks if the player is vending or has has a buyingstore.
|
void |
checkweight()
checkweight(<item id>,<amount>{,<item id>,<amount>,<item id>,<amount>,...});
checkweight("<item name>",<amount>{,"<item name>",<amount>,"<item name>",<amount>,...});
checkweight2(<id_array>,<amount_array>);
These functions will compute and return 1 if the total weight of the specified
number of specific items does not exceed the invoking character's carrying
capacity, and 0 otherwise.
|
void |
checkwug()
checkwug({<char_id>});
This function will return 1 if the invoking character has a
warg and 0 if they don't.
|
void |
getattachedrid()
getattachedrid();
Returns RID from running script.
|
void |
isloggedin()
isloggedin(<account id>{,<char id>})
This function returns 1 if the specified account is logged in and 0 if they
aren't.
|
void |
isnight()
isnight()
isday()
These functions will return 1 or 0 depending on whether the server is in night
mode or day mode.
|
void |
setcart()
setcart {<type>{,<char_id>}};
checkcart({<char_id>});
If <type> is 0 this command will remove the cart from the character.
|
void |
setdragon()
setdragon {<color>{,<char_id>}};
checkdragon({<char_id>});
The 'setdragon' function toggles mounting a dragon for the invoking character.
|
void |
setfalcon()
setfalcon {<flag>{,<char_id>}};
checkfalcon({<char_id>});
If <flag> is 0 this command will remove the falcon from the character.
|
void |
setmadogear()
setmadogear {<flag>{,<char_id>}};
checkmadogear({<char_id>});
If <flag> is 0 this command will remove the mount from the character.
|
void |
setmounting()
setmounting {<char_id>};
ismounting({<char_id>});
The 'setmounting' function toggles cash mount for the invoking character.
|
void |
setriding()
setriding {<flag>{,<char_id>}};
checkriding({<char_id>});
If <flag> is 0 this command will remove the mount from the character.
|
getattachedrid();
Returns RID from running script. Script may not be attached to any RID like
a floating script or function and will return 0.
isloggedin(<account id>{,<char id>})
This function returns 1 if the specified account is logged in and 0 if they
aren't. You can also pass the char id to check for both account and char id.
checkweight(<item id>,<amount>{,<item id>,<amount>,<item id>,<amount>,...});
checkweight("<item name>",<amount>{,"<item name>",<amount>,"<item name>",<amount>,...});
checkweight2(<id_array>,<amount_array>);
These functions will compute and return 1 if the total weight of the specified
number of specific items does not exceed the invoking character's carrying
capacity, and 0 otherwise. It is important to see if a player can carry the
items you expect to give them, failing to do that may open your script up to
abuse or create some very unfair errors.
The second function will check an array of items and amounts, and also
returns 1 on success and 0 on failure.
The functions, in addition to checking to see if the player is capable of
holding a set amount of items, also ensure the player has room in their
inventory for the item(s) they will be receiving.
Like 'getitem', this function will also accept an 'english name' from the
database as an argument.
Example 1:
if (checkweight(512,10)) {
getitem 512,10;
} else {
mes "Sorry, you cannot hold this amount of apples!";
}
Example 2:
setarray .@item[0],512,513,514;
setarray .@amount[0],10,5,5;
if (!checkweight2(.@item,.@amount)) {
mes "Sorry, you cannot hold this amount of fruit!";
}
basicskillcheck()
This function will return the state of the configuration option
'basic_skill_check' in 'battle_athena.conf'. It returns 1 if the option is
enabled and 0 if it isn't. If the 'basic_skill_check' option is enabled, which
it is by default, characters must have a certain number of basic skill levels to
sit, request a trade, use emotions, etc. Making your script behave differently
depending on whether the characters must actually have the skill to do all these
things might in some cases be required.
checkoption(<option number>{,<char_id>});
checkoption1(<option number>{,<char_id>});
checkoption2(<option number>{,<char_id>});
setoption <option number>{,<flag>{,<char_id>}};
The 'setoption' series of functions check for a so-called option that is set on
the invoking character. 'Options' are used to store status conditions and a lot
of other non-permanent character data of the yes-no kind. For most common cases,
it is better to use 'checkcart','checkfalcon','checkriding' and other similar
functions, but there are some options which you cannot get at this way. They
return 1 if the option is set and 0 if the option is not set.
Option numbers valid for the first (option) version of this command are:
0x1 - Sight in effect.
0x2 - Hide in effect.
0x4 - Cloaking in effect.
0x8 - Cart number 1 present.
0x10 - Falcon present.
0x20 - Peco Peco present.
0x40 - GM Perfect Hide in effect.
0x80 - Cart number 2 present.
0x100 - Cart number 3 present.
0x200 - Cart number 4 present.
0x400 - Cart number 5 present.
0x800 - Orc head present.
0x1000 - The character is wearing a wedding sprite.
0x2000 - Ruwach is in effect.
0x4000 - Chasewalk in effect.
0x8000 - Flying or Xmas suit.
0x10000 - Sighttrasher.
0x100000 - Warg present.
0x200000 - The character is riding a warg.
Option numbers valid for the second version (opt1) of this command are:
1 - Petrified.
2 - Frozen.
3 - Stunned.
4 - Sleeping.
6 - Petrifying (the state where you can still walk)
Option numbers valid for the third version (opt2) of this command are:
0x1 - Poisoned.
0x2 - Cursed.
0x4 - Silenced.
0x8 - Signum Crucis (plays a howl-like sound effect, but otherwise no visible effects are displayed)
0x10 - Blinded.
0x80 - Deadly poisoned.
Option numbers (except for opt1) are bit-masks - you can add them up to check
for several states, but the functions will return true if at least one of them
is in effect.
'setoption' will set options on the invoking character. There are no second and
third versions of this command, so you can only change the values in the first
list (cloak, cart, ruwach, etc). if flag is 1 (default when omitted),
the option will be added to what the character currently has; if 0, the option is removed.
This is definitely not a complete list of available option flag numbers. Ask a
core developer (or read the source: src/map/status.hpp) for the full list.
setcart {<type>{,<char_id>}};
checkcart({<char_id>});
If <type> is 0 this command will remove the cart from the character.
Otherwise it gives the invoking character a cart. The cart given will be
cart number <type> and will work regardless of whether the character is a
merchant class or not.
Note: the character needs to have the skill MC_PUSHCART to gain a cart
The accompanying function will return 1 if the invoking character has a cart
(any kind of cart) and 0 if they don't.
if (checkcart()) mes "But you already have a cart!";
setfalcon {<flag>{,<char_id>}};
checkfalcon({<char_id>});
If <flag> is 0 this command will remove the falcon from the character.
Otherwise it gives the invoking character a falcon. The falcon will be there
regardless of whether the character is a hunter or not. It will (probably) not
have any useful effects for non-hunters though.
Note: the character needs to have the skill HT_FALCON to gain a falcon
The accompanying function will return 1 if the invoking character has a falcon
and 0 if they don't.
if (checkfalcon()) mes "But you already have a falcon!";
setriding {<flag>{,<char_id>}};
checkriding({<char_id>});
If <flag> is 0 this command will remove the mount from the character.
Otherwise it gives the invoking character a PecoPeco (if they are a Knight
series class), a GrandPeco (if they are a Crusader series class), or
a Gryphon (if they are a Royal Guard). Unlike 'setfalcon' and 'setcart'
this will not work at all if they aren't of a class which can ride.
Note: the character needs to have the skill KN_RIDING to gain a mount
The accompanying function will return 1 if the invoking character is riding a
bird and 0 if they aren't.
if (checkriding()) mes "PLEASE leave your bird outside! No riding birds on the floor here!";
setdragon {<color>{,<char_id>}};
checkdragon({<char_id>});
The 'setdragon' function toggles mounting a dragon for the invoking character.
It will return 1 if successful, 0 otherwise.
The available colors are:
1 - Green Dragon (default)
2 - Brown Dragon
3 - Gray Dragon
4 - Blue Dragon
5 - Red Dragon
Note: the character must be a Rune Knight and have the skill RK_DRAGONTRAINING to gain a mount
The accompanying function will return 1 if the invoking character is riding a
dragon and 0 if they aren't.
setmadogear {<flag>{,<char_id>}};
checkmadogear({<char_id>});
If <flag> is 0 this command will remove the mount from the character.
Otherwise it gives the invoking character a Mado (if they are a Mechanic).
The accompanying function will return 1 if the invoking character has a
Mado and 0 if they don't.
setmounting {<char_id>};
ismounting({<char_id>});
The 'setmounting' function toggles cash mount for the invoking character.
It will return 1 if successful, 0 otherwise.
Note: Character must not be mounting a non-cash mount (eg. dragon, peco, wug, etc.)
The accompanying function will return 1 if the invoking character has a
cash mount and 0 if they don't.
checkwug({<char_id>});
This function will return 1 if the invoking character has a
warg and 0 if they don't.
checkvending({"<Player Name>"})
Checks if the player is vending or has has a buyingstore. Additionally
it gives you the information whether the player uses autotrade or not.
Name is optional, and defaults to the attached player if omitted.
The returned value is bitmask of.
0 = doesn't have a vending or buyingstore (which also means he can't use autotrade)
1 = normal vending
2 = using @autotrade
4 = has a buyingstore
Examples:
//This will check Aaron's state
.@state = checkvending("Aaron");
if (.@state&1)
mes "Aaron is currently vending!";
if (.@state&4)
mes "Aaron has a buying store!";
if (.@state&2)
mes "Aaron is autotrading!";
checkchatting({"<Player Name>"})
Checks if the player is in a chatroom.
Name is optional, and defaults to the attached player if omitted.
Returns 1 if they are in a chat room, 0 if they are not.
Examples:
//This will check if the attached player in a chat room or not.
if (checkchatting())
mes "You are currently in a chat room!";
checkidle({"<Player Name>"})
Returns the time, in seconds, that the specified player has been idle.
Name is optional, and defaults to the attached player if omitted.
agitcheck();
agitcheck2();
agitcheck3();
These function will let you check whether the server is currently in WoE:FE mode
(agitcheck()), WoE:SE mode (agitcheck2()), or WoE:TE mode (agitcheck3()) and will
return true if War of Emperium is on and false if it isn't.
isnight();
isday();
These functions will return 1 or 0 depending on whether the server is in night
mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday'
the other way around. They can be used interchangeably, pick the one you like
more:
// These two are equivalent:
if (isday()) mes "I only prowl in the night.";
if (isnight() != 1) mes "I only prowl in the night.";
checkre(<type>)
Checks if a renewal feature is enabled or not in renewal.hpp, and returns 1 if
enabled and 0 for disabled.
The renewal feature to check is determined by type.
0 - RENEWAL (game renewal server mode)
1 - RENEWAL_CAST (renewal cast time)
2 - RENEWAL_DROP (renewal drop rate algorithms)
3 - RENEWAL_EXP (renewal exp rate algorithms)
4 - RENEWAL_LVDMG (renewal level modifier on damage)
5 - RENEWAL_ASPD (renewal ASPD)
Copyright © 工程的初始时间(可选)–2019. All rights reserved.