2010-07-06 03:27:41 +02:00
/*
2012-01-01 00:32:13 +01:00
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
2010-07-06 03:27:41 +02:00
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2008-10-21 13:19:26 -05:00
*
2010-07-06 03:27:41 +02:00
* 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.
2008-10-21 13:19:26 -05:00
*
2010-07-06 03:27:41 +02:00
* 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/>.
2008-10-21 13:19:26 -05:00
*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/* ScriptData
SDName: Nagrand
SD%Complete: 90
2011-10-23 11:10:58 +01:00
SDComment: Quest support: 9868, 9874, 10044, 10172, 10085. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
2008-10-21 13:19:26 -05:00
SDCategory: Nagrand
EndScriptData */
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/* ContentData
npc_greatmother_geyah
2009-09-17 01:45:36 -07:00
npc_maghar_captive
2008-10-21 13:19:26 -05:00
npc_creditmarker_visit_with_ancestors
EndContentData */
2012-07-29 21:40:10 +02:00
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
2010-01-19 11:36:05 +01:00
#include "ScriptedEscortAI.h"
2012-11-17 05:18:37 +01:00
#include "Player.h"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*######
## npc_greatmother_geyah
######*/
2009-10-17 15:51:44 -07:00
2009-01-23 16:38:09 +01:00
#define GOSSIP_HGG1 "Hello, Greatmother. Garrosh told me that you wanted to speak with me."
#define GOSSIP_HGG2 "Garrosh is beyond redemption, Greatmother. I fear that in helping the Mag'har, I have convinced Garrosh that he is unfit to lead."
2009-10-17 15:51:44 -07:00
2009-01-23 16:38:09 +01:00
#define GOSSIP_SGG1 "You raised all of the orcs here, Greatmother?"
#define GOSSIP_SGG2 "Do you believe that?"
#define GOSSIP_SGG3 "What can be done? I have tried many different things. I have done my best to help the people of Nagrand. Each time I have approached Garrosh, he has dismissed me."
#define GOSSIP_SGG4 "Left? How can you choose to leave?"
#define GOSSIP_SGG5 "What is this duty?"
#define GOSSIP_SGG6 "Is there anything I can do for you, Greatmother?"
#define GOSSIP_SGG7 "I have done all that I could, Greatmother. I thank you for your kind words."
#define GOSSIP_SGG8 "Greatmother, you are the mother of Durotan?"
#define GOSSIP_SGG9 "Greatmother, I never had the honor. Durotan died long before my time, but his heroics are known to all on my world. The orcs of Azeroth reside in a place known as Durotar, named after your son. And ... (You take a moment to breathe and think through what you are about to tell the Greatmother.)"
#define GOSSIP_SGG10 "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild."
#define GOSSIP_SGG11 "I will return to Azeroth at once, Greatmother."
2009-10-17 15:51:44 -07:00
2010-08-09 00:56:10 +06:00
//all the textId's for the below is unknown, but i do believe the gossip item texts are proper.
class npc_greatmother_geyah : public CreatureScript
2008-10-21 13:19:26 -05:00
{
2010-08-08 22:54:58 +06:00
public :
npc_greatmother_geyah () : CreatureScript ( "npc_greatmother_geyah" ) { }
2009-10-17 15:51:44 -07:00
2012-03-07 14:08:30 +01:00
bool OnGossipSelect ( Player * player , Creature * creature , uint32 /*sender*/ , uint32 action )
2008-10-21 13:19:26 -05:00
{
2011-07-02 22:52:42 +02:00
player -> PlayerTalkClass -> ClearMenus ();
2012-03-07 14:08:30 +01:00
switch ( action )
2010-08-08 22:54:58 +06:00
{
case GOSSIP_ACTION_INFO_DEF + 1 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG1 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 2 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG2 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 3 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 3 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG3 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 4 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 4 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG4 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 5 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 5 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG5 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 6 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 6 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG6 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 7 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 7 :
2011-07-02 22:52:42 +02:00
player -> AreaExploredOrEventHappens ( 10044 );
player -> CLOSE_GOSSIP_MENU ();
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 10 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG7 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 11 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 11 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG8 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 12 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 12 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG9 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 13 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 13 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG10 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 14 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 14 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_SGG11 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 15 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 15 :
2011-07-02 22:52:42 +02:00
player -> AreaExploredOrEventHappens ( 10172 );
player -> CLOSE_GOSSIP_MENU ();
2010-08-08 22:54:58 +06:00
break ;
}
return true ;
}
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
bool OnGossipHello ( Player * player , Creature * creature )
2008-10-21 13:19:26 -05:00
{
2011-07-02 22:18:03 +02:00
if ( creature -> isQuestGiver ())
2011-07-02 22:52:42 +02:00
player -> PrepareQuestMenu ( creature -> GetGUID ());
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
if ( player -> GetQuestStatus ( 10044 ) == QUEST_STATUS_INCOMPLETE )
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_HGG1 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 1 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
}
2011-07-02 22:52:42 +02:00
else if ( player -> GetQuestStatus ( 10172 ) == QUEST_STATUS_INCOMPLETE )
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_HGG2 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 10 );
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
}
else
2011-07-02 22:52:42 +02:00
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( creature ), creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
return true ;
2008-10-21 13:19:26 -05:00
}
2010-08-08 22:54:58 +06:00
};
2009-09-17 01:45:36 -07:00
/*#####
## npc_maghar_captive
#####*/
2009-10-17 15:51:44 -07:00
2009-10-17 07:42:48 -07:00
enum eMagharCaptive
2009-09-17 01:45:36 -07:00
{
SAY_MAG_START = - 1000482 ,
SAY_MAG_NO_ESCAPE = - 1000483 ,
SAY_MAG_MORE = - 1000484 ,
SAY_MAG_MORE_REPLY = - 1000485 ,
SAY_MAG_LIGHTNING = - 1000486 ,
SAY_MAG_SHOCK = - 1000487 ,
SAY_MAG_COMPLETE = - 1000488 ,
2009-10-17 15:51:44 -07:00
2009-09-17 01:45:36 -07:00
SPELL_CHAIN_LIGHTNING = 16006 ,
SPELL_EARTHBIND_TOTEM = 15786 ,
SPELL_FROST_SHOCK = 12548 ,
SPELL_HEALING_WAVE = 12491 ,
2009-10-17 15:51:44 -07:00
2009-09-17 01:45:36 -07:00
QUEST_TOTEM_KARDASH_H = 9868 ,
2009-10-17 15:51:44 -07:00
2009-09-17 01:45:36 -07:00
NPC_MURK_RAIDER = 18203 ,
NPC_MURK_BRUTE = 18211 ,
NPC_MURK_SCAVENGER = 18207 ,
NPC_MURK_PUTRIFIER = 18202
};
2009-10-17 15:51:44 -07:00
2010-08-22 23:46:40 +06:00
static float m_afAmbushA [] = { - 1568.805786f , 8533.873047f , 1.958f };
static float m_afAmbushB [] = { - 1491.554321f , 8506.483398f , 1.248f };
2010-08-09 00:56:10 +06:00
class npc_maghar_captive : public CreatureScript
2009-09-17 01:45:36 -07:00
{
2010-08-08 22:54:58 +06:00
public :
npc_maghar_captive () : CreatureScript ( "npc_maghar_captive" ) { }
2009-10-17 15:51:44 -07:00
2011-10-07 19:45:43 -05:00
bool OnQuestAccept ( Player * player , Creature * creature , const Quest * quest )
2009-09-17 01:45:36 -07:00
{
2011-10-07 19:45:43 -05:00
if ( quest -> GetQuestId () == QUEST_TOTEM_KARDASH_H )
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:18:03 +02:00
if ( npc_maghar_captiveAI * pEscortAI = dynamic_cast < npc_maghar_captiveAI *> ( creature -> AI ()))
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:18:03 +02:00
creature -> SetStandState ( UNIT_STAND_STATE_STAND );
creature -> setFaction ( 232 );
2010-08-08 22:54:58 +06:00
2011-10-07 19:45:43 -05:00
pEscortAI -> Start ( true , false , player -> GetGUID (), quest );
2010-08-08 22:54:58 +06:00
2011-07-02 22:18:03 +02:00
DoScriptText ( SAY_MAG_START , creature );
2010-08-08 22:54:58 +06:00
2011-07-02 22:18:03 +02:00
creature -> SummonCreature ( NPC_MURK_RAIDER , m_afAmbushA [ 0 ] + 2.5f , m_afAmbushA [ 1 ] - 2.5f , m_afAmbushA [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
creature -> SummonCreature ( NPC_MURK_PUTRIFIER , m_afAmbushA [ 0 ] - 2.5f , m_afAmbushA [ 1 ] + 2.5f , m_afAmbushA [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
creature -> SummonCreature ( NPC_MURK_BRUTE , m_afAmbushA [ 0 ], m_afAmbushA [ 1 ], m_afAmbushA [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
2010-08-08 22:54:58 +06:00
}
}
return true ;
2009-09-17 01:45:36 -07:00
}
2009-10-17 15:51:44 -07:00
2011-07-02 22:18:03 +02:00
CreatureAI * GetAI ( Creature * creature ) const
2009-09-17 01:45:36 -07:00
{
2011-07-02 22:18:03 +02:00
return new npc_maghar_captiveAI ( creature );
2009-09-17 01:45:36 -07:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
struct npc_maghar_captiveAI : public npc_escortAI
2009-09-17 01:45:36 -07:00
{
2011-07-02 22:18:03 +02:00
npc_maghar_captiveAI ( Creature * creature ) : npc_escortAI ( creature ) { Reset (); }
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
uint32 m_uiChainLightningTimer ;
uint32 m_uiHealTimer ;
uint32 m_uiFrostShockTimer ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void Reset ()
{
m_uiChainLightningTimer = 1000 ;
m_uiHealTimer = 0 ;
m_uiFrostShockTimer = 6000 ;
}
2009-10-17 15:51:44 -07:00
2011-07-02 23:53:38 +02:00
void EnterCombat ( Unit * /*who*/ )
2010-08-08 22:54:58 +06:00
{
DoCast ( me , SPELL_EARTHBIND_TOTEM , false );
}
2009-10-17 15:51:44 -07:00
2012-03-29 15:44:24 +08:00
void WaypointReached ( uint32 waypointId )
2010-08-08 22:54:58 +06:00
{
2012-03-29 15:44:24 +08:00
switch ( waypointId )
2010-08-08 22:54:58 +06:00
{
case 7 :
DoScriptText ( SAY_MAG_MORE , me );
2009-10-17 15:51:44 -07:00
2011-10-07 19:45:43 -05:00
if ( Creature * temp = me -> SummonCreature ( NPC_MURK_PUTRIFIER , m_afAmbushB [ 0 ], m_afAmbushB [ 1 ], m_afAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 ))
DoScriptText ( SAY_MAG_MORE_REPLY , temp );
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
me -> SummonCreature ( NPC_MURK_PUTRIFIER , m_afAmbushB [ 0 ] - 2.5f , m_afAmbushB [ 1 ] - 2.5f , m_afAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
me -> SummonCreature ( NPC_MURK_SCAVENGER , m_afAmbushB [ 0 ] + 2.5f , m_afAmbushB [ 1 ] + 2.5f , m_afAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
me -> SummonCreature ( NPC_MURK_SCAVENGER , m_afAmbushB [ 0 ] + 2.5f , m_afAmbushB [ 1 ] - 2.5f , m_afAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
break ;
case 16 :
DoScriptText ( SAY_MAG_COMPLETE , me );
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
if ( Player * player = GetPlayerForEscort ())
player -> GroupEventHappens ( QUEST_TOTEM_KARDASH_H , me );
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
SetRun ();
break ;
}
}
2009-10-17 15:51:44 -07:00
2011-07-03 00:28:03 +02:00
void JustSummoned ( Creature * summoned )
2009-09-17 01:45:36 -07:00
{
2011-07-03 00:28:03 +02:00
if ( summoned -> GetEntry () == NPC_MURK_BRUTE )
DoScriptText ( SAY_MAG_NO_ESCAPE , summoned );
2009-10-17 15:51:44 -07:00
2011-07-03 00:28:03 +02:00
if ( summoned -> isTotem ())
2010-08-08 22:54:58 +06:00
return ;
2009-10-17 15:51:44 -07:00
2012-02-23 11:50:58 +01:00
summoned -> SetWalk ( false );
2011-07-03 00:28:03 +02:00
summoned -> GetMotionMaster () -> MovePoint ( 0 , me -> GetPositionX (), me -> GetPositionY (), me -> GetPositionZ ());
summoned -> AI () -> AttackStart ( me );
2009-10-17 15:51:44 -07:00
2009-09-17 01:45:36 -07:00
}
2009-10-17 15:51:44 -07:00
2011-10-07 19:45:43 -05:00
void SpellHitTarget ( Unit * /*target*/ , const SpellInfo * pSpell )
2009-09-17 01:45:36 -07:00
{
2010-08-08 22:54:58 +06:00
if ( pSpell -> Id == SPELL_CHAIN_LIGHTNING )
2009-09-17 01:45:36 -07:00
{
2010-08-08 22:54:58 +06:00
if ( rand () % 10 )
return ;
DoScriptText ( SAY_MAG_LIGHTNING , me );
2009-09-17 01:45:36 -07:00
}
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void UpdateAI ( const uint32 uiDiff )
2009-09-17 01:45:36 -07:00
{
2010-08-08 22:54:58 +06:00
npc_escortAI :: UpdateAI ( uiDiff );
if ( ! me -> getVictim ())
return ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
if ( m_uiChainLightningTimer <= uiDiff )
{
DoCast ( me -> getVictim (), SPELL_CHAIN_LIGHTNING );
m_uiChainLightningTimer = urand ( 7000 , 14000 );
}
else
m_uiChainLightningTimer -= uiDiff ;
2009-10-17 15:51:44 -07:00
2010-08-26 01:20:57 +06:00
if ( HealthBelowPct ( 30 ))
2010-08-08 22:54:58 +06:00
{
if ( m_uiHealTimer <= uiDiff )
{
DoCast ( me , SPELL_HEALING_WAVE );
m_uiHealTimer = 5000 ;
}
else
m_uiHealTimer -= uiDiff ;
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
if ( m_uiFrostShockTimer <= uiDiff )
{
DoCast ( me -> getVictim (), SPELL_FROST_SHOCK );
m_uiFrostShockTimer = urand ( 7500 , 15000 );
}
else
m_uiFrostShockTimer -= uiDiff ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
DoMeleeAttackIfReady ();
2009-09-17 01:45:36 -07:00
}
2010-08-08 22:54:58 +06:00
};
};
2008-10-21 13:19:26 -05:00
/*######
2009-01-23 16:38:09 +01:00
## npc_creditmarker_visist_with_ancestors
2008-10-21 13:19:26 -05:00
######*/
2010-08-09 00:56:10 +06:00
class npc_creditmarker_visit_with_ancestors : public CreatureScript
2008-10-21 13:19:26 -05:00
{
2010-08-08 22:54:58 +06:00
public :
npc_creditmarker_visit_with_ancestors () : CreatureScript ( "npc_creditmarker_visit_with_ancestors" ) { }
2009-10-17 15:51:44 -07:00
2011-07-02 22:18:03 +02:00
CreatureAI * GetAI ( Creature * creature ) const
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:18:03 +02:00
return new npc_creditmarker_visit_with_ancestorsAI ( creature );
2010-08-08 22:54:58 +06:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
2008-10-21 13:19:26 -05:00
{
2012-03-14 09:20:36 +08:00
npc_creditmarker_visit_with_ancestorsAI ( Creature * creature ) : ScriptedAI ( creature ) {}
2010-08-08 22:54:58 +06:00
void Reset () {}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void EnterCombat ( Unit * /*who*/ ) {}
2011-06-30 14:24:56 +02:00
void MoveInLineOfSight ( Unit * who )
2008-10-21 13:19:26 -05:00
{
2010-08-08 22:54:58 +06:00
if ( ! who )
return ;
if ( who -> GetTypeId () == TYPEID_PLAYER )
2008-10-21 13:19:26 -05:00
{
2010-08-08 22:54:58 +06:00
if ( CAST_PLR ( who ) -> GetQuestStatus ( 10085 ) == QUEST_STATUS_INCOMPLETE )
2008-10-21 13:19:26 -05:00
{
2010-08-08 22:54:58 +06:00
uint32 creditMarkerId = me -> GetEntry ();
if (( creditMarkerId >= 18840 ) && ( creditMarkerId <= 18843 ))
{
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
if ( ! CAST_PLR ( who ) -> GetReqKillOrCastCurrentCount ( 10085 , creditMarkerId ))
CAST_PLR ( who ) -> KilledMonsterCredit ( creditMarkerId , me -> GetGUID ());
}
2008-10-21 13:19:26 -05:00
}
}
}
2010-08-08 22:54:58 +06:00
};
2008-10-21 13:19:26 -05:00
};
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*######
2011-10-23 11:00:56 +01:00
## go_corkis_prison and npc_corki
2008-10-21 13:19:26 -05:00
######*/
2009-10-17 15:51:44 -07:00
2011-05-07 20:09:45 +02:00
enum CorkiData
2011-04-05 15:15:15 +02:00
{
// first quest
QUEST_HELP = 9923 ,
NPC_CORKI = 18445 ,
2011-05-19 15:03:58 +02:00
NPC_CORKI_CREDIT_1 = 18369 ,
2011-04-05 15:15:15 +02:00
GO_CORKIS_PRISON = 182349 ,
CORKI_SAY_THANKS = - 1800071 ,
// 2nd quest
QUEST_CORKIS_GONE_MISSING_AGAIN = 9924 ,
NPC_CORKI_2 = 20812 ,
GO_CORKIS_PRISON_2 = 182350 ,
CORKI_SAY_PROMISE = - 1800072 ,
// 3rd quest
QUEST_CHOWAR_THE_PILLAGER = 9955 ,
NPC_CORKI_3 = 18369 ,
2011-05-19 15:03:58 +02:00
NPC_CORKI_CREDIT_3 = 18444 ,
2011-04-05 15:15:15 +02:00
GO_CORKIS_PRISON_3 = 182521 ,
CORKI_SAY_LAST = - 1800073
2008-11-09 15:17:38 -06:00
};
2009-10-17 15:51:44 -07:00
2011-04-05 15:15:15 +02:00
class go_corkis_prison : public GameObjectScript
{
public :
go_corkis_prison () : GameObjectScript ( "go_corkis_prison" ) { }
bool OnGossipHello ( Player * player , GameObject * go )
{
if ( go -> GetEntry () == GO_CORKIS_PRISON )
{
if ( Creature * corki = go -> FindNearestCreature ( NPC_CORKI , 25 , true ))
{
go -> SetGoState ( GO_STATE_READY );
corki -> GetMotionMaster () -> MovePoint ( 1 , go -> GetPositionX () + 5 , go -> GetPositionY (), go -> GetPositionZ ());
if ( player )
2011-05-19 15:03:58 +02:00
player -> KilledMonsterCredit ( NPC_CORKI_CREDIT_1 , 0 );
2011-04-05 15:15:15 +02:00
}
}
2012-03-28 11:13:37 +08:00
2011-04-05 15:15:15 +02:00
if ( go -> GetEntry () == GO_CORKIS_PRISON_2 )
{
if ( Creature * corki = go -> FindNearestCreature ( NPC_CORKI_2 , 25 , true ))
{
go -> SetGoState ( GO_STATE_READY );
corki -> GetMotionMaster () -> MovePoint ( 1 , go -> GetPositionX () - 5 , go -> GetPositionY (), go -> GetPositionZ ());
if ( player )
player -> KilledMonsterCredit ( NPC_CORKI_2 , 0 );
}
}
2012-03-28 11:13:37 +08:00
2011-04-05 15:15:15 +02:00
if ( go -> GetEntry () == GO_CORKIS_PRISON_3 )
{
if ( Creature * corki = go -> FindNearestCreature ( NPC_CORKI_3 , 25 , true ))
{
go -> SetGoState ( GO_STATE_READY );
corki -> GetMotionMaster () -> MovePoint ( 1 , go -> GetPositionX () + 4 , go -> GetPositionY (), go -> GetPositionZ ());
if ( player )
2011-05-19 15:03:58 +02:00
player -> KilledMonsterCredit ( NPC_CORKI_CREDIT_3 , 0 );
2011-04-05 15:15:15 +02:00
}
}
return true ;
}
};
class npc_corki : public CreatureScript
{
public :
npc_corki () : CreatureScript ( "npc_corki" ) { }
2011-09-15 14:08:17 +02:00
CreatureAI * GetAI ( Creature * creature ) const
2011-04-05 15:15:15 +02:00
{
return new npc_corkiAI ( creature );
}
struct npc_corkiAI : public ScriptedAI
{
npc_corkiAI ( Creature * creature ) : ScriptedAI ( creature ) {}
uint32 Say_Timer ;
bool ReleasedFromCage ;
void Reset ()
{
2012-03-24 17:09:42 +01:00
Say_Timer = 5000 ;
2011-04-05 15:15:15 +02:00
ReleasedFromCage = false ;
}
void UpdateAI ( uint32 const diff )
{
2012-03-24 17:09:42 +01:00
if ( ReleasedFromCage )
2011-04-05 15:15:15 +02:00
{
2012-03-24 17:09:42 +01:00
if ( Say_Timer <= diff )
{
2012-04-24 16:53:37 +02:00
me -> DespawnOrUnsummon ();
2012-03-24 17:09:42 +01:00
ReleasedFromCage = false ;
}
else
Say_Timer -= diff ;
2011-04-05 15:15:15 +02:00
}
}
2011-05-07 20:09:45 +02:00
2011-04-05 15:15:15 +02:00
void MovementInform ( uint32 type , uint32 id )
{
2011-05-07 20:09:45 +02:00
if ( type == POINT_MOTION_TYPE && id == 1 )
2011-04-05 15:15:15 +02:00
{
Say_Timer = 5000 ;
ReleasedFromCage = true ;
if ( me -> GetEntry () == NPC_CORKI )
DoScriptText ( CORKI_SAY_THANKS , me );
if ( me -> GetEntry () == NPC_CORKI_2 )
DoScriptText ( CORKI_SAY_PROMISE , me );
if ( me -> GetEntry () == NPC_CORKI_3 )
DoScriptText ( CORKI_SAY_LAST , me );
}
};
};
};
2009-10-17 15:51:44 -07:00
2011-10-22 17:30:53 +01:00
/*#####
## npc_kurenai_captive
#####*/
enum KurenaiCaptive
{
SAY_KUR_START = 0 ,
SAY_KUR_NO_ESCAPE = 1 ,
SAY_KUR_MORE = 2 ,
SAY_KUR_MORE_TWO = 3 ,
SAY_KUR_LIGHTNING = 4 ,
SAY_KUR_SHOCK = 5 ,
SAY_KUR_COMPLETE = 6 ,
SPELL_KUR_CHAIN_LIGHTNING = 16006 ,
SPELL_KUR_EARTHBIND_TOTEM = 15786 ,
SPELL_KUR_FROST_SHOCK = 12548 ,
SPELL_KUR_HEALING_WAVE = 12491 ,
QUEST_TOTEM_KARDASH_A = 9879 ,
NPC_KUR_MURK_RAIDER = 18203 ,
NPC_KUR_MURK_BRUTE = 18211 ,
NPC_KUR_MURK_SCAVENGER = 18207 ,
NPC_KUR_MURK_PUTRIFIER = 18202 ,
};
static float kurenaiAmbushA [] = { - 1568.805786f , 8533.873047f , 1.958f };
static float kurenaiAmbushB [] = { - 1491.554321f , 8506.483398f , 1.248f };
class npc_kurenai_captive : public CreatureScript
{
public :
npc_kurenai_captive () : CreatureScript ( "npc_kurenai_captive" ) { }
bool OnQuestAccept ( Player * player , Creature * creature , const Quest * quest )
{
if ( quest -> GetQuestId () == QUEST_TOTEM_KARDASH_A )
{
if ( npc_kurenai_captiveAI * EscortAI = dynamic_cast < npc_kurenai_captiveAI *> ( creature -> AI ()))
{
creature -> SetStandState ( UNIT_STAND_STATE_STAND );
EscortAI -> Start ( true , false , player -> GetGUID (), quest );
DoScriptText ( SAY_KUR_START , creature );
creature -> SummonCreature ( NPC_KUR_MURK_RAIDER , kurenaiAmbushA [ 0 ] + 2.5f , kurenaiAmbushA [ 1 ] - 2.5f , kurenaiAmbushA [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
creature -> SummonCreature ( NPC_KUR_MURK_BRUTE , kurenaiAmbushA [ 0 ] - 2.5f , kurenaiAmbushA [ 1 ] + 2.5f , kurenaiAmbushA [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
creature -> SummonCreature ( NPC_KUR_MURK_SCAVENGER , kurenaiAmbushA [ 0 ], kurenaiAmbushA [ 1 ], kurenaiAmbushA [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
}
}
return true ;
}
CreatureAI * GetAI ( Creature * creature ) const
{
return new npc_kurenai_captiveAI ( creature );
}
struct npc_kurenai_captiveAI : public npc_escortAI
{
npc_kurenai_captiveAI ( Creature * creature ) : npc_escortAI ( creature ) { }
uint32 ChainLightningTimer ;
uint32 HealTimer ;
uint32 FrostShockTimer ;
void Reset ()
{
ChainLightningTimer = 1000 ;
HealTimer = 0 ;
FrostShockTimer = 6000 ;
}
void EnterCombat ( Unit * /*who*/ )
{
DoCast ( me , SPELL_KUR_EARTHBIND_TOTEM , false );
}
void JustDied ( Unit * /*killer*/ )
{
if ( ! HasEscortState ( STATE_ESCORT_ESCORTING ))
return ;
if ( Player * player = GetPlayerForEscort ())
{
if ( player -> GetQuestStatus ( QUEST_TOTEM_KARDASH_A ) != QUEST_STATUS_COMPLETE )
player -> FailQuest ( QUEST_TOTEM_KARDASH_A );
}
}
2012-03-29 15:44:24 +08:00
void WaypointReached ( uint32 waypointId )
2011-10-22 17:30:53 +01:00
{
2012-03-29 15:44:24 +08:00
switch ( waypointId )
2011-10-22 17:30:53 +01:00
{
case 3 :
{
Talk ( SAY_KUR_MORE );
2011-12-15 11:12:15 +01:00
if ( me -> SummonCreature ( NPC_KUR_MURK_PUTRIFIER , kurenaiAmbushB [ 0 ], kurenaiAmbushB [ 1 ], kurenaiAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 ))
2011-10-22 17:30:53 +01:00
Talk ( SAY_KUR_MORE_TWO );
me -> SummonCreature ( NPC_KUR_MURK_PUTRIFIER , kurenaiAmbushB [ 0 ] - 2.5f , kurenaiAmbushB [ 1 ] - 2.5f , kurenaiAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
me -> SummonCreature ( NPC_KUR_MURK_SCAVENGER , kurenaiAmbushB [ 0 ] + 2.5f , kurenaiAmbushB [ 1 ] + 2.5f , kurenaiAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
me -> SummonCreature ( NPC_KUR_MURK_SCAVENGER , kurenaiAmbushB [ 0 ] + 2.5f , kurenaiAmbushB [ 1 ] - 2.5f , kurenaiAmbushB [ 2 ], 0.0f , TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT , 25000 );
break ;
}
case 7 :
{
Talk ( SAY_KUR_COMPLETE );
if ( Player * player = GetPlayerForEscort ())
player -> GroupEventHappens ( QUEST_TOTEM_KARDASH_A , me );
SetRun ();
break ;
}
}
}
void JustSummoned ( Creature * summoned )
{
if ( summoned -> GetEntry () == NPC_KUR_MURK_BRUTE )
Talk ( SAY_KUR_NO_ESCAPE );
// This function is for when we summoned enemies to fight - so that does NOT mean we should make our totem count in this!
if ( summoned -> isTotem ())
return ;
2012-02-23 11:50:58 +01:00
summoned -> SetWalk ( false );
2011-10-22 17:30:53 +01:00
summoned -> GetMotionMaster () -> MovePoint ( 0 , me -> GetPositionX (), me -> GetPositionY (), me -> GetPositionZ ());
summoned -> AI () -> AttackStart ( me );
}
void SpellHitTarget ( Unit * /*target*/ , const SpellInfo * spell )
{
if ( spell -> Id == SPELL_KUR_CHAIN_LIGHTNING )
{
if ( rand () % 30 )
return ;
Talk ( SAY_KUR_LIGHTNING );
}
if ( spell -> Id == SPELL_KUR_FROST_SHOCK )
{
if ( rand () % 30 )
return ;
Talk ( SAY_KUR_SHOCK );
}
}
void UpdateAI ( const uint32 diff )
{
if ( ! UpdateVictim ())
return ;
2012-02-03 19:02:17 +02:00
if ( me -> HasUnitState ( UNIT_STATE_CASTING ))
2011-10-22 17:30:53 +01:00
return ;
if ( ChainLightningTimer <= diff )
{
DoCast ( me -> getVictim (), SPELL_KUR_CHAIN_LIGHTNING );
ChainLightningTimer = urand ( 7000 , 14000 );
} else ChainLightningTimer -= diff ;
if ( HealthBelowPct ( 30 ))
{
if ( HealTimer <= diff )
{
DoCast ( me , SPELL_KUR_HEALING_WAVE );
HealTimer = 5000 ;
} else HealTimer -= diff ;
}
if ( FrostShockTimer <= diff )
{
DoCast ( me -> getVictim (), SPELL_KUR_FROST_SHOCK );
FrostShockTimer = urand ( 7500 , 15000 );
} else FrostShockTimer -= diff ;
DoMeleeAttackIfReady ();
}
};
};
2011-10-22 17:33:12 +01:00
/*######
## go_warmaul_prison
######*/
enum FindingTheSurvivorsData
{
QUEST_FINDING_THE_SURVIVORS = 9948 ,
NPC_MAGHAR_PRISONER = 18428 ,
2011-10-25 23:52:55 +01:00
SAY_FREE = 0 ,
2011-10-22 17:33:12 +01:00
};
class go_warmaul_prison : public GameObjectScript
{
2011-10-25 23:52:55 +01:00
public :
go_warmaul_prison () : GameObjectScript ( "go_warmaul_prison" ) { }
2011-10-22 17:33:12 +01:00
2011-10-25 23:52:55 +01:00
bool OnGossipHello ( Player * player , GameObject * go )
2011-10-22 17:33:12 +01:00
{
2011-10-25 23:52:55 +01:00
if ( player -> GetQuestStatus ( QUEST_FINDING_THE_SURVIVORS ) != QUEST_STATUS_INCOMPLETE )
return false ;
if ( Creature * prisoner = go -> FindNearestCreature ( NPC_MAGHAR_PRISONER , 5.0f ))
2011-10-22 17:33:12 +01:00
{
2012-03-28 11:13:37 +08:00
go -> UseDoorOrButton ();
player -> KilledMonsterCredit ( NPC_MAGHAR_PRISONER , 0 );
2011-10-22 17:33:12 +01:00
2012-03-28 11:13:37 +08:00
prisoner -> AI () -> Talk ( SAY_FREE , player -> GetGUID ());
2012-04-24 16:53:37 +02:00
prisoner -> DespawnOrUnsummon ( 6000 );
2011-10-22 17:33:12 +01:00
}
2011-10-25 23:52:55 +01:00
return true ;
2011-10-22 17:33:12 +01:00
}
};
2008-10-21 13:19:26 -05:00
void AddSC_nagrand ()
{
2010-08-08 22:54:58 +06:00
new npc_greatmother_geyah ();
new npc_maghar_captive ();
new npc_creditmarker_visit_with_ancestors ();
2011-04-05 15:15:15 +02:00
new npc_corki ();
new go_corkis_prison ();
2011-10-22 17:30:53 +01:00
new npc_kurenai_captive ();
2011-10-22 17:33:12 +01:00
new go_warmaul_prison ();
2008-10-21 13:19:26 -05:00
}