mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
refactor(Scripts/Pets): Move Mojo to SAI (#9662)
This commit is contained in:
@@ -30,56 +30,6 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Mojo
|
||||
{
|
||||
SAY_MOJO = 0,
|
||||
|
||||
SPELL_FEELING_FROGGY = 43906,
|
||||
SPELL_SEDUCTION_VISUAL = 43919
|
||||
};
|
||||
|
||||
struct npc_pet_gen_mojo : public ScriptedAI
|
||||
{
|
||||
npc_pet_gen_mojo(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_victimGUID.Clear();
|
||||
|
||||
if (Unit* owner = me->GetOwner())
|
||||
me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
void UpdateAI(uint32 /*diff*/) override { }
|
||||
|
||||
void ReceiveEmote(Player* player, uint32 emote) override
|
||||
{
|
||||
me->HandleEmoteCommand(emote);
|
||||
Unit* owner = me->GetOwner();
|
||||
if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER ||
|
||||
owner->ToPlayer()->GetTeamId(true) != player->GetTeamId(true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Talk(SAY_MOJO, player);
|
||||
|
||||
if (_victimGUID)
|
||||
if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID))
|
||||
victim->RemoveAura(SPELL_FEELING_FROGGY);
|
||||
|
||||
_victimGUID = player->GetGUID();
|
||||
|
||||
DoCast(player, SPELL_FEELING_FROGGY, true);
|
||||
DoCast(me, SPELL_SEDUCTION_VISUAL, true);
|
||||
me->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
private:
|
||||
ObjectGuid _victimGUID;
|
||||
};
|
||||
|
||||
enum soulTrader
|
||||
{
|
||||
SPELL_STEAL_ESSENCE_VISUAL = 50101,
|
||||
@@ -828,7 +778,6 @@ struct npc_pet_gen_moth : public NullCreatureAI
|
||||
|
||||
void AddSC_generic_pet_scripts()
|
||||
{
|
||||
RegisterCreatureAI(npc_pet_gen_mojo);
|
||||
RegisterCreatureAI(npc_pet_gen_soul_trader_beacon);
|
||||
RegisterCreatureAI(npc_pet_gen_argent_pony_bridle);
|
||||
RegisterCreatureAI(npc_pet_gen_target_following_bomb);
|
||||
|
||||
Reference in New Issue
Block a user