aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.cpp
AgeCommit message (Collapse)Author
2009-06-07*Implement spell aura 177.megamage
--HG-- branch : trunk
2009-06-07*Add support for stance-dependant action bar spellsQAston
*Temporary remove assert check in Player::RestoreSpellMods *Apply bleeding damage bonuses for Shred. --HG-- branch : trunk
2009-06-06*Remove Arcane Blast on Arcane Missiles and Arcane Barrage castQAston
*Spell_affect entry for Fingers of frost - by Larva *use spellaffect entries in every affect check *Allow spell_affect table to modify affect data for any spell --HG-- branch : trunk
2009-06-06*Do not allow Divine Spirit and Prayer of Divine spirit to stack.adrycasillo
--HG-- branch : trunk
2009-06-06*Update spellmod systemQAston
*Implement SPELL_ATTR_EX6_IGNORE_CASTER_AURAS *Fix some bugs with traps proc flags --HG-- branch : trunk
2009-06-03*Fix the bug that some traps without charges and spell radius cannot be ↵megamage
triggered. *Provide spell support for quest 12698 --HG-- branch : trunk
2009-06-01[7930] Added diminishing for spell 1499 and ranks. Author: Lightguardmegamage
--HG-- branch : trunk
2009-05-31[7917] Spell effect with SPELL_AURA_MOD_SPELL_CRIT_CHANCE always possitive ↵megamage
with possitive aura value. Author: VladimirMangos --HG-- branch : trunk
2009-05-29*Allow some warrior shouts and druid roars to interrupt stealth. thanks to ↵megamage
thenecromancer --HG-- branch : trunk
2009-05-27*Some improvement of DK start zone quests (no new quest fixed)megamage
--HG-- branch : trunk
2009-05-26*Fix DK quest 12641megamage
--HG-- branch : trunk
2009-05-26[7892] Update spell_loot_template entry description in error output for ↵megamage
better fit to current table use. Author: VladimirMangos --HG-- branch : trunk
2009-05-26*Consider flight spells as passive spells.megamage
--HG-- branch : trunk
2009-05-25*Move spelltarget table check to the start of the server to reduce log spams.megamage
--HG-- branch : trunk
2009-05-25*Merge.megamage
--HG-- branch : trunk
2009-05-25*Do not allow wrecking crew stack with enrage. Also, allow proc buff ↵megamage
overwrite another. Need better rules to check that. (see my comment in code) --HG-- branch : trunk
2009-05-25*Merge.megamage
--HG-- branch : trunk
2009-05-24*Remove auras with duration lower than 30 sec on arena start.QAston
*Do not remove rougue poisons and dk runes on arena start. *Apply healing bonus for healing stream totem. *Do not duplicate damage bonus in code with the one in db for Seal of Vengenance/Corruption --HG-- branch : trunk
2009-05-24 [7886] Drop use table `petcreateinfo_spell`megamage
This is first commit in chain for remove oudated and not used pet functionality. * Use instead dropped table CreatureSpellData.dbc if creature_template.PetSpellDataId set (mostly hunter pets) * Use creature_template.spellN if not set creature_template.PetSpellDataId (mostly different summon creatures) * Fixed bug with not removing from action bar spell icon for not ranked unlearned spells. Note: summoned controllable creatures without PetSpellDataId must have expected spells in spellN feilds for creature_template. [7887] Drop pet spell teaching code, including field in character_pet. Author: VladimirMangos --HG-- branch : trunk
2009-05-24Ancestral Awakening target selectionQAston
--HG-- branch : trunk
2009-05-24*Fix whath of air and flametongue totemQAston
--HG-- branch : trunk
2009-05-23*always remove old aura instead of recalculating new one in same id stack ↵QAston
case-this prevents some problem with spelleffects execution problems --HG-- branch : trunk
2009-05-23*Fix rock shards spell for archavon script.megamage
--HG-- branch : trunk
2009-05-23*Correct spell id for Muru's Negative Energy's MaxAffectedTargets by Alyen. ↵Anubisss
Thank you. --HG-- branch : trunk
2009-05-21*Do not remove/add aura for refreshing case.megamage
--HG-- branch : trunk
2009-05-21*Implement spell effect wmo damage.megamage
--HG-- branch : trunk
2009-05-20*Update Naxx scripts. Now only Kelthuzad is incompletedmegamage
--HG-- branch : trunk
2009-05-18*Add some scripted spells for naxx.megamage
--HG-- branch : trunk
2009-05-18*Fix the bug that startfall aoe damage also apply on direct target.megamage
*Add starfall spell bonus for other ranks. By Uruviel and Nesocip. --HG-- branch : trunk
2009-05-17*Fix the bug that inferno and curse of doom summons too many minions.megamage
--HG-- branch : trunk
2009-05-17*Merge.megamage
--HG-- branch : trunk
2009-05-17*Update proc system.QAston
--HG-- branch : trunk
2009-05-17 [7839] Rafactoring player targeting code in chat command and related ↵megamage
cleanups/improvments. * New extractOptFirstArg function for easy get 2 args in case option playe name as first arg. * New extractPlayerTarget function for get player pointer/guid/name for online/offline player base at provided name or if not provided by current seelction with error cases processing. * Property apply mute/unmute in case use different character name from loggined currently for account. * .reset commands can be used from console now * .repairitems comamnd can be used from console now but only to online player. Author: VladimirMangos --HG-- branch : trunk
2009-05-16*Update naxx script.megamage
--HG-- branch : trunk
2009-05-16*Fix lifebloom final heal coefficient - by nesocipQAston
*Fix aura immunity dispel for spells like Resurrection sickness *Do not proc auras without spellfamilyflags required for totems. *Allow more auras to be displayed in client. *Fix some issues with Cut to the Chase. --HG-- branch : trunk
2009-05-15*Skip Mangos ([7833] Implement levelup spells for non-hunter pets. Author: ↵megamage
VladimirMangos) --HG-- branch : trunk
2009-05-15*Move some Trinity-only functions to the end of file.megamage
--HG-- branch : trunk
2009-05-15*Allow hots to procQAston
--HG-- branch : trunk
2009-05-15*Item enchancment/proc patch - original code by ThenecromancerQAston
-void Player::CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attType) -{ - if(!item || item->IsBroken()) - return; - - ItemPrototype const *proto = item->GetProto(); - if(!proto) - return; +void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo, ItemPrototype const * proto) +{ + Unit * Target = damageInfo->target; + WeaponAttackType attType = damageInfo->attackType; if (!Target || Target == this ) return; - for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) - { - _Spell const& spellData = proto->Spells[i]; - - // no spell - if(!spellData.SpellId ) - continue; - - // wrong triggering type - if(spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT) - continue; - - SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId); - if(!spellInfo) - { - sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId); - continue; - } - - // not allow proc extra attack spell at extra attack - if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) ) - return; - - float chance = spellInfo->procChance; - - if(spellData.SpellPPMRate) - { - uint32 WeaponSpeed = GetAttackTime(attType); - chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo); - } - else if(chance > 100.0f) - { - chance = GetWeaponProcChance(); - } - - if (roll_chance_f(chance)) - CastSpell(Target, spellInfo->Id, true, item); + // Can do effect if any damage done to target + if (damageInfo->damage) + { + for (int i = 0; i < 5; i++) + { + _Spell const& spellData = proto->Spells[i]; + + // no spell + if(!spellData.SpellId ) + continue; + + // wrong triggering type + if(spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT) + continue; + + SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId); + if(!spellInfo) + { + sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId); + continue; + } + + // not allow proc extra attack spell at extra attack + if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) ) + return; + + float chance = spellInfo->procChance; + + if(spellData.SpellPPMRate) + { + uint32 WeaponSpeed = GetAttackTime(attType); + chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo); + } + else if(chance > 100.0f) + { + chance = GetWeaponProcChance(); + } + + if (roll_chance_f(chance)) + CastSpell(Target, spellInfo->Id, true, item); + } } // item combat enchantments @@ -6993,6 +6993,21 @@ if(pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; + SpellEnchantProcEntry const* entry = spellmgr.GetSpellEnchantProcEvent(enchant_id); + + if (entry && entry->procEx) + { + // Check hit/crit/dodge/parry requirement + if((entry->procEx & damageInfo->procEx) == 0) + continue; + } + else + { + // Can do effect if any damage done to target + if (!(damageInfo->damage)) + continue; + } + SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]); if (!spellInfo) { @@ -7001,6 +7016,18 @@ } float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance(); + + if (entry && entry->PPMChance) + { + uint32 WeaponSpeed = GetAttackTime(attType); + chance = GetPPMProcChance(WeaponSpeed, entry->PPMChance, spellInfo); + } + else if (entry && entry->customChance) + chance = entry->customChance; + + // Apply spell mods + ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance); + if (roll_chance_f(chance)) { if(IsPositiveSpell(pEnchant->spellid[s])) @@ -7012,6 +7039,7 @@ } } + void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex) { ItemPrototype const* proto = item->GetProto(); --HG-- branch : trunk
2009-05-14Do not allow to proc spells if they can't stack with already active auras.krz
this fixes 13048 and 12292. --HG-- branch : trunk
2009-05-11*Fix a typoQAston
--HG-- branch : trunk
2009-05-11*Allow Hots to proc-this should fix talents like 33776 effect from hots.QAston
--HG-- branch : trunk
2009-05-11*Change waypoint data structure. Use creature db guid as path id. If a ↵megamage
creature uses waypoint movement as default movement type, the path id should be DBGUID*10. For paths of script use, the path id should be DBGUID*10+1 ~ DBGUID*10+9. *Two sql queries are included. Converter is used to convert the existing path id to new path id. "...creature_add..." is used to change table structure. You can first run the converter, then run the other one. Or run the other one directly and get the new data from the db team. Because it may take hours to run the converter. *If you have custom data, you may need to run the converter. We suggest you use console to run it It is extremely slow to run the query. If you have multiple paths for a creature in your db, you need to do more work to convert it. However, if you know how to use multiple paths, you should already have more db knowledge than I do and you should know how to convert it. *There may be a faster query to convert the db. If you know, please tell us. I am no sql expert. *Backup your db first! *Thanks to X-Savior and subhuman_bob. --HG-- branch : trunk
2009-05-10*Update AI scripts. Use better default AI.megamage
--HG-- branch : trunk
2009-05-11Allow class specific periodic dummy and dummy auras to always stackQAston
--HG-- branch : trunk
2009-05-10*Item enchancment/proc patch - original code by ThenecromancerQAston
--HG-- branch : trunk
2009-05-08*Update some spell attr flag. Use better way to check IsRangedSpell and ↵megamage
UnaffectedByInvulnerability --HG-- branch : trunk
2009-05-08*Do not allow to cast cyclone on divine shielded target.QAston
--HG-- branch : trunk
2009-05-06*Update Naxx scripts.megamage
--HG-- branch : trunk
2009-05-04*Fix chains of iceQAston
*Correct typo in my prev commit-by megamage *Fix hearthstone obtaining from innkeeper. --HG-- branch : trunk