aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/BattleGround.cpp5
-rw-r--r--src/game/BattleGroundSA.cpp87
-rw-r--r--src/game/BattleGroundSA.h19
-rw-r--r--src/scripts/world/go_scripts.cpp11
4 files changed, 107 insertions, 15 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index df58b643294..389fdc25408 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -1485,7 +1485,7 @@ void BattleGround::SpawnBGObject(uint32 type, uint32 respawntime)
}
}
-Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 /*respawntime*/)
+Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime)
{
Map * map = GetBgMap();
if (!map)
@@ -1514,6 +1514,9 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
map->Add(pCreature);
m_BgCreatures[type] = pCreature->GetGUID();
+ if (respawntime)
+ pCreature->SetRespawnDelay(respawntime);
+
return pCreature;
}
/*
diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGroundSA.cpp
index 25fcb74d954..fa8c08b6570 100644
--- a/src/game/BattleGroundSA.cpp
+++ b/src/game/BattleGroundSA.cpp
@@ -88,11 +88,12 @@ bool BattleGroundSA::ResetObjs()
{
if (!AddCreature(BG_SA_NpcEntries[i], i, (attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE),
BG_SA_NpcSpawnlocs[i][0],BG_SA_NpcSpawnlocs[i][1],
- BG_SA_NpcSpawnlocs[i][2],BG_SA_NpcSpawnlocs[i][3]))
+ BG_SA_NpcSpawnlocs[i][2],BG_SA_NpcSpawnlocs[i][3],600))
return false;
}
OverrideGunFaction();
+ DemolisherStartState(true);
for (uint8 i = 0; i <= BG_SA_TITAN_RELIC; i++)
{
@@ -143,7 +144,7 @@ bool BattleGroundSA::ResetObjs()
//GY capture points
for (uint8 i = BG_SA_CENTRAL_FLAG; i < BG_SA_MAXOBJ; i++)
{
- AddObject(i, BG_SA_ObjEntries[i] - (attackers == TEAM_ALLIANCE ? 1:0),
+ AddObject(i, BG_SA_ObjEntries[(i + (attackers == TEAM_ALLIANCE ? 3:0))],
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0,0,0,0,RESPAWN_ONE_DAY);
@@ -236,6 +237,7 @@ void BattleGroundSA::Update(uint32 diff)
{
TotalTime = 0;
ToggleTimer();
+ DemolisherStartState(false);
status = (status == BG_SA_WARMUP) ? BG_SA_ROUND_ONE : BG_SA_ROUND_TWO;
}
if (TotalTime >= BG_SA_BOAT_START)
@@ -276,7 +278,10 @@ void BattleGroundSA::Update(uint32 diff)
}
}
if (status == BG_SA_ROUND_ONE || status == BG_SA_ROUND_TWO)
+ {
SendTime();
+ UpdateDemolisherSpawns();
+ }
}
}
@@ -478,6 +483,23 @@ void BattleGroundSA::OverrideGunFaction()
}
}
+void BattleGroundSA::DemolisherStartState(bool start)
+{
+ if (!m_BgCreatures[0])
+ return;
+
+ for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4; i++)
+ {
+ if (Creature* dem = GetBGCreature(i))
+ {
+ if (start)
+ dem->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ else
+ dem->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ }
+ }
+}
+
void BattleGroundSA::DestroyGate(uint32 i, Player* pl)
{
if (!GateStatus[i])
@@ -565,58 +587,76 @@ void BattleGroundSA::SendTime()
UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round%60000)%10000)/1000);
}
-void BattleGroundSA::EventPlayerClickedOnFlag(Player * /*Source*/, GameObject* target_obj)
+void BattleGroundSA::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
{
switch(target_obj->GetEntry())
{
case 191307:
case 191308:
- CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY);
+ CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY, Source);
break;
case 191305:
case 191306:
- CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY);
+ CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY, Source);
break;
case 191310:
case 191309:
- CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY);
+ CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY, Source);
break;
default:
return;
};
}
-void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i)
+void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
{
DelCreature(BG_SA_MAXNPC + i);
- GraveyardStatus[i] = (GraveyardStatus[i] == TEAM_ALLIANCE? TEAM_HORDE : TEAM_ALLIANCE);
+ GraveyardStatus[i] = Source->GetTeamId();
WorldSafeLocsEntry const *sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], (GraveyardStatus[i] == TEAM_ALLIANCE? ALLIANCE : HORDE));
uint32 npc = 0;
+ uint32 flag = 0;
switch(i)
{
case BG_SA_LEFT_CAPTURABLE_GY:
- SpawnBGObject(BG_SA_LEFT_FLAG,RESPAWN_ONE_DAY);
+ flag = BG_SA_LEFT_FLAG;
+ DelObject(flag);
+ AddObject(flag,BG_SA_ObjEntries[(flag + (Source->GetTeamId() == TEAM_ALLIANCE ? 0:3))],
+ BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1],
+ BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY);
+
npc = BG_SA_NPC_RIGSPARK;
AddCreature(BG_SA_NpcEntries[npc], npc, attackers,
BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1],
BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]);
+
UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0));
UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
break;
case BG_SA_RIGHT_CAPTURABLE_GY:
- SpawnBGObject(BG_SA_RIGHT_FLAG, RESPAWN_ONE_DAY);
+ flag = BG_SA_RIGHT_FLAG;
+ DelObject(flag);
+ AddObject(flag,BG_SA_ObjEntries[(flag + (Source->GetTeamId() == TEAM_ALLIANCE ? 0:3))],
+ BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1],
+ BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY);
+
npc = BG_SA_NPC_SPARKLIGHT;
AddCreature(BG_SA_NpcEntries[npc], npc, attackers,
BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1],
BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]);
+
UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0));
UpdateWorldState(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
break;
case BG_SA_CENTRAL_CAPTURABLE_GY:
- SpawnBGObject(BG_SA_CENTRAL_FLAG, RESPAWN_ONE_DAY);
+ flag = BG_SA_CENTRAL_FLAG;
+ DelObject(flag);
+ AddObject(flag,BG_SA_ObjEntries[(flag + (Source->GetTeamId() == TEAM_ALLIANCE ? 0:3))],
+ BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1],
+ BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY);
+
UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0));
UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
break;
@@ -678,4 +718,29 @@ void BattleGroundSA::EndBattleGround(uint32 winner)
BattleGround::EndBattleGround(winner);
}
+void BattleGroundSA::UpdateDemolisherSpawns()
+{
+ for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4; i++)
+ {
+ if (m_BgCreatures[i])
+ {
+ if (Creature *Demolisher = GetBGCreature(i))
+ {
+ if (Demolisher->isDead())
+ {
+ uint8 gy = (i >= BG_SA_DEMOLISHER_3 ? 3 : 2);
+ if (GraveyardStatus[gy] == attackers)
+ Demolisher->Relocate(BG_SA_NpcSpawnlocs[i + 6][0], BG_SA_NpcSpawnlocs[i + 6][1],
+ BG_SA_NpcSpawnlocs[i + 6][2], BG_SA_NpcSpawnlocs[i + 6][3]);
+ else
+ Demolisher->Relocate(BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1],
+ BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3]);
+
+ Demolisher->Respawn();
+ }
+ }
+ }
+ }
+}
+
diff --git a/src/game/BattleGroundSA.h b/src/game/BattleGroundSA.h
index aedf8307369..fe636c52813 100644
--- a/src/game/BattleGroundSA.h
+++ b/src/game/BattleGroundSA.h
@@ -30,6 +30,9 @@ class BattleGroundSAScore : public BattleGroundScore
uint8 gates_destroyed;
};
+#define BG_SA_FLAG_AMOUNT 3
+#define BG_SA_DEMOLISHER_AMOUNT 4
+
enum BG_SA_Status
{
BG_SA_NOTSTARTED = 0,
@@ -134,7 +137,7 @@ const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] =
29262,
};
-const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC][4] =
+const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] =
{
//Cannons
{ 1436.429f, 110.05f, 41.407f, 5.4f },
@@ -155,6 +158,11 @@ const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC][4] =
//Npcs
{ 1348.644165, -298.786469, 31.080130, 1.710423},
{ 1358.191040, 195.527786, 31.018187, 4.171337},
+ //Demolishers2
+ { 1371.055786, -317.071136, 35.007359, 1.947460},
+ { 1424.034912, -260.195190, 31.084425, 2.820013},
+ { 1353.139893, 223.745438, 35.265411, 4.343684},
+ { 1404.809570, 197.027237, 32.046032, 3.605401},
};
enum BG_SA_Objects
@@ -223,7 +231,7 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] =
* to get horde ones.
*/
-const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ] =
+const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] =
{
190722,
190727,
@@ -245,6 +253,9 @@ const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ] =
191310,
191306,
191308,
+ 191309,
+ 191305,
+ 191307,
};
const uint32 BG_SA_Factions[2] =
@@ -323,10 +334,12 @@ class BattleGroundSA : public BattleGround
void StartShips();
void TeleportPlayers();
void OverrideGunFaction();
+ void DemolisherStartState(bool start);
void DestroyGate(uint32 i, Player* pl);
void SendTime();
- void CaptureGraveyard(BG_SA_Graveyards i);
+ void CaptureGraveyard(BG_SA_Graveyards i, Player *Source);
void ToggleTimer();
+ void UpdateDemolisherSpawns();
TeamId attackers;
uint32 TotalTime;
bool ShipsStarted;
diff --git a/src/scripts/world/go_scripts.cpp b/src/scripts/world/go_scripts.cpp
index e14311f9d31..6f06ac78fd7 100644
--- a/src/scripts/world/go_scripts.cpp
+++ b/src/scripts/world/go_scripts.cpp
@@ -982,6 +982,12 @@ bool GOHello_go_hive_pod(Player *pPlayer, GameObject *pGO)
return true;
}
+bool GOHello_go_massive_seaforium_charge(Player* pPlayer, GameObject *pGo)
+{
+ pGo->SetLootState(GO_JUST_DEACTIVATED);
+ return true;
+}
+
void AddSC_go_scripts()
{
Script *newscript;
@@ -1168,4 +1174,9 @@ void AddSC_go_scripts()
newscript->Name = "go_hive_pod";
newscript->pGOHello = &GOHello_go_hive_pod;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "go_massive_seaforium_charge";
+ newscript->pGOHello = &GOHello_go_massive_seaforium_charge;
+ newscript->RegisterSelf();
}