Commit Graph
137 Commits
Author SHA1 Message Date
QAston f2ec641e42 [8056] Move SMSG_CLEAR_COOLDOWN into function and use it. Other cleanups. Author:XTZGZoReX
[8060] Store spell_pet_auras for auraeffects instead of by whole aura Author:hunuza.

--HG--
branch : trunk
2009-06-23 14:05:37 +02:00
megamage 2d569883e6 *Add config option CheckDB to check if the contents in FULL folder are applied.
--HG--
branch : trunk
2009-06-17 14:09:17 -05:00
QAston bcab60c253 *Spell power coefficient for Sacred Shield.
--HG--
branch : trunk
2009-06-15 18:18:24 +02:00
QAston 109302999d *Fix improved stormstrike - by CRAZyBUg
--HG--
branch : trunk
2009-06-15 17:56:10 +02:00
QAston 7268e291b4 *Fix improved drain soul.
--HG--
branch : trunk
2009-06-15 13:42:43 +02:00
QAston e7910ec9d2 *Correct interpretation of procflags and update spell_proc_event due to that (some of mangos entries may be incompatibile due to that change)
*Fix siphon life.
*Fix Rapture.

--HG--
branch : trunk
2009-06-14 17:56:22 +02:00
megamage 8c4861b40f *Fix build in *nix. Note: *nix does not allow you declare an "enum" in one file while define it in another.
--HG--
branch : trunk
2009-06-13 09:55:02 -05:00
QAston da067afe12 *Fix Improved Spell Reflection
*Fix Glyph of Improved Scorch
*Sword And Board
*Fix Glyph of Devastate - original patch by CRAZyBUg

--HG--
branch : trunk
2009-06-10 23:44:30 +02:00
adrycasillo 8bc014b42d *Do not allow Divine Spirit and Prayer of Divine spirit to stack.
--HG--
branch : trunk
2009-06-06 09:14:04 +02:00
QAston 39548d6822 *Update spellmod system
*Implement SPELL_ATTR_EX6_IGNORE_CASTER_AURAS
*Fix some bugs with traps proc flags

--HG--
branch : trunk
2009-06-06 08:27:36 +02:00
megamage 7e1ca8f2ce *Merge.
--HG--
branch : trunk
2009-05-25 11:08:52 -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 09b386a786 [7886] Drop use table petcreateinfo_spell
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-24 12:16:12 -05:00
megamage 1a637493b7 [7881] More types with random generated item at recipe casting. Cleanups code. Author: VladimirMangos
Real resulting items creating required DB support (helper error message outputed at loading)

--HG--
branch : trunk
2009-05-24 11:17:41 -05:00
megamage 4ed847a6e3 *Implement spell effect wmo damage.
--HG--
branch : trunk
2009-05-21 10:01:03 -05:00
megamage 6473e94358 *Update Naxx scripts. Now only Kelthuzad is incompleted
--HG--
branch : trunk
2009-05-20 11:44:38 -05:00
megamage 1c134f81e3 *Merge.
--HG--
branch : trunk
2009-05-17 16:40:40 -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 15c78a728e *Skip Mangos ([7833] Implement levelup spells for non-hunter pets. Author: VladimirMangos)
--HG--
branch : trunk
2009-05-15 16:36:59 -05:00
QAston 02bc76455a *Fix build.
--HG--
branch : trunk
2009-05-15 18:30:34 +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
krz ee40287ef7 Do not allow to proc spells if they can't stack with already active auras.
this fixes 13048 and 12292.

