From cc4428b758a55b43fd4eaf38551925a63997867e Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Fri, 9 Jan 2009 23:56:25 +0100 Subject: *Support for quest 9752 --HG-- branch : trunk --- sql/updates/822_world_scripts.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/822_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/822_world_scripts.sql b/sql/updates/822_world_scripts.sql new file mode 100644 index 00000000000..0102336e31f --- /dev/null +++ b/sql/updates/822_world_scripts.sql @@ -0,0 +1,2 @@ +update creature_template set scriptname='npc_kayra_longmane' where entry=17969; +delete from creature_template_addon where entry=17969; \ No newline at end of file -- cgit v1.2.3 From 35b8de046e3461adc982a0c35364f6c95f81cf00 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sat, 10 Jan 2009 12:45:01 +0100 Subject: *Support for quest 6482 - by arcx *Line endings --HG-- branch : trunk --- sql/updates/826_world_scripts.sql | 1 + .../scripts/zone/ashenvale_forest/ashenvale.cpp | 131 ++++++++++++++++++++- src/game/TicketHandler.cpp | 2 +- 3 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 sql/updates/826_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/826_world_scripts.sql b/sql/updates/826_world_scripts.sql new file mode 100644 index 00000000000..b125225744f --- /dev/null +++ b/sql/updates/826_world_scripts.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_ruul_snowhoof' WHERE `entry` = 12818; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp index c988054cfa9..49935651cb6 100644 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp @@ -17,12 +17,13 @@ /* ScriptData SDName: Ashenvale SD%Complete: 70 -SDComment: Quest support: 6544 +SDComment: Quest support: 6544, 6482 SDCategory: Ashenvale Forest EndScriptData */ /* ContentData npc_torek +npc_ruul_snowhoof EndContentData */ #include "precompiled.h" @@ -174,7 +175,125 @@ CreatureAI* GetAI_npc_torek(Creature *_Creature) return (CreatureAI*)thisAI; } - + +/*#### +# npc_ruul_snowhoof +####*/ + +#define QUEST_FREEDOM_TO_RUUL 6482 +#define GO_CAGE 178147 + +struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI +{ + npc_ruul_snowhoofAI(Creature *c) : npc_escortAI(c) {Reset();} + + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch(i) + { + case 0: { + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + GameObject* Cage = FindGameObject(GO_CAGE, 99); + if(Cage) + Cage->SetGoState(0); + break;} + case 13: + m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + case 19: + m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + + case 21:{ + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature); + + break; } + } + } + + void Aggro(Unit* who) {} + + void Reset() + { + if (!IsBeingEscorted) + m_creature->setFaction(1602); + + GameObject* Cage = FindGameObject(GO_CAGE, 99); + if(Cage) + Cage->SetGoState(1); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_FREEDOM_TO_RUUL); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_ruul_snowhoof(Player* player, Creature* creature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) + { + creature->setFaction(1603); + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature) +{ + npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(_Creature); + + ruul_snowhoofAI->AddWaypoint(0, 3347.250089, -694.700989, 159.925995); + ruul_snowhoofAI->AddWaypoint(1, 3341.527039, -694.725891, 161.124542, 4000); + ruul_snowhoofAI->AddWaypoint(2, 3338.351074, -686.088138, 163.444000); + ruul_snowhoofAI->AddWaypoint(3, 3352.744873, -677.721741, 162.316269); + ruul_snowhoofAI->AddWaypoint(4, 3370.291016, -669.366943, 160.751358); + ruul_snowhoofAI->AddWaypoint(5, 3381.479492, -659.449097, 162.545303); + ruul_snowhoofAI->AddWaypoint(6, 3389.554199, -648.500000, 163.651825); + ruul_snowhoofAI->AddWaypoint(7, 3396.645020, -641.508911, 164.216019); + ruul_snowhoofAI->AddWaypoint(8, 3410.498535, -634.299622, 165.773453); + ruul_snowhoofAI->AddWaypoint(9, 3418.461426, -631.791992, 166.477615); + ruul_snowhoofAI->AddWaypoint(10, 3429.500000, -631.588745, 166.921265); + ruul_snowhoofAI->AddWaypoint(11,3434.950195, -629.245483, 168.333969); + ruul_snowhoofAI->AddWaypoint(12,3438.927979, -618.503235, 171.503143); + ruul_snowhoofAI->AddWaypoint(13,3444.217529, -609.293640, 173.077972, 1000); // Ambush 1 + ruul_snowhoofAI->AddWaypoint(14,3460.505127, -593.794189, 174.342255); + ruul_snowhoofAI->AddWaypoint(15,3480.283203, -578.210327, 176.652313); + ruul_snowhoofAI->AddWaypoint(16,3492.912842, -562.335449, 181.396301); + ruul_snowhoofAI->AddWaypoint(17,3495.230957, -550.977600, 184.652267); + ruul_snowhoofAI->AddWaypoint(18,3496.247070, -529.194214, 188.172028); + ruul_snowhoofAI->AddWaypoint(19,3497.619385, -510.411499, 188.345322, 1000); // Ambush 2 + ruul_snowhoofAI->AddWaypoint(20,3498.498047, -497.787506, 185.806274); + ruul_snowhoofAI->AddWaypoint(21,3484.218750, -489.717529, 182.389862, 4000); // End + + return (CreatureAI*)ruul_snowhoofAI; +} + void AddSC_ashenvale() { Script *newscript; @@ -184,4 +303,10 @@ void AddSC_ashenvale() newscript->GetAI = &GetAI_npc_torek; newscript->pQuestAccept = &QuestAccept_npc_torek; newscript->RegisterSelf(); -} \ No newline at end of file + + newscript = new Script; + newscript->Name = "npc_ruul_snowhoof"; + newscript->GetAI = &GetAI_npc_ruul_snowhoofAI; + newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof; + newscript->RegisterSelf(); +} diff --git a/src/game/TicketHandler.cpp b/src/game/TicketHandler.cpp index 5f43fb9a384..71375beb5da 100644 --- a/src/game/TicketHandler.cpp +++ b/src/game/TicketHandler.cpp @@ -187,4 +187,4 @@ void WorldSession::HandleGMTicketSystemStatusOpcode( WorldPacket & /*recv_data*/ // Send Packet SendPacket(&data); -} \ No newline at end of file +} -- cgit v1.2.3 From 3858dab58baebfdf7148eb6b56bea359bcf72526 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 10 Jan 2009 11:11:01 -0600 Subject: *Fix sql bug in 741_characters.sql. If you already have "closed" column in gm_tickets table, use ALTER TABLE `gm_tickets` CHANGE `closed` `closed` tinyint(1) NOT NULL default '0'; If you do not have that column, use ALTER TABLE `gm_tickets` ADD `closed` tinyint(1) NOT NULL default '0' AFTER `timestamp`; Also, you should check if you have "assignedto" column. --HG-- branch : trunk --- sql/updates/741_characters.sql | 3 +-- sql/updates/832_characters.sql | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 sql/updates/832_characters.sql (limited to 'sql/updates') diff --git a/sql/updates/741_characters.sql b/sql/updates/741_characters.sql index aeba6f8c9ac..4ce094e3e5f 100644 --- a/sql/updates/741_characters.sql +++ b/sql/updates/741_characters.sql @@ -1,4 +1,3 @@ -ALTER TABLE `gm_tickets` CHANGE `closed` `closed` tinyint(1) NOT NULL default '0'; -ALTER TABLE `gm_tickets` ADD `closed` bit(1) NOT NULL AFTER `timestamp`; +ALTER TABLE `gm_tickets` ADD `closed` tinyint(1) NOT NULL default '0' AFTER `timestamp`; ALTER TABLE `gm_tickets` ADD `assignedto` int(10) NOT NULL default '0' AFTER `timestamp`; diff --git a/sql/updates/832_characters.sql b/sql/updates/832_characters.sql new file mode 100644 index 00000000000..1330aef891e --- /dev/null +++ b/sql/updates/832_characters.sql @@ -0,0 +1 @@ +ALTER TABLE `gm_tickets` CHANGE `closed` `closed` tinyint(1) NOT NULL default '0'; \ No newline at end of file -- cgit v1.2.3 From 7a4833bee78ec8f13c5d94b538abaa35d7d930d9 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sat, 10 Jan 2009 19:50:39 +0100 Subject: *Support for quest 10231 --HG-- branch : trunk --- sql/updates/833_world_scripts.sql | 2 + .../scripts/zone/shattrath/shattrath_city.cpp | 186 ++++++++++++++++++++- 2 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 sql/updates/833_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/833_world_scripts.sql b/sql/updates/833_world_scripts.sql new file mode 100644 index 00000000000..ad68e7a1da0 --- /dev/null +++ b/sql/updates/833_world_scripts.sql @@ -0,0 +1,2 @@ +update creature_template set scriptname='npc_dirty_larry', unit_flags=0, flags_extra=0 where entry=19720; +update creature_template set unit_flags=0, flags_extra=0 where entry in (19726, 19725); \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp index b7370dfd8eb..7e9399c7fcd 100644 --- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Shattrath_City SD%Complete: 100 -SDComment: Quest support: 10004, 10009, 10211. Flask vendors, Teleport to Caverns of Time +SDComment: Quest support: 10004, 10009, 10211, 10231. Flask vendors, Teleport to Caverns of Time SDCategory: Shattrath City EndScriptData */ @@ -27,10 +27,12 @@ npc_salsalabim npc_shattrathflaskvendors npc_zephyr npc_kservant +npc_dirty_larry EndContentData */ #include "precompiled.h" #include "../../npc/npc_escortAI.h" +#include "GridNotifiers.h" /*###### ## npc_raliq_the_drunk @@ -406,6 +408,179 @@ CreatureAI* GetAI_npc_kservantAI(Creature *_Creature) return (CreatureAI*)kservantAI; } +/*###### +# npc_dirty_larry +######*/ + +#define GOSSIP_BOOK "Ezekiel said that you might have a certain book..." +#define SAY_1 "Time to teach you a lesson in manners, little boy!" +#define SAY_2 "Now I'm gonna give you to the count of '3' to get out of here before I sick the dogs on you." +#define SAY_3 "1..." +#define SAY_4 "2..." +#define SAY_5 "Time to meet your maker!" +#define SAY_GIVEUP "Alright, we give up! Don't hurt us!" + +#define QUEST_WBI 10231 +#define NPC_CREEPJACK 19726 +#define NPC_MALONE 19725 + +struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI +{ + npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {Reset();} + + bool Event; + bool Attack; + bool Done; + + uint64 PlayerGUID; + + uint32 SayTimer; + uint32 Step; + + void Reset() + { + Event = false; + Attack = false; + Done = false; + + PlayerGUID = 0; + SayTimer = 0; + Step = 0; + + m_creature->setFaction(1194); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + if(Creepjack) + { + ((Creature*)Creepjack)->AI()->EnterEvadeMode(); + Creepjack->setFaction(1194); + } + Unit* Malone = FindCreature(NPC_MALONE, 20); + if(Malone) + { + ((Creature*)Malone)->AI()->EnterEvadeMode(); + Malone->setFaction(1194); + } + } + + uint32 NextStep(uint32 Step) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + switch(Step) + { + case 0:{ m_creature->SetInFront(player); + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + if(Creepjack) + Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + Unit* Malone = FindCreature(NPC_MALONE, 20); + if(Malone) + Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000; + case 1: DoSay(SAY_1, LANG_UNIVERSAL, player); return 3000; + case 2: DoSay(SAY_2, LANG_UNIVERSAL, player, true); return 5000; + case 3: DoSay(SAY_3, LANG_UNIVERSAL, player); return 2000; + case 4: DoSay(SAY_4, LANG_UNIVERSAL, player); return 2000; + case 5: DoSay(SAY_5, LANG_UNIVERSAL, player); return 2000; + case 6: Attack = true; return 2000; + default: return 0; + } + } + + void Aggro(Unit* who){} + + void UpdateAI(const uint32 diff) + { + if(SayTimer < diff) + { + if(Event) + SayTimer = NextStep(Step++); + }else SayTimer -= diff; + + if(Attack) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if(player) + { + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + if(Creepjack) + { + Creepjack->Attack(player, true); + Creepjack->setFaction(14); + Creepjack->GetMotionMaster()->MoveChase(player); + } + Unit* Malone = FindCreature(NPC_MALONE, 20); + if(Malone) + { + Malone->Attack(player, true); + Malone->setFaction(14); + Malone->GetMotionMaster()->MoveChase(player); + } + m_creature->SetInCombatWith(player); + DoStartMovement(player); + AttackStart(player); + } + Attack = false; + } + + if((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done) + { + Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20); + if(Creepjack) + { + ((Creature*)Creepjack)->AI()->EnterEvadeMode(); + Creepjack->setFaction(1194); + } + Unit* Malone = FindCreature(NPC_MALONE, 20); + if(Malone) + { + ((Creature*)Malone)->AI()->EnterEvadeMode(); + Malone->setFaction(1194); + } + m_creature->setFaction(1194); + Done = true; + DoSay(SAY_GIVEUP, LANG_UNIVERSAL, NULL); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + m_creature->GetMotionMaster()->MoveTargetedHome(); + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if(player) + ((Player*)player)->GroupEventHappens(QUEST_WBI, m_creature); + } + DoMeleeAttackIfReady(); + } +}; + +bool GossipHello_npc_dirty_larry(Player *player, Creature *creature) +{ + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if(player->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(0, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(creature->GetNpcTextId(), creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_dirty_larry(Player *player, Creature *creature, uint32 sender, uint32 action ) +{ + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + ((npc_dirty_larryAI*)creature->AI())->Event = true; + ((npc_dirty_larryAI*)creature->AI())->PlayerGUID = player->GetGUID(); + player->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +CreatureAI* GetAI_npc_dirty_larryAI(Creature *_Creature) +{ + return new npc_dirty_larryAI (_Creature); +} + void AddSC_shattrath_city() { Script *newscript; @@ -434,8 +609,15 @@ void AddSC_shattrath_city() newscript->pGossipSelect = &GossipSelect_npc_zephyr; newscript->RegisterSelf(); - newscript = new Script; + newscript = new Script; newscript->Name="npc_kservant"; newscript->GetAI = &GetAI_npc_kservantAI; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_dirty_larry"; + newscript->GetAI = &GetAI_npc_dirty_larryAI; + newscript->pGossipHello = &GossipHello_npc_dirty_larry; + newscript->pGossipSelect = &GossipSelect_npc_dirty_larry; + newscript->RegisterSelf(); } -- cgit v1.2.3 From e6503b9572a84252f0c3efd72719d2082d40088a Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sat, 10 Jan 2009 21:18:27 +0100 Subject: *Missed sql in prev commit --HG-- branch : trunk --- sql/updates/834_world_scripts.sql | 1 + src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 sql/updates/834_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/834_world_scripts.sql b/sql/updates/834_world_scripts.sql new file mode 100644 index 00000000000..14b3d74340e --- /dev/null +++ b/sql/updates/834_world_scripts.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_ishanah' WHERE `entry`=18538; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index 6e84e5d5d0c..7a633a30bb8 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -367,7 +367,7 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature) /*##### ## npc_wizzlecrank_shredder -#####*/ +##### #define SAY_PROGRESS_1 "Alright, alright I think I can figure out how to operate this thing..." #define SAY_PROGRESS_2 "Arrrgh! This isn't right!" @@ -424,7 +424,7 @@ CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature *_Creature) npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(_Creature); return (CreatureAI*)thisAI; -} +}*/ void AddSC_the_barrens() { @@ -453,9 +453,9 @@ void AddSC_the_barrens() newscript->GetAI = &GetAI_npc_twiggy_flathead; newscript->RegisterSelf(); - newscript = new Script; +/* newscript = new Script; newscript->Name="npc_wizzlecrank_shredder"; newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI; newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder; - newscript->RegisterSelf(); + newscript->RegisterSelf();*/ } -- cgit v1.2.3 From 7233c671c173ac4783fc4654d89135cd9809ab66 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sat, 10 Jan 2009 23:46:51 +0100 Subject: *Gossip for 18166 --HG-- branch : trunk --- sql/updates/837_world_scripts.sql | 1 + .../scripts/zone/shattrath/shattrath_city.cpp | 70 ++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 sql/updates/837_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/837_world_scripts.sql b/sql/updates/837_world_scripts.sql new file mode 100644 index 00000000000..9146566cf18 --- /dev/null +++ b/sql/updates/837_world_scripts.sql @@ -0,0 +1 @@ +update creature_template set scriptname='npc_khadgar' where entry=18166; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp index 5baa7f90f85..839c6ab1fe8 100644 --- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp @@ -29,6 +29,7 @@ npc_zephyr npc_kservant npc_dirty_larry npc_ishanah +npc_khadgar EndContentData */ #include "precompiled.h" @@ -590,6 +591,9 @@ CreatureAI* GetAI_npc_dirty_larryAI(Creature *_Creature) bool GossipHello_npc_ishanah(Player *player, Creature *_Creature) { + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu(_Creature->GetGUID()); + player->ADD_GOSSIP_ITEM(0, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->ADD_GOSSIP_ITEM(0, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -608,6 +612,66 @@ bool GossipSelect_npc_ishanah(Player *player, Creature *_Creature, uint32 sender return true; } +/*###### +# npc_khadgar +######*/ + +#define KHADGAR_GOSSIP_1 "I've heard your name spoken only in whispers, mage. Who are you?" +#define KHADGAR_GOSSIP_2 "Go on, please." +#define KHADGAR_GOSSIP_3 "I see." //6th too this +#define KHADGAR_GOSSIP_4 "What did you do then?" +#define KHADGAR_GOSSIP_5 "What happened next?" +#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you." + +bool GossipHello_npc_khadgar(Player *player, Creature *creature) +{ + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if(!player->hasQuest(10211)) + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(9243, creature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_khadgar(Player *player, Creature *creature, uint32 sender, uint32 action) +{ + switch(action) + { + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(9876, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->SEND_GOSSIP_MENU(9877, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(9878, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(9879, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + player->SEND_GOSSIP_MENU(9880, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + player->SEND_GOSSIP_MENU(9881, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(9243, creature->GetGUID()); + break; + } + return true; +} + void AddSC_shattrath_city() { Script *newscript; @@ -652,5 +716,11 @@ void AddSC_shattrath_city() newscript->Name="npc_ishanah"; newscript->pGossipHello = &GossipHello_npc_ishanah; newscript->pGossipSelect = &GossipSelect_npc_ishanah; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_khadgar"; + newscript->pGossipHello = &GossipHello_npc_khadgar; + newscript->pGossipSelect = &GossipSelect_npc_khadgar; newscript->RegisterSelf(); } -- cgit v1.2.3 From ca1c3cf7938c6a0d88769936e86b158072ec13f6 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 11 Jan 2009 02:23:11 +0100 Subject: *Support for quest 11129 - by Silver1ce --HG-- branch : trunk --- sql/updates/838_world_scripts.sql | 3 + .../scripts/scripts/zone/mulgore/mulgore.cpp | 115 ++++++++++++++++++++- 2 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 sql/updates/838_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/838_world_scripts.sql b/sql/updates/838_world_scripts.sql new file mode 100644 index 00000000000..ef963ffb168 --- /dev/null +++ b/sql/updates/838_world_scripts.sql @@ -0,0 +1,3 @@ +insert into `spell_script_target` values +('42222','1','23616'); +update `creature_template` set `scriptname`='npc_kyle_frenzied' where `entry`='23616'; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp index 44de5eab777..72125a8e2d9 100644 --- a/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp +++ b/src/bindings/scripts/scripts/zone/mulgore/mulgore.cpp @@ -17,12 +17,13 @@ /* ScriptData SDName: Mulgore SD%Complete: 100 -SDComment: Skorn Whitecloud: Just a story if not rewarded for quest +SDComment: Support for quest: 11129 SDCategory: Mulgore EndScriptData */ /* ContentData npc_skorn_whitecloud +npc_kyle_frenzied EndContentData */ #include "precompiled.h" @@ -52,13 +53,121 @@ bool GossipSelect_npc_skorn_whitecloud(Player *player, Creature *_Creature, uint return true; } +/*##### +# npc_kyle_frenzied +######*/ + +struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI +{ + npc_kyle_frenziedAI(Creature *c) : ScriptedAI(c) {Reset();} + + int STATE; + uint32 wait; + uint64 player; + + void Reset() + { + STATE = 0; + m_creature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); + m_creature->GetMotionMaster()->Initialize(); + } + void Aggro(Unit* who){} + + void SpellHit(Unit *caster, const SpellEntry* spell) + { // we can feed him without any quest + if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && ((Player*)caster)->GetTeam() == HORDE) + { + STATE = 1; + player = caster->GetGUID(); + float x, y, z, z2; + caster->GetPosition(x, y, z); + x = x + 3.7*cos(caster->GetOrientation()); + y = y + 3.7*sin(caster->GetOrientation()); + z2 = m_creature->GetBaseMap()->GetHeight(x,y,z,false); + z = (z2 <= INVALID_HEIGHT) ? z : z2; + m_creature->SetDefaultMovementType(IDLE_MOTION_TYPE); //there is other way to stop waypoint movement? + m_creature->GetMotionMaster()->Initialize(); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->GetMotionMaster()->MovePoint(0,x, y, z); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if(type == POINT_MOTION_TYPE) + { + switch(STATE) + { + case 1: + { + Unit *plr = Unit::GetUnit((*m_creature),player); + if(plr) + m_creature->SetOrientation(m_creature->GetAngle(plr)); + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING); //eat + WorldPacket data; + m_creature->BuildHeartBeatMsg(&data); + m_creature->SendMessageToSet(&data,true); + wait = 3000; + STATE = 2; + break; + } + case 4: + m_creature->setDeathState(JUST_DIED); + m_creature->Respawn(); + break; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!STATE || STATE == 4) + return; + if(wait < diff) + { + switch(STATE) + { + case 2: + STATE = 3; wait = 7000; + m_creature->UpdateEntry(23622,HORDE); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); + break; + case 3: + STATE = 4; //go home + Unit *plr = Unit::GetUnit((*m_creature),player); + if(plr && ((Player*)plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE) + ((Player*)plr)->CompleteQuest(11129); + float x, y, z, z2, angle; + angle = m_creature->GetAngle(-2146, -430); + m_creature->GetPosition(x,y,z); + x = x + 40*cos(angle); + y = y + 40*sin(angle); + z2 = m_creature->GetBaseMap()->GetHeight(x,y,MAX_HEIGHT,false); + z = (z2 <= INVALID_HEIGHT) ? z : z2; + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + break; + } + }else wait -= diff; + } +}; + +CreatureAI* GetAI_npc_kyle_frenzied(Creature *_Creature) +{ + return new npc_kyle_frenziedAI (_Creature); +} + void AddSC_mulgore() { Script *newscript; newscript = new Script; newscript->Name="npc_skorn_whitecloud"; - newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud; - newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud; + newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud; + newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_kyle_frenzied"; + newscript->GetAI = &GetAI_npc_kyle_frenzied; newscript->RegisterSelf(); } -- cgit v1.2.3 From aba4f5927dbe2d4025f3395d34d537ecedd119f1 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 11 Jan 2009 02:23:57 +0100 Subject: *Support for quest 863 --HG-- branch : trunk --- sql/updates/839_world_script.sql | 1 + .../scripts/scripts/zone/barrens/the_barrens.cpp | 99 ++++++++++++++++++++-- 2 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 sql/updates/839_world_script.sql (limited to 'sql/updates') diff --git a/sql/updates/839_world_script.sql b/sql/updates/839_world_script.sql new file mode 100644 index 00000000000..722737ea3b0 --- /dev/null +++ b/sql/updates/839_world_script.sql @@ -0,0 +1 @@ +update creature_template set scriptname='npc_wizzlecrank_shredder' where entry=3439; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index 7a633a30bb8..cf35c4b9bc7 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -366,8 +366,8 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature) } /*##### -## npc_wizzlecrank_shredder -##### +## npc_wizzlecrank_shredder TODO: Pilot scripting +#####*/ #define SAY_PROGRESS_1 "Alright, alright I think I can figure out how to operate this thing..." #define SAY_PROGRESS_2 "Arrrgh! This isn't right!" @@ -380,8 +380,8 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature) #define SAY_PROGRESS_7 "That was a close one! Well, let's get going, it's still a ways to Ratchet!" #define SAY_PROGRESS_8 "Hmm... I don't think this blinking red light is a good thing..." -#define SAY_PILOT_10 "Looks like you'll have to go ahead to Ratchet and tell Sputtervalve that I've wrecked the shredder." -#define SAY_PILOT_11 "I'll stay behind and guard the wreck. Hurry! Hopefully no one will notice the smoke..." +#define SAY_PILOT_9 "Looks like you'll have to go ahead to Ratchet and tell Sputtervalve that I've wrecked the shredder." +#define SAY_PILOT_10 "I'll stay behind and guard the wreck. Hurry! Hopefully no one will notice the smoke..." #define QUEST_ESCAPE 863 #define NPC_PILOT 3451 @@ -393,16 +393,61 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI void WaypointReached(uint32 i) { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if(!player) + return; + switch(i) { + case 0: DoSay(SAY_PROGRESS_1, LANG_UNIVERSAL, NULL); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 1: DoSay(SAY_PROGRESS_2, LANG_UNIVERSAL, NULL); break; + case 10: DoSay(SAY_PROGRESS_3, LANG_UNIVERSAL, player); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 20:{ + Unit* Mercenary = FindCreature(MOB_MERCENARY, 99); + if(Mercenary) + { + ((Creature*)Mercenary)->Yell(SAY_MERCENARY_4, LANG_UNIVERSAL, NULL); + Mercenary->Attack(m_creature, true); + } + }break; + case 21: DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, NULL); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; + case 28: DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, NULL); break; + case 29: DoSay(SAY_PROGRESS_7, LANG_UNIVERSAL, NULL); break; + case 30: DoSay(SAY_PROGRESS_8, LANG_UNIVERSAL, NULL); break; + case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); + m_creature->setDeathState(JUST_DIED); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_ESCAPE, m_creature); + break; + case 32: {Unit* Pilot = FindCreature(NPC_PILOT, 30); + if(Pilot) + ((Creature*)Pilot)->Say(SAY_PILOT_9, LANG_UNIVERSAL, NULL);}break; + case 33:{ Unit* Pilot = FindCreature(NPC_PILOT, 30); + if(Pilot) + ((Creature*)Pilot)->Say(SAY_PILOT_10, LANG_UNIVERSAL, NULL);} break; } } - void Reset(){} + void Reset() + { + m_creature->setDeathState(ALIVE); + } void Aggro(Unit* who){} - void JustDied(Unit* killer){} + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_ESCAPE); + } + } void UpdateAI(const uint32 diff) { @@ -415,6 +460,7 @@ bool QuestAccept_npc_wizzlecrank_shredder(Player* player, Creature* creature, Qu if (quest->GetQuestId() == QUEST_ESCAPE) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + creature->setFaction(35); } return true; } @@ -423,8 +469,43 @@ CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature *_Creature) { npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(_Creature); + thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000);//say1 spw + thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000);//say2 crazy running + thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000); + thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000); + thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000); + thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000); + thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000); + thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000); + thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000); + thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000); + thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000);//end of crazy running + thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); + thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); + thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); + thisAI->AddWaypoint(14, 1096.97, -3051,99, 82.50); + thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); + thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); + thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); + thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08); + thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000);//twice + thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000);//mercenary + thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000);//say + thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46);//crazy running + thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81); + thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59); + thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81); + thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67); + thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73); + thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000);//6 + thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000);//7 + thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000);//8 + thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000);//justdied summon creature + thisAI->AddWaypoint(32, 1091.28, -2985.82, 91.74, 2000);//9 + thisAI->AddWaypoint(33, 1091.28, -2985.82, 91.74, 7000);//10 + return (CreatureAI*)thisAI; -}*/ +} void AddSC_the_barrens() { @@ -453,9 +534,9 @@ void AddSC_the_barrens() newscript->GetAI = &GetAI_npc_twiggy_flathead; newscript->RegisterSelf(); -/* newscript = new Script; + newscript = new Script; newscript->Name="npc_wizzlecrank_shredder"; newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI; newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder; - newscript->RegisterSelf();*/ + newscript->RegisterSelf(); } -- cgit v1.2.3 From bc1a40bed21a28de2c005d9f239b0927536b32ff Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 11 Jan 2009 10:04:26 +0100 Subject: *Corrected vulcanos by Supremus for phase switching - by Anubisss --HG-- branch : trunk --- sql/updates/839_world_script.sql | 1 - sql/updates/839_world_scripts.sql | 1 + sql/updates/840_world_scripts.sql | 1 + .../scripts/zone/black_temple/boss_supremus.cpp | 62 ++++++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) delete mode 100644 sql/updates/839_world_script.sql create mode 100644 sql/updates/839_world_scripts.sql create mode 100644 sql/updates/840_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/839_world_script.sql b/sql/updates/839_world_script.sql deleted file mode 100644 index 722737ea3b0..00000000000 --- a/sql/updates/839_world_script.sql +++ /dev/null @@ -1 +0,0 @@ -update creature_template set scriptname='npc_wizzlecrank_shredder' where entry=3439; \ No newline at end of file diff --git a/sql/updates/839_world_scripts.sql b/sql/updates/839_world_scripts.sql new file mode 100644 index 00000000000..722737ea3b0 --- /dev/null +++ b/sql/updates/839_world_scripts.sql @@ -0,0 +1 @@ +update creature_template set scriptname='npc_wizzlecrank_shredder' where entry=3439; \ No newline at end of file diff --git a/sql/updates/840_world_scripts.sql b/sql/updates/840_world_scripts.sql new file mode 100644 index 00000000000..8b0140b6dbb --- /dev/null +++ b/sql/updates/840_world_scripts.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `spell1` = 0, `flags_extra` = 0, `ScriptName` = 'npc_volcano' WHERE `entry` = 23085; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp index 6c642ea41a3..ea7fc3cbd1e 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp @@ -193,6 +193,9 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI { if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) { + if(!target) + target = m_creature->getVictim(); + DoCast(target, SPELL_VOLCANIC_SUMMON); DoScriptText(EMOTE_GROUND_CRACK, m_creature); SummonVolcanoTimer = 10000; @@ -226,6 +229,55 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI } }; +struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI +{ + npc_volcanoAI(Creature *c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } + + ScriptedInstance *pInstance; + + uint32 CheckTimer; + bool Eruption; + + void Reset() + { + CheckTimer = 1500; + Eruption = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void Aggro(Unit *who) {} + + void MoveInLineOfSight(Unit *who) + { + return; // paralyze the npc + } + + void UpdateAI(const uint32 diff) + { + if(CheckTimer < diff) + { + uint64 SupremusGUID = pInstance->GetData64(DATA_SUPREMUS); + Creature* Supremus = ((Creature*)Unit::GetUnit((*m_creature), SupremusGUID)); + if(!Eruption && !((boss_supremusAI*)Supremus->AI())->Phase1) + { + Eruption = true; + DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + } + else if(Eruption && ((boss_supremusAI*)Supremus->AI())->Phase1) + { + m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION, 0); + } + CheckTimer = 1500; + }else CheckTimer -= diff; + } +}; + CreatureAI* GetAI_boss_supremus(Creature *_Creature) { return new boss_supremusAI (_Creature); @@ -236,6 +288,11 @@ CreatureAI* GetAI_molten_flame(Creature *_Creature) return new molten_flameAI (_Creature); } +CreatureAI* GetAI_npc_volcano(Creature *_Creature) +{ + return new npc_volcanoAI (_Creature); +} + void AddSC_boss_supremus() { Script *newscript; @@ -247,5 +304,10 @@ void AddSC_boss_supremus() newscript = new Script; newscript->Name="molten_flame"; newscript->GetAI = &GetAI_molten_flame; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_volcano"; + newscript->GetAI = &GetAI_npc_volcano; newscript->RegisterSelf(); } -- cgit v1.2.3 From d719fb27072e8dafb8b650c150cb8660e065388b Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 11 Jan 2009 13:00:27 +0100 Subject: *Support for quest 11541 --HG-- branch : trunk --- sql/updates/841_world_scripts.sql | 1 + .../zone/isle_of_queldanas/isle_of_queldanas.cpp | 65 +++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 sql/updates/841_world_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/841_world_scripts.sql b/sql/updates/841_world_scripts.sql new file mode 100644 index 00000000000..f23cb8f8cc8 --- /dev/null +++ b/sql/updates/841_world_scripts.sql @@ -0,0 +1 @@ +update creature_template set scriptname='npc_greengill_slave' where entry=25084; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp index ca9414a3077..903787adebe 100644 --- a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp +++ b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp @@ -17,7 +17,7 @@ /* ScriptData SDName: Isle_of_Queldanas SD%Complete: 100 -SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543 +SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541 SDCategory: Isle Of Quel'Danas EndScriptData */ @@ -25,6 +25,7 @@ EndScriptData */ npc_ayren_cloudbreaker npc_converted_sentry npc_unrestrained_dragonhawk +npc_greengill_slave EndContentData */ #include "precompiled.h" @@ -132,6 +133,63 @@ bool GossipSelect_npc_unrestrained_dragonhawk(Player *player, Creature *_Creatur return true; } +/*###### +## npc_greengill_slave +######*/ + +#define ENRAGE 45111 +#define ORB 45109 +#define QUESTG 11541 +#define DM 25060 + +struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI +{ + npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {Reset();} + + uint64 PlayerGUID; + + void Aggro(Unit* who){} + + void Reset() + { + PlayerGUID = 0; + } + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if(!caster) + return; + + if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE, 0)) + { + PlayerGUID = caster->GetGUID(); + if(PlayerGUID) + { + Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID); + if(plr && ((Player*)plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) + ((Player*)plr)->KilledMonster(25086, m_creature->GetGUID()); + } + DoCast(m_creature, ENRAGE); + Unit* Myrmidon = FindCreature(DM, 70); + if(Myrmidon) + { + m_creature->AddThreat(Myrmidon, 100000.0f); + AttackStart(Myrmidon); + } + } + } + + void UpdateAI(const uint32 diff) + { + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_greengill_slaveAI(Creature* _Creature) +{ + return new npc_greengill_slaveAI(_Creature); +} + void AddSC_isle_of_queldanas() { Script *newscript; @@ -152,4 +210,9 @@ void AddSC_isle_of_queldanas() newscript->pGossipHello = &GossipHello_npc_unrestrained_dragonhawk; newscript->pGossipSelect = &GossipSelect_npc_unrestrained_dragonhawk; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_greengill_slave"; + newscript->GetAI = &GetAI_npc_greengill_slaveAI; + newscript->RegisterSelf(); } -- cgit v1.2.3 From ca342a8815f3c99119de6723c3f775baac6849c8 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 11 Jan 2009 16:47:44 +0100 Subject: *Implemented requires_heroic_quest_done in areatrigger_teleport - by Anubisss --HG-- branch : trunk --- sql/updates/842_world.sql | 5 +++++ src/game/MiscHandler.cpp | 8 +++++++- src/game/ObjectMgr.cpp | 41 ++++++++++++++++++++++++++--------------- src/game/ObjectMgr.h | 2 ++ 4 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 sql/updates/842_world.sql (limited to 'sql/updates') diff --git a/sql/updates/842_world.sql b/sql/updates/842_world.sql new file mode 100644 index 00000000000..953dff584a0 --- /dev/null +++ b/sql/updates/842_world.sql @@ -0,0 +1,5 @@ +ALTER TABLE `areatrigger_teleport` +ADD `heroic_required_quest_done` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `heroic_key2`, +ADD `heroic_required_failed_quest_text` TEXT NULL DEFAULT NULL AFTER `heroic_required_quest_done`; + +UPDATE `areatrigger_teleport` SET `heroic_required_quest_done` = 11492, `heroic_required_failed_quest_text` = 'Heroic Difficulty requires completion of the "Hard to Kill" quest.' WHERE `id` = 4887; \ No newline at end of file diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index dcf1f158e92..cfba9a5f7c4 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -860,6 +860,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) missingItem = at->requiredItem2; uint32 missingKey = 0; + uint32 missingHeroicQuest = 0; if(GetPlayer()->GetDifficulty() == DIFFICULTY_HEROIC) { if(at->heroicKey) @@ -870,19 +871,24 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) } else if(at->heroicKey2 && !GetPlayer()->HasItemCount(at->heroicKey2, 1)) missingKey = at->heroicKey2; + + if(at->heroicQuest && !GetPlayer()->GetQuestRewardStatus(at->heroicQuest)) + missingHeroicQuest = at->heroicQuest; } uint32 missingQuest = 0; if(at->requiredQuest && !GetPlayer()->GetQuestRewardStatus(at->requiredQuest)) missingQuest = at->requiredQuest; - if(missingLevel || missingItem || missingKey || missingQuest) + if(missingLevel || missingItem || missingKey || missingQuest || missingHeroicQuest) { // TODO: all this is probably wrong if(missingItem) SendAreaTriggerMessage(GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, objmgr.GetItemPrototype(missingItem)->Name1); else if(missingKey) GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY2); + else if(missingHeroicQuest) + SendAreaTriggerMessage(at->heroicQuestFailedText.c_str()); else if(missingQuest) SendAreaTriggerMessage(at->requiredFailedText.c_str()); else if(missingLevel) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 8d14db9e377..6ceb9a08334 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -5112,9 +5112,9 @@ void ObjectMgr::LoadAreaTriggerTeleports() uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 9 10 11 12 - QueryResult *result = WorldDatabase.Query("SELECT id, required_level, required_item, required_item2, heroic_key, heroic_key2, required_quest_done, required_failed_text, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport"); - if( !result ) + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + QueryResult *result = WorldDatabase.Query("SELECT id, required_level, required_item, required_item2, heroic_key, heroic_key2, heroic_required_quest_done, heroic_required_failed_quest_text, required_quest_done, required_failed_text, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport"); + if( !result ) { barGoLink bar( 1 ); @@ -5140,18 +5140,20 @@ void ObjectMgr::LoadAreaTriggerTeleports() AreaTrigger at; - at.requiredLevel = fields[1].GetUInt8(); - at.requiredItem = fields[2].GetUInt32(); - at.requiredItem2 = fields[3].GetUInt32(); - at.heroicKey = fields[4].GetUInt32(); - at.heroicKey2 = fields[5].GetUInt32(); - at.requiredQuest = fields[6].GetUInt32(); - at.requiredFailedText = fields[7].GetCppString(); - at.target_mapId = fields[8].GetUInt32(); - at.target_X = fields[9].GetFloat(); - at.target_Y = fields[10].GetFloat(); - at.target_Z = fields[11].GetFloat(); - at.target_Orientation = fields[12].GetFloat(); + at.requiredLevel = fields[1].GetUInt8(); + at.requiredItem = fields[2].GetUInt32(); + at.requiredItem2 = fields[3].GetUInt32(); + at.heroicKey = fields[4].GetUInt32(); + at.heroicKey2 = fields[5].GetUInt32(); + at.heroicQuest = fields[6].GetUInt32(); + at.heroicQuestFailedText = fields[7].GetCppString(); + at.requiredQuest = fields[8].GetUInt32(); + at.requiredFailedText = fields[9].GetCppString(); + at.target_mapId = fields[10].GetUInt32(); + at.target_X = fields[11].GetFloat(); + at.target_Y = fields[12].GetFloat(); + at.target_Z = fields[13].GetFloat(); + at.target_Orientation = fields[14].GetFloat(); AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if(!atEntry) @@ -5199,6 +5201,15 @@ void ObjectMgr::LoadAreaTriggerTeleports() } } + if(at.heroicQuest) + { + if(!mQuestTemplates[at.heroicQuest]) + { + sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",at.heroicQuest,Trigger_ID); + at.heroicQuest = 0; + } + } + if(at.requiredQuest) { if(!mQuestTemplates[at.requiredQuest]) diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index cca03ae39a3..b942ae21c37 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -107,6 +107,8 @@ struct AreaTrigger uint32 requiredItem2; uint32 heroicKey; uint32 heroicKey2; + uint32 heroicQuest; + std::string heroicQuestFailedText; uint32 requiredQuest; std::string requiredFailedText; uint32 target_mapId; -- cgit v1.2.3