diff options
| author | Shauren <shauren.trinity@gmail.com> | 2022-09-11 14:13:10 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-09-11 14:13:10 +0200 |
| commit | 78698463ff6b20255148fb647e9ad33a487bb09d (patch) | |
| tree | 3140019ebcee5c7d9e4e80f40c5689ff5d4c791c /src/server/game/Spells/SpellInfo.cpp | |
| parent | 2556d6d705c519fd461b9d9f10a4387d9beb199e (diff) | |
Core/Spells: Remove all hardcoded restrictions for pick pocket spell effect and rely only on presence of pickpocket loot in db
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index b8802af30ab..a1c84545a6a 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -25,6 +25,7 @@ #include "Item.h" #include "ItemTemplate.h" #include "Log.h" +#include "LootMgr.h" #include "Map.h" #include "ObjectAccessor.h" #include "Pet.h" @@ -2132,10 +2133,12 @@ SpellCastResult SpellInfo::CheckTarget(WorldObject const* caster, WorldObject co if (HasAttribute(SPELL_ATTR0_CU_PICKPOCKET)) { - if (unitTarget->GetTypeId() == TYPEID_PLAYER) - return SPELL_FAILED_BAD_TARGETS; - else if ((unitTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0) - return SPELL_FAILED_TARGET_NO_POCKETS; + Creature const* targetCreature = unitTarget->ToCreature(); + if (!targetCreature) + return SPELL_FAILED_BAD_TARGETS; + + if (!LootTemplates_Pickpocketing.HaveLootFor(targetCreature->GetCreatureTemplate()->pickpocketLootId)) + return SPELL_FAILED_TARGET_NO_POCKETS; } // Not allow disarm unarmed player |
