Merge remote-tracking branch 'velinath/sai-migrations' into 3.3.5-base

This commit is contained in:
treeston
2016-01-12 18:32:51 +01:00
3 changed files with 125 additions and 119 deletions

View File

@@ -1,117 +0,0 @@
/*
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Npc_Taxi
SD%Complete: 0%
SDComment: To be used for taxi NPCs that are located globally.
SDCategory: NPCs
EndScriptData
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Player.h"
#include "WorldSession.h"
#define GOSSIP_SUSURRUS "I am ready."
#define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!"
#define GOSSIP_BRAZEN "I am ready to go to Durnholde Keep."
#define GOSSIP_VERONIA "Fly me to Manaforge Coruu please"
#define GOSSIP_CRIMSONWING "<Ride the gryphons to Survey Alcaz Island>"
class npc_taxi : public CreatureScript
{
public:
npc_taxi() : CreatureScript("npc_taxi") { }
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
switch (creature->GetEntry())
{
case 17435: // Azuremyst Isle - Susurrus
if (player->HasItemCount(23843, 1, true))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SUSURRUS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
break;
case 20903: // Netherstorm - Protectorate Nether Drake
if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NETHER_DRAKE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
break;
case 18725: // Old Hillsbrad Foothills - Brazen
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRAZEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
break;
case 20162: // Netherstorm - Veronia
//Behind Enemy Lines
if (player->GetQuestStatus(10652) != QUEST_STATUS_REWARDED)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VERONIA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
break;
case 23704: // Dustwallow Marsh - Cassa Crimsonwing
if (player->GetQuestStatus(11142) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CRIMSONWING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+25);
break;
}
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
switch (action)
{
case GOSSIP_ACTION_INFO_DEF:
//spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506.
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 32474, true);
break;
case GOSSIP_ACTION_INFO_DEF + 1:
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155))
break;
case GOSSIP_ACTION_INFO_DEF + 2:
if (!player->HasItemCount(25853))
player->SEND_GOSSIP_MENU(9780, creature->GetGUID());
else
{
player->CLOSE_GOSSIP_MENU();
player->ActivateTaxiPathTo(534); //TaxiPath 534
}
break;
case GOSSIP_ACTION_INFO_DEF + 15:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 34905, true); //TaxiPath 606
break;
case GOSSIP_ACTION_INFO_DEF + 25:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, 42295, true);
break;
}
return true;
}
};
void AddSC_npc_taxi()
{
new npc_taxi;
}