Rename .goname to .appear, .namego to .summon, and .groupgo to .groupsummon. Also do some cleanup in Level1.cpp.
Fixes issue #3451 --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
DELETE FROM `command` WHERE `name` IN ('summon', 'appear', 'groupsummon');
|
||||
UPDATE `command` SET `name`='summon' WHERE `name`='namego';
|
||||
UPDATE `command` SET `name`='appear' WHERE `name`='goname';
|
||||
UPDATE `command` SET `name`='groupsummon' WHERE `name`='groupgo';
|
||||
@@ -711,9 +711,9 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "gmannounce", SEC_MODERATOR, true, &ChatHandler::HandleGMAnnounceCommand, "", NULL },
|
||||
{ "notify", SEC_MODERATOR, true, &ChatHandler::HandleNotifyCommand, "", NULL },
|
||||
{ "gmnotify", SEC_MODERATOR, true, &ChatHandler::HandleGMNotifyCommand, "", NULL },
|
||||
{ "goname", SEC_MODERATOR, false, &ChatHandler::HandleGonameCommand, "", NULL },
|
||||
{ "namego", SEC_MODERATOR, false, &ChatHandler::HandleNamegoCommand, "", NULL },
|
||||
{ "groupgo", SEC_MODERATOR, false, &ChatHandler::HandleGroupgoCommand, "", NULL },
|
||||
{ "appear", SEC_MODERATOR, false, &ChatHandler::HandleAppearCommand, "", NULL },
|
||||
{ "summon", SEC_MODERATOR, false, &ChatHandler::HandleSummonCommand, "", NULL },
|
||||
{ "groupsummon", SEC_MODERATOR, false, &ChatHandler::HandleGroupSummonCommand, "", NULL },
|
||||
{ "commands", SEC_PLAYER, true, &ChatHandler::HandleCommandsCommand, "", NULL },
|
||||
{ "demorph", SEC_GAMEMASTER, false, &ChatHandler::HandleDeMorphCommand, "", NULL },
|
||||
{ "die", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDieCommand, "", NULL },
|
||||
|
||||
@@ -501,9 +501,9 @@ class ChatHandler
|
||||
bool HandleDismountCommand(const char* args);
|
||||
bool HandleSaveCommand(const char* args);
|
||||
|
||||
bool HandleNamegoCommand(const char* args);
|
||||
bool HandleGonameCommand(const char* args);
|
||||
bool HandleGroupgoCommand(const char* args);
|
||||
bool HandleSummonCommand(const char* args);
|
||||
bool HandleAppearCommand(const char* args);
|
||||
bool HandleGroupSummonCommand(const char* args);
|
||||
bool HandleRecallCommand(const char* args);
|
||||
bool HandleAnnounceCommand(const char* args);
|
||||
bool HandleNotifyCommand(const char* args);
|
||||
|
||||
@@ -737,6 +737,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
|
||||
GridPair p = Trinity::ComputeGridPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
|
||||
// 63? WHY?
|
||||
int gx = 63 - p.x_coord;
|
||||
int gy = 63 - p.y_coord;
|
||||
|
||||
@@ -748,7 +749,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
if(map->IsOutdoors(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ()))
|
||||
PSendSysMessage("You are outdoors");
|
||||
else
|
||||
PSendSysMessage("You are indoor");
|
||||
PSendSysMessage("You are indoors");
|
||||
}
|
||||
else PSendSysMessage("no VMAP available for area info");
|
||||
|
||||
@@ -784,7 +785,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
}
|
||||
|
||||
//Summon Player
|
||||
bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
bool ChatHandler::HandleSummonCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
@@ -827,12 +828,8 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
}
|
||||
// if both players are in different bgs
|
||||
else if (target->GetBattlegroundId() && m_session->GetPlayer()->GetBattlegroundId() != target->GetBattlegroundId())
|
||||
{
|
||||
target->LeaveBattleground(false); // Note: should be changed so target gets no Deserter debuff
|
||||
//PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,nameLink.c_str());
|
||||
//SetSentErrorMessage(true);
|
||||
//return false;
|
||||
}
|
||||
|
||||
// all's well, set bg id
|
||||
// when porting out from the bg, it will be reset to 0
|
||||
target->SetBattlegroundId(m_session->GetPlayer()->GetBattlegroundId(), m_session->GetPlayer()->GetBattlegroundTypeId());
|
||||
@@ -843,14 +840,9 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
else if (pMap->IsDungeon())
|
||||
{
|
||||
Map* cMap = target->GetMap();
|
||||
|
||||
if (cMap->Instanceable() && cMap->GetInstanceId() != pMap->GetInstanceId())
|
||||
{
|
||||
target->UnbindInstance(pMap->GetInstanceId(), target->GetDungeonDifficulty(), true);
|
||||
// cannot summon from instance to instance
|
||||
//PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,nameLink.c_str());
|
||||
//SetSentErrorMessage(true);
|
||||
//return false;
|
||||
}
|
||||
|
||||
// we are in instance, and can summon only player in our group with us as lead
|
||||
if (!m_session->GetPlayer()->GetGroup() || !target->GetGroup() ||
|
||||
@@ -908,7 +900,7 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
}
|
||||
|
||||
//Teleport to Player
|
||||
bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
@@ -944,12 +936,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
}
|
||||
// if both players are in different bgs
|
||||
else if (_player->GetBattlegroundId() && _player->GetBattlegroundId() != target->GetBattlegroundId())
|
||||
{
|
||||
_player->LeaveBattleground(false); // Note: should be changed so _player gets no Deserter debuff
|
||||
//PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
|
||||
//SetSentErrorMessage(true);
|
||||
//return false;
|
||||
}
|
||||
|
||||
// all's well, set bg id
|
||||
// when porting out from the bg, it will be reset to 0
|
||||
_player->SetBattlegroundId(target->GetBattlegroundId(), target->GetBattlegroundTypeId());
|
||||
@@ -959,8 +947,6 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
}
|
||||
else if (cMap->IsDungeon())
|
||||
{
|
||||
//Map* pMap = _player->GetMap();
|
||||
|
||||
// we have to go to instance, and can go to player only if:
|
||||
// 1) we are in his group (either as leader or as member)
|
||||
// 2) we are not bound to any group and have GM mode on
|
||||
@@ -1005,8 +991,6 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
|
||||
//if (needReportToTarget(target))
|
||||
// ChatHandler(target).PSendSysMessage(LANG_APPEARING_TO, GetNameLink().c_str());
|
||||
|
||||
// stop flight if need
|
||||
if (_player->isInFlight())
|
||||
@@ -1130,16 +1114,6 @@ bool ChatHandler::HandleModifyManaCommand(const char* args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// char* pmana = strtok((char*)args, " ");
|
||||
// if (!pmana)
|
||||
// return false;
|
||||
|
||||
// char* pmanaMax = strtok(NULL, " ");
|
||||
// if (!pmanaMax)
|
||||
// return false;
|
||||
|
||||
// int32 manam = atoi(pmanaMax);
|
||||
// int32 mana = atoi(pmana);
|
||||
int32 mana = atoi((char*)args);
|
||||
int32 manam = atoi((char*)args);
|
||||
|
||||
@@ -2595,7 +2569,7 @@ bool ChatHandler::HandleTeleGroupCommand(const char * args)
|
||||
}
|
||||
|
||||
//Summon group of player
|
||||
bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||
bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
@@ -2751,7 +2725,8 @@ bool ChatHandler::HandleGoXYCommand(const char* args)
|
||||
uint32 mapid;
|
||||
if (pmapid)
|
||||
mapid = (uint32)atoi(pmapid);
|
||||
else mapid = _player->GetMapId();
|
||||
else
|
||||
mapid = _player->GetMapId();
|
||||
|
||||
if (!MapManager::IsValidMapCoord(mapid,x,y))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user