diff options
-rw-r--r-- | src/server/scripts/Pet/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/server/scripts/Pet/pet_generic.cpp | 90 | ||||
-rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 62 |
3 files changed, 91 insertions, 62 deletions
diff --git a/src/server/scripts/Pet/CMakeLists.txt b/src/server/scripts/Pet/CMakeLists.txt index b4a8eea77d8..87bbfd63c69 100644 --- a/src/server/scripts/Pet/CMakeLists.txt +++ b/src/server/scripts/Pet/CMakeLists.txt @@ -11,6 +11,7 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} Pet/pet_dk.cpp + Pet/pet_generic.cpp Pet/pet_hunter.cpp Pet/pet_mage.cpp Pet/pet_priest.cpp diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp new file mode 100644 index 00000000000..f4327ef8daa --- /dev/null +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -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() +{ +} diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index f12c68678b1..5304cbf56ca 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1605,67 +1605,6 @@ class npc_brewfest_reveler : public CreatureScript } }; -enum Mojo -{ - SAY_MOJO = 0, - - SPELL_FEELING_FROGGY = 43906, - SPELL_SEDUCTION_VISUAL = 43919 -}; - -class npc_mojo : public CreatureScript -{ - public: - npc_mojo() : CreatureScript("npc_mojo") { } - - struct npc_mojoAI : public ScriptedAI - { - npc_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_mojoAI(creature); - } -}; - enum TrainingDummy { NPC_ADVANCED_TARGET_DUMMY = 2674, @@ -2519,7 +2458,6 @@ void AddSC_npcs_special() new npc_steam_tonk(); new npc_tonk_mine(); new npc_brewfest_reveler(); - new npc_mojo(); new npc_training_dummy(); new npc_wormhole(); new npc_pet_trainer(); |