--HG--
branch : trunk
2009-05-14 14:35:09 +02:00
QAston 51b5f2aa64 *Allow Hots to proc-this should fix talents like 33776 effect from hots.
--HG--
branch : trunk
2009-05-11 23:46:45 +02:00
QAston fcf0fdc1c1 *Item enchancment/proc patch - original code by Thenecromancer
--HG--
branch : trunk
2009-05-10 18:06:22 +02:00
megamage 979073cebd *Update some spell attr flag. Use better way to check IsRangedSpell and UnaffectedByInvulnerability
--HG--
branch : trunk
2009-05-08 00:49:02 -05:00
megamage ac3c58a2eb *Fix the bug that fishing bobber does not have correct position.
--HG--
branch : trunk
2009-05-06 10:35:37 -05:00
megamage 4045c881ab *add SPELL_ATTR_CU_EXCLUDE_SELF
--HG--
branch : trunk
2009-05-06 00:07:28 -05:00
megamage 5b9dae20b1 *Fix build. By Kudlaty.
--HG--
branch : trunk
2009-05-07 18:06:20 -05:00
mknjc 3703f4891d Backported TC2 commit 3157 (megamage: *Fix the bug that fishing bobber does not have correct position.)
--HG--
branch : trunk
2009-05-07 18:20:55 +02:00
QAston f9b13b45e0 *Fix grounding totem.
*Fix runic power regeneration of butchery
*Fix some problems with master of subtlety buff expire.
*Do not allow arcane intellect and brillance to stack.

--HG--
branch : trunk
2009-05-03 16:55:09 +02:00
megamage 9f0f239e60 *Merge.
*Also fix build in VC7 and VC8.

--HG--
branch : trunk
2009-05-02 13:30:55 -05:00
megamage f303ee08c5 *Update spell selection.
--HG--
branch : trunk
2009-05-02 11:28:11 -05:00
megamage db817d668a *Merge.
--HG--
branch : trunk
2009-05-01 18:37:32 -05:00
megamage 5a66774008 *Fix the bug that shapeshift can remove blind.
--HG--
branch : trunk
2009-05-01 15:36:32 -05:00
QAston 0f5a9cb46f *Implement enchanting vellums.
--HG--
branch : trunk
2009-05-01 15:40:49 +02:00
megamage 09af28301e [7716] Fixed some typos and possible crashes. Author: AlexDereka
--HG--
branch : trunk
2009-04-27 18:42:35 -05:00
QAston a00563a127 *Fix deadly brew.
*Some changes in flag SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY.

--HG--
branch : trunk
2009-04-25 18:53:29 +02:00
QAston a731f9a3c0 *Update of procflag system:
-Improved holy concentration, Second wind and other spells which can trigger from triggered spells should work correctly now
-Allow potions to trigger

--HG--
branch : trunk
2009-04-18 21:25:48 +02:00
QAston a13e6537e9 *Fix T.N.T proc chance
--HG--
branch : trunk
2009-04-13 18:56:29 +02:00
QAston beab3e0125 *Fix some problems with ProcFlag
--HG--
branch : trunk
2009-04-13 15:52:59 +02:00
QAston 276084e294 *Fixes in pet levelup spell system-pets no longer learn triggered spells and can cow learn 2 spells for 1 level.
--HG--
branch : trunk
2009-04-06 14:54:56 +02:00
QAston 20c02ef760 *Update of aura system.
--HG--
branch : trunk
2009-04-06 13:31:14 +02:00
megamage bc2f2bc56a [7552] Move client version dependend DBC code to src/game. Author: VladimirMangos
--HG--
branch : trunk
2009-03-27 09:58:20 -06:00
QAston ce71c0e798 *Update dispel code and fix crash related to it. Thanks to megamage.
--HG--
branch : trunk
2009-03-23 01:54:50 +01:00
megamage ee332629b6 *Do not allow toggle unautocastable spells for pet.
--HG--
branch : trunk
2009-03-21 18:05:43 -06:00
QAston 3ff11b64ba *Move Overkill and Master of Subtlety to procflag and fix some issues with them.
*Proc Shattered Barrier only on aura destroy.
*Fix some possible issues with aura stackamount display.

--HG--
branch : trunk
2009-03-19 10:40:02 +01:00
megamage 3eba06e4ad *Use SpellCastResult and finaly fix SPELL_CAST_OK value (255 custom value now). By VladimirMangos.
--HG--
branch : trunk
2009-03-16 12:00:14 -06:00
megamage 3c9c17b253 [7463] Make basic preparations for replace 0 as ok spell cast value by more correct value. Author: VladimirMangos
Currently 0 used ast OK value for spell cast checks BUT 0 = SPELL_FAILED_AFFECTING_COMBAT
    So another values need used. This required lot code changes. This is first step.

--HG--
branch : trunk
2009-03-15 17:22:19 -06:00
QAston 8b96182b1c *Fix Shattered Barrier
--HG--
branch : trunk
2009-03-15 02:06:59 +01:00