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

263 lines
8.1 KiB
C++
Raw Normal View History

/*
2011-01-01 15:01:13 +01:00
* Copyright (C) 2008-2011 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"
class npc_blood_knight_dawnstar : public CreatureScript
{
2010-08-08 22:54:58 +06:00
public:
npc_blood_knight_dawnstar() : CreatureScript("npc_blood_knight_dawnstar") { }
2009-10-17 15:51:44 -07:00
bool OnGossipSelect(Player* pPlayer, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
2010-08-08 22:54:58 +06:00
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
2010-08-08 22:54:58 +06:00
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 24226, 1, NULL);
2010-08-08 22:54:58 +06:00
if (msg == EQUIP_ERR_OK)
{
pPlayer->StoreNewItem(dest, 24226, 1, true);
pPlayer->PlayerTalkClass->ClearMenus();
}
}
2010-08-08 22:54:58 +06:00
return true;
}
2010-08-08 22:54:58 +06:00
bool OnGossipHello(Player* pPlayer, Creature* creature)
2010-08-08 22:54:58 +06:00
{
2011-04-29 20:47:02 +02:00
if (pPlayer->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(24226, 1, true))
2010-08-08 22:54:58 +06:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_BKD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(creature), creature->GetGUID());
2010-08-08 22:54:58 +06:00
return true;
}
};
/*######
## 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?"
class npc_budd_nedreck : public CreatureScript
{
2010-08-08 22:54:58 +06:00
public:
npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { }
2009-10-17 15:51:44 -07:00
bool OnGossipSelect(Player* pPlayer, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
2010-08-08 22:54:58 +06:00
{
pPlayer->PlayerTalkClass->ClearMenus();
2010-08-08 22:54:58 +06:00
if (uiAction == GOSSIP_ACTION_INFO_DEF)
{
pPlayer->CLOSE_GOSSIP_MENU();
creature->CastSpell(pPlayer, 42540, false);
2010-08-08 22:54:58 +06:00
}
return true;
}
2009-10-17 15:51:44 -07:00
bool OnGossipHello(Player* pPlayer, Creature* creature)
{
if (creature->isQuestGiver())
pPlayer->PrepareQuestMenu(creature->GetGUID());
2010-08-08 22:54:58 +06:00
if (pPlayer->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(creature), creature->GetGUID());
2010-08-08 22:54:58 +06:00
return true;
}
2010-08-08 22:54:58 +06:00
};
/*######
## npc_rathis_tomber
######*/
class npc_rathis_tomber : public CreatureScript
{
2010-08-08 22:54:58 +06:00
public:
npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { }
2009-10-17 15:51:44 -07:00
bool OnGossipSelect(Player* pPlayer, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
2010-08-08 22:54:58 +06:00
if (uiAction == GOSSIP_ACTION_TRADE)
pPlayer->GetSession()->SendListInventory(creature->GetGUID());
2010-08-08 22:54:58 +06:00
return true;
}
2009-10-17 15:51:44 -07:00
bool OnGossipHello(Player* pPlayer, Creature* creature)
2010-08-08 22:54:58 +06:00
{
if (creature->isQuestGiver())
pPlayer->PrepareQuestMenu(creature->GetGUID());
2010-08-08 22:54:58 +06:00
if (creature->isVendor() && pPlayer->GetQuestRewardStatus(9152))
2010-08-08 22:54:58 +06:00
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
pPlayer->SEND_GOSSIP_MENU(8432, creature->GetGUID());
2010-08-08 22:54:58 +06:00
}else
pPlayer->SEND_GOSSIP_MENU(8431, creature->GetGUID());
2010-08-08 22:54:58 +06:00
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,
};
class npc_ranger_lilatha : public CreatureScript
{
2010-08-08 22:54:58 +06:00
public:
npc_ranger_lilatha() : CreatureScript("npc_ranger_lilatha") { }
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
struct npc_ranger_lilathaAI : public npc_escortAI
2009-02-09 08:16:34 -05:00
{
npc_ranger_lilathaAI(Creature* c) : npc_escortAI(c) {}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void WaypointReached(uint32 i)
2009-02-09 08:16:34 -05:00
{
2010-08-08 22:54:58 +06:00
Player* pPlayer = GetPlayerForEscort();
if (!pPlayer)
return;
switch(i)
2009-05-01 01:06:19 +02:00
{
2010-08-08 22:54:58 +06:00
case 0:
{
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
DoScriptText(SAY_START, me, pPlayer);
break;
}
case 5:
DoScriptText(SAY_PROGRESS1, me, pPlayer);
case 11:
DoScriptText(SAY_PROGRESS2, me, pPlayer);
2010-08-22 23:46:40 +06:00
me->SetOrientation(4.762841f);
2010-08-08 22:54:58 +06:00
break;
case 18:
{
DoScriptText(SAY_PROGRESS3, me, pPlayer);
2010-08-22 23:46:40 +06:00
Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
2010-08-08 22:54:58 +06:00
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
Summ2->Attack(pPlayer, true);
}
me->AI()->AttackStart(Summ1);
break;
}
case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break;
case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); break;
case 30:
if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
2011-04-29 20:47:02 +02:00
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
2010-08-08 22:54:58 +06:00
break;
case 32:
2010-08-22 23:46:40 +06:00
me->SetOrientation(2.978281f);
2010-08-08 22:54:58 +06:00
DoScriptText(SAY_END1, me, pPlayer);
break;
case 33:
2010-08-22 23:46:40 +06:00
me->SetOrientation(5.858011f);
2010-08-08 22:54:58 +06:00
DoScriptText(SAY_END2, me, pPlayer);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, pPlayer);
break;
2009-02-09 08:16:34 -05:00
}
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void Reset()
{
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_READY);
}
};
bool OnQuestAccept(Player* pPlayer, Creature* creature, Quest const* quest)
2009-02-09 08:16:34 -05:00
{
2010-08-08 22:54:58 +06:00
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
creature->setFaction(113);
2010-08-08 22:54:58 +06:00
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI()))
2010-08-08 22:54:58 +06:00
pEscortAI->Start(true, false, pPlayer->GetGUID());
}
return true;
}
2009-10-17 15:51:44 -07:00
CreatureAI* GetAI(Creature* creature) const
{
return new npc_ranger_lilathaAI(creature);
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
};
void AddSC_ghostlands()
{
2010-08-08 22:54:58 +06:00
new npc_blood_knight_dawnstar();
new npc_budd_nedreck();
new npc_rathis_tomber();
new npc_ranger_lilatha();
}