aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp1
-rw-r--r--src/game/Spell.cpp16
-rw-r--r--src/game/SpellAuras.cpp9
-rw-r--r--src/game/SpellMgr.cpp10
-rw-r--r--src/game/SpellMgr.h3
-rw-r--r--src/game/TemporarySummon.h1
-rw-r--r--src/game/Totem.h1
-rw-r--r--src/game/Unit.cpp26
8 files changed, 43 insertions, 24 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index c3672b8ea7e..966c23623be 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -15844,7 +15844,6 @@ void Player::_SaveAuras()
// passive auras and stances
if (itr->second->IsPassive()
|| itr->second->IsAuraType(SPELL_AURA_MOD_SHAPESHIFT)
- || itr->second->IsAuraType(SPELL_AURA_MOD_STEALTH)
|| itr->second->IsRemovedOnShapeLost())
continue;
bool isCaster = itr->second->GetCasterGUID() == GetGUID();
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 8cb8c6a56b3..483678bed0e 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1665,14 +1665,14 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
switch(cur)
{
case TARGET_UNIT_TARGET_ENEMY:
- if(Unit *magnet = m_caster->SelectMagnetTarget(target))
+ if(Unit *magnet = m_caster->SelectMagnetTarget(target, m_spellInfo))
if(magnet != target)
m_targets.setUnitTarget(magnet);
pushType = PUSH_CHAIN;
break;
case TARGET_UNIT_TARGET_ANY:
if(!IsPositiveSpell(m_spellInfo->Id))
- if(Unit *magnet = m_caster->SelectMagnetTarget(target))
+ if(Unit *magnet = m_caster->SelectMagnetTarget(target, m_spellInfo))
if(magnet != target)
m_targets.setUnitTarget(magnet);
pushType = PUSH_CHAIN;
@@ -2181,7 +2181,7 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
for(std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
AddUnitTarget(*itr, i);
}
- } // Chain or Area
+ }
}
void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura)
@@ -3667,7 +3667,7 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
uint8 eff = m_spellInfo->Effect[i];
- sLog.outDebug( "Spell: Effect : %u", eff);
+ sLog.outDebug( "Spell: %u Effect : %u", m_spellInfo->Id, eff);
//we do not need DamageMultiplier here.
damage = CalculateDamage(i, NULL);
@@ -5310,11 +5310,11 @@ SpellCastResult Spell::CheckItems()
// skip spell if no weapon in slot or broken
if(!item || item->IsBroken() )
- return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return m_IsTriggeredSpell? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
// skip spell if weapon not fit to triggered spell
if(!item->IsFitToSpellRequirements(m_spellInfo))
- return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return m_IsTriggeredSpell? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
}
// offhand hand weapon required
@@ -5324,11 +5324,11 @@ SpellCastResult Spell::CheckItems()
// skip spell if no weapon in slot or broken
if(!item || item->IsBroken() )
- return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return m_IsTriggeredSpell? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
// skip spell if weapon not fit to triggered spell
if(!item->IsFitToSpellRequirements(m_spellInfo))
- return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
+ return m_IsTriggeredSpell? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS;
}
}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 8970797e646..14628b2c66b 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1257,7 +1257,7 @@ void Aura::DropAuraCharge()
if(--m_procCharges) // Send charge change
SendAuraUpdate();
else // Last charge dropped
- m_target->RemoveAura(this);
+ m_target->RemoveAura(this, AURA_REMOVE_BY_EXPIRE);
}
}
@@ -6223,6 +6223,13 @@ void AuraEffect::PeriodicTick()
// cannibalize anim
m_target->HandleEmoteCommand(EMOTE_STATE_CANNIBALIZE);
}
+ // Butchery
+ else if (m_spellProto->SpellFamilyName==SPELLFAMILY_DEATHKNIGHT
+ && m_spellProto->SpellIconID==2664)
+ {
+ if (m_target->isInCombat())
+ m_target->ModifyPower(pt,m_amount);
+ }
// Anger Management
// amount = 1+ 16 = 17 = 3,4*5 = 10,2*5/3
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 5b8a35cd577..31195f67bca 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -365,6 +365,10 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if (spellInfo->SpellFamilyFlags[0] & 0x12040000)
return SPELL_MAGE_ARMOR;
+ // Arcane brillance and Arcane intelect (normal check fails because of flags difference)
+ if (spellInfo->SpellFamilyFlags[0] & 0x400)
+ return SPELL_MAGE_ARCANE_BRILLANCE;
+
if ((spellInfo->SpellFamilyFlags[0] & 0x1000000) && spellInfo->EffectApplyAuraName[0]==SPELL_AURA_MOD_CONFUSE)
return SPELL_MAGE_POLYMORPH;
@@ -498,6 +502,7 @@ bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1,uint32 spellSpec2)
case SPELL_FOOD:
case SPELL_CHARM:
case SPELL_SCROLL:
+ case SPELL_MAGE_ARCANE_BRILLANCE:
return spellSpec1==spellSpec2;
case SPELL_BATTLE_ELIXIR:
return spellSpec2==SPELL_BATTLE_ELIXIR
@@ -1462,6 +1467,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
{
if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags)
return false;
+ if (!spellInfo_1->SpellFamilyFlags)
+ return false;
}
//use data of highest rank spell(needed for spells which ranks have different effects)
@@ -1471,9 +1478,6 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
//if spells have exactly the same effect they cannot stack
for(uint32 i = 0; i < 3; ++i)
if(spellInfo_1->Effect[i] != spellInfo_2->Effect[i]
- // Allow dummy auras stack (needed by 31666 and 58428)
- || spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_DUMMY
- || spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_DUMMY
|| spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i]
|| spellInfo_1->EffectMiscValue[i] != spellInfo_2->EffectMiscValue[i]) // paladin resist aura
return false; // need itemtype check? need an example to add that check
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 315fdc1ae17..8933931ea64 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -137,7 +137,8 @@ enum SpellSpecific
SPELL_FOOD = 20,
SPELL_PRESENCE = 21,
SPELL_CHARM = 22,
- SPELL_SCROLL = 23
+ SPELL_SCROLL = 23,
+ SPELL_MAGE_ARCANE_BRILLANCE = 24
};
#define SPELL_LINKED_MAX_SPELLS 200000
diff --git a/src/game/TemporarySummon.h b/src/game/TemporarySummon.h
index 16980b30a8d..8db384d2eba 100644
--- a/src/game/TemporarySummon.h
+++ b/src/game/TemporarySummon.h
@@ -35,6 +35,7 @@ class TempSummon : public Creature
void SetTempSummonType(TempSummonType type);
void SaveToDB();
Unit* GetSummoner() const;
+ uint64 const& GetSummonerGUID() { return m_summonerGUID; }
SummonPropertiesEntry const *m_Properties;
diff --git a/src/game/Totem.h b/src/game/Totem.h
index 4287ddc50e6..9da7b8efd8d 100644
--- a/src/game/Totem.h
+++ b/src/game/Totem.h
@@ -51,6 +51,7 @@ class Totem : public Minion
void UpdateMaxPower(Powers /*power*/) {}
void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {}
void UpdateDamagePhysical(WeaponAttackType /*attType*/) {}
+ void SetDuration(int32 dur) { m_duration = dur; }
bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 4eac618dd18..df61c321797 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1016,8 +1016,7 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I
if (!originalCaster && GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem())
if (Unit * owner = GetOwner())
- if (owner->GetTypeId()==TYPEID_PLAYER)
- originalCaster=owner->GetGUID();
+ originalCaster=owner->GetGUID();
SpellCastTargets targets;
uint32 targetMask = spellInfo->Targets;
@@ -4111,6 +4110,13 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
Aur->_RemoveAura();
+ // Remove totem at next update if totem looses its aura
+ if (GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem()&& ((TempSummon*)this)->GetSummonerGUID()==Aur->GetCasterGUID())
+ {
+ if (((Totem*)this)->GetSpell()==Aur->GetId())
+ ((Totem*)this)->setDeathState(JUST_DIED);
+ }
+
// only way correctly remove all auras from list
i = m_Auras.begin();
}
@@ -8316,19 +8322,20 @@ Unit* Unit::SelectMagnetTarget(Unit *victim, SpellEntry const *spellInfo)
Unit::AuraEffectList const& magnetAuras = victim->GetAurasByType(SPELL_AURA_SPELL_MAGNET);
for(Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
- if(Unit* magnet = (*itr)->GetCaster())
- if(magnet->isAlive())
- {
- (*itr)->GetParentAura()->DropAuraCharge();
- return magnet;
- }
+ if(Unit* magnet = (*itr)->IsAreaAura() ? ((AreaAuraEffect*)(*itr))->GetFormalCaster():(*itr)->GetCaster() )
+ if(magnet->isAlive())
+ {
+ if (Aura * aur = magnet->GetAura((*itr)->GetId(),(*itr)->GetCasterGUID()))
+ aur->DropAuraCharge();
+ return magnet;
+ }
}
// Melee && ranged case
else
{
AuraEffectList const& hitTriggerAuras = victim->GetAurasByType(SPELL_AURA_ADD_CASTER_HIT_TRIGGER);
for(AuraEffectList::const_iterator i = hitTriggerAuras.begin(); i != hitTriggerAuras.end(); ++i)
- if(Unit* magnet = (*i)->GetCaster())
+ if(Unit* magnet = (*i)->IsAreaAura() ? ((AreaAuraEffect*)(*i))->GetFormalCaster():(*i)->GetCaster() )
if(magnet->isAlive() && magnet->IsWithinLOSInMap(this))
if(roll_chance_i((*i)->GetAmount()))
{
@@ -10413,7 +10420,6 @@ void Unit::setDeathState(DeathState s)
RemoveAllControlled();
RemoveAllAurasOnDeath();
ExitVehicle();
- //This is needed to clear visible auras after unit dies
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);