Merge [SD2]
r1009 Restore compile. RecieveEmote function moved to creature AI. --HG-- branch : trunk
This commit is contained in:
@@ -170,3 +170,27 @@ void guardAI::UpdateAI(const uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
void guardAI::DoReplyToTextEmote(uint32 em)
|
||||
{
|
||||
switch(em)
|
||||
{
|
||||
case TEXTEMOTE_KISS: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
|
||||
case TEXTEMOTE_WAVE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
|
||||
case TEXTEMOTE_SALUTE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
|
||||
case TEXTEMOTE_SHY: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
|
||||
case TEXTEMOTE_RUDE:
|
||||
case TEXTEMOTE_CHICKEN: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
|
||||
}
|
||||
}
|
||||
|
||||
void guardAI_orgrimmar::ReceiveEmote(Player *player, uint32 text_emote)
|
||||
{
|
||||
if (player->GetTeam()==HORDE)
|
||||
DoReplyToTextEmote(text_emote);
|
||||
}
|
||||
|
||||
void guardAI_stormwind::ReceiveEmote(Player *player, uint32 text_emote)
|
||||
{
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
DoReplyToTextEmote(text_emote);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,23 @@ struct TRINITY_DLL_DECL guardAI : public ScriptedAI
|
||||
void JustDied(Unit *Killer);
|
||||
|
||||
void UpdateAI(const uint32 diff);
|
||||
|
||||
//common used for guards in main cities
|
||||
void DoReplyToTextEmote(uint32 em);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL guardAI_orgrimmar : public guardAI
|
||||
{
|
||||
guardAI_orgrimmar(Creature *c) : guardAI(c) {}
|
||||
|
||||
void ReceiveEmote(Player *player, uint32 text_emote);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL guardAI_stormwind : public guardAI
|
||||
{
|
||||
guardAI_stormwind(Creature *c) : guardAI(c) {}
|
||||
|
||||
void ReceiveEmote(Player *player, uint32 text_emote);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -79,20 +79,6 @@ EndContentData */
|
||||
#define GOSSIP_TEXT_INN_SILVERMOON_1 "Silvermoon City Inn"
|
||||
#define GOSSIP_TEXT_INN_SILVERMOON_2 "Wayfarer's Rest tavern"
|
||||
|
||||
//common used for guards in main cities
|
||||
void DoReplyToTextEmote(Creature *_Creature,uint32 em)
|
||||
{
|
||||
switch(em)
|
||||
{
|
||||
case TEXTEMOTE_KISS: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
|
||||
case TEXTEMOTE_WAVE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
|
||||
case TEXTEMOTE_SALUTE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
|
||||
case TEXTEMOTE_SHY: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
|
||||
case TEXTEMOTE_RUDE:
|
||||
case TEXTEMOTE_CHICKEN: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************
|
||||
* guard_azuremyst start
|
||||
*******************************************************/
|
||||
@@ -2220,20 +2206,13 @@ bool GossipSelect_guard_orgrimmar(Player *player, Creature *_Creature, uint32 se
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReceiveEmote_guard_orgrimmar(Player *player, Creature *_Creature, uint32 emote)
|
||||
{
|
||||
if( player->GetTeam() == HORDE )
|
||||
DoReplyToTextEmote(_Creature,emote);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*******************************************************
|
||||
* guard_orgrimmar end
|
||||
*******************************************************/
|
||||
|
||||
CreatureAI* GetAI_guard_orgrimmar(Creature *_Creature)
|
||||
{
|
||||
return new guardAI (_Creature);
|
||||
return new guardAI_orgrimmar (_Creature);
|
||||
}
|
||||
|
||||
/*******************************************************
|
||||
@@ -3384,20 +3363,13 @@ bool GossipSelect_guard_stormwind(Player *player, Creature *_Creature, uint32 se
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReceiveEmote_guard_stormwind(Player *player, Creature *_Creature, uint32 emote)
|
||||
{
|
||||
if( player->GetTeam() == ALLIANCE )
|
||||
DoReplyToTextEmote(_Creature,emote);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*******************************************************
|
||||
* guard_stormwind end
|
||||
*******************************************************/
|
||||
|
||||
CreatureAI* GetAI_guard_stormwind(Creature *_Creature)
|
||||
{
|
||||
return new guardAI (_Creature);
|
||||
return new guardAI_stormwind (_Creature);
|
||||
}
|
||||
|
||||
/*******************************************************
|
||||
@@ -4010,7 +3982,6 @@ void AddSC_guards()
|
||||
newscript->Name="guard_orgrimmar";
|
||||
newscript->pGossipHello = &GossipHello_guard_orgrimmar;
|
||||
newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
|
||||
//newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
|
||||
newscript->GetAI = &GetAI_guard_orgrimmar;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
@@ -4046,7 +4017,6 @@ void AddSC_guards()
|
||||
newscript->Name="guard_stormwind";
|
||||
newscript->pGossipHello = &GossipHello_guard_stormwind;
|
||||
newscript->pGossipSelect = &GossipSelect_guard_stormwind;
|
||||
//newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
|
||||
newscript->GetAI = &GetAI_guard_stormwind;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
|
||||
@@ -98,14 +98,18 @@ struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
|
||||
DoScriptText(EMOTE_A_HELLO, m_creature);
|
||||
}
|
||||
}
|
||||
} else DoScriptText(EMOTE_H_HELLO,m_creature);
|
||||
}
|
||||
else
|
||||
DoScriptText(EMOTE_H_HELLO,m_creature);
|
||||
}
|
||||
if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
|
||||
if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
|
||||
{
|
||||
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
m_creature->setFaction(FACTION_FRIENDLY);
|
||||
DoScriptText(EMOTE_CLUCK_TEXT2, m_creature);
|
||||
if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
|
||||
{
|
||||
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
m_creature->setFaction(FACTION_FRIENDLY);
|
||||
DoScriptText(EMOTE_CLUCK_TEXT2, m_creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -167,8 +167,8 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
|
||||
{
|
||||
if (m_creature->getFaction() == FACTION_FRIENDLY_F)
|
||||
return;
|
||||
else
|
||||
DoFriend();
|
||||
|
||||
DoFriend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,10 @@ bool GossipSelect_npc_neeru_fireblade(Player *player, Creature *_Creature, uint3
|
||||
## npc_shenthul
|
||||
######*/
|
||||
|
||||
#define QUEST_2460 2460
|
||||
enum
|
||||
{
|
||||
QUEST_SHATTERED_SALUTE = 2460
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
|
||||
{
|
||||
@@ -95,21 +98,27 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if( CanEmote )
|
||||
if( Reset_Timer < diff )
|
||||
{
|
||||
if( Unit* temp = Unit::GetUnit((*m_creature),playerGUID) )
|
||||
if( temp->GetTypeId() == TYPEID_PLAYER )
|
||||
CAST_PLR(temp)->FailQuest(QUEST_2460);
|
||||
Reset();
|
||||
} else Reset_Timer -= diff;
|
||||
if (Reset_Timer < diff)
|
||||
{
|
||||
if (Player* pPlayer = (Player*)Unit::GetUnit((*m_creature),playerGUID))
|
||||
{
|
||||
if (pPlayer->GetTypeId() == TYPEID_PLAYER && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
|
||||
pPlayer->FailQuest(QUEST_SHATTERED_SALUTE);
|
||||
}
|
||||
Reset();
|
||||
} else Reset_Timer -= diff;
|
||||
}
|
||||
|
||||
if( CanTalk && !CanEmote )
|
||||
if( Salute_Timer < diff )
|
||||
{
|
||||
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
CanEmote = true;
|
||||
Reset_Timer = 60000;
|
||||
} else Salute_Timer -= diff;
|
||||
if (Salute_Timer < diff)
|
||||
{
|
||||
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
CanEmote = true;
|
||||
Reset_Timer = 60000;
|
||||
} else Salute_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -119,12 +128,14 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
|
||||
|
||||
void ReciveEmote_npc_shenthul(Player *player, uint32 emote)
|
||||
{
|
||||
if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
|
||||
if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
if(CanEmote)
|
||||
{
|
||||
player->AreaExploredOrEventHappens(QUEST_2460);
|
||||
player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE);
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -135,7 +146,7 @@ CreatureAI* GetAI_npc_shenthul(Creature *_Creature)
|
||||
|
||||
bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if( quest->GetQuestId() == QUEST_2460 )
|
||||
if( quest->GetQuestId() == QUEST_SHATTERED_SALUTE )
|
||||
{
|
||||
CAST_AI(npc_shenthulAI, creature->AI())->CanTalk = true;
|
||||
CAST_AI(npc_shenthulAI, creature->AI())->playerGUID = player->GetGUID();
|
||||
|
||||
@@ -179,21 +179,32 @@ CreatureAI* GetAI_npc_dashel_stonefist(Creature* pCreature)
|
||||
|
||||
#define SAY_GREETING -1000005
|
||||
|
||||
bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote)
|
||||
struct TRINITY_DLL_DECL npc_general_marcus_jonathanAI : public ScriptedAI
|
||||
{
|
||||
if(player->GetTeam() == ALLIANCE)
|
||||
npc_general_marcus_jonathanAI(Creature *c) : ScriptedAI(c) { }
|
||||
|
||||
void Reset() {}
|
||||
void Aggro(Unit*) {}
|
||||
|
||||
void ReceiveEmote(Player *player, uint32 emote)
|
||||
{
|
||||
if (emote == TEXTEMOTE_SALUTE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
{
|
||||
_Creature->SetOrientation(_Creature->GetAngle(player));
|
||||
_Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
}
|
||||
if (emote == TEXTEMOTE_WAVE)
|
||||
{
|
||||
DoScriptText(SAY_GREETING, _Creature, player);
|
||||
if (emote == TEXTEMOTE_SALUTE)
|
||||
{
|
||||
m_creature->SetOrientation(m_creature->GetAngle(player));
|
||||
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
|
||||
}
|
||||
|
||||
if (emote == TEXTEMOTE_WAVE)
|
||||
DoScriptText(SAY_GREETING, m_creature, player);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_general_marcus_jonathan(Creature* pCreature)
|
||||
{
|
||||
return new npc_general_marcus_jonathanAI(pCreature);
|
||||
}
|
||||
|
||||
/*######
|
||||
@@ -266,7 +277,7 @@ void AddSC_stormwind_city()
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_general_marcus_jonathan";
|
||||
//newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
|
||||
newscript->GetAI = &GetAI_npc_general_marcus_jonathan;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
|
||||
Reference in New Issue
Block a user