Files
TCPlayerbotCore/src/server/scripts/EasternKingdoms/ghostlands.cpp
T

253 lines
7.8 KiB
C++
Raw Normal View History

/*
* Copyright (C) 2008-2010 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/>.
*/
2009-10-17 15:51:44 -07:00
/* ScriptData
SDName: Ghostlands
SD%Complete: 100
SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
SDCategory: Ghostlands
EndScriptData */
2009-10-17 15:51:44 -07:00
/* ContentData
npc_blood_knight_dawnstar
npc_budd_nedreck
npc_rathis_tomber
npc_ranger_lilatha
EndContentData */
2009-10-17 15:51:44 -07:00
#include "ScriptPCH.h"
2010-01-19 11:36:05 +01:00
#include "ScriptedEscortAI.h"
2009-10-17 15:51:44 -07:00
/*######
## npc_blood_knight_dawnstar
######*/
2009-10-17 15:51:44 -07:00
2009-01-22 22:05:51 +01:00
#define GOSSIP_H_BKD "Take Blood Knight Insignia"
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature)
{
2009-08-14 00:02:13 +02:00
if (pPlayer->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(24226,1,true))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_BKD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
2009-10-17 15:51:44 -07:00
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
return true;
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool GossipSelect_npc_blood_knight_dawnstar(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
{
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
ItemPosCountVec dest;
2009-08-14 00:02:13 +02:00
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 24226, 1, false);
if (msg == EQUIP_ERR_OK)
{
2009-08-14 00:02:13 +02:00
pPlayer->StoreNewItem(dest, 24226, 1, true);
pPlayer->PlayerTalkClass->ClearMenus();
}
}
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## npc_budd_nedreck
######*/
2009-10-17 15:51:44 -07:00
2009-01-22 22:05:51 +01:00
#define GOSSIP_HBN "You gave the crew disguises?"
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_budd_nedreck(Player* pPlayer, Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (pPlayer->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
2009-10-17 15:51:44 -07:00
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool GossipSelect_npc_budd_nedreck(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_INFO_DEF)
{
2009-08-14 00:02:13 +02:00
pPlayer->CLOSE_GOSSIP_MENU();
2009-08-14 00:39:07 +02:00
pCreature->CastSpell(pPlayer, 42540, false);
}
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## npc_rathis_tomber
######*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_rathis_tomber(Player* pPlayer, Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(9152))
{
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(8432, pCreature->GetGUID());
}else
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(8431, pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
return true;
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool GossipSelect_npc_rathis_tomber(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_TRADE)
2009-08-14 00:39:07 +02:00
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## npc_ranger_lilatha
######*/
2009-10-17 15:51:44 -07:00
2009-10-17 07:42:48 -07:00
enum eEnums
2009-03-22 23:11:55 +01:00
{
SAY_START = -1000140,
SAY_PROGRESS1 = -1000141,
SAY_PROGRESS2 = -1000142,
SAY_PROGRESS3 = -1000143,
SAY_END1 = -1000144,
SAY_END2 = -1000145,
SAY_CAPTAIN_ANSWER = -1000146,
2009-10-17 15:51:44 -07:00
2009-03-22 23:11:55 +01:00
QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212,
GO_CAGE = 181152,
NPC_CAPTAIN_HELIOS = 16220,
FACTION_SMOON_E = 1603,
};
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_ranger_lilathaAI : public npc_escortAI
{
npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
void WaypointReached(uint32 i)
{
2009-08-17 00:29:53 +02:00
Player* pPlayer = GetPlayerForEscort();
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (!pPlayer)
return;
2009-10-17 15:51:44 -07:00
switch(i)
2009-02-09 08:16:34 -05:00
{
case 0:
{
2010-04-14 23:07:41 +02:00
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
2009-08-14 00:02:13 +02:00
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
2009-04-30 23:38:21 -05:00
Cage->SetGoState(GO_STATE_ACTIVE);
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_START, me, pPlayer);
2009-02-09 08:16:34 -05:00
break;
}
case 5:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_PROGRESS1, me, pPlayer);
2009-02-09 08:16:34 -05:00
case 11:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_PROGRESS2, me, pPlayer);
me->SetOrientation(4.762841);
2009-02-09 08:16:34 -05:00
break;
case 18:
{
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_PROGRESS3, me, pPlayer);
Creature* Summ1 = me->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0);
2009-08-14 00:02:13 +02:00
if (Summ1 && Summ2)
2009-05-01 01:06:19 +02:00
{
2010-04-14 23:07:41 +02:00
Summ1->Attack(me, true);
2009-08-14 00:02:13 +02:00
Summ2->Attack(pPlayer, true);
2009-05-01 01:06:19 +02:00
}
2010-04-14 23:07:41 +02:00
me->AI()->AttackStart(Summ1);
2009-02-09 08:16:34 -05:00
break;
}
case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break;
case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); break;
2009-02-09 08:16:34 -05:00
case 30:
2009-08-14 00:02:13 +02:00
if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
2010-04-14 23:07:41 +02:00
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,me);
2009-02-09 08:16:34 -05:00
break;
case 32:
2010-04-14 23:07:41 +02:00
me->SetOrientation(2.978281);
DoScriptText(SAY_END1, me, pPlayer);
2009-02-09 08:16:34 -05:00
break;
case 33:
2010-04-14 23:07:41 +02:00
me->SetOrientation(5.858011);
DoScriptText(SAY_END2, me, pPlayer);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
2009-08-14 00:02:13 +02:00
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, pPlayer);
2009-02-09 08:16:34 -05:00
break;
}
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
void Reset()
{
2009-08-14 05:32:39 +02:00
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_READY);
}
};
2009-10-17 15:51:44 -07:00
2009-08-14 04:21:52 +02:00
bool QuestAccept_npc_ranger_lilatha(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
2009-08-14 04:21:52 +02:00
pCreature->setFaction(113);
2009-10-17 15:51:44 -07:00
2009-08-14 04:21:52 +02:00
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilathaAI, pCreature->AI()))
pEscortAI->Start(true, false, pPlayer->GetGUID());
}
return true;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_ranger_lilathaAI(Creature* pCreature)
{
2009-08-16 02:12:14 +02:00
return new npc_ranger_lilathaAI(pCreature);
}
2009-10-17 15:51:44 -07:00
void AddSC_ghostlands()
{
Script *newscript;
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_blood_knight_dawnstar";
newscript->pGossipHello = &GossipHello_npc_blood_knight_dawnstar;
newscript->pGossipSelect = &GossipSelect_npc_blood_knight_dawnstar;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_budd_nedreck";
newscript->pGossipHello = &GossipHello_npc_budd_nedreck;
newscript->pGossipSelect = &GossipSelect_npc_budd_nedreck;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_rathis_tomber";
newscript->pGossipHello = &GossipHello_npc_rathis_tomber;
newscript->pGossipSelect = &GossipSelect_npc_rathis_tomber;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
newscript = new Script;
newscript->Name = "npc_ranger_lilatha";
newscript->GetAI = &GetAI_npc_ranger_lilathaAI;
newscript->pQuestAccept = &QuestAccept_npc_ranger_lilatha;
newscript->RegisterSelf();
}