mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 04:42:10 +01:00
added Honorable Defender buff for Alterac Valley nodes + bosses + captains
--HG-- branch : trunk
This commit is contained in:
@@ -64,12 +64,24 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
uint32 entry = unit->GetEntry();
|
||||
/*
|
||||
uint32 triggerSpawnID = 0;
|
||||
if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN][0])
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER16;
|
||||
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_BOSS][0])
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER17;
|
||||
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER18;
|
||||
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_BOSS][0])
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER19;
|
||||
*/
|
||||
if (entry == BG_AV_CreatureInfo[AV_NPC_A_BOSS][0])
|
||||
{
|
||||
CastSpellOnTeam(23658,HORDE); //this is a spell which finishes a quest where a player has to kill the boss
|
||||
RewardReputationToTeam(729,BG_AV_REP_BOSS,HORDE);
|
||||
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),HORDE);
|
||||
EndBattleGround(HORDE);
|
||||
DelCreature(AV_CPLACE_TRIGGER17);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_BOSS][0])
|
||||
{
|
||||
@@ -77,6 +89,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
RewardReputationToTeam(730,BG_AV_REP_BOSS,ALLIANCE);
|
||||
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),ALLIANCE);
|
||||
EndBattleGround(ALLIANCE);
|
||||
DelCreature(AV_CPLACE_TRIGGER19);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN][0])
|
||||
{
|
||||
@@ -95,7 +108,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature,GetTrinityString(LANG_BG_AV_A_CAPTAIN_DEAD),LANG_UNIVERSAL);
|
||||
|
||||
DelCreature(AV_CPLACE_TRIGGER16);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
|
||||
{
|
||||
@@ -114,6 +127,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if (creature)
|
||||
YellToAll(creature,GetTrinityString(LANG_BG_AV_H_CAPTAIN_DEAD),LANG_UNIVERSAL);
|
||||
DelCreature(AV_CPLACE_TRIGGER18);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_N_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_A_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_H_4][0])
|
||||
ChangeMineOwner(AV_NORTH_MINE,killer->GetTeam());
|
||||
@@ -292,6 +306,38 @@ Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
if (level != 0)
|
||||
level += m_MaxLevel - 60; //maybe we can do this more generic for custom level-range.. actually it's blizzlike
|
||||
creature->SetLevel(level);
|
||||
|
||||
uint32 triggerSpawnID = 0;
|
||||
uint32 newFaction = 0;
|
||||
if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN][0])
|
||||
{
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER16;
|
||||
newFaction = 84;
|
||||
}
|
||||
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_BOSS][0])
|
||||
{
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER17;
|
||||
newFaction = 84;
|
||||
}
|
||||
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
|
||||
{
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER18;
|
||||
newFaction = 83;
|
||||
}
|
||||
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_BOSS][0])
|
||||
{
|
||||
triggerSpawnID = AV_CPLACE_TRIGGER19;
|
||||
newFaction = 83;
|
||||
}
|
||||
if (triggerSpawnID && newFaction)
|
||||
{
|
||||
if (Creature* trigger = AddCreature(WORLD_TRIGGER,triggerSpawnID,BG_AV_CreatureInfo[creature->GetEntry()][1],BG_AV_CreaturePos[triggerSpawnID][0],BG_AV_CreaturePos[triggerSpawnID][1],BG_AV_CreaturePos[triggerSpawnID][2],BG_AV_CreaturePos[triggerSpawnID][3]))
|
||||
{
|
||||
trigger->setFaction(newFaction);
|
||||
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
|
||||
}
|
||||
}
|
||||
|
||||
return creature;
|
||||
}
|
||||
|
||||
@@ -709,6 +755,26 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
}
|
||||
for (uint8 i=0; i<4; i++)
|
||||
AddAVCreature(creatureid,c_place+i);
|
||||
|
||||
if (node >= BG_AV_NODES_MAX)//fail safe
|
||||
return;
|
||||
Creature* trigger = GetBGCreature(node + 302);//0-302 other creatures
|
||||
if (!trigger)
|
||||
trigger = AddCreature(WORLD_TRIGGER,node + 302,owner,BG_AV_CreaturePos[node + 302][0],BG_AV_CreaturePos[node + 302][1],BG_AV_CreaturePos[node + 302][2],BG_AV_CreaturePos[node + 302][3]);
|
||||
|
||||
//add bonus honor aura trigger creature when node is accupied
|
||||
//cast bonus aura (+50% honor in 25yards)
|
||||
//aura should only apply to players who have accupied the node, set correct faction for trigger
|
||||
if (trigger)
|
||||
{
|
||||
if (owner != ALLIANCE && owner != HORDE)//node can be neutral, remove trigger
|
||||
{
|
||||
DelCreature(node + 302);
|
||||
return;
|
||||
}
|
||||
trigger->setFaction(owner == ALLIANCE ? 84 : 83);
|
||||
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
|
||||
}
|
||||
}
|
||||
void BattleGroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
{
|
||||
@@ -719,6 +785,10 @@ void BattleGroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
//spiritguide
|
||||
if (!IsTower(node) && m_BgCreatures[node])
|
||||
DelCreature(node);
|
||||
|
||||
//remove bonus honor aura trigger creature when node is lost
|
||||
if(node < BG_AV_NODES_MAX)//fail safe
|
||||
DelCreature(node + 302);//NULL checks are in DelCreature! 0-302 spirit guides
|
||||
}
|
||||
|
||||
const BG_AV_Nodes BattleGroundAV::GetNodeThroughObject(uint32 object)
|
||||
|
||||
@@ -596,7 +596,30 @@ enum BG_AV_CreaturePlace
|
||||
//herald
|
||||
AV_CPLACE_HERALD = 301,
|
||||
|
||||
AV_CPLACE_MAX = 302
|
||||
//node aura triggers
|
||||
AV_CPLACE_TRIGGER01 = 302,
|
||||
AV_CPLACE_TRIGGER02 = 303,
|
||||
AV_CPLACE_TRIGGER03 = 304,
|
||||
AV_CPLACE_TRIGGER04 = 305,
|
||||
AV_CPLACE_TRIGGER05 = 306,
|
||||
AV_CPLACE_TRIGGER06 = 307,
|
||||
AV_CPLACE_TRIGGER07 = 308,
|
||||
AV_CPLACE_TRIGGER08 = 309,
|
||||
AV_CPLACE_TRIGGER09 = 310,
|
||||
AV_CPLACE_TRIGGER10 = 311,
|
||||
AV_CPLACE_TRIGGER11 = 312,
|
||||
AV_CPLACE_TRIGGER12 = 313,
|
||||
AV_CPLACE_TRIGGER13 = 314,
|
||||
AV_CPLACE_TRIGGER14 = 315,
|
||||
AV_CPLACE_TRIGGER15 = 316,
|
||||
|
||||
//boss,captain triggers
|
||||
AV_CPLACE_TRIGGER16 = 317,
|
||||
AV_CPLACE_TRIGGER17 = 318,
|
||||
AV_CPLACE_TRIGGER18 = 319,
|
||||
AV_CPLACE_TRIGGER19 = 320,
|
||||
|
||||
AV_CPLACE_MAX = 321
|
||||
};
|
||||
|
||||
//x, y, z, o
|
||||
@@ -934,8 +957,27 @@ const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = {
|
||||
//boss
|
||||
{-848.902f,-92.931f,68.6325f,3.33350},
|
||||
//herald
|
||||
{-48.459f,-288.802f,55.47f,1.0}
|
||||
|
||||
{-48.459f,-288.802f,55.47f,1.0},
|
||||
//triggers
|
||||
{637.083,-32.6603,45.9715,1.14353}, //firstaid_station
|
||||
{669.007f,-294.078f,30.2909f,2.77507f}, //stormpike_grave
|
||||
{77.8013f,-404.7f,46.7549f,-0.872665f}, //stoneheart_grave
|
||||
{-202.581f,-112.73f,78.4876f,-0.715585f}, //snowfall_grave
|
||||
{-611.962f,-396.17f,60.8351f,2.53682f}, //iceblood_grave
|
||||
{-1082.45f,-346.823f,54.9219f,-1.53589f}, //frostwolf_grave
|
||||
{-1402.21f,-307.431f,89.4424f,0.191986f}, //frostwolf_hut
|
||||
{553.779f,-78.6566f,51.9378f,-1.22173f}, //dunbaldar_south
|
||||
{674.001f,-143.125f,63.6615f,0.994838f}, //dunbaldar_north
|
||||
{203.281f,-360.366f,56.3869f,-0.925024}, //icewing_bunker
|
||||
{-152.437f,-441.758f,40.3982f,-1.95477f}, //stoneheart_bunker
|
||||
{-571.88f,-262.777f,75.0087f,-0.802851f}, //iceblood_tower
|
||||
{-768.907f,-363.71f,90.8949f,1.07991f}, //tower_point
|
||||
{-1302.9f,-316.981f,113.867f,2.00713f}, //frostwolf_etower
|
||||
{-1297.5f,-266.767f,114.15f,3.31044f}, //frostwolf_wtower
|
||||
{-57.7891f,-286.597f,15.6479f,6.02139f}, //AV_NPC_A_CAPTAIN balinda
|
||||
{722.43f,-10.9982f,50.7046f,3.42085f}, //AV_NPC_A_BOSS vanndar
|
||||
{-545.23f,-165.35f,57.7886f,3.01145f}, //AV_NPC_H_CAPTAIN galvangar
|
||||
{-1370.9f,-219.793f,98.4258f,5.04381f} //AV_NPC_H_BOSS drek thar
|
||||
};
|
||||
|
||||
enum BG_AV_CreatureIds
|
||||
|
||||
Reference in New Issue
Block a user