*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:
megamage
2009-05-30 22:15:05 -05:00
parent b5778357d9
commit 8d1f4f9ea0
25 changed files with 224 additions and 263 deletions

View File

@@ -83,6 +83,9 @@ void GameObject::AddToWorld()
///- Register the gameobject for guid lookup
if(!IsInWorld())
{
if(m_zoneScript)
m_zoneScript->OnGameObjectCreate(this, true);
ObjectAccessor::Instance().AddObject(this);
WorldObject::AddToWorld();
}
@@ -93,16 +96,8 @@ void GameObject::RemoveFromWorld()
///- Remove the gameobject from the accessor
if(IsInWorld())
{
if(Map *map = FindMap())
if(map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData())
((InstanceMap*)map)->GetInstanceData()->OnObjectCreate(this, false);
switch(m_goInfo->type)
{
case GAMEOBJECT_TYPE_CAPTURE_POINT:
sOutdoorPvPMgr.OnGameObjectCreate(this, false);
break;
}
if(m_zoneScript)
m_zoneScript->OnGameObjectCreate(this, false);
// Possible crash at access to deleted GO in Unit::m_gameobj
if(uint64 owner_guid = GetOwnerGUID())
@@ -181,18 +176,9 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
m_goValue->destructibleBuilding.health = goinfo->destructibleBuilding.damagedHealth;
break;
case GAMEOBJECT_TYPE_CAPTURE_POINT:
sOutdoorPvPMgr.OnGameObjectCreate(this, true);
break;
}
//Notify the map's instance data.
//Only works if you create the object in it, not if it is moves to that map.
//Normally non-players do not teleport to other maps.
if(map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData())
{
((InstanceMap*)map)->GetInstanceData()->OnObjectCreate(this, true);
}
SetZoneScript();
return true;
}