Trinitycore: [3.3.5] - Unequip Items with spell effect

Created on 25 Sep 2017  路  6Comments  路  Source: TrinityCore/TrinityCore

Description:

When you unequip a item with spell effect you should lost the spell effect (like Trinkets).
By example equip Shadowmourne (weapon) get the aura and switch weapon, the aura still

It is not directly related to: #11644

Expected behaviour:

You should lost the aura when unequip the item

Steps to reproduce the problem:

  1. Equip a item with spell effect, by example Shadowmourne
  2. Get the aura of item
  3. Switch or unequip the item

Branch(es): 3.3.5

TC rev. hash/commit: 4d654f548b29bf61552d9f90da8254ecea91b63e

TDB version: TDB335.63

Operating system: Debian

Branch-3.3.5a Comp-Core Feedback-PatchFix Sub-Exploit Sub-Spells

Most helpful comment

Yeap, same in Val'anyr, paladins libram, dk's sigil, etc

All 6 comments

Yeap, same in Val'anyr, paladins libram, dk's sigil, etc

My old fix for these, i think it still works, as long as the spell is not cast by scripts, in that case, the item script should handle the remove by itself;
```diff
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index ffb5350..6ea43a6 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -4117,6 +4117,11 @@ void Unit::RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid)
{
if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid)
{

  • if (SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo())
  • for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
  • if (uint32 triggeredSpellId = spellInfo->Effects[i].TriggerSpell)
  • RemoveAurasDueToSpell(triggeredSpellId);
    +
    RemoveAura(iter);
    iter = m_appliedAuras.lower_bound(spellId);
    }

@sirikfoll seems works fine ;)

Only a doubt, Shadowmourne spell have a SpellScript:
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/Spells/spell_item.cpp#L1619

What should be done in this case?
By example, add in script onremove should remove aura??

@sirikfoll make pr or merge xd

I'm not sure about this PR, item spells already have proc cooldown implemented on equip (meaning you can't gain anything by switching weapons/librams while in combat)

yes you can ariel-
try librams xd

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DDuarte picture DDuarte  路  3Comments

Keader picture Keader  路  3Comments

ZenoX92 picture ZenoX92  路  3Comments

Rushor picture Rushor  路  3Comments

tje3d picture tje3d  路  3Comments