diff options
author | Drahy <none@none> | 2009-04-15 21:40:09 +0200 |
---|---|---|
committer | Drahy <none@none> | 2009-04-15 21:40:09 +0200 |
commit | e3bd7fed4e06827ed1337dd80f85e83304ba28fe (patch) | |
tree | ee3e1f562f6d27673d11c84ce33068a8ee9b6e36 | |
parent | 49b5e021caea81914cdf1dd68dfda4529e2914c1 (diff) |
* Added gossip option related to quest 12791, 12794 and 12796 - Thx SD2 team
--HG--
branch : trunk
-rw-r--r-- | sql/updates/2706_world_SD2_scripts.sql | 4 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/npc/npcs_special.cpp | 45 |
2 files changed, 49 insertions, 0 deletions
diff --git a/sql/updates/2706_world_SD2_scripts.sql b/sql/updates/2706_world_SD2_scripts.sql new file mode 100644 index 00000000000..cd9c4ea3b19 --- /dev/null +++ b/sql/updates/2706_world_SD2_scripts.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='npc_kingdom_of_dalaran_quests' WHERE entry IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162);
+DELETE FROM spell_target_position WHERE id=53360;
+INSERT INTO spell_target_position VALUES
+(53360, 571, 5807.829, 587.960, 660.939, 1.663);
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 49bc64e9021..3084b57e956 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -29,6 +29,7 @@ npc_guardian 100% guardianAI used to prevent players from accessin npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 565 npc_injured_patient 100% patients for triage-quests (6622 and 6624) npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage) +npc_kingdom_of_dalaran_quests Misc NPC's gossip option related to quests 12791, 12794 and 12796 npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681 npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given @@ -877,6 +878,44 @@ CreatureAI* GetAI_npc_guardian(Creature *_Creature) } /*###### +## npc_kingdom_of_dalaran_quests +######*/ + +enum +{ + SPELL_TELEPORT_DALARAN = 53360, + ITEM_KT_SIGNET = 39740, + QUEST_MAGICAL_KINGDOM_A = 12794, + QUEST_MAGICAL_KINGDOM_H = 12791, + QUEST_MAGICAL_KINGDOM_N = 12796 +}; + +#define GOSSIP_ITEM_TELEPORT_TO "I am ready to be teleported to Dalaran." + +bool GossipHello_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasItemCount(ITEM_KT_SIGNET,1) && (!pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_A) || + !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_H) || !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_N))) + pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_TELEPORT_TO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,SPELL_TELEPORT_DALARAN,false); + } + return true; +} + +/*###### ## npc_mount_vendor ######*/ @@ -1418,6 +1457,12 @@ void AddSC_npcs_special() newscript->RegisterSelf(); newscript = new Script; + newscript->Name="npc_kingdom_of_dalaran_quests"; + newscript->pGossipHello = &GossipHello_npc_kingdom_of_dalaran_quests; + newscript->pGossipSelect = &GossipSelect_npc_kingdom_of_dalaran_quests; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name="npc_mount_vendor"; newscript->pGossipHello = &GossipHello_npc_mount_vendor; newscript->pGossipSelect = &GossipSelect_npc_mount_vendor; |