*Update to Trinity 843.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-12 11:02:18 -06:00
37 changed files with 1492 additions and 142 deletions
@@ -17,12 +17,13 @@
/* ScriptData
SDName: Ashenvale
SD%Complete: 70
SDComment: Quest support: 6544
SDComment: Quest support: 6544, 6482
SDCategory: Ashenvale Forest
EndScriptData */
/* ContentData
npc_torek
npc_ruul_snowhoof
EndContentData */
#include "precompiled.h"
@@ -174,7 +175,125 @@ CreatureAI* GetAI_npc_torek(Creature *_Creature)
return (CreatureAI*)thisAI;
}
/*####
# npc_ruul_snowhoof
####*/
#define QUEST_FREEDOM_TO_RUUL 6482
#define GO_CAGE 178147
struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
{
npc_ruul_snowhoofAI(Creature *c) : npc_escortAI(c) {Reset();}
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (!player)
return;
switch(i)
{
case 0: {
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
GameObject* Cage = FindGameObject(GO_CAGE, 99);
if(Cage)
Cage->SetGoState(0);
break;}
case 13:
m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 19:
m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 21:{
if (player && player->GetTypeId() == TYPEID_PLAYER)
((Player*)player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature);
break; }
}
}
void Aggro(Unit* who) {}
void Reset()
{
if (!IsBeingEscorted)
m_creature->setFaction(1602);
GameObject* Cage = FindGameObject(GO_CAGE, 99);
if(Cage)
Cage->SetGoState(1);
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
}
void JustDied(Unit* killer)
{
if (PlayerGUID)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (player)
((Player*)player)->FailQuest(QUEST_FREEDOM_TO_RUUL);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
bool QuestAccept_npc_ruul_snowhoof(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
{
creature->setFaction(1603);
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
}
return true;
}
CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature)
{
npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(_Creature);
ruul_snowhoofAI->AddWaypoint(0, 3347.250089, -694.700989, 159.925995);
ruul_snowhoofAI->AddWaypoint(1, 3341.527039, -694.725891, 161.124542, 4000);
ruul_snowhoofAI->AddWaypoint(2, 3338.351074, -686.088138, 163.444000);
ruul_snowhoofAI->AddWaypoint(3, 3352.744873, -677.721741, 162.316269);
ruul_snowhoofAI->AddWaypoint(4, 3370.291016, -669.366943, 160.751358);
ruul_snowhoofAI->AddWaypoint(5, 3381.479492, -659.449097, 162.545303);
ruul_snowhoofAI->AddWaypoint(6, 3389.554199, -648.500000, 163.651825);
ruul_snowhoofAI->AddWaypoint(7, 3396.645020, -641.508911, 164.216019);
ruul_snowhoofAI->AddWaypoint(8, 3410.498535, -634.299622, 165.773453);
ruul_snowhoofAI->AddWaypoint(9, 3418.461426, -631.791992, 166.477615);
ruul_snowhoofAI->AddWaypoint(10, 3429.500000, -631.588745, 166.921265);
ruul_snowhoofAI->AddWaypoint(11,3434.950195, -629.245483, 168.333969);
ruul_snowhoofAI->AddWaypoint(12,3438.927979, -618.503235, 171.503143);
ruul_snowhoofAI->AddWaypoint(13,3444.217529, -609.293640, 173.077972, 1000); // Ambush 1
ruul_snowhoofAI->AddWaypoint(14,3460.505127, -593.794189, 174.342255);
ruul_snowhoofAI->AddWaypoint(15,3480.283203, -578.210327, 176.652313);
ruul_snowhoofAI->AddWaypoint(16,3492.912842, -562.335449, 181.396301);
ruul_snowhoofAI->AddWaypoint(17,3495.230957, -550.977600, 184.652267);
ruul_snowhoofAI->AddWaypoint(18,3496.247070, -529.194214, 188.172028);
ruul_snowhoofAI->AddWaypoint(19,3497.619385, -510.411499, 188.345322, 1000); // Ambush 2
ruul_snowhoofAI->AddWaypoint(20,3498.498047, -497.787506, 185.806274);
ruul_snowhoofAI->AddWaypoint(21,3484.218750, -489.717529, 182.389862, 4000); // End
return (CreatureAI*)ruul_snowhoofAI;
}
void AddSC_ashenvale()
{
Script *newscript;
@@ -184,4 +303,10 @@ void AddSC_ashenvale()
newscript->GetAI = &GetAI_npc_torek;
newscript->pQuestAccept = &QuestAccept_npc_torek;
newscript->RegisterSelf();
}
newscript = new Script;
newscript->Name = "npc_ruul_snowhoof";
newscript->GetAI = &GetAI_npc_ruul_snowhoofAI;
newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof;
newscript->RegisterSelf();
}
@@ -17,7 +17,7 @@
/* ScriptData
SDName: The_Barrens
SD%Complete: 90
SDComment: Quest support: 2458, 4921, 6981
SDComment: Quest support: 2458, 4921, 6981, 1719, 863
SDCategory: Barrens
EndScriptData */
@@ -25,9 +25,12 @@ EndScriptData */
npc_beaten_corpse
npc_sputtervalve
npc_taskmaster_fizzule remove hack when Trinity implement feature/detect spell kind to not aggro
npc_twiggy_flathead
npc_wizzlecrank_shredder
EndContentData */
#include "precompiled.h"
#include "../../npc/npc_escortAI.h"
/*######
## npc_beaten_corpse
@@ -361,6 +364,149 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature *_Creature)
{
return new npc_twiggy_flatheadAI (_Creature);
}
/*#####
## npc_wizzlecrank_shredder TODO: Pilot scripting
#####*/
#define SAY_PROGRESS_1 "Alright, alright I think I can figure out how to operate this thing..."
#define SAY_PROGRESS_2 "Arrrgh! This isn't right!"
#define SAY_PROGRESS_3 "Okay, I think I've got it, now. Follow me, $N!"
#define SAY_MERCENARY_4 "There's the stolen shredder! Stop it or Lugwizzle will have our hides!"
#define SAY_PROGRESS_5 "Looks like we're out of woods, eh? Wonder what this does..."
#define SAY_PROGRESS_6 "Come on, don't break down on me now!"
#define SAY_PROGRESS_7 "That was a close one! Well, let's get going, it's still a ways to Ratchet!"
#define SAY_PROGRESS_8 "Hmm... I don't think this blinking red light is a good thing..."
#define SAY_PILOT_9 "Looks like you'll have to go ahead to Ratchet and tell Sputtervalve that I've wrecked the shredder."
#define SAY_PILOT_10 "I'll stay behind and guard the wreck. Hurry! Hopefully no one will notice the smoke..."
#define QUEST_ESCAPE 863
#define NPC_PILOT 3451
#define MOB_MERCENARY 3282
struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI
{
npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) {Reset();}
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if(!player)
return;
switch(i)
{
case 0: DoSay(SAY_PROGRESS_1, LANG_UNIVERSAL, NULL);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 1: DoSay(SAY_PROGRESS_2, LANG_UNIVERSAL, NULL); break;
case 10: DoSay(SAY_PROGRESS_3, LANG_UNIVERSAL, player);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 20:{
Unit* Mercenary = FindCreature(MOB_MERCENARY, 99);
if(Mercenary)
{
((Creature*)Mercenary)->Yell(SAY_MERCENARY_4, LANG_UNIVERSAL, NULL);
Mercenary->Attack(m_creature, true);
}
}break;
case 21: DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, NULL);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 28: DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, NULL); break;
case 29: DoSay(SAY_PROGRESS_7, LANG_UNIVERSAL, NULL); break;
case 30: DoSay(SAY_PROGRESS_8, LANG_UNIVERSAL, NULL); break;
case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
m_creature->setDeathState(JUST_DIED);
if (player && player->GetTypeId() == TYPEID_PLAYER)
((Player*)player)->GroupEventHappens(QUEST_ESCAPE, m_creature);
break;
case 32: {Unit* Pilot = FindCreature(NPC_PILOT, 30);
if(Pilot)
((Creature*)Pilot)->Say(SAY_PILOT_9, LANG_UNIVERSAL, NULL);}break;
case 33:{ Unit* Pilot = FindCreature(NPC_PILOT, 30);
if(Pilot)
((Creature*)Pilot)->Say(SAY_PILOT_10, LANG_UNIVERSAL, NULL);} break;
}
}
void Reset()
{
m_creature->setDeathState(ALIVE);
}
void Aggro(Unit* who){}
void JustDied(Unit* killer)
{
if (PlayerGUID)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (player)
((Player*)player)->FailQuest(QUEST_ESCAPE);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
bool QuestAccept_npc_wizzlecrank_shredder(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_ESCAPE)
{
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
creature->setFaction(35);
}
return true;
}
CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature *_Creature)
{
npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(_Creature);
thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000);//say1 spw
thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000);//say2 crazy running
thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000);
thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000);
thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000);
thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000);
thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000);
thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000);
thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000);
thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000);
thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000);//end of crazy running
thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97);
thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83);
thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53);
thisAI->AddWaypoint(14, 1096.97, -3051,99, 82.50);
thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70);
thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79);
thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73);
thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08);
thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000);//twice
thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000);//mercenary
thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000);//say
thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46);//crazy running
thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81);
thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59);
thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81);
thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67);
thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73);
thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000);//6
thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000);//7
thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000);//8
thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000);//justdied summon creature
thisAI->AddWaypoint(32, 1091.28, -2985.82, 91.74, 2000);//9
thisAI->AddWaypoint(33, 1091.28, -2985.82, 91.74, 7000);//10
return (CreatureAI*)thisAI;
}
void AddSC_the_barrens()
{
Script *newscript;
@@ -387,4 +533,10 @@ void AddSC_the_barrens()
newscript->Name="npc_twiggy_flathead";
newscript->GetAI = &GetAI_npc_twiggy_flathead;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_wizzlecrank_shredder";
newscript->GetAI = &GetAI_npc_wizzlecrank_shredderAI;
newscript->pQuestAccept = &QuestAccept_npc_wizzlecrank_shredder;
newscript->RegisterSelf();
}
@@ -363,9 +363,10 @@ static Animation DemonTransformation[]=
/************************************** Illidan's AI ***************************************/
struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
{
boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c)
boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(m_creature)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
Reset();
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHADOWFIEND_PASSIVE);
@@ -390,6 +391,8 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
uint64 FlameGUID[2];
uint64 GlaiveGUID[2];
SummonList Summons;
void Reset();
void JustSummoned(Creature* summon);
@@ -402,12 +405,13 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
if(summon->GetGUID() == FlameGUID[i])
FlameGUID[i] = 0;
if(!FlameGUID[0] && !FlameGUID[1])
if(!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_NULL)
{
m_creature->InterruptNonMeleeSpells(true);
EnterPhase(PHASE_FLIGHT_SEQUENCE);
}
}
Summons.Despawn(summon);
}
void MovementInform(uint32 MovementType, uint32 Data)
@@ -899,7 +903,7 @@ struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
GlaiveGUID = 0;
}
void Aggro(Unit *who) {}
void Aggro(Unit *who) {DoZoneInCombat();}
void ChargeCheck()
{
@@ -1805,23 +1809,6 @@ void boss_illidan_stormrageAI::Reset()
if(pInstance)
pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED);
for(uint8 i = 0; i < 2; i++)
{
if(FlameGUID[i])
{
if(GETUNIT(Flame, FlameGUID[i]))
Flame->setDeathState(JUST_DIED);
FlameGUID[i] = 0;
}
if(GlaiveGUID[i])
{
if(GETUNIT(Glaive, GlaiveGUID[i]))
Glaive->setDeathState(JUST_DIED);
GlaiveGUID[i] = 0;
}
}
if(AkamaGUID)
{
if(GETCRE(Akama, AkamaGUID))
@@ -1838,15 +1825,11 @@ void boss_illidan_stormrageAI::Reset()
AkamaGUID = 0;
}
if(MaievGUID)
MaievGUID = 0;
for(int i = 0; i < 2; ++i)
{
GETUNIT(Maiev, MaievGUID);
if(Maiev && Maiev->isAlive())
{
Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true);
Maiev->setDeathState(JUST_DIED);
}
MaievGUID = 0;
FlameGUID[i] = 0;
GlaiveGUID[i] = 0;
}
Phase = PHASE_NULL;
@@ -1865,17 +1848,23 @@ void boss_illidan_stormrageAI::Reset()
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT);
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
m_creature->setActive(false);
Summons.DespawnAll();
}
void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
{
Summons.Summon(summon);
switch(summon->GetEntry())
{
case PARASITIC_SHADOWFIEND:
{
if(Phase == PHASE_TALK_SEQUENCE)
{
summon->SetVisibility(VISIBILITY_OFF);
summon->setDeathState(JUST_DIED);
return;
}
Unit *target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0, 999, true);
if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0)
|| target->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
@@ -1897,6 +1886,10 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
((boss_maievAI*)summon->AI())->GetIllidanGUID(m_creature->GetGUID());
((boss_maievAI*)summon->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
}break;
case FLAME_OF_AZZINOTH:
{
summon->AI()->AttackStart(summon->SelectNearestTarget(999));
}break;
default:
break;
}
@@ -1948,6 +1941,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
}break;
case 15:
DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him
Summons.DespawnAll();
break;
case 17:
if(GETUNIT(Akama, AkamaGUID))
@@ -2037,10 +2031,8 @@ void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth()
{
Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction
Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE);
Flame->AI()->AttackStart(m_creature->getVictim()); // Attack our target!
FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase
((flame_of_azzinothAI*)Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]);
DoZoneInCombat(Flame);
Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it.
}
}
@@ -193,6 +193,9 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
{
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true))
{
if(!target)
target = m_creature->getVictim();
DoCast(target, SPELL_VOLCANIC_SUMMON);
DoScriptText(EMOTE_GROUND_CRACK, m_creature);
SummonVolcanoTimer = 10000;
@@ -226,6 +229,55 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
}
};
struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
{
npc_volcanoAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
ScriptedInstance *pInstance;
uint32 CheckTimer;
bool Eruption;
void Reset()
{
CheckTimer = 1500;
Eruption = false;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void Aggro(Unit *who) {}
void MoveInLineOfSight(Unit *who)
{
return; // paralyze the npc
}
void UpdateAI(const uint32 diff)
{
if(CheckTimer < diff)
{
uint64 SupremusGUID = pInstance->GetData64(DATA_SUPREMUS);
Creature* Supremus = ((Creature*)Unit::GetUnit((*m_creature), SupremusGUID));
if(!Eruption && !((boss_supremusAI*)Supremus->AI())->Phase1)
{
Eruption = true;
DoCast(m_creature, SPELL_VOLCANIC_ERUPTION);
}
else if(Eruption && ((boss_supremusAI*)Supremus->AI())->Phase1)
{
m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION, 0);
}
CheckTimer = 1500;
}else CheckTimer -= diff;
}
};
CreatureAI* GetAI_boss_supremus(Creature *_Creature)
{
return new boss_supremusAI (_Creature);
@@ -236,6 +288,11 @@ CreatureAI* GetAI_molten_flame(Creature *_Creature)
return new molten_flameAI (_Creature);
}
CreatureAI* GetAI_npc_volcano(Creature *_Creature)
{
return new npc_volcanoAI (_Creature);
}
void AddSC_boss_supremus()
{
Script *newscript;
@@ -247,5 +304,10 @@ void AddSC_boss_supremus()
newscript = new Script;
newscript->Name="molten_flame";
newscript->GetAI = &GetAI_molten_flame;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_volcano";
newscript->GetAI = &GetAI_npc_volcano;
newscript->RegisterSelf();
}
@@ -290,59 +290,59 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
if(!EventBegun) return;
if(EndEventTimer)
{
if(EndEventTimer <= diff)
{
if(DeathCount > 3)
if(EndEventTimer <= diff)
{
if(pInstance)
if(DeathCount > 3)
{
if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
if(pInstance)
{
if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
}
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
Creature* pMember = ((Creature*)Unit::GetUnit(*m_creature, Council[DeathCount]));
if(pMember && pMember->isAlive())
pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
++DeathCount;
EndEventTimer = 1500;
}else EndEventTimer -= diff;
}
Creature* pMember = ((Creature*)Unit::GetUnit(*m_creature, Council[DeathCount]));
if(pMember && pMember->isAlive())
pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
++DeathCount;
EndEventTimer = 1500;
}else EndEventTimer -= diff;
}
if(CheckTimer)
{
if(CheckTimer <= diff)
{
uint8 EvadeCheck = 0;
for(uint8 i = 0; i < 4; ++i)
if(CheckTimer <= diff)
{
if(Council[i])
uint8 EvadeCheck = 0;
for(uint8 i = 0; i < 4; ++i)
{
if(Creature* Member = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
if(Council[i])
{
// This is the evade/death check.
if(Member->isAlive() && !Member->SelectHostilTarget())
++EvadeCheck; //If all members evade, we reset so that players can properly reset the event
else if(!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self.
if(Creature* Member = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
{
EndEventTimer = 1000;
CheckTimer = 0;
return;
// This is the evade/death check.
if(Member->isAlive() && !Member->SelectHostilTarget())
++EvadeCheck; //If all members evade, we reset so that players can properly reset the event
else if(!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self.
{
EndEventTimer = 1000;
CheckTimer = 0;
return;
}
}
}
}
}
if(EvadeCheck > 3)
Reset();
if(EvadeCheck > 3)
Reset();
CheckTimer = 2000;
}else CheckTimer -= diff;
}
CheckTimer = 2000;
}else CheckTimer -= diff;
}
}
};
@@ -385,6 +385,20 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
LoadGUIDs();
}
void EnterEvadeMode()
{
for(uint8 i = 0; i < 4; ++i)
{
if(Unit* pUnit = Unit::GetUnit(*m_creature, Council[i]))
if(pUnit != m_creature && pUnit->getVictim())
{
AttackStart(pUnit->getVictim());
return;
}
}
ScriptedAI::EnterEvadeMode();
}
void DamageTaken(Unit* done_by, uint32 &damage)
{
if(done_by == m_creature)
@@ -211,16 +211,20 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
if(SpoutAnimTimer<diff)
{
DoCast(m_creature,SPELL_SPOUT_ANIM,true);
SpoutAnimTimer = 1000;
}else SpoutAnimTimer-=diff;
SpoutAnimTimer = 1000;
}else SpoutAnimTimer-=diff;
std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
{
Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
if(target && target->GetTypeId() == TYPEID_PLAYER && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->GetDistance(target) <= SPOUT_DIST && !target->IsInWater())
DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water
}
Map *map = m_creature->GetMap();
if (map->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS)
{
Map::PlayerList const &PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
Player *target = i->getSource();
if(target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->GetDistance(target) <= SPOUT_DIST && !target->IsInWater())
DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water
}
}
}
void StartRotate(Unit* victim)
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Isle_of_Queldanas
SD%Complete: 100
SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543
SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541
SDCategory: Isle Of Quel'Danas
EndScriptData */
@@ -25,6 +25,7 @@ EndScriptData */
npc_ayren_cloudbreaker
npc_converted_sentry
npc_unrestrained_dragonhawk
npc_greengill_slave
EndContentData */
#include "precompiled.h"
@@ -132,6 +133,63 @@ bool GossipSelect_npc_unrestrained_dragonhawk(Player *player, Creature *_Creatur
return true;
}
/*######
## npc_greengill_slave
######*/
#define ENRAGE 45111
#define ORB 45109
#define QUESTG 11541
#define DM 25060
struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
{
npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {Reset();}
uint64 PlayerGUID;
void Aggro(Unit* who){}
void Reset()
{
PlayerGUID = 0;
}
void SpellHit(Unit* caster, const SpellEntry* spell)
{
if(!caster)
return;
if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE, 0))
{
PlayerGUID = caster->GetGUID();
if(PlayerGUID)
{
Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
if(plr && ((Player*)plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
((Player*)plr)->KilledMonster(25086, m_creature->GetGUID());
}
DoCast(m_creature, ENRAGE);
Unit* Myrmidon = FindCreature(DM, 70);
if(Myrmidon)
{
m_creature->AddThreat(Myrmidon, 100000.0f);
AttackStart(Myrmidon);
}
}
}
void UpdateAI(const uint32 diff)
{
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_greengill_slaveAI(Creature* _Creature)
{
return new npc_greengill_slaveAI(_Creature);
}
void AddSC_isle_of_queldanas()
{
Script *newscript;
@@ -152,4 +210,9 @@ void AddSC_isle_of_queldanas()
newscript->pGossipHello = &GossipHello_npc_unrestrained_dragonhawk;
newscript->pGossipSelect = &GossipSelect_npc_unrestrained_dragonhawk;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_greengill_slave";
newscript->GetAI = &GetAI_npc_greengill_slaveAI;
newscript->RegisterSelf();
}
@@ -272,7 +272,8 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
if(SummonKilrek && Kilrek)
{
Kilrek->Respawn();
Kilrek->AI()->AttackStart(m_creature->getVictim());
if(Kilrek->AI())
Kilrek->AI()->AttackStart(m_creature->getVictim());
SummonKilrek = false;
}
@@ -17,12 +17,13 @@
/* ScriptData
SDName: Mulgore
SD%Complete: 100
SDComment: Skorn Whitecloud: Just a story if not rewarded for quest
SDComment: Support for quest: 11129
SDCategory: Mulgore
EndScriptData */
/* ContentData
npc_skorn_whitecloud
npc_kyle_frenzied
EndContentData */
#include "precompiled.h"
@@ -52,13 +53,121 @@ bool GossipSelect_npc_skorn_whitecloud(Player *player, Creature *_Creature, uint
return true;
}
/*#####
# npc_kyle_frenzied
######*/
struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI
{
npc_kyle_frenziedAI(Creature *c) : ScriptedAI(c) {Reset();}
int STATE;
uint32 wait;
uint64 player;
void Reset()
{
STATE = 0;
m_creature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
m_creature->GetMotionMaster()->Initialize();
}
void Aggro(Unit* who){}
void SpellHit(Unit *caster, const SpellEntry* spell)
{ // we can feed him without any quest
if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && ((Player*)caster)->GetTeam() == HORDE)
{
STATE = 1;
player = caster->GetGUID();
float x, y, z, z2;
caster->GetPosition(x, y, z);
x = x + 3.7*cos(caster->GetOrientation());
y = y + 3.7*sin(caster->GetOrientation());
z2 = m_creature->GetBaseMap()->GetHeight(x,y,z,false);
z = (z2 <= INVALID_HEIGHT) ? z : z2;
m_creature->SetDefaultMovementType(IDLE_MOTION_TYPE); //there is other way to stop waypoint movement?
m_creature->GetMotionMaster()->Initialize();
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->GetMotionMaster()->MovePoint(0,x, y, z);
}
}
void MovementInform(uint32 type, uint32 id)
{
if(type == POINT_MOTION_TYPE)
{
switch(STATE)
{
case 1:
{
Unit *plr = Unit::GetUnit((*m_creature),player);
if(plr)
m_creature->SetOrientation(m_creature->GetAngle(plr));
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING); //eat
WorldPacket data;
m_creature->BuildHeartBeatMsg(&data);
m_creature->SendMessageToSet(&data,true);
wait = 3000;
STATE = 2;
break;
}
case 4:
m_creature->setDeathState(JUST_DIED);
m_creature->Respawn();
break;
}
}
}
void UpdateAI(const uint32 diff)
{
if (!STATE || STATE == 4)
return;
if(wait < diff)
{
switch(STATE)
{
case 2:
STATE = 3; wait = 7000;
m_creature->UpdateEntry(23622,HORDE);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
break;
case 3:
STATE = 4; //go home
Unit *plr = Unit::GetUnit((*m_creature),player);
if(plr && ((Player*)plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE)
((Player*)plr)->CompleteQuest(11129);
float x, y, z, z2, angle;
angle = m_creature->GetAngle(-2146, -430);
m_creature->GetPosition(x,y,z);
x = x + 40*cos(angle);
y = y + 40*sin(angle);
z2 = m_creature->GetBaseMap()->GetHeight(x,y,MAX_HEIGHT,false);
z = (z2 <= INVALID_HEIGHT) ? z : z2;
m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
break;
}
}else wait -= diff;
}
};
CreatureAI* GetAI_npc_kyle_frenzied(Creature *_Creature)
{
return new npc_kyle_frenziedAI (_Creature);
}
void AddSC_mulgore()
{
Script *newscript;
newscript = new Script;
newscript->Name="npc_skorn_whitecloud";
newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud;
newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud;
newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud;
newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_kyle_frenzied";
newscript->GetAI = &GetAI_npc_kyle_frenzied;
newscript->RegisterSelf();
}
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Shattrath_City
SD%Complete: 100
SDComment: Quest support: 10004, 10009, 10211. Flask vendors, Teleport to Caverns of Time
SDComment: Quest support: 10004, 10009, 10211, 10231. Flask vendors, Teleport to Caverns of Time
SDCategory: Shattrath City
EndScriptData */
@@ -27,6 +27,9 @@ npc_salsalabim
npc_shattrathflaskvendors
npc_zephyr
npc_kservant
npc_dirty_larry
npc_ishanah
npc_khadgar
EndContentData */
#include "precompiled.h"
@@ -406,6 +409,269 @@ CreatureAI* GetAI_npc_kservantAI(Creature *_Creature)
return (CreatureAI*)kservantAI;
}
/*######
# npc_dirty_larry
######*/
#define GOSSIP_BOOK "Ezekiel said that you might have a certain book..."
#define SAY_1 "Time to teach you a lesson in manners, little boy!"
#define SAY_2 "Now I'm gonna give you to the count of '3' to get out of here before I sick the dogs on you."
#define SAY_3 "1..."
#define SAY_4 "2..."
#define SAY_5 "Time to meet your maker!"
#define SAY_GIVEUP "Alright, we give up! Don't hurt us!"
#define QUEST_WBI 10231
#define NPC_CREEPJACK 19726
#define NPC_MALONE 19725
struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
{
npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {Reset();}
bool Event;
bool Attack;
bool Done;
uint64 PlayerGUID;
uint32 SayTimer;
uint32 Step;
void Reset()
{
Event = false;
Attack = false;
Done = false;
PlayerGUID = 0;
SayTimer = 0;
Step = 0;
m_creature->setFaction(1194);
Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20);
if(Creepjack)
{
((Creature*)Creepjack)->AI()->EnterEvadeMode();
Creepjack->setFaction(1194);
}
Unit* Malone = FindCreature(NPC_MALONE, 20);
if(Malone)
{
((Creature*)Malone)->AI()->EnterEvadeMode();
Malone->setFaction(1194);
}
}
uint32 NextStep(uint32 Step)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
switch(Step)
{
case 0:{ m_creature->SetInFront(player);
Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20);
if(Creepjack)
Creepjack->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
Unit* Malone = FindCreature(NPC_MALONE, 20);
if(Malone)
Malone->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }return 2000;
case 1: DoSay(SAY_1, LANG_UNIVERSAL, player); return 3000;
case 2: DoSay(SAY_2, LANG_UNIVERSAL, player, true); return 5000;
case 3: DoSay(SAY_3, LANG_UNIVERSAL, player); return 2000;
case 4: DoSay(SAY_4, LANG_UNIVERSAL, player); return 2000;
case 5: DoSay(SAY_5, LANG_UNIVERSAL, player); return 2000;
case 6: Attack = true; return 2000;
default: return 0;
}
}
void Aggro(Unit* who){}
void UpdateAI(const uint32 diff)
{
if(SayTimer < diff)
{
if(Event)
SayTimer = NextStep(Step++);
}else SayTimer -= diff;
if(Attack)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
m_creature->setFaction(14);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if(player)
{
Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20);
if(Creepjack)
{
Creepjack->Attack(player, true);
Creepjack->setFaction(14);
Creepjack->GetMotionMaster()->MoveChase(player);
}
Unit* Malone = FindCreature(NPC_MALONE, 20);
if(Malone)
{
Malone->Attack(player, true);
Malone->setFaction(14);
Malone->GetMotionMaster()->MoveChase(player);
}
m_creature->SetInCombatWith(player);
DoStartMovement(player);
AttackStart(player);
}
Attack = false;
}
if((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1 && !Done)
{
Unit* Creepjack = FindCreature(NPC_CREEPJACK, 20);
if(Creepjack)
{
((Creature*)Creepjack)->AI()->EnterEvadeMode();
Creepjack->setFaction(1194);
}
Unit* Malone = FindCreature(NPC_MALONE, 20);
if(Malone)
{
((Creature*)Malone)->AI()->EnterEvadeMode();
Malone->setFaction(1194);
}
m_creature->setFaction(1194);
Done = true;
DoSay(SAY_GIVEUP, LANG_UNIVERSAL, NULL);
m_creature->DeleteThreatList();
m_creature->CombatStop();
m_creature->GetMotionMaster()->MoveTargetedHome();
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if(player)
((Player*)player)->GroupEventHappens(QUEST_WBI, m_creature);
}
DoMeleeAttackIfReady();
}
};
bool GossipHello_npc_dirty_larry(Player *player, Creature *creature)
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if(player->GetQuestStatus(QUEST_WBI) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(0, GOSSIP_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(creature->GetNpcTextId(), creature->GetGUID());
return true;
}
bool GossipSelect_npc_dirty_larry(Player *player, Creature *creature, uint32 sender, uint32 action )
{
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
((npc_dirty_larryAI*)creature->AI())->Event = true;
((npc_dirty_larryAI*)creature->AI())->PlayerGUID = player->GetGUID();
player->CLOSE_GOSSIP_MENU();
}
return true;
}
CreatureAI* GetAI_npc_dirty_larryAI(Creature *_Creature)
{
return new npc_dirty_larryAI (_Creature);
}
/*######
# npc_ishanah
######*/
#define ISANAH_GOSSIP_1 "Who are the Sha'tar?"
#define ISANAH_GOSSIP_2 "Isn't Shattrath a draenei city? Why do you allow others here?"
bool GossipHello_npc_ishanah(Player *player, Creature *_Creature)
{
if (_Creature->isQuestGiver())
player->PrepareQuestMenu(_Creature->GetGUID());
player->ADD_GOSSIP_ITEM(0, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->ADD_GOSSIP_ITEM(0, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
return true;
}
bool GossipSelect_npc_ishanah(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
if(action == GOSSIP_ACTION_INFO_DEF+1)
player->SEND_GOSSIP_MENU(9458, _Creature->GetGUID());
else if(action == GOSSIP_ACTION_INFO_DEF+2)
player->SEND_GOSSIP_MENU(9459, _Creature->GetGUID());
return true;
}
/*######
# npc_khadgar
######*/
#define KHADGAR_GOSSIP_1 "I've heard your name spoken only in whispers, mage. Who are you?"
#define KHADGAR_GOSSIP_2 "Go on, please."
#define KHADGAR_GOSSIP_3 "I see." //6th too this
#define KHADGAR_GOSSIP_4 "What did you do then?"
#define KHADGAR_GOSSIP_5 "What happened next?"
#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you."
bool GossipHello_npc_khadgar(Player *player, Creature *creature)
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if(!player->hasQuest(10211))
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9243, creature->GetGUID());
return true;
}
bool GossipSelect_npc_khadgar(Player *player, Creature *creature, uint32 sender, uint32 action)
{
switch(action)
{
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(9876, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
player->SEND_GOSSIP_MENU(9877, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
player->SEND_GOSSIP_MENU(9878, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
player->SEND_GOSSIP_MENU(9879, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
player->SEND_GOSSIP_MENU(9880, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+6:
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
player->SEND_GOSSIP_MENU(9881, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+7:
player->ADD_GOSSIP_ITEM(0, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9243, creature->GetGUID());
break;
}
return true;
}
void AddSC_shattrath_city()
{
Script *newscript;
@@ -434,8 +700,27 @@ void AddSC_shattrath_city()
newscript->pGossipSelect = &GossipSelect_npc_zephyr;
newscript->RegisterSelf();
newscript = new Script;
newscript = new Script;
newscript->Name="npc_kservant";
newscript->GetAI = &GetAI_npc_kservantAI;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_dirty_larry";
newscript->GetAI = &GetAI_npc_dirty_larryAI;
newscript->pGossipHello = &GossipHello_npc_dirty_larry;
newscript->pGossipSelect = &GossipSelect_npc_dirty_larry;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_ishanah";
newscript->pGossipHello = &GossipHello_npc_ishanah;
newscript->pGossipSelect = &GossipSelect_npc_ishanah;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_khadgar";
newscript->pGossipHello = &GossipHello_npc_khadgar;
newscript->pGossipSelect = &GossipSelect_npc_khadgar;
newscript->RegisterSelf();
}
@@ -111,11 +111,12 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
m_creature->SetDisplayId(m_creature->GetNativeDisplayId());
m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
//m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
//m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->setActive(false);
}
void Aggro(Unit *who)
@@ -125,6 +126,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
DoZoneInCombat();
m_creature->setActive(true);
}
void JustDied(Unit *victim)
@@ -136,13 +138,8 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
void JustSummoned(Creature *summon)
{
if(summon->GetEntry() == CREATURE_EMBER_OF_ALAR)
{
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
summon->AI()->AttackStart(target);
summon->SetInCombatWith(target);
}
}
}
void MoveInLineOfSight(Unit *who) {}
@@ -405,7 +402,7 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI
else
{
Unit *target = NULL;
if(Phase1 && (target = m_creature->SelectNearbyTarget()) && m_creature->IsHostileTo(target)) // core bug, 1620 faction bugged
if(Phase1 && (target = m_creature->SelectNearestTarget(5)))
m_creature->AI()->AttackStart(target);
else
{
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Zangarmarsh
SD%Complete: 100
SDComment: Quest support: 9785, 9803, 10009. Mark Of ... buffs.
SDComment: Quest support: 9785, 9803, 10009, 9752. Mark Of ... buffs.
SDCategory: Zangarmarsh
EndScriptData */
@@ -26,9 +26,11 @@ npcs_ashyen_and_keleth
npc_cooshcoosh
npc_elder_kuruti
npc_mortog_steamhead
npc_kayra_longmane
EndContentData */
#include "precompiled.h"
#include "../../npc/npc_escortAI.h"
/*######
## npcs_ashyen_and_keleth
@@ -249,6 +251,126 @@ bool GossipSelect_npc_mortog_steamhead(Player *player, Creature *_Creature, uint
return true;
}
/*######
## npc_kayra_longmane
######*/
#define SAY_PROGRESS_1 "Is the way clear? Let's get out while we can, $N."
#define SAY_PROGRESS_2 "Looks like we won't get away so easy. Get ready!"
#define SAY_PROGRESS_3 "Let's keep moving. We're not safe here!"
#define SAY_PROGRESS_4 "Look out, $N! Enemies ahead!"
#define SAY_PROGRESS_5 "We're almost to the refuge! Let's go."
#define SAY_PROGRESS_6 "I can see my fellow druids from here. Thank you, $N. I'm sure Ysiel will reward you for your actions!"
#define QUEST_EFU 9752
#define MOB_AMBUSH 18042
struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
{
npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {Reset();}
bool Completed;
void Reset()
{
Completed = false;
}
void Aggro(Unit* who){}
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->setFaction(14);
}
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
switch(i)
{
case 0: DoSay(SAY_PROGRESS_1, LANG_UNIVERSAL, player); break;
case 5: DoSay(SAY_PROGRESS_2, LANG_UNIVERSAL, player);
m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
break;
case 6: DoSay(SAY_PROGRESS_3, LANG_UNIVERSAL, player);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 18: DoSay(SAY_PROGRESS_4, LANG_UNIVERSAL, player);
m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
break;
case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, player); break;
case 26: DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, player);
if(player)
((Player*)player)->GroupEventHappens(QUEST_EFU, m_creature);
break;
}
}
void JustDied(Unit* killer)
{
if (PlayerGUID)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (player && !Completed)
((Player*)player)->FailQuest(QUEST_EFU);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
bool QuestAccept_npc_kayra_longmane(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_EFU)
{
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
creature->setFaction(775);
}
return true;
}
CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* _Creature)
{
npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(_Creature);
thisAI->AddWaypoint(0, -931.88, 5283.56, 23.98);//SAY_PROGRESS_1
thisAI->AddWaypoint(1, -930.52, 5287.57, 23.82);
thisAI->AddWaypoint(2, -924.98, 5297.94, 17.78);
thisAI->AddWaypoint(3, -928.83, 5316.07, 18.18);
thisAI->AddWaypoint(4, -930.07, 5323.10, 18.63);
thisAI->AddWaypoint(5, -926.58, 5331.24, 18.74, 6000);//SAY_PROGRESS_2
thisAI->AddWaypoint(6, -926.58, 5331.24, 18.74, 3000);//SAY_PROGRESS_3 Run to the hills!
thisAI->AddWaypoint(7, -931.24, 5358.89, 18.14);
thisAI->AddWaypoint(8, -934.43, 5370.20, 22.41);
thisAI->AddWaypoint(9, -943.01, 5400.55, 22.74);
thisAI->AddWaypoint(10, -929.62, 5417.98, 23.07);
thisAI->AddWaypoint(11, -901.92, 5420.38, 24.19);
thisAI->AddWaypoint(12, -859.03, 5415.36, 23.64);
thisAI->AddWaypoint(13, -808.94, 5401.93, 23.11);
thisAI->AddWaypoint(14, -772.74, 5390.53, 22.97);
thisAI->AddWaypoint(15, -749.71, 5385.39, 22.75);
thisAI->AddWaypoint(16, -721.23, 5380.38, 22.47);
thisAI->AddWaypoint(17, -687.96, 5379.08, 22.16);
thisAI->AddWaypoint(18, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_4 Summon Ambush
thisAI->AddWaypoint(19, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_5
thisAI->AddWaypoint(20, -636.14, 5385.25, 22.20);
thisAI->AddWaypoint(21, -602.94, 5411.36, 21.48);
thisAI->AddWaypoint(22, -566.86, 5421.87, 21.25);
thisAI->AddWaypoint(23, -547.27, 5427.87, 21.10);
thisAI->AddWaypoint(24, -520.59, 5444.83, 21.15);
thisAI->AddWaypoint(25, -488.45, 5447.83, 22.38);
thisAI->AddWaypoint(26, -449.65, 5463.78, 21.77, 11000);//SAY_PROGRESS_6
return (CreatureAI*)thisAI;
}
/*######
## AddSC
######*/
@@ -280,4 +402,10 @@ void AddSC_zangarmarsh()
newscript->pGossipHello = &GossipHello_npc_mortog_steamhead;
newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_kayra_longmane";
newscript->GetAI = &GetAI_npc_kayra_longmaneAI;
newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane;
newscript->RegisterSelf();
}