mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[12152] Remove unused argument from OutdoorPvP::HandlePlayerKillInsideArea
This commit is contained in:
parent
f2cf0bcd19
commit
a53ac2aca7
10 changed files with 33 additions and 30 deletions
|
|
@ -78,7 +78,7 @@ void OutdoorPvP::SendUpdateWorldState(uint32 field, uint32 value)
|
||||||
@param player who killed another player
|
@param player who killed another player
|
||||||
@param victim who was killed
|
@param victim who was killed
|
||||||
*/
|
*/
|
||||||
void OutdoorPvP::HandlePlayerKill(Player* killer, Unit* victim)
|
void OutdoorPvP::HandlePlayerKill(Player* killer, Player* victim)
|
||||||
{
|
{
|
||||||
if (Group* group = killer->GetGroup())
|
if (Group* group = killer->GetGroup())
|
||||||
{
|
{
|
||||||
|
|
@ -96,14 +96,14 @@ void OutdoorPvP::HandlePlayerKill(Player* killer, Unit* victim)
|
||||||
// creature kills must be notified, even if not inside objective / not outdoor pvp active
|
// creature kills must be notified, even if not inside objective / not outdoor pvp active
|
||||||
// player kills only count if active and inside objective
|
// player kills only count if active and inside objective
|
||||||
if (groupMember->CanUseOutdoorCapturePoint())
|
if (groupMember->CanUseOutdoorCapturePoint())
|
||||||
HandlePlayerKillInsideArea(groupMember, victim);
|
HandlePlayerKillInsideArea(groupMember);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// creature kills must be notified, even if not inside objective / not outdoor pvp active
|
// creature kills must be notified, even if not inside objective / not outdoor pvp active
|
||||||
if (killer && killer->CanUseOutdoorCapturePoint())
|
if (killer && killer->CanUseOutdoorCapturePoint())
|
||||||
HandlePlayerKillInsideArea(killer, victim);
|
HandlePlayerKillInsideArea(killer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,8 @@ class OutdoorPvP
|
||||||
// update - called by the OutdoorPvPMgr
|
// update - called by the OutdoorPvPMgr
|
||||||
virtual void Update(uint32 /*diff*/) {}
|
virtual void Update(uint32 /*diff*/) {}
|
||||||
|
|
||||||
// handle npc/player kill
|
// Handle player kill
|
||||||
void HandlePlayerKill(Player* killer, Unit* victim);
|
void HandlePlayerKill(Player* killer, Player* victim);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ class OutdoorPvP
|
||||||
virtual void SendRemoveWorldStates(Player* /*player*/) {}
|
virtual void SendRemoveWorldStates(Player* /*player*/) {}
|
||||||
|
|
||||||
// handle npc/player kill
|
// handle npc/player kill
|
||||||
virtual void HandlePlayerKillInsideArea(Player* /*killer*/, Unit* /*victim*/) {}
|
virtual void HandlePlayerKillInsideArea(Player* /*killer*/) {}
|
||||||
|
|
||||||
// send world state update to all players present
|
// send world state update to all players present
|
||||||
void SendUpdateWorldState(uint32 field, uint32 value);
|
void SendUpdateWorldState(uint32 field, uint32 value);
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ void OutdoorPvPHP::HandleObjectiveComplete(uint32 eventId, std::list<Player*> pl
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cast player spell on opponent kill
|
// Cast player spell on opponent kill
|
||||||
void OutdoorPvPHP::HandlePlayerKillInsideArea(Player* player, Unit* /*victim*/)
|
void OutdoorPvPHP::HandlePlayerKillInsideArea(Player* player)
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < MAX_HP_TOWERS; ++i)
|
for (uint8 i = 0; i < MAX_HP_TOWERS; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ class OutdoorPvPHP : public OutdoorPvP
|
||||||
void HandleObjectiveComplete(uint32 eventId, std::list<Player*> players, Team team) override;
|
void HandleObjectiveComplete(uint32 eventId, std::list<Player*> players, Team team) override;
|
||||||
|
|
||||||
void HandleGameObjectCreate(GameObject* go) override;
|
void HandleGameObjectCreate(GameObject* go) override;
|
||||||
void HandlePlayerKillInsideArea(Player* player, Unit* victim) override;
|
void HandlePlayerKillInsideArea(Player* player) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// process capture events
|
// process capture events
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ void OutdoorPvPNA::HandleObjectiveComplete(uint32 eventId, std::list<Player*> pl
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cast player spell on opponent kill
|
// Cast player spell on opponent kill
|
||||||
void OutdoorPvPNA::HandlePlayerKillInsideArea(Player* player, Unit* /*victim*/)
|
void OutdoorPvPNA::HandlePlayerKillInsideArea(Player* player)
|
||||||
{
|
{
|
||||||
if (GameObject* capturePoint = player->GetMap()->GetGameObject(m_capturePoint))
|
if (GameObject* capturePoint = player->GetMap()->GetGameObject(m_capturePoint))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ class OutdoorPvPNA : public OutdoorPvP
|
||||||
void HandleGameObjectCreate(GameObject* go) override;
|
void HandleGameObjectCreate(GameObject* go) override;
|
||||||
void HandleCreatureDeath(Creature* creature) override;
|
void HandleCreatureDeath(Creature* creature) override;
|
||||||
|
|
||||||
void HandlePlayerKillInsideArea(Player* player, Unit* victim) override;
|
void HandlePlayerKillInsideArea(Player* player) override;
|
||||||
bool HandleGameObjectUse(Player* player, GameObject* go) override;
|
bool HandleGameObjectUse(Player* player, GameObject* go) override;
|
||||||
void Update(uint32 diff) override;
|
void Update(uint32 diff) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ void OutdoorPvPZM::HandleGameObjectCreate(GameObject* go)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cast player spell on opponent kill
|
// Cast player spell on opponent kill
|
||||||
void OutdoorPvPZM::HandlePlayerKillInsideArea(Player* player, Unit* /*victim*/)
|
void OutdoorPvPZM::HandlePlayerKillInsideArea(Player* player)
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < MAX_ZM_TOWERS; ++i)
|
for (uint8 i = 0; i < MAX_ZM_TOWERS; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ class OutdoorPvPZM : public OutdoorPvP
|
||||||
void HandleCreatureCreate(Creature* creature) override;
|
void HandleCreatureCreate(Creature* creature) override;
|
||||||
void HandleGameObjectCreate(GameObject* go) override;
|
void HandleGameObjectCreate(GameObject* go) override;
|
||||||
|
|
||||||
void HandlePlayerKillInsideArea(Player* player, Unit* victim) override;
|
void HandlePlayerKillInsideArea(Player* player) override;
|
||||||
bool HandleGameObjectUse(Player* player, GameObject* go) override;
|
bool HandleGameObjectUse(Player* player, GameObject* go) override;
|
||||||
//bool HandleDropFlag(Player* player, uint32 spellId) override;
|
//bool HandleDropFlag(Player* player, uint32 spellId) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1114,26 +1114,29 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||||
he->DuelComplete(DUEL_INTERUPTED);
|
he->DuelComplete(DUEL_INTERUPTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle player kill in outdoor pvp
|
// handle player/npc kill in battleground or outdoor pvp script
|
||||||
if (player_tap && pVictim->GetTypeId() == TYPEID_PLAYER && pVictim != this)
|
if (player_tap)
|
||||||
{
|
{
|
||||||
if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(player_tap->GetCachedZoneId()))
|
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||||
outdoorPvP->HandlePlayerKill(player_tap, pVictim);
|
{
|
||||||
}
|
Player* killed = (Player*)pVictim;
|
||||||
|
if (killed->InBattleGround())
|
||||||
// battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill)
|
{
|
||||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && ((Player*)pVictim)->InBattleGround())
|
if (BattleGround* bg = killed->GetBattleGround())
|
||||||
{
|
bg->HandleKillPlayer(killed, player_tap);
|
||||||
Player* killed = ((Player*)pVictim);
|
}
|
||||||
if (BattleGround* bg = killed->GetBattleGround())
|
else if (pVictim != this)
|
||||||
if (player_tap)
|
{
|
||||||
bg->HandleKillPlayer(killed, player_tap);
|
// selfkills are not handled in outdoor pvp scripts
|
||||||
}
|
if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(player_tap->GetCachedZoneId()))
|
||||||
else if (pVictim->GetTypeId() == TYPEID_UNIT)
|
outdoorPvP->HandlePlayerKill(player_tap, killed);
|
||||||
{
|
}
|
||||||
if (player_tap)
|
}
|
||||||
|
else if (pVictim->GetTypeId() == TYPEID_UNIT)
|
||||||
|
{
|
||||||
if (BattleGround* bg = player_tap->GetBattleGround())
|
if (BattleGround* bg = player_tap->GetBattleGround())
|
||||||
bg->HandleKillUnit((Creature*)pVictim, player_tap);
|
bg->HandleKillUnit((Creature*)pVictim, player_tap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // if (health <= damage)
|
else // if (health <= damage)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12151"
|
#define REVISION_NR "12152"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue