Files
TCPlayerbotCore/src/scripts/eastern_kingdoms/western_plaguelands.cpp
T

266 lines
9.5 KiB
C++
Raw Normal View History

2009-02-17 18:08:26 +01:00
/* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
2009-10-17 15:51:44 -07:00
/* ScriptData
SDName: Western_Plaguelands
SD%Complete: 90
SDComment: Quest support: 5097, 5098, 5216, 5219, 5222, 5225, 5229, 5231, 5233, 5235. To obtain Vitreous Focuser (could use more spesifics about gossip items)
SDCategory: Western Plaguelands
EndScriptData */
2009-10-17 15:51:44 -07:00
/* ContentData
npcs_dithers_and_arbington
2009-06-10 22:12:58 +02:00
npc_myranda_the_hag
npc_the_scourge_cauldron
2010-04-07 18:09:10 +02:00
npc_andorhal_tower
EndContentData */
2009-10-17 15:51:44 -07:00
2010-01-19 11:36:05 +01:00
#include "ScriptedPch.h"
2009-10-17 15:51:44 -07:00
/*######
## npcs_dithers_and_arbington
######*/
2009-10-17 15:51:44 -07:00
#define GOSSIP_HDA1 "What does the Felstone Field Cauldron need?"
#define GOSSIP_HDA2 "What does the Dalson's Tears Cauldron need?"
#define GOSSIP_HDA3 "What does the Writhing Haunt Cauldron need?"
#define GOSSIP_HDA4 "What does the Gahrron's Withering Cauldron need?"
2009-10-17 15:51:44 -07:00
#define GOSSIP_SDA1 "Thanks, i need a Vitreous Focuser"
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pCreature->isVendor())
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-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (pPlayer->GetQuestRewardStatus(5237) || pPlayer->GetQuestRewardStatus(5238))
{
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(3985, pCreature->GetGUID());
}else
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
2009-08-15 00:32:04 +02:00
bool GossipSelect_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
2009-08-15 00:32:04 +02:00
switch(uiAction)
{
case GOSSIP_ACTION_TRADE:
2009-08-14 00:39:07 +02:00
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(3980, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(3981, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(3982, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(3983, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
2009-08-14 00:02:13 +02:00
pPlayer->CLOSE_GOSSIP_MENU();
2009-08-14 00:39:07 +02:00
pCreature->CastSpell(pPlayer, 17529, false);
break;
}
return true;
}
2009-10-17 15:51:44 -07:00
2009-06-10 22:12:58 +02:00
/*######
## npc_myranda_the_hag
######*/
2009-10-17 15:51:44 -07:00
2009-10-17 07:42:48 -07:00
enum eMyranda
2009-06-10 22:12:58 +02:00
{
QUEST_SUBTERFUGE = 5862,
QUEST_IN_DREAMS = 5944,
SPELL_SCARLET_ILLUSION = 17961
};
2009-10-17 15:51:44 -07:00
2009-06-10 22:12:58 +02:00
#define GOSSIP_ITEM_ILLUSION "I am ready for the illusion, Myranda."
2009-10-17 15:51:44 -07:00
2009-06-10 22:12:58 +02:00
bool GossipHello_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature)
{
2009-08-14 00:02:13 +02:00
if (pCreature->isQuestGiver())
2009-06-10 22:12:58 +02:00
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (pPlayer->GetQuestStatus(QUEST_SUBTERFUGE) == QUEST_STATUS_COMPLETE &&
2009-06-10 22:12:58 +02:00
!pPlayer->GetQuestRewardStatus(QUEST_IN_DREAMS) && !pPlayer->HasAura(SPELL_SCARLET_ILLUSION))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ILLUSION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(4773, pCreature->GetGUID());
return true;
}
else
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
2009-06-10 22:12:58 +02:00
return true;
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool GossipSelect_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
2009-06-10 22:12:58 +02:00
{
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
2009-06-10 22:12:58 +02:00
{
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer, SPELL_SCARLET_ILLUSION, false);
2009-06-10 22:12:58 +02:00
}
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## npc_the_scourge_cauldron
######*/
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_the_scourge_cauldronAI : public ScriptedAI
{
npc_the_scourge_cauldronAI(Creature *c) : ScriptedAI(c) {}
2009-10-17 15:51:44 -07:00
void Reset() {}
2009-10-17 15:51:44 -07:00
2009-04-27 21:23:42 -05:00
void EnterCombat(Unit* who) {}
2009-10-17 15:51:44 -07:00
void DoDie()
{
//summoner dies here
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
//override any database `spawntimesecs` to prevent duplicated summons
uint32 rTime = m_creature->GetRespawnDelay();
2009-08-14 00:02:13 +02:00
if (rTime<600)
m_creature->SetRespawnDelay(600);
}
2009-10-17 15:51:44 -07:00
void MoveInLineOfSight(Unit *who)
{
if (!who || who->GetTypeId() != TYPEID_PLAYER)
return;
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (who->GetTypeId() == TYPEID_PLAYER)
{
switch(m_creature->GetAreaId())
{
case 199: //felstone
2009-08-14 00:02:13 +02:00
if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE)
{
2009-08-06 20:35:18 +02:00
m_creature->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
case 200: //dalson
2009-08-14 00:02:13 +02:00
if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE)
{
2009-08-06 20:35:18 +02:00
m_creature->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
DoDie();
}
break;
case 201: //gahrron
2009-08-14 00:02:13 +02:00
if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE)
{
2009-08-06 20:35:18 +02:00
m_creature->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
DoDie();
}
break;
case 202: //writhing
2009-08-14 00:02:13 +02:00
if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE)
{
2009-08-06 20:35:18 +02:00
m_creature->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
DoDie();
}
break;
}
}
}
};
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_the_scourge_cauldron(Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
return new npc_the_scourge_cauldronAI (pCreature);
}
2009-10-17 15:51:44 -07:00
/*######
2010-04-07 18:09:10 +02:00
## npcs_andorhal_tower
######*/
enum eAndorhalTower
{
GO_BEACON_TORCH = 176093
};
2010-02-05 00:31:28 +01:00
struct npc_andorhal_towerAI : public Scripted_NoMovementAI
{
npc_andorhal_towerAI(Creature *c) : Scripted_NoMovementAI(c) {}
void MoveInLineOfSight(Unit* pWho)
{
if (!pWho || pWho->GetTypeId() != TYPEID_PLAYER)
return;
if (m_creature->FindNearestGameObject(GO_BEACON_TORCH, 10.0f))
CAST_PLR(pWho)->KilledMonsterCredit(m_creature->GetEntry(), m_creature->GetGUID());
}
};
CreatureAI* GetAI_npc_andorhal_tower(Creature* pCreature)
{
return new npc_andorhal_towerAI (pCreature);
}
/*######
##
######*/
2009-10-17 15:51:44 -07:00
void AddSC_western_plaguelands()
{
Script *newscript;
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npcs_dithers_and_arbington";
newscript->pGossipHello = &GossipHello_npcs_dithers_and_arbington;
newscript->pGossipSelect = &GossipSelect_npcs_dithers_and_arbington;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
2009-06-10 22:12:58 +02:00
newscript = new Script;
newscript->Name = "npc_myranda_the_hag";
newscript->pGossipHello = &GossipHello_npc_myranda_the_hag;
newscript->pGossipSelect = &GossipSelect_npc_myranda_the_hag;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_the_scourge_cauldron";
newscript->GetAI = &GetAI_npc_the_scourge_cauldron;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_andorhal_tower";
newscript->GetAI = &GetAI_npc_andorhal_tower;
newscript->RegisterSelf();
}