diff options
-rw-r--r-- | src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp | 8 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp | 118 |
2 files changed, 64 insertions, 62 deletions
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp index e847973ac7a..b46705ddf5e 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -89,9 +89,9 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI float posX, posY, posZ, angle; m_creature->GetHomePosition(posX, posY, posZ, angle); - Beacon[0] = m_creature->SummonCreature(ENTRY_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - Beacon[1] = m_creature->SummonCreature(ENTRY_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - Beacon[2] = m_creature->SummonCreature(ENTRY_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + Beacon[0] = m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + Beacon[1] = m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + Beacon[2] = m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); for(uint8 i = 0; i < NR_INITIAL_BEACONS; i++) { @@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI void JustSummoned(Creature *summoned) { - if( summoned->GetEntry() == ENTRY_BEACON ) + if( summoned->GetEntry() == NPC_BEACON ) { summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); 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 7406d259db1..81d44b207c9 100644 --- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp @@ -193,87 +193,89 @@ CreatureAI* GetAI_npc_swiftmountain(Creature *_Creature) # npc_plucky ######*/ -#define GOSSIP_P "<Learn Secret phrase>" +#define GOSSIP_P "Please tell me the Phrase.." -#define SPELL_TRANSFORM_HUMAN 9192 -#define QUEST_GET_THE_SCOOP 1950 +enum +{ + FACTION_FRIENDLY = 35, + QUEST_SCOOP = 1950, + SPELL_PLUCKY_HUMAN = 9192, + SPELL_PLUCKY_CHICKEN = 9220 +}; struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI { - npc_pluckyAI(Creature *c) : ScriptedAI(c) {} + npc_pluckyAI(Creature *c) : ScriptedAI(c) { m_uiNormFaction = c->getFaction(); } - bool Transformed; - bool Chicken; + uint32 m_uiNormFaction; + uint32 m_uiResetTimer; - uint32 Timer; - uint32 ChickenTimer; + void Reset() + { + m_uiResetTimer = 120000; - void Reset() { + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); - Transformed = false; - Chicken = false; - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - Timer = 0; - ChickenTimer = 0; - } + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - void EnterCombat(Unit *who){} + m_creature->CastSpell(m_creature, SPELL_PLUCKY_CHICKEN, false); + } - void TransformHuman(uint32 emoteid) + void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) { - if (!Transformed) - { - Transformed = true; - DoCast(m_creature, SPELL_TRANSFORM_HUMAN); - Timer = 120000; - if (emoteid == TEXTEMOTE_BECKON) - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - else - { - ChickenTimer = 1500; - Chicken = true; - } - } + if (pPlayer->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) + { + if (uiTextEmote == TEXTEMOTE_BECKON) + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); + } + } + + if (uiTextEmote == TEXTEMOTE_CHICKEN) + { + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return; + else + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + } + } } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { - if (Transformed) + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) { - if (Timer < diff) - Reset(); - else Timer-=diff; + if (m_uiResetTimer < uiDiff) + { + if (!m_creature->getVictim()) + EnterEvadeMode(); + else + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + return; + } + else + m_uiResetTimer -= uiDiff; } - if(Chicken) - { - if (ChickenTimer < diff) - { - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - Chicken = false; - }else ChickenTimer-=diff; - } - - if(!UpdateVictim()) + if (!UpdateVictim()) return; DoMeleeAttackIfReady(); - } - - void ReceiveEmote( Player *player, uint32 emote ) - { - if( (emote == TEXTEMOTE_BECKON || emote == TEXTEMOTE_CHICKEN && - player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) ) - { - m_creature->SetInFront(player); - TransformHuman(emote); - } } }; bool GossipHello_npc_plucky(Player *player, Creature *_Creature) { - if(player->GetQuestStatus(QUEST_GET_THE_SCOOP) == QUEST_STATUS_INCOMPLETE) + if(player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM(0, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(738, _Creature->GetGUID()); @@ -286,7 +288,7 @@ bool GossipSelect_npc_plucky(Player *player, Creature *_Creature, uint32 sender, { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); - player->CompleteQuest(QUEST_GET_THE_SCOOP); + player->CompleteQuest(QUEST_SCOOP); break; } return true; @@ -294,7 +296,7 @@ bool GossipSelect_npc_plucky(Player *player, Creature *_Creature, uint32 sender, CreatureAI* GetAI_npc_plucky(Creature *_Creature) { -return new npc_pluckyAI(_Creature); + return new npc_pluckyAI(_Creature); } /*##### |