*Fix more receive emote and disable the remaining ones, until someone is kind enough to do the work.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-15 19:12:22 -05:00
parent 20344396b3
commit f35a6b1363
4 changed files with 71 additions and 78 deletions

View File

@@ -4010,7 +4010,7 @@ void AddSC_guards()
newscript->Name="guard_orgrimmar";
newscript->pGossipHello = &GossipHello_guard_orgrimmar;
newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
//newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
newscript->GetAI = &GetAI_guard_orgrimmar;
newscript->RegisterSelf();
@@ -4046,7 +4046,7 @@ void AddSC_guards()
newscript->Name="guard_stormwind";
newscript->pGossipHello = &GossipHello_guard_stormwind;
newscript->pGossipSelect = &GossipSelect_guard_stormwind;
newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
//newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
newscript->GetAI = &GetAI_guard_stormwind;
newscript->RegisterSelf();

View File

@@ -79,6 +79,32 @@ struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
if(UpdateVictim())
DoMeleeAttackIfReady();
}
void ReceiveEmote( Player *player, uint32 emote )
{
if( emote == TEXTEMOTE_CHICKEN )
{
if( player->GetTeam() == ALLIANCE )
{
if( rand()%30 == 1 )
{
if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
{
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
m_creature->setFaction(FACTION_FRIENDLY);
DoScriptText(EMOTE_A_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);
}
}
};
CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
@@ -86,34 +112,6 @@ CreatureAI* GetAI_npc_chicken_cluck(Creature *_Creature)
return new npc_chicken_cluckAI(_Creature);
}
bool ReceiveEmote_npc_chicken_cluck( Player *player, Creature *_Creature, uint32 emote )
{
if( emote == TEXTEMOTE_CHICKEN )
{
if( player->GetTeam() == ALLIANCE )
{
if( rand()%30 == 1 )
{
if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE )
{
_Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
_Creature->setFaction(FACTION_FRIENDLY);
DoScriptText(EMOTE_A_HELLO, _Creature);
}
}
} else DoScriptText(EMOTE_H_HELLO,_Creature);
}
if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
{
_Creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
_Creature->setFaction(FACTION_FRIENDLY);
DoScriptText(EMOTE_CLUCK_TEXT2, _Creature);
}
return true;
}
bool QuestAccept_npc_chicken_cluck(Player *player, Creature *_Creature, const Quest *_Quest )
{
if(_Quest->GetQuestId() == QUEST_CLUCK)
@@ -174,6 +172,32 @@ struct TRINITY_DLL_DECL npc_dancing_flamesAI : public ScriptedAI
}
void Aggro(Unit* who){}
void ReceiveEmote( Player *player, uint32 emote )
{
if (m_creature->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && m_creature->IsWithinDistInMap(player,30.0f))
{
m_creature->SetInFront(player);
active = false;
WorldPacket data;
m_creature->BuildHeartBeatMsg(&data);
m_creature->SendMessageToSet(&data,true);
switch(emote)
{
case TEXTEMOTE_KISS: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break;
case TEXTEMOTE_WAVE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
case TEXTEMOTE_BOW: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
case TEXTEMOTE_JOKE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break;
case TEXTEMOTE_DANCE:
{
if (!player->HasAura(SPELL_SEDUCTION))
m_creature->CastSpell(player,SPELL_SEDUCTION,true);
}
break;
}
}
}
};
CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature)
@@ -181,34 +205,6 @@ CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature)
return new npc_dancing_flamesAI(_Creature);
}
bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *flame, uint32 emote )
{
if ( ((npc_dancing_flamesAI*)flame->AI())->active &&
flame->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && flame->IsWithinDistInMap(player,30.0f))
{
flame->SetInFront(player);
((npc_dancing_flamesAI*)flame->AI())->active = false;
WorldPacket data;
flame->BuildHeartBeatMsg(&data);
flame->SendMessageToSet(&data,true);
switch(emote)
{
case TEXTEMOTE_KISS: flame->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break;
case TEXTEMOTE_WAVE: flame->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
case TEXTEMOTE_BOW: flame->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
case TEXTEMOTE_JOKE: flame->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break;
case TEXTEMOTE_DANCE:
{
if (!player->HasAura(SPELL_SEDUCTION))
flame->CastSpell(player,SPELL_SEDUCTION,true);
}
break;
}
}
return true;
}
/*######
## Triage quest
######*/
@@ -1424,7 +1420,6 @@ void AddSC_npcs_special()
newscript = new Script;
newscript->Name="npc_chicken_cluck";
newscript->GetAI = &GetAI_npc_chicken_cluck;
newscript->pReceiveEmote = &ReceiveEmote_npc_chicken_cluck;
newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck;
newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck;
newscript->RegisterSelf();
@@ -1432,7 +1427,6 @@ void AddSC_npcs_special()
newscript = new Script;
newscript->Name="npc_dancing_flames";
newscript->GetAI = &GetAI_npc_dancing_flames;
newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames;
newscript->RegisterSelf();
newscript = new Script;
@@ -1492,12 +1486,12 @@ void AddSC_npcs_special()
newscript = new Script;
newscript->Name="npc_winter_reveler";
newscript->pReceiveEmote = &ReceiveEmote_npc_winter_reveler;
//newscript->pReceiveEmote = &ReceiveEmote_npc_winter_reveler;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_brewfest_reveler";
newscript->pReceiveEmote = &ReceiveEmote_npc_brewfest_reveler;
//newscript->pReceiveEmote = &ReceiveEmote_npc_brewfest_reveler;
newscript->RegisterSelf();
newscript = new Script;

View File

@@ -157,6 +157,20 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
DoMeleeAttackIfReady();
}
void ReciveEmote(Player* pPlayer, uint32 emote)
{
if (emote == TEXTEMOTE_SALUTE)
{
if (FlareCount >= 2)
{
if (m_creature->getFaction() == FACTION_FRIENDLY_F)
return;
else
DoFriend();
}
}
}
};
CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature)
@@ -164,20 +178,6 @@ CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature)
return new npc_taskmaster_fizzuleAI(pCreature);
}
bool ReciveEmote_npc_taskmaster_fizzule(Player* pPlayer, Creature* pCreature, uint32 emote)
{
if (emote == TEXTEMOTE_SALUTE)
{
if (((npc_taskmaster_fizzuleAI*)pCreature->AI())->FlareCount >= 2)
{
if (pCreature->getFaction() == FACTION_FRIENDLY_F)
return true;
else
((npc_taskmaster_fizzuleAI*)pCreature->AI())->DoFriend();
}
}
return true;
}
/*#####
## npc_twiggy_flathead
#####*/
@@ -549,7 +549,6 @@ void AddSC_the_barrens()
newscript = new Script;
newscript->Name="npc_taskmaster_fizzule";
newscript->GetAI = &GetAI_npc_taskmaster_fizzule;
newscript->pReceiveEmote = &ReciveEmote_npc_taskmaster_fizzule;
newscript->RegisterSelf();
newscript = new Script;

View File

@@ -285,7 +285,7 @@ void AddSC_stormwind_city()
newscript = new Script;
newscript->Name = "npc_general_marcus_jonathan";
newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
//newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
newscript->RegisterSelf();
newscript = new Script;