Commit Graph
100 Commits
Author SHA1 Message Date
megamage 833ceee7c5 *Fix a bug that player cannot remove buff which is not casted by self.
--HG--
branch : trunk
2009-05-18 23:07:36 -05:00
megamage ba727af796 *Fix a crash caused by a typo in SetCantProc. Thanks to Drahy. Do not use rev between 3392 and 3404.
--HG--
branch : trunk
2009-05-18 17:48:03 -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
megamage 3f98363aab *Merge.
--HG--
branch : trunk
2009-05-18 15:17:53 -05:00
megamage df866dd37b [7848] Fix set variable to zero on apply -100% mod Author: SeT
--HG--
branch : trunk
2009-05-18 15:15:22 -05:00
megamage c3499f39da [7847] Replace paramter unions by uniton of event ai action type structures. Add/fix some loading checks. Author: VladimirMangos
* Also send to process function reference to strucutre instead large amount fields.
    * Specially note that fixed check for first arg of action type 27 that before wrongly test as quest id,
    when by using code expected creature id. Possible some used data wrongly can be quest ids....

--HG--
branch : trunk
2009-05-18 15:14:27 -05:00
megamage 40dad11d74 [7846] Add empty line to end of .h file Author: timmit
--HG--
branch : trunk
2009-05-18 15:10:13 -05:00
megamage 2cdb3865aa [7845] Implement reload support for creature eventAI tables. Author: evilstar
--HG--
branch : trunk
2009-05-18 15:09:34 -05:00
megamage bd87c96f4c [7844] Fixed mangos string storage index type. Author: VladimirMangos
--HG--
branch : trunk
2009-05-18 15:07:14 -05:00
megamage e8be2f026e *Add some scripted spells for naxx.
--HG--
branch : trunk
2009-05-18 15:04:05 -05:00
QAston d0ef4b8b4a *Merge.
--HG--
branch : trunk
2009-05-18 21:55:04 +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
megamage 609f7bd6b9 *Add a missing part of sql of 3391. By nesocip
--HG--
branch : trunk
2009-05-18 14:50:29 -05:00
Anubisss 3449432e38 *Add ATTACK_DISTANCE from MaNGOS.
--HG--
branch : trunk
2009-05-18 20:34:09 +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
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
Anubisss a57d52fa28 *Rename a sql file because firstly You should convert the waypoints and after drop the columns.
--HG--
branch : trunk
rename : sql/updates/3257_world_creature_addon_(waypoint).sql => sql/updates/3258_world_creature_addon_(waypoint).sql
2009-05-18 15:53:59 +02:00
megamage 0b9bb3b4ff *Use Null AI for spell click creature as default.
--HG--
branch : trunk
2009-05-17 23:28:12 -05:00
megamage a922f36da5 *Update script for Loatheb.
--HG--
branch : trunk
2009-05-17 23:27:51 -05:00
megamage 1d859b6ee4 [7843] Added newline into Pet.h end to make gcc happy. Author: ApoC
--HG--
branch : trunk
2009-05-17 18:43:07 -05:00
megamage 786083d8cc [7842] Set and stop combat for pets at player enter to GM-mode. Author: DonTomika
--HG--
branch : trunk
2009-05-17 18:42:01 -05:00
megamage ce0feb36ea [7841] Fixed: Prevent loading maps/vmaps when building enum. Author: SilverIce
--HG--
branch : trunk
2009-05-17 18:41:16 -05:00
megamage 3d43b9a612 *Remove some unused scripts and add a missing scriptname to full sql.
--HG--
branch : trunk
2009-05-17 18:00:17 -05:00
megamage cbc375b895 *Fix a bug that event ai text is loaded twice.
--HG--
branch : trunk
2009-05-17 17:46:47 -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 5f023f64f3 *Use degree rather than radian for creature_formation table.
--HG--
branch : trunk
2009-05-17 17:29:25 -05: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
megamage c75e3d526b *Update Naxx script. Let boss evade if they are pulled out of room.
--HG--
branch : trunk
2009-05-17 16:37:03 -05:00
megamage 424391d7c4 *Fix a bug that player may not be at correct location when log in after crash.
--HG--
branch : trunk
2009-05-17 16:36:40 -05:00
QAston 7c6757d7ee *Update proc system.
--HG--
branch : trunk
2009-05-17 18:00:33 +02:00
megamage f09f5c61d4 [7840] Fixed unexpected rounding in pet size scale calculation. Author: Naicisum
--HG--
branch : trunk
2009-05-17 10:58:31 -05: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 d2ef2c0500 [7837] Implement missed item enchant type (stat mana, stat health) Author: xILOSWag
--HG--
branch : trunk
2009-05-17 10:09:44 -05:00
megamage d99e66d931 [7836] Fixes for distance range checks. Author: VladimirMangos
* ignore 0.0f min range limit (this correct case when 2 object overlapped)

    Also use int32 for temporary store GetSessionDbLocaleIndex result.

--HG--
branch : trunk
2009-05-17 10:09:06 -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
megamage d0a50c9d55 *Fix the sql error when saving pet auras.
--HG--
branch : trunk
2009-05-17 09:43:57 -05:00
megamage f4efa0f1df *Fix a crash caused by bg and arena.
--HG--
branch : trunk
2009-05-17 09:28:38 -05:00
megamage 698b43f088 *Make some boss scripts safer. But I still strongly recommend that you do not spawn instance bosses outside the instance. They may make server crash like hell.
--HG--
branch : trunk
2009-05-16 22:45:13 -05:00
megamage c583767ad6 *Update gluth script.
--HG--
branch : trunk
2009-05-16 16:52:57 -05:00
megamage a0ba5dc206 *Allow creating new instance when log in and a save exists.
--HG--
branch : trunk
2009-05-16 16:52:45 -05:00
megamage a5df3c9e72 *Do not allow positive AOE affect totem.
--HG--
branch : trunk
2009-05-16 15:28:58 -05:00
megamage 09407c8757 *Do not allow taunt affect passive creatures.
*Fix build.

--HG--
branch : trunk
2009-05-16 15:28:37 -05:00
megamage e4456ae9f8 *Fix an exploit that instance can be reset when there are logged-out players in it.
--HG--
branch : trunk
2009-05-16 14:52:41 -05:00
megamage 14edc1e5eb *Update naxx script.
--HG--
branch : trunk
2009-05-16 14:49:58 -05:00
megamage 819326f286 *Update some instance script functions.
--HG--
branch : trunk
2009-05-16 14:49:30 -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
Drahy 68a8c72041 * Used trinity sql coding style
--HG--
branch : trunk
2009-05-16 02:56:39 +02:00
megamage 9b4d3bf0af [7835] Store structures (with size = uint32) insteed pointer to structure in PetSpellMap. Author: VladimirMangos
--HG--
branch : trunk
2009-05-15 16:46:02 -05:00
megamage f5af5ea9e3 [7834] Mangos string loading code cleanups. Author: VladimirMangos
* Better integration creature event ai strings.
    * Not inclide in checks as expected max mangos strings range value to range

--HG--
branch : trunk
2009-05-15 16:41:36 -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
megamage 834580f6b2 *Move some Trinity-only functions to the end of file.
--HG--
branch : trunk
2009-05-15 16:26:00 -05:00
megamage 5732b8c170 *Remove an unused file.
--HG--
branch : trunk
2009-05-15 16:08:28 -05:00
megamage 03cfacb361 *Fix a crash caused by eventai.
--HG--
branch : trunk
2009-05-15 14:23:05 -05:00
megamage c64c834c50 *Fix build.
--HG--
branch : trunk
2009-05-15 14:10:31 -05:00
megamage ff7f023ff1 *Merge.
--HG--
branch : trunk
2009-05-15 13:57:10 -05:00
megamage e826b482a5 *Skip not needed tc1 patches
--HG--
branch : trunk
2009-05-15 13:53:32 -05:00
megamage 0f3506e90a *Remove not needed TC1 sql.
--HG--
branch : trunk
2009-05-15 13:51:58 -05:00
megamage 9f31ecbdec *Skip all unused TC1 revs.
--HG--
branch : trunk
2009-05-15 13:50:30 -05:00
megamage c15bae5871 [7832] Better check at petcreateinfo_spell loading for errors and redundend data. Author: VladimirMangos
--HG--
branch : trunk
2009-05-15 13:45:34 -05:00
megamage a442a9b914 [7831] Prevent have hunter pet with level greater player levels at level changes. Propertly set hunter pet xp values at level update. Author: VladimirMangos
--HG--
branch : trunk
2009-05-15 13:44:49 -05:00
megamage 0d715cfd8f *remove UNIT_FLAG2_FORCE_MOVE when loading players. This fix the bug that players cannot stop moving forward. By Bulkin.
--HG--
branch : trunk
2009-05-15 13:39:48 -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
X-Savior f1fd3ad040 *Update some spell/script sql data
--HG--
branch : trunk
2009-05-15 19:01:56 +02:00
QAston 02bc76455a *Fix build.
--HG--
branch : trunk
2009-05-15 18:30:34 +02:00
QAston d81352b421 *Allow hots to proc
--HG--
branch : trunk
2009-05-15 16:59:27 +02:00
QAston 4a20e22af3 *Do not proc relentless strikes with slice and dice twice
*Fix trap radius calculation in some cases-by krz

--HG--
branch : trunk
2009-05-15 16:51:26 +02:00
QAston ab195a1031 *Add sqls for latest commit.
--HG--
branch : trunk
2009-05-15 18:09:44 +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
QAston a796012723 *Merge some fixes from tc1
--HG--
branch : trunk
2009-05-15 18:00:50 +02:00
Anubisss ad92f5e210 *Fix Glyph of Ice Block.
*Thanks QAston for the help in the SpellFamilyMask.

