Commit Graph
117 Commits
Author SHA1 Message Date
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
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
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
QAston 0d5044863e *Add procflag PROC_EX_AURA_REMOVE.
*Use new procflag to fix Psyhic Horror.
*Fix a typo in Living Bomb handler.

--HG--
branch : trunk
2009-03-13 22:48:04 +01:00
QAston 6683ae58c9 * Fix mind flay target requirements.
--HG--
branch : trunk
2009-03-11 22:27:07 +01:00
QAston fec6be8a74 *Fix compile.
--HG--
branch : trunk
2009-03-10 21:53:11 +01:00
QAston 6fb63d3325 *Make scrolls not stackable.
--HG--
branch : trunk
2009-03-10 16:44:03 +01:00
megamage 985b7656bb *Merge.
--HG--
branch : trunk
rename : sql/updates/XXX_characters_auctionhouse.sql => sql/updates/1164_characters.sql
2009-03-08 11:36:10 -06:00
KingPin ae70787843 Extend the spell_disabled table to have a seperate flag for pet spells from player spells, Patch by Koani
--HG--
branch : trunk
2009-03-07 07:47:02 -05:00
QAston ab2fa2e52c *Fix amount of paladin's spells damage.
*Fix problems with aurastate remove.

--HG--
branch : trunk
2009-03-06 18:52:39 +01:00
megamage 1cdae46468 [7376] Allow store in spell_area.aura_spell negative values for "not has aura" requirement. Author: VladimirMangos
Also
    * Allow have in aura_spell spells with SPELL_AURA_PHASE in first effect.
    * Allow negative aura_spell chaining in spell_area table.
    * Better check at loading duplicate data (by requiremnt set) in spell_area table.

--HG--
branch : trunk
2009-03-03 18:41:11 -06:00
megamage b1677c901d [7362] Use IN_MILISECONDS where appropriate, other cleanups. Author: VladimirMangos
--HG--
branch : trunk
2009-03-02 16:53:50 -06:00
megamage adb19df474 [7349] Implement spell cast depenences from area/quest.aura state store in new table spell_area. Author: VladimirMangos
* It allow store requirenments: area, active or rewarded quest (until possible another quest not rewarded),
      aura present at character, character race/gender.
    * Listed spell can marked as auto-casted when fit requirents. In this case spell requirements checked at
      zone/subzone update (and then resurraction also), quest start/reward, dummy aura apply.
    * Old hardcoded lines for similar check removed from sources and required DB support for work now.

--HG--
branch : trunk
2009-02-27 12:53:27 -06:00
megamage 2dbe092d9f [7348] Remove hack code from IsDeathPersistentSpell. Author: VladimirMangos
Re-apply zone dependent auras at resurrection by triggering zone update for player.

--HG--
branch : trunk
2009-02-27 12:28:10 -06:00
QAston 64540eff85 *Fix bug with spellproc.
*Fix bug with bloodthirst healing.

--HG--
branch : trunk
2009-02-25 21:15:38 +01:00
megamage 699bc588b8 [7330] Code warnings and style cleanups. Some bugs fixes. Author: VladimirMangos
1) comparison singed and unsigned values
    2) redundent includes
    3) wrong constructor :-part field initilization
    4) unused not-/*name*/-guarded args in template/virtual functions that not required like args.
    5) explicitly list not implemented achievement types.

    Also bugs fixed:
    1) Drop wrong phase mask 0 check in WorldObject::InSamePhase.
    2) ArenaTeamMember::ModifyPersonalRating incorrect work with move points in negative with infinity values in result.
    3) ArenaTeam::SaveToDB code send uint64 value to string with arg format %u.

--HG--
branch : trunk
2009-02-24 11:14:28 -06:00
megamage 4ecbdb128c [7313] Optimized checks of presence in std::set Author: zhenya
--HG--
branch : trunk
2009-02-21 17:03:39 -06:00
megamage 50012743e8 *Merge.
--HG--
branch : trunk
2009-02-18 16:57:42 -06:00
megamage 0ff7fbcd7f *Fix a crash caused by charm/possess spells.
--HG--
branch : trunk
2009-02-18 16:26:02 -06:00
megamage 31637d4aac *Merge.
--HG--
branch : trunk
2009-02-18 11:36:19 -06:00
KingPin 14234c86fa Newline added to bottom of all files.
--HG--
branch : trunk
2009-02-17 20:07:49 -06:00
QAston 14d85a183e *Make range check dependent from target.
--HG--
branch : trunk
2009-02-14 15:56:04 +01:00
megamage a72c0d223d [7266] Use DBC data for auction cut/deposit percents and location (auiction house id in fact).
More auction related code refactoring,
Move auction related code from ObjectMgr to AuctionHouseMgr.
Author: VladimirMangos

--HG--
branch : trunk
2009-02-13 19:50:20 -06:00