*Fix some receive emote. More to be fixed.
--HG-- branch : trunk
This commit is contained in:
@@ -190,6 +190,18 @@ struct TRINITY_DLL_DECL example_creatureAI : public ScriptedAI
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
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
|
//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;
|
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()
|
//This is the actual function called only once durring InitScripts()
|
||||||
//It must define all handled functions that are to be run in this script
|
//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
|
//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->GetAI = &GetAI_example_creature;
|
||||||
newscript->pGossipHello = &GossipHello_example_creature;
|
newscript->pGossipHello = &GossipHello_example_creature;
|
||||||
newscript->pGossipSelect = &GossipSelect_example_creature;
|
newscript->pGossipSelect = &GossipSelect_example_creature;
|
||||||
newscript->pReceiveEmote = &ReceiveEmote_example_creature;
|
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,18 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
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)
|
CreatureAI* GetAI_npc_shenthul(Creature *_Creature)
|
||||||
{
|
{
|
||||||
return new npc_shenthulAI (_Creature);
|
return new npc_shenthulAI (_Creature);
|
||||||
@@ -132,17 +143,6 @@ bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* q
|
|||||||
return true;
|
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
|
## npc_thrall_warchief
|
||||||
######*/
|
######*/
|
||||||
@@ -263,7 +263,6 @@ void AddSC_orgrimmar()
|
|||||||
newscript->Name="npc_shenthul";
|
newscript->Name="npc_shenthul";
|
||||||
newscript->GetAI = &GetAI_npc_shenthul;
|
newscript->GetAI = &GetAI_npc_shenthul;
|
||||||
newscript->pQuestAccept = &QuestAccept_npc_shenthul;
|
newscript->pQuestAccept = &QuestAccept_npc_shenthul;
|
||||||
newscript->pReceiveEmote = &ReciveEmote_npc_shenthul;
|
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
|
|||||||
@@ -227,6 +227,32 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
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)
|
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);
|
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()
|
void AddSC_stratholme()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script *newscript;
|
||||||
@@ -284,7 +282,6 @@ void AddSC_stratholme()
|
|||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "mobs_spectral_ghostly_citizen";
|
newscript->Name = "mobs_spectral_ghostly_citizen";
|
||||||
newscript->GetAI = &GetAI_mobs_spectral_ghostly_citizen;
|
newscript->GetAI = &GetAI_mobs_spectral_ghostly_citizen;
|
||||||
newscript->pReceiveEmote = &ReciveEmote_mobs_spectral_ghostly_citizen;
|
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -259,19 +259,17 @@ struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI
|
|||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
bool ReceiveEmote_npc_plucky( Player *player, Creature *_Creature, uint32 emote )
|
void ReceiveEmote( Player *player, uint32 emote )
|
||||||
{
|
{
|
||||||
if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN &&
|
if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN &&
|
||||||
player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) )
|
player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) )
|
||||||
{
|
{
|
||||||
_Creature->SetInFront(player);
|
m_creature->SetInFront(player);
|
||||||
((npc_pluckyAI*)((Creature*)_Creature)->AI())->TransformHuman(emote);
|
TransformHuman(emote);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
bool GossipHello_npc_plucky(Player *player, Creature *_Creature)
|
bool GossipHello_npc_plucky(Player *player, Creature *_Creature)
|
||||||
{
|
{
|
||||||
@@ -316,7 +314,6 @@ void AddSC_thousand_needles()
|
|||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "npc_plucky";
|
newscript->Name = "npc_plucky";
|
||||||
newscript->GetAI = &GetAI_npc_plucky;
|
newscript->GetAI = &GetAI_npc_plucky;
|
||||||
newscript->pReceiveEmote = &ReceiveEmote_npc_plucky;
|
|
||||||
newscript->pGossipHello = &GossipHello_npc_plucky;
|
newscript->pGossipHello = &GossipHello_npc_plucky;
|
||||||
newscript->pGossipSelect = &GossipSelect_npc_plucky;
|
newscript->pGossipSelect = &GossipSelect_npc_plucky;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|||||||
Reference in New Issue
Block a user