mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Spell): don't allow to tame an already owned creature (#9005)
This commit is contained in:
@@ -1891,7 +1891,7 @@ public:
|
|||||||
DeathState getDeathState() { return m_deathState; };
|
DeathState getDeathState() { return m_deathState; };
|
||||||
virtual void setDeathState(DeathState s, bool despawn = false); // overwrited in Creature/Player/Pet
|
virtual void setDeathState(DeathState s, bool despawn = false); // overwrited in Creature/Player/Pet
|
||||||
|
|
||||||
[[nodiscard]] ObjectGuid GetOwnerGUID() const { return GetGuidValue(UNIT_FIELD_SUMMONEDBY); }
|
[[nodiscard]] ObjectGuid GetOwnerGUID() const { return GetGuidValue(UNIT_FIELD_SUMMONEDBY); }
|
||||||
void SetOwnerGUID(ObjectGuid owner);
|
void SetOwnerGUID(ObjectGuid owner);
|
||||||
[[nodiscard]] ObjectGuid GetCreatorGUID() const { return GetGuidValue(UNIT_FIELD_CREATEDBY); }
|
[[nodiscard]] ObjectGuid GetCreatorGUID() const { return GetGuidValue(UNIT_FIELD_CREATEDBY); }
|
||||||
void SetCreatorGUID(ObjectGuid creator) { SetGuidValue(UNIT_FIELD_CREATEDBY, creator); }
|
void SetCreatorGUID(ObjectGuid creator) { SetGuidValue(UNIT_FIELD_CREATEDBY, creator); }
|
||||||
|
|||||||
@@ -946,6 +946,12 @@ class spell_hun_tame_beast : public SpellScript
|
|||||||
player->SendTameFailure(PET_TAME_ANOTHER_SUMMON_ACTIVE);
|
player->SendTameFailure(PET_TAME_ANOTHER_SUMMON_ACTIVE);
|
||||||
return SPELL_FAILED_DONT_REPORT;
|
return SPELL_FAILED_DONT_REPORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (target->GetOwnerGUID())
|
||||||
|
{
|
||||||
|
player->SendTameFailure(PET_TAME_CREATURE_ALREADY_OWNED);
|
||||||
|
return SPELL_FAILED_DONT_REPORT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user