diff options
-rw-r--r-- | sql/updates/world/2015_11_06_38_world_2015_10_03_00.sql | 11 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 42 |
2 files changed, 39 insertions, 14 deletions
diff --git a/sql/updates/world/2015_11_06_38_world_2015_10_03_00.sql b/sql/updates/world/2015_11_06_38_world_2015_10_03_00.sql new file mode 100644 index 00000000000..4a5aedb13d4 --- /dev/null +++ b/sql/updates/world/2015_11_06_38_world_2015_10_03_00.sql @@ -0,0 +1,11 @@ +-- +-- Salanar the Horseman (NPC 28788) say line in Realm of Shadows +SET @ENTRY := 28788; +DELETE FROM `creature_text` WHERE `entry` = @ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(@ENTRY,0,0,'Impressive, death knight. Return to me in the world of the living for your reward.',12,0,100,0,0,0,28835,0,'SALANAR_SAY'); + +-- Salanar the Horseman (NPC 28653) conditions for the gossip_menu_option to be shown for Into the Realm of Shadows +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9739 AND `ConditionValue1`=12687; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9739,0,0,0,9,0,12687,0,0,0,0,0,'','Salanar the Horseman - Show gossip option only if player has accepted quest 12687, but not completed it.'); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 238ca194a65..44d48e3f0bb 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -731,13 +731,19 @@ class npc_dark_rider_of_acherus : public CreatureScript ## npc_salanar_the_horseman ######*/ -enum Spells_Salanar +enum SalanarTheHorseman { - SPELL_REALM_OF_SHADOWS = 52693, + GOSSIP_SALANAR_MENU = 9739, + GOSSIP_SALANAR_OPTION = 0, + SALANAR_SAY = 0, + QUEST_INTO_REALM_OF_SHADOWS = 12687, + NPC_DARK_RIDER_OF_ACHERUS = 28654, + NPC_SALANAR_IN_REALM_OF_SHADOWS = 28788, SPELL_EFFECT_STOLEN_HORSE = 52263, SPELL_DELIVER_STOLEN_HORSE = 52264, SPELL_CALL_DARK_RIDER = 52266, - SPELL_EFFECT_OVERTAKE = 52349 + SPELL_EFFECT_OVERTAKE = 52349, + SPELL_REALM_OF_SHADOWS = 52693 }; class npc_salanar_the_horseman : public CreatureScript @@ -745,15 +751,19 @@ class npc_salanar_the_horseman : public CreatureScript public: npc_salanar_the_horseman() : CreatureScript("npc_salanar_the_horseman") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_salanar_the_horsemanAI(creature); - } - struct npc_salanar_the_horsemanAI : public ScriptedAI { npc_salanar_the_horsemanAI(Creature* creature) : ScriptedAI(creature) { } + void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override + { + if (menuId == GOSSIP_SALANAR_MENU && gossipListId == GOSSIP_SALANAR_OPTION) + { + player->CastSpell(player, SPELL_REALM_OF_SHADOWS, true); + player->PlayerTalkClass->SendCloseGossip(); + } + } + void SpellHit(Unit* caster, const SpellInfo* spell) override { if (spell->Id == SPELL_DELIVER_STOLEN_HORSE) @@ -768,7 +778,7 @@ public: caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); caster->setFaction(35); DoCast(caster, SPELL_CALL_DARK_RIDER, true); - if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) + if (Creature* Dark_Rider = me->FindNearestCreature(NPC_DARK_RIDER_OF_ACHERUS, 15)) ENSURE_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); } } @@ -786,10 +796,11 @@ public: { if (Player* player = charmer->ToPlayer()) { - // for quest Into the Realm of Shadows(12687) - if (me->GetEntry() == 28788 && player->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) + // for quest Into the Realm of Shadows(QUEST_INTO_REALM_OF_SHADOWS) + if (me->GetEntry() == NPC_SALANAR_IN_REALM_OF_SHADOWS && player->GetQuestStatus(QUEST_INTO_REALM_OF_SHADOWS) == QUEST_STATUS_INCOMPLETE) { - player->GroupEventHappens(12687, me); + player->GroupEventHappens(QUEST_INTO_REALM_OF_SHADOWS, me); + Talk(SALANAR_SAY); charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); if (Creature* creature = who->ToCreature()) { @@ -798,14 +809,17 @@ public: } } - if (player->HasAura(SPELL_REALM_OF_SHADOWS)) - player->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); + player->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); } } } } }; + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_salanar_the_horsemanAI(creature); + } }; /*###### |