From 9d0e943488b35059b649f3f22d1f995966989694 Mon Sep 17 00:00:00 2001 From: yad02 Date: Sun, 20 Dec 2009 13:06:36 +0300 Subject: [PATCH 1/9] [9036] Typo in function name. Signed-off-by: VladimirMangos --- src/game/Unit.cpp | 6 +++--- src/game/Unit.h | 2 +- src/shared/revision_nr.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 741805772..50c3ce29e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -197,7 +197,7 @@ void Unit::Update( uint32 p_time ) m_Events.Update( p_time ); _UpdateSpells( p_time ); - CleanupDeletedAuars(); + CleanupDeletedAuras(); if (m_lastManaUseTimer) { @@ -11422,7 +11422,7 @@ void Unit::RemoveFromWorld() RemoveGuardians(); RemoveAllGameObjects(); RemoveAllDynObjects(); - CleanupDeletedAuars(); + CleanupDeletedAuras(); } Object::RemoveFromWorld(); @@ -13067,7 +13067,7 @@ void Unit::StopAttackFaction(uint32 faction_id) guardian->StopAttackFaction(faction_id); } -void Unit::CleanupDeletedAuars() +void Unit::CleanupDeletedAuras() { // really delete auras "deleted" while processing its ApplyModify code for(AuraList::const_iterator itr = m_deletedAuras.begin(); itr != m_deletedAuras.end(); ++itr) diff --git a/src/game/Unit.h b/src/game/Unit.h index 669916759..81b84dc33 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1624,7 +1624,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject uint32 m_lastManaUseTimer; private: - void CleanupDeletedAuars(); + void CleanupDeletedAuras(); bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent ); bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d85161e46..f286a4c0c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9035" + #define REVISION_NR "9036" #endif // __REVISION_NR_H__ From 15de4282422f41d5f25d510bc7e97aff4b03902e Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sun, 20 Dec 2009 19:23:54 +0300 Subject: [PATCH 2/9] [9037] Cleanups in spellmode apply code. * Add constructores for spellmode creating instead explcit fields init * Use uint32 for family mask 2 instead unneded uint64 Also drop one from manual applies for uno-existed now spell. --- src/game/DBCStructure.h | 4 ++ src/game/Player.cpp | 34 ++++++++++++-- src/game/Player.h | 13 +++++- src/game/Spell.cpp | 5 +- src/game/SpellAuras.cpp | 99 ++++++---------------------------------- src/game/SpellAuras.h | 2 +- src/game/SpellMgr.cpp | 19 -------- src/game/SpellMgr.h | 2 - src/game/Unit.cpp | 17 ++----- src/shared/revision_nr.h | 2 +- 10 files changed, 70 insertions(+), 127 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index d5b294f21..45e353f4e 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1426,6 +1426,10 @@ struct SpellEntry // helpers int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); } + uint32 const* GetEffectSpellClassMask(uint8 effect) const + { + return EffectSpellClassMaskA + effect * 3; + } private: // prevent creating custom entries (copy data from original in fact) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2d09f4f3b..968299f28 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -274,6 +274,33 @@ std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi) return ss; } +SpellModifier::SpellModifier( SpellModOp _op, SpellModType _type, int32 _value, SpellEntry const* spellEntry, uint8 eff, int16 _charges /*= 0*/ ) : op(_op), type(_type), charges(_charges), value(_value), spellId(spellEntry->Id), lastAffected(NULL) +{ + uint32 const* ptr = spellEntry->GetEffectSpellClassMask(eff); + mask = uint64(ptr[0]) | (uint64(ptr[1]) << 32); + mask2= ptr[2]; +} + +SpellModifier::SpellModifier( SpellModOp _op, SpellModType _type, int32 _value, Aura const* aura, int16 _charges /*= 0*/ ) : op(_op), type(_type), charges(_charges), value(_value), spellId(aura->GetId()), lastAffected(NULL) +{ + uint32 const* ptr = aura->getAuraSpellClassMask(); + mask = uint64(ptr[0]) | (uint64(ptr[1]) << 32); + mask2= ptr[2]; +} + +bool SpellModifier::isAffectedOnSpell( SpellEntry const *spell ) const +{ + SpellEntry const *affect_spell = sSpellStore.LookupEntry(spellId); + // False if affect_spell == NULL or spellFamily not equal + if (!affect_spell || affect_spell->SpellFamilyName != spell->SpellFamilyName) + return false; + if (mask & spell->SpellFamilyFlags) + return true; + if (mask2 & spell->SpellFamilyFlags2) + return true; + return false; +} + //== Player ==================================================== UpdateMask Player::updateVisualBits; @@ -17173,7 +17200,7 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo return false; } - return sSpellMgr.IsAffectedByMod(spellInfo, mod); + return mod->isAffectedOnSpell(spellInfo); } void Player::AddSpellMod(SpellModifier* mod, bool apply) @@ -17183,9 +17210,9 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) for(int eff=0;eff<96;++eff) { uint64 _mask = 0; - uint64 _mask2= 0; + uint32 _mask2= 0; if (eff<64) _mask = uint64(1) << (eff- 0); - else _mask2= uint64(1) << (eff-64); + else _mask2= uint32(1) << (eff-64); if ( mod->mask & _mask || mod->mask2 & _mask2) { int32 val = 0; @@ -21288,3 +21315,4 @@ void Player::SetHomebindToCurrentPos() CharacterDatabase.PExecute("UPDATE character_homebind SET map = '%u', zone = '%u', position_x = '%f', position_y = '%f', position_z = '%f' WHERE guid = '%u'", m_homebindMapId, m_homebindZoneId, m_homebindX, m_homebindY, m_homebindZ, GetGUIDLow()); } + diff --git a/src/game/Player.h b/src/game/Player.h index 75e8e3163..97412964d 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -97,12 +97,23 @@ struct PlayerSpell struct SpellModifier { SpellModifier() : charges(0), lastAffected(NULL) {} + + SpellModifier(SpellModOp _op, SpellModType _type, int32 _value, uint32 _spellId, uint64 _mask, uint32 _mask2 = 0, int16 _charges = 0) + : op(_op), type(_type), charges(_charges), value(_value), mask(_mask), mask2(_mask2), spellId(_spellId), lastAffected(NULL) + {} + + SpellModifier(SpellModOp _op, SpellModType _type, int32 _value, SpellEntry const* spellEntry, uint8 eff, int16 _charges = 0); + + SpellModifier(SpellModOp _op, SpellModType _type, int32 _value, Aura const* aura, int16 _charges = 0); + + bool isAffectedOnSpell(SpellEntry const *spell) const; + SpellModOp op : 8; SpellModType type : 8; int16 charges : 16; int32 value; uint64 mask; - uint64 mask2; + uint32 mask2; uint32 spellId; Spell const* lastAffected; }; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ce6814fc7..9f141df99 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -5772,7 +5772,10 @@ void Spell::UpdatePointers() bool Spell::IsAffectedByAura(Aura *aura) const { - return sSpellMgr.IsAffectedByMod(m_spellInfo, aura->getAuraSpellMod()); + if(SpellModifier* mod = aura->getAuraSpellMod()) + return mod->isAffectedOnSpell(m_spellInfo); + else + return false; } bool Spell::CheckTargetCreatureType(Unit* target) const diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 337340650..77ade4ca6 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1395,30 +1395,14 @@ void Aura::HandleAddModifier(bool apply, bool Real) break; } - SpellModifier *mod = new SpellModifier; - mod->op = SpellModOp(m_modifier.m_miscvalue); - mod->value = m_modifier.m_amount; - mod->type = SpellModType(m_modifier.m_auraname); // SpellModType value == spell aura types - mod->spellId = GetId(); - - uint32 const *ptr; - switch (m_effIndex) - { - case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break; - case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break; - case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break; - default: - return; - } - - mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32; - mod->mask2= (uint64)ptr[2]; - - // prevent expire spell mods with (charges > 0 && m_stackAmount > 1) - // all this spell expected expire not at use but at spell proc event check - mod->charges = m_spellProto->StackAmount > 1 ? 0 : m_procCharges; - - m_spellmod = mod; + m_spellmod = new SpellModifier( + SpellModOp(m_modifier.m_miscvalue), + SpellModType(m_modifier.m_auraname), // SpellModType value == spell aura types + m_modifier.m_amount, + this, + // prevent expire spell mods with (charges > 0 && m_stackAmount > 1) + // all this spell expected expire not at use but at spell proc event check + m_spellProto->StackAmount > 1 ? 0 : m_procCharges); } ((Player*)m_target)->AddSpellMod(m_spellmod, apply); @@ -1454,18 +1438,10 @@ void Aura::HandleAddTargetTrigger(bool apply, bool /*Real*/) SpellModifier *mod = new SpellModifier; mod->spellId = GetId(); - uint32 const *ptr; - switch (m_effIndex) - { - case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break; - case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break; - case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break; - default: - return; - } + uint32 const *ptr = m_spellProto->GetEffectSpellClassMask(m_effIndex); mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32; - mod->mask2= (uint64)ptr[2]; + mod->mask2= ptr[2]; m_spellmod = mod; } else @@ -2611,14 +2587,8 @@ void Aura::HandleAuraDummy(bool apply, bool Real) if(apply) { // Reduce backfire damage (dot damage) from Shadow Word: Death - SpellModifier *mod = new SpellModifier; - mod->op = SPELLMOD_DOT; - mod->value = m_modifier.m_amount; - mod->type = SPELLMOD_PCT; - mod->spellId = GetId(); - mod->mask = UI64LIT(0x0000200000000000); - mod->mask2= UI64LIT(0x0); - m_spellmod = mod; + // aura have wrong effectclassmask, so use hardcoded value + m_spellmod = new SpellModifier(SPELLMOD_DOT,SPELLMOD_PCT,m_modifier.m_amount,GetId(),0x0000200000000000); } ((Player*)m_target)->AddSpellMod(m_spellmod, apply); return; @@ -2636,17 +2606,8 @@ void Aura::HandleAuraDummy(bool apply, bool Real) return; if(apply) - { - SpellModifier *mod = new SpellModifier; - mod->op = SPELLMOD_DOT; - mod->value = m_modifier.m_amount/7; - mod->type = SPELLMOD_FLAT; - mod->spellId = GetId(); - mod->mask = UI64LIT(0x001000000000); - mod->mask2= UI64LIT(0x0); - - m_spellmod = mod; - } + // dummy not have proper effectclassmask + m_spellmod = new SpellModifier(SPELLMOD_DOT,SPELLMOD_FLAT,m_modifier.m_amount/7,GetId(),UI64LIT(0x001000000000)); ((Player*)m_target)->AddSpellMod(m_spellmod, apply); return; @@ -2770,39 +2731,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } break; case SPELLFAMILY_SHAMAN: - { - // Improved Weapon Totems - if( GetSpellProto()->SpellIconID == 57 && m_target->GetTypeId()==TYPEID_PLAYER ) - { - if(apply) - { - SpellModifier *mod = new SpellModifier; - mod->op = SPELLMOD_EFFECT1; - mod->value = m_modifier.m_amount; - mod->type = SPELLMOD_PCT; - mod->spellId = GetId(); - switch (m_effIndex) - { - case 0: - // Windfury Totem - mod->mask = UI64LIT(0x00200000000); - mod->mask2= UI64LIT(0x0); - break; - case 1: - // Flametongue Totem - mod->mask = UI64LIT(0x00400000000); - mod->mask2= UI64LIT(0x0); - break; - } - - m_spellmod = mod; - } - - ((Player*)m_target)->AddSpellMod(m_spellmod, apply); - return; - } break; - } } // pet auras diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 489976a5d..bae2f36d9 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -339,7 +339,7 @@ class MANGOS_DLL_SPEC Aura void TriggerSpell(); void TriggerSpellWithValue(); - uint32 const *getAuraSpellClassMask() const { return m_spellProto->EffectSpellClassMaskA + m_effIndex * 3; } + uint32 const *getAuraSpellClassMask() const { return m_spellProto->GetEffectSpellClassMask(m_effIndex); } bool isAffectedOnSpell(SpellEntry const *spell) const; protected: Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 2f6621ee7..e018eaf36 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -862,25 +862,6 @@ void SpellMgr::LoadSpellTargetPositions() sLog.outString( ">> Loaded %u spell teleport coordinates", count ); } -bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const -{ - // false for spellInfo == NULL - if (!spellInfo || !mod) - return false; - - SpellEntry const *affect_spell = sSpellStore.LookupEntry(mod->spellId); - // False if affect_spell == NULL or spellFamily not equal - if (!affect_spell || affect_spell->SpellFamilyName != spellInfo->SpellFamilyName) - return false; - - // true - if (mod->mask & spellInfo->SpellFamilyFlags || - mod->mask2 & spellInfo->SpellFamilyFlags2) - return true; - - return false; -} - struct DoSpellProcEvent { DoSpellProcEvent(SpellProcEventEntry const& _spe) : spe(_spe) {} diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 0583f62ba..8d8e3d8a4 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -732,8 +732,6 @@ class SpellMgr // Accessors (const or static functions) public: - bool IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const; - SpellElixirMap const& GetSpellElixirMap() const { return mSpellElixirs; } uint32 GetSpellElixirMask(uint32 spellid) const diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 50c3ce29e..42d434dfa 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6548,13 +6548,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu } // No thread generated mod // TODO: exist special flag in spell attributes for this, need found and use! - SpellModifier *mod = new SpellModifier; - mod->op = SPELLMOD_THREAT; - mod->value = -100; - mod->type = SPELLMOD_PCT; - mod->spellId = dummySpell->Id; - mod->mask = UI64LIT(0x0000000000000003); - mod->mask2= UI64LIT(0x0); + SpellModifier *mod = new SpellModifier(SPELLMOD_THREAT,SPELLMOD_PCT,-100,triggeredByAura); + ((Player*)this)->AddSpellMod(mod, true); // Remove cooldown (Chain Lightning - have Category Recovery time) @@ -12809,13 +12804,7 @@ bool Unit::HandleMendingAuraProc( Aura* triggeredByAura ) if(Player* target = ((Player*)this)->GetNextRandomRaidMember(radius)) { // aura will applied from caster, but spell casted from current aura holder - SpellModifier *mod = new SpellModifier; - mod->op = SPELLMOD_CHARGES; - mod->value = jumps-5; // negative - mod->type = SPELLMOD_FLAT; - mod->spellId = spellProto->Id; - mod->mask = spellProto->SpellFamilyFlags; - mod->mask2 = spellProto->SpellFamilyFlags2; + SpellModifier *mod = new SpellModifier(SPELLMOD_CHARGES,SPELLMOD_FLAT,jumps-5,spellProto->Id,spellProto->SpellFamilyFlags,spellProto->SpellFamilyFlags2); // remove before apply next (locked against deleted) triggeredByAura->SetInUse(true); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f286a4c0c..d9eccda5b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9036" + #define REVISION_NR "9037" #endif // __REVISION_NR_H__ From 6adfd75040522cf1d22b06c393564fbb1fd0779d Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sun, 20 Dec 2009 22:37:11 +0300 Subject: [PATCH 3/9] [9038] Update highest threat enemy at move to offline list. It will restored if still highest at move back and fix at least visual bug with GM-mode on still show for GM as highest threat enemy for creature. --- src/game/ThreatManager.cpp | 3 ++- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 2d4669518..8f8329692 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -512,6 +512,7 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat setCurrentVictim(NULL); setDirty(true); } + iOwner->SendThreatRemove(hostileReference); iThreatContainer.remove(hostileReference); iUpdateNeed = true; iThreatOfflineContainer.addReference(hostileReference); @@ -531,9 +532,9 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat setCurrentVictim(NULL); setDirty(true); } - iOwner->SendThreatRemove(hostileReference); if(hostileReference->isOnline()) { + iOwner->SendThreatRemove(hostileReference); iThreatContainer.remove(hostileReference); iUpdateNeed = true; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d9eccda5b..b5eb66fe7 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9037" + #define REVISION_NR "9038" #endif // __REVISION_NR_H__ From 7b0a059d2f9100b8ac0e49129bf27ea4400c321a Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 21 Dec 2009 00:02:03 +0300 Subject: [PATCH 4/9] [9039] Allow have more one hunter aspect from different casters. --- src/game/SpellMgr.cpp | 3 ++- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index e018eaf36..5bda5eeed 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -338,6 +338,7 @@ bool IsSingleFromSpellSpecificPerTargetPerCaster(SpellSpecific spellSpec1,SpellS case SPELL_AURA: case SPELL_STING: case SPELL_CURSE: + case SPELL_ASPECT: case SPELL_POSITIVE_SHOUT: case SPELL_JUDGEMENT: case SPELL_HAND: @@ -355,6 +356,7 @@ bool IsSingleFromSpellSpecificSpellRanksPerTarget(SpellSpecific spellSpec1,Spell case SPELL_BLESSING: case SPELL_AURA: case SPELL_CURSE: + case SPELL_ASPECT: case SPELL_HAND: return spellSpec1==spellSpec2; default: @@ -368,7 +370,6 @@ bool IsSingleFromSpellSpecificPerTarget(SpellSpecific spellSpec1,SpellSpecific s switch(spellSpec1) { case SPELL_SEAL: - case SPELL_ASPECT: case SPELL_TRACKER: case SPELL_WARLOCK_ARMOR: case SPELL_MAGE_ARMOR: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b5eb66fe7..5c35a4338 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9038" + #define REVISION_NR "9039" #endif // __REVISION_NR_H__ From 70c7d955f91109cafd365b49a5fc76c96b1e562e Mon Sep 17 00:00:00 2001 From: laise Date: Mon, 21 Dec 2009 01:27:56 +0300 Subject: [PATCH 5/9] [9040] Update code for talent 17056 and ranks correct work. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 13 ++++++++----- src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 77ade4ca6..a1c28baf6 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3008,27 +3008,30 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) case FORM_DIREBEAR: { // get furor proc chance - uint32 FurorChance = 0; + int32 furorChance = 0; Unit::AuraList const& mDummy = m_target->GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraList::const_iterator i = mDummy.begin(); i != mDummy.end(); ++i) { if ((*i)->GetSpellProto()->SpellIconID == 238) { - FurorChance = (*i)->GetModifier()->m_amount; + furorChance = (*i)->GetModifier()->m_amount; break; } } + if(!furorChance) + break; + if (m_modifier.m_miscvalue == FORM_CAT) { m_target->SetPower(POWER_ENERGY, 0); - if(urand(1,100) <= FurorChance) - m_target->CastSpell(m_target, 17099, true, NULL, this); + // Furor chance is now amount of energy for cat form + m_target->CastCustomSpell(m_target, 17099, &furorChance, NULL, NULL, this); } else { m_target->SetPower(POWER_RAGE, 0); - if(urand(1,100) <= FurorChance) + if(urand(1,100) <= furorChance) m_target->CastSpell(m_target, 17057, true, NULL, this); } break; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5c35a4338..93db2cd4a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9039" + #define REVISION_NR "9040" #endif // __REVISION_NR_H__ From 050bff1a1dc771994387b31814823b13b5e04adc Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Sun, 20 Dec 2009 23:48:12 +0100 Subject: [PATCH 6/9] [9041] Move enum CastFlags from eventAI to creatureAI for access to all AI Signed-off-by: NoFantasy --- src/game/CreatureAI.h | 10 ++++++++++ src/game/CreatureEventAI.h | 10 ---------- src/shared/revision_nr.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index a9857eb2a..4038b675e 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -34,6 +34,16 @@ struct SpellEntry; #define TIME_INTERVAL_LOOK 5000 #define VISIBILITY_RANGE 10000 +enum CastFlags +{ + CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting + CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) + CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range + CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range + CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself + CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell +}; + class MANGOS_DLL_SPEC CreatureAI { public: diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h index 6124fb884..6ab1ec4e1 100644 --- a/src/game/CreatureEventAI.h +++ b/src/game/CreatureEventAI.h @@ -137,16 +137,6 @@ enum Target TARGET_T_END }; -enum CastFlags -{ - CAST_INTURRUPT_PREVIOUS = 0x01, //Interrupt any spell casting - CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) - CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range - CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range - CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself - CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell -}; - enum EventFlags { EFLAG_REPEATABLE = 0x01, //Event repeats diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 93db2cd4a..d3be9202a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9040" + #define REVISION_NR "9041" #endif // __REVISION_NR_H__ From 817ffb7a8d8fb0028b39dd25044bc73c8254f4cc Mon Sep 17 00:00:00 2001 From: goldberg002 Date: Mon, 21 Dec 2009 01:49:17 +0300 Subject: [PATCH 7/9] [9042] Remove double apply bonuses for spell 635/31935 and ranks One time in code and second time by DB data. Signed-off-by: VladimirMangos --- src/game/SpellEffects.cpp | 16 ---------------- src/shared/revision_nr.h | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d11576e22..4f4b4b90d 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -668,22 +668,6 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) if(stacks) damage += damage * stacks * 10 /100; } - // Avenger's Shield ($m1+0.07*$SPH+0.07*$AP) - ranged sdb for future - else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) - { - 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.07f) + int32(holy * 7 / 100); - } - // Hammer of Wrath ($m1+0.15*$SPH+0.15*$AP) - ranged type sdb future fix - else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000008000000000)) - { - 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.15f) + int32(holy * 15 / 100); - } // Hammer of the Righteous else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0004000000000000)) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d3be9202a..b3daa46ed 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9041" + #define REVISION_NR "9042" #endif // __REVISION_NR_H__ From a01f2e1f726803631b01fd0b3cce4a7fc649f30f Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 21 Dec 2009 02:02:08 +0300 Subject: [PATCH 8/9] [9043] Fxied build at *nix systems. --- src/game/SpellAuras.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index a1c28baf6..f33c0134d 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2588,7 +2588,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) { // Reduce backfire damage (dot damage) from Shadow Word: Death // aura have wrong effectclassmask, so use hardcoded value - m_spellmod = new SpellModifier(SPELLMOD_DOT,SPELLMOD_PCT,m_modifier.m_amount,GetId(),0x0000200000000000); + m_spellmod = new SpellModifier(SPELLMOD_DOT,SPELLMOD_PCT,m_modifier.m_amount,GetId(),UI64LIT(0x0000200000000000)); } ((Player*)m_target)->AddSpellMod(m_spellmod, apply); return; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b3daa46ed..69398c2a8 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9042" + #define REVISION_NR "9043" #endif // __REVISION_NR_H__ From 68c87571272b6aa2ca1368f68070eddbbfa5f26a Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 21 Dec 2009 16:48:11 +0300 Subject: [PATCH 9/9] [9044] Exclude TARGET_SELF from IsExplicitPositiveTarget. This must fix triggred spells casting in case when it self casted but cast code send diff target. --- src/game/SpellMgr.cpp | 5 ++--- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 5bda5eeed..bdcbf71c5 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -429,10 +429,9 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB) bool IsExplicitPositiveTarget(uint32 targetA) { - // positive targets + // positive targets that in target selection code expect target in m_targers, so not that auto-select target by spell data by m_caster and etc switch(targetA) { - case TARGET_SELF: case TARGET_SINGLE_FRIEND: case TARGET_SINGLE_PARTY: case TARGET_CHAIN_HEAL: @@ -448,7 +447,7 @@ bool IsExplicitPositiveTarget(uint32 targetA) bool IsExplicitNegativeTarget(uint32 targetA) { - // non-positive targets + // non-positive targets that in target selection code expect target in m_targers, so not that auto-select target by spell data by m_caster and etc switch(targetA) { case TARGET_CHAIN_DAMAGE: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 69398c2a8..4fc4e5d5e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9043" + #define REVISION_NR "9044" #endif // __REVISION_NR_H__