aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
AgeCommit message (Collapse)Author
2009-05-24 [7880] Added error output for default switch case. Author: ApoCmegamage
--HG-- branch : trunk
2009-05-24 [7879] Added SPELL_AURA_MOD_SPELL_CRIT_CHANCE into isTriggerAura. ↵megamage
Author: ApoC This will fix auras (57529, 57531, possibly others) to be correctly removed dependently on their procFlags and procCharges. --HG-- branch : trunk
2009-05-24[7879] Fixed proc for 31571 and ranks. Author: Tanatosmegamage
--HG-- branch : trunk
2009-05-23*Store aura::source for all types of aura effect.megamage
--HG-- branch : trunk
2009-05-23*Rename formalCaster as "source"megamage
--HG-- branch : trunk
2009-05-23*Fix a bug that player can change to an occupied seat on vehicle.megamage
*Load full creature data for vehicles. --HG-- branch : trunk
2009-05-23*Fix build.megamage
--HG-- branch : trunk
2009-05-23*Try to fix an aura bug that cause server freezemegamage
--HG-- branch : trunk
2009-05-23*Fix a crash.QAston
--HG-- branch : trunk
2009-05-23*Allow healing mod auras to affect SPELL_DAMAGE_CLASS_NONE spellsQAston
--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-22[7876] Implemented dummy effect /*and special target selection*/ for 52759. ↵megamage
Author: ApoC --HG-- branch : trunk
2009-05-22*Set pvp flags for units controlled by player.megamage
*Reset pvp flags when unit is uncharmed. *Remove walk flag when unit is charmed. --HG-- branch : trunk
2009-05-21*Fix a infinite loop introduced in 3453. Thanks to QAston and Drahy.megamage
--HG-- branch : trunk
2009-05-21*Fix a infinite loop introduced in 3444.megamage
--HG-- branch : trunk
2009-05-21*Do not remove/add aura for refreshing case.megamage
--HG-- branch : trunk
2009-05-21*Fix reckongingQAston
*fix Sword and Board *Fix Vigilance *Rollback sw:death fix. --HG-- branch : trunk
2009-05-21[7864] Use x.0f float constant format. Author: NoFantasymegamage
--HG-- branch : trunk
2009-05-21[7862] Fixed infinity loop at search spell related summoned gameobject in ↵megamage
owner list. Author: VladimirMangos --HG-- branch : trunk
2009-05-21Mobs fleeing and getting assistance feature implementaion. Author: Neo2003megamage
--HG-- branch : trunk
2009-05-21[7856] Fix cast 51525 and ranks charge on target (not owner) Author: Astellarmegamage
--HG-- branch : trunk
2009-05-20*Remove some redundant code in dealdamage.megamage
--HG-- branch : trunk
2009-05-19*Corret proc from bloodsurge and judgements of the wiseQAston
*Do not proc backfire dmg from sw:death if target is killed *Allow hots to proc from selfcast *Fix glyph of corruption. --HG-- branch : trunk
2009-05-19*Fix Demonic Empowerment.QAston
*Some code optimisations. *Set formalCasterGuid for area auras correctly. --HG-- branch : trunk
2009-05-19*Fix some bugs about pet spells: such as cannot cast/cannot autocast.megamage
--HG-- branch : trunk
2009-05-18*Fix a typo causing healing bonus for spells to be far too low.QAston
--HG-- branch : trunk
2009-05-18*Fix beacon of lightQAston
*Apply healing aura mods to leech auras. --HG-- branch : trunk
2009-05-18*Spell_proc_event entries for Malestorm Weapon - by throneincQAston
*Fix bug that some spells can't proc *Add spell_proc_event entries for some items. --HG-- branch : trunk
2009-05-20Correctly interpret SPELL_AURA_MOD_COMBAT_CHANCE DBC valuesthenecromancer
as % modificators instead of flat values. --HG-- branch : trunk
2009-05-20Correct behavior of Add Extra Attact spelleffect.thenecromancer
Correctly send attack gain in spell log. Attack right after processing effect Ignore effect if target not in melee range/angle --HG-- branch : trunk
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 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-17*Do not clear unit movement flags when it is stunned/rootedmegamage
--HG-- branch : trunk
2009-05-17Properly check if triggering spell can stack with player's aura.krz
That should fix e.g. water shield. --HG-- branch : trunk
2009-05-16*Do not allow taunt affect passive creatures.megamage
*Fix build. --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-16Moved most randomisation functions usage from static version into Map object.raczman
--HG-- branch : trunk
2009-05-15*Merge.megamage
--HG-- branch : trunk
2009-05-15*Blizzlike calculation of skill required to cast judgement-like spells.QAston
--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*Fix Cheat Death.QAston
--HG-- branch : trunk
2009-05-14*Add some distance check functions. By VladimirMangos.megamage
--HG-- branch : trunk
2009-05-14*Merge. Sorry for the mess. But a rev was wrongly backouted so we have to ↵megamage
make these two backouts. --HG-- branch : trunk
2009-05-14Backed out changeset: 7dcbf5239f55megamage
--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