Core/Script: Messenger Torvus.

(cherry picked from commit 924cdb9a11b1d419080045e6bb7fee164f6f000c)
This commit is contained in:
SnapperRy
2017-11-05 12:46:29 +01:00
committed by joschiwald
parent 5130139733
commit 0afa672077
2 changed files with 35 additions and 0 deletions
@@ -0,0 +1,8 @@
--
DELETE FROM `creature_text` WHERE `CreatureID`=26649;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(26649, 0, 0, "Pssst... Over here, by the mailbox. Come quickly and make sure you aren't followed.", 15, 0, 100, 0, 0, 0, 25823, 0, "Borus Ironbender");
DELETE FROM `areatrigger_scripts` WHERE `entry`=4960;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(4960, "at_nearby_messenger_torvus");
@@ -30,6 +30,7 @@ EndContentData */
#include "CombatAI.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
@@ -701,6 +702,31 @@ class npc_torturer_lecraft : public CreatureScript
}
};
enum MessengerTorvus
{
NPC_MESSENGER_TORVUS = 26649,
QUEST_MESSAGE_FROM_THE_WEST = 12033,
TALK_0 = 0
};
class at_nearby_messenger_torvus : public AreaTriggerScript
{
public:
at_nearby_messenger_torvus() : AreaTriggerScript("at_nearby_messenger_torvus") { }
bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/, bool entered) override
{
if (player && player->IsAlive() && entered)
if (const Quest* quest = sObjectMgr->GetQuestTemplate(QUEST_MESSAGE_FROM_THE_WEST))
if (player->CanTakeQuest(quest, false))
if (Creature* creature = player->FindNearestCreature(NPC_MESSENGER_TORVUS, 50.0f, true))
creature->AI()->Talk(TALK_0, player);
return true;
}
};
void AddSC_dragonblight()
{
new npc_commander_eligor_dawnbringer();
@@ -708,4 +734,5 @@ void AddSC_dragonblight()
new spell_q12096_q12092_bark();
new npc_wyrmrest_defender();
new npc_torturer_lecraft();
new at_nearby_messenger_torvus();
}