mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
*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
This commit is contained in:
@@ -782,25 +782,15 @@ 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()))
|
||||
float x, y, z, o = m_session->GetPlayer()->GetOrientation();
|
||||
m_session->GetPlayer()->GetClosePoint(x, y, z, m_session->GetPlayer()->GetObjectSize());
|
||||
|
||||
if(!v->Create(objmgr.GenerateLowGuid(HIGHGUID_VEHICLE), map, m_session->GetPlayer()->GetPhaseMask(), entry, id, m_session->GetPlayer()->GetTeam(), x, y, z, o))
|
||||
{
|
||||
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());
|
||||
|
||||
if(!v->IsPositionValid())
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
map->Add((Creature*)v);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user