aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Item.cpp7
-rw-r--r--src/game/Spell.cpp22
-rw-r--r--src/game/SpellAuras.cpp6
-rw-r--r--src/game/SpellEffects.cpp10
-rw-r--r--src/game/SpellMgr.cpp9
-rw-r--r--src/game/SpellMgr.h1
-rw-r--r--src/game/Unit.cpp45
-rw-r--r--src/game/Unit.h1
8 files changed, 63 insertions, 38 deletions
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index 85df92f998b..ea8d77076eb 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -756,7 +756,12 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
if(spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
{
- if((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
+ // Special case - accept weapon type for main and offhand requirements
+ if(proto->InventoryType == INVTYPE_WEAPON &&
+ (spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONMAINHAND) ||
+ spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND)))
+ return true;
+ else if ((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
return false; // inventory type not present in mask
}
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index aa04784fb97..9d9fdc70305 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1127,7 +1127,20 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
// Apply additional spell effects to target
if (m_preCastSpell)
- m_caster->CastSpell(unit,m_preCastSpell, true, m_CastItem);
+ {
+ // Special spell id
+ // TODO: Handle all of special spells in one place?
+ if(m_preCastSpell==61988)
+ {
+ //Cast forbearance
+ m_caster->CastSpell(unit,25771, true, m_CastItem);
+ // Cast Avenging Wrath Marker
+ m_caster->CastSpell(unit,61987, true, m_CastItem);
+ }
+ else
+ m_caster->CastSpell(unit,m_preCastSpell, true, m_CastItem);
+ }
+
for(uint32 effectNumber=0;effectNumber<3;effectNumber++)
{
@@ -2179,13 +2192,6 @@ void Spell::cast(bool skipCheck)
m_preCastSpell = 23230; // Blood Fury - Healing Reduction
break;
}
-
- case SPELLFAMILY_PRIEST:
- {
- if (m_spellInfo->Id == 47585) // Dispersion (transform)
- m_preCastSpell = 60069; // Dispersion (mana regen)
- break;
- }
}
// traded items have trade slot instead of guid in m_itemTargetGUID
// set to real guid to be sent later to the client
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index fe16e488b3d..d31ec2ff553 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -459,12 +459,6 @@ m_updated(false), m_isRemovedOnShapeLost(true), m_in_use(false)
Aura::~Aura()
{
- //Delete references to aura
- if(GetAuraSlot() < MAX_AURAS && m_target && m_target->GetVisibleAura(GetAuraSlot()))
- {
- AuraSlotEntry * entry = m_target->GetVisibleAura(GetAuraSlot());
- entry->m_slotAuras[GetEffIndex()]=NULL;
- }
}
AreaAura::AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index fbee149152a..469f3f45357 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -620,23 +620,23 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
}
case SPELLFAMILY_PALADIN:
{
- // Judgement of Vengeance ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance on the target
- if((m_spellInfo->SpellFamilyFlags[1] & 0x8) && m_spellInfo->SpellIconID==2292)
+ // Judgement of Vengeance/Corruption ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance/Blood Corruption on the target
+ if((m_spellInfo->SpellFamilyFlags[1] & 0x800) && m_spellInfo->SpellIconID==2292)
{
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
m_caster->SpellBaseDamageBonusForVictim(GetSpellSchoolMask(m_spellInfo), unitTarget);
damage+=int32(ap * 0.14f) + int32(holy * 22 / 100);
- // Get stack of Holy Vengeance on the target added by caster
+ // Get stack of Holy Vengeance/Blood Corruption on the target added by caster
uint32 stacks = 0;
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
- if((*itr)->GetId() == 31803 && (*itr)->GetCasterGUID()==m_caster->GetGUID())
+ if(((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID()==m_caster->GetGUID())
{
stacks = (*itr)->GetStackAmount();
break;
}
- // + 10% for each application of Holy Vengeance on the target
+ // + 10% for each application of Holy Vengeance/Blood Corruption on the target
if(stacks)
damage += damage * stacks * 10 /100;
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index f312329192c..95a52acf57c 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1044,8 +1044,9 @@ void SpellMgr::LoadSpellProcEvents()
spe.schoolMask = fields[1].GetUInt32();
spe.spellFamilyName = fields[2].GetUInt32();
- spe.spellFamilyMask = (uint64)fields[3].GetUInt32()|((uint64)fields[4].GetUInt32()<<32);
- spe.spellFamilyMask2= fields[5].GetUInt32();
+ spe.spellFamilyMask[0] = fields[3].GetUInt32();
+ spe.spellFamilyMask[1] = fields[4].GetUInt32();
+ spe.spellFamilyMask[2] = fields[5].GetUInt32();
spe.procFlags = fields[6].GetUInt32();
spe.procEx = fields[7].GetUInt32();
spe.ppmRate = fields[8].GetFloat();
@@ -1155,7 +1156,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
return false;
// spellFamilyName is Ok need check for spellFamilyMask if present
- if(spellProcEvent->spellFamilyMask || spellProcEvent->spellFamilyMask2)
+ if(spellProcEvent->spellFamilyMask)
{
if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags ) == 0)
return false;
@@ -2883,7 +2884,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
if (mechanic & (1<<MECHANIC_FEAR)) return DIMINISHING_FEAR;
if (mechanic & (1<<MECHANIC_CHARM)) return DIMINISHING_CHARM;
if (mechanic & (1<<MECHANIC_SILENCE)) return DIMINISHING_SILENCE;
- if (mechanic & (1<<DIMINISHING_DISARM)) return DIMINISHING_DISARM;
+ if (mechanic & (1<<MECHANIC_DISARM)) return DIMINISHING_DISARM;
if (mechanic & (1<<MECHANIC_FREEZE)) return DIMINISHING_FREEZE;
if (mechanic & ((1<<MECHANIC_KNOCKOUT) | (1<<MECHANIC_SAPPED))) return DIMINISHING_KNOCKOUT;
if (mechanic & (1<<MECHANIC_BANISH)) return DIMINISHING_BANISH;
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 2fe81a3e98b..119dbed9eb8 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -615,7 +615,6 @@ struct SpellProcEventEntry
uint32 schoolMask; // if nonzero - bit mask for matching proc condition based on spell candidate's school: Fire=2, Mask=1<<(2-1)=2
uint32 spellFamilyName; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyNamer value
flag96 spellFamilyMask; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags (like auras 107 and 108 do)
- uint32 spellFamilyMask2; // if nonzero - for matching proc condition based on candidate spell's SpellFamilyFlags2 (like auras 107 and 108 do)
uint32 procFlags; // bitmask for matching proc event
uint32 procEx; // proc Extend info (see ProcFlagsEx)
float ppmRate; // for melee (ranged?) damage spells - proc rate per minute. if zero, falls back to flat chance from Spell.dbc
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b31eab7572c..52d858f8542 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -209,18 +209,7 @@ void Unit::Update( uint32 p_time )
_UpdateAura();
}else
m_AurasCheck -= p_time;*/
- const uint64& auramask = GetAuraUpdateMask();
- if (auramask)
- {
- for(uint32 i = 0; i < MAX_AURAS; ++i)
- {
- if(auramask & (uint64(1) << i))
- {
- SendAuraUpdate(i);
- }
- }
- ResetAuraUpdateMask();
- }
+ UpdateAuras();
// WARNING! Order of execution here is important, do not change.
// Spells must be processed with event system BEFORE they go to _UpdateSpells.
@@ -265,6 +254,22 @@ void Unit::Update( uint32 p_time )
i_motionMaster.UpdateMotion(p_time);
}
+void Unit::UpdateAuras()
+{
+ const uint64& auramask = GetAuraUpdateMask();
+ if (auramask)
+ {
+ for(uint32 i = 0; i < MAX_AURAS; ++i)
+ {
+ if(auramask & (uint64(1) << i))
+ {
+ SendAuraUpdate(i);
+ }
+ }
+ ResetAuraUpdateMask();
+ }
+}
+
bool Unit::haveOffhandWeapon() const
{
if(GetTypeId() == TYPEID_PLAYER)
@@ -4328,6 +4333,9 @@ Aura* Unit::GetAura(AuraType type, uint32 family, uint32 familyFlag1, uint32 fam
bool Unit::HasAura(uint32 spellId) const
{
+ //Special case for non existing spell
+ if (spellId==61988)
+ return HasAura(61987) || HasAura(25771);
for (int i = 0; i < 3 ; ++i)
{
AuraMap::const_iterator iter = m_Auras.find(spellEffectPair(spellId, i));
@@ -5783,6 +5791,15 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
triggered_spell_id = 31803;
break;
}
+ // Seal of Corruption
+ case 53736:
+ {
+ if(effIndex != 0) // effect 1,2 used by seal unleashing code
+ return false;
+
+ triggered_spell_id = 53742;
+ break;
+ }
// Spiritual Attunement
case 31785:
case 33776:
@@ -6930,7 +6947,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
// Bloodthirst (($m/100)% of max health)
case 23880:
{
- basepoints0 = int32(GetMaxHealth() * triggerAmount / 10000);
+ basepoints0 = int32(GetMaxHealth() * triggerAmount / 100);
break;
}
// Shamanistic Rage triggered spell
@@ -9848,6 +9865,8 @@ void Unit::setDeathState(DeathState s)
{
RemoveAllAurasOnDeath();
UnsummonAllTotems();
+ //This is needed to clear visible auras after unit dies
+ UpdateAuras();
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 3b43f3ba4cb..8cf3171ba92 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -865,6 +865,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry);
virtual void Update( uint32 time );
+ void UpdateAuras();
void setAttackTimer(WeaponAttackType type, uint32 time) { m_attackTimer[type] = time; }
void resetAttackTimer(WeaponAttackType type = BASE_ATTACK);