aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-06-07 23:40:37 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-06-07 23:40:37 +0200
commit1f62d9c3875c446e3b8a23f8624c3ee8d8eb80cc (patch)
treed450c68ac6e085359b5a22e32912dc03c0743206 /src/server/scripts/World
parent1e4ec81ccbc4e471804f9067d1cd18268d84e707 (diff)
parent5fee5b012566191bfd0c27d3fcfc64aad6d657cb (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Handlers/ItemHandler.cpp src/server/scripts/Spells/spell_dk.cpp
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/npcs_special.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index e6857659d2e..321c3d67dc5 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -56,6 +56,7 @@ EndContentData */
#include "CellImpl.h"
#include "SpellAuras.h"
#include "Pet.h"
+#include "CreatureTextMgr.h"
/*########
# npc_air_force_bots
@@ -2351,6 +2352,60 @@ public:
};
};
+class npc_imp_in_a_ball : public CreatureScript
+{
+private:
+ enum
+ {
+ SAY_RANDOM,
+
+ EVENT_TALK = 1,
+ };
+
+public:
+ npc_imp_in_a_ball() : CreatureScript("npc_imp_in_a_ball") { }
+
+ struct npc_imp_in_a_ballAI : public ScriptedAI
+ {
+ npc_imp_in_a_ballAI(Creature* creature) : ScriptedAI(creature)
+ {
+ summonerGUID = 0;
+ }
+
+ void IsSummonedBy(Unit* summoner) override
+ {
+ if (summoner->GetTypeId() == TYPEID_PLAYER)
+ {
+ summonerGUID = summoner->GetGUID();
+ events.ScheduleEvent(EVENT_TALK, 3000);
+ }
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ events.Update(diff);
+
+ if (events.ExecuteEvent() == EVENT_TALK)
+ {
+ if (Player* owner = ObjectAccessor::GetPlayer(*me, summonerGUID))
+ {
+ sCreatureTextMgr->SendChat(me, SAY_RANDOM, owner,
+ owner->GetGroup() ? CHAT_MSG_MONSTER_PARTY : CHAT_MSG_MONSTER_WHISPER, LANG_ADDON, TEXT_RANGE_NORMAL);
+ }
+ }
+ }
+
+ private:
+ EventMap events;
+ uint64 summonerGUID;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_imp_in_a_ballAI(creature);
+ }
+};
+
void AddSC_npcs_special()
{
new npc_air_force_bots();
@@ -2373,4 +2428,5 @@ void AddSC_npcs_special()
new npc_experience();
new npc_firework();
new npc_spring_rabbit();
+ new npc_imp_in_a_ball();
}