Core/GameObject: Refactored destructible building handling, properly implemented spell effect repair
This commit is contained in:
@@ -331,7 +331,7 @@ class Battleground
|
||||
{
|
||||
}
|
||||
|
||||
virtual void DestroyGate(Player* /*pl*/, GameObject* /*go*/, uint32 /*destroyedEvent*/) {}
|
||||
virtual void DestroyGate(Player* /*pl*/, GameObject* /*go*/) {}
|
||||
|
||||
/* achievement req. */
|
||||
virtual bool IsAllNodesConrolledByTeam(uint32 /*team*/) const { return false; }
|
||||
|
||||
@@ -817,7 +817,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundIC::DestroyGate(Player* pl, GameObject* go, uint32 /*destroyedEvent*/)
|
||||
void BattlegroundIC::DestroyGate(Player* player, GameObject* go)
|
||||
{
|
||||
GateStatus[GetGateIDFromEntry(go->GetEntry())] = BG_IC_GATE_DESTROYED;
|
||||
uint32 uws_open = GetWorldStateFromGateEntry(go->GetEntry(), true);
|
||||
@@ -827,7 +827,7 @@ void BattlegroundIC::DestroyGate(Player* pl, GameObject* go, uint32 /*destroyedE
|
||||
UpdateWorldState(uws_close, 0);
|
||||
UpdateWorldState(uws_open, 1);
|
||||
}
|
||||
DoorOpen((pl->GetTeamId() == TEAM_ALLIANCE ? BG_IC_GO_HORDE_KEEP_PORTCULLIS : BG_IC_GO_DOODAD_PORTCULLISACTIVE02));
|
||||
DoorOpen((player->GetTeamId() == TEAM_ALLIANCE ? BG_IC_GO_HORDE_KEEP_PORTCULLIS : BG_IC_GO_DOODAD_PORTCULLISACTIVE02));
|
||||
|
||||
uint32 lang_entry = 0;
|
||||
|
||||
@@ -850,7 +850,7 @@ void BattlegroundIC::DestroyGate(Player* pl, GameObject* go, uint32 /*destroyedE
|
||||
break;
|
||||
}
|
||||
|
||||
SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (pl->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP));
|
||||
SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (player->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP));
|
||||
}
|
||||
|
||||
void BattlegroundIC::EventPlayerDamagedGO(Player* /*plr*/, GameObject* /*go*/, uint32 /*eventType*/)
|
||||
|
||||
@@ -879,7 +879,7 @@ class BattlegroundIC : public Battleground
|
||||
void EventPlayerClickedOnFlag(Player *source, GameObject* /*target_obj*/);
|
||||
|
||||
void EventPlayerDamagedGO(Player* /*plr*/, GameObject* go, uint32 eventType);
|
||||
void DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroyedEvent);
|
||||
void DestroyGate(Player* player, GameObject* go);
|
||||
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
|
||||
|
||||
@@ -598,15 +598,15 @@ void BattlegroundSA::DemolisherStartState(bool start)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroyedEvent)
|
||||
void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
|
||||
{
|
||||
uint32 i = GetGateIDFromDestroyEventID(destroyedEvent);
|
||||
uint32 i = GetGateIDFromDestroyEventID(go->GetGOInfo()->building.destroyedEvent);
|
||||
if (!GateStatus[i])
|
||||
return;
|
||||
|
||||
if (GameObject* g = GetBGObject(i))
|
||||
{
|
||||
if (g->GetGOValue()->building.health == 0)
|
||||
if (g->GetGOValue()->Building.Health == 0)
|
||||
{
|
||||
GateStatus[i] = BG_SA_GATE_DESTROYED;
|
||||
uint32 uws = GetWorldStateFromGateID(i);
|
||||
@@ -635,9 +635,9 @@ void BattlegroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroye
|
||||
|
||||
if (i < 5)
|
||||
DelObject(i+9);
|
||||
UpdatePlayerScore(pl, SCORE_DESTROYED_WALL, 1);
|
||||
UpdatePlayerScore(player, SCORE_DESTROYED_WALL, 1);
|
||||
if (rewardHonor)
|
||||
UpdatePlayerScore(pl, SCORE_BONUS_HONOR, (GetBonusHonorFromKill(1)));
|
||||
UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@ class BattlegroundSA : public Battleground
|
||||
* -Update worldstate
|
||||
* -Delete gameobject in front of door (lighting object, with different colours for each door)
|
||||
*/
|
||||
void DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroyedEvent);
|
||||
void DestroyGate(Player* player, GameObject* go);
|
||||
/// Update timer worldstate
|
||||
void SendTime();
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user