Commit Graph
167 Commits
Author SHA1 Message Date
megamage 5ed5513ca8 Mangos [7911]. Author: tomrus88
Very big patch. May cause bugs.

--HG--
branch : trunk
2009-05-31 15:56:51 -05:00
megamage bc32144310 *Update OutdoorPvP functions. No longer need creature triggers for capture points.
--HG--
branch : trunk
2009-05-29 00:18:41 -05:00
megamage 1288761fb7 [7905] Implement ACTION_T_SET_SHEATH for creature event ai make possibility set ranged fire state. Author: VladimirMangos
Also related cleanup code in field cases and player Player::SetSheath.

--HG--
branch : trunk
2009-05-28 18:43:57 -05:00
megamage 73d31e2552 [7898] Improve client error output at different mail send errors, cleanup code. Author: VladimirMangos
--HG--
branch : trunk
2009-05-27 16:38:50 -05:00
megamage cb72853dc6 *Cleanup message deliver functions. Remove unused parameters.
--HG--
branch : trunk
2009-05-27 09:09:22 -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 2fadf3dd77 Fixed bank bag slot amount achievement statistic. Cleanup related code. Author: VladimirMangos
--HG--
branch : trunk
2009-05-24 11:17:03 -05:00
megamage 3641be039b *Set pvp flags for units controlled by player.
*Reset pvp flags when unit is uncharmed.
*Remove walk flag when unit is charmed.

--HG--
branch : trunk
2009-05-22 03:12:35 -05:00
QAston 1403419164 *Fix reckonging
*fix Sword and Board
*Fix Vigilance
*Rollback sw:death fix.

--HG--
branch : trunk
2009-05-21 20:02:22 +02: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
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
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
megamage bf82601817 [7818] Implement SPELL_AURA_MOD_FACTION_REPUTATION_GAIN. Author: DonTomika
--HG--
branch : trunk
2009-05-14 11:56:02 -05:00
megamage ff3332f066 [7809] Replace repeating "remove cooldown and send update to client" code by function call. Author: VladimirMangos
--HG--
branch : trunk
2009-05-10 14:51:51 -05:00
megamage 29921b5bea [7798] More Player::ActivateTaxiPathTo use improvements Author: VladimirMangos
* Provide more explicit way about spell that cast taxi flight if any
    * Remove incorrect states instead error reporting in case non-taximaster flight start (cast/script)
    * Remove mount_id arg from ActivateTaxiPathTo and implement support for 0 mount_id case (spell 32474)
    * Implement spell 32474 (except finilize part)
    * Provided Player::ActivateTaxiPathTo(uint32 taxi_path_id) function version for simplify one node to node paths use by id.

--HG--
branch : trunk
2009-05-08 18:52:12 -05:00
megamage e69d2cbed9 [7776] Completed implementation of CMSG_SPELLCLICK Author: arrai
For vehicles, you have to add the correct SPELL_AURA_CONTROL_VEHICLE spells to
    npc_spellclick_spells, otherwise you won't be able to use them

--HG--
branch : trunk
2009-05-05 16:56:15 -05:00
megamage a04c9bfe00 [7772] Implement ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED Author: DonTomika
--HG--
branch : trunk
2009-05-05 14:48:48 -05:00
megamage 30ac988ad3 *Fix build.
--HG--
branch : trunk
2009-05-03 22:33:41 -05:00
megamage 85fbe3ada2 [7740] More correct flags in trainer list data for profession ranks. Author: VladimirMangos
Note: this is not fix problem with gren show recently learned non-first rank of primary profession.

    Thanks to Seizerkiller for help in reseach.

--HG--
branch : trunk
2009-05-01 01:33:08 -05:00
megamage 4b4f472357 [7737] Implement ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE. Author: Trazom
Zone dependent achievement criteria required DB support.

--HG--
branch : trunk
2009-04-29 18:42:53 -05:00
megamage de11b9e901 [7730] Some optimizantion and code style. Author: zhenya
--HG--
branch : trunk
2009-04-29 00:26:07 -05:00
megamage bd4c2bdb64 [7728] Use correct loot_type values in data sent to client instead long time existed hacks. Code cleanups. Author: VladimirMangos
Thanks to Seizerkiller and TOM_RUS for help in reseach.

--HG--
branch : trunk
2009-04-27 21:29:01 -05:00
QAston 2d1521dea9 *Fix CAST_INTURRUPT_PREVIOUS flag for eventai action cast
*Rewrite .reload all pet_spells command to make it reset actionbars correctly.

--HG--
branch : trunk
2009-04-26 02:48:20 +02:00
QAston 066af701d3 *Fix frenzy and Ferocious Inspiration proc.
*Add command .reset all pet_spells - use it if you still have problems with pet talents after recent revs changes (like pets with all talents for example)

--HG--
branch : trunk
2009-04-23 20:57:17 +02:00
megamage 3a316370b1 [7696] Fixed compile warnings Author: AlexDereka
--HG--
branch : trunk
2009-04-22 17:56:59 -05:00
megamage 06667c40dd *Fix some bugs about vehicle.
--HG--
branch : trunk
2009-04-21 15:43:03 -05:00
megamage f9befe1d3d [7688] Move Get*IfCanInteractWith to Player including renamed IsGameObjectOfTypeInRange. Author: VladimirMangos
--HG--
branch : trunk
2009-04-19 18:23:10 -05:00
megamage c7d78b5ff9 *Some work on vehicles.
--HG--
branch : trunk
2009-04-17 15:08:58 -05:00
megamage 0010f7ffe3 [7648] Resolve problems with expected fall damage at near teleport. Author: VladimirMangos
Move near teleport landing code to WorldSession::HandleMoveTeleportAck.
    This make Player::TeleportTo code working in same way for both far/near teleports.
    Move mSemaphoreTeleport from WorldObject to Player and merge with DoNotMove (using 2 fields for far/near teleport flag).
    Skip movement packets until landing confirmation for near teleport from client.

--HG--
branch : trunk
2009-04-11 23:07:07 -05:00
megamage 3120221deb *Note: this patch may do not have any use for TC.
[7645] Fixed problems wit temporary unsummoned pets and cleanup code. Author: VladimirMangos

    * Save temporary unsummoned pet to current slot (instead non_in_slot mode) and
      prevent save as current pet summoned while temporay unsummon (arena)
    * Prevent overwrite temporary summoned pet data
    * At player loading set temporary unsummoned pet data instead pet loading
      if pet expected to be temporary unsummoned in current player state (loading in taxi flight/etc)
    * Restore proper pet at arena leave and unsummon in arena summoned.

--HG--
branch : trunk
2009-04-11 14:47:38 -05:00
XTZGZoReX 2fe9fed7c7 * Tabs to spaces -- using: perl -p -i -e "s/\t/ /g" *
--HG--
branch : trunk
2009-04-07 10:51:45 +02:00
megamage 5acc0c057b [7612] Move SMSG_TRIGGER_CINEMATIC and SMSG_TRIGGER_MOVIE to functions and use its instead explicit packet creating. Author: NoFantasy
--HG--
branch : trunk
2009-04-05 16:25:00 -05:00
QAston 20c02ef760 *Update of aura system.
--HG--
branch : trunk
2009-04-06 13:31:14 +02:00
megamage 1299521d50 [7559] Implement function Player::RewardPlayerAndGroupAtEvent for reward (quest objective only) player and group at special kill-like events. Author: Ramses_II
Use it for Spell::EffectKillCredit and some dummy code.

--HG--
branch : trunk
2009-03-28 16:26:31 -06:00
megamage ff83e4a9b1 *Fix some bugs of pet.
--HG--
branch : trunk
2009-03-27 22:47:28 -06:00
megamage 68c3039715 *Move most reputation/force faction reaction code to new ReputationMgr. Author: VladimirMangos
--HG--
branch : trunk
2009-03-26 13:53:32 -06:00
megamage 02440eaa10 [7538] Hide some implementation details for reputation/forced faction reaction. Author: VladimirMangos
--HG--
branch : trunk
2009-03-25 16:04:08 -06:00
megamage 1c6c199f5d [7533] Redirect movement packet in proper way to controlled target. Author: VladimirMangos
* In creature case ignore fall/etc damage
    * In player case apply fall damage/etc to controlled player, apply other movement effect to it also.

--HG--
branch : trunk
2009-03-24 17:42:22 -06:00
megamage c5969d6d03 *Make sure the a player can only have one viewpoint.
--HG--
branch : trunk
2009-03-24 13:13:00 -06:00
megamage 208398017a [7529] Hide some implementation details for fall damage calculation and breath timers. Author: VladimirMangos
--HG--
branch : trunk
2009-03-24 09:46:45 -06:00
megamage ba1fd0db90 [7527] Remove redundent arg from Player::EnvironmentalDamage Author: VladimirMangos
--HG--
branch : trunk
2009-03-24 09:44:08 -06:00
megamage 7d9a71a6cf [7523] Fixed: players will now drop flag in battleground if they cast immunity buff on themselves. Author: `win
TODO: players who carry flag in bg are imune to immunity buffs casted by friendly players. (todo added to code).
    Bug: if paladin casts Hand of protection on flag carrier - flag will be dropped, but he should get "target is immune" message.
    Fixed: Do not call Battleground::Update for battleground template objects.
    Fixed: Do not allow immune player to click on object in battleground (not sure if this is correct in all cases).

--HG--
branch : trunk
2009-03-24 09:36:50 -06:00
megamage a47d2e1c22 *Note some script id are changed. DB change may be needed.
[7518] Implement new script command SCRIPT_COMMAND_PLAY_SOUND (look in World.h for args) Author: VladimirMangos

    * Also rewrite use SMSG_PLAY_OBJECT_SOUND/SMSG_PLAY_SOUND
      Now WorldObject have 2 function for sound level dependent from distance (PlayDistanceSound)
      and for not depednet (PlayDirectSound)
    * Old Player::PlaySound function removed and uses need to be updated to WorldObject functions
      Note: function called for _source_ of sound in different from old function.
    * chat command .debug ps removed and .debug playsound can used for bother packects test:
      if no selection used SMSG_PLAY_SOUND, if selection exist including self then SMSG_PLAY_OBJECT_SOUND.

--HG--
branch : trunk
2009-03-22 19:20:03 -06:00
megamage b522a34247 [7513] Implement currencies tab work. Also check related item data at server startup. Author: VladimirMangos
--HG--
branch : trunk
2009-03-21 22:44:59 -06:00
megamage 738e139882 [7510] Some cleanups and commens for special forbidden slots Author: VladimirMangos
--HG--
branch : trunk
2009-03-21 14:55:52 -06:00
megamage 7de6113d90 [7509] Use defines instead explcit value for talent rank cound (in general and for pets) Author: VladimirMangos
--HG--
branch : trunk
2009-03-21 14:55:10 -06:00
megamage de849cc508 Small code cleanup and partial merge with dev branch Author: tomrus88
--HG--
branch : trunk
2009-03-21 14:53:38 -06:00
megamage a84e757793 *Update summon system. Show pet bar for guardians. Allow multiple charms/guardians.
--HG--
branch : trunk
2009-03-21 09:48:44 -06:00
megamage 8f627853df *More work on summon system.
--HG--
branch : trunk
2009-03-20 14:01:46 -06:00
megamage a2392121f0 *Fix the bug that summon dbc is not read. Now creatures can be summoned.
*Make minipet as tempsummon instead of pet. Make totem as tempsummon.

--HG--
branch : trunk
2009-03-19 14:41:30 -06:00