mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[10122] Avoid use EquippedItemInventoryTypeMask mask for not item targeted spells check.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
4024a1c50c
commit
15390df4d9
4 changed files with 31 additions and 27 deletions
|
|
@ -399,6 +399,32 @@ enum SummonPropFlags
|
||||||
SUMMON_PROP_FLAG_UNK14 = 0x2000, // 2 spells in 3.0.3, escort?
|
SUMMON_PROP_FLAG_UNK14 = 0x2000, // 2 spells in 3.0.3, escort?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// SpellEntry::Targets
|
||||||
|
enum SpellCastTargetFlags
|
||||||
|
{
|
||||||
|
TARGET_FLAG_SELF = 0x00000000,
|
||||||
|
TARGET_FLAG_UNUSED1 = 0x00000001, // not used in any spells as of 3.0.3 (can be set dynamically)
|
||||||
|
TARGET_FLAG_UNIT = 0x00000002, // pguid
|
||||||
|
TARGET_FLAG_UNUSED2 = 0x00000004, // not used in any spells as of 3.0.3 (can be set dynamically)
|
||||||
|
TARGET_FLAG_UNUSED3 = 0x00000008, // not used in any spells as of 3.0.3 (can be set dynamically)
|
||||||
|
TARGET_FLAG_ITEM = 0x00000010, // pguid
|
||||||
|
TARGET_FLAG_SOURCE_LOCATION = 0x00000020, // 3 float
|
||||||
|
TARGET_FLAG_DEST_LOCATION = 0x00000040, // 3 float
|
||||||
|
TARGET_FLAG_OBJECT_UNK = 0x00000080, // used in 7 spells only
|
||||||
|
TARGET_FLAG_UNIT_UNK = 0x00000100, // looks like self target (480 spells)
|
||||||
|
TARGET_FLAG_PVP_CORPSE = 0x00000200, // pguid
|
||||||
|
TARGET_FLAG_UNIT_CORPSE = 0x00000400, // 10 spells (gathering professions)
|
||||||
|
TARGET_FLAG_OBJECT = 0x00000800, // pguid, 2 spells
|
||||||
|
TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid, 0 spells
|
||||||
|
TARGET_FLAG_STRING = 0x00002000, // string, 0 spells
|
||||||
|
TARGET_FLAG_UNK1 = 0x00004000, // 199 spells, opening object/lock
|
||||||
|
TARGET_FLAG_CORPSE = 0x00008000, // pguid, resurrection spells
|
||||||
|
TARGET_FLAG_UNK2 = 0x00010000, // pguid, not used in any spells as of 3.0.3 (can be set dynamically)
|
||||||
|
TARGET_FLAG_GLYPH = 0x00020000, // used in glyph spells
|
||||||
|
TARGET_FLAG_UNK3 = 0x00040000, //
|
||||||
|
TARGET_FLAG_UNK4 = 0x00080000 // uint32, loop { vec3, guid -> if guid == 0 break }
|
||||||
|
};
|
||||||
|
|
||||||
enum SpellEffectIndex
|
enum SpellEffectIndex
|
||||||
{
|
{
|
||||||
EFFECT_INDEX_0 = 0,
|
EFFECT_INDEX_0 = 0,
|
||||||
|
|
|
||||||
|
|
@ -770,7 +770,10 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
|
// Only check for item enchantments (TARGET_FLAG_ITEM), all other spells are either NPC spells
|
||||||
|
// or spells where slot requirements are already handled with AttributesEx3 fields
|
||||||
|
// and special code (Titan's Grip, Windfury Attack). Check clearly not applicable for Lava Lash.
|
||||||
|
if(spellInfo->EquippedItemInventoryTypeMask != 0 && (spellInfo->Targets & TARGET_FLAG_ITEM)) // 0 == any inventory type
|
||||||
{
|
{
|
||||||
if((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
|
if((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
|
||||||
return false; // inventory type not present in mask
|
return false; // inventory type not present in mask
|
||||||
|
|
|
||||||
|
|
@ -35,31 +35,6 @@ class GameObject;
|
||||||
class Group;
|
class Group;
|
||||||
class Aura;
|
class Aura;
|
||||||
|
|
||||||
enum SpellCastTargetFlags
|
|
||||||
{
|
|
||||||
TARGET_FLAG_SELF = 0x00000000,
|
|
||||||
TARGET_FLAG_UNUSED1 = 0x00000001, // not used in any spells as of 3.0.3 (can be set dynamically)
|
|
||||||
TARGET_FLAG_UNIT = 0x00000002, // pguid
|
|
||||||
TARGET_FLAG_UNUSED2 = 0x00000004, // not used in any spells as of 3.0.3 (can be set dynamically)
|
|
||||||
TARGET_FLAG_UNUSED3 = 0x00000008, // not used in any spells as of 3.0.3 (can be set dynamically)
|
|
||||||
TARGET_FLAG_ITEM = 0x00000010, // pguid
|
|
||||||
TARGET_FLAG_SOURCE_LOCATION = 0x00000020, // 3 float
|
|
||||||
TARGET_FLAG_DEST_LOCATION = 0x00000040, // 3 float
|
|
||||||
TARGET_FLAG_OBJECT_UNK = 0x00000080, // used in 7 spells only
|
|
||||||
TARGET_FLAG_UNIT_UNK = 0x00000100, // looks like self target (480 spells)
|
|
||||||
TARGET_FLAG_PVP_CORPSE = 0x00000200, // pguid
|
|
||||||
TARGET_FLAG_UNIT_CORPSE = 0x00000400, // 10 spells (gathering professions)
|
|
||||||
TARGET_FLAG_OBJECT = 0x00000800, // pguid, 2 spells
|
|
||||||
TARGET_FLAG_TRADE_ITEM = 0x00001000, // pguid, 0 spells
|
|
||||||
TARGET_FLAG_STRING = 0x00002000, // string, 0 spells
|
|
||||||
TARGET_FLAG_UNK1 = 0x00004000, // 199 spells, opening object/lock
|
|
||||||
TARGET_FLAG_CORPSE = 0x00008000, // pguid, resurrection spells
|
|
||||||
TARGET_FLAG_UNK2 = 0x00010000, // pguid, not used in any spells as of 3.0.3 (can be set dynamically)
|
|
||||||
TARGET_FLAG_GLYPH = 0x00020000, // used in glyph spells
|
|
||||||
TARGET_FLAG_UNK3 = 0x00040000, //
|
|
||||||
TARGET_FLAG_UNK4 = 0x00080000 // uint32, loop { vec3, guid -> if guid == 0 break }
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SpellCastFlags
|
enum SpellCastFlags
|
||||||
{
|
{
|
||||||
CAST_FLAG_NONE = 0x00000000,
|
CAST_FLAG_NONE = 0x00000000,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10121"
|
#define REVISION_NR "10122"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue