From 8d1f4f9ea0beb503e2a3014abb95263e501ef1c5 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 30 May 2009 22:15:05 -0500 Subject: *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 --- src/game/OutdoorPvPMgr.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/game/OutdoorPvPMgr.cpp') diff --git a/src/game/OutdoorPvPMgr.cpp b/src/game/OutdoorPvPMgr.cpp index 7d367392764..446f7e2ce95 100644 --- a/src/game/OutdoorPvPMgr.cpp +++ b/src/game/OutdoorPvPMgr.cpp @@ -207,15 +207,13 @@ bool OutdoorPvPMgr::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * return false; } -void OutdoorPvPMgr::OnGameObjectCreate(GameObject *go, bool add) +ZoneScript * OutdoorPvPMgr::GetZoneScript(uint32 zoneId) { - if(go->GetGoType() != GAMEOBJECT_TYPE_CAPTURE_POINT) - return; - - for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) - for(OutdoorPvP::OPvPCapturePointMap::iterator itr2 = (*itr)->m_capturePoints.begin(); itr2 != (*itr)->m_capturePoints.end(); ++itr2) - if((*itr2)->m_CapturePointGUID == go->GetDBTableGUIDLow()) - (*itr2)->m_capturePoint = add ? go : NULL; + OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneId); + if(itr != m_OutdoorPvPMap.end()) + return itr->second; + else + return NULL; } bool OutdoorPvPMgr::HandleOpenGo(Player *plr, uint64 guid) -- cgit v1.2.3