public class 0202_Guild_Related extends Object
================================ |0202.- Guild-related commands.| ================================
| 构造器和说明 |
|---|
0202_Guild_Related() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
getcastledata()
getcastledata("<map name>",<type of data>)
setcastledata "<map name>",<type of data>,<value>;
This function returns the castle ownership information for the castle referred
to by its map name.
|
void |
getcastlename()
getcastlename("<map name>")
This function returns the name of the castle when given the map name for that
castle.
|
void |
getgdskilllv()
getgdskilllv(<guild id>,<skill id>)
getgdskilllv(<guild id>,"<skill name>")
This function returns the level of the skill <skill id> of the guild <guild id>.
|
void |
getguildmaster()
getguildmaster(<guild id>)
This function return the name of the master of the guild which has the specified
ID number.
|
void |
getguildmasterid()
getguildmasterid(<guild id>)
This function will return the character ID number of the guild master of the
guild specified by the ID. 0 if the character is not a guild master of any guild.
|
void |
getguildmember()
getguildmember <guild id>{,<type>{,<array_variable>}};
This command will find all members of a specified guild and returns their names
(or character id or account id depending on the value of "type") into an array
of temporary global variables.
|
void |
getguildname()
getguildname(<guild id>)
This function returns a guild's name given an ID number.
|
void |
getmapguildusers()
getmapguildusers("<map name>",<guild id>)
Returns the amount of characters from the specified guild on the given map.
|
void |
is_guild_leader()
is_guild_leader({<guild ID>})
This command will return true if the player attached to the script is the leader
of his/her guild, or, if a guild ID is specified, of that guild.
|
void |
requestguildinfo()
requestguildinfo <guild id>{,"<event label>"};
This command requests the guild data from the char server and merrily continues
with the execution.
|
getguildname(<guild id>)
This function returns a guild's name given an ID number. If there is no such
guild, "null" will be returned.
Example:
mes "The guild " + getguildname(10007) + " are all nice people.";
getguildmember <guild id>{,<type>{,<array_variable>}};
This command will find all members of a specified guild and returns their names
(or character id or account id depending on the value of "type") into an array
of temporary global variables.
Upon executing this,
$@guildmembername$[] is a global temporary string array which contains all the
names of these guild members.
(only set when type is 0 or not specified)
$@guildmembercid[] is a global temporary number array which contains the
character id of these guild members.
(only set when type is 1)
$@guildmemberaid[] is a global temporary number array which contains the
account id of these guild members.
(only set when type is 2)
$@guildmembercount is the number of guild members that were found.
The guild members will be found regardless of whether they are online or offline.
Note that the names come in no particular order.
Be sure to use $@guildmembercount to go through this array, and not
'getarraysize', because it is not cleared between runs of 'getguildmember'.
If 'array_variable' is set, the result will be stored to that variable instead
using global variable.
For usage examples, see 'getpartymember'.
getguildmaster(<guild id>)
This function return the name of the master of the guild which has the specified
ID number. If there is no such guild, "null" will be returned.
Example 1:
// Prints the guild master of guild 10007, whoever that might be.
mes getguildmaster(10007) + " runs " + getguildname(10007);
Example 2:
// Checks if the character is the guild master of the specified guild.
.@GID = getcharid(2);
if (.@GID == 0) {
mes "Sorry, you are not in a guild.";
close;
}
if (strcharinfo(0) != getguildmaster(.@GID)) {
mes "Sorry, you don't own the guild you are in.";
close;
}
mes "Welcome, guild master of " + getguildname(.@GID);
close;
getguildmasterid(<guild id>)
This function will return the character ID number of the guild master of the
guild specified by the ID. 0 if the character is not a guild master of any guild.
is_guild_leader({<guild ID>})
This command will return true if the player attached to the script is the leader
of his/her guild, or, if a guild ID is specified, of that guild.
getcastlename("<map name>")
This function returns the name of the castle when given the map name for that
castle. The data is read from 'db/castle_db.txt'.
getcastledata("<map name>",<type of data>);
setcastledata "<map name>",<type of data>,<value>;
This function returns the castle ownership information for the castle referred
to by its map name. Castle information is stored in `guild_castle` SQL table.
Types of data correspond to `guild_castle` table columns:
CD_GUILD_ID - Guild ID.
CD_CURRENT_ECONOMY - Castle Economy score.
CD_CURRENT_DEFENSE - Castle Defense score.
CD_INVESTED_ECONOMY - Number of times the economy was invested in today.
CD_INVESTED_DEFENSE - Number of times the defense was invested in today.
CD_NEXT_TIME - unused
CD_PAY_TIME - unused
CD_CREATE_TIME - unused
CD_ENABLED_KAFRA - Is 1 if a Kafra was hired for this castle, 0 otherwise.
CD_ENABLED_GUARDIAN0 - Is 1 if the 1st guardian is present (Soldier Guardian)
CD_ENABLED_GUARDIAN1 - Is 1 if the 2nd guardian is present (Soldier Guardian)
CD_ENABLED_GUARDIAN2 - Is 1 if the 3rd guardian is present (Soldier Guardian)
CD_ENABLED_GUARDIAN3 - Is 1 if the 4th guardian is present (Archer Guardian)
CD_ENABLED_GUARDIAN4 - Is 1 if the 5th guardian is present (Archer Guardian)
CD_ENABLED_GUARDIAN5 - Is 1 if the 6th guardian is present (Knight Guardian)
CD_ENABLED_GUARDIAN6 - Is 1 if the 7th guardian is present (Knight Guardian)
CD_ENABLED_GUARDIAN7 - Is 1 if the 8th guardian is present (Knight Guardian)
All types of data have their meaning determined by War of Emperium scripts,
with exception of:
- CD_GUILD_ID that is always considered ID of the guild that owns the castle,
- CD_CURRENT_DEFENSE that is used in Guardians & Emperium HP calculations,
- CD_ENABLED_GUARDIANX that is always considered to hold guardian presence bits.
The 'setcastledata' command will behave identically, but instead of returning
values for the specified types of accessible data, it will alter them and cause
them to be sent to the char-server for storage.
Changing Guild ID or Castle Defense will trigger additional actions, like
recalculating guardians' HP.
getgdskilllv(<guild id>,<skill id>);
getgdskilllv(<guild id>,"<skill name>");
This function returns the level of the skill <skill id> of the guild <guild id>.
If the guild does not have that skill, 0 is returned.
If the guild does not exist, -1 is returned.
Refer to 'db/(pre-)re/skill_db.txt' for the full list of skills. (GD_* are guild skills)
requestguildinfo <guild id>{,"<event label>"};
This command requests the guild data from the char server and merrily continues
with the execution. Whenever the guild information becomes available (which
happens instantly if the guild information is already in memory, or later, if it
isn't and the map server has to wait for the char server to reply) it will run
the specified event as in a 'donpcevent' call.
getmapguildusers("<map name>",<guild id>)
Returns the amount of characters from the specified guild on the given map.
Example:
mes "You have " + getMapGuildUsers("prontera",getcharid(2)) + " guild members in Prontera.";
Copyright © 工程的初始时间(可选)–2019. All rights reserved.