Commit Graph
198 Commits
Author SHA1 Message Date
QAston 84644b7644 *Some improvements in procflags:
-handle proc_flag_death
 -allow trap selection in spell proc event entry for proc_flag_on_trap
*Add spell_proc_event entry for Lock and Load - by Bengan
*Add spell_proc_event entry for Improved Spell Reflection.

--HG--
branch : trunk
2009-07-11 20:06:02 +02:00
QAston 107e7eafbd *Add new procExFlag: PROC_EX_ONLY_ACTIVE_SPELL - which allows only damaging/healing spells to proc - this fixes double proc of judgement auras in some cases.
--HG--
branch : trunk
2009-07-09 23:49:46 +02:00
QAston c86bdd2d40 *Fix a typo breaking compile on Linux.
--HG--
branch : trunk
2009-07-05 20:21:25 +02:00
QAston 67f8ec608c *Allow dest target spells to proc spellcast.
*Allow source target spells to be triggered during spellproc if no unit target avalible.

--HG--
branch : trunk
2009-07-05 16:58:42 +02:00
QAston 3225eb9648 *Redefine procflags:
PROC_FLAG_SUCCESSFUL_POSITIVE_MAGIC_SPELL = 0x00004000
PROC_FLAG_TAKEN_POSITIVE_MAGIC_SPELL      = 0x00008000
PROC_FLAG_SUCCESSFUL_NEGATIVE_MAGIC_SPELL = 0x00010000
PROC_FLAG_TAKEN_NEGATIVE_MAGIC_SPELL      = 0x00020000
*Add procEx flag:
PROC_EX_NOT_ACTIVE_SPELL    = 0x0008000 for spells which proc on spells not doing damage and not specified by familyflags.

--HG--
branch : trunk
2009-07-02 21:32:19 +02:00
QAston de721d1b86 *Some research about aura types.
--HG--
branch : trunk
2009-07-02 18:34:19 +02:00
QAston 7a4d99cc90 *Fix 'crazy procs' issue and shadowstep remove on stealth.
--HG--
branch : trunk
2009-07-02 14:13:30 +02:00
megamage e1d93bd00f *Backup your DB!
[8098] Support uint32 spell ids in code. Author: VladimirMangos

    * Propertly work with uint32 spell ids in player action bar
    * Fix in same time bug with not save equipment set button with id==0
    * Merge misc field in character_action and playercreateinfo_action to action field as 3 byte
    * Propertly load uint32 spell ids from character_spell
    * Fixed types for some pet/creature related structure for spell id storing.

--HG--
branch : trunk
2009-07-01 18:07:20 -05:00
megamage cf9c437d8e [8082] Update Diminishing Returns. Author: Lightguard
--HG--
branch : trunk
2009-06-27 18:24:40 -05:00
megamage d9ec2d2196 [8072] First step to get rid of data blob.
Adds new fields gender, level, xp, money, playerBytes, playerBytes2 and playerFlags to characters table.

    The update will not work if your database contains characters with an old data field (not fitting to the actual client version).

    It's recommended to backup your character database before applying this patch.

--HG--
branch : trunk
2009-06-27 17:39:51 -05:00
QAston f558a785fc [8069] Fixed copy/paste mistake in achievement error output. Author: Saeba
[8070] Restore spell casting loot items and recipes.

* SPELL_EFFECT_OPEN_LOCK_ITEM (59) effect removed in 3.1.3
* It replaced by SPELL_EFFECT_CREATE_RANDOM_ITEM (59), random item without
template replace spells like clam loot spells)
  Used by spells that use before SPELL_EFFECT_CREATE_ITEM_2 (157) with
  itemtype==0

Note: required DB support in `spell_loot_termplate` Author: VladimirMangos

--HG--
branch : trunk
2009-06-23 14:44:16 +02:00
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