*Integrate Script system to Core
-added ScriptMgr for loading scripts -removed bindings -moved script system to src/game -moved scripts to src/scripts -VC project files updated -cmakes updated (not 100% done yet) NOTE to Devs: -file locations changed -precompiled renamed to ScriptedPch -ecsort_ai renamed to ScriptedEscortAI -follower_ai renamed to ScriptedFollowerAI -guard_ai renamed to ScriptedGuardAI -simple_ai renamed to ScriptedSimpleAI -sc_creature renamed to ScriptedCreature -sc_gossip renamed to ScriptedGossip -sc_instance renamed to ScriptedInstance *use the new headers in scripts, thank you NOTE to ALL: cmake not fully tested, please report any errors with it could make creashes, incompability USE AT YOUR OWN RISK before further tests!! --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef DEF_AHNKAHET_H
|
||||
#define DEF_AHNKAHET_H
|
||||
|
||||
#define DATA_ELDER_NADOX 1
|
||||
#define DATA_PRINCE_TALDARAM 2
|
||||
#define DATA_JEDOGA_SHADOWSEEKER 3
|
||||
#define DATA_HERALD_VOLAZJ 4
|
||||
#define DATA_AMANITAR 5
|
||||
|
||||
#define DATA_ELDER_NADOX_EVENT 6
|
||||
#define DATA_PRINCE_TALDARAM_EVENT 7
|
||||
#define DATA_JEDOGA_SHADOWSEEKER_EVENT 8
|
||||
#define DATA_HERALD_VOLAZJ_EVENT 9
|
||||
#define DATA_AMANITAR_EVENT 10
|
||||
|
||||
#define DATA_SPHERE1 11
|
||||
#define DATA_SPHERE2 12
|
||||
#define DATA_SPHERE1_EVENT 13
|
||||
#define DATA_SPHERE2_EVENT 14
|
||||
#define DATA_PRINCE_TALDARAM_PLATFORM 15
|
||||
|
||||
#define DATA_PL_JEDOGA_TARGET 16
|
||||
#define DATA_ADD_JEDOGA_OPFER 17
|
||||
#define DATA_JEDOGA_RESET_INITIANDS 18
|
||||
#define DATA_JEDOGA_TRIGGER_SWITCH 19
|
||||
#define DATA_ADD_JEDOGA_INITIAND 20
|
||||
#define DATA_ALL_INITIAND_DEAD 21
|
||||
#define DATA_INITIAND_KILLED 22
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Script Data Start
|
||||
SDName: boss_amanitar
|
||||
SDAuthor: WarHead
|
||||
SD%Complete: 80%
|
||||
SDComment: Find correct mushrooms spell to make them visible - buffs of the mushrooms not ever applied to the users...
|
||||
SDCategory: Ahn'kahet
|
||||
Script Data End */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "ahnkahet.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BASH = 57094, // Victim
|
||||
SPELL_ENTANGLING_ROOTS = 57095, // Random Victim 100Y
|
||||
SPELL_MINI = 57055, // Self
|
||||
SPELL_VENOM_BOLT_VOLLEY = 57088, // Random Victim 100Y
|
||||
|
||||
HEALTHY_MUSHROOM_SPELL_POTENT_FUNGUS = 56648, // Killer 3Y
|
||||
|
||||
POISONOUS_MUSHROOM_SPELL_POISON_CLOUD = 57061, // Self - Duration 8 Sec
|
||||
POISONOUS_MUSHROOM_SPELL_VISUAL_AREA = 61566, // Self
|
||||
POISONOUS_MUSHROOM_SPELL_VISUAL_AURA = 56741, // Self
|
||||
|
||||
SPELL_PUTRID_MUSHROOM = 31690, // To make the mushrooms visible
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
#define NPC_HEALTHY_MUSHROOM 30391
|
||||
#define NPC_POISONOUS_MUSHROOM 30435
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_amanitarAI : public ScriptedAI
|
||||
{
|
||||
boss_amanitarAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
FirstTime = true;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 roottimer,
|
||||
bashtimer,
|
||||
bolttimer,
|
||||
spawntimer;
|
||||
|
||||
bool FirstTime;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
roottimer = urand(5000,9000);
|
||||
bashtimer = urand(10000,14000);
|
||||
bolttimer = urand(15000,30000);
|
||||
spawntimer = 0;
|
||||
|
||||
m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
|
||||
if (!FirstTime)
|
||||
{
|
||||
pInstance->SetData(DATA_AMANITAR_EVENT, FAIL);
|
||||
}
|
||||
else FirstTime = false;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit *Killer)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_AMANITAR_EVENT, DONE);
|
||||
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AMANITAR_EVENT, IN_PROGRESS);
|
||||
|
||||
DoCast(m_creature, SPELL_MINI, false);
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
{
|
||||
for (uint8 i = 0; i < 30; ++i)
|
||||
{
|
||||
Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (victim)
|
||||
{
|
||||
Position pos;
|
||||
victim->GetPosition(&pos);
|
||||
m_creature->GetRandomNearPosition(pos, float(urand(5,80)));
|
||||
m_creature->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
|
||||
m_creature->GetRandomNearPosition(pos, float(urand(5,80)));
|
||||
m_creature->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (spawntimer <= diff)
|
||||
{
|
||||
SpawnAdds();
|
||||
spawntimer = urand(35000,40000);
|
||||
} else spawntimer -= diff;
|
||||
|
||||
if (roottimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_ENTANGLING_ROOTS);
|
||||
roottimer = urand(15000,30000);
|
||||
}
|
||||
|
||||
if (bashtimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_BASH);
|
||||
bashtimer = urand(15000,30000);
|
||||
} else bashtimer -= diff;
|
||||
|
||||
if (bolttimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_VENOM_BOLT_VOLLEY);
|
||||
bolttimer = urand(15000,30000);
|
||||
} else bolttimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_amanitar_mushroomsAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_amanitar_mushroomsAI(Creature* c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
c->SetUInt32Value(UNIT_FIELD_DISPLAYID, 26981); // Unsichtbar...
|
||||
}
|
||||
|
||||
uint32 auratimer,
|
||||
deathtimer; // Without not all will despawn after 30000! :-(
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(m_creature, SPELL_PUTRID_MUSHROOM, true); // Hack, to make the mushrooms visible, can't find orig. spell...
|
||||
|
||||
if (m_creature->GetEntry() == NPC_POISONOUS_MUSHROOM)
|
||||
DoCast(m_creature, POISONOUS_MUSHROOM_SPELL_VISUAL_AURA, true);
|
||||
|
||||
auratimer = 0;
|
||||
deathtimer = 30000;
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
if (!killer)
|
||||
return;
|
||||
|
||||
if (m_creature->GetEntry() == NPC_HEALTHY_MUSHROOM && killer->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
DoCast(killer, HEALTHY_MUSHROOM_SPELL_POTENT_FUNGUS, false);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who) {}
|
||||
void AttackStart(Unit *victim) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (m_creature->GetEntry() == NPC_POISONOUS_MUSHROOM)
|
||||
{
|
||||
if (auratimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, POISONOUS_MUSHROOM_SPELL_VISUAL_AREA, true);
|
||||
DoCast(m_creature, POISONOUS_MUSHROOM_SPELL_POISON_CLOUD, false);
|
||||
auratimer = 7000;
|
||||
} else auratimer -= diff;
|
||||
}
|
||||
if (deathtimer <= diff)
|
||||
{
|
||||
m_creature->DisappearAndDie();
|
||||
} else deathtimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_amanitar(Creature* pCreature)
|
||||
{
|
||||
return new boss_amanitarAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_amanitar_mushrooms(Creature *pCreature)
|
||||
{
|
||||
return new mob_amanitar_mushroomsAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_amanitar()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_amanitar";
|
||||
newscript->GetAI = &GetAI_boss_amanitar;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_amanitar_mushrooms";
|
||||
newscript->GetAI = &GetAI_mob_amanitar_mushrooms;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_elder_nadox
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Ahn'kahet
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "ahnkahet.h"
|
||||
|
||||
bool DeadAhnkaharGuardian; // needed for achievement: Respect Your Elders(2038)
|
||||
|
||||
#define ACHIEVEMENT_RESPECT_YOUR_ELDERS 2038
|
||||
|
||||
//not in db
|
||||
#define SAY_AGGRO -1619014
|
||||
#define SAY_SLAY_1 -1619015
|
||||
#define SAY_SLAY_2 -1619016
|
||||
#define SAY_SLAY_3 -1619017
|
||||
#define SAY_DEATH -1619018
|
||||
#define SAY_EGG_SAC_1 -1619019
|
||||
#define SAY_EGG_SAC_2 -1619020
|
||||
|
||||
#define SPELL_BROOD_PLAGUE 56130
|
||||
#define H_SPELL_BROOD_PLAGUE 59467
|
||||
#define H_SPELL_BROOD_RAGE 59465
|
||||
#define SPELL_ENRAGE 26662// Enraged if too far away from home
|
||||
|
||||
#define MOB_AHNKAHAR_SWARMER 30178
|
||||
#define SPELL_SUMMON_SWARMERS 56119//2x 30178 -- 2x every 10secs
|
||||
|
||||
#define MOB_AHNKAHAR_GUARDIAN_ENTRY 30176
|
||||
#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -- every 25secs
|
||||
#define SPELL_GUARDIAN_AURA 56151
|
||||
|
||||
#define EMOTE_HATCHES "An Ahn'kahar Guardian hatches!"
|
||||
|
||||
struct TRINITY_DLL_DECL boss_elder_nadoxAI : public ScriptedAI
|
||||
{
|
||||
boss_elder_nadoxAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 plague_Timer;
|
||||
uint32 rage_Timer;
|
||||
|
||||
uint32 swarmer_spawn_Timer;
|
||||
uint32 guard_spawn_Timer;
|
||||
uint32 enrage_Timer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
plague_Timer = 13000;
|
||||
rage_Timer = 20000;
|
||||
|
||||
swarmer_spawn_Timer = 10000;
|
||||
guard_spawn_Timer = 25000;
|
||||
|
||||
enrage_Timer = 5000;
|
||||
|
||||
DeadAhnkaharGuardian = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_DEATH,m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_SLAY_3,m_creature); //SAY_SLAY_3 on death?
|
||||
|
||||
if (IsHeroic() && !DeadAhnkaharGuardian)
|
||||
{
|
||||
AchievementEntry const *AchievRespectYourElders = GetAchievementStore()->LookupEntry(ACHIEVEMENT_RESPECT_YOUR_ELDERS);
|
||||
if (AchievRespectYourElders)
|
||||
{
|
||||
Map* pMap = m_creature->GetMap();
|
||||
if (pMap && pMap->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &players = pMap->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
itr->getSource()->CompletedAchievement(AchievRespectYourElders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (plague_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_BROOD_PLAGUE, H_SPELL_BROOD_PLAGUE));
|
||||
plague_Timer = 15000;
|
||||
} else plague_Timer -= diff;
|
||||
|
||||
if (IsHeroic())
|
||||
if (rage_Timer <= diff)
|
||||
{
|
||||
Unit* Swarmer = m_creature->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35);
|
||||
|
||||
if (Swarmer)
|
||||
{
|
||||
DoCast(Swarmer, H_SPELL_BROOD_RAGE, true);
|
||||
rage_Timer = 15000;
|
||||
}
|
||||
} else rage_Timer -= diff;
|
||||
|
||||
if (swarmer_spawn_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SUMMON_SWARMERS, true);
|
||||
DoCast(m_creature, SPELL_SUMMON_SWARMERS);
|
||||
if (urand(1,3) == 3) // 33% chance of dialog
|
||||
DoScriptText(RAND(SAY_EGG_SAC_1,SAY_EGG_SAC_2), m_creature);
|
||||
|
||||
swarmer_spawn_Timer = 10000;
|
||||
} else swarmer_spawn_Timer -= diff;
|
||||
|
||||
if (guard_spawn_Timer <= diff)
|
||||
{
|
||||
m_creature->MonsterTextEmote(EMOTE_HATCHES,m_creature->GetGUID(),true);
|
||||
DoCast(m_creature, SPELL_SUMMON_SWARM_GUARD);
|
||||
guard_spawn_Timer = 25000;
|
||||
} else guard_spawn_Timer -= diff;
|
||||
|
||||
if (enrage_Timer <= diff)
|
||||
{
|
||||
if (m_creature->HasAura(SPELL_ENRAGE,0))
|
||||
return;
|
||||
|
||||
float x, y, z, o;
|
||||
m_creature->GetHomePosition(x, y, z, o);
|
||||
if (z < 24)
|
||||
if (!m_creature->IsNonMeleeSpellCasted(false))
|
||||
DoCast(m_creature, SPELL_ENRAGE, true);
|
||||
|
||||
enrage_Timer = 5000;
|
||||
} else enrage_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_elder_nadox(Creature* pCreature)
|
||||
{
|
||||
return new boss_elder_nadoxAI(pCreature);
|
||||
}
|
||||
|
||||
#define SPELL_SPRINT 56354
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ahnkahar_nerubianAI : public ScriptedAI
|
||||
{
|
||||
mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
uint32 sprint_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (m_creature->GetEntry() == 30176) //magic numbers are bad!
|
||||
DoCast(m_creature, SPELL_GUARDIAN_AURA, true);
|
||||
sprint_Timer = 10000;
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY)
|
||||
DeadAhnkaharGuardian = true;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who){}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (m_creature->GetEntry() == 30176) //magic numbers are bad!
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS)
|
||||
{
|
||||
m_creature->DealDamage(m_creature,m_creature->GetHealth());
|
||||
m_creature->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (sprint_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SPRINT);
|
||||
sprint_Timer = 25000;
|
||||
} else sprint_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_nadox_eggsAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_nadox_eggsAI(Creature* c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
c->UpdateAllStats();
|
||||
}
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* who) {}
|
||||
void AttackStart(Unit* victim) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff) {}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature* pCreature)
|
||||
{
|
||||
return new mob_ahnkahar_nerubianAI(pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_nadox_eggs(Creature* _Creature)
|
||||
{
|
||||
return new mob_nadox_eggsAI(_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_elder_nadox()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_elder_nadox";
|
||||
newscript->GetAI = &GetAI_boss_elder_nadox;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ahnkahar_nerubian";
|
||||
newscript->GetAI = &GetAI_mob_ahnkahar_nerubian;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_nadox_eggs";
|
||||
newscript->GetAI = &GetAI_mob_nadox_eggs;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_herald_volazj
|
||||
SDAuthor: Tartalo
|
||||
SD%Complete: 20
|
||||
SDComment: Coded all but Insanity
|
||||
SDCategory: Ahn'kahet
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "ahnkahet.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_INSANITY = 57496, //Dummy
|
||||
INSANITY_VISUAL = 57561,
|
||||
SPELL_MIND_FLAY = 57941,
|
||||
H_SPELL_MIND_FLAY = 59974,
|
||||
SPELL_SHADOW_BOLT_VOLLEY = 57942,
|
||||
H_SPELL_SHADOW_BOLT_VOLLEY = 59975,
|
||||
SPELL_SHIVER = 57949,
|
||||
H_SPELL_SHIVER = 59978
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1619030,
|
||||
SAY_SLAY_1 = -1619031,
|
||||
SAY_SLAY_2 = -1619032,
|
||||
SAY_SLAY_3 = -1619033,
|
||||
SAY_DEATH_1 = -1619034,
|
||||
SAY_DEATH_2 = -1619035,
|
||||
SAY_PHASE = -1619036
|
||||
};
|
||||
|
||||
enum Achievements
|
||||
{
|
||||
ACHIEVEMENT_QUICK_DEMISE = 1862
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI
|
||||
{
|
||||
boss_volazjAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
uint32 uiMindFlayTimer;
|
||||
uint32 uiShadowBoltVolleyTimer;
|
||||
uint32 uiShiverTimer;
|
||||
uint32 uiEncounterTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiEncounterTimer = 0;
|
||||
uiMindFlayTimer = 8000;
|
||||
uiShadowBoltVolleyTimer = 5000;
|
||||
uiShiverTimer = 15000;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HERALD_VOLAZJ, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HERALD_VOLAZJ, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiMindFlayTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MIND_FLAY, H_SPELL_MIND_FLAY));
|
||||
uiMindFlayTimer = 20000;
|
||||
} else uiMindFlayTimer -= diff;
|
||||
|
||||
if (uiShadowBoltVolleyTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SHADOW_BOLT_VOLLEY, H_SPELL_SHADOW_BOLT_VOLLEY));
|
||||
uiShadowBoltVolleyTimer = 5000;
|
||||
} else uiShadowBoltVolleyTimer -= diff;
|
||||
|
||||
if (uiShiverTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_SHIVER, H_SPELL_SHIVER));
|
||||
uiShiverTimer = 15000;
|
||||
} else uiShiverTimer -= diff;
|
||||
|
||||
uiEncounterTimer += diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH_1, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HERALD_VOLAZJ, DONE);
|
||||
|
||||
AchievementEntry const *AchievQuickDemise = GetAchievementStore()->LookupEntry(ACHIEVEMENT_QUICK_DEMISE);
|
||||
Map* pMap = m_creature->GetMap();
|
||||
|
||||
if (IsHeroic() && uiEncounterTimer < 120000 && pMap && pMap->IsDungeon() && AchievQuickDemise)
|
||||
{
|
||||
Map::PlayerList const &players = pMap->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
itr->getSource()->CompletedAchievement(AchievQuickDemise);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_volazj(Creature* pCreature)
|
||||
{
|
||||
return new boss_volazjAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_volazj()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_volazj";
|
||||
newscript->GetAI = &GetAI_boss_volazj;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,594 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_jedoga_shadowseeker
|
||||
SDAuthor: WarHead
|
||||
SD%Complete: 100%
|
||||
SDComment: Complete - BUT THE TRIGGER NEEDS DATA WHETHER THE PRISON OF TALDARAM IS OFFLINE !
|
||||
SDCategory: Ahn'kahet
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "ahnkahet.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
TEXT_AGGRO = -1619000,
|
||||
TEXT_SACRIFICE_1_1 = -1619001,
|
||||
TEXT_SACRIFICE_1_2 = -1619002,
|
||||
TEXT_SACRIFICE_2_1 = -1619003,
|
||||
TEXT_SACRIFICE_2_2 = -1619004,
|
||||
TEXT_SLAY_1 = -1619005,
|
||||
TEXT_SLAY_2 = -1619006,
|
||||
TEXT_SLAY_3 = -1619007,
|
||||
TEXT_DEATH = -1619008,
|
||||
TEXT_PREACHING_1 = -1619009,
|
||||
TEXT_PREACHING_2 = -1619010,
|
||||
TEXT_PREACHING_3 = -1619011,
|
||||
TEXT_PREACHING_4 = -1619012,
|
||||
TEXT_PREACHING_5 = -1619013
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SPHERE_VISUAL = 56075,
|
||||
SPELL_GIFT_OF_THE_HERALD = 56219,
|
||||
SPELL_CYCLONE_STRIKE = 56855, // Self
|
||||
SPELL_CYCLONE_STRIKE_H = 60030,
|
||||
SPELL_LIGHTNING_BOLT = 56891, // 40Y
|
||||
SPELL_LIGHTNING_BOLT_H = 60032, // 40Y
|
||||
SPELL_THUNDERSHOCK = 56926, // 30Y
|
||||
SPELL_THUNDERSHOCK_H = 60029 // 30Y
|
||||
};
|
||||
|
||||
float JEDOGA_POS[2][4] =
|
||||
{
|
||||
{372.330994f, -705.278015f, -0.624178f, 5.427970f},
|
||||
{372.330994f, -705.278015f, -16.179716f, 5.427970f}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_jedoga_shadowseekerAI : public ScriptedAI
|
||||
{
|
||||
boss_jedoga_shadowseekerAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
FirstTime = true;
|
||||
predone = false;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiOpFerTimer,
|
||||
uiCycloneTimer,
|
||||
uiBoltTimer,
|
||||
uiThunderTimer;
|
||||
|
||||
bool predone,
|
||||
bOpFerok,
|
||||
bOnGround,
|
||||
bOpFerokFail,
|
||||
bCanDown;
|
||||
|
||||
bool FirstTime;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiOpFerTimer = urand(15000,20000);
|
||||
|
||||
uiCycloneTimer = 3000;
|
||||
uiBoltTimer = 7000;
|
||||
uiThunderTimer = 12000;
|
||||
|
||||
bOpFerok = false;
|
||||
bOpFerokFail = false;
|
||||
bOnGround = false;
|
||||
bCanDown = false;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (!FirstTime)
|
||||
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, FAIL);
|
||||
|
||||
pInstance->SetData64(DATA_PL_JEDOGA_TARGET, 0);
|
||||
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
|
||||
pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
|
||||
}
|
||||
MoveUp();
|
||||
|
||||
FirstTime = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (!pInstance || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == 30181))
|
||||
return;
|
||||
|
||||
DoScriptText(TEXT_AGGRO, m_creature);
|
||||
m_creature->SetInCombatWithZone();
|
||||
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == 30181))
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* Victim)
|
||||
{
|
||||
if (!Victim || Victim->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), m_creature);
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
DoScriptText(TEXT_DEATH, m_creature);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, DONE);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!pInstance || !who || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == 30181))
|
||||
return;
|
||||
|
||||
if (!predone && who->GetTypeId() == TYPEID_PLAYER && m_creature->GetDistance(who) < 100.0f)
|
||||
{
|
||||
DoScriptText(RAND(TEXT_PREACHING_1, TEXT_PREACHING_2, TEXT_PREACHING_3, TEXT_PREACHING_4, TEXT_PREACHING_5), m_creature);
|
||||
predone = true;
|
||||
}
|
||||
|
||||
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS || !bOnGround)
|
||||
return;
|
||||
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && m_creature->IsHostileTo(who) && who->isInAccessiblePlaceFor(m_creature))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
|
||||
{
|
||||
if (!m_creature->getVictim())
|
||||
{
|
||||
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
|
||||
AttackStart(who);
|
||||
}
|
||||
else if (m_creature->GetMap()->IsDungeon())
|
||||
{
|
||||
who->SetInCombatWith(m_creature);
|
||||
m_creature->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveDown()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
bOpFerokFail = false;
|
||||
|
||||
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 0);
|
||||
m_creature->GetMotionMaster()->MovePoint(1, JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2]);
|
||||
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
|
||||
m_creature->SendMonsterMove(JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2], 0, MOVEFLAG_JUMP, 0);
|
||||
m_creature->Relocate(JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2], JEDOGA_POS[1][3]);
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
|
||||
|
||||
bOnGround = true;
|
||||
|
||||
if (UpdateVictim())
|
||||
{
|
||||
AttackStart(m_creature->getVictim());
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Unit* pTarget = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_PL_JEDOGA_TARGET)))
|
||||
{
|
||||
AttackStart(pTarget);
|
||||
pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
|
||||
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
|
||||
EnterCombat(pTarget);
|
||||
}
|
||||
else if (!m_creature->isInCombat())
|
||||
EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
|
||||
void MoveUp()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
m_creature->AttackStop();
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->LoadCreaturesAddon();
|
||||
m_creature->GetMotionMaster()->MovePoint(0, JEDOGA_POS[0][0], JEDOGA_POS[0][1], JEDOGA_POS[0][2]);
|
||||
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING);
|
||||
m_creature->SendMonsterMove(JEDOGA_POS[0][0], JEDOGA_POS[0][1], JEDOGA_POS[0][2], 0, MOVEFLAG_JUMP, 0);
|
||||
m_creature->Relocate(JEDOGA_POS[0][0], JEDOGA_POS[0][1], JEDOGA_POS[0][2], JEDOGA_POS[0][3]);
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->StopMoving();
|
||||
|
||||
pInstance->SetData(DATA_JEDOGA_TRIGGER_SWITCH, 1);
|
||||
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) OpferRufen();
|
||||
|
||||
bOnGround = false;
|
||||
uiOpFerTimer = urand(15000,30000);
|
||||
}
|
||||
|
||||
void OpferRufen()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
uint64 opfer = pInstance->GetData64(DATA_ADD_JEDOGA_INITIAND);
|
||||
|
||||
if (opfer)
|
||||
{
|
||||
DoScriptText(RAND(TEXT_SACRIFICE_1_1, TEXT_SACRIFICE_1_2), m_creature);
|
||||
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, opfer);
|
||||
} else
|
||||
bCanDown = true;
|
||||
}
|
||||
|
||||
void Opfern()
|
||||
{
|
||||
DoScriptText(RAND(TEXT_SACRIFICE_2_1, TEXT_SACRIFICE_2_2), m_creature);
|
||||
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
DoCast(m_creature, SPELL_GIFT_OF_THE_HERALD, false);
|
||||
|
||||
bOpFerok = false;
|
||||
bCanDown = true;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && pInstance->GetData(DATA_ALL_INITIAND_DEAD))
|
||||
MoveDown();
|
||||
|
||||
if (bOpFerok && !bOnGround && !bCanDown) Opfern();
|
||||
|
||||
if (bOpFerokFail && !bOnGround && !bCanDown)
|
||||
bCanDown = true;
|
||||
|
||||
if (bCanDown)
|
||||
{
|
||||
MoveDown();
|
||||
bCanDown = false;
|
||||
}
|
||||
|
||||
if (bOnGround)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiCycloneTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_CYCLONE_STRIKE, SPELL_CYCLONE_STRIKE_H), false);
|
||||
uiCycloneTimer = urand(15000,30000);
|
||||
} else uiCycloneTimer -= diff;
|
||||
|
||||
if (uiBoltTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_LIGHTNING_BOLT, SPELL_LIGHTNING_BOLT_H), false);
|
||||
|
||||
uiBoltTimer = urand(15000,30000);
|
||||
} else uiBoltTimer -= diff;
|
||||
|
||||
if (uiThunderTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_THUNDERSHOCK, SPELL_THUNDERSHOCK_H), false);
|
||||
|
||||
uiThunderTimer = urand(15000,30000);
|
||||
} else uiThunderTimer -= diff;
|
||||
|
||||
if (uiOpFerTimer <= diff)
|
||||
MoveUp();
|
||||
else
|
||||
uiOpFerTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_jedoga_initiandAI : public ScriptedAI
|
||||
{
|
||||
mob_jedoga_initiandAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 checktimer;
|
||||
|
||||
bool walking;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
walking = false;
|
||||
checktimer = 2000;
|
||||
|
||||
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS)
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoCast(m_creature, SPELL_SPHERE_VISUAL, false);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (!Killer || !pInstance) return;
|
||||
|
||||
if (walking)
|
||||
{
|
||||
Creature* boss = m_creature->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
|
||||
if (boss && !CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok) CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = true;
|
||||
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER) pInstance->SetData(DATA_INITIAND_KILLED, 1);
|
||||
pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
|
||||
|
||||
walking = false;
|
||||
}
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER) pInstance->SetData64(DATA_PL_JEDOGA_TARGET, Killer->GetGUID());
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !who) return;
|
||||
}
|
||||
|
||||
void AttackStart(Unit* victim)
|
||||
{
|
||||
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !victim) return;
|
||||
|
||||
ScriptedAI::AttackStart(victim);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if ((pInstance && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS) || !who) return;
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiPointId)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE || !pInstance) return;
|
||||
|
||||
switch(uiPointId)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Creature* boss = m_creature->GetMap()->GetCreature(pInstance->GetData64(DATA_JEDOGA_SHADOWSEEKER));
|
||||
if (boss)
|
||||
{
|
||||
CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok = true;
|
||||
CAST_AI(boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = false;
|
||||
m_creature->Kill(m_creature);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance && checktimer <= diff)
|
||||
{
|
||||
if (m_creature->GetGUID() == pInstance->GetData64(DATA_ADD_JEDOGA_OPFER) && !walking)
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
float distance = m_creature->GetDistance(JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2]);
|
||||
|
||||
if (distance < 9.0f)
|
||||
m_creature->SetSpeed(MOVE_WALK, 0.5f, true);
|
||||
else if (distance < 15.0f)
|
||||
m_creature->SetSpeed(MOVE_WALK, 0.75f, true);
|
||||
else if (distance < 20.0f)
|
||||
m_creature->SetSpeed(MOVE_WALK, 1.0f, true);
|
||||
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MovePoint(1, JEDOGA_POS[1][0], JEDOGA_POS[1][1], JEDOGA_POS[1][2]);
|
||||
walking = true;
|
||||
}
|
||||
if (!walking)
|
||||
{
|
||||
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) != IN_PROGRESS && m_creature->HasAura(SPELL_SPHERE_VISUAL))
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, false);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, false);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
if (pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == IN_PROGRESS && !m_creature->HasAura(SPELL_SPHERE_VISUAL))
|
||||
{
|
||||
DoCast(m_creature, SPELL_SPHERE_VISUAL, false);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
}
|
||||
checktimer = 2000;
|
||||
} else checktimer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
// Jedogas Aufseher - Entry: 30181
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
enum AufseherSpell
|
||||
{
|
||||
SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1 = 60342,
|
||||
SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2 = 56312
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_jedogas_aufseher_triggerAI : public Scripted_NoMovementAI
|
||||
{
|
||||
npc_jedogas_aufseher_triggerAI(Creature* c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
c->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
|
||||
c->setFaction(35);
|
||||
removed = false;
|
||||
removed2 = false;
|
||||
casted = false;
|
||||
casted2 = false;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
bool removed,
|
||||
removed2,
|
||||
casted,
|
||||
casted2;
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* who) {}
|
||||
void AttackStart(Unit* victim) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (!removed && m_creature->GetPositionX() > 440.0f)
|
||||
{ /* NEEDS DATA WHETHER THE PRISON OF TALDARAM IS OFFLINE !
|
||||
if (pInstance->GetData(EVENT_VORRICHTUNGEN))
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
removed = true;
|
||||
return;
|
||||
}*/
|
||||
if (pInstance->GetData(DATA_PRINCE_TALDARAM_EVENT) == DONE)
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
removed = true;
|
||||
return;
|
||||
}
|
||||
if (!casted)
|
||||
{
|
||||
DoCast(m_creature, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_1, false);
|
||||
casted = true;
|
||||
}
|
||||
}
|
||||
if (!removed2 && m_creature->GetPositionX() < 440.0f)
|
||||
{
|
||||
if (!casted2 && pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
|
||||
{
|
||||
DoCast(m_creature, SPELL_BEAM_VISUAL_JEDOGAS_AUFSEHER_2, false);
|
||||
casted2 = true;
|
||||
}
|
||||
if (casted2 && !pInstance->GetData(DATA_JEDOGA_TRIGGER_SWITCH))
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
casted2 = false;
|
||||
}
|
||||
if (!removed2 && pInstance->GetData(DATA_JEDOGA_SHADOWSEEKER_EVENT) == DONE)
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
removed2 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_jedoga_shadowseeker(Creature* pCreature)
|
||||
{
|
||||
return new boss_jedoga_shadowseekerAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_jedoga_initiand(Creature* pCreature)
|
||||
{
|
||||
return new mob_jedoga_initiandAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_jedogas_aufseher_trigger(Creature* pCreature)
|
||||
{
|
||||
return new npc_jedogas_aufseher_triggerAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_jedoga_shadowseeker()
|
||||
{
|
||||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_jedoga_shadowseeker";
|
||||
newscript->GetAI = &GetAI_boss_jedoga_shadowseeker;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_jedoga_initiand";
|
||||
newscript->GetAI = &GetAI_mob_jedoga_initiand;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_jedogas_aufseher_trigger";
|
||||
newscript->GetAI = &GetAI_npc_jedogas_aufseher_trigger;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,417 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_prince_taldaram
|
||||
SDAuthor: Tartalo & tlexii
|
||||
SD%Complete: 0
|
||||
SDComment:
|
||||
SDCategory: Ahn'kahet
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "ahnkahet.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BLOODTHIRST = 55968, //Trigger Spell + add aura
|
||||
SPELL_CONJURE_FLAME_SPHERE = 55931,
|
||||
SPELL_FLAME_SPHERE_SUMMON_1 = 55895,// 1x 30106
|
||||
H_SPELL_FLAME_SPHERE_SUMMON_1 = 59511,// 1x 31686
|
||||
H_SPELL_FLAME_SPHERE_SUMMON_2 = 59512,// 1x 31687
|
||||
SPELL_FLAME_SPHERE_SPAWN_EFFECT = 55891,
|
||||
SPELL_FLAME_SPHERE_VISUAL = 55928,
|
||||
SPELL_FLAME_SPHERE_PERIODIC = 55926,
|
||||
H_SPELL_FLAME_SPHERE_PERIODIC = 59508,
|
||||
SPELL_FLAME_SPHERE_DEATH_EFFECT = 55947,
|
||||
SPELL_BEAM_VISUAL = 60342,
|
||||
SPELL_EMBRACE_OF_THE_VAMPYR = 55959,
|
||||
H_SPELL_EMBRACE_OF_THE_VAMPYR = 59513,
|
||||
SPELL_VANISH = 55964,
|
||||
CREATURE_FLAME_SPHERE = 30106,
|
||||
H_CREATURE_FLAME_SPHERE_1 = 31686,
|
||||
H_CREATURE_FLAME_SPHERE_2 = 31687
|
||||
};
|
||||
enum Misc
|
||||
{
|
||||
DATA_EMBRACE_DMG = 20000,
|
||||
H_DATA_EMBRACE_DMG = 40000,
|
||||
DATA_SPHERE_DISTANCE = 15
|
||||
};
|
||||
#define DATA_SPHERE_ANGLE_OFFSET 0.7
|
||||
#define DATA_GROUND_POSITION_Z 11.4
|
||||
enum Achievements
|
||||
{
|
||||
ACHIEVEMENT_THE_PARTY_IS_OVER = 1861
|
||||
};
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1619021,
|
||||
SAY_SLAY_1 = -1619022,
|
||||
SAY_SLAY_2 = -1619023,
|
||||
SAY_DEATH = -1619024,
|
||||
SAY_FEED_1 = -1619025,
|
||||
SAY_FEED_2 = -1619026,
|
||||
SAY_VANISH_1 = -1619027,
|
||||
SAY_VANISH_2 = -1619028
|
||||
};
|
||||
enum CombatPhase
|
||||
{
|
||||
NORMAL,
|
||||
CASTING_FLAME_SPHERES,
|
||||
JUST_VANISHED,
|
||||
VANISHED,
|
||||
FEEDING
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_taldaramAI : public ScriptedAI
|
||||
{
|
||||
boss_taldaramAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
uint32 uiBloodthirstTimer;
|
||||
uint32 uiVanishTimer;
|
||||
uint32 uiWaitTimer;
|
||||
uint32 uiEmbraceTimer;
|
||||
uint32 uiEmbraceTakenDamage;
|
||||
uint32 uiFlamesphereTimer;
|
||||
uint32 uiPhaseTimer;
|
||||
|
||||
uint64 uiSphereGuids[2];
|
||||
|
||||
Unit *pEmbraceTarget;
|
||||
Unit *pSphereTarget;
|
||||
|
||||
Creature* pSpheres[3];
|
||||
|
||||
CombatPhase Phase;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiBloodthirstTimer = 10000;
|
||||
uiVanishTimer = (25 + rand()%10)*1000;
|
||||
uiEmbraceTimer = 20000;
|
||||
uiFlamesphereTimer = 5000;
|
||||
uiEmbraceTakenDamage = 0;
|
||||
Phase = NORMAL;
|
||||
uiPhaseTimer = 0;
|
||||
pEmbraceTarget = NULL;
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, IN_PROGRESS);
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
if (uiPhaseTimer <= diff)
|
||||
{
|
||||
switch (Phase)
|
||||
{
|
||||
case CASTING_FLAME_SPHERES:
|
||||
//DoCast(m_creature, SPELL_FLAME_SPHERE_SUMMON_1);
|
||||
pSpheres[0] = DoSpawnCreature(CREATURE_FLAME_SPHERE, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
pSphereTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pSphereTarget && pSpheres[0])
|
||||
{
|
||||
float angle,x,y;
|
||||
angle = pSpheres[0]->GetAngle(pSphereTarget);
|
||||
x = pSpheres[0]->GetPositionX() + DATA_SPHERE_DISTANCE * cos(angle);
|
||||
y = pSpheres[0]->GetPositionY() + DATA_SPHERE_DISTANCE * sin(angle);
|
||||
pSpheres[0]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[0]->GetPositionZ());
|
||||
}
|
||||
if (IsHeroic())
|
||||
{
|
||||
//DoCast(m_creature, H_SPELL_FLAME_SPHERE_SUMMON_1);
|
||||
pSpheres[1] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_1, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
//DoCast(m_creature, H_SPELL_FLAME_SPHERE_SUMMON_2);
|
||||
pSpheres[2] = DoSpawnCreature(H_CREATURE_FLAME_SPHERE_2, 0, 0, 5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
|
||||
if (pSphereTarget && pSpheres[1] && pSpheres[2])
|
||||
{
|
||||
float angle,x,y;
|
||||
angle = pSpheres[1]->GetAngle(pSphereTarget) + DATA_SPHERE_ANGLE_OFFSET;
|
||||
x = pSpheres[1]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
|
||||
y = pSpheres[1]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
|
||||
pSpheres[1]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[1]->GetPositionZ());
|
||||
angle = pSpheres[2]->GetAngle(pSphereTarget) - DATA_SPHERE_ANGLE_OFFSET;
|
||||
x = pSpheres[2]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
|
||||
y = pSpheres[2]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
|
||||
pSpheres[2]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[2]->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
Phase = NORMAL;
|
||||
uiPhaseTimer = 0;
|
||||
break;
|
||||
case JUST_VANISHED:
|
||||
if(pEmbraceTarget)
|
||||
{
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->SetSpeed(MOVE_WALK, 2.0f, true);
|
||||
m_creature->GetMotionMaster()->MoveChase(pEmbraceTarget);
|
||||
}
|
||||
Phase = VANISHED;
|
||||
uiPhaseTimer = 1300;
|
||||
break;
|
||||
case VANISHED:
|
||||
if(pEmbraceTarget)
|
||||
DoCast(pEmbraceTarget, DUNGEON_MODE(SPELL_EMBRACE_OF_THE_VAMPYR, H_SPELL_EMBRACE_OF_THE_VAMPYR));
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->SetSpeed(MOVE_WALK, 1.0f, true);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
Phase = FEEDING;
|
||||
uiPhaseTimer = 20000;
|
||||
break;
|
||||
case FEEDING:
|
||||
Phase = NORMAL;
|
||||
uiPhaseTimer = 0;
|
||||
pEmbraceTarget = NULL;
|
||||
break;
|
||||
case NORMAL:
|
||||
if (uiBloodthirstTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_BLOODTHIRST);
|
||||
uiBloodthirstTimer = 10000;
|
||||
} else uiBloodthirstTimer -= diff;
|
||||
|
||||
if (uiFlamesphereTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_CONJURE_FLAME_SPHERE);
|
||||
Phase = CASTING_FLAME_SPHERES;
|
||||
uiPhaseTimer = 3000 + diff;
|
||||
uiFlamesphereTimer = 15000;
|
||||
} else uiFlamesphereTimer -= diff;
|
||||
|
||||
if (uiVanishTimer <= diff)
|
||||
{
|
||||
//Count alive players
|
||||
Unit *pTarget = NULL;
|
||||
std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
|
||||
std::vector<Unit *> target_list;
|
||||
for (std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
|
||||
// exclude pets & totems
|
||||
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive())
|
||||
target_list.push_back(pTarget);
|
||||
pTarget = NULL;
|
||||
}
|
||||
//He only vanishes if there are 3 or more alive players
|
||||
if (target_list.size() > 2)
|
||||
{
|
||||
DoScriptText(RAND(SAY_VANISH_1,SAY_VANISH_2), m_creature);
|
||||
DoCast(m_creature, SPELL_VANISH);
|
||||
Phase = JUST_VANISHED;
|
||||
uiPhaseTimer = 500;
|
||||
pEmbraceTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
}
|
||||
uiVanishTimer = urand(25000,35000);
|
||||
} else uiVanishTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
}
|
||||
} else uiPhaseTimer -= diff;
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage)
|
||||
{
|
||||
if (Phase == FEEDING && pEmbraceTarget && pEmbraceTarget->isAlive())
|
||||
{
|
||||
uiEmbraceTakenDamage += damage;
|
||||
if (uiEmbraceTakenDamage > DUNGEON_MODE(DATA_EMBRACE_DMG, H_DATA_EMBRACE_DMG))
|
||||
{
|
||||
Phase = NORMAL;
|
||||
uiPhaseTimer = 0;
|
||||
pEmbraceTarget = NULL;
|
||||
m_creature->CastStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE);
|
||||
|
||||
//The Party's Over achievement:
|
||||
AchievementEntry const *AchievThePartyIsOver = GetAchievementStore()->LookupEntry(ACHIEVEMENT_THE_PARTY_IS_OVER);
|
||||
Map* pMap = m_creature->GetMap();
|
||||
if (pMap && pMap->IsDungeon() && IsHeroic() && AchievThePartyIsOver)
|
||||
{
|
||||
Map::PlayerList const &players = pMap->GetPlayers();
|
||||
if (players.getSize() < 5)
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
itr->getSource()->CompletedAchievement(AchievThePartyIsOver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
if (Phase == FEEDING && pEmbraceTarget && victim == pEmbraceTarget)
|
||||
{
|
||||
Phase = NORMAL;
|
||||
uiPhaseTimer = 0;
|
||||
pEmbraceTarget = NULL;
|
||||
}
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
}
|
||||
|
||||
bool CheckSpheres()
|
||||
{
|
||||
if(!pInstance)
|
||||
return false;
|
||||
uiSphereGuids[0] = pInstance->GetData64(DATA_SPHERE1);
|
||||
uiSphereGuids[1] = pInstance->GetData64(DATA_SPHERE2);
|
||||
|
||||
GameObject *pSpheres[2];
|
||||
for (uint8 i=0; i < 2; ++i)
|
||||
{
|
||||
pSpheres[i] = pInstance->instance->GetGameObject(uiSphereGuids[i]);
|
||||
if (!pSpheres[i])
|
||||
return false;
|
||||
if (pSpheres[i]->GetGoState() != GO_STATE_ACTIVE)
|
||||
return false;
|
||||
}
|
||||
RemovePrison();
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemovePrison()
|
||||
{
|
||||
if(!pInstance)
|
||||
return;
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL);
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||
m_creature->SetHomePosition(m_creature->GetPositionX(), m_creature->GetPositionY(), DATA_GROUND_POSITION_Z, m_creature->GetOrientation());
|
||||
uint64 prison_GUID = pInstance->GetData64(DATA_PRINCE_TALDARAM_PLATFORM);
|
||||
pInstance->HandleGameObject(prison_GUID,true);
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_taldaram_flamesphereAI : public ScriptedAI
|
||||
{
|
||||
mob_taldaram_flamesphereAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiDespawnTimer;
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
m_creature->setFaction(16);
|
||||
m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
|
||||
DoCast(m_creature, SPELL_FLAME_SPHERE_VISUAL);
|
||||
DoCast(m_creature, SPELL_FLAME_SPHERE_SPAWN_EFFECT);
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_FLAME_SPHERE_PERIODIC, H_SPELL_FLAME_SPHERE_PERIODIC));
|
||||
uiDespawnTimer = 10000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who) {}
|
||||
void MoveInLineOfSight(Unit *who) {}
|
||||
|
||||
void JustDied(Unit* slayer)
|
||||
{
|
||||
DoCast(m_creature, SPELL_FLAME_SPHERE_DEATH_EFFECT);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (uiDespawnTimer <= diff)
|
||||
m_creature->DisappearAndDie();
|
||||
else
|
||||
uiDespawnTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_taldaram(Creature* pCreature)
|
||||
{
|
||||
return new boss_taldaramAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_taldaram_flamesphere(Creature* pCreature)
|
||||
{
|
||||
return new mob_taldaram_flamesphereAI (pCreature);
|
||||
}
|
||||
|
||||
bool GOHello_prince_taldaram_sphere(Player *pPlayer, GameObject *pGO)
|
||||
{
|
||||
ScriptedInstance *pInstance = pGO->GetInstanceData();
|
||||
|
||||
Creature *pPrinceTaldaram = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_PRINCE_TALDARAM) : 0);
|
||||
if (pPrinceTaldaram && pPrinceTaldaram->isAlive())
|
||||
{
|
||||
// maybe these are hacks :(
|
||||
pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
pGO->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
switch(pGO->GetEntry())
|
||||
{
|
||||
case 193093: pInstance->SetData(DATA_SPHERE1_EVENT,IN_PROGRESS); break;
|
||||
case 193094: pInstance->SetData(DATA_SPHERE2_EVENT,IN_PROGRESS); break;
|
||||
}
|
||||
|
||||
CAST_AI(boss_taldaramAI, pPrinceTaldaram->AI())->CheckSpheres();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddSC_boss_taldaram()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_taldaram";
|
||||
newscript->GetAI = &GetAI_boss_taldaram;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_taldaram_flamesphere";
|
||||
newscript->GetAI = &GetAI_mob_taldaram_flamesphere;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "prince_taldaram_sphere";
|
||||
newscript->pGOHello = &GOHello_prince_taldaram_sphere;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Azjol_Nerub
|
||||
SD%Complete: 0
|
||||
SDComment:
|
||||
SDCategory: Azjol Nerub
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "ahnkahet.h"
|
||||
|
||||
#define MAX_ENCOUNTER 5
|
||||
#define MAX_JEDOGA_INITIANDS 15
|
||||
|
||||
#define AchievementVolunteerWork 2056
|
||||
|
||||
/* Ahn'kahet encounters:
|
||||
0 - Elder Nadox
|
||||
1 - Prince Taldaram
|
||||
2 - Jedoga Shadowseeker
|
||||
3 - Herald Volazj
|
||||
4 - Amanitar (Heroic only)
|
||||
*/
|
||||
|
||||
struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance
|
||||
{
|
||||
instance_ahnkahet(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
|
||||
uint64 Elder_Nadox;
|
||||
uint64 Prince_Taldaram;
|
||||
uint64 Jedoga_Shadowseeker;
|
||||
uint64 Herald_Volazj;
|
||||
uint64 Amanitar;
|
||||
|
||||
uint64 Prince_TaldaramSpheres[2];
|
||||
uint64 Prince_TaldaramPlatform;
|
||||
uint64 Prince_TaldaramGate;
|
||||
|
||||
std::set<uint64> InitiandGUIDs;
|
||||
uint64 JedogaSacrifices;
|
||||
uint64 JedogaTarget;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 spheres[2];
|
||||
|
||||
uint8 InitiandCnt,
|
||||
switchtrigger,
|
||||
initiandkilled;
|
||||
|
||||
std::string str_data;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
InitiandGUIDs.clear();
|
||||
|
||||
Elder_Nadox =0;
|
||||
Prince_Taldaram =0;
|
||||
Jedoga_Shadowseeker =0;
|
||||
Herald_Volazj =0;
|
||||
Amanitar =0;
|
||||
|
||||
spheres[0] = NOT_STARTED;
|
||||
spheres[1] = NOT_STARTED;
|
||||
|
||||
InitiandCnt = 0;
|
||||
switchtrigger = 0;
|
||||
initiandkilled = 0;
|
||||
JedogaSacrifices = 0;
|
||||
JedogaTarget = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool add)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case 29309: Elder_Nadox = pCreature->GetGUID(); break;
|
||||
case 29308: Prince_Taldaram = pCreature->GetGUID(); break;
|
||||
case 29310: Jedoga_Shadowseeker = pCreature->GetGUID(); break;
|
||||
case 29311: Herald_Volazj = pCreature->GetGUID(); break;
|
||||
case 30258: Amanitar = pCreature->GetGUID(); break;
|
||||
case 30114: InitiandGUIDs.insert(pCreature->GetGUID()); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case 193564: Prince_TaldaramPlatform = pGo->GetGUID();
|
||||
if (m_auiEncounter[1] == DONE) HandleGameObject(NULL,true,pGo); break;
|
||||
case 193093: Prince_TaldaramSpheres[0] = pGo->GetGUID();
|
||||
if (spheres[0] == IN_PROGRESS)
|
||||
{
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
else pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
break;
|
||||
case 193094: Prince_TaldaramSpheres[1] = pGo->GetGUID();
|
||||
if (spheres[1] == IN_PROGRESS)
|
||||
{
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
else pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
break;
|
||||
case 192236: Prince_TaldaramGate = pGo->GetGUID(); // Web gate past Prince Taldaram
|
||||
if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData64(uint32 idx, uint64 guid)
|
||||
{
|
||||
switch(idx)
|
||||
{
|
||||
case DATA_ADD_JEDOGA_OPFER: JedogaSacrifices = guid; break;
|
||||
case DATA_PL_JEDOGA_TARGET: JedogaTarget = guid; break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_ELDER_NADOX: return Elder_Nadox;
|
||||
case DATA_PRINCE_TALDARAM: return Prince_Taldaram;
|
||||
case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker;
|
||||
case DATA_HERALD_VOLAZJ: return Herald_Volazj;
|
||||
case DATA_AMANITAR: return Amanitar;
|
||||
case DATA_SPHERE1: return Prince_TaldaramSpheres[0];
|
||||
case DATA_SPHERE2: return Prince_TaldaramSpheres[1];
|
||||
case DATA_PRINCE_TALDARAM_PLATFORM: return Prince_TaldaramPlatform;
|
||||
case DATA_ADD_JEDOGA_INITIAND:
|
||||
{
|
||||
std::vector<uint64> vInitiands;
|
||||
vInitiands.clear();
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
{
|
||||
Creature* cr = instance->GetCreature(*itr);
|
||||
if (cr && cr->isAlive())
|
||||
vInitiands.push_back(*itr);
|
||||
}
|
||||
if (vInitiands.empty())
|
||||
return 0;
|
||||
uint8 j = urand(0,vInitiands.size() -1);
|
||||
return vInitiands[j];
|
||||
}
|
||||
case DATA_ADD_JEDOGA_OPFER: return JedogaSacrifices;
|
||||
case DATA_PL_JEDOGA_TARGET: return JedogaTarget;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_ELDER_NADOX_EVENT: m_auiEncounter[0] = data; break;
|
||||
case DATA_PRINCE_TALDARAM_EVENT:
|
||||
if (data == DONE)
|
||||
HandleGameObject(Prince_TaldaramGate,true);
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_JEDOGA_SHADOWSEEKER_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
if (data == DONE)
|
||||
{
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
{
|
||||
Creature* cr = instance->GetCreature(*itr);
|
||||
if (cr && cr->isAlive())
|
||||
{
|
||||
cr->SetVisibility(VISIBILITY_OFF);
|
||||
cr->setDeathState(JUST_DIED);
|
||||
cr->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
if (!initiandkilled && instance->IsHeroic())
|
||||
DoCompleteAchievement(AchievementVolunteerWork);
|
||||
}
|
||||
break;
|
||||
case DATA_HERALD_VOLAZJ: m_auiEncounter[3] = data; break;
|
||||
case DATA_AMANITAR: m_auiEncounter[4] = data; break;
|
||||
case DATA_SPHERE1_EVENT: spheres[0] = data; break;
|
||||
case DATA_SPHERE2_EVENT: spheres[1] = data; break;
|
||||
case DATA_JEDOGA_TRIGGER_SWITCH: switchtrigger = data; break;
|
||||
case DATA_INITIAND_KILLED: initiandkilled = data; break;
|
||||
case DATA_JEDOGA_RESET_INITIANDS:
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
{
|
||||
Creature* cr = instance->GetCreature(*itr);
|
||||
if (cr)
|
||||
{
|
||||
cr->Respawn();
|
||||
if (!cr->IsInEvadeMode()) cr->AI()->EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_ELDER_NADOX_EVENT: return m_auiEncounter[0];
|
||||
case DATA_PRINCE_TALDARAM_EVENT: return m_auiEncounter[1];
|
||||
case DATA_JEDOGA_SHADOWSEEKER_EVENT: return m_auiEncounter[2];
|
||||
case DATA_HERALD_VOLAZJ: return m_auiEncounter[3];
|
||||
case DATA_AMANITAR: return m_auiEncounter[4];
|
||||
case DATA_SPHERE1_EVENT: return spheres[0];
|
||||
case DATA_SPHERE2_EVENT: return spheres[1];
|
||||
case DATA_ALL_INITIAND_DEAD:
|
||||
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
|
||||
{
|
||||
Creature* cr = instance->GetCreature(*itr);
|
||||
if (!cr || (cr && cr->isAlive())) return 0;
|
||||
}
|
||||
return 1;
|
||||
case DATA_JEDOGA_TRIGGER_SWITCH: return switchtrigger;
|
||||
case DATA_INITIAND_KILLED: return initiandkilled;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " "
|
||||
<< spheres[0] << " " << spheres[1];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0, data1, data2, data3, data4, data5, data6;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4 >> data5 >> data6;
|
||||
|
||||
if (dataHead1 == 'A' && dataHead2 == 'K')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
m_auiEncounter[3] = data3;
|
||||
m_auiEncounter[4] = data4;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
spheres[0] = data5;
|
||||
spheres[1] = data6;
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_ahnkahet(Map* pMap)
|
||||
{
|
||||
return new instance_ahnkahet(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_ahnkahet()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_ahnkahet";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef DEF_AZJOL_NERUB_H
|
||||
#define DEF_AZJOL_NERUB_H
|
||||
|
||||
enum Data64
|
||||
{
|
||||
DATA_KRIKTHIR_THE_GATEWATCHER,
|
||||
DATA_HADRONOX,
|
||||
DATA_ANUBARAK,
|
||||
DATA_WATCHER_GASHRA,
|
||||
DATA_WATCHER_SILTHIK,
|
||||
DATA_WATCHER_NARJIL
|
||||
};
|
||||
enum Data
|
||||
{
|
||||
DATA_KRIKTHIR_THE_GATEWATCHER_EVENT,
|
||||
DATA_HADRONOX_EVENT,
|
||||
DATA_ANUBARAK_EVENT
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,289 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_anubarak
|
||||
SD%Complete: 90 %
|
||||
SDComment: Says are not implemented.
|
||||
SDCategory: Azjol Nerub
|
||||
EndScriptData */
|
||||
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "azjol_nerub.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CARRION_BEETLES = 53520,
|
||||
SPELL_SUMMON_CARRION_BEETLES = 53521,
|
||||
SPELL_LEECHING_SWARM = 53467,
|
||||
|
||||
SPELL_IMPALE = 53454,
|
||||
H_SPELL_IMPALE = 59446,
|
||||
|
||||
SPELL_POUND = 53472,
|
||||
H_SPELL_POUND = 59433,
|
||||
|
||||
SPELL_SUBMERGE = 53421,
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
CREATURE_GUARDIAN = 29216,
|
||||
CREATURE_VENOMANCER = 29217,
|
||||
CREATURE_DATTER = 29213
|
||||
};
|
||||
|
||||
// not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_INTRO = -1601010,
|
||||
SAY_AGGRO = -1601000,
|
||||
SAY_SLAY_1 = -1601001,
|
||||
SAY_SLAY_2 = -1601002,
|
||||
SAY_SLAY_3 = -1601003,
|
||||
SAY_LOCUST_1 = -1601005,
|
||||
SAY_LOCUST_2 = -1601006,
|
||||
SAY_LOCUST_3 = -1601007,
|
||||
SAY_SUBMERGE_1 = -1601008,
|
||||
SAY_SUBMERGE_2 = -1601009,
|
||||
SAY_DEATH = -1601004
|
||||
};
|
||||
#define SPAWNPOINT_Z 224.3
|
||||
|
||||
float SpawnPoint[2][2] =
|
||||
{
|
||||
{550.7, 282.8},
|
||||
{551.1, 229.4},
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI
|
||||
{
|
||||
boss_anub_arakAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
bool Channeling;
|
||||
bool HeroicMode;
|
||||
bool Summoned_Guardian;
|
||||
bool Summoned_Venomancer;
|
||||
bool Summoned_Datter;
|
||||
uint32 Phase;
|
||||
uint32 Phase_Time;
|
||||
|
||||
uint32 SPELL_CARRION_BEETLES_Timer;
|
||||
uint32 SPELL_LEECHING_SWARM_Timer;
|
||||
uint32 SPELL_IMPALE_Timer;
|
||||
uint32 SPELL_POUND_Timer;
|
||||
uint32 SPELL_SUBMERGE_Timer;
|
||||
uint32 UNDERGROUND_Timer;
|
||||
uint32 VENOMANCER_Timer;
|
||||
uint32 DATTER_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
|
||||
SPELL_CARRION_BEETLES_Timer = 8000;
|
||||
SPELL_LEECHING_SWARM_Timer = 20000;
|
||||
SPELL_IMPALE_Timer = 9000;
|
||||
SPELL_POUND_Timer = 15000;
|
||||
|
||||
Phase = 0;
|
||||
Phase_Time = 0;
|
||||
Channeling = false;
|
||||
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->RemoveAura(SPELL_SUBMERGE);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ANUBARAK_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
|
||||
void EnterCombat(Unit *pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ANUBARAK_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Channeling == true)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
DoCast(m_creature->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true);
|
||||
Channeling = false;
|
||||
}
|
||||
|
||||
if (Phase == 1)
|
||||
{
|
||||
if (SPELL_IMPALE_Timer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_IMPALE,H_SPELL_IMPALE), true);
|
||||
|
||||
SPELL_IMPALE_Timer = 9000;
|
||||
} else SPELL_IMPALE_Timer -= diff;
|
||||
|
||||
if (!Summoned_Guardian)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (Creature *Guardian = m_creature->SummonCreature(CREATURE_GUARDIAN,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0))
|
||||
{
|
||||
Guardian->AddThreat(m_creature->getVictim(), 0.0f);
|
||||
DoZoneInCombat(Guardian);
|
||||
}
|
||||
}
|
||||
Summoned_Guardian = true;
|
||||
}
|
||||
|
||||
if(!Summoned_Venomancer)
|
||||
{
|
||||
if (VENOMANCER_Timer <= diff)
|
||||
{
|
||||
if (Phase_Time > 1)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (Creature *Venomancer = m_creature->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0))
|
||||
{
|
||||
Venomancer->AddThreat(m_creature->getVictim(), 0.0f);
|
||||
DoZoneInCombat(Venomancer);
|
||||
}
|
||||
}
|
||||
Summoned_Venomancer = true;
|
||||
}
|
||||
} else VENOMANCER_Timer -= diff;
|
||||
}
|
||||
|
||||
if(!Summoned_Datter)
|
||||
{
|
||||
if (DATTER_Timer <= diff)
|
||||
{
|
||||
if (Phase_Time > 2)
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
if (Creature *Datter = m_creature->SummonCreature(CREATURE_DATTER,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0))
|
||||
{
|
||||
Datter->AddThreat(m_creature->getVictim(), 0.0f);
|
||||
DoZoneInCombat(Datter);
|
||||
}
|
||||
}
|
||||
Summoned_Datter = true;
|
||||
}
|
||||
} else DATTER_Timer -= diff;
|
||||
}
|
||||
|
||||
if (UNDERGROUND_Timer <= diff)
|
||||
{
|
||||
m_creature->RemoveAura(SPELL_SUBMERGE);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
|
||||
Phase = 0;
|
||||
} else UNDERGROUND_Timer -= diff;
|
||||
}
|
||||
|
||||
if (Phase == 0)
|
||||
{
|
||||
if (SPELL_LEECHING_SWARM_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_LEECHING_SWARM, true);
|
||||
SPELL_LEECHING_SWARM_Timer = 19000;
|
||||
} else SPELL_LEECHING_SWARM_Timer -= diff;
|
||||
|
||||
if (SPELL_CARRION_BEETLES_Timer <= diff)
|
||||
{
|
||||
Channeling = true;
|
||||
DoCastVictim(SPELL_CARRION_BEETLES);
|
||||
SPELL_CARRION_BEETLES_Timer = 25000;
|
||||
} else SPELL_CARRION_BEETLES_Timer -= diff;
|
||||
|
||||
if (SPELL_POUND_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(DUNGEON_MODE(SPELL_POUND, H_SPELL_POUND));
|
||||
SPELL_POUND_Timer = 16500;
|
||||
} else SPELL_POUND_Timer -= diff;
|
||||
}
|
||||
|
||||
if ((Phase_Time == 0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 75)
|
||||
|| (Phase_Time == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50)
|
||||
|| (Phase_Time == 2 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25))
|
||||
{
|
||||
++Phase_Time;
|
||||
|
||||
Summoned_Guardian = false;
|
||||
Summoned_Venomancer = false;
|
||||
Summoned_Datter = false;
|
||||
|
||||
UNDERGROUND_Timer = 40000;
|
||||
VENOMANCER_Timer = 25000;
|
||||
DATTER_Timer = 32000;
|
||||
|
||||
DoCast(m_creature, SPELL_SUBMERGE, false);
|
||||
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
Phase = 1;
|
||||
}
|
||||
|
||||
if (Phase != 1)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit *pKiller)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ANUBARAK_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *pVictim)
|
||||
{
|
||||
if (pVictim == m_creature)
|
||||
return;
|
||||
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_anub_arak(Creature *pCreature)
|
||||
{
|
||||
return new boss_anub_arakAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_anub_arak()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_anub_arak";
|
||||
newscript->GetAI = &GetAI_boss_anub_arak;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Script Data Start
|
||||
SDName: Boss hadronox
|
||||
SDAuthor: WarHead
|
||||
SD%Complete: 50
|
||||
SDComment: No Waves atm and the doors spells are crazy...
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
//Phase 0 => Gauntlet Event described below
|
||||
//Phase 1 => Boss Encounter
|
||||
|
||||
/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians.
|
||||
When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back,
|
||||
so you don't aggro all 3. Hadronox will be under you, fighting Nerubians.
|
||||
|
||||
This is the timed gauntlet - waves of non-elite spiders
|
||||
will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the
|
||||
main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for
|
||||
Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "azjol_nerub.h"
|
||||
|
||||
#define SPELL_ACID_CLOUD 53400 // Victim
|
||||
#define SPELL_LEECH_POISON 53030 // Victim
|
||||
#define SPELL_PIERCE_ARMOR 53418 // Victim
|
||||
#define SPELL_WEB_GRAB 57731 // Victim
|
||||
#define SPELL_WEB_FRONT_DOORS 53177 // Self
|
||||
#define SPELL_WEB_SIDE_DOORS 53185 // Self
|
||||
|
||||
#define SPELL_ACID_CLOUD_H 59419
|
||||
#define SPELL_LEECH_POISON_H 59417
|
||||
#define SPELL_WEB_GRAB_H 59421
|
||||
|
||||
struct TRINITY_DLL_DECL boss_hadronoxAI : public ScriptedAI
|
||||
{
|
||||
boss_hadronoxAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
MaxDistance = 50.0f;
|
||||
FirstTime = true;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 acidtimer,
|
||||
leechtimer,
|
||||
piercetimer,
|
||||
grabtimer,
|
||||
doorstimer,
|
||||
CheckDistanceTimer;
|
||||
|
||||
bool FirstTime;
|
||||
|
||||
float MaxDistance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 9.0f);
|
||||
m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 9.0f);
|
||||
|
||||
acidtimer = urand(10000,14000);
|
||||
leechtimer = urand(3000,9000);
|
||||
piercetimer = urand(1000,3000);
|
||||
grabtimer = urand(15000,19000);
|
||||
doorstimer = urand(20000,30000);
|
||||
|
||||
CheckDistanceTimer = 2000;
|
||||
|
||||
if (pInstance && (pInstance->GetData(DATA_HADRONOX_EVENT) != DONE && !FirstTime))
|
||||
pInstance->SetData(DATA_HADRONOX_EVENT, FAIL);
|
||||
|
||||
FirstTime = false;
|
||||
}
|
||||
|
||||
//when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on
|
||||
void KilledUnit(Unit* Victim)
|
||||
{
|
||||
// not sure if this aura check is correct, I think it is though
|
||||
if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, SPELL_LEECH_POISON_H)) || !m_creature->isAlive())
|
||||
return;
|
||||
|
||||
uint32 health = (m_creature->GetMaxHealth()/100)*10;
|
||||
|
||||
if ((m_creature->GetHealth()+health) >= m_creature->GetMaxHealth())
|
||||
m_creature->SetHealth(m_creature->GetMaxHealth());
|
||||
else
|
||||
m_creature->SetHealth(m_creature->GetHealth()+health);
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HADRONOX_EVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HADRONOX_EVENT, IN_PROGRESS);
|
||||
m_creature->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void CheckDistance(float dist, const uint32 uiDiff)
|
||||
{
|
||||
if (!m_creature->isInCombat())
|
||||
return;
|
||||
|
||||
float x=0.0f, y=0.0f, z=0.0f;
|
||||
m_creature->GetRespawnCoord(x,y,z);
|
||||
|
||||
if (CheckDistanceTimer <= uiDiff)
|
||||
CheckDistanceTimer = 5000;
|
||||
else
|
||||
{
|
||||
CheckDistanceTimer -= uiDiff;
|
||||
return;
|
||||
}
|
||||
if (m_creature->IsInEvadeMode() || !m_creature->getVictim())
|
||||
return;
|
||||
if (m_creature->GetDistance(x,y,z) > dist)
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim()) return;
|
||||
|
||||
// Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge!
|
||||
CheckDistance(MaxDistance, diff);
|
||||
|
||||
if (m_creature->HasAura(SPELL_WEB_FRONT_DOORS) || m_creature->HasAura(SPELL_WEB_SIDE_DOORS))
|
||||
{
|
||||
if (IsCombatMovement())
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
else if (!IsCombatMovement())
|
||||
SetCombatMovement(true);
|
||||
|
||||
if (piercetimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_PIERCE_ARMOR);
|
||||
piercetimer = 8000;
|
||||
} else piercetimer -= diff;
|
||||
|
||||
if (acidtimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_ACID_CLOUD, SPELL_ACID_CLOUD_H));
|
||||
|
||||
acidtimer = urand(20000,30000);
|
||||
} else acidtimer -= diff;
|
||||
|
||||
if (leechtimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_LEECH_POISON, SPELL_LEECH_POISON_H));
|
||||
|
||||
leechtimer = urand(11000,14000);
|
||||
} else leechtimer -= diff;
|
||||
|
||||
if (grabtimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself.
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_WEB_GRAB, SPELL_WEB_GRAB_H));
|
||||
|
||||
grabtimer = urand(15000,30000);
|
||||
} else grabtimer -= diff;
|
||||
|
||||
if (doorstimer <= diff)
|
||||
{/* Debuff bleibt auf den Spielern bis zum Tod...
|
||||
DoCast(m_creature, RAND(SPELL_WEB_FRONT_DOORS, SPELL_WEB_SIDE_DOORS));
|
||||
*/
|
||||
doorstimer = urand(30000,60000);
|
||||
} else doorstimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_hadronox(Creature* pCreature)
|
||||
{
|
||||
return new boss_hadronoxAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_hadronox()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_hadronox";
|
||||
newscript->GetAI = &GetAI_boss_hadronox;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,556 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_krikthir_the_gatewatcher
|
||||
SD%Complete: 80 %
|
||||
SDComment: Find in the future best timers and the event is not implemented.
|
||||
SDCategory: Azjol Nerub
|
||||
EndScriptData */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_krik_thir' where entry = '';
|
||||
*** SQL END ***/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "azjol_nerub.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MIND_FLAY = 52586,
|
||||
H_SPELL_MIND_FLAY = 59367,
|
||||
SPELL_CURSE_OF_FATIGUE = 52592,
|
||||
H_SPELL_CURSE_OF_FATIGUE = 59368,
|
||||
SPELL_FRENZY = 28747, //maybe 53361
|
||||
|
||||
SPELL_SUMMON_SKITTERING_SWARMER = 52438, //AOE Effect 140, maybe 52439
|
||||
SPELL_SUMMON_SKITTERING_SWARMER_1 = 52439, //Summon 3x 28735
|
||||
|
||||
H_SPELL_ACID_SPLASH = 59363,
|
||||
SPELL_ACID_SPLASH = 52446,
|
||||
|
||||
SPELL_CHARGE = 16979,//maybe is another spell
|
||||
SPELL_BACKSTAB = 52540,
|
||||
|
||||
SPELL_SHADOW_BOLT = 52534,
|
||||
H_SPELL_SHADOW_BOLT = 59357,
|
||||
SPELL_SHADOW_NOVA = 52535,
|
||||
H_SPELL_SHADOW_NOVA = 59358,
|
||||
|
||||
SPELL_STRIKE = 52532,
|
||||
SPELL_CLEAVE = 49806,
|
||||
|
||||
SPELL_ENRAGE = 52470,
|
||||
|
||||
SPELL_INFECTED_BITE = 52469,
|
||||
H_SPELL_INFECTED_BITE = 59364,
|
||||
SPELL_WEB_WRAP = 52086,//the spell is not working propperly
|
||||
|
||||
SPELL_BLINDING_WEBS = 52524,
|
||||
H_SPELL_BLINDING_WEBS = 59365,
|
||||
|
||||
SPELL_POSION_SPRAY = 52493,
|
||||
H_SPELL_POSION_SPRAY = 59366,
|
||||
};
|
||||
|
||||
enum Mobs
|
||||
{
|
||||
MOB_SKITTERING_SWARMER = 28735,
|
||||
MOB_SKITTERING_SWARMER_CONTROLLER = 32593,
|
||||
MOB_SKITTERING_INFECTIOR = 28736,
|
||||
};
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1601000,
|
||||
SAY_SLAY_1 = -1601001,
|
||||
SAY_SLAY_2 = -1601002,
|
||||
SAY_DEATH = -1601003,
|
||||
//Not in db
|
||||
SAY_SEND_GROUP_1 = -1601004,
|
||||
SAY_SEND_GROUP_2 = -1601005,
|
||||
SAY_SEND_GROUP_3 = -1601006,
|
||||
SAY_SWARM_1 = -1601007,
|
||||
SAY_SWARM_2 = -1601008,
|
||||
SAY_PREFIGHT_1 = -1601009,
|
||||
SAY_PREFIGHT_2 = -1601010,
|
||||
SAY_PREFIGHT_3 = -1601011,
|
||||
};
|
||||
enum Misc
|
||||
{
|
||||
ACHIEVEMENT_WATCH_HIM_DIE = 1296
|
||||
};
|
||||
struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI
|
||||
{
|
||||
boss_krik_thirAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 MindFlayTimer;
|
||||
uint32 CurseFatigueTimer;
|
||||
uint32 SummonTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
MindFlayTimer = 15000;
|
||||
CurseFatigueTimer = 12000;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
Summon();
|
||||
SummonTimer = 15000;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void Summon()
|
||||
{
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,566.164,682.087,769.079,2.21657,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,566.164,682.087,769.079,2.21657,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,529.042,706.941,777.298,1.0821,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,529.042,706.941,777.298,1.0821,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,489.975,671.239,772.131,0.261799,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,489.975,671.239,772.131,0.261799,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,488.556,692.95,771.764,4.88692,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,488.556,692.95,771.764,4.88692,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,553.34,640.387,777.419,1.20428,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,553.34,640.387,777.419,1.20428,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,517.486,706.398,777.335,5.35816,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,517.486,706.398,777.335,5.35816,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_INFECTIOR,504.01,637.693,777.479,0.506145,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,504.01,637.693,777.479,0.506145,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,552.625,706.408,777.177,3.4383,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
m_creature->SummonCreature(MOB_SKITTERING_SWARMER,552.625,706.408,777.177,3.4383,TEMPSUMMON_TIMED_DESPAWN,25000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (SummonTimer <= diff)
|
||||
{
|
||||
Summon();
|
||||
SummonTimer = 15000;
|
||||
} else SummonTimer -= diff;
|
||||
|
||||
if (MindFlayTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MIND_FLAY, H_SPELL_MIND_FLAY));
|
||||
MindFlayTimer = 15000;
|
||||
} else MindFlayTimer -= diff;
|
||||
|
||||
if (CurseFatigueTimer <= diff)
|
||||
{
|
||||
//WowWiki say "Curse of Fatigue-Kirk'thir will cast Curse of Fatigue on 2-3 targets periodically."
|
||||
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
Unit *pTarget_1 = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
|
||||
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));
|
||||
DoCast(pTarget_1, DUNGEON_MODE(SPELL_CURSE_OF_FATIGUE, H_SPELL_CURSE_OF_FATIGUE));
|
||||
|
||||
CurseFatigueTimer = 10000;
|
||||
} else CurseFatigueTimer -= diff;
|
||||
|
||||
if (!m_creature->HasAura(SPELL_FRENZY) && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10)
|
||||
DoCast(m_creature, SPELL_FRENZY, true);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, DONE);
|
||||
//Achievement: Watch him die
|
||||
AchievementEntry const *AchievWatchHimDie = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WATCH_HIM_DIE);
|
||||
Map* pMap = m_creature->GetMap();
|
||||
Creature *pAdd1, *pAdd2, *pAdd3;
|
||||
if ((pAdd1 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_GASHRA))) && pAdd1->isAlive() &&
|
||||
(pAdd2 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_SILTHIK))) && pAdd2->isAlive() &&
|
||||
(pAdd3 = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_WATCHER_NARJIL))) && pAdd3->isAlive() &&
|
||||
IsHeroic() && pMap && pMap->IsDungeon() && AchievWatchHimDie)
|
||||
{
|
||||
Map::PlayerList const &players = pMap->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (itr->getSource())
|
||||
itr->getSource()->CompletedAchievement(AchievWatchHimDie);
|
||||
}
|
||||
}
|
||||
}
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
summoned->GetMotionMaster()->MovePoint(m_creature->GetEntry(),m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ());
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_skittering_infectorAI : public ScriptedAI
|
||||
{
|
||||
npc_skittering_infectorAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
//The spell is not working propperly
|
||||
DoCast(m_creature->getVictim(),DUNGEON_MODE(SPELL_ACID_SPLASH, H_SPELL_ACID_SPLASH), true);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_anub_ar_skirmisherAI : public ScriptedAI
|
||||
{
|
||||
npc_anub_ar_skirmisherAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 ChargeTimer;
|
||||
uint32 BackstabTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ChargeTimer = 11000;
|
||||
BackstabTimer = 7000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (ChargeTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
DoResetThreat();
|
||||
m_creature->AddThreat(pTarget,1.0f);
|
||||
DoCast(pTarget, SPELL_CHARGE, true);
|
||||
}
|
||||
|
||||
ChargeTimer = 15000;
|
||||
} else ChargeTimer -= diff;
|
||||
|
||||
if (BackstabTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_BACKSTAB);
|
||||
BackstabTimer = 12000;
|
||||
} else BackstabTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_anub_ar_shadowcasterAI : public ScriptedAI
|
||||
{
|
||||
npc_anub_ar_shadowcasterAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 ShadowBoltTimer;
|
||||
uint32 ShadowNovaTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowBoltTimer = 6000;
|
||||
ShadowNovaTimer = 15000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (ShadowBoltTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT), true);
|
||||
ShadowBoltTimer = 15000;
|
||||
} else ShadowBoltTimer -= diff;
|
||||
|
||||
if (ShadowNovaTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SHADOW_NOVA, H_SPELL_SHADOW_NOVA), true);
|
||||
ShadowNovaTimer = 17000;
|
||||
} else ShadowNovaTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_anub_ar_warriorAI : public ScriptedAI
|
||||
{
|
||||
npc_anub_ar_warriorAI(Creature *c) : ScriptedAI(c){}
|
||||
|
||||
uint32 CleaveTimer;
|
||||
uint32 StrikeTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
CleaveTimer = 11000;
|
||||
StrikeTimer = 6000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (StrikeTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STRIKE, true);
|
||||
StrikeTimer = 15000;
|
||||
} else StrikeTimer -= diff;
|
||||
|
||||
if (CleaveTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_CLEAVE, true);
|
||||
CleaveTimer = 17000;
|
||||
} else CleaveTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_watcher_gashraAI : public ScriptedAI
|
||||
{
|
||||
npc_watcher_gashraAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 WebWrapTimer;
|
||||
uint32 InfectedBiteTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
WebWrapTimer = 11000;
|
||||
InfectedBiteTimer = 4000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoCast(m_creature, SPELL_ENRAGE, true);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (WebWrapTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_WEB_WRAP, true);
|
||||
WebWrapTimer = 17000;
|
||||
} else WebWrapTimer -= diff;
|
||||
|
||||
if (InfectedBiteTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true);
|
||||
InfectedBiteTimer = 15000;
|
||||
} else InfectedBiteTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_watcher_narjilAI : public ScriptedAI
|
||||
{
|
||||
npc_watcher_narjilAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 WebWrapTimer;
|
||||
uint32 InfectedBiteTimer;
|
||||
uint32 BlindingWebsTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
WebWrapTimer = 11000;
|
||||
InfectedBiteTimer = 4000;
|
||||
BlindingWebsTimer = 17000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (WebWrapTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_WEB_WRAP, true);
|
||||
WebWrapTimer = 15000;
|
||||
} else WebWrapTimer -= diff;
|
||||
|
||||
if (InfectedBiteTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true);
|
||||
InfectedBiteTimer = 11000;
|
||||
} else InfectedBiteTimer -= diff;
|
||||
|
||||
if (BlindingWebsTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_BLINDING_WEBS, H_SPELL_BLINDING_WEBS), true);
|
||||
BlindingWebsTimer = 17000;
|
||||
} else BlindingWebsTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_watcher_silthikAI : public ScriptedAI
|
||||
{
|
||||
npc_watcher_silthikAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 WebWrapTimer;
|
||||
uint32 InfectedBiteTimer;
|
||||
uint32 PosionSprayTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
WebWrapTimer = 11000;
|
||||
InfectedBiteTimer = 4000;
|
||||
PosionSprayTimer = 15000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (WebWrapTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_WEB_WRAP, true);
|
||||
|
||||
WebWrapTimer = 15000;
|
||||
} else WebWrapTimer -= diff;
|
||||
|
||||
if (InfectedBiteTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_INFECTED_BITE, H_SPELL_INFECTED_BITE), true);
|
||||
InfectedBiteTimer = 15000;
|
||||
} else InfectedBiteTimer -= diff;
|
||||
|
||||
if (PosionSprayTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_POSION_SPRAY, H_SPELL_POSION_SPRAY), true);
|
||||
PosionSprayTimer = 17000;
|
||||
} else PosionSprayTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_krik_thir(Creature* pCreature)
|
||||
{
|
||||
return new boss_krik_thirAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_anub_ar_skirmisher (Creature* pCreature)
|
||||
{
|
||||
return new npc_anub_ar_skirmisherAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_skittering_infector (Creature* pCreature)
|
||||
{
|
||||
return new npc_skittering_infectorAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_anub_ar_shadowcaster (Creature* pCreature)
|
||||
{
|
||||
return new npc_anub_ar_shadowcasterAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_anub_ar_warrior (Creature* pCreature)
|
||||
{
|
||||
return new npc_anub_ar_warriorAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_watcher_gashra (Creature* pCreature)
|
||||
{
|
||||
return new npc_watcher_gashraAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_watcher_narjil (Creature* pCreature)
|
||||
{
|
||||
return new npc_watcher_narjilAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_watcher_silthik (Creature* pCreature)
|
||||
{
|
||||
return new npc_watcher_silthikAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_krik_thir()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_krik_thir";
|
||||
newscript->GetAI = &GetAI_boss_krik_thir;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_skittering_infector";
|
||||
newscript->GetAI = &GetAI_npc_skittering_infector;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_anub_ar_skirmisher";
|
||||
newscript->GetAI = &GetAI_npc_anub_ar_skirmisher;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_anub_ar_shadowcaster";
|
||||
newscript->GetAI = &GetAI_npc_anub_ar_shadowcaster;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_watcher_gashra";
|
||||
newscript->GetAI = &GetAI_npc_watcher_gashra;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_anub_ar_warrior";
|
||||
newscript->GetAI = &GetAI_npc_anub_ar_warrior;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_watcher_silthik";
|
||||
newscript->GetAI = &GetAI_npc_watcher_silthik;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_watcher_narjil";
|
||||
newscript->GetAI = &GetAI_npc_watcher_narjil;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Azjol_Nerub
|
||||
SD%Complete: 0
|
||||
SDComment: Placeholder
|
||||
SDCategory: Azjol Nerub
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "azjol_nerub.h"
|
||||
|
||||
#define MAX_ENCOUNTER 3
|
||||
|
||||
/* Azjol Nerub encounters:
|
||||
0 - Krik'thir the Gatewatcher
|
||||
1 - Hadronox
|
||||
2 - Anub'arak
|
||||
*/
|
||||
|
||||
struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
|
||||
{
|
||||
instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
|
||||
uint64 m_uiKrikthir;
|
||||
uint64 m_uiHadronox;
|
||||
uint64 m_uiAnubarak;
|
||||
uint64 m_uiWatcherGashra;
|
||||
uint64 m_uiWatcherSilthik;
|
||||
uint64 m_uiWatcherNarjil;
|
||||
|
||||
uint64 m_uiKrikthirDoor;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
m_uiKrikthir = 0;
|
||||
m_uiHadronox = 0;
|
||||
m_uiAnubarak = 0;
|
||||
m_uiWatcherGashra = 0;
|
||||
m_uiWatcherSilthik = 0;
|
||||
m_uiWatcherNarjil = 0;
|
||||
m_uiKrikthirDoor = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool add)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case 28684: m_uiKrikthir = pCreature->GetGUID(); break;
|
||||
case 28921: m_uiHadronox = pCreature->GetGUID(); break;
|
||||
case 29120: m_uiAnubarak = pCreature->GetGUID(); break;
|
||||
case 28730: m_uiWatcherGashra = pCreature->GetGUID(); break;
|
||||
case 28731: m_uiWatcherSilthik = pCreature->GetGUID(); break;
|
||||
case 28729: m_uiWatcherNarjil = pCreature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
{
|
||||
switch (pGo->GetEntry())
|
||||
{
|
||||
case 192395:
|
||||
m_uiKrikthirDoor = pGo->GetGUID();
|
||||
if (m_auiEncounter[0] == DONE)
|
||||
HandleGameObject(NULL,true,pGo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_KRIKTHIR_THE_GATEWATCHER: return m_uiKrikthir;
|
||||
case DATA_HADRONOX: return m_uiHadronox;
|
||||
case DATA_ANUBARAK: return m_uiAnubarak;
|
||||
case DATA_WATCHER_GASHRA: return m_uiWatcherGashra;
|
||||
case DATA_WATCHER_SILTHIK: return m_uiWatcherSilthik;
|
||||
case DATA_WATCHER_NARJIL: return m_uiWatcherNarjil;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
if (data == DONE)
|
||||
HandleGameObject(m_uiKrikthirDoor,true);
|
||||
break;
|
||||
case DATA_HADRONOX_EVENT:
|
||||
m_auiEncounter[1] = data; break;
|
||||
case DATA_ANUBARAK_EVENT:
|
||||
m_auiEncounter[2] = data; break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return m_auiEncounter[0];
|
||||
case DATA_HADRONOX_EVENT: return m_auiEncounter[1];
|
||||
case DATA_ANUBARAK_EVENT: return m_auiEncounter[2];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::string str_data;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "A N " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0,data1,data2;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2;
|
||||
|
||||
if (dataHead1 == 'A' && dataHead2 == 'N')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_azjol_nerub(Map* pMap)
|
||||
{
|
||||
return new instance_azjol_nerub(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_azjol_nerub()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_azjol_nerub";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
Reference in New Issue
Block a user