diff options
author | Supabad <supabad.trinity@gmail.com> | 2011-04-05 15:15:15 +0200 |
---|---|---|
committer | leak <leakzx@googlemail.com> | 2011-04-06 11:35:50 +0200 |
commit | 3e22e88f4e0a56f191121d878fcae53f95b371b7 (patch) | |
tree | 61b094ad041446a8281892b4d78ade963d68088a | |
parent | dc8fd3cbc3740f226862045f2f23c3da8320b3bf (diff) |
Scripts/Nagrand: Add core support for quest 9923,9924,9955
-rw-r--r-- | sql/scripts/world_script_texts.sql | 3 | ||||
-rw-r--r-- | sql/scripts/world_scripts_full.sql | 2 | ||||
-rw-r--r-- | sql/updates/world/2011_04_03_12_world_script_text.sql | 5 | ||||
-rw-r--r-- | sql/updates/world/2011_04_03_12_world_scriptname.sql | 2 | ||||
-rw-r--r-- | src/server/scripts/Outland/nagrand.cpp | 118 |
5 files changed, 127 insertions, 3 deletions
diff --git a/sql/scripts/world_script_texts.sql b/sql/scripts/world_script_texts.sql index b1cea599a86..30356654038 100644 --- a/sql/scripts/world_script_texts.sql +++ b/sql/scripts/world_script_texts.sql @@ -570,6 +570,9 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1` (0,-1800068,'Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man''s heart. ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,11,1,'npc_anchorite_truuen - SAY_WP_4'), (0,-1800069,'Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire. ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,11,1,'npc_anchorite_truuen - SAY_WP_5'), (0,-1800070,'Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she''ll be keenly interested to know of what has transpired here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,11,1,'npc_anchorite_truuen - SAY_WP_6'), + (18445,-1800071,'Thanks, $C! I''m sure my dad will reward you greatly! Bye!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,NULL), + (20812,-1800072,'This is the last time I get caught!I promise! Bye!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,NULL), + (18369,-1800073,'Thank you for saving me again!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,NULL), -- -1 033 000 SHADOWFANG KEEP (0,-1033000,'Follow me and I''ll open the courtyard door for you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,7,1,'prisoner ashcrombe SAY_FREE_AS'), diff --git a/sql/scripts/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql index e0ae3293d62..5aaf10881f6 100644 --- a/sql/scripts/world_scripts_full.sql +++ b/sql/scripts/world_scripts_full.sql @@ -1009,6 +1009,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_lantresor_of_the_blade' WHERE ` UPDATE `creature_template` SET `ScriptName`='npc_creditmarker_visit_with_ancestors' WHERE `entry` IN (18840,18841,18842,18843); UPDATE `creature_template` SET `ScriptName`='mob_sparrowhawk' WHERE `entry`=22979; UPDATE `creature_template` SET `ScriptName`='npc_maghar_captive' WHERE `entry`=18210; +UPDATE `creature_template` SET `ScriptName`='npc_corki' WHERE `entry` IN (18445,20812,18369); +UPDATE `gameobject_template` SET `ScriptName`='go_corkis_prison' WHERE `entry` IN (182349,182350,182521); /* NAXXRAMAS */ UPDATE `instance_template` SET `script`='instance_naxxramas' WHERE `map`=533; diff --git a/sql/updates/world/2011_04_03_12_world_script_text.sql b/sql/updates/world/2011_04_03_12_world_script_text.sql new file mode 100644 index 00000000000..a0755059223 --- /dev/null +++ b/sql/updates/world/2011_04_03_12_world_script_text.sql @@ -0,0 +1,5 @@ +DELETE FROM `script_texts` WHERE `npc_entry` IN (18445,20812,18369); +INSERT INTO `script_texts` (`npc_entry`, `entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES +(18445,-1800071, 'Thanks, $C! I''m sure my dad will reward you greatly! Bye!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,NULL), +(20812,-1800072, 'This is the last time I get caught!I promise! Bye!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,NULL), +(18369,-1800073, 'Thank you for saving me again!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,NULL); diff --git a/sql/updates/world/2011_04_03_12_world_scriptname.sql b/sql/updates/world/2011_04_03_12_world_scriptname.sql new file mode 100644 index 00000000000..69b8d5b7120 --- /dev/null +++ b/sql/updates/world/2011_04_03_12_world_scriptname.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_corki' WHERE `entry` IN (18445,20812,18369); +UPDATE `gameobject_template` SET `ScriptName` = 'go_corkis_prison' WHERE `entry` IN (182349,182350,182521); diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 4a53c3d7d02..de2f215bbec 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -891,12 +891,122 @@ public: return; } }; +}; +enum corki +{ + // first quest + QUEST_HELP = 9923, + NPC_CORKI = 18445, + GO_CORKIS_PRISON = 182349, + CORKI_SAY_THANKS = -1800071, + // 2nd quest + QUEST_CORKIS_GONE_MISSING_AGAIN = 9924, + NPC_CORKI_2 = 20812, + GO_CORKIS_PRISON_2 = 182350, + CORKI_SAY_PROMISE = -1800072, + // 3rd quest + QUEST_CHOWAR_THE_PILLAGER = 9955, + NPC_CORKI_3 = 18369, + NPC_CORKI_CREDIT = 18444, + GO_CORKIS_PRISON_3 = 182521, + CORKI_SAY_LAST = -1800073 }; -/*#### -# -####*/ +class go_corkis_prison : public GameObjectScript +{ +public: + go_corkis_prison() : GameObjectScript("go_corkis_prison") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + if (go->GetEntry() == GO_CORKIS_PRISON) + { + if (Creature* corki = go->FindNearestCreature(NPC_CORKI, 25, true)) + { + go->SetGoState(GO_STATE_READY); + corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ()); + if (player) + player->KilledMonsterCredit(NPC_CORKI, 0); + } + } + if (go->GetEntry() == GO_CORKIS_PRISON_2) + { + if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true)) + { + go->SetGoState(GO_STATE_READY); + corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()-5, go->GetPositionY(), go->GetPositionZ()); + if (player) + player->KilledMonsterCredit(NPC_CORKI_2, 0); + } + } + if (go->GetEntry() == GO_CORKIS_PRISON_3) + { + if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true)) + { + go->SetGoState(GO_STATE_READY); + corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+4, go->GetPositionY(), go->GetPositionZ()); + if (player) + player->KilledMonsterCredit(NPC_CORKI_CREDIT, 0); + } + } + return true; + } +}; + +/*###### +## npc_corki +######*/ + +class npc_corki : public CreatureScript +{ +public: + npc_corki() : CreatureScript("npc_corki") { } + + CreatureAI *GetAI(Creature *creature) const + { + return new npc_corkiAI(creature); + } + + struct npc_corkiAI : public ScriptedAI + { + npc_corkiAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 Say_Timer; + bool ReleasedFromCage; + + void Reset() + { + ReleasedFromCage = false; + } + + void UpdateAI(uint32 const diff) + { + if (Say_Timer <= diff && ReleasedFromCage) + { + me->ForcedDespawn(); + ReleasedFromCage = false; + } + else + Say_Timer -= diff; + } + + void MovementInform(uint32 type, uint32 id) + { + if (id == 1) + { + Say_Timer = 5000; + ReleasedFromCage = true; + if (me->GetEntry() == NPC_CORKI) + DoScriptText(CORKI_SAY_THANKS, me); + if (me->GetEntry() == NPC_CORKI_2) + DoScriptText(CORKI_SAY_PROMISE, me); + if (me->GetEntry() == NPC_CORKI_3) + DoScriptText(CORKI_SAY_LAST, me); + } + }; + }; +}; void AddSC_nagrand() { @@ -909,4 +1019,6 @@ void AddSC_nagrand() new npc_maghar_captive(); new npc_creditmarker_visit_with_ancestors(); new mob_sparrowhawk(); + new npc_corki(); + new go_corkis_prison(); } |