*Update to Mangos 7059.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-09 16:06:17 -06:00
parent 75cd06b98c
commit 5c8f52d134
31 changed files with 882 additions and 683 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ bool LoginQueryHolder::Initialize()
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT leaderGuid FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,slot,active,disabled FROM character_spell WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4 FROM character_queststatus WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS,"SELECT quest,time FROM character_queststatus_daily WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADTUTORIALS, "SELECT tut0,tut1,tut2,tut3,tut4,tut5,tut6,tut7 FROM character_tutorial WHERE account = '%u' AND realmid = '%u'", GetAccountId(), realmID);
+7 -23
View File
@@ -593,7 +593,7 @@ void Pet::RegenerateFocus()
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == POWER_FOCUS)
addvalue *= ((*i)->GetModifierValue() + 100) / 100.0f;
addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
ModifyPower(POWER_FOCUS, (int32)addvalue);
}
@@ -1108,7 +1108,7 @@ void Pet::_SaveSpellCooldowns()
void Pet::_LoadSpells()
{
QueryResult *result = CharacterDatabase.PQuery("SELECT spell,slot,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber());
QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber());
if(result)
{
@@ -1116,7 +1116,7 @@ void Pet::_LoadSpells()
{
Field *fields = result->Fetch();
addSpell(fields[0].GetUInt16(), fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16());
addSpell(fields[0].GetUInt16(), fields[1].GetUInt16(), PETSPELL_UNCHANGED);
}
while( result->NextRow() );
@@ -1133,7 +1133,7 @@ void Pet::_SaveSpells()
if (itr->second->state == PETSPELL_REMOVED || itr->second->state == PETSPELL_CHANGED)
CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first);
if (itr->second->state == PETSPELL_NEW || itr->second->state == PETSPELL_CHANGED)
CharacterDatabase.PExecute("INSERT INTO pet_spell (guid,spell,slot,active) VALUES ('%u', '%u', '%u','%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second->slotId,itr->second->active);
CharacterDatabase.PExecute("INSERT INTO pet_spell (guid,spell,active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second->active);
if (itr->second->state == PETSPELL_REMOVED)
_removeSpell(itr->first);
@@ -1251,7 +1251,7 @@ void Pet::_SaveAuras()
{
CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "', '%u', '%u', '%u', '%d', '%d', '%d', '%d')",
m_charmInfo->GetPetNumber(), itr2->second->GetCasterGUID(),(uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
m_charmInfo->GetPetNumber(), itr2->second->GetCasterGUID(),(uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount ,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
}
}
}
@@ -1269,7 +1269,7 @@ void Pet::_SaveAuras()
}
}
bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 slot_id, PetSpellType type)
bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, PetSpellType type)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
if (!spellInfo)
@@ -1333,7 +1333,6 @@ bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 s
if(spellmgr.GetFirstSpellInChain(itr->first) == chainstart)
{
slot_id = itr->second->slotId;
newspell->active = itr->second->active;
if(newspell->active == ACT_ENABLED)
@@ -1345,21 +1344,6 @@ bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 s
}
}
uint16 tmpslot = slot_id;
if (tmpslot == 0xffff)
{
uint16 maxid = 0;
PetSpellMap::iterator itr;
for (itr = m_spells.begin(); itr != m_spells.end(); ++itr)
{
if(itr->second->state == PETSPELL_REMOVED) continue;
if (itr->second->slotId > maxid) maxid = itr->second->slotId;
}
tmpslot = maxid + 1;
}
newspell->slotId = tmpslot;
m_spells[spell_id] = newspell;
if (IsPassiveSpell(spell_id))
@@ -1631,7 +1615,7 @@ void Pet::LearnPetPassives()
// Passive 01~10, Passive 00 (20782, not used), Ferocious Inspiration (34457)
// Scale 01~03 (34902~34904, bonus from owner, not used)
for(PetFamilySpellsSet::const_iterator petSet = petStore->second.begin(); petSet != petStore->second.end(); ++petSet)
addSpell(*petSet, ACT_DECIDE, PETSPELL_NEW, 0xffff, PETSPELL_FAMILY);
addSpell(*petSet, ACT_DECIDE, PETSPELL_NEW, PETSPELL_FAMILY);
}
}
+1 -2
View File
@@ -68,7 +68,6 @@ enum PetSpellType
struct PetSpell
{
uint16 slotId;
uint16 active;
PetSpellState state : 16;
@@ -191,7 +190,7 @@ class Pet : public Creature
void _LoadSpells();
void _SaveSpells();
bool addSpell(uint16 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, uint16 slot_id=0xffff, PetSpellType type = PETSPELL_NORMAL);
bool addSpell(uint16 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
bool learnSpell(uint16 spell_id);
void learnLevelupSpells();
bool unlearnSpell(uint16 spell_id);
+13 -44
View File
@@ -945,7 +945,7 @@ void Player::HandleDrowning()
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifierValue()) / 100.0f);
UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifier()->m_amount) / 100.0f);
if ((m_isunderwater & 0x01) && !(m_isunderwater & 0x80) && isAlive())
{
@@ -1987,7 +1987,7 @@ void Player::Regenerate(Powers power)
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == power)
addvalue *= ((*i)->GetModifierValue() + 100) / 100.0f;
addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
}
if (power != POWER_RAGE && power != POWER_RUNIC_POWER)
@@ -2028,7 +2028,7 @@ void Player::RegenerateHealth()
{
AuraList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
for(AuraList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
addvalue *= (100.0f + (*i)->GetModifierValue()) / 100.0f;
addvalue *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
}
else if(HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
addvalue *= GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT) / 100.0f;
@@ -2226,7 +2226,7 @@ void Player::GiveXP(uint32 xp, Unit* victim)
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
xp = uint32(xp*(1.0f + (*i)->GetModifierValue() / 100.0f));
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
// XP resting bonus for kill
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
@@ -2633,7 +2633,7 @@ void Player::AddNewMailDeliverTime(time_t deliver_time)
}
}
bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading, uint16 slot_id, bool disabled)
bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading, bool disabled)
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
if (!spellInfo)
@@ -2751,7 +2751,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
else if(uint32 prev_spell = spellmgr.GetPrevSpellInChain(spell_id))
{
if(loading) // at spells loading, no output, but allow save
addSpell(prev_spell,active,true,loading,SPELL_WITHOUT_SLOT_ID,disabled);
addSpell(prev_spell,active,true,loading,disabled);
else // at normal learning
learnSpell(prev_spell);
}
@@ -2809,23 +2809,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
}
}
uint16 tmpslot=slot_id;
if (tmpslot == SPELL_WITHOUT_SLOT_ID)
{
uint16 maxid = 0;
PlayerSpellMap::iterator itr;
for (itr = m_spells.begin(); itr != m_spells.end(); ++itr)
{
if(itr->second->state == PLAYERSPELL_REMOVED)
continue;
if (itr->second->slotId > maxid)
maxid = itr->second->slotId;
}
tmpslot = maxid + 1;
}
newspell->slotId = tmpslot;
m_spells[spell_id] = newspell;
// return false if spell disabled
@@ -4961,22 +4944,8 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType)
UpdateAllCritPercentages();
}
void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, MeleeHitOutcome outcome, bool defence)
void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence)
{
/* Not need, this checked on call this func from trigger system
switch(outcome)
{
case MELEE_HIT_CRIT:
case MELEE_HIT_DODGE:
case MELEE_HIT_PARRY:
case MELEE_HIT_BLOCK:
case MELEE_HIT_BLOCK_CRIT:
return;
default:
break;
}
*/
uint32 plevel = getLevel(); // if defense than pVictim == attacker
uint32 greylevel = Trinity::XP::GetGrayLevel(plevel);
uint32 moblevel = pVictim->getLevelForTarget(this);
@@ -6920,7 +6889,7 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attac
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
HandleBaseModValue(mod, FLAT_MOD, float (aura->GetModifierValue()), apply);
HandleBaseModValue(mod, FLAT_MOD, float (aura->GetModifier()->m_amount), apply);
}
}
@@ -6954,7 +6923,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
HandleStatModifier(unitMod, unitModType, float(aura->GetModifierValue()),apply);
HandleStatModifier(unitMod, unitModType, float(aura->GetModifier()->m_amount),apply);
}
}
@@ -15342,7 +15311,7 @@ void Player::_LoadSpells(QueryResult *result)
delete itr->second;
m_spells.clear();
//QueryResult *result = CharacterDatabase.PQuery("SELECT spell,slot,active FROM character_spell WHERE guid = '%u'",GetGUIDLow());
//QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow());
if(result)
{
@@ -15350,7 +15319,7 @@ void Player::_LoadSpells(QueryResult *result)
{
Field *fields = result->Fetch();
addSpell(fields[0].GetUInt16(), fields[2].GetBool(), false, true, fields[1].GetUInt16(), fields[3].GetBool());
addSpell(fields[0].GetUInt16(), fields[1].GetBool(), false, true, fields[2].GetBool());
}
while( result->NextRow() );
@@ -15927,7 +15896,7 @@ void Player::_SaveAuras()
{
CharacterDatabase.PExecute("INSERT INTO character_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "' ,'%u', '%u', '%u', '%d', '%d', '%d', '%d')",
GetGUIDLow(), itr2->second->GetCasterGUID(), (uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
GetGUIDLow(), itr2->second->GetCasterGUID(), (uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount ,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
}
}
}
@@ -16134,7 +16103,7 @@ void Player::_SaveSpells()
if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED)
CharacterDatabase.PExecute("DELETE FROM character_spell WHERE guid = '%u' and spell = '%u'", GetGUIDLow(), itr->first);
if (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)
CharacterDatabase.PExecute("INSERT INTO character_spell (guid,spell,slot,active,disabled) VALUES ('%u', '%u', '%u','%u','%u')", GetGUIDLow(), itr->first, itr->second->slotId,itr->second->active ? 1 : 0,itr->second->disabled ? 1 : 0);
CharacterDatabase.PExecute("INSERT INTO character_spell (guid,spell,active,disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0,itr->second->disabled ? 1 : 0);
if (itr->second->state == PLAYERSPELL_REMOVED)
_removeSpell(itr->first);
+2 -5
View File
@@ -75,14 +75,11 @@ enum PlayerSpellState
struct PlayerSpell
{
uint16 slotId : 16;
PlayerSpellState state : 8;
bool active : 1;
bool disabled : 1;
};
#define SPELL_WITHOUT_SLOT_ID uint16(-1)
// Spell modifier (used for modify other spells)
struct SpellModifier
{
@@ -1481,7 +1478,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SendProficiency(uint8 pr1, uint32 pr2);
void SendInitialSpells();
bool addSpell(uint32 spell_id, bool active, bool learning = true, bool loading = false, uint16 slot_id=SPELL_WITHOUT_SLOT_ID, bool disabled = false);
bool addSpell(uint32 spell_id, bool active, bool learning = true, bool loading = false, bool disabled = false);
void learnSpell(uint32 spell_id);
void removeSpell(uint32 spell_id, bool disabled = false);
void resetSpells();
@@ -1749,7 +1746,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void UpdateDefense();
void UpdateWeaponSkill (WeaponAttackType attType);
void UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, MeleeHitOutcome outcome, bool defence);
void UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence);
void SetSkill(uint32 id, uint16 currVal, uint16 maxVal);
uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus
+2 -1
View File
@@ -288,7 +288,7 @@ enum SpellCategory
#define SPELL_ATTR_EX2_UNK2 0x00000004 // 2 boss spells?
#define SPELL_ATTR_EX2_UNK3 0x00000008 // 3
#define SPELL_ATTR_EX2_UNK4 0x00000010 // 4
#define SPELL_ATTR_EX2_UNK5 0x00000020 // 5
#define SPELL_ATTR_EX2_AUTOREPEAT_FLAG 0x00000020 // 5
#define SPELL_ATTR_EX2_UNK6 0x00000040 // 6
#define SPELL_ATTR_EX2_UNK7 0x00000080 // 7
#define SPELL_ATTR_EX2_UNK8 0x00000100 // 8 not set in 3.0.3
@@ -2149,6 +2149,7 @@ enum SummonType
SUMMON_TYPE_UNKNOWN5 = 409,
SUMMON_TYPE_POSESSED3 = 427,
SUMMON_TYPE_POSESSED2 = 428,
SUMMON_TYPE_FORCE_OF_NATURE = 669,
SUMMON_TYPE_GUARDIAN2 = 1161
};
+18 -10
View File
@@ -658,22 +658,30 @@ void Spell::prepareDataForTriggerSystem()
m_procVictim = PROC_FLAG_TAKEN_MELEE_SPELL_HIT;
break;
case SPELL_DAMAGE_CLASS_RANGED:
m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT;
m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT;
break;
default:
if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell
// Auto attack
if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG)
{
m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL;
m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL;
m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT;
m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT;
}
// Wands
else if (IsAutoRepeatRangedSpell(m_spellInfo) && m_spellInfo->Id != SPELL_ID_AUTOSHOT)
else // Ranged spell attack
{
m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT;
m_procVictim = PROC_FLAG_TAKEN_RANGED_SPELL_HIT;
}
else
break;
default:
if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell
{
m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL;
m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL;
}
else if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) // Wands auto attack
{
m_procAttacker = PROC_FLAG_SUCCESSFUL_RANGED_HIT;
m_procVictim = PROC_FLAG_TAKEN_RANGED_HIT;
}
else // Negative spell
{
m_procAttacker = PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT;
m_procVictim = PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT;
+326 -263
View File
File diff suppressed because it is too large Load Diff
+24 -26
View File
@@ -222,8 +222,6 @@ class TRINITY_DLL_SPEC Aura
void SetModifier(AuraType t, int32 a, uint32 pt, int32 miscValue);
Modifier* GetModifier() {return &m_modifier;}
int32 GetModifierValuePerStack() {return m_modifier.m_amount;}
int32 GetModifierValue() {return m_modifier.m_amount * m_stackAmount;}
int32 GetMiscValue() {return m_spellProto->EffectMiscValue[m_effIndex];}
int32 GetMiscBValue() {return m_spellProto->EffectMiscValueB[m_effIndex];}
@@ -238,11 +236,8 @@ class TRINITY_DLL_SPEC Aura
int32 GetAuraDuration() const { return m_duration; }
void SetAuraDuration(int32 duration) { m_duration = duration; }
time_t GetAuraApplyTime() { return m_applyTime; }
SpellModifier *getAuraSpellMod() {return m_spellmod; }
void UpdateAuraDuration();
void SendAuraDurationForCaster(Player* caster);
void UpdateSlotCounterAndDuration();
SpellModifier *getAuraSpellMod() {return m_spellmod; }
uint64 const& GetCasterGUID() const { return m_caster_guid; }
Unit* GetCaster() const;
@@ -283,6 +278,12 @@ class TRINITY_DLL_SPEC Aura
void SetAura(bool remove) { m_target->SetVisibleAura(m_auraSlot, remove ? 0 : GetId()); }
void SendAuraUpdate(bool remove);
int8 GetStackAmount() {return m_stackAmount;}
int32 GetModifierValuePerStack() {return m_modifier.m_amount / m_stackAmount;}
void SetStackAmount(uint8 num);
bool modStackAmount(int32 num); // return true if last charge dropped
void RefreshAura();
bool IsPositive() { return m_positive; }
void SetNegative() { m_positive = false; }
void SetPositive() { m_positive = true; }
@@ -323,31 +324,33 @@ class TRINITY_DLL_SPEC Aura
uint32 const *getAuraSpellClassMask() const { return m_spellProto->EffectSpellClassMaskA + m_effIndex * 3; }
bool isAffectedOnSpell(SpellEntry const *spell) const;
int32 GetStackAmount() {return m_stackAmount;}
void SetStackAmount(int32 amount) {m_stackAmount=amount;}
protected:
Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
Modifier m_modifier;
SpellModifier *m_spellmod;
uint32 m_effIndex;
SpellEntry const *m_spellProto;
int32 m_currentBasePoints; // cache SpellEntry::EffectBasePoints and use for set custom base points
uint64 m_caster_guid;
Unit* m_target;
int32 m_maxduration;
int32 m_duration;
int32 m_timeCla;
uint64 m_caster_guid;
uint64 m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
time_t m_applyTime;
AuraRemoveMode m_removeMode;
int32 m_currentBasePoints; // cache SpellEntry::EffectBasePoints and use for set custom base points
int32 m_maxduration; // Max aura duration
int32 m_duration; // Current time
int32 m_timeCla; // Timer for power per sec calcultion
int32 m_periodicTimer; // Timer for periodic auras
uint8 m_auraSlot;
uint8 m_auraFlags;
uint8 m_auraLevel;
int8 m_procCharges;
AuraRemoveMode m_removeMode:8; // Store info for know remove aura reason
DiminishingGroup m_AuraDRGroup:8; // Diminishing
uint8 m_effIndex; // Aura effect index in spell
uint8 m_auraSlot; // Aura slot on unit (for show in client)
uint8 m_auraFlags; // Aura info flag (for send data to client)
uint8 m_auraLevel; // Aura level (store caster level for correct show level dep amount)
uint8 m_procCharges; // Aura charges (0 for infinite)
uint8 m_stackAmount; // Aura stack amount
bool m_positive:1;
bool m_permanent:1;
@@ -358,14 +361,9 @@ class TRINITY_DLL_SPEC Aura
bool m_isPersistent:1;
bool m_isDeathPersist:1;
bool m_isRemovedOnShapeLost:1;
bool m_updated:1;
bool m_updated:1; // Prevent remove aura by stack if set
bool m_in_use:1; // true while in Aura::ApplyModifier call
int32 m_periodicTimer;
uint32 m_PeriodicEventId;
DiminishingGroup m_AuraDRGroup;
int32 m_stackAmount;
private:
void CleanupTriggeredSpells();
};
+47 -45
View File
@@ -519,31 +519,29 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
// consume from stack dozes not more that have combo-points
if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
{
// count consumed deadly poison doses at target
uint32 doses = 0;
// remove consumed poison doses
Aura *poison = 0;
// Lookup for Deadly poison (only attacker applied)
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end() && combo;)
{
// Deadly poison (only attacker applied)
if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE && ((*itr)->GetSpellProto()->SpellFamilyFlags & 0x10000) &&
(*itr)->GetSpellProto()->SpellVisual[0]==5100 && (*itr)->GetCasterGUID()==m_caster->GetGUID() )
if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
(*itr)->GetSpellProto()->SpellFamilyFlags & 0x10000 &&
(*itr)->GetCasterGUID()==m_caster->GetGUID() )
{
--combo;
++doses;
unitTarget->RemoveSingleAuraFromStack((*itr)->GetId(), (*itr)->GetEffIndex());
itr = auras.begin();
poison = *itr;
break;
}
else
++itr;
// count consumed deadly poison doses at target
if (poison)
{
uint32 spellId = poison->GetId();
uint32 doses = poison->GetStackAmount();
if (doses > combo)
doses = combo;
for (int i=0; i< doses; i++)
unitTarget->RemoveSingleSpellAurasFromStack(spellId);
damage *= doses;
damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
}
damage *= doses;
damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
// Eviscerate and Envenom Bonus Damage (item set effect)
if(m_caster->GetDummyAura(37169))
damage += ((Player*)m_caster)->GetComboPoints()*40;
@@ -628,19 +626,25 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
}
case SPELLFAMILY_PALADIN:
{
// Judgement of Vengeance
// Judgement of Vengeance ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance on the target
if((m_spellInfo->SpellFamilyFlags & 0x800000000LL) && 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
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())
++stacks;
if(!stacks)
//No damage if the target isn't affected by this
damage = -1;
else
damage *= stacks;
{
stacks = (*itr)->GetStackAmount();
break;
}
// + 10% for each application of Holy Vengeance on the target
if(stacks)
damage += damage * stacks * 10 /100;
}
// Avenger's Shield ($m1+0.07*$SPH+0.07*$AP)
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000004000LL)
@@ -1576,6 +1580,8 @@ void Spell::EffectDummy(uint32 i)
case 20930: hurt = 25902; heal = 25903; break;
case 27174: hurt = 27176; heal = 27175; break;
case 33072: hurt = 33073; heal = 33074; break;
case 48824: hurt = 48822; heal = 48820; break;
case 48825: hurt = 48823; heal = 48821; break;
default:
sLog.outError("Spell::EffectDummy: Spell %u not handled in HS",m_spellInfo->Id);
return;
@@ -2249,7 +2255,8 @@ void Spell::EffectPowerDrain(uint32 i)
unitTarget->ModifyPower(drain_power,-new_damage);
if(drain_power == POWER_MANA)
// Don`t restore from self drain
if(drain_power == POWER_MANA && m_caster != unitTarget)
{
float manaMultiplier = m_spellInfo->EffectMultipleValue[i];
if(manaMultiplier==0)
@@ -2388,7 +2395,7 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
Unit::AuraList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
if((*i)->GetId() == 45062)
damageAmount+=(*i)->GetModifierValue();
damageAmount+=(*i)->GetModifier()->m_amount;
if (damageAmount)
m_caster->RemoveAurasDueToSpell(45062);
@@ -2428,7 +2435,7 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
tickheal = auraCaster->SpellHealingBonus(targetAura->GetSpellProto(), tickheal, DOT, unitTarget);
//int32 tickheal = targetAura->GetSpellProto()->EffectBasePoints[idx] + 1;
//It is said that talent bonus should not be included
//int32 tickheal = targetAura->GetModifierValue();
//int32 tickheal = targetAura->GetModifier()->m_amount;
int32 tickcount = GetSpellDuration(targetAura->GetSpellProto()) / targetAura->GetSpellProto()->EffectAmplitude[idx];
addhealth += tickheal * tickcount;
unitTarget->RemoveAurasDueToCasterSpell(targetAura->GetId(), targetAura->GetCasterGUID());
@@ -3161,6 +3168,7 @@ void Spell::EffectSummonType(uint32 i)
case SUMMON_TYPE_POSESSED2:
case SUMMON_TYPE_POSESSED3:
EffectSummonPossessed(i);
case SUMMON_TYPE_FORCE_OF_NATURE:
case SUMMON_TYPE_GUARDIAN2:
EffectSummonGuardian(i);
break;
@@ -3404,12 +3412,7 @@ void Spell::EffectDispel(uint32 i)
SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first);
data << uint32(spellInfo->Id); // Spell Id
data << uint8(0); // 0 - dispelled !=0 cleansed
if(spellInfo->StackAmount!= 0)
{
//Why are Aura's Removed by EffIndex? Auras should be removed as a whole.....
unitTarget->RemoveSingleAuraFromStackByDispel(spellInfo->Id);
}
else
//Why are Aura's Removed by EffIndex? Auras should be removed as a whole.....
unitTarget->RemoveAurasDueToSpellByDispel(spellInfo->Id, j->second, m_caster);
}
m_caster->SendMessageToSet(&data, true);
@@ -4299,7 +4302,6 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
if(m_spellInfo->SpellVisual[0] == 671 && m_spellInfo->SpellIconID == 1508)
{
uint32 stack = 0;
Unit::AuraList const& list = unitTarget->GetAurasByType(SPELL_AURA_MOD_RESISTANCE);
for(Unit::AuraList::const_iterator itr=list.begin();itr!=list.end();++itr)
{
@@ -4307,9 +4309,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
if(proto->SpellFamilyName == SPELLFAMILY_WARRIOR
&& proto->SpellFamilyFlags == SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR)
{
int32 duration = GetSpellDuration(proto);
(*itr)->SetAuraDuration(duration);
(*itr)->SendAuraUpdate(false);
(*itr)->RefreshAura();
stack = (*itr)->GetStackAmount();
break;
}
@@ -4347,6 +4347,8 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
}
}
}
if (stack)
spell_bonus += stack * CalculateDamage(2, unitTarget);
}
break;
}
@@ -4732,6 +4734,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
case 11729:
case 11730:
case 27230:
case 47871:
case 47878:
{
uint32 itemtype;
uint32 rank = 0;
@@ -4779,12 +4783,11 @@ void Spell::EffectScriptEffect(uint32 effIndex)
}
// Brittle Armor - need remove one 24575 Brittle Armor aura
case 24590:
unitTarget->RemoveSingleAuraFromStack(24575, 0);
unitTarget->RemoveSingleAuraFromStack(24575, 1);
unitTarget->RemoveSingleSpellAurasFromStack(24575);
return;
// Mercurial Shield - need remove one 26464 Mercurial Shield aura
case 26465:
unitTarget->RemoveSingleAuraFromStack(26464, 0);
unitTarget->RemoveSingleSpellAurasFromStack(26464);
return;
// Orb teleport spells
case 25140:
@@ -5054,8 +5057,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
if (!(familyFlag & 0x000000800000C000LL))
continue;
// Refresh aura duration
aura->SetAuraDuration(aura->GetAuraMaxDuration());
aura->SendAuraUpdate(false);
aura->RefreshAura();
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
if (familyFlag & 0x0000000000004000LL && aura->GetEffIndex() == 0)
+12 -2
View File
@@ -429,10 +429,9 @@ inline bool isSpellBreakStealth(SpellEntry const* spellInfo)
inline bool IsAutoRepeatRangedSpell(SpellEntry const* spellInfo)
{
return (spellInfo->Attributes & SPELL_ATTR_RANGED) && (spellInfo->AttributesEx2 == 0x000020 /*autorepeat*/);
return (spellInfo->Attributes & SPELL_ATTR_RANGED) && (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG);
}
uint8 GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 form);
inline bool IsChanneledSpell(SpellEntry const* spellInfo)
@@ -460,6 +459,17 @@ inline uint32 GetSpellMechanicMask(SpellEntry const* spellInfo, int32 effect)
return mask;
}
inline uint32 GetAllSpellMechanicMask(SpellEntry const* spellInfo)
{
uint32 mask = 0;
if (spellInfo->Mechanic)
mask |= 1<<spellInfo->Mechanic;
for (int i=0; i< 3; ++i)
if (spellInfo->EffectMechanic[i])
mask |= 1<<spellInfo->EffectMechanic[i];
return mask;
}
inline Mechanics GetEffectMechanic(SpellEntry const* spellInfo, int32 effect)
{
if (spellInfo->EffectMechanic[effect])
+4 -4
View File
@@ -165,7 +165,7 @@ void Player::UpdateArmor()
{
Modifier* mod = (*i)->GetModifier();
if(mod->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
value += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetModifierValue() / 100.0f);
value += int32(GetStat(Stats((*i)->GetMiscBValue())) * mod->m_amount / 100.0f);
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
@@ -612,10 +612,10 @@ void Player::UpdateExpertise(WeaponAttackType attack)
{
// item neutral spell
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
expertise += (*itr)->GetModifierValue();
expertise += (*itr)->GetModifier()->m_amount;
// item dependent spell
else if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
expertise += (*itr)->GetModifierValue();
expertise += (*itr)->GetModifier()->m_amount;
}
if(expertise < 0)
@@ -645,7 +645,7 @@ void Player::UpdateManaRegen()
for(AuraList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
power_regen_mp5 += GetStat(Stats(mod->m_miscvalue)) * (*i)->GetModifierValue() / 500.0f;
power_regen_mp5 += GetStat(Stats(mod->m_miscvalue)) * mod->m_amount / 500.0f;
}
// Bonus from some dummy auras
+177 -208
View File
@@ -1306,10 +1306,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
{
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
if( spellInfo->AttributesEx3 & 0x40000 && spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && ((*itr).second->GetCasterGUID() == GetGUID()))
{
(*itr).second->SetAuraDuration((*itr).second->GetAuraMaxDuration());
(*itr).second->SendAuraUpdate(false);
}
(*itr).second->RefreshAura();
}
}
// Call default DealDamage
@@ -1623,10 +1620,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
{
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
if( spellInfo->AttributesEx3 & 0x40000 && spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && ((*itr).second->GetCasterGUID() == GetGUID()))
{
(*itr).second->SetAuraDuration((*itr).second->GetAuraMaxDuration());
(*itr).second->SendAuraUpdate(false);
}
(*itr).second->RefreshAura();
}
}
@@ -2551,7 +2545,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
Unit::AuraList const& mReflectSpellsSchool = pVictim->GetAurasByType(SPELL_AURA_REFLECT_SPELLS_SCHOOL);
for(Unit::AuraList::const_iterator i = mReflectSpellsSchool.begin(); i != mReflectSpellsSchool.end(); ++i)
if((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spell))
reflectchance = (*i)->GetModifierValue();
reflectchance = (*i)->GetModifier()->m_amount;
if (reflectchance > 0 && roll_chance_i(reflectchance))
{
// Start triggers for remove charges if need (trigger only for victim, and mark as active spell)
@@ -3167,7 +3161,7 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
modifier += (*i)->GetModifierValue();
modifier += (*i)->GetModifier()->m_amount;
return modifier;
}
@@ -3178,7 +3172,7 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
multiplier *= (100.0f + (*i)->GetModifierValue())/100.0f;
multiplier *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f;
return multiplier;
}
@@ -3190,7 +3184,7 @@ int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
int32 amount = (*i)->GetModifierValue();
int32 amount = (*i)->GetModifier()->m_amount;
if (amount > modifier)
modifier = amount;
}
@@ -3205,7 +3199,7 @@ int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
int32 amount = (*i)->GetModifierValue();
int32 amount = (*i)->GetModifier()->m_amount;
if (amount < modifier)
modifier = amount;
}
@@ -3222,7 +3216,7 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask)
{
Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue & misc_mask)
modifier += (*i)->GetModifierValue();
modifier += (*i)->GetModifier()->m_amount;
}
return modifier;
}
@@ -3236,7 +3230,7 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask
{
Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue & misc_mask)
multiplier *= (100.0f + (*i)->GetModifierValue())/100.0f;
multiplier *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f;
}
return multiplier;
}
@@ -3249,7 +3243,7 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
int32 amount = (*i)->GetModifierValue();
int32 amount = (*i)->GetModifier()->m_amount;
if (mod->m_miscvalue & misc_mask && amount > modifier)
modifier = amount;
}
@@ -3265,7 +3259,7 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
int32 amount = (*i)->GetModifierValue();
int32 amount = (*i)->GetModifier()->m_amount;
if (mod->m_miscvalue & misc_mask && amount < modifier)
modifier = amount;
}
@@ -3282,7 +3276,7 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value)
{
Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue == misc_value)
modifier += (*i)->GetModifierValue();
modifier += (*i)->GetModifier()->m_amount;
}
return modifier;
}
@@ -3296,7 +3290,7 @@ float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_valu
{
Modifier* mod = (*i)->GetModifier();
if (mod->m_miscvalue == misc_value)
multiplier *= (100.0f + (*i)->GetModifierValue())/100.0f;
multiplier *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f;
}
return multiplier;
}
@@ -3309,7 +3303,7 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
int32 amount = (*i)->GetModifierValue();
int32 amount = (*i)->GetModifier()->m_amount;
if (mod->m_miscvalue == misc_value && amount > modifier)
modifier = amount;
}
@@ -3325,7 +3319,7 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
int32 amount = (*i)->GetModifierValue();
int32 amount = (*i)->GetModifier()->m_amount;
if (mod->m_miscvalue == misc_value && amount < modifier)
modifier = amount;
}
@@ -3363,50 +3357,45 @@ bool Unit::AddAura(Aura *Aur)
// passive and persistent auras can stack with themselves any number of times
if (!Aur->IsPassive() && !Aur->IsPersistent())
{
// replace aura if next will > spell StackAmount
if(aurSpellInfo->StackAmount)
for(AuraMap::iterator i2 = m_Auras.lower_bound(spair); i2 != m_Auras.upper_bound(spair); ++i2)
{
Aur->SetStackAmount(i->second->GetStackAmount());
if(Aur->GetStackAmount() < aurSpellInfo->StackAmount)
Aur->SetStackAmount(Aur->GetStackAmount()+1);
RemoveAura(i,AURA_REMOVE_BY_STACK);
}
// if StackAmount==0 not allow auras from same caster
else
{
for(AuraMap::iterator i2 = m_Auras.lower_bound(spair); i2 != m_Auras.upper_bound(spair); ++i2)
if(i2->second->GetCasterGUID()==Aur->GetCasterGUID())
{
if(i2->second->GetCasterGUID()==Aur->GetCasterGUID())
// Aura can stack on self -> Stack it;
if(aurSpellInfo->StackAmount)
{
i2->second->modStackAmount(1);
delete Aur;
return false;
}
// can be only single (this check done at _each_ aura add
RemoveAura(i2,AURA_REMOVE_BY_STACK);
break;
}
bool stop = false;
switch(aurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()])
{
// DoT/HoT/etc
case SPELL_AURA_PERIODIC_DAMAGE: // allow stack
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_PERIODIC_HEAL:
case SPELL_AURA_OBS_MOD_HEALTH:
case SPELL_AURA_PERIODIC_MANA_LEECH:
case SPELL_AURA_PERIODIC_ENERGIZE:
case SPELL_AURA_OBS_MOD_MANA:
case SPELL_AURA_POWER_BURN_MANA:
break;
default: // not allow
// can be only single (this check done at _each_ aura add
RemoveAura(i2,AURA_REMOVE_BY_STACK);
break;
}
bool stop = false;
switch(aurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()])
{
// DoT/HoT/etc
case SPELL_AURA_PERIODIC_DAMAGE: // allow stack
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_PERIODIC_HEAL:
case SPELL_AURA_OBS_MOD_HEALTH:
case SPELL_AURA_PERIODIC_MANA_LEECH:
case SPELL_AURA_PERIODIC_ENERGIZE:
case SPELL_AURA_OBS_MOD_MANA:
case SPELL_AURA_POWER_BURN_MANA:
break;
default: // not allow
// can be only single (this check done at _each_ aura add
RemoveAura(i2,AURA_REMOVE_BY_STACK);
stop = true;
break;
}
if(stop)
stop = true;
break;
}
if(stop)
break;
}
}
}
@@ -3656,14 +3645,15 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
uint64 caster_guid = aur->GetCasterGUID();
// Remove aura
RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
if (iter->second->modStackAmount(-1))
RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
// backfire damage and silence
dispeler->CastCustomSpell(dispeler, 31117, &damage, NULL, NULL, true, NULL, NULL,caster_guid);
iter = m_Auras.begin(); // iterator can be invalidate at cast if self-dispel
}
else
else if (iter->second->modStackAmount(-1))
RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
}
else
@@ -3695,7 +3685,8 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
stealer->AddAura(new_aur);
// Remove aura as dispel
RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
if (iter->second->modStackAmount(-1))
RemoveAura(iter, AURA_REMOVE_BY_DISPEL);
}
else
++iter;
@@ -3733,48 +3724,20 @@ void Unit::RemoveAurasWithDispelType( DispelType type )
}
}
void Unit::RemoveSingleAuraFromStackByDispel(uint32 spellId)
{
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
{
Aura *aur = iter->second;
if (aur->GetId() == spellId)
{
if(iter->second->GetStackAmount() > 1)
{
// reapply modifier with reduced stack amount
iter->second->ApplyModifier(false,true);
iter->second->SetStackAmount(iter->second->GetStackAmount()-1);
iter->second->ApplyModifier(true,true);
iter->second->UpdateSlotCounterAndDuration();
return; // not remove aura if stack amount > 1
}
else
RemoveAura(iter,AURA_REMOVE_BY_DISPEL);
}
else
++iter;
}
}
void Unit::RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex)
{
AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, effindex));
if(iter != m_Auras.end())
{
if(iter->second->GetStackAmount() > 1)
{
// reapply modifier with reduced stack amount
iter->second->ApplyModifier(false,true);
iter->second->SetStackAmount(iter->second->GetStackAmount()-1);
iter->second->ApplyModifier(true,true);
if (iter->second->modStackAmount(-1))
RemoveAura(iter);
}
}
iter->second->UpdateSlotCounterAndDuration();
return; // not remove aura if stack amount > 1
}
RemoveAura(iter);
}
void Unit::RemoveSingleSpellAurasFromStack(uint32 spellId)
{
for (int i=0; i<3; ++i)
RemoveSingleAuraFromStack(spellId, i);
}
void Unit::RemoveAurasDueToSpell(uint32 spellId, Aura* except)
@@ -4478,15 +4441,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (!procSpell || procSpell->Id == 24659)
return false;
// Need remove one 24659 aura
RemoveSingleAuraFromStack(24659, 0);
RemoveSingleAuraFromStack(24659, 1);
RemoveSingleSpellAurasFromStack(24659);
return true;
}
// Restless Strength
case 24661:
{
// Need remove one 24662 aura
RemoveSingleAuraFromStack(24662, 0);
RemoveSingleSpellAurasFromStack(24662);
return true;
}
// Adaptive Warding (Frostfire Regalia set)
@@ -4809,7 +4771,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
// mana cost save
basepoints0 = procSpell->manaCost * triggeredByAura->GetModifier()->m_amount/100;
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost * triggeredByAura->GetModifier()->m_amount/100;
if( basepoints0 <=0 )
return false;
@@ -4840,6 +4803,20 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
mod->m_amount = 25;
return true;
}
// Burnout
if (dummySpell->SpellIconID == 2998)
{
if(!procSpell)
return false;
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost * triggeredByAura->GetModifier()->m_amount/100;
if( basepoints0 <=0 )
return false;
triggered_spell_id = 44450;
target = this;
break;
}
// Incanter's Regalia set (add trigger chance to Mana Shield)
if (dummySpell->SpellFamilyFlags & 0x0000000000008000LL)
{
@@ -4908,15 +4885,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == pVictim)
return false;
// Need stun or root mechanic
if (procSpell->Mechanic != MECHANIC_ROOT && procSpell->Mechanic != MECHANIC_STUN)
{
int32 i;
for (i=0; i<3; i++)
if (procSpell->EffectMechanic[i] == MECHANIC_ROOT || procSpell->EffectMechanic[i] == MECHANIC_STUN)
break;
if (i == 3)
return false;
}
if (!(GetAllSpellMechanicMask(procSpell) & ((1<<MECHANIC_ROOT)|(1<<MECHANIC_STUN))))
return false;
switch (dummySpell->Id)
{
@@ -5262,48 +5232,15 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
case SPELLFAMILY_PALADIN:
{
// TODO: spell list, formula change in 3.0.3
// Seal of Righteousness - melee proc dummy
// Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
if (dummySpell->SpellFamilyFlags&0x000000008000000LL && triggeredByAura->GetEffIndex()==0)
{
if(GetTypeId() != TYPEID_PLAYER)
return false;
uint32 spellId;
switch (triggeredByAura->GetId())
{
case 21084: spellId = 25742; break; // Rank 1
case 20287: spellId = 25740; break; // Rank 2
case 20288: spellId = 25739; break; // Rank 3
case 20289: spellId = 25738; break; // Rank 4
case 20290: spellId = 25737; break; // Rank 5
case 20291: spellId = 25736; break; // Rank 6
case 20292: spellId = 25735; break; // Rank 7
case 20293: spellId = 25713; break; // Rank 8
case 27155: spellId = 27156; break; // Rank 9
default:
sLog.outError("Unit::HandleDummyAuraProc: non handled possibly SoR (Id = %u)", triggeredByAura->GetId());
return false;
}
Item *item = ((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
float speed = (item ? item->GetProto()->Delay : BASE_ATTACK_TIME)/1000.0f;
float damageBasePoints;
if(item && item->GetProto()->InventoryType == INVTYPE_2HWEAPON)
// two hand weapon
damageBasePoints=1.20f*triggeredByAura->GetModifier()->m_amount * 1.2f * 1.03f * speed/100.0f + 1;
else
// one hand weapon/no weapon
damageBasePoints=0.85f*ceil(triggeredByAura->GetModifier()->m_amount * 1.2f * 1.03f * speed/100.0f) - 1;
int32 damagePoint = int32(damageBasePoints + 0.03f * (GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE)+GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE))/2.0f) + 1;
// apply damage bonuses manually
if(damagePoint >= 0)
damagePoint = SpellDamageBonus(pVictim, dummySpell, damagePoint, SPELL_DIRECT_DAMAGE);
CastCustomSpell(pVictim,spellId,&damagePoint,NULL,NULL,true,NULL, triggeredByAura);
return true; // no hidden cooldown
triggered_spell_id = 25742;
float ap = GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) +
SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_HOLY, pVictim);
basepoints0 = GetAttackTime(BASE_ATTACK) * int32(ap*0.022f + 0.044f * holy) / 1000;
break;
}
// Seal of Blood do damage trigger
if(dummySpell->SpellFamilyFlags & 0x0000040000000000LL)
@@ -5359,8 +5296,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
}
break;
}
// TODO: fix basepoint calculation (changed in 3.0.3)
// Seal of Vengeance
// Seal of Vengeance (damage calc on apply aura)
case 31801:
{
if(effIndex != 0) // effect 1,2 used by seal unleashing code
@@ -5496,14 +5432,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if( cooldown && ((Player*)this)->HasSpellCooldown(dummySpell->Id))
return false;
// Now amount of extra power stored in 1 effect of Enchant spell
// Get it by item enchant id
uint32 spellId;
switch (castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)))
{
case 283: spellId = 33757; break; //1 Rank
case 284: spellId = 33756; break; //2 Rank
case 525: spellId = 33755; break; //3 Rank
case 1669:spellId = 33754; break; //4 Rank
case 2636:spellId = 33727; break; //5 Rank
case 283: spellId = 8232; break; // 1 Rank
case 284: spellId = 8235; break; // 2 Rank
case 525: spellId = 10486; break; // 3 Rank
case 1669:spellId = 16362; break; // 4 Rank
case 2636:spellId = 25505; break; // 5 Rank
case 3785:spellId = 58801; break; // 6 Rank
case 3786:spellId = 58803; break; // 7 Rank
case 3787:spellId = 58804; break; // 8 Rank
default:
{
sLog.outError("Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
@@ -5519,7 +5460,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
}
int32 extra_attack_power = CalculateSpellDamage(windfurySpellEntry,0,windfurySpellEntry->EffectBasePoints[0],pVictim);
int32 extra_attack_power = CalculateSpellDamage(windfurySpellEntry, 1, windfurySpellEntry->EffectBasePoints[1], pVictim);
// Off-Hand case
if ( castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND )
@@ -5577,15 +5518,22 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
target = this;
break;
}
// Glyph of Healing Wave
case 55440:
{
// Not proc from self heals
if (this==pVictim)
return false;
basepoints0 = triggeredByAura->GetModifier()->m_amount * damage / 100;
target = this;
triggered_spell_id = 55533;
break;
}
}
// Earth Shield
if(dummySpell->SpellFamilyFlags & 0x0000040000000000LL)
{
if(GetTypeId() != TYPEID_PLAYER)
return false;
// heal
basepoints0 = triggeredByAura->GetModifier()->m_amount;
target = this;
triggered_spell_id = 379;
@@ -5656,17 +5604,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return true;
}
// Glyph of Healing Wave
case 55440:
{
// Not proc from self heals
if (this==pVictim)
return false;
basepoints0 = triggeredByAura->GetModifier()->m_amount * damage / 100;
target = this;
triggered_spell_id = 55533;
break;
}
break;
}
case SPELLFAMILY_DEATHKNIGHT:
@@ -6071,8 +6008,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
// procspell is triggered spell but we need mana cost of original casted spell
uint32 originalSpellId = procSpell->Id;
// Holy Shock
if(procSpell->SpellFamilyFlags & 0x00200000)
// Holy Shock heal
if(procSpell->SpellFamilyFlags & 0x0001000000000000LL)
{
switch(procSpell->Id)
{
@@ -6081,6 +6018,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
case 25903: originalSpellId = 20930; break;
case 27175: originalSpellId = 27174; break;
case 33074: originalSpellId = 33072; break;
case 48820: originalSpellId = 48824; break;
case 48821: originalSpellId = 48825; break;
default:
sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id);
return false;
@@ -6093,7 +6032,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
}
// percent stored in effect 1 (class scripts) base points
basepoints0 = originalSpell->manaCost*(auraSpellInfo->EffectBasePoints[1]+1)/100;
int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost*(auraSpellInfo->EffectBasePoints[1]+1)/100;
trigger_spell_id = 20272;
target = this;
}
@@ -6104,12 +6044,10 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
// stacking
CastSpell(this, 37658, true, NULL, triggeredByAura);
// counting
Aura * dummy = GetDummyAura(37658);
if (!dummy)
return false;
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(dummy->GetStackAmount() < triggerAmount)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(37658);
@@ -6123,14 +6061,11 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
// stacking
CastSpell(this, 54842, true, NULL, triggeredByAura);
// counting
uint32 count = 0;
AuraList const& dummyAura = GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator itr = dummyAura.begin(); itr != dummyAura.end(); ++itr)
if((*itr)->GetId()==54842)
++count;
Aura * dummy = GetDummyAura(54842);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(count < triggerAmount)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(54842);
@@ -6359,6 +6294,40 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
break;
}
// Brain Freeze
case 57761:
{
if(!procSpell)
return false;
// For trigger from Blizzard need exist Improved Blizzard
if (procSpell->SpellFamilyName==SPELLFAMILY_MAGE && procSpell->SpellFamilyFlags & 0x0000000000000080)
{
bool found = false;
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
int32 script = (*i)->GetModifier()->m_miscvalue;
if(script==836 || script==988 || script==989)
{
found=true;
break;
}
}
if(!found)
return false;
}
break;
}
// Burning Determination
case 54748:
{
if(!procSpell)
return false;
// Need Interrupt or Silenced mechanic
if (!(GetAllSpellMechanicMask(procSpell) & ((1<<MECHANIC_INTERRUPT)|(1<<MECHANIC_SILENCE))))
return false;
break;
}
}
if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(trigger_spell_id))
@@ -7247,7 +7216,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 )
// 0 == any inventory type (not wand then)
{
DoneTotalMod *= ((*i)->GetModifierValue() +100.0f)/100.0f;
DoneTotalMod *= ((*i)->GetModifier()->m_amount +100.0f)/100.0f;
}
}
@@ -7255,13 +7224,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
DoneTotalMod *= ((*i)->GetModifierValue() +100.0f)/100.0f;
DoneTotalMod *= ((*i)->GetModifier()->m_amount +100.0f)/100.0f;
// ..taken
AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
if( (*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto) )
TakenTotalMod *= ((*i)->GetModifierValue() +100.0f)/100.0f;
TakenTotalMod *= ((*i)->GetModifier()->m_amount +100.0f)/100.0f;
// .. taken pct: scripted (increases damage of * against targets *)
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
@@ -7596,7 +7565,7 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask)
// -1 == any item class (not wand then)
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 )
// 0 == any inventory type (not wand then)
DoneAdvertisedBenefit += (*i)->GetModifierValue();
DoneAdvertisedBenefit += (*i)->GetModifier()->m_amount;
if (GetTypeId() == TYPEID_PLAYER)
{
@@ -7608,14 +7577,14 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask)
{
// stat used stored in miscValueB for this aura
Stats usedStat = Stats((*i)->GetMiscBValue());
DoneAdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifierValue() / 100.0f);
DoneAdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifier()->m_amount / 100.0f);
}
}
// ... and attack power
AuraList const& mDamageDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER);
for(AuraList::const_iterator i =mDamageDonebyAP.begin();i != mDamageDonebyAP.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue & schoolMask)
DoneAdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifierValue() / 100.0f);
DoneAdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifier()->m_amount / 100.0f);
}
return DoneAdvertisedBenefit;
@@ -7630,13 +7599,13 @@ int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVic
AuraList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE);
for(AuraList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
TakenAdvertisedBenefit += (*i)->GetModifierValue();
TakenAdvertisedBenefit += (*i)->GetModifier()->m_amount;
// ..taken
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0)
TakenAdvertisedBenefit += (*i)->GetModifierValue();
TakenAdvertisedBenefit += (*i)->GetModifier()->m_amount;
return TakenAdvertisedBenefit;
}
@@ -7923,7 +7892,7 @@ uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount,
// Healing done percent
AuraList const& mHealingDonePct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
for(AuraList::const_iterator i = mHealingDonePct.begin();i != mHealingDonePct.end(); ++i)
heal *= (100.0f + (*i)->GetModifierValue()) / 100.0f;
heal *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
// apply spellmod to Done amount
if(Player* modOwner = GetSpellModOwner())
@@ -7964,7 +7933,7 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask)
AuraList const& mHealingDone = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE);
for(AuraList::const_iterator i = mHealingDone.begin();i != mHealingDone.end(); ++i)
if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0)
AdvertisedBenefit += (*i)->GetModifierValue();
AdvertisedBenefit += (*i)->GetModifier()->m_amount;
// Healing bonus of spirit, intellect and strength
if (GetTypeId() == TYPEID_PLAYER)
@@ -7975,14 +7944,14 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask)
{
// stat used dependent from misc value (stat index)
Stats usedStat = Stats((*i)->GetSpellProto()->EffectMiscValue[(*i)->GetEffIndex()]);
AdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifierValue() / 100.0f);
AdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifier()->m_amount / 100.0f);
}
// ... and attack power
AuraList const& mHealingDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER);
for(AuraList::const_iterator i = mHealingDonebyAP.begin();i != mHealingDonebyAP.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue & schoolMask)
AdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifierValue() / 100.0f);
AdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifier()->m_amount / 100.0f);
}
return AdvertisedBenefit;
}
@@ -7993,7 +7962,7 @@ int32 Unit::SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit *pVi
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING);
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0)
AdvertisedBenefit += (*i)->GetModifierValue();
AdvertisedBenefit += (*i)->GetModifier()->m_amount;
return AdvertisedBenefit;
}
@@ -8105,7 +8074,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
AuraList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE);
for(AuraList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
DoneFlatBenefit += (*i)->GetModifierValue();
DoneFlatBenefit += (*i)->GetModifier()->m_amount;
// ..done
// SPELL_AURA_MOD_DAMAGE_DONE included in weapon damage
@@ -8120,7 +8089,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
AuraList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS);
for(AuraList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
APbonus += (*i)->GetModifierValue();
APbonus += (*i)->GetModifier()->m_amount;
}
else
{
@@ -8130,7 +8099,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
AuraList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS);
for(AuraList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
APbonus += (*i)->GetModifierValue();
APbonus += (*i)->GetModifier()->m_amount;
}
if (APbonus!=0) // Can be negative
@@ -8155,7 +8124,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask())
TakenFlatBenefit += (*i)->GetModifierValue();
TakenFlatBenefit += (*i)->GetModifier()->m_amount;
if(attType!=RANGED_ATTACK)
TakenFlatBenefit += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN);
@@ -8173,13 +8142,13 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
DoneTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
DoneTotalMod *= ((*i)->GetModifier()->m_amount +100.0f)/100.0f;
// ..taken
AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask())
TakenTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
TakenTotalMod *= ((*i)->GetModifier()->m_amount +100.0f)/100.0f;
// .. taken pct: dummy auras
AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
@@ -8237,13 +8206,13 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
{
AuraList const& mModMeleeDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT);
for(AuraList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i)
TakenTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
TakenTotalMod *= ((*i)->GetModifier()->m_amount +100.0f)/100.0f;
}
else
{
AuraList const& mModRangedDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT);
for(AuraList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i)
TakenTotalMod *= ((*i)->GetModifierValue()+100.0f)/100.0f;
TakenTotalMod *= ((*i)->GetModifier()->m_amount +100.0f)/100.0f;
}
float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod;
@@ -10116,7 +10085,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
if (procExtra&(PROC_EX_NORMAL_HIT|PROC_EX_MISS|PROC_EX_RESIST))
{
if (pTarget->GetTypeId() != TYPEID_PLAYER && pTarget->GetCreatureType() != CREATURE_TYPE_CRITTER)
((Player*)this)->UpdateCombatSkills(pTarget, attType, MELEE_HIT_MISS, isVictim);
((Player*)this)->UpdateCombatSkills(pTarget, attType, isVictim);
}
// Update defence if player is victim and parry/dodge/block
if (isVictim && procExtra&(PROC_EX_DODGE|PROC_EX_PARRY|PROC_EX_BLOCK))
+2 -2
View File
@@ -1147,8 +1147,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAura(uint32 spellId, uint32 effindex, Aura* except = NULL);
void RemoveSingleAuraFromStackByDispel(uint32 spellId);
void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex);
void RemoveSingleSpellAurasFromStack(uint32 spellId);
void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex);
void RemoveAurasDueToSpell(uint32 spellId, Aura* except = NULL);
void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
void RemoveAurasDueToCasterSpell(uint32 spellId, uint64 guid);