Files
TCPlayerbotCore/src/server/scripts/Kalimdor/feralas.cpp
T

209 lines
6.9 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: Feralas
SD%Complete: 100
2009-05-19 23:48:48 +02:00
SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer
SDCategory: Feralas
EndScriptData */
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_gregan_brewspewer
######*/
2009-10-17 15:51:44 -07:00
2009-01-22 22:05:51 +01:00
#define GOSSIP_HELLO "Buy somethin', will ya?"
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_gregan_brewspewer(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->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE)
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(2433, pCreature->GetGUID());
return true;
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool GossipSelect_npc_gregan_brewspewer(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
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(2434, pCreature->GetGUID());
}
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
2009-05-19 23:48:48 +02:00
/*######
## npc_oox22fe
######*/
2009-10-17 15:51:44 -07:00
2009-10-17 07:42:48 -07:00
enum eOOX
2009-05-19 23:48:48 +02:00
{
//signed for 7806
2009-08-17 02:06:52 +02:00
SAY_OOX_START = -1000287,
SAY_OOX_AGGRO1 = -1000288,
SAY_OOX_AGGRO2 = -1000289,
SAY_OOX_AMBUSH = -1000290,
SAY_OOX_END = -1000292,
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
NPC_YETI = 7848,
NPC_GORILLA = 5260,
NPC_WOODPAW_REAVER = 5255,
NPC_WOODPAW_BRUTE = 5253,
NPC_WOODPAW_ALPHA = 5258,
NPC_WOODPAW_MYSTIC = 5254,
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
QUEST_RESCUE_OOX22FE = 2767,
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775
};
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_oox22feAI : public npc_escortAI
2009-05-19 23:48:48 +02:00
{
2009-08-14 05:32:39 +02:00
npc_oox22feAI(Creature* pCreature) : npc_escortAI(pCreature) { }
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
void WaypointReached(uint32 i)
{
switch (i)
{
// First Ambush(3 Yetis)
case 11:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_OOX_AMBUSH, me);
me->SummonCreature(NPC_YETI, -4841.01, 1593.91, 73.42, 3.98, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_YETI, -4837.61, 1568.58, 78.21, 3.13, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_YETI, -4841.89, 1569.95, 76.53, 0.68, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
2009-05-19 23:48:48 +02:00
break;
//Second Ambush(3 Gorillas)
case 21:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_OOX_AMBUSH, me);
me->SummonCreature(NPC_GORILLA, -4595.81, 2005.99, 53.08, 3.74, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_GORILLA, -4597.53, 2008.31, 52.70, 3.78, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_GORILLA, -4599.37, 2010.59, 52.77, 3.84, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
2009-05-19 23:48:48 +02:00
break;
//Third Ambush(4 Gnolls)
case 30:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_OOX_AMBUSH, me);
me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14, 2075.87, 47.77, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_WOODPAW_BRUTE , -4426.68, 2077.98, 47.57, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33, 2080.24, 47.43, 3.87, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_WOODPAW_ALPHA , -4430.04, 2075.54, 46.83, 3.81, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
2009-05-19 23:48:48 +02:00
break;
case 37:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_OOX_END, me);
2009-05-19 23:48:48 +02:00
// Award quest credit
2009-08-17 00:29:53 +02:00
if (Player* pPlayer = GetPlayerForEscort())
2009-05-19 23:48:48 +02:00
{
2010-04-14 23:07:41 +02:00
pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
2009-05-19 23:48:48 +02:00
}
break;
}
}
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
void Reset()
{
2009-10-11 18:03:59 +02:00
if (!HasEscortState(STATE_ESCORT_ESCORTING))
2010-04-14 23:07:41 +02:00
me->SetStandState(UNIT_STAND_STATE_DEAD);
2009-05-19 23:48:48 +02:00
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void EnterCombat(Unit* /*who*/)
2009-05-19 23:48:48 +02:00
{
//For an small probability the npc says something when he get aggro
if (urand(0,9) > 7)
2010-04-14 23:07:41 +02:00
DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), me);
2009-05-19 23:48:48 +02:00
}
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
void JustSummoned(Creature* summoned)
{
2010-04-14 23:07:41 +02:00
summoned->AI()->AttackStart(me);
2009-05-19 23:48:48 +02:00
}
};
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
CreatureAI* GetAI_npc_oox22fe(Creature* pCreature)
{
2009-08-16 02:12:14 +02:00
return new npc_oox22feAI(pCreature);
2009-05-19 23:48:48 +02:00
}
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
bool QuestAccept_npc_oox22fe(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_RESCUE_OOX22FE)
{
2009-08-17 02:06:52 +02:00
DoScriptText(SAY_OOX_START, pCreature);
2009-05-19 23:48:48 +02:00
//change that the npc is not lying dead on the ground
pCreature->SetStandState(UNIT_STAND_STATE_STAND);
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
if (pPlayer->GetTeam() == ALLIANCE)
pCreature->setFaction(FACTION_ESCORTEE_A);
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
if (pPlayer->GetTeam() == HORDE)
pCreature->setFaction(FACTION_ESCORTEE_H);
2009-10-17 15:51:44 -07:00
2009-08-14 04:21:52 +02:00
if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22feAI, pCreature->AI()))
pEscortAI->Start(true, false, pPlayer->GetGUID());
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
}
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## npc_screecher_spirit
######*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_screecher_spirit(Player* pPlayer, Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(2039, pCreature->GetGUID());
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
2009-10-17 15:51:44 -07:00
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## AddSC
######*/
2009-10-17 15:51:44 -07:00
void AddSC_feralas()
{
Script *newscript;
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_gregan_brewspewer";
newscript->pGossipHello = &GossipHello_npc_gregan_brewspewer;
newscript->pGossipSelect = &GossipSelect_npc_gregan_brewspewer;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
2009-05-19 23:48:48 +02:00
newscript = new Script;
newscript->Name = "npc_oox22fe";
newscript->GetAI = &GetAI_npc_oox22fe;
newscript->pQuestAccept = &QuestAccept_npc_oox22fe;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_screecher_spirit";
newscript->pGossipHello = &GossipHello_npc_screecher_spirit;
newscript->RegisterSelf();
}
2009-02-17 20:07:49 -06:00