Over 100 camangos Cata commits applied (to c12950)

Over 100 camangos Cata commits applied. up to and inclusing c12950.
This commit is contained in:
Charles A Edwards 2016-08-20 17:10:24 +01:00 committed by Antz
parent b4ec0440aa
commit eef77eadb9
117 changed files with 4314 additions and 3547 deletions

View file

@ -883,14 +883,12 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
// remove affects from attacker at any non-DoT damage (including 0 damage)
if (damagetype != DOT)
{
RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
if (damagetype != SELF_DAMAGE_ROGUE_FALL)
RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
if (pVictim != this)
RemoveSpellsCausingAura(SPELL_AURA_MOD_INVISIBILITY);
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUNNED))
{ pVictim->SetStandState(UNIT_STAND_STATE_STAND); }
pVictim->SetStandState(UNIT_STAND_STATE_STAND);
}
if (!damage)
@ -952,7 +950,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
((Creature*)pVictim)->SetLootRecipient(this);
JustKilledCreature((Creature*)pVictim, nullptr);
JustKilledCreature((Creature*)pVictim, NULL);
pVictim->SetHealth(0);
return damage;
@ -978,7 +976,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
{
SpellEntry const* shareSpell = (*itr)->GetSpellProto();
uint32 shareDamage = uint32(damage*(*itr)->GetModifier()->m_amount / 100.0f);
DealDamageMods(shareTarget, shareDamage, nullptr);
DealDamageMods(shareTarget, shareDamage, NULL);
DealDamage(shareTarget, shareDamage, 0, damagetype, GetSpellSchoolMask(shareSpell), shareSpell, false);
}
}
@ -4335,7 +4333,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder* holder)
switch (aurNameReal)
{
// DoT/HoT/etc
// DoT/HoT/etc
case SPELL_AURA_DUMMY: // allow stack
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
@ -4346,7 +4344,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder* holder)
case SPELL_AURA_OBS_MOD_MANA:
case SPELL_AURA_POWER_BURN_MANA:
case SPELL_AURA_CONTROL_VEHICLE:
case SPELL_AURA_284: // SPELL_AURA_LINKED_AURA, unknown how it is handled, but let it stack like vehicle control aura
case SPELL_AURA_TRIGGER_LINKED_AURA:
case SPELL_AURA_PERIODIC_DUMMY:
break;
case SPELL_AURA_PERIODIC_ENERGIZE: // all or self or clear non-stackable
@ -4367,7 +4365,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder* holder)
if (!IsPassiveSpell(aurSpellInfo) || !IsPassiveSpellStackableWithRanks(aurSpellInfo))
{
// Hack exceptions for Vehicle/Linked auras
if (!IsSpellHaveAura(aurSpellInfo, SPELL_AURA_CONTROL_VEHICLE) && !IsSpellHaveAura(aurSpellInfo, SPELL_AURA_284) &&
if (!IsSpellHaveAura(aurSpellInfo, SPELL_AURA_CONTROL_VEHICLE) && !IsSpellHaveAura(aurSpellInfo, SPELL_AURA_TRIGGER_LINKED_AURA) &&
!RemoveNoStackAurasDueToAuraHolder(holder))
{
delete holder;
@ -5750,8 +5748,10 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, SpellSchoolMask d
void Unit::SetPowerType(Powers new_powertype)
{
// set power type
SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype);
// group updates
if (GetTypeId() == TYPEID_PLAYER)
{
if (((Player*)this)->GetGroup())
@ -5768,22 +5768,38 @@ void Unit::SetPowerType(Powers new_powertype)
}
}
switch (new_powertype)
// special cases for power type switching (druid and pets only)
if (GetTypeId() == TYPEID_PLAYER || (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()))
{
default:
case POWER_MANA:
break;
case POWER_RAGE:
SetMaxPower(POWER_RAGE, GetCreatePowers(POWER_RAGE));
SetPower(POWER_RAGE, 0);
break;
case POWER_FOCUS:
SetMaxPower(POWER_FOCUS, GetCreatePowers(POWER_FOCUS));
SetPower(POWER_FOCUS, GetCreatePowers(POWER_FOCUS));
break;
case POWER_ENERGY:
SetMaxPower(POWER_ENERGY, GetCreatePowers(POWER_ENERGY));
break;
uint32 maxValue = GetCreatePowers(new_powertype);
uint32 curValue = maxValue;
// special cases with current power = 0
switch (new_powertype)
{
case POWER_RAGE:
case POWER_RUNE:
case POWER_RUNIC_POWER:
curValue = 0;
break;
default:
break;
}
// set power (except for mana)
if (new_powertype != POWER_MANA)
{
SetMaxPower(new_powertype, maxValue);
SetPower(new_powertype, curValue);
}
// send power type update to client
WorldPacket data(SMSG_POWER_UPDATE);
data << GetPackGUID();
data << uint32(1); // power count
data << uint8(new_powertype);
data << uint32(curValue);
SendMessageToSet(&data, true);
}
}
@ -6717,7 +6733,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u
// Creature damage
if (GetTypeId() == TYPEID_UNIT && !((Creature*)this)->IsPet())
DoneTotalMod *= ((Creature*)this)->GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->Rank);
DoneTotalMod *= ((Creature*)this)->_GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->Rank);
AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
@ -9269,6 +9285,10 @@ void Unit::SetDeathState(DeathState s)
if (IsVehicle())
m_vehicleInfo->RemoveAccessoriesFromMap();
// Unboard from transport
if (GetTransportInfo() && ((Unit*)GetTransportInfo()->GetTransport())->IsVehicle())
((Unit*)GetTransportInfo()->GetTransport())->RemoveSpellsCausingAura(SPELL_AURA_CONTROL_VEHICLE, GetObjectGuid());
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
// remove aurastates allowing special moves
@ -10417,14 +10437,14 @@ uint32 Unit::GetCreatePowers(Powers power) const
{
case POWER_HEALTH: return 0; // is it really should be here?
case POWER_MANA: return GetCreateMana();
case POWER_RAGE: return 1000;
case POWER_RAGE: return POWER_RAGE_DEFAULT;
case POWER_FOCUS:
if(GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_HUNTER)
return 100;
return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 100);
case POWER_ENERGY: return 100;
case POWER_RUNE: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? 8 : 0;
case POWER_RUNIC_POWER: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? 1000 : 0;
return POWER_FOCUS_DEFAULT;
return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : POWER_FOCUS_DEFAULT);
case POWER_ENERGY: return POWER_ENERGY_DEFAULT;
case POWER_RUNE: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? POWER_RUNE_DEFAULT : 0;
case POWER_RUNIC_POWER: return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_DEATH_KNIGHT ? POWER_RUNIC_POWER_DEFAULT : 0;
case POWER_SOUL_SHARDS: return 0;
case POWER_ECLIPSE: return 0; // TODO: fix me
case POWER_HOLY_POWER: return 0;
@ -10438,9 +10458,9 @@ uint32 Unit::GetCreateMaxPowers(Powers power) const
switch (power)
{
case POWER_HOLY_POWER:
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_PALADIN ? 3 : 0;
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_PALADIN ? POWER_HOLY_POWER_DEFAULT : 0;
case POWER_SOUL_SHARDS:
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_WARLOCK ? 3 : 0;
return GetTypeId() == TYPEID_PLAYER && ((Player const*)this)->getClass() == CLASS_WARLOCK ? POWER_SOUL_SHARDS_DEFAULT : 0;
default:
return GetCreatePowers(power);
}
@ -10593,7 +10613,6 @@ void CharmInfo::InitCharmCreateSpells()
bool onlyselfcast = true;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo) onlyselfcast = false;
for (uint32 i = 0; i < 3 && onlyselfcast; ++i) // nonexistent spell will not make any problems as onlyselfcast would be false -> break right away
{
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(SpellEffectIndex(i));
@ -10843,7 +10862,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
if (itr->second->IsDeleted())
continue;
SpellProcEventEntry const* spellProcEvent = nullptr;
SpellProcEventEntry const* spellProcEvent = NULL;
// check if that aura is triggered by proc event (then it will be managed by proc handler)
if (!IsTriggeredAtSpellProcEvent(pTarget, itr->second, procSpell, procFlag, procExtra, attType, isVictim, spellProcEvent))
{
@ -11031,8 +11050,7 @@ void Unit::StopMoving(bool forceSendStop /*=false*/)
return;
Movement::MoveSplineInit init(*this);
init.SetFacing(GetOrientation());
init.Launch();
init.Stop();
}
void Unit::InterruptMoving(bool forceSendStop /*=false*/)
@ -11644,6 +11662,24 @@ void Unit::SetFFAPvP(bool state)
CallForAllControlledUnits(SetFFAPvPHelper(state), CONTROLLED_PET | CONTROLLED_TOTEMS | CONTROLLED_GUARDIANS | CONTROLLED_CHARM);
}
void Unit::RestoreOriginalFaction()
{
if (GetTypeId() == TYPEID_PLAYER)
((Player*)this)->setFactionForRace(getRace());
else
{
Creature* creature = (Creature*)this;
if (creature->IsPet() || creature->IsTotem())
{
if (Unit* owner = GetOwner())
setFaction(owner->getFaction());
}
else
setFaction(creature->GetCreatureInfo()->FactionAlliance);
}
}
void Unit::KnockBackFrom(Unit* target, float horizontalSpeed, float verticalSpeed)
{
float angle = this == target ? GetOrientation() + M_PI_F : target->GetAngle(this);