--HG--
branch : trunk
2009-05-15 17:58:06 +02:00
Anubisss e6cd40a619 *Implement GetSpellCooldowns() for get m_spellCooldowns(Player's map of spell CDs).
--HG--
branch : trunk
2009-05-15 17:54:10 +02:00
BroodWyrm 7549076a38 *Rewrite Moroes Script to fix reset bug
--HG--
branch : trunk
2009-05-15 16:52:59 +02:00
QAston ae461a4158 *Fix Cheat Death.
--HG--
branch : trunk
2009-05-15 15:33:23 +02:00
Genars & Aokromes 854e791c2f New server options to block adding GMs to friends by players and to block inviting GMs to parties
--HG--
branch : trunk
2009-05-14 23:07:17 +02:00
megamage 662dbb9744 *Fix a typo that cause crash. Thanks to Drahy.
--HG--
branch : trunk
2009-05-14 20:02:10 -05:00
megamage c50e1fc4b6 *Merge.
--HG--
branch : trunk
2009-05-14 16:52:01 -05:00
megamage 047cc95388 *Add some distance check functions. By VladimirMangos.
--HG--
branch : trunk
2009-05-14 16:50:47 -05:00
Drahy baa7545346 * Finally updated world_spell_full (contains spell_linked_spell, spell_script_target, spell_required and spell_proc_event)
* Please everyone to add patches also to full sqls in the future

--HG--
branch : trunk
2009-05-14 22:57:47 +02:00
megamage 811eee356d [7825] Fixed typo in comment and var. name. Author: BombermaG
--HG--
branch : trunk
2009-05-14 15:38:20 -05:00
megamage 5823e2c471 [7824] Implement use ArmorDamageModifier bonus for armor Author: DiSlord
--HG--
branch : trunk
2009-05-14 15:37:56 -05:00
megamage 1390440f14 [7823] Fix ScalingStatValue field size in item_template table. Author: DiSlord
--HG--
branch : trunk
2009-05-14 15:37:28 -05:00
megamage 9831dab114 [7822] Avoid declined names form show in case disabled config option with russian client at non-russian realm. Author: Foks
--HG--
branch : trunk
2009-05-14 11:59:15 -05:00
megamage d3839aaaf0 [7821] Fixed typo in comment and var. name. Author: KAPATEJIb
--HG--
branch : trunk
2009-05-14 11:58:35 -05:00
megamage c6407a8b4c [7820] Fixed typo in [7819] that not allow correct work non-scalling item stats. Author: VladimirMangos
--HG--
branch : trunk
2009-05-14 11:58:01 -05:00
megamage 43b84c7b07 Code style and cleanups in item equip checks. Author: VladimirMangos
--HG--
branch : trunk
2009-05-14 11:57:25 -05:00
megamage 8782d2d31a [7819] Correct use item ScalingStatValues data (ScalingStatValues.dbc): Author: DiSlord
- ScalingStatDistribution stats multiplier
     - Armor bonus from ssv
     - Damage from ssv
     - Feral AP from ssv
     - Feral AP from ssv dps bonus
    Use item->StatsCount in apply mods
    Not allow equip item if level > ScalingStatDistribution->maxlevel field

    TODO find more info about ScalingStatValuesEntry->spellBonus

--HG--
branch : trunk
2009-05-14 11:56:51 -05:00
megamage bf82601817 [7818] Implement SPELL_AURA_MOD_FACTION_REPUTATION_GAIN. Author: DonTomika
--HG--
branch : trunk
2009-05-14 11:56:02 -05:00
megamage 657971629c *Merge. Sorry for the mess. But a rev was wrongly backouted so we have to make these two backouts.
--HG--
branch : trunk
2009-05-14 11:47:12 -05:00
megamage 22b082519e Backed out changeset: 7dcbf5239f55
--HG--
branch : trunk
2009-05-14 11:44:27 -05:00
megamage 64bee88f69 *Merge.
--HG--
branch : trunk
2009-05-14 11:41:34 -05:00
megamage 1b52fa4206 Backed out changeset: 5201ecc6b309
--HG--
branch : trunk
2009-05-14 11:40:02 -05:00
raczman 2ed9222ac9 Fixed build on linux.
Tested on Arch linux, still need someone to fixup .vcproj's for windows.

--HG--
branch : trunk
2009-05-14 13:25:35 +02:00
Drahy f45242b798 * Fix compile error
--HG--
branch : trunk
2009-05-14 11:56:15 +02:00
QAston dbceefb4a1 *Merge
--HG--
branch : trunk
2009-05-14 06:38:22 +02:00
QAston 42aa8efe47 Backed out changeset 1f92b07df94a
--HG--
branch : trunk
2009-05-14 06:32:35 +02:00
megamage d1d8177c3f *Merge.
--HG--
branch : trunk
2009-05-13 19:37:00 -05:00
megamage cd25059f60 *Remove a TC1 file.
--HG--
branch : trunk
2009-05-13 19:35:00 -05:00
megamage 22f34d1b74 *Merge.
--HG--
branch : trunk
2009-05-13 19:34:10 -05:00