diff options
-rw-r--r-- | sql/updates/8816_world_spell_bonus_data.sql | 4 | ||||
-rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 28 | ||||
-rw-r--r-- | src/server/game/Miscellaneous/SharedDefines.h | 2 |
4 files changed, 23 insertions, 16 deletions
diff --git a/sql/updates/8816_world_spell_bonus_data.sql b/sql/updates/8816_world_spell_bonus_data.sql new file mode 100644 index 00000000000..67d01d19b77 --- /dev/null +++ b/sql/updates/8816_world_spell_bonus_data.sql @@ -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'); diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 52f02f0f66d..fbf5a80d42b 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -36,8 +36,13 @@ float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float fThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell) { if (pThreatSpell) + { + if (pThreatSpell->AttributesEx & SPELL_ATTR_EX_NO_THREAT) + return 0.0f; + if (Player* modOwner = pHatedUnit->GetSpellModOwner()) modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, fThreat); + } return pHatedUnit->ApplyTotalThreatModifier(fThreat, schoolMask); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 362ccbf582d..e85dd8968dc 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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); 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) + { + // 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); + } CastSpell(pVictim, spellId, true, castItem, triggeredByAura); - this->ToPlayer()->AddSpellMod(mod, false); - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown); + ToPlayer()->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown); return true; } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a9ae3bc4cc0..a1692794ca8 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -287,7 +287,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { #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_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_UNK12 0x00001000 // 12 #define SPELL_ATTR_EX_UNK13 0x00002000 // 13 |