fix(Core/Spells): Remove all hardcoded restrictions for pick pocket sp… (#14788)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Skjalf
2023-01-29 12:12:21 -03:00
committed by GitHub
parent b3d4d36398
commit 2aeeee9c83
7 changed files with 34 additions and 14 deletions

View File

@@ -19,6 +19,7 @@
#include "Chat.h"
#include "ConditionMgr.h"
#include "DBCStores.h"
#include "LootMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "Spell.h"
@@ -1777,11 +1778,13 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
if (targetCreature->hasLootRecipient() && !targetCreature->isTappedBy(caster->ToPlayer()))
return SPELL_FAILED_CANT_CAST_ON_TAPPED;
if (AttributesCu & SPELL_ATTR0_CU_PICKPOCKET)
if (HasAttribute(SPELL_ATTR0_CU_PICKPOCKET))
{
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
Creature const* targetCreature = unitTarget->ToCreature();
if (!targetCreature)
return SPELL_FAILED_BAD_TARGETS;
else if ((unitTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0)
if (!LootTemplates_Pickpocketing.HaveLootFor(targetCreature->GetCreatureTemplate()->pickpocketLootId))
return SPELL_FAILED_TARGET_NO_POCKETS;
}