diff options
-rw-r--r-- | src/game/Spell.cpp | 52 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 23 | ||||
-rw-r--r-- | src/game/Unit.cpp | 7 | ||||
-rw-r--r-- | src/game/Unit.h | 2 |
5 files changed, 22 insertions, 64 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 5df891d6dc5..3113beac3f6 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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]))) 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) { 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); } // Set aura only when successfully applied - if (unit->AddAura(Aur)) + if (unit->AddAura(Aur, false)) m_spellAura = Aur; } + for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber) + { + if (effectMask & (1<<effectNumber)) + HandleEffects(unit,NULL,NULL,effectNumber); + } + return SPELL_MISS_NONE; } @@ -2031,43 +2030,6 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap) TagUnitMap.remove(m_targets.getUnitTarget()); 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); - } - }*/ } } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 02fae77f700..5749cb65d35 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -49,8 +49,6 @@ #include "GridNotifiersImpl.h" #include "CellImpl.h" -class Vehicle; - pAuraHandler AuraHandler[TOTAL_AURAS]= { &AuraEffect::HandleNULL, // 0 SPELL_AURA_NONE diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 0eab6a025fa..f749da89711 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2329,7 +2329,16 @@ void Spell::EffectTeleportUnits(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 ) @@ -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) { uint32 entry = m_spellInfo->EffectMiscValue[i]; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5f946045192..458fb466cef 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3681,7 +3681,7 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ return modifier; } -bool Unit::AddAura(Aura *Aur) +bool Unit::AddAura(Aura *Aur, bool handleEffects) { // aura doesn't apply effects-return if (!Aur->GetEffectMask() || Aur->IsExpired()) @@ -3779,7 +3779,8 @@ bool Unit::AddAura(Aura *Aur) m_ccAuras.push_back(Aur); } - Aur->HandleEffects(true); + if (handleEffects) + Aur->HandleEffects(true); sLog.outDebug("Aura %u now is in use", Aur->GetId()); return true; @@ -10175,7 +10176,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) // 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); - 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()) { diff --git a/src/game/Unit.h b/src/game/Unit.h index 7dceb66f5b1..bf3f41bb1d1 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1289,7 +1289,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject 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(uint32 spellId, uint64 caster = 0 ,AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT); |