Commit Graph

281 Commits

Author SHA1 Message Date
megamage
0652c95126 [7892] Update spell_loot_template entry description in error output for better fit to current table use. Author: VladimirMangos
--HG--
branch : trunk
2009-05-26 16:10:42 -05:00
megamage
326940181a *Consider flight spells as passive spells.
--HG--
branch : trunk
2009-05-26 15:32:11 -05:00
megamage
ddcc7d1c66 *Move spelltarget table check to the start of the server to reduce log spams.
--HG--
branch : trunk
2009-05-25 16:50:01 -05:00
megamage
a2f8a735ae *Merge.
--HG--
branch : trunk
2009-05-25 13:03:11 -05:00
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
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
QAston
1b2579a2ab Ancestral Awakening target selection
--HG--
branch : trunk
2009-05-24 15:36:15 +02:00
QAston
74770dbcf6 *Fix whath of air and flametongue totem
--HG--
branch : trunk
2009-05-24 14:58:54 +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
ec24442af4 *Fix rock shards spell for archavon script.
--HG--
branch : trunk
2009-05-23 01:43:46 -05:00
Anubisss
08e1ec8a8a *Correct spell id for Muru's Negative Energy's MaxAffectedTargets by Alyen. Thank you.
--HG--
branch : trunk
2009-05-23 00:18:24 +02:00
megamage
32064b79da *Do not remove/add aura for refreshing case.
--HG--
branch : trunk
2009-05-21 14:54:22 -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
e8be2f026e *Add some scripted spells for naxx.
--HG--
branch : trunk
2009-05-18 15:04:05 -05:00
megamage
e45c57f298 *Fix the bug that startfall aoe damage also apply on direct target.
*Add starfall spell bonus for other ranks. By Uruviel and Nesocip.

--HG--
branch : trunk
2009-05-18 10:22:43 -05:00
megamage
5784d03121 *Fix the bug that inferno and curse of doom summons too many minions.
--HG--
branch : trunk
2009-05-17 17:33:39 -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
14edc1e5eb *Update naxx script.
--HG--
branch : trunk
2009-05-16 14:49:58 -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
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
megamage
834580f6b2 *Move some Trinity-only functions to the end of file.
--HG--
branch : trunk
2009-05-15 16:26:00 -05:00
QAston
d81352b421 *Allow hots to proc
--HG--
branch : trunk
2009-05-15 16:59:27 +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
a9349e06ba *Fix a typo
--HG--
branch : trunk
2009-05-11 23:52:50 +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
megamage
8fc07d443a *Change waypoint data structure. Use creature db guid as path id. If a creature uses waypoint movement as default movement type, the path id should be DBGUID*10. For paths of script use, the path id should be DBGUID*10+1 ~ DBGUID*10+9.
*Two sql queries are included. Converter is used to convert the existing path id to new path id. "...creature_add..." is used to change table structure. You can first run the converter, then run the other one. Or run the other one directly and get the new data from the db team. Because it may take hours to run the converter.
*If you have custom data, you may need to run the converter. We suggest you use console to run it It is extremely slow to run the query. If you have multiple paths for a creature in your db, you need to do more work to convert it. However, if you know how to use multiple paths, you should already have more db knowledge than I do and you should know how to convert it.
*There may be a faster query to convert the db. If you know, please tell us. I am no sql expert.
*Backup your db first!
*Thanks to X-Savior and subhuman_bob.

--HG--
branch : trunk
2009-05-11 13:27:10 -05:00
megamage
82f886e3c1 *Update AI scripts. Use better default AI.
--HG--
branch : trunk
2009-05-10 22:48:22 -05:00
QAston
50bf49bd81 Allow class specific periodic dummy and dummy auras to always stack
--HG--
branch : trunk
2009-05-11 00:05:36 +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
QAston
e8474f3291 *Do not allow to cast cyclone on divine shielded target.
--HG--
branch : trunk
2009-05-08 00:37:13 +02:00
megamage
a3447b294d *Update Naxx scripts.
--HG--
branch : trunk
2009-05-06 00:08:19 -05:00
QAston
6998da2028 *Fix chains of ice
*Correct typo in my prev commit-by megamage
*Fix hearthstone obtaining from innkeeper.

--HG--
branch : trunk
2009-05-04 18:31:37 +02:00
megamage
1cfc04f1f5 [7745] Fixed gcc warnings. Author: AlexDereka
--HG--
branch : trunk
2009-05-03 22:21:46 -05:00
megamage
84fc76439c *Fix a crash caused by feedpet.
*Also have delay for jump spells.

--HG--
branch : trunk
2009-05-03 16:29:33 -05:00
megamage
04d5acb24e *Fix a typo that break some charge spells.
--HG--
branch : trunk
2009-05-03 15:17:19 -05:00
megamage
193b0634df *Some fix of sapphiron script.
--HG--
branch : trunk
2009-05-03 11:28:14 -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
QAston
abe9b27ee4 *Fix target selection for wild growth and circle of healing
--HG--
branch : trunk
2009-05-03 00:02:02 +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
QAston
a1f73a8a08 *More correct handling of fly mod auras.
*Pets now learn all levelup spells.
*Fix lightning overload.

--HG--
branch : trunk
2009-05-02 16:08:52 +02: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