aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2009-05-17*Merge.megamage
--HG-- branch : trunk
2009-05-17*Move AI function DamageTaken back to DealDamage.megamage
--HG-- branch : trunk
2009-05-17*Update Naxx script. Let boss evade if they are pulled out of room.megamage
--HG-- branch : trunk
2009-05-17*Fix a bug that player may not be at correct location when log in after crash.megamage
--HG-- branch : trunk
2009-05-17*Update proc system.QAston
--HG-- branch : trunk
2009-05-17[7840] Fixed unexpected rounding in pet size scale calculation. Author: Naicisummegamage
--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-17[7837] Implement missed item enchant type (stat mana, stat health) Author: ↵megamage
xILOSWag --HG-- branch : trunk
2009-05-17 [7836] Fixes for distance range checks. Author: VladimirMangosmegamage
* ignore 0.0f min range limit (this correct case when 2 object overlapped) Also use int32 for temporary store GetSessionDbLocaleIndex result. --HG-- branch : trunk
2009-05-17*Do not clear unit movement flags when it is stunned/rootedmegamage
--HG-- branch : trunk
2009-05-17*Fix the sql error when saving pet auras.megamage
--HG-- branch : trunk
2009-05-17*Fix a crash caused by bg and arena.megamage
--HG-- branch : trunk
2009-05-16*Make some boss scripts safer. But I still strongly recommend that you do ↵megamage
not spawn instance bosses outside the instance. They may make server crash like hell. --HG-- branch : trunk
2009-05-16*Update gluth script.megamage
--HG-- branch : trunk
2009-05-16*Allow creating new instance when log in and a save exists.megamage
--HG-- branch : trunk
2009-05-16*Do not allow positive AOE affect totem.megamage
--HG-- branch : trunk
2009-05-16*Do not allow taunt affect passive creatures.megamage
*Fix build. --HG-- branch : trunk
2009-05-16*Fix an exploit that instance can be reset when there are logged-out players ↵megamage
in it. --HG-- branch : trunk
2009-05-16*Update naxx script.megamage
--HG-- branch : trunk
2009-05-16*Update some instance script functions.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-16*Change amount of passive auras if mod changed for them (this fixes Glyph of ↵QAston
vigor apply/remove and some other spells) *Backfire damage from unstable affliction is applied to dispeller now *Correct amount of improved Divine Spirit --HG-- branch : trunk
2009-05-15[7835] Store structures (with size = uint32) insteed pointer to structure in ↵megamage
PetSpellMap. Author: VladimirMangos --HG-- branch : trunk
2009-05-15 [7834] Mangos string loading code cleanups. Author: VladimirMangosmegamage
* Better integration creature event ai strings. * Not inclide in checks as expected max mangos strings range value to range --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*Fix a crash caused by eventai.megamage
--HG-- branch : trunk
2009-05-15*Fix build.megamage
--HG-- branch : trunk
2009-05-15*Merge.megamage
--HG-- branch : trunk
2009-05-15[7832] Better check at `petcreateinfo_spell` loading for errors and ↵megamage
redundend data. Author: VladimirMangos --HG-- branch : trunk
2009-05-15[7831] Prevent have hunter pet with level greater player levels at level ↵megamage
changes. Propertly set hunter pet xp values at level update. Author: VladimirMangos --HG-- branch : trunk
2009-05-15*remove UNIT_FLAG2_FORCE_MOVE when loading players. This fix the bug that ↵megamage
players cannot stop moving forward. By Bulkin. --HG-- branch : trunk
2009-05-15*Blizzlike calculation of skill required to cast judgement-like spells.QAston
--HG-- branch : trunk
2009-05-15*Fix build.QAston
--HG-- branch : trunk
2009-05-15*Allow hots to procQAston
--HG-- branch : trunk
2009-05-15*Do not proc relentless strikes with slice and dice twiceQAston
*Fix trap radius calculation in some cases-by krz --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-15*Merge some fixes from tc1QAston
--HG-- branch : trunk
2009-05-15*Fix Glyph of Ice Block.Anubisss
*Thanks QAston for the help in the SpellFamilyMask. --HG-- branch : trunk
2009-05-15*Implement GetSpellCooldowns() for get m_spellCooldowns(Player's map of ↵Anubisss
spell CDs). --HG-- branch : trunk
2009-05-15*Rewrite Moroes Script to fix reset bugBroodWyrm
--HG-- branch : trunk
2009-05-15*Fix Cheat Death.QAston
--HG-- branch : trunk
2009-05-14New server options to block adding GMs to friends by players and to block ↵Genars & Aokromes
inviting GMs to parties --HG-- branch : trunk
2009-05-14*Fix a typo that cause crash. Thanks to Drahy.megamage
--HG-- branch : trunk
2009-05-14*Add some distance check functions. By VladimirMangos.megamage
--HG-- branch : trunk
2009-05-14[7825] Fixed typo in comment and var. name. Author: BombermaGmegamage
--HG-- branch : trunk
2009-05-14[7824] Implement use ArmorDamageModifier bonus for armor Author: DiSlordmegamage
--HG-- branch : trunk
2009-05-14[7822] Avoid declined names form show in case disabled config option with ↵megamage
russian client at non-russian realm. Author: Foks --HG-- branch : trunk
2009-05-14[7821] Fixed typo in comment and var. name. Author: KAPATEJIbmegamage
--HG-- branch : trunk
2009-05-14[7820] Fixed typo in [7819] that not allow correct work non-scalling item ↵megamage
stats. Author: VladimirMangos --HG-- branch : trunk