public class 0700_Instance_Commands extends Object
=========================== |0700.- Instance commands.| ===========================
| 构造器和说明 |
|---|
0700_Instance_Commands() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
instance_announce()
instance_announce <instance id>,"<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}};
Broadcasts a message to all players in the instance <instance id> currently
residing on an instance map.
|
void |
instance_check_clan()
instance_check_clan(<clan id>{,<amount>{,<min>{,<max>}}})
This function checks if a clan meets certain requirements, returning 1 if all
conditions are met and 0 otherwise.
|
void |
instance_check_guild()
instance_check_guild(<guild id>{,<amount>{,<min>{,<max>}}})
This function checks if a guild meets certain requirements, returning 1 if all
conditions are met and 0 otherwise.
|
void |
instance_check_party()
instance_check_party(<party id>{,<amount>{,<min>{,<max>}}})
This function checks if a party meets certain requirements, returning 1 if all
conditions are met and 0 otherwise.
|
void |
instance_create()
instance_create("<instance name>"{,<instance mode>{,<owner id>}});
Creates an instance for the <owner id> of <mode>.
|
void |
instance_destroy()
instance_destroy {<instance id>};
Destroys instance with the ID <instance id>.
|
void |
instance_enter()
instance_enter("<instance name>",{<x>,<y>,<char_id>,<instance id>});
Warps player to the specified instance after the script terminates.
|
void |
instance_id()
instance_id()
Returns the unique instance id of the attached script.
|
void |
instance_info()
instance_info("<instance name>",<info type>{,<instance_db map index>});
Returns the specified <info type> of the given <instance name> from the instance database.
|
void |
instance_mapname()
instance_mapname("<map name>"{,<instance id>})
Returns the unique name of the instanced map.
|
void |
instance_npcname()
instance_npcname("<npc name>"{,<instance id>})
Returns the unique name of the instanced script.
|
void |
instance_warpall()
instance_warpall "<map name>",<x>,<y>{,<instance id>};
Warps all players in the instance <instance id> to <map name> at given
coordinates.
|
instance_create("<instance name>"{,<instance mode>{,<owner id>}});
Creates an instance for the <owner id> of <mode>. The instance name, along with
all other instance data, is read from 'db/(pre-)re/instance_db.txt'. Upon success,
the command generates a unique instance ID, duplicates all listed maps and NPCs,
sets the alive time, and triggers the "OnInstanceInit" label in all NPCs inside
the instance.
Instance Mode options:
IM_NONE: Attached to no one.
IM_CHAR: Attached to a single character.
IM_PARTY: Attached to a party (default instance mode).
IM_GUILD: Attached to a guild.
IM_CLAN: Attached to a clan.
The command returns the instance ID upon success, and these values upon failure:
-1: Invalid type.
-2: Character/Party/Guild/Clan not found.
-3: Instance already exists.
-4: No free instances (MAX_INSTANCE exceeded).
instance_destroy {<instance id>};
Destroys instance with the ID <instance id>. If no ID is specified, the instance
the script is attached to is used. If the script is not attached to an instance,
the instance of the currently attached player is used (if it is a character, party,
guild or clan mode). If it is not owned by anyone, no player needs to be attached. If
that fails, the script will come to a halt. This will also trigger the "OnInstanceDestroy"
label in all NPCs inside the instance.
instance_enter("<instance name>",{<x>,<y>,<char_id>,<instance id>});
Warps player to the specified instance after the script terminates. The map and
coordinates are located in 'db/(pre-)re/instance_db.txt'.
The command returns IE_OK upon success, and these values upon failure:
IE_NOMEMBER: Party/Guild/Clan not found (for party/guild/clan modes).
IE_NOINSTANCE: Character/Party/Guild/Clan does not have an instance.
IE_OTHER: Other errors (invalid instance name, instance doesn't match with character/party/guild/clan).
Put -1 for x and y if want to warp player with default entrance coordinates.
instance_npcname("<npc name>"{,<instance id>})
Returns the unique name of the instanced script. If no ID is specified,
the instance the script is attached to is used. If the script is not attached to
an instance, the instance of the currently attached NPC, player, party, guild
or clan is used. If that fails, the script will come to a halt.
instance_mapname("<map name>"{,<instance id>})
Returns the unique name of the instanced map. If no instance ID is specified,
the instance the script is attached to is used. If the script is not attached to
an instance, the instance of the currently attached player is used (if it is a
character, party, guild or clan mode). If it is not owned by anyone, no player needs
to be attached. If that fails, the command returns an empty string instead.
instance_id()
Returns the unique instance id of the attached script. If the script is not
attached to an instance, the instance of the currently attached player is
used (if it is a character, party, guild or clan mode). If it is not owned by anyone, no
player needs to be attached. If that fails, the function will return 0.
instance_warpall "<map name>",<x>,<y>{,<instance id>};
Warps all players in the instance <instance id> to <map name> at given
coordinates. If no ID is specified, the instance the script is attached to
is used. If the script is not attached to an instance, the instance of the
currently attached player is used (if it is a character, party, guild or clan
mode). If it is not owned by anyone, no player needs to be attached. If that
fails, the script will come to a halt.
instance_announce <instance id>,"<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}};
Broadcasts a message to all players in the instance <instance id> currently
residing on an instance map. If 0 is specified for <instance id>, the instance
the script is attached to is used. If the script is not attached to an instance,
the instance of the currently attached player is used (if it is a character,
party, guild or clan mode). If it is not owned by anyone, no player needs to be attached.
For details on the other parameters, see 'announce'.
instance_check_party(<party id>{,<amount>{,<min>{,<max>}}})
This function checks if a party meets certain requirements, returning 1 if all
conditions are met and 0 otherwise. It will only check online characters.
amount - number of online party members (default is 1).
min - minimum level of all characters in the party (default is 1).
max - maximum level of all characters in the party (default is max level in conf).
Example:
if (instance_check_party(getcharid(1),2,2,149)) {
mes "Your party meets the Memorial Dungeon requirements.",
mes "All online members are between levels 1-150 and at least two are online.";
close;
} else {
mes "Sorry, your party does not meet requirements.";
close;
}
instance_check_guild(<guild id>{,<amount>{,<min>{,<max>}}})
This function checks if a guild meets certain requirements, returning 1 if all
conditions are met and 0 otherwise. It will only check online characters.
amount - number of online guild members (default is 1).
min - minimum level of all characters in the guild (default is 1).
max - maximum level of all characters in the guild (default is max level in conf).
Example:
if (instance_check_guild(getcharid(2),2,2,149)) {
mes "Your guild meets the Memorial Dungeon requirements.",
mes "All online members are between levels 1-150 and at least two are online.";
close;
} else {
mes "Sorry, your guild does not meet requirements.";
close;
}
instance_check_clan(<clan id>{,<amount>{,<min>{,<max>}}})
This function checks if a clan meets certain requirements, returning 1 if all
conditions are met and 0 otherwise. It will only check online characters.
amount - number of online clan members (default is 1).
min - minimum level of all characters in the clan (default is 1).
max - maximum level of all characters in the clan (default is max level in conf).
Example:
if (instance_check_clan(getcharid(5),2,2,149)) {
mes "Your clan meets the Memorial Dungeon requirements.",
mes "All online members are between levels 1-150 and at least two are online.";
close;
} else {
mes "Sorry, your clan does not meet requirements.";
close;
}
instance_info("<instance name>",<info type>{,<instance_db map index>});
Returns the specified <info type> of the given <instance name> from the instance database.
If the <instance name> is unknown or an invalid <info type> is supplied -1 will be returned.
Valid info types:
IIT_ID: Instance database ID as integer.
IIT_TIME_LIMIT: Instance database total life time as integer.
IIT_IDLE_TIMEOUT: Instance database timeout time as integer.
IIT_ENTER_MAP: Instance database enter map as string.
IIT_ENTER_X: Instance database enter X location as integer.
IIT_ENTER_Y: Instance database enter Y location as integer.
IIT_MAPCOUNT: Instance database total maps as integer.
IIT_MAP: Instance database map name from the given <instance_db map index> as string.
If the index is invalid an empty string will be returned.
Example:
.@name$ = "Endless Tower";
mes .@name$ + " will be destroyed if no one is in the instance for " + instance_info(.@name$,IIT_IDLETIMEOUT) + " seconds.";
// Endless Tower will be destroyed if no one is in the instance for 300 seconds.
Copyright © 工程的初始时间(可选)–2019. All rights reserved.