Commit Graph

1148 Commits

Author SHA1 Message Date
megamage
a53326353b *Do not allow wrecking crew stack with enrage. Also, allow proc buff overwrite another. Need better rules to check that. (see my comment in code)
--HG--
branch : trunk
2009-05-25 11:19:13 -05:00
megamage
7e1ca8f2ce *Merge.
--HG--
branch : trunk
2009-05-25 11:08:52 -05:00
megamage
98049925a6 *Fix a typo that makes seal of vengeance/blood deal huge damage.
--HG--
branch : trunk
2009-05-25 10:39:50 -05:00
megamage
6f2eebf2c3 *Fix broken escort AI.
--HG--
branch : trunk
2009-05-24 18:16:43 -05:00
megamage
8140543de4 *Rewrite some OPvP functions.
*Apply tenacity buff for outnumbered players in wintergrasp.

--HG--
branch : trunk
2009-05-24 17:26:44 -05:00
QAston
1c505261bc *Remove auras with duration lower than 30 sec on arena start.
*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 22:54:13 +02:00
megamage
aa67033cc7 [7885] Fixed talent 34914 and ranks proc spell to correct spellid. Author: qsa
--HG--
branch : trunk
2009-05-24 11:32:44 -05:00
megamage
35f08f9e21 [7880] Added error output for default switch case. Author: ApoC
--HG--
branch : trunk
2009-05-24 11:15:37 -05:00
megamage
57f14494b1 [7879] Added SPELL_AURA_MOD_SPELL_CRIT_CHANCE into isTriggerAura. 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 11:14:42 -05:00
megamage
4ebe23324b [7879] Fixed proc for 31571 and ranks. Author: Tanatos
--HG--
branch : trunk
2009-05-24 11:13:45 -05:00
megamage
946aa87445 *Store aura::source for all types of aura effect.
--HG--
branch : trunk
2009-05-23 22:21:26 -05:00
megamage
af1f0fd419 *Rename formalCaster as "source"
--HG--
branch : trunk
2009-05-23 20:50:21 -05:00
megamage
2780893030 *Fix a bug that player can change to an occupied seat on vehicle.
*Load full creature data for vehicles.

--HG--
branch : trunk
2009-05-23 20:40:14 -05:00
megamage
a22aedf320 *Fix build.
--HG--
branch : trunk
2009-05-23 10:16:40 -05:00
megamage
bfac33f24f *Try to fix an aura bug that cause server freeze
--HG--
branch : trunk
2009-05-23 10:04:12 -05:00
QAston
73faabbc49 *Fix a crash.
--HG--
branch : trunk
2009-05-23 11:26:08 +02:00
QAston
4d9bce3270 *Allow healing mod auras to affect SPELL_DAMAGE_CLASS_NONE spells
--HG--
branch : trunk
2009-05-23 11:12:13 +02:00
QAston
9af492483e *always remove old aura instead of recalculating new one in same id stack case-this prevents some problem with spelleffects execution problems
--HG--
branch : trunk
2009-05-23 10:57:05 +02:00
megamage
2e46b7e65d [7876] Implemented dummy effect /*and special target selection*/ for 52759. Author: ApoC
--HG--
branch : trunk
2009-05-22 16:49:37 -05:00
megamage
3641be039b *Set pvp flags for units controlled by player.
*Reset pvp flags when unit is uncharmed.
*Remove walk flag when unit is charmed.

--HG--
branch : trunk
2009-05-22 03:12:35 -05:00
megamage
67255e536b *Fix a infinite loop introduced in 3453. Thanks to QAston and Drahy.
--HG--
branch : trunk
2009-05-21 17:18:44 -05:00
megamage
31005dab82 *Fix a infinite loop introduced in 3444.
--HG--
branch : trunk
2009-05-21 15:17:51 -05:00
megamage
32064b79da *Do not remove/add aura for refreshing case.
--HG--
branch : trunk
2009-05-21 14:54:22 -05:00
QAston
1403419164 *Fix reckonging
*fix Sword and Board
*Fix Vigilance
*Rollback sw:death fix.

--HG--
branch : trunk
2009-05-21 20:02:22 +02:00
megamage
6d6a4a7856 [7864] Use x.0f float constant format. Author: NoFantasy
--HG--
branch : trunk
2009-05-21 10:52:35 -05:00
megamage
8d771cc9f7 [7862] Fixed infinity loop at search spell related summoned gameobject in owner list. Author: VladimirMangos
--HG--
branch : trunk
2009-05-21 10:51:18 -05:00
megamage
67c84b1f3d Mobs fleeing and getting assistance feature implementaion. Author: Neo2003
--HG--
branch : trunk
2009-05-21 10:48:00 -05:00
megamage
fb0ccbf4aa [7856] Fix cast 51525 and ranks charge on target (not owner) Author: Astellar
--HG--
branch : trunk
2009-05-21 10:09:25 -05:00
megamage
49a39abf8f *Remove some redundant code in dealdamage.
--HG--
branch : trunk
2009-05-20 12:26:14 -05:00
QAston
e348b671e7 *Corret proc from bloodsurge and judgements of the wise
*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 20:33:11 +02:00
QAston
2b47f0c0f7 *Fix Demonic Empowerment.
*Some code optimisations.
*Set formalCasterGuid for area auras correctly.

--HG--
branch : trunk
2009-05-19 18:33:49 +02:00
megamage
2a2eff190c *Fix some bugs about pet spells: such as cannot cast/cannot autocast.
--HG--
branch : trunk
2009-05-19 01:23:52 -05:00
QAston
483714d845 *Fix a typo causing healing bonus for spells to be far too low.
--HG--
branch : trunk
2009-05-18 22:59:57 +02:00
QAston
7ed391aa92 *Fix beacon of light
*Apply healing aura mods to leech auras.

--HG--
branch : trunk
2009-05-18 21:54:11 +02:00
QAston
6c7f2d2b24 *Spell_proc_event entries for Malestorm Weapon - by throneinc
*Fix bug that some spells can't proc
*Add spell_proc_event entries for some items.

--HG--
branch : trunk
2009-05-18 19:00:20 +02:00
thenecromancer
d7740fcd17 Correctly interpret SPELL_AURA_MOD_COMBAT_CHANCE DBC values
as % modificators instead of flat values.

--HG--
branch : trunk
2009-05-20 22:59:22 +02:00
thenecromancer
6ebfe2f580 Correct behavior of Add Extra Attact spelleffect.
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-20 22:39:52 +02:00
megamage
1c134f81e3 *Merge.
--HG--
branch : trunk
2009-05-17 16:40:40 -05:00
megamage
b95e67375c *Move AI function DamageTaken back to DealDamage.
--HG--
branch : trunk
2009-05-17 16:38:44 -05:00
QAston
7c6757d7ee *Update proc system.
--HG--
branch : trunk
2009-05-17 18:00:33 +02:00
megamage
3569f949d7 [7839] Rafactoring player targeting code in chat command and related 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 10:57:55 -05:00
megamage
98e32a041d *Do not clear unit movement flags when it is stunned/rooted
--HG--
branch : trunk
2009-05-17 10:07:11 -05:00
krz
cc85d9e1c4 Properly check if triggering spell can stack with player's aura.
That should fix e.g. water shield.

--HG--
branch : trunk
2009-05-17 12:03:54 +02:00
megamage
09407c8757 *Do not allow taunt affect passive creatures.
*Fix build.

--HG--
branch : trunk
2009-05-16 15:28:37 -05:00
QAston
bb6e0dba89 *Fix lifebloom final heal coefficient - by nesocip
*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 20:23:56 +02:00
QAston
14daff6d38 *Change amount of passive auras if mod changed for them (this fixes Glyph of 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-16 17:59:36 +02:00
raczman
10ee81ef13 Moved most randomisation functions usage from static version into Map object.
--HG--
branch : trunk
2009-05-16 10:50:39 +02:00
megamage
ff7f023ff1 *Merge.
--HG--
branch : trunk
2009-05-15 13:57:10 -05:00
QAston
4b782ccc1d *Blizzlike calculation of skill required to cast judgement-like spells.
--HG--
branch : trunk
2009-05-15 19:40:45 +02:00
QAston
47d5fc51c5 *Item enchancment/proc patch - original code by Thenecromancer
-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 16:37:22 +02:00