mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Many, many cmangos Cata commits applied
The following commits were either applied or found not to be applicable:
This commit is contained in:
parent
32a26f44c7
commit
a800f3b1ad
100 changed files with 2385 additions and 1305 deletions
|
|
@ -6101,9 +6101,7 @@ bool ChatHandler::HandleGMFlyCommand(char* args)
|
|||
if (!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
WorldPacket data;
|
||||
target->BuildMoveSetCanFlyPacket(&data, value, 0);
|
||||
target->SendMessageToSet(&data, true);
|
||||
target->SetCanFly(value);
|
||||
PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, GetNameLink(target).c_str(), args);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -7310,6 +7308,64 @@ bool ChatHandler::HandleMmapTestArea(char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
// use ".mmap testheight 10" selecting any creature/player
|
||||
bool ChatHandler::HandleMmapTestHeight(char* args)
|
||||
{
|
||||
float radius = 0.0f;
|
||||
ExtractFloat(&args, radius);
|
||||
if (radius > 40.0f)
|
||||
radius = 40.0f;
|
||||
|
||||
Unit* unit = getSelectedUnit();
|
||||
|
||||
Player* player = m_session->GetPlayer();
|
||||
if (!unit)
|
||||
unit = player;
|
||||
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (radius < 0.1f)
|
||||
radius = static_cast<Creature*>(unit)->GetRespawnRadius();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unit->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
PSendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (radius < 0.1f)
|
||||
{
|
||||
PSendSysMessage("Provided spawn radius for %s is too small. Using 5.0f instead.", unit->GetGuidStr().c_str());
|
||||
radius = 5.0f;
|
||||
}
|
||||
|
||||
float gx, gy, gz;
|
||||
unit->GetPosition(gx, gy, gz);
|
||||
|
||||
Creature* summoned = unit->SummonCreature(VISUAL_WAYPOINT, gx, gy, gz + 0.5f, 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
|
||||
summoned->CastSpell(summoned, 8599, false);
|
||||
uint32 tries = 1;
|
||||
uint32 successes = 0;
|
||||
uint32 startTime = WorldTimer::getMSTime();
|
||||
for (; tries < 500; ++tries)
|
||||
{
|
||||
unit->GetPosition(gx, gy, gz);
|
||||
if (unit->GetMap()->GetReachableRandomPosition(unit, gx, gy, gz, radius))
|
||||
{
|
||||
unit->SummonCreature(VISUAL_WAYPOINT, gx, gy, gz, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
|
||||
++successes;
|
||||
if (successes >= 100)
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint32 genTime = WorldTimer::getMSTimeDiff(startTime, WorldTimer::getMSTime());
|
||||
PSendSysMessage("Generated %u valid points for %u try in %ums.", successes, tries, genTime);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleServerResetAllRaidCommand(char* args)
|
||||
{
|
||||
PSendSysMessage("Global raid instances reset, all players in raid instances will be teleported to homebind!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue