Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Warrior][Talent] Titan's Grip - Damage Reduction #6375

Closed
telsamat opened this issue Apr 28, 2012 · 24 comments
Closed

[Warrior][Talent] Titan's Grip - Damage Reduction #6375

telsamat opened this issue Apr 28, 2012 · 24 comments

Comments

@telsamat
Copy link

rev.: b53485e
tdb 46

wiki says: Patch 3.1.0 (2009-04-14): 10% damage decrease

Reduction part of this talent does not work anymore.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Expecto
Copy link

Expecto commented Apr 28, 2012

confirm

@Vincent-Michael
Copy link
Contributor

source: Mangos

Fix try:

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index b9e2b49..e26bdf9 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -4225,7 +4225,11 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
     }

     if (spell_id == 46917 && m_canTitanGrip)
+    {
         SetCanTitanGrip(false);
+        // Remove Titan's Grip damage penalty now
+        RemoveAurasDueToSpell(49152);
+    }
     if (spell_id == 674 && m_canDualWield)
         SetCanDualWield(false);

@@ -12717,6 +12721,9 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)

         return pItem2;
     }
+    // Apply Titan's Grip damage penalty if necessary
+    if ((slot == EQUIPMENT_SLOT_MAINHAND || slot == EQUIPMENT_SLOT_OFFHAND) && CanTitanGrip() && HasTwoHandWeaponInOneHand() && !HasAura(49152))
+        CastSpell(this, 49152, true);

     // only for full equip instead adding to stack
     GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
@@ -12741,6 +12748,9 @@ void Player::QuickEquipItem(uint16 pos, Item* pItem)
             pItem->AddToWorld();
             pItem->SendUpdateToPlayer(this);
         }
+        // Apply Titan's Grip damage penalty if necessary
+        if ((slot == EQUIPMENT_SLOT_MAINHAND || slot == EQUIPMENT_SLOT_OFFHAND) && CanTitanGrip() && HasTwoHandWeaponInOneHand() && !HasAura(49152))
+            CastSpell(this, 49152, true);

         GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
         GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot);
@@ -12854,7 +12864,12 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
             SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), 0);

             if (slot < EQUIPMENT_SLOT_END)
+            {
                 SetVisibleItemSlot(slot, NULL);
+                // Remove Titan's Grip damage penalty if necessary
+                if ((slot == EQUIPMENT_SLOT_MAINHAND || slot == EQUIPMENT_SLOT_OFFHAND) && CanTitanGrip() && !HasTwoHandWeaponInOneHand())
+                    RemoveAurasDueToSpell(49152);
+            }
         }
         else if (Bag* pBag = GetBagByPos(bag))
             pBag->RemoveItem(slot, update);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 5556130..490dfb3 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1363,6 +1363,12 @@ class Player : public Unit, public GridObject<Player>
             Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
             return mainItem && mainItem->GetTemplate()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
         }
+        bool HasTwoHandWeaponInOneHand() const
+        {
+            Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
+            Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
+            return offItem && ((mainItem && mainItem->GetTemplate()->InventoryType == INVTYPE_2HWEAPON) || offItem->GetTemplate()->InventoryType == INVTYPE_2HWEAPON);
+        }
         void SendNewItem(Item* item, uint32 count, bool received, bool created, bool broadcast = false);
         bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
         bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index c59c978..bb39d6c 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -6431,8 +6431,12 @@ void Spell::EffectTitanGrip(SpellEffIndex /*effIndex*/)
     if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
         return;

-    if (m_caster->GetTypeId() == TYPEID_PLAYER)
-        m_caster->ToPlayer()->SetCanTitanGrip(true);
+    if (Player* player = (Player*)m_caster)
+    {
+        player->SetCanTitanGrip(true);
+        if (player->HasTwoHandWeaponInOneHand() && !player->HasAura(49152))
+            player->CastSpell(player, 49152, true);
+    }
 }

 void Spell::EffectRedirectThreat(SpellEffIndex /*effIndex*/)

@Sethi
Copy link

Sethi commented Apr 29, 2012

Titan's Grip is not bugged while equipping 2 weapons, only while equipping one weapon.
When equipping two 2H-weapons, physical damage IS reduced by 10%.

The real bug is actually a display bug. If you try with this patch , you have a penality of 20% while equipping two 2H-weapons.

@telsamat
Copy link
Author

no it is not, you can try test your damage and calculate it, now with 2h weapons you have no penalty

@Xanvial
Copy link
Contributor

Xanvial commented Apr 29, 2012

that patch check if player already has aura 49152 (titan grip penalty aura) before cast it
so i think you won't have 20% penalty

@Vincent-Michael
Copy link
Contributor

try with .list aura command^^

@ghost ghost assigned Vincent-Michael Sep 6, 2012
@Lat89
Copy link

Lat89 commented Oct 13, 2012

Damage reduction part still doesnt work. Should someone try implementing Vincent's fix?
Core up to 7918ac0

@garyfisher
Copy link

Confirm

Rev: 27f0918

TDB: TDB 335.49+

@Lat89
Copy link

Lat89 commented Nov 12, 2012

Still bugged. When anyone has the time, please look at Vincent's patch fix or tell us why it hasnt been implemented yet.

@TBEGAMER
Copy link

Confirming on
Core revision: Trinity Core 4dffccb+
Database revision: TDB 335.49

@Poli93
Copy link

Poli93 commented Dec 2, 2012

Still bugged, any progress?

@Fateswhisper
Copy link

@Vincent-Michael, patch works for me!

@digz6666
Copy link

digz6666 commented Jun 9, 2014

Confirmed!

@D4R4
Copy link
Contributor

D4R4 commented Mar 12, 2015

Is this still considered a valid issue? I can't find the aura 49152 on my toon when dual-wielding two-hand weps atm with Titan's Grip

alot of people say it is working as intended and the 10% IS indeed getting reduced but i don't see the spell or any piece of code in the source handling the effect,

@Killyana
Copy link
Member

Still not fixed on rev. 5b5c093
If you .aura 49152 you will see on your stats "damage" will turn red with x90% instead of 100%

@robinsch
Copy link
Contributor

robinsch commented Jul 7, 2015

Do some testing first, if this is really not working as it should I can check and fix it.

@Keader
Copy link
Member

Keader commented Sep 27, 2015

Fix by: @Vincent-Michael work here.

@Keader
Copy link
Member

Keader commented Jan 2, 2016

Hey @Vincent-Michael Divine Intervetion (spell id: 19752) of Paladins, remove reduction.

@Aokromes
Copy link
Member

If anything here is valid plz open a PR for it.

@Aokromes
Copy link
Member

Aokromes commented Jul 9, 2016

@Vincent-Michael can you merge this?

@Keader
Copy link
Member

Keader commented Jul 9, 2016

I'm using Vincent-Michael fix, and works fine
But need a spellmgrfix:

case 49152: //Titan's Grip
     spellInfo->Attributes |= SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY;
     break;

will fix this exploit: #6375 (comment)

@robinsch
Copy link
Contributor

robinsch commented Jul 9, 2016

Same for other immunity effects, such as Hand of Protection

@joschiwald
Copy link
Contributor

joschiwald commented Jul 9, 2016

how is this possible? titan's grip has SPELL_ATTR0_PASSIVE

@Poli93
Copy link

Poli93 commented Oct 1, 2016

Is there any progress with this spell? It's literally been three years. Don't misunderstand me I do not complain but I'm confused, I see a lot of inputs and someone even suggested a possible fix.

ariel- added a commit that referenced this issue Oct 2, 2016
Aokromes pushed a commit to Aokromes/TrinityCore that referenced this issue Oct 3, 2016
joschiwald pushed a commit that referenced this issue Mar 4, 2017
Closes #6375

(cherry picked from commit a4baef1)

Core/Player: unconditionally remove Titan's grip penalty aura on Spell removal

Was causing an issue when switching spec, because off hand weapon was still equipped
(cherry picked from commit df0f88e)
joschiwald pushed a commit that referenced this issue Mar 4, 2017
…e auras (even if negative)

Ref issue #6375

(cherry picked from commit b2fbd2c)
conan513 pushed a commit to conan513/SingleCore_TC that referenced this issue Mar 13, 2017
Closes TrinityCore#6375

(cherry picked from commit a4baef1)

Core/Player: unconditionally remove Titan's grip penalty aura on Spell removal

Was causing an issue when switching spec, because off hand weapon was still equipped
(cherry picked from commit df0f88e)
conan513 pushed a commit to conan513/SingleCore_TC that referenced this issue Mar 13, 2017
…e auras (even if negative)

Ref issue TrinityCore#6375

(cherry picked from commit b2fbd2c)
conan513 pushed a commit to conan513/SingleCore_TC that referenced this issue Apr 16, 2017
conan513 pushed a commit to conan513/SingleCore_TC that referenced this issue Apr 16, 2017
Krudor pushed a commit to Krudor/TrinityCore that referenced this issue Jul 13, 2017
Closes TrinityCore#6375

(cherry picked from commit a4baef1)

Core/Player: unconditionally remove Titan's grip penalty aura on Spell removal

Was causing an issue when switching spec, because off hand weapon was still equipped
(cherry picked from commit df0f88e)
Krudor pushed a commit to Krudor/TrinityCore that referenced this issue Jul 13, 2017
…e auras (even if negative)

Ref issue TrinityCore#6375

(cherry picked from commit b2fbd2c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests