diff options
| author | megamage <none@none> | 2009-05-30 15:05:54 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-05-30 15:05:54 -0500 |
| commit | 76d0498aae83914b3321039e605e198abe383ac4 (patch) | |
| tree | 8311480f218268e60e4b466a4eace66b76678a7d /src | |
| parent | 790181add08642fc18954c6d165f08ac4aa2c1e9 (diff) | |
*Allow to spawn correct npc for defender/attacker in wintergrasp based on game event. Now only xxx Champion is spawned based on faction for test. Other npc and gameobjects requires DB support (now in db the defender is always horde and attacker always alliance, and the data of counterpart is missing)
*Fix defenders' portal (now only useable for horde)
*Display random model if the model id in creature table is one of those in creature_template table (in this case they should be 0 actually).
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/ObjectMgr.cpp | 27 | ||||
| -rw-r--r-- | src/game/Wintergrasp.cpp | 2 | ||||
| -rw-r--r-- | src/game/Wintergrasp.h | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 52a06ed7e57..7232da67103 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -892,7 +892,15 @@ uint32 ObjectMgr::ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const if (!data || data->displayid == 0) // use defaults from the template { display_id = cinfo->GetRandomValidModelId(); - } else display_id = data->displayid; // overwritten from creature data + } + else + { + display_id = data->displayid; // overwritten from creature data + // I do not know why but in db most display id are not zero + if(display_id == cinfo->Modelid_A1 || display_id == cinfo->Modelid_A2 + || display_id == cinfo->Modelid_H1 || display_id == cinfo->Modelid_H2) + display_id = cinfo->GetRandomValidModelId(); + } return display_id; } @@ -1059,6 +1067,9 @@ void ObjectMgr::LoadCreatures() if(cInfo->HeroicEntry) heroicCreatures.insert(cInfo->HeroicEntry); + //TODO: remove this + gameeventmgr.mGameEventCreatureGuids.resize(52*2-1); + barGoLink bar(result->GetRowCount()); do @@ -1160,6 +1171,20 @@ void ObjectMgr::LoadCreatures() data.phaseMask = 1; } + //if(entry == 32307 || entry == 32308) + if(entry == 30739 || entry == 30740) + { + gameEvent = 51; + uint32 guid2 = objmgr.GenerateLowGuid(HIGHGUID_UNIT); + CreatureData& data2 = mCreatureDataMap[guid2]; + data2 = data; +// data2.id = (entry == 32307 ? 32308 : 32307); + data2.id = (entry == 30739 ? 30740 : 30739); + data2.displayid = 0; + gameeventmgr.mGameEventCreatureGuids[51+51].push_back(guid); + gameeventmgr.mGameEventCreatureGuids[51+50].push_back(guid2); + } + if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system AddCreatureToGrid(guid, &data); diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp index 0103b32b35d..a6f84c83b2e 100644 --- a/src/game/Wintergrasp.cpp +++ b/src/game/Wintergrasp.cpp @@ -19,6 +19,7 @@ #include "Wintergrasp.h" #include "SpellAuras.h" #include "Vehicle.h" +#include "GameEventMgr.h" bool OPvPWintergrasp::SetupOutdoorPvP() { @@ -32,6 +33,7 @@ bool OPvPWintergrasp::SetupOutdoorPvP() } m_defender = TeamId(rand()%2); + gameeventmgr.StartInternalEvent(GameEventWintergraspDefender[m_defender]); return true; } diff --git a/src/game/Wintergrasp.h b/src/game/Wintergrasp.h index e95b7884efb..76838068d48 100644 --- a/src/game/Wintergrasp.h +++ b/src/game/Wintergrasp.h @@ -23,6 +23,8 @@ #define ZONE_WINTERGRASP 4197 +const uint16 GameEventWintergraspDefender[2] = {50, 51}; + #define POS_X_CENTER 4700 #define SPELL_RECRUIT 37795 |
