*Some changes in SPELL_AURA_OBS_MOD_ENERGY handler.
--HG-- branch : trunk
This commit is contained in:
@@ -140,6 +140,7 @@ enum Powers
|
|||||||
POWER_HAPPINESS = 4,
|
POWER_HAPPINESS = 4,
|
||||||
POWER_RUNE = 5,
|
POWER_RUNE = 5,
|
||||||
POWER_RUNIC_POWER = 6,
|
POWER_RUNIC_POWER = 6,
|
||||||
|
POWER_ALL = 127, // default for class?
|
||||||
POWER_HEALTH = 0xFFFFFFFE // (-2 as signed value)
|
POWER_HEALTH = 0xFFFFFFFE // (-2 as signed value)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+6
-14
@@ -5803,25 +5803,20 @@ void Aura::PeriodicTick()
|
|||||||
{
|
{
|
||||||
if(m_modifier.m_miscvalue < 0)
|
if(m_modifier.m_miscvalue < 0)
|
||||||
break;
|
break;
|
||||||
if (uint32 modmask = m_modifier.m_miscvalue)
|
|
||||||
{
|
|
||||||
for(uint8 i = 0; i < MAX_POWERS; ++i)
|
|
||||||
{
|
|
||||||
if(modmask & (uint32(1) << i))
|
|
||||||
{
|
|
||||||
if(i >= MAX_POWERS)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Powers power = Powers(i);
|
Powers power;
|
||||||
|
if (m_modifier.m_miscvalue == POWER_ALL)
|
||||||
|
power = m_target->getPowerType();
|
||||||
|
else
|
||||||
|
power = Powers(m_modifier.m_miscvalue);
|
||||||
|
|
||||||
if(m_target->GetMaxPower(power) == 0)
|
if(m_target->GetMaxPower(power) == 0)
|
||||||
continue;
|
break;
|
||||||
|
|
||||||
uint32 amount = m_modifier.m_amount * m_target->GetMaxPower(power) /100;
|
uint32 amount = m_modifier.m_amount * m_target->GetMaxPower(power) /100;
|
||||||
sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
|
sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
|
||||||
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), amount, GetId());
|
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), amount, GetId());
|
||||||
|
|
||||||
// Warning: this packet may be not blizzlike
|
|
||||||
WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size
|
WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size
|
||||||
data.append(m_target->GetPackGUID());
|
data.append(m_target->GetPackGUID());
|
||||||
data.appendPackGUID(GetCasterGUID());
|
data.appendPackGUID(GetCasterGUID());
|
||||||
@@ -5836,9 +5831,6 @@ void Aura::PeriodicTick()
|
|||||||
|
|
||||||
if(Unit* pCaster = GetCaster())
|
if(Unit* pCaster = GetCaster())
|
||||||
m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto());
|
m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto());
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SPELL_AURA_PERIODIC_ENERGIZE:
|
case SPELL_AURA_PERIODIC_ENERGIZE:
|
||||||
|
|||||||
Reference in New Issue
Block a user