mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Implemented Phase Definitions, Terrainswap and multiphasing
* fixes cataclysm aura effect SPELL_AURA_PHASE without phasemasks defined in miscValueA NOTE: - Need some more test and feedback! Thanks to: - Naios: Main Author - Cyberbrest: For the hard research work about multiphasing. - Venugh: He helped me with a lot of strange compile Errors. - Shauren: For the 4.3.4 phaseshift packet. - Booksize: He showed me how terrainswap works - Zakamurite: For Backporting some to MaNGOS - All other Author
This commit is contained in:
parent
7c485a9ccc
commit
ab2c78ba59
29 changed files with 418 additions and 210 deletions
|
|
@ -42,6 +42,7 @@
|
|||
#include "GMTicketMgr.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "Util.h"
|
||||
#include "PhaseMgr.h"
|
||||
#include <cctype>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
|
@ -1100,7 +1101,7 @@ bool ChatHandler::HandleGameObjectAddCommand(char* args)
|
|||
}
|
||||
|
||||
GameObject* pGameObj = new GameObject;
|
||||
if (!pGameObj->Create(db_lowGUID, gInfo->id, map, plr->GetPhaseMaskForSpawn(), x, y, z, o))
|
||||
if (!pGameObj->Create(db_lowGUID, gInfo->id, map, plr->GetPhaseMgr()->GetPhaseMaskForSpawn(), x, y, z, o))
|
||||
{
|
||||
delete pGameObj;
|
||||
return false;
|
||||
|
|
@ -1110,7 +1111,7 @@ bool ChatHandler::HandleGameObjectAddCommand(char* args)
|
|||
pGameObj->SetRespawnTime(spawntimeSecs);
|
||||
|
||||
// fill the gameobject data and save to the db
|
||||
pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), plr->GetPhaseMaskForSpawn());
|
||||
pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), plr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
|
||||
// this will generate a new guid if the object is in an instance
|
||||
if (!pGameObj->LoadFromDB(db_lowGUID, map))
|
||||
|
|
@ -1590,7 +1591,7 @@ bool ChatHandler::HandleNpcAddCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
|
||||
uint32 db_guid = pCreature->GetGUIDLow();
|
||||
|
||||
|
|
@ -2598,7 +2599,10 @@ bool ChatHandler::HandleModifyPhaseCommand(char* args)
|
|||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target))
|
||||
return false;
|
||||
|
||||
target->SetPhaseMask(phasemask, true);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)target)->GetPhaseMgr()->SetCustomPhase(phasemask);
|
||||
else
|
||||
target->SetPhaseMask(phasemask,true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3307,7 +3311,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
|
||||
wpCreature->LoadFromDB(wpCreature->GetGUIDLow(), map);
|
||||
map->Add(wpCreature);
|
||||
|
|
@ -3419,7 +3423,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
|
||||
wpCreature2->LoadFromDB(wpCreature2->GetGUIDLow(), map);
|
||||
map->Add(wpCreature2);
|
||||
|
|
@ -3704,7 +3708,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
|
|||
|
||||
Field* fields = result->Fetch();
|
||||
uint32 point = fields[0].GetUInt32();
|
||||
CreatureCreatePos pos(map, fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), chr->GetOrientation(), chr->GetPhaseMaskForSpawn());
|
||||
CreatureCreatePos pos(map, fields[1].GetFloat(), fields[2].GetFloat(), fields[3].GetFloat(), chr->GetOrientation(), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
|
||||
Creature* wpCreature = new Creature;
|
||||
|
||||
|
|
@ -3721,7 +3725,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
|
|||
// set "wpguid" column to the visual waypoint
|
||||
WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid=%u WHERE id=%u and point=%u", wpCreature->GetGUIDLow(), lowguid, point);
|
||||
|
||||
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
|
||||
wpCreature->LoadFromDB(wpCreature->GetGUIDLow(), map);
|
||||
map->Add(wpCreature);
|
||||
|
|
@ -3750,7 +3754,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
|
|||
Map* map = chr->GetMap();
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
CreatureCreatePos pos(map, fields[0].GetFloat(), fields[1].GetFloat(), fields[2].GetFloat(), chr->GetOrientation(), chr->GetPhaseMaskForSpawn());
|
||||
CreatureCreatePos pos(map, fields[0].GetFloat(), fields[1].GetFloat(), fields[2].GetFloat(), chr->GetOrientation(), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
|
||||
|
|
@ -3762,7 +3766,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
pCreature->LoadFromDB(pCreature->GetGUIDLow(), map);
|
||||
map->Add(pCreature);
|
||||
// player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "First Waypoint");
|
||||
|
|
@ -3798,7 +3802,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
|
|||
Map* map = chr->GetMap();
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
CreatureCreatePos pos(map, fields[0].GetFloat(), fields[1].GetFloat(), fields[2].GetFloat(), chr->GetOrientation(), chr->GetPhaseMaskForSpawn());
|
||||
CreatureCreatePos pos(map, fields[0].GetFloat(), fields[1].GetFloat(), fields[2].GetFloat(), chr->GetOrientation(), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
|
||||
|
|
@ -3810,7 +3814,7 @@ bool ChatHandler::HandleWpShowCommand(char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn());
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr()->GetPhaseMaskForSpawn());
|
||||
pCreature->LoadFromDB(pCreature->GetGUIDLow(), map);
|
||||
map->Add(pCreature);
|
||||
// player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "Last Waypoint");
|
||||
|
|
@ -3869,6 +3873,15 @@ bool ChatHandler::HandleWpShowCommand(char* args)
|
|||
return true;
|
||||
} // HandleWpShowCommand
|
||||
|
||||
bool ChatHandler::HandleReloadPhaseDefinitionsCommand(char* /*args*/)
|
||||
{
|
||||
SendSysMessage("Reloading phase_definitions table...");
|
||||
sObjectMgr.LoadPhaseDefinitions();
|
||||
sWorld.UpdatePhaseDefinitions();
|
||||
SendSysMessage("Phase Definitions reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleWpExportCommand(char* args)
|
||||
{
|
||||
if (!*args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue