diff options
-rw-r--r-- | sql/updates/1074_world_scripts.sql | 1 | ||||
-rw-r--r-- | sql/updates/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sql/world_scripts_full.sql | 4 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp | 141 |
4 files changed, 138 insertions, 10 deletions
diff --git a/sql/updates/1074_world_scripts.sql b/sql/updates/1074_world_scripts.sql new file mode 100644 index 00000000000..6653d9c62d4 --- /dev/null +++ b/sql/updates/1074_world_scripts.sql @@ -0,0 +1 @@ +update creature_template set scriptname = 'npc_plucky' where entry in (6626);
\ No newline at end of file diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index 6c45423e70c..28d1f895e68 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -166,4 +166,6 @@ INSTALL(FILES 1026_world.sql 1028_world_scripts.sql 1069_world_scripts.sql +1073_world_scripts.sql +1074_world_scripts.sql DESTINATION share/trinity/sql/updates) diff --git a/sql/world_scripts_full.sql b/sql/world_scripts_full.sql index 3d27739693b..47c4087f7e4 100644 --- a/sql/world_scripts_full.sql +++ b/sql/world_scripts_full.sql @@ -595,7 +595,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_clintar_spirit' WHERE `entry` = /* MULGORE */ UPDATE `creature_template` SET `ScriptName`='npc_skorn_whitecloud' WHERE `entry`=3052; -UPDATE `creature_template` SET `ScriptName`='npc_kyle_frenzied' where `entry`='23616'; +UPDATE `creature_template` SET `ScriptName`='npc_kyle_frenzied' WHERE `entry`='23616'; +UPDATE `creature_template` SET `ScriptName`='npc_plains_vision' WHERE `entry`='2983'; /* NAGRAND */ UPDATE `creature_template` SET `ScriptName`='mob_lump' WHERE `entry`=18351; @@ -892,6 +893,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_isla_starmane' where entry=1876 /* THOUSAND NEEDLES */ UPDATE `creature_template` SET `ScriptName` = 'npc_swiftmountain' WHERE `entry` = 10427; +UPDATE `creature_template` SET `ScriptName` = 'npc_plucky' WHERE `entry` = '6626'; /* THUNDER BLUFF */ UPDATE `creature_template` SET `ScriptName`='npc_cairne_bloodhoof' WHERE `entry`=3057; 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 d1ba50406d1..37576d2e347 100644 --- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp @@ -17,17 +17,22 @@ /* ScriptData SDName: Thousand Needles SD%Complete: 100 -SDComment: Support for Quest: 4770 +SDComment: Support for Quest: 4770, 1950 SDCategory: Thousand Needles EndScriptData */ /* ContentData npc_swiftmountain +npc_plucky EndContentData */ #include "precompiled.h" #include "../../npc/npc_escortAI.h" +/*##### +# npc_swiftmountain +######*/ + #define SAY_READY -1000147 #define SAY_AGGRO -1000148 #define SAY_FINISH -1000149 @@ -35,8 +40,6 @@ EndContentData */ #define QUEST_HOMEWARD_BOUND 4770 #define ENTRY_WYVERN 4107 - - struct TRINITY_DLL_DECL npc_swiftmountainAI : public npc_escortAI { npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {Reset();} @@ -69,11 +72,10 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {Reset();} void Reset() { - + m_creature->setFaction(104); } - void Aggro(Unit* who) - {} + void Aggro(Unit* who){} void JustSummoned(Creature* summoned) { @@ -100,8 +102,7 @@ bool QuestAccept_npc_swiftmountain(Player* player, Creature* creature, Quest con if (quest->GetQuestId() == QUEST_HOMEWARD_BOUND) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - DoScriptText(SAY_READY, creature, player); - // Change faction so mobs attack + DoScriptText(SAY_READY, creature, player); creature->setFaction(113); } @@ -188,6 +189,120 @@ CreatureAI* GetAI_npc_swiftmountain(Creature *_Creature) return (CreatureAI*)thisAI; } +/*##### +# npc_plucky +######*/ + +#define GOSSIP_P "<Learn Secret phrase>" + +#define SPELL_TRANSFORM_HUMAN 9192 +#define QUEST_GET_THE_SCOOP 1950 + +struct TRINITY_DLL_DECL npc_pluckyAI : public ScriptedAI +{ + npc_pluckyAI(Creature *c) : ScriptedAI(c) {Reset();} + + bool Transformed; + bool Chicken; + + uint32 Timer; + uint32 ChickenTimer; + + void Reset() { + + Transformed = false; + Chicken = false; + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Timer = 0; + ChickenTimer = 0; + } + + void Aggro(Unit *who){} + + void TransformHuman(uint32 emoteid) + { + 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; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (Transformed) + { + if (Timer < diff) + Reset(); + else Timer-=diff; + } + + if(Chicken) + { + if (ChickenTimer < diff) + { + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + Chicken = false; + }else ChickenTimer-=diff; + } + + if(!UpdateVictim()) + return; + + 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) ) + { + _Creature->SetInFront(player); + ((npc_pluckyAI*)((Creature*)_Creature)->AI())->TransformHuman(emote); + } + + return true; +} + +bool GossipHello_npc_plucky(Player *player, Creature *_Creature) +{ + if(player->GetQuestStatus(QUEST_GET_THE_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()); + + return true; +} + +bool GossipSelect_npc_plucky(Player *player, Creature *_Creature, uint32 sender, uint32 action) +{ + switch( action ) + { + case GOSSIP_ACTION_INFO_DEF+1: + player->CLOSE_GOSSIP_MENU(); + player->CompleteQuest(QUEST_GET_THE_SCOOP); + break; + } + return true; +} + +CreatureAI* GetAI_npc_plucky(Creature *_Creature) +{ +return new npc_pluckyAI(_Creature); +} + +/*##### +# +######*/ + void AddSC_thousand_needles() { Script *newscript; @@ -197,4 +312,12 @@ void AddSC_thousand_needles() newscript->GetAI = &GetAI_npc_swiftmountain; newscript->pQuestAccept = &QuestAccept_npc_swiftmountain; newscript->RegisterSelf(); -}
\ No newline at end of file + + 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(); +} |