aboutsummaryrefslogtreecommitdiff
path: root/src/game/Wintergrasp.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-30 22:15:05 -0500
committermegamage <none@none>2009-05-30 22:15:05 -0500
commit8d1f4f9ea0beb503e2a3014abb95263e501ef1c5 (patch)
tree41d48951c315129dee817befa40d4dab90d3fd14 /src/game/Wintergrasp.cpp
parentb5778357d9d8c5fb10da5d99c46b48250578cb49 (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/Wintergrasp.cpp')
-rw-r--r--src/game/Wintergrasp.cpp60
1 files changed, 58 insertions, 2 deletions
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index a6f84c83b2e..06ef39bd599 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -19,7 +19,8 @@
#include "Wintergrasp.h"
#include "SpellAuras.h"
#include "Vehicle.h"
-#include "GameEventMgr.h"
+//#include "GameEventMgr.h"
+#include "ObjectMgr.h"
bool OPvPWintergrasp::SetupOutdoorPvP()
{
@@ -33,11 +34,66 @@ bool OPvPWintergrasp::SetupOutdoorPvP()
}
m_defender = TeamId(rand()%2);
- gameeventmgr.StartInternalEvent(GameEventWintergraspDefender[m_defender]);
+ //m_defender = TEAM_ALLIANCE;
+ //gameeventmgr.StartInternalEvent(GameEventWintergraspDefender[m_defender]);
return true;
}
+uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, uint32 entry)
+{
+ if(m_defender == TEAM_ALLIANCE)
+ {
+ switch(entry)
+ {
+ case 30739: return 30740;
+ case 30740: return 30739;
+ }
+ }
+ return entry;
+}
+
+/*
+uint32 OPvPWintergrasp::GetGameObjectEntry(uint32 guidlow, uint32 entry)
+{
+ if(m_defender == TEAM_ALLIANCE)
+ {
+ GameObjectInfo const* goInfo = objmgr.GetGameObjectInfo(entry);
+ if(!goInfo)
+ return 0;
+ switch(goInfo->displayId)
+ {
+ case 5651: return 192289;
+ case 5652: return 192288;
+ case 8256: return 192502;
+ case 8257: return 192501;
+ }
+ }
+ return entry;
+}
+*/
+
+void OPvPWintergrasp::OnGameObjectCreate(GameObject *go, bool add)
+{
+ OutdoorPvP::OnGameObjectCreate(go, add);
+ if(m_defender == TEAM_ALLIANCE)
+ {
+ switch(go->GetEntry())
+ {
+ case 190763: go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_defender]); break;
+ }
+
+ // Note: this is only for test, still need db support
+ switch(go->GetGOInfo()->displayId)
+ {
+ case 5651: go->SetUInt32Value(GAMEOBJECT_DISPLAYID, 5652); break;
+ case 5652: go->SetUInt32Value(GAMEOBJECT_DISPLAYID, 5651); break;
+ case 8256: go->SetUInt32Value(GAMEOBJECT_DISPLAYID, 8257); break;
+ case 8257: go->SetUInt32Value(GAMEOBJECT_DISPLAYID, 8256); break;
+ }
+ }
+}
+
void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone)
{
if(!plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL)