Scripted: Fix warning
This commit is contained in:
1 parent
b1721a65ee
commit
8fd1f46192
3 files changed
+91
-62
No files matched your search
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Ordered alphabetically using scriptname.
|
||||
* Scriptnames of files in this file should be prefixed with "npc_pet_gen_".
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Mojo
|
||||
{
|
||||
SAY_MOJO = 0,
|
||||
|
||||
SPELL_FEELING_FROGGY = 43906,
|
||||
SPELL_SEDUCTION_VISUAL = 43919
|
||||
};
|
||||
|
||||
class npc_pet_gen_mojo : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_pet_gen_mojo() : CreatureScript("npc_pet_gen_mojo") { }
|
||||
|
||||
struct npc_pet_gen_mojoAI : public ScriptedAI
|
||||
{
|
||||
npc_pet_gen_mojoAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
_victimGUID = 0;
|
||||
|
||||
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()->GetTeam() != player->GetTeam())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Talk(SAY_MOJO, player->GetGUID());
|
||||
|
||||
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:
|
||||
uint64 _victimGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_pet_gen_mojoAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_shaman_pet_scripts()
|
||||
{
|
||||
}
|
||||
Reference in new issue
Block a user