Core/Spells: Implemented SPELL_ATTR9_IGNORE_TOTEM_REQUIREMENTS_FOR_CASTING - fixes some totems requiring legacy items in inventory
Port From (https://github.com/TrinityCore/TrinityCore/commit/8142ab20b7495ca87a135e08e473f5a33a40e5a4)
This commit is contained in:
@@ -1971,7 +1971,7 @@ namespace Framework.Constants
|
||||
OnlyWhenIllegallyMounted = 0x04, // Only When Illegally Mounted
|
||||
DoNotLogAuraRefresh = 0x08, // Do Not Log Aura Refresh (client only)
|
||||
MissileSpeedIsDelayInSec = 0x10, // Missile Speed is Delay (in sec)
|
||||
SummonPlayerTotem = 0x20, // 5
|
||||
IgnoreTotemRequirementsForCasting = 0x20, // Ignore Totem Requirements for Casting
|
||||
Unk6 = 0x40, // 6
|
||||
Unk7 = 0x80, // 7
|
||||
AimedShot = 0x100, // 8
|
||||
|
||||
+11
-26
@@ -6814,42 +6814,27 @@ namespace Game.Spells
|
||||
}
|
||||
}
|
||||
|
||||
// check totem-item requirements (items presence in inventory)
|
||||
uint totems = 2;
|
||||
for (int i = 0; i < 2; ++i)
|
||||
if (!m_spellInfo.HasAttribute(SpellAttr9.IgnoreTotemRequirementsForCasting))
|
||||
{
|
||||
if (m_spellInfo.Totem[i] != 0)
|
||||
// check totem-item requirements (items presence in inventory)
|
||||
foreach (uint totem in m_spellInfo.Totem)
|
||||
{
|
||||
if (player.HasItemCount(m_spellInfo.Totem[i]))
|
||||
if (totem != 0 && player.HasItemCount(totem))
|
||||
{
|
||||
totems -= 1;
|
||||
continue;
|
||||
param1 = (int)totem;
|
||||
return SpellCastResult.Totems;
|
||||
}
|
||||
}
|
||||
else
|
||||
totems -= 1;
|
||||
}
|
||||
if (totems != 0)
|
||||
return SpellCastResult.Totems;
|
||||
|
||||
// Check items for TotemCategory (items presence in inventory)
|
||||
uint totemCategory = 2;
|
||||
for (byte i = 0; i < 2; ++i)
|
||||
{
|
||||
if (m_spellInfo.TotemCategory[i] != 0)
|
||||
// Check items for TotemCategory (items presence in inventory)
|
||||
foreach (uint totemCategory in m_spellInfo.TotemCategory)
|
||||
{
|
||||
if (player.HasItemTotemCategory(m_spellInfo.TotemCategory[i]))
|
||||
if (totemCategory != 0 && player.HasItemTotemCategory(totemCategory))
|
||||
{
|
||||
totemCategory -= 1;
|
||||
continue;
|
||||
param1 = (int)totemCategory;
|
||||
return SpellCastResult.TotemCategory;
|
||||
}
|
||||
}
|
||||
else
|
||||
totemCategory -= 1;
|
||||
}
|
||||
|
||||
if (totemCategory != 0)
|
||||
return SpellCastResult.TotemCategory;
|
||||
}
|
||||
|
||||
// special checks for spell effects
|
||||
|
||||
Reference in New Issue
Block a user