*Wintergrasp: allow player to get promotion by group member's kill. Thanks to iadus3
--HG-- branch : trunk
This commit is contained in:
+33
-21
@@ -647,27 +647,7 @@ void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
|||||||
UpdateTenacityStack();
|
UpdateTenacityStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
|
void OPvPWintergrasp::PromotePlayer(Player *killer) const
|
||||||
{
|
|
||||||
bool ok = false;
|
|
||||||
if(victim->GetTypeId() == TYPEID_PLAYER)
|
|
||||||
{
|
|
||||||
if(victim->getLevel() >= 70)
|
|
||||||
ok = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch(GetCreatureType(victim->GetEntry()))
|
|
||||||
{
|
|
||||||
case CREATURE_SIEGE_VEHICLE:
|
|
||||||
case CREATURE_GUARD:
|
|
||||||
case CREATURE_TURRET:
|
|
||||||
ok = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ok)
|
|
||||||
{
|
{
|
||||||
Aura *aur;
|
Aura *aur;
|
||||||
if(aur = killer->GetAura(SPELL_RECRUIT))
|
if(aur = killer->GetAura(SPELL_RECRUIT))
|
||||||
@@ -693,6 +673,38 @@ void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
|
|||||||
else if(killer->HasAura(SPELL_LIEUTENANT))
|
else if(killer->HasAura(SPELL_LIEUTENANT))
|
||||||
killer->CastSpell(killer, SPELL_LIEUTENANT, true);
|
killer->CastSpell(killer, SPELL_LIEUTENANT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim)
|
||||||
|
{
|
||||||
|
bool ok = false;
|
||||||
|
if(victim->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
{
|
||||||
|
if(victim->getLevel() >= 70)
|
||||||
|
ok = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch(GetCreatureType(victim->GetEntry()))
|
||||||
|
{
|
||||||
|
case CREATURE_SIEGE_VEHICLE:
|
||||||
|
case CREATURE_GUARD:
|
||||||
|
case CREATURE_TURRET:
|
||||||
|
ok = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ok)
|
||||||
|
{
|
||||||
|
if(Group *pGroup = killer->GetGroup())
|
||||||
|
{
|
||||||
|
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||||
|
if(itr->getSource()->IsAtGroupRewardDistance(victim))
|
||||||
|
PromotePlayer(itr->getSource());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
PromotePlayer(killer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPvPWintergrasp::UpdateTenacityStack()
|
void OPvPWintergrasp::UpdateTenacityStack()
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ class OPvPWintergrasp : public OutdoorPvP
|
|||||||
|
|
||||||
void UpdateClock();
|
void UpdateClock();
|
||||||
void UpdateClockDigit(uint32 &timer, uint32 digit, uint32 mod);
|
void UpdateClockDigit(uint32 &timer, uint32 digit, uint32 mod);
|
||||||
|
void PromotePlayer(Player *player) const;
|
||||||
void UpdateTenacityStack();
|
void UpdateTenacityStack();
|
||||||
void UpdateAllWorldObject();
|
void UpdateAllWorldObject();
|
||||||
bool UpdateCreatureInfo(Creature *creature) const;
|
bool UpdateCreatureInfo(Creature *creature) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user