mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[10314] Implement commands for work with areatriggers in game.
* all teleport commands support new areatrigger and areatriger-target shiftlinks
* .go trigger now let select areatrigger or areatrigger target as teleport point
* New commands:
.trigger - show detail info about areatrigger including all requirements
for teleport with shift-links to items/keys/quest
.trigger active - show all currently activated by character areatriggers
.trigger near - show near areatriggers
* .lookup item now show [usable] postfix if item can be used/equipped by selected character.
This commit is contained in:
parent
835efe7f6a
commit
685edfe7e2
12 changed files with 509 additions and 67 deletions
|
|
@ -40,6 +40,8 @@
|
|||
// |color|Hachievement:achievement_id:player_guid:0:0:0:0:0:0:0:0|h[name]|h|r
|
||||
// - client, item icon shift click, not used in server currently
|
||||
// |color|Harea:area_id|h[name]|h|r
|
||||
// |color|Hareatrigger:id|h[name]|h|r
|
||||
// |color|Hareatrigger_target:id|h[name]|h|r
|
||||
// |color|Hcreature:creature_guid|h[name]|h|r
|
||||
// |color|Hcreature_entry:creature_id|h[name]|h|r
|
||||
// |color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r - client, at shift click in recipes list dialog
|
||||
|
|
@ -610,6 +612,14 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand triggerCommandTable[] =
|
||||
{
|
||||
{ "active", SEC_GAMEMASTER, false, &ChatHandler::HandleTriggerActiveCommand, "", NULL },
|
||||
{ "near", SEC_GAMEMASTER, false, &ChatHandler::HandleTriggerNearCommand, "", NULL },
|
||||
{ "", SEC_GAMEMASTER, true, &ChatHandler::HandleTriggerCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand unbanCommandTable[] =
|
||||
{
|
||||
{ "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanAccountCommand, "", NULL },
|
||||
|
|
@ -654,6 +664,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ "server", SEC_PLAYER, true, NULL, "", serverCommandTable },
|
||||
{ "tele", SEC_MODERATOR, true, NULL, "", teleCommandTable },
|
||||
{ "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable },
|
||||
{ "trigger", SEC_GAMEMASTER, false, NULL, "", triggerCommandTable },
|
||||
{ "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
|
||||
|
||||
{ "aura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAuraCommand, "", NULL },
|
||||
|
|
@ -2285,7 +2296,9 @@ enum LocationLinkType
|
|||
LOCATION_LINK_CREATURE = 3,
|
||||
LOCATION_LINK_GAMEOBJECT = 4,
|
||||
LOCATION_LINK_CREATURE_ENTRY = 5,
|
||||
LOCATION_LINK_GAMEOBJECT_ENTRY = 6
|
||||
LOCATION_LINK_GAMEOBJECT_ENTRY = 6,
|
||||
LOCATION_LINK_AREATRIGGER = 7,
|
||||
LOCATION_LINK_AREATRIGGER_TARGET= 8,
|
||||
};
|
||||
|
||||
static char const* const locationKeys[] =
|
||||
|
|
@ -2297,6 +2310,8 @@ static char const* const locationKeys[] =
|
|||
"Hgameobject",
|
||||
"Hcreature_entry",
|
||||
"Hgameobject_entry",
|
||||
"Hareatrigger",
|
||||
"Hareatrigger_target",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -2311,6 +2326,8 @@ bool ChatHandler::extractLocationFromLink(char* text, uint32& mapid, float& x, f
|
|||
// |color|Hgameobject:go_guid|h[name]|h|r
|
||||
// |color|Hcreature_entry:creature_id|h[name]|h|r
|
||||
// |color|Hgameobject_entry:go_id|h[name]|h|r
|
||||
// |color|Hareatrigger:id|h[name]|h|r
|
||||
// |color|Hareatrigger_target:id|h[name]|h|r
|
||||
char* idS = extractKeyFromLink(text,locationKeys,&type);
|
||||
if(!idS)
|
||||
return false;
|
||||
|
|
@ -2449,6 +2466,49 @@ bool ChatHandler::extractLocationFromLink(char* text, uint32& mapid, float& x, f
|
|||
else
|
||||
return false;
|
||||
}
|
||||
case LOCATION_LINK_AREATRIGGER:
|
||||
{
|
||||
uint32 id = (uint32)atol(idS);
|
||||
|
||||
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(id);
|
||||
if (!atEntry)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
mapid = atEntry->mapid;
|
||||
x = atEntry->x;
|
||||
y = atEntry->y;
|
||||
z = atEntry->z;
|
||||
return true;
|
||||
}
|
||||
case LOCATION_LINK_AREATRIGGER_TARGET:
|
||||
{
|
||||
uint32 id = (uint32)atol(idS);
|
||||
|
||||
if (!sAreaTriggerStore.LookupEntry(id))
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
AreaTrigger const* at = sObjectMgr.GetAreaTrigger(id);
|
||||
if(!at)
|
||||
{
|
||||
PSendSysMessage(LANG_AREATRIGER_NOT_HAS_TARGET, id);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
mapid = at->target_mapId;
|
||||
x = at->target_X;
|
||||
y = at->target_Y;
|
||||
z = at->target_Z;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// unknown type?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue