mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
Apply style fix pt4
This commit is contained in:
parent
d93dbd95fe
commit
4727d8846f
87 changed files with 710 additions and 0 deletions
|
|
@ -4402,7 +4402,9 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const
|
|||
|
||||
AuraList const& mTotalAuraList = GetAurasByType(auratype);
|
||||
for (AuraList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
modifier += (*i)->GetModifier()->m_amount;
|
||||
}
|
||||
|
||||
return modifier;
|
||||
}
|
||||
|
|
@ -4413,7 +4415,9 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype) const
|
|||
|
||||
AuraList const& mTotalAuraList = GetAurasByType(auratype);
|
||||
for (AuraList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
multiplier *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
|
||||
}
|
||||
|
||||
return multiplier;
|
||||
}
|
||||
|
|
@ -8059,7 +8063,9 @@ uint32 Unit::SpellHealingBonusDone(Unit* pVictim, SpellEntry const* spellProto,
|
|||
// Healing done percent
|
||||
AuraList const& mHealingDonePct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
|
||||
for (AuraList::const_iterator i = mHealingDonePct.begin(); i != mHealingDonePct.end(); ++i)
|
||||
{
|
||||
DoneTotalMod *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
|
||||
}
|
||||
|
||||
AuraList const& mHealingFromHealthPct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_FROM_PCT_HEALTH);
|
||||
if (!mHealingFromHealthPct.empty())
|
||||
|
|
@ -11348,28 +11354,38 @@ CharmInfo::CharmInfo(Unit* unit)
|
|||
: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_reactState(REACT_PASSIVE), m_petnumber(0)
|
||||
{
|
||||
for (int i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
{
|
||||
m_charmspells[i].SetActionAndType(0, ACT_DISABLED);
|
||||
}
|
||||
}
|
||||
|
||||
void CharmInfo::InitPetActionBar()
|
||||
{
|
||||
// the first 3 SpellOrActions are attack, follow and stay
|
||||
for (uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_START - ACTION_BAR_INDEX_START; ++i)
|
||||
{
|
||||
SetActionBar(ACTION_BAR_INDEX_START + i, COMMAND_ATTACK - i, ACT_COMMAND);
|
||||
}
|
||||
|
||||
// middle 4 SpellOrActions are spells/special attacks/abilities
|
||||
for (uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_END - ACTION_BAR_INDEX_PET_SPELL_START; ++i)
|
||||
{
|
||||
SetActionBar(ACTION_BAR_INDEX_PET_SPELL_START + i, 0, ACT_DISABLED);
|
||||
}
|
||||
|
||||
// last 3 SpellOrActions are reactions
|
||||
for (uint32 i = 0; i < ACTION_BAR_INDEX_END - ACTION_BAR_INDEX_PET_SPELL_END; ++i)
|
||||
{
|
||||
SetActionBar(ACTION_BAR_INDEX_PET_SPELL_END + i, COMMAND_ATTACK - i, ACT_REACTION);
|
||||
}
|
||||
}
|
||||
|
||||
void CharmInfo::InitEmptyActionBar()
|
||||
{
|
||||
for (uint32 x = ACTION_BAR_INDEX_START; x < ACTION_BAR_INDEX_END; ++x)
|
||||
{
|
||||
SetActionBar(x, 0, ACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void CharmInfo::InitVehicleCreateSpells()
|
||||
|
|
@ -11560,7 +11576,9 @@ void CharmInfo::LoadPetActionBar(const std::string& data)
|
|||
void CharmInfo::BuildActionBar(WorldPacket* data)
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
|
||||
{
|
||||
*data << uint32(PetActionBar[i].packedData);
|
||||
}
|
||||
}
|
||||
|
||||
void CharmInfo::SetSpellAutocast(uint32 spell_id, bool state)
|
||||
|
|
@ -11810,7 +11828,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
|
|||
removedSpells.unique();
|
||||
// Remove auras from removedAuras
|
||||
for (RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end(); ++i)
|
||||
{
|
||||
RemoveAurasDueToSpell(*i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -12134,7 +12154,9 @@ void Unit::ClearComboPointHolders()
|
|||
void Unit::ClearAllReactives()
|
||||
{
|
||||
for (int i = 0; i < MAX_REACTIVE; ++i)
|
||||
{
|
||||
m_reactiveTimer[i] = 0;
|
||||
}
|
||||
|
||||
if (HasAuraState(AURA_STATE_DEFENSE))
|
||||
ModifyAuraState(AURA_STATE_DEFENSE, false);
|
||||
|
|
@ -12218,7 +12240,9 @@ Unit* Unit::SelectRandomUnfriendlyTarget(Unit* except /*= NULL*/, float radius /
|
|||
uint32 rIdx = urand(0, targets.size() - 1);
|
||||
std::list<Unit*>::const_iterator tcIter = targets.begin();
|
||||
for (uint32 i = 0; i < rIdx; ++i)
|
||||
{
|
||||
++tcIter;
|
||||
}
|
||||
|
||||
return *tcIter;
|
||||
}
|
||||
|
|
@ -12259,7 +12283,9 @@ Unit* Unit::SelectRandomFriendlyTarget(Unit* except /*= NULL*/, float radius /*=
|
|||
uint32 rIdx = urand(0, targets.size() - 1);
|
||||
std::list<Unit*>::const_iterator tcIter = targets.begin();
|
||||
for (uint32 i = 0; i < rIdx; ++i)
|
||||
{
|
||||
++tcIter;
|
||||
}
|
||||
|
||||
return *tcIter;
|
||||
}
|
||||
|
|
@ -12722,12 +12748,16 @@ bool Unit::IsIgnoreUnitState(SpellEntry const* spell, IgnoreUnitState ignoreStat
|
|||
void Unit::CleanupDeletedAuras()
|
||||
{
|
||||
for (SpellAuraHolderList::const_iterator iter = m_deletedHolders.begin(); iter != m_deletedHolders.end(); ++iter)
|
||||
{
|
||||
delete *iter;
|
||||
}
|
||||
m_deletedHolders.clear();
|
||||
|
||||
// really delete auras "deleted" while processing its ApplyModify code
|
||||
for (AuraList::const_iterator itr = m_deletedAuras.begin(); itr != m_deletedAuras.end(); ++itr)
|
||||
{
|
||||
delete *itr;
|
||||
}
|
||||
m_deletedAuras.clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue