mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
fix(Core/Wintergrasp): Reimplement Wintergrasp quests and fix vendors (#11533)
This commit is contained in:
@@ -704,29 +704,60 @@ void BattlefieldWG::OnGameObjectCreate(GameObject* go)
|
||||
void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
|
||||
{
|
||||
if (killer == victim)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TeamId killerTeam = killer->GetTeamId();
|
||||
|
||||
// xinef: tower cannons also grant rank
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER || IsKeepNpc(victim->GetEntry()) || victim->GetEntry() == NPC_WINTERGRASP_TOWER_CANNON)
|
||||
{
|
||||
for (GuidUnorderedSet::const_iterator itr = m_PlayersInWar[killerTeam].begin(); itr != m_PlayersInWar[killerTeam].end(); ++itr)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(*itr))
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && victim->HasAura(SPELL_LIEUTENANT))
|
||||
{
|
||||
// Quest - Wintergrasp - PvP Kill - Horde/Alliance
|
||||
for (auto& playerGuid : m_PlayersInWar[killerTeam])
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(playerGuid))
|
||||
{
|
||||
if (player->GetDistance2d(killer) < 40)
|
||||
{
|
||||
player->KilledMonsterCredit(killerTeam == TEAM_HORDE ? NPC_QUEST_PVP_KILL_ALLIANCE : NPC_QUEST_PVP_KILL_HORDE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& playerGuid : m_PlayersInWar[killerTeam])
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(playerGuid))
|
||||
{
|
||||
if (player->GetDistance2d(killer) < 40)
|
||||
{
|
||||
PromotePlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Xinef: Allow to Skin non-released corpse
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
victim->SetUnitFlag(UNIT_FLAG_SKINNABLE);
|
||||
}
|
||||
}
|
||||
else if (victim->IsVehicle() && !killer->IsFriendlyTo(victim))
|
||||
{
|
||||
// Quest - Wintergrasp - PvP Kill - Vehicle
|
||||
for (GuidUnorderedSet::const_iterator itr = m_PlayersInWar[killerTeam].begin(); itr != m_PlayersInWar[killerTeam].end(); ++itr)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(*itr))
|
||||
for (auto& playerGuid : m_PlayersInWar[killerTeam])
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(playerGuid))
|
||||
{
|
||||
if (player->GetDistance2d(killer) < 40)
|
||||
{
|
||||
player->KilledMonsterCredit(NPC_QUEST_PVP_KILL_VEHICLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,6 +218,8 @@ enum WintergraspNpcs
|
||||
NPC_QUEST_SOUTHERN_TOWER_KILL = 35074,
|
||||
NPC_QUEST_VEHICLE_PROTECTED = 31284,
|
||||
NPC_QUEST_PVP_KILL_VEHICLE = 31093,
|
||||
NPC_QUEST_PVP_KILL_HORDE = 39019,
|
||||
NPC_QUEST_PVP_KILL_ALLIANCE = 31086,
|
||||
};
|
||||
|
||||
struct BfWGCoordGY
|
||||
|
||||
Reference in New Issue
Block a user