*Fix: Strand of the Ancients.

- Massive Seaforium Charge (needs DB support for the spawns)
 - Demolishers are not attackable at the start
 - Demolishers spawn at the workshop if the graveyard is taken
   (The spawn locations aren't official yet)
 - Demolishers spawn immediately after being destroyed
 To make SotA perfect, it needs a lot of DB support.
 - Seaforium Bomb spawn locations
 - Set speed_run to 0 of the Cannons.

--HG--
branch : trunk
This commit is contained in:
Liberate
2010-05-31 23:01:47 +02:00
parent a623ccd5fa
commit b02bde6d2a
6 changed files with 113 additions and 15 deletions
+1
View File
@@ -0,0 +1 @@
UPDATE `gameobject_template` SET `ScriptName`='go_massive_seaforium_charge' WHERE `entry` = 190752;
@@ -0,0 +1,5 @@
DELETE FROM `spell_linked_spell` WHERE `spell_effect` IN (52418, -52418);
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(52415, 52418, 0, 'Carrying Seaforium - Add'),
(52410, -52418, 0, 'Carrying Seaforium - Remove');
+4 -1
View File
@@ -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(); Map * map = GetBgMap();
if (!map) if (!map)
@@ -1514,6 +1514,9 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
map->Add(pCreature); map->Add(pCreature);
m_BgCreatures[type] = pCreature->GetGUID(); m_BgCreatures[type] = pCreature->GetGUID();
if (respawntime)
pCreature->SetRespawnDelay(respawntime);
return pCreature; return pCreature;
} }
/* /*
+76 -11
View File
@@ -88,11 +88,12 @@ bool BattleGroundSA::ResetObjs()
{ {
if (!AddCreature(BG_SA_NpcEntries[i], i, (attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), 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][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; return false;
} }
OverrideGunFaction(); OverrideGunFaction();
DemolisherStartState(true);
for (uint8 i = 0; i <= BG_SA_TITAN_RELIC; i++) for (uint8 i = 0; i <= BG_SA_TITAN_RELIC; i++)
{ {
@@ -143,7 +144,7 @@ bool BattleGroundSA::ResetObjs()
//GY capture points //GY capture points
for (uint8 i = BG_SA_CENTRAL_FLAG; i < BG_SA_MAXOBJ; i++) 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][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0,0,0,0,RESPAWN_ONE_DAY); 0,0,0,0,RESPAWN_ONE_DAY);
@@ -236,6 +237,7 @@ void BattleGroundSA::Update(uint32 diff)
{ {
TotalTime = 0; TotalTime = 0;
ToggleTimer(); ToggleTimer();
DemolisherStartState(false);
status = (status == BG_SA_WARMUP) ? BG_SA_ROUND_ONE : BG_SA_ROUND_TWO; status = (status == BG_SA_WARMUP) ? BG_SA_ROUND_ONE : BG_SA_ROUND_TWO;
} }
if (TotalTime >= BG_SA_BOAT_START) 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) if (status == BG_SA_ROUND_ONE || status == BG_SA_ROUND_TWO)
{
SendTime(); 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) void BattleGroundSA::DestroyGate(uint32 i, Player* pl)
{ {
if (!GateStatus[i]) if (!GateStatus[i])
@@ -565,58 +587,76 @@ void BattleGroundSA::SendTime()
UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round%60000)%10000)/1000); 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()) switch(target_obj->GetEntry())
{ {
case 191307: case 191307:
case 191308: case 191308:
CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY); CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY, Source);
break; break;
case 191305: case 191305:
case 191306: case 191306:
CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY); CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY, Source);
break; break;
case 191310: case 191310:
case 191309: case 191309:
CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY); CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY, Source);
break; break;
default: default:
return; return;
}; };
} }
void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i) void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
{ {
DelCreature(BG_SA_MAXNPC + i); DelCreature(BG_SA_MAXNPC + i);
GraveyardStatus[i] = (GraveyardStatus[i] == TEAM_ALLIANCE? TEAM_HORDE : TEAM_ALLIANCE); GraveyardStatus[i] = Source->GetTeamId();
WorldSafeLocsEntry const *sg = NULL; WorldSafeLocsEntry const *sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]); 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)); 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 npc = 0;
uint32 flag = 0;
switch(i) switch(i)
{ {
case BG_SA_LEFT_CAPTURABLE_GY: 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; npc = BG_SA_NPC_RIGSPARK;
AddCreature(BG_SA_NpcEntries[npc], npc, attackers, AddCreature(BG_SA_NpcEntries[npc], npc, attackers,
BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1], BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1],
BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]); 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_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0));
UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1)); UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
break; break;
case BG_SA_RIGHT_CAPTURABLE_GY: 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; npc = BG_SA_NPC_SPARKLIGHT;
AddCreature(BG_SA_NpcEntries[npc], npc, attackers, AddCreature(BG_SA_NpcEntries[npc], npc, attackers,
BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1], BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1],
BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]); 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_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0));
UpdateWorldState(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1)); UpdateWorldState(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
break; break;
case BG_SA_CENTRAL_CAPTURABLE_GY: 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_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0));
UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1)); UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
break; break;
@@ -678,4 +718,29 @@ void BattleGroundSA::EndBattleGround(uint32 winner)
BattleGround::EndBattleGround(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();
}
}
}
}
}
+16 -3
View File
@@ -30,6 +30,9 @@ class BattleGroundSAScore : public BattleGroundScore
uint8 gates_destroyed; uint8 gates_destroyed;
}; };
#define BG_SA_FLAG_AMOUNT 3
#define BG_SA_DEMOLISHER_AMOUNT 4
enum BG_SA_Status enum BG_SA_Status
{ {
BG_SA_NOTSTARTED = 0, BG_SA_NOTSTARTED = 0,
@@ -134,7 +137,7 @@ const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] =
29262, 29262,
}; };
const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC][4] = const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] =
{ {
//Cannons //Cannons
{ 1436.429f, 110.05f, 41.407f, 5.4f }, { 1436.429f, 110.05f, 41.407f, 5.4f },
@@ -155,6 +158,11 @@ const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC][4] =
//Npcs //Npcs
{ 1348.644165, -298.786469, 31.080130, 1.710423}, { 1348.644165, -298.786469, 31.080130, 1.710423},
{ 1358.191040, 195.527786, 31.018187, 4.171337}, { 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 enum BG_SA_Objects
@@ -223,7 +231,7 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] =
* to get horde ones. * 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, 190722,
190727, 190727,
@@ -245,6 +253,9 @@ const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ] =
191310, 191310,
191306, 191306,
191308, 191308,
191309,
191305,
191307,
}; };
const uint32 BG_SA_Factions[2] = const uint32 BG_SA_Factions[2] =
@@ -323,10 +334,12 @@ class BattleGroundSA : public BattleGround
void StartShips(); void StartShips();
void TeleportPlayers(); void TeleportPlayers();
void OverrideGunFaction(); void OverrideGunFaction();
void DemolisherStartState(bool start);
void DestroyGate(uint32 i, Player* pl); void DestroyGate(uint32 i, Player* pl);
void SendTime(); void SendTime();
void CaptureGraveyard(BG_SA_Graveyards i); void CaptureGraveyard(BG_SA_Graveyards i, Player *Source);
void ToggleTimer(); void ToggleTimer();
void UpdateDemolisherSpawns();
TeamId attackers; TeamId attackers;
uint32 TotalTime; uint32 TotalTime;
bool ShipsStarted; bool ShipsStarted;
+11
View File
@@ -982,6 +982,12 @@ bool GOHello_go_hive_pod(Player *pPlayer, GameObject *pGO)
return true; return true;
} }
bool GOHello_go_massive_seaforium_charge(Player* pPlayer, GameObject *pGo)
{
pGo->SetLootState(GO_JUST_DEACTIVATED);
return true;
}
void AddSC_go_scripts() void AddSC_go_scripts()
{ {
Script *newscript; Script *newscript;
@@ -1168,4 +1174,9 @@ void AddSC_go_scripts()
newscript->Name = "go_hive_pod"; newscript->Name = "go_hive_pod";
newscript->pGOHello = &GOHello_go_hive_pod; newscript->pGOHello = &GOHello_go_hive_pod;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_massive_seaforium_charge";
newscript->pGOHello = &GOHello_go_massive_seaforium_charge;
newscript->RegisterSelf();
} }