Handle spell effects in order from dbcs
--HG-- branch : trunk
This commit is contained in:
+7
-45
@@ -1127,13 +1127,6 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
|
|||||||
if (effectMask & (1<<i) && (m_spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA || IsAreaAuraEffect(m_spellInfo->Effect[i])))
|
if (effectMask & (1<<i) && (m_spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA || IsAreaAuraEffect(m_spellInfo->Effect[i])))
|
||||||
aura_effmask |= 1<<i;
|
aura_effmask |= 1<<i;
|
||||||
|
|
||||||
uint8 t_effmask = effectMask & ~aura_effmask;
|
|
||||||
for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber)
|
|
||||||
{
|
|
||||||
if (t_effmask & (1<<effectNumber))
|
|
||||||
HandleEffects(unit,NULL,NULL,effectNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aura_effmask)
|
if (aura_effmask)
|
||||||
{
|
{
|
||||||
Unit * caster = m_originalCaster ? m_originalCaster : m_caster;
|
Unit * caster = m_originalCaster ? m_originalCaster : m_caster;
|
||||||
@@ -1163,10 +1156,16 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
|
|||||||
m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID);
|
m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID);
|
||||||
}
|
}
|
||||||
// Set aura only when successfully applied
|
// Set aura only when successfully applied
|
||||||
if (unit->AddAura(Aur))
|
if (unit->AddAura(Aur, false))
|
||||||
m_spellAura = Aur;
|
m_spellAura = Aur;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber)
|
||||||
|
{
|
||||||
|
if (effectMask & (1<<effectNumber))
|
||||||
|
HandleEffects(unit,NULL,NULL,effectNumber);
|
||||||
|
}
|
||||||
|
|
||||||
return SPELL_MISS_NONE;
|
return SPELL_MISS_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2031,43 +2030,6 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||||||
TagUnitMap.remove(m_targets.getUnitTarget());
|
TagUnitMap.remove(m_targets.getUnitTarget());
|
||||||
|
|
||||||
Trinity::RandomResizeList(TagUnitMap, unMaxTargets);
|
Trinity::RandomResizeList(TagUnitMap, unMaxTargets);
|
||||||
|
|
||||||
/*if(m_spellInfo->Id==57669) //Replenishment (special target selection)
|
|
||||||
{
|
|
||||||
if(pGroup)
|
|
||||||
{
|
|
||||||
typedef std::priority_queue<PrioritizeManaPlayerWraper, std::vector<PrioritizeManaPlayerWraper>, PrioritizeMana> Top10;
|
|
||||||
Top10 manaUsers;
|
|
||||||
|
|
||||||
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL && manaUsers.size() < 10; itr = itr->next())
|
|
||||||
{
|
|
||||||
Player* Target = itr->getSource();
|
|
||||||
if (m_caster->GetGUID() != Target->GetGUID() && Target->getPowerType() == POWER_MANA &&
|
|
||||||
!Target->isDead() && m_caster->IsWithinDistInMap(Target, radius))
|
|
||||||
{
|
|
||||||
PrioritizeManaPlayerWraper WTarget(Target);
|
|
||||||
manaUsers.push(WTarget);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while(!manaUsers.empty())
|
|
||||||
{
|
|
||||||
TagUnitMap.push_back(manaUsers.top().getPlayer());
|
|
||||||
manaUsers.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Unit* ownerOrSelf = pTarget ? pTarget : m_caster->GetCharmerOrOwnerOrSelf();
|
|
||||||
if ((ownerOrSelf==m_caster || m_caster->IsWithinDistInMap(ownerOrSelf, radius)) &&
|
|
||||||
ownerOrSelf->getPowerType() == POWER_MANA)
|
|
||||||
TagUnitMap.push_back(ownerOrSelf);
|
|
||||||
|
|
||||||
if(Pet* pet = ownerOrSelf->GetGuardianPet())
|
|
||||||
if( m_caster->IsWithinDistInMap(pet, radius) && pet->getPowerType() == POWER_MANA )
|
|
||||||
TagUnitMap.push_back(pet);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,6 @@
|
|||||||
#include "GridNotifiersImpl.h"
|
#include "GridNotifiersImpl.h"
|
||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
|
|
||||||
class Vehicle;
|
|
||||||
|
|
||||||
pAuraHandler AuraHandler[TOTAL_AURAS]=
|
pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||||
{
|
{
|
||||||
&AuraEffect::HandleNULL, // 0 SPELL_AURA_NONE
|
&AuraEffect::HandleNULL, // 0 SPELL_AURA_NONE
|
||||||
|
|||||||
+10
-13
@@ -2329,7 +2329,16 @@ void Spell::EffectTeleportUnits(uint32 i)
|
|||||||
|
|
||||||
void Spell::EffectApplyAura(uint32 i)
|
void Spell::EffectApplyAura(uint32 i)
|
||||||
{
|
{
|
||||||
return; //handled elsewhere
|
if (m_spellAura)
|
||||||
|
if (AuraEffect * AurEff = m_spellAura->GetPartAura(i))
|
||||||
|
unitTarget->HandleAuraEffect(AurEff, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Spell::EffectApplyAreaAura(uint32 i)
|
||||||
|
{
|
||||||
|
if (m_spellAura)
|
||||||
|
if (AuraEffect * AurEff = m_spellAura->GetPartAura(i))
|
||||||
|
unitTarget->HandleAuraEffect(AurEff, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectUnlearnSpecialization( uint32 i )
|
void Spell::EffectUnlearnSpecialization( uint32 i )
|
||||||
@@ -3183,18 +3192,6 @@ void Spell::EffectProficiency(uint32 /*i*/)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectApplyAreaAura(uint32 i)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
/* if(!unitTarget)
|
|
||||||
return;
|
|
||||||
if(!unitTarget->isAlive())
|
|
||||||
return;
|
|
||||||
|
|
||||||
AreaAura* Aur = new AreaAura(m_spellInfo, i, &damage, unitTarget, m_caster, m_CastItem);
|
|
||||||
unitTarget->AddAura(Aur);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void Spell::EffectSummonType(uint32 i)
|
void Spell::EffectSummonType(uint32 i)
|
||||||
{
|
{
|
||||||
uint32 entry = m_spellInfo->EffectMiscValue[i];
|
uint32 entry = m_spellInfo->EffectMiscValue[i];
|
||||||
|
|||||||
+4
-3
@@ -3681,7 +3681,7 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
|
|||||||
return modifier;
|
return modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Unit::AddAura(Aura *Aur)
|
bool Unit::AddAura(Aura *Aur, bool handleEffects)
|
||||||
{
|
{
|
||||||
// aura doesn't apply effects-return
|
// aura doesn't apply effects-return
|
||||||
if (!Aur->GetEffectMask() || Aur->IsExpired())
|
if (!Aur->GetEffectMask() || Aur->IsExpired())
|
||||||
@@ -3779,7 +3779,8 @@ bool Unit::AddAura(Aura *Aur)
|
|||||||
m_ccAuras.push_back(Aur);
|
m_ccAuras.push_back(Aur);
|
||||||
}
|
}
|
||||||
|
|
||||||
Aur->HandleEffects(true);
|
if (handleEffects)
|
||||||
|
Aur->HandleEffects(true);
|
||||||
|
|
||||||
sLog.outDebug("Aura %u now is in use", Aur->GetId());
|
sLog.outDebug("Aura %u now is in use", Aur->GetId());
|
||||||
return true;
|
return true;
|
||||||
@@ -10175,7 +10176,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
|||||||
// for some spells this mod is applied on vehicle owner
|
// for some spells this mod is applied on vehicle owner
|
||||||
uint32 owner_speed_mod = ((Vehicle*)this)->GetOwner()->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED);
|
uint32 owner_speed_mod = ((Vehicle*)this)->GetOwner()->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED);
|
||||||
|
|
||||||
main_speed_mod>owner_speed_mod ? main_speed_mod : owner_speed_mod;
|
main_speed_mod = main_speed_mod>owner_speed_mod ? main_speed_mod : owner_speed_mod;
|
||||||
}
|
}
|
||||||
else if (IsMounted())
|
else if (IsMounted())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1289,7 +1289,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
|
|
||||||
Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0);
|
Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0);
|
||||||
|
|
||||||
bool AddAura(Aura *aur);
|
bool AddAura(Aura *aur, bool handleEffects = true);
|
||||||
|
|
||||||
void RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
|
void RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
|
||||||
void RemoveAura(uint32 spellId, uint64 caster = 0 ,AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
void RemoveAura(uint32 spellId, uint64 caster = 0 ,AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||||
|
|||||||
Reference in New Issue
Block a user