aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-15 19:01:51 -0500
committermegamage <none@none>2009-04-15 19:01:51 -0500
commit20344396b3aa91728c16851e6522944e5671af05 (patch)
tree9ac3742b631485079ed18dc5f4ce080bb8df8aea /src
parente9272c9e84ca0cffb519c195829e5956ecaa8c8e (diff)
*Fix some receive emote. More to be fixed.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/examples/example_creature.cpp27
-rw-r--r--src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp23
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp55
-rw-r--r--src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp19
4 files changed, 57 insertions, 67 deletions
diff --git a/src/bindings/scripts/scripts/examples/example_creature.cpp b/src/bindings/scripts/scripts/examples/example_creature.cpp
index 708740c3b9d..140e477441d 100644
--- a/src/bindings/scripts/scripts/examples/example_creature.cpp
+++ b/src/bindings/scripts/scripts/examples/example_creature.cpp
@@ -190,6 +190,18 @@ struct TRINITY_DLL_DECL example_creatureAI : public ScriptedAI
DoMeleeAttackIfReady();
}
+
+ //Our Recive emote function
+ void ReceiveEmote(Player *player, uint32 emote)
+ {
+ m_creature->HandleEmoteCommand(emote);
+
+ if (emote == TEXTEMOTE_DANCE)
+ DoScriptText(SAY_DANCE, m_creature);
+
+ if (emote == TEXTEMOTE_SALUTE)
+ DoScriptText(SAY_SALUTE, m_creature);
+ }
};
//This is the GetAI method used by all scripts that involve AI
@@ -229,20 +241,6 @@ bool GossipHello_example_creature(Player *player, Creature *_Creature)
return true;
}
-//Our Recive emote function
-bool ReceiveEmote_example_creature(Player *player, Creature *_Creature, uint32 emote)
-{
- _Creature->HandleEmoteCommand(emote);
-
- if (emote == TEXTEMOTE_DANCE)
- DoScriptText(SAY_DANCE, _Creature);
-
- if (emote == TEXTEMOTE_SALUTE)
- DoScriptText(SAY_SALUTE, _Creature);
-
- return true;
-}
-
//This is the actual function called only once durring InitScripts()
//It must define all handled functions that are to be run in this script
//For example if you want this Script to handle Emotes you must include
@@ -256,6 +254,5 @@ void AddSC_example_creature()
newscript->GetAI = &GetAI_example_creature;
newscript->pGossipHello = &GossipHello_example_creature;
newscript->pGossipSelect = &GossipSelect_example_creature;
- newscript->pReceiveEmote = &ReceiveEmote_example_creature;
newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
index fdb6fff31bb..1c2822b24b1 100644
--- a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
+++ b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
@@ -116,7 +116,18 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
DoMeleeAttackIfReady();
}
+
+ void ReciveEmote_npc_shenthul(Player *player, uint32 emote)
+ {
+ if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
+ if(CanEmote)
+ {
+ player->AreaExploredOrEventHappens(QUEST_2460);
+ Reset();
+ }
+ }
};
+
CreatureAI* GetAI_npc_shenthul(Creature *_Creature)
{
return new npc_shenthulAI (_Creature);
@@ -132,17 +143,6 @@ bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* q
return true;
}
-bool ReciveEmote_npc_shenthul(Player *player, Creature *_Creature, uint32 emote)
-{
- if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
- if( ((npc_shenthulAI*)_Creature->AI())->CanEmote )
- {
- player->AreaExploredOrEventHappens(QUEST_2460);
- ((npc_shenthulAI*)_Creature->AI())->Reset();
- }
- return true;
-}
-
/*######
## npc_thrall_warchief
######*/
@@ -263,7 +263,6 @@ void AddSC_orgrimmar()
newscript->Name="npc_shenthul";
newscript->GetAI = &GetAI_npc_shenthul;
newscript->pQuestAccept = &QuestAccept_npc_shenthul;
- newscript->pReceiveEmote = &ReciveEmote_npc_shenthul;
newscript->RegisterSelf();
newscript = new Script;
diff --git a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
index 91c7553bff7..d7f16105f07 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
@@ -227,6 +227,32 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
DoMeleeAttackIfReady();
}
+
+ void ReciveEmote(Player *player, uint32 emote)
+ {
+ switch(emote)
+ {
+ case TEXTEMOTE_DANCE:
+ EnterEvadeMode();
+ break;
+ case TEXTEMOTE_RUDE:
+ //Should instead cast spell, kicking player back. Spell not found.
+ if (m_creature->IsWithinDistInMap(player, 5))
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
+ else
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
+ break;
+ case TEXTEMOTE_WAVE:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
+ break;
+ case TEXTEMOTE_BOW:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
+ break;
+ case TEXTEMOTE_KISS:
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX);
+ break;
+ }
+ }
};
CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature)
@@ -234,34 +260,6 @@ CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature *_Creature)
return new mobs_spectral_ghostly_citizenAI (_Creature);
}
-bool ReciveEmote_mobs_spectral_ghostly_citizen(Player *player, Creature *_Creature, uint32 emote)
-{
- switch(emote)
- {
- case TEXTEMOTE_DANCE:
- ((mobs_spectral_ghostly_citizenAI*)_Creature->AI())->EnterEvadeMode();
- break;
- case TEXTEMOTE_RUDE:
- //Should instead cast spell, kicking player back. Spell not found.
- if (_Creature->IsWithinDistInMap(player, 5))
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
- else
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
- break;
- case TEXTEMOTE_WAVE:
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
- break;
- case TEXTEMOTE_BOW:
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW);
- break;
- case TEXTEMOTE_KISS:
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX);
- break;
- }
-
- return true;
-}
-
void AddSC_stratholme()
{
Script *newscript;
@@ -284,7 +282,6 @@ void AddSC_stratholme()
newscript = new Script;
newscript->Name = "mobs_spectral_ghostly_citizen";
newscript->GetAI = &GetAI_mobs_spectral_ghostly_citizen;
- newscript->pReceiveEmote = &ReciveEmote_mobs_spectral_ghostly_citizen;
newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp
index 922687b0723..4c9c76010ca 100644
--- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp
+++ b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp
@@ -259,19 +259,17 @@ struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI
DoMeleeAttackIfReady();
}
-};
-bool ReceiveEmote_npc_plucky( Player *player, Creature *_Creature, uint32 emote )
-{
- if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN &&
- player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) )
+ void ReceiveEmote( Player *player, uint32 emote )
{
- _Creature->SetInFront(player);
- ((npc_pluckyAI*)((Creature*)_Creature)->AI())->TransformHuman(emote);
+ if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN &&
+ player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) )
+ {
+ m_creature->SetInFront(player);
+ TransformHuman(emote);
+ }
}
-
- return true;
-}
+};
bool GossipHello_npc_plucky(Player *player, Creature *_Creature)
{
@@ -316,7 +314,6 @@ void AddSC_thousand_needles()
newscript = new Script;
newscript->Name = "npc_plucky";
newscript->GetAI = &GetAI_npc_plucky;
- newscript->pReceiveEmote = &ReceiveEmote_npc_plucky;
newscript->pGossipHello = &GossipHello_npc_plucky;
newscript->pGossipSelect = &GossipSelect_npc_plucky;
newscript->RegisterSelf();