Fixed Chain Lightning overproccing with Lightning Overload, patch by DrTenma
Closes issue #1198. --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
DELETE FROM `spell_bonus_data` WHERE `entry` IN (45284,45297);
|
||||||
|
INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
|
||||||
|
(45284,0.357,-1,-1,-1,'Shaman - LO Lightning Bolt'),
|
||||||
|
(45297,0.285,-1,-1,-1,'Shaman - LO Chain Lightning');
|
||||||
@@ -36,8 +36,13 @@
|
|||||||
float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float fThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell)
|
float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float fThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell)
|
||||||
{
|
{
|
||||||
if (pThreatSpell)
|
if (pThreatSpell)
|
||||||
|
{
|
||||||
|
if (pThreatSpell->AttributesEx & SPELL_ATTR_EX_NO_THREAT)
|
||||||
|
return 0.0f;
|
||||||
|
|
||||||
if (Player* modOwner = pHatedUnit->GetSpellModOwner())
|
if (Player* modOwner = pHatedUnit->GetSpellModOwner())
|
||||||
modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, fThreat);
|
modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, fThreat);
|
||||||
|
}
|
||||||
|
|
||||||
return pHatedUnit->ApplyTotalThreatModifier(fThreat, schoolMask);
|
return pHatedUnit->ApplyTotalThreatModifier(fThreat, schoolMask);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7335,27 +7335,25 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
|
sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 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[0] = 0x02;
|
|
||||||
mod->mask[2] = 0x00;
|
|
||||||
this->ToPlayer()->AddSpellMod(mod, true);
|
|
||||||
|
|
||||||
// Remove cooldown (Chain Lightning - have Category Recovery time)
|
// Chain Lightning
|
||||||
if (procSpell->SpellFamilyFlags[0] & 0x2)
|
if (procSpell->SpellFamilyFlags[0] & 0x2)
|
||||||
|
{
|
||||||
|
// Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit.
|
||||||
|
// A maxed LO would have a 33% / 3 = 11% chance to proc of each target.
|
||||||
|
// LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets]
|
||||||
|
float chance = 100.0f / procSpell->EffectChainTarget[effIndex];
|
||||||
|
if (!roll_chance_f(chance))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Remove cooldown (Chain Lightning - have Category Recovery time)
|
||||||
ToPlayer()->RemoveSpellCooldown(spellId);
|
ToPlayer()->RemoveSpellCooldown(spellId);
|
||||||
|
}
|
||||||
|
|
||||||
CastSpell(pVictim, spellId, true, castItem, triggeredByAura);
|
CastSpell(pVictim, spellId, true, castItem, triggeredByAura);
|
||||||
|
|
||||||
this->ToPlayer()->AddSpellMod(mod, false);
|
|
||||||
|
|
||||||
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
||||||
ToPlayer()->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown);
|
ToPlayer()->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
|
|||||||
#define SPELL_ATTR_EX_NEGATIVE 0x00000080 // 7
|
#define SPELL_ATTR_EX_NEGATIVE 0x00000080 // 7
|
||||||
#define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET 0x00000100 // 8 Spell req target not to be in combat state
|
#define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET 0x00000100 // 8 Spell req target not to be in combat state
|
||||||
#define SPELL_ATTR_EX_UNK9 0x00000200 // 9 melee spells
|
#define SPELL_ATTR_EX_UNK9 0x00000200 // 9 melee spells
|
||||||
#define SPELL_ATTR_EX_UNK10 0x00000400 // 10 no generates threat on cast 100%? (old NO_INITIAL_AGGRO)
|
#define SPELL_ATTR_EX_NO_THREAT 0x00000400 // 10 no generates threat on cast 100% (old NO_INITIAL_AGGRO)
|
||||||
#define SPELL_ATTR_EX_UNK11 0x00000800 // 11 aura
|
#define SPELL_ATTR_EX_UNK11 0x00000800 // 11 aura
|
||||||
#define SPELL_ATTR_EX_UNK12 0x00001000 // 12
|
#define SPELL_ATTR_EX_UNK12 0x00001000 // 12
|
||||||
#define SPELL_ATTR_EX_UNK13 0x00002000 // 13
|
#define SPELL_ATTR_EX_UNK13 0x00002000 // 13
|
||||||
|
|||||||
Reference in New Issue
Block a user