diff options
author | megamage <none@none> | 2009-05-30 22:15:05 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-30 22:15:05 -0500 |
commit | 8d1f4f9ea0beb503e2a3014abb95263e501ef1c5 (patch) | |
tree | 41d48951c315129dee817befa40d4dab90d3fd14 /src/game/Debugcmds.cpp | |
parent | b5778357d9d8c5fb10da5d99c46b48250578cb49 (diff) |
*Provide another way to implement dynamic spawns. Now a creature will call its zonescript before spawn to determine the spawned entry. This can be used to implement zones such as wintergrasp with less data requirement (only need to know the entry of counterpart creatures, not require spawn points)
*Use zonescript as basic class of opvp script and dugeon script (can also be used for bg)
*Store zonescript in worldobject.
*Add door for sapphiron.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Debugcmds.cpp')
-rw-r--r-- | src/game/Debugcmds.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index fda50f8b9a6..196816fff02 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -782,21 +782,11 @@ bool ChatHandler::HandleDebugSpawnVehicle(const char* args) Vehicle *v = new Vehicle; Map *map = m_session->GetPlayer()->GetMap(); - if(!v->Create(objmgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, m_session->GetPlayer()->GetPhaseMask(), entry, id, m_session->GetPlayer()->GetTeam())) - { - delete v; - return false; - } - - float px, py, pz; - m_session->GetPlayer()->GetClosePoint(px, py, pz, m_session->GetPlayer()->GetObjectSize()); - - v->Relocate(px, py, pz, m_session->GetPlayer()->GetOrientation()); + float x, y, z, o = m_session->GetPlayer()->GetOrientation(); + m_session->GetPlayer()->GetClosePoint(x, y, z, m_session->GetPlayer()->GetObjectSize()); - if(!v->IsPositionValid()) + if(!v->Create(objmgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, m_session->GetPlayer()->GetPhaseMask(), entry, id, m_session->GetPlayer()->GetTeam(), x, y, z, o)) { - sLog.outError("Vehicle (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", - v->GetGUIDLow(), v->GetEntry(), v->GetPositionX(), v->GetPositionY()); delete v; return false; } |