--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-04 17:22:43 -06:00
373 changed files with 2607 additions and 2215 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
CREATE TABLE `game_event_battleground_holiday` (
CREATE TABLE `game_event_battleground_holiday` (
`event` int(10) unsigned NOT NULL,
`bgflag` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`event`)
+1 -1
View File
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: MaNGOS <http://getmangos.com/>
+1 -1
View File
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: MaNGOS <http://getmangos.com/>
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: MaNGOS <http://getmangos.com/>
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: MaNGOS <http://getmangos.com/>
+1 -1
View File
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: MaNGOS <http://getmangos.com/>
+1 -1
View File
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: MaNGOS <http://getmangos.com/>
+1 -1
View File
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* Thanks to the original authors: MaNGOS <http://getmangos.com/>
+4 -4
View File
@@ -650,7 +650,7 @@ void LoadDatabase()
// Drop Existing Text Map, only done once and we are ready to add data from multiple sources.
TextMap.clear();
// Load EventAI Text
// Load EventAI Text
outstring_log("TSCR: Loading EventAI Texts...");
LoadTrinityStrings(TScriptDB,"eventai_texts",-1,1+(TEXT_SOURCE_RANGE));
@@ -716,7 +716,7 @@ void LoadDatabase()
outstring_log(">> Loaded 0 additional EventAI Texts data. DB table `eventai_texts` is empty.");
}
// Load Script Text
// Load Script Text
outstring_log("TSCR: Loading Script Texts...");
LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2));
@@ -781,7 +781,7 @@ void LoadDatabase()
outstring_log(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty.");
}
// Load Custom Text
// Load Custom Text
outstring_log("TSCR: Loading Custom Texts...");
LoadTrinityStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3));
@@ -1198,7 +1198,7 @@ void LoadDatabase()
struct TSpellSummary {
uint8 Targets; // set of enum SelectTarget
uint8 Effects; // set of enum SelectEffect
uint8 Effects; // set of enum SelectEffect
}extern *SpellSummary;
TRINITY_DLL_EXPORT
+8 -8
View File
@@ -136,7 +136,7 @@ void ScriptedAI::EnterEvadeMode()
{
if(owner->isAlive())
m_creature->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
}
}
else
m_creature->GetMotionMaster()->MoveTargetedHome();
}
@@ -434,7 +434,7 @@ void ScriptedAI::SelectUnitList(std::list<Unit*> &targetList, uint32 num, Select
|| playerOnly && target->GetTypeId() != TYPEID_PLAYER
|| dist && !m_creature->IsWithinCombatRange(target, dist))
{
continue;
continue;
}
targetList.push_back(target);
--num;
@@ -634,15 +634,15 @@ void FillSpellSummary()
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_FRIEND-1);
//Make sure that this spell includes a damage effect
if ( TempSpell->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE ||
TempSpell->Effect[j] == SPELL_EFFECT_INSTAKILL ||
TempSpell->Effect[j] == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE ||
if ( TempSpell->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE ||
TempSpell->Effect[j] == SPELL_EFFECT_INSTAKILL ||
TempSpell->Effect[j] == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE ||
TempSpell->Effect[j] == SPELL_EFFECT_HEALTH_LEECH )
SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_DAMAGE-1);
//Make sure that this spell includes a healing effect (or an apply aura with a periodic heal)
if ( TempSpell->Effect[j] == SPELL_EFFECT_HEAL ||
TempSpell->Effect[j] == SPELL_EFFECT_HEAL_MAX_HEALTH ||
if ( TempSpell->Effect[j] == SPELL_EFFECT_HEAL ||
TempSpell->Effect[j] == SPELL_EFFECT_HEAL_MAX_HEALTH ||
TempSpell->Effect[j] == SPELL_EFFECT_HEAL_MECHANICAL ||
(TempSpell->Effect[j] == SPELL_EFFECT_APPLY_AURA && TempSpell->EffectApplyAuraName[j]== 8 ))
SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_HEALING-1);
@@ -746,7 +746,7 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
}
Unit* FindCreature(uint32 entry, float range, Unit* Finder)
{
{
if(!Finder)
return NULL;
Creature* target = NULL;
+1 -1
View File
@@ -38,7 +38,7 @@ class TRINITY_DLL_DECL ScriptedInstance : public InstanceData
virtual void Update(uint32) {}
// Save and Load instance data to the database
const char* Save() { return NULL; }
const char* Save() { return NULL; }
void Load(const char* in) { }
};
@@ -44,13 +44,13 @@ bool AreaTrigger_at_legion_teleporter(Player *player, AreaTriggerEntry *at)
player->CastSpell(player,SPELL_TELE_A_TO,false);
return true;
}
if (player->GetTeam()== HORDE && player->GetQuestRewardStatus(10604))
{
player->CastSpell(player,SPELL_TELE_H_TO,false);
return true;
}
return false;
}
return false;
@@ -112,7 +112,7 @@ struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI
m_creature->resetAttackTimer();
}
}
else
else
{
//Only run this code if we arn't already casting
if (!m_creature->IsNonMeleeSpellCasted(false))
@@ -155,7 +155,7 @@ struct TRINITY_DLL_DECL generic_creatureAI : public ScriptedAI
}
}
}
};
};
CreatureAI* GetAI_generic_creature(Creature *_Creature)
{
return new generic_creatureAI (_Creature);
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Guard_AI
SD%Complete: 90
SDComment:
SDComment:
SDCategory: Guards
EndScriptData */
@@ -51,7 +51,7 @@ void guardAI::Aggro(Unit *who)
break;
}
}
if (SpellEntry const *spell = m_creature->reachWithSpellAttack(who))
DoCastSpell(who, spell);
}
@@ -74,7 +74,7 @@ bool ItemUse_item_only_for_flight(Player *player, Item* _Item, SpellCastTargets
{
uint32 itemId = _Item->GetEntry();
bool disabled = false;
//for special scripts
switch(itemId)
{
@@ -84,10 +84,10 @@ bool ItemUse_item_only_for_flight(Player *player, Item* _Item, SpellCastTargets
break;
case 34489:
if(player->GetZoneId() != 4080)
disabled = true;
disabled = true;
break;
}
// allow use in flight only
if( player->isInFlight() && !disabled)
return false;
@@ -110,7 +110,7 @@ bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTa
((Creature*)targets.getUnitTarget())->RemoveCorpse();
return false;
}
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
return true;
}
@@ -31,7 +31,7 @@ void npc_escortAI::AttackStart(Unit *who)
if (IsBeingEscorted && !Defend)
return;
if ( m_creature->Attack(who, true) )
{
m_creature->AddThreat(who, 0.0f);
@@ -237,7 +237,7 @@ void npc_escortAI::MovementInform(uint32 type, uint32 id)
void npc_escortAI::OnPossess(bool apply)
{
// We got possessed in the middle of being escorted, store the point
// We got possessed in the middle of being escorted, store the point
// where we left off to come back to when possess is removed
if (IsBeingEscorted)
{
@@ -139,7 +139,7 @@ bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const
struct TRINITY_DLL_DECL npc_dancing_flamesAI : public ScriptedAI
{
npc_dancing_flamesAI(Creature *c) : ScriptedAI(c) {Reset();}
bool active;
uint32 can_iteract;
@@ -899,7 +899,7 @@ struct TRINITY_DLL_DECL npc_steam_tonkAI : public ScriptedAI
void Reset() {}
void Aggro(Unit *who) {}
void OnPossess(bool apply)
{
if (apply)
@@ -921,11 +921,11 @@ CreatureAI* GetAI_npc_steam_tonk(Creature *_Creature)
return new npc_steam_tonkAI(_Creature);
}
#define SPELL_TONK_MINE_DETONATE 25099
#define SPELL_TONK_MINE_DETONATE 25099
struct TRINITY_DLL_DECL npc_tonk_mineAI : public ScriptedAI
{
npc_tonk_mineAI(Creature *c) : ScriptedAI(c)
npc_tonk_mineAI(Creature *c) : ScriptedAI(c)
{
m_creature->SetReactState(REACT_PASSIVE);
Reset();
@@ -1002,7 +1002,7 @@ bool ReceiveEmote_npc_brewfest_reveler( Player *player, Creature *_Creature, uin
#define SPELL_DEADLY_POISON 34655 //Venomous Snake
#define SPELL_CRIPPLING_POISON 3409 //Viper
#define VENOMOUS_SNAKE_TIMER 1200
#define VENOMOUS_SNAKE_TIMER 1200
#define VIPER_TIMER 3000
#define C_VIPER 19921
@@ -1016,14 +1016,14 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI
uint32 SpellTimer;
Unit *Owner;
bool IsViper;
void Aggro(Unit *who) {}
void Reset()
{
Owner = m_creature->GetOwner();
if (!m_creature->isPet() || !Owner)
if (!m_creature->isPet() || !Owner)
return;
CreatureInfo const *Info = m_creature->GetCreatureInfo();
@@ -1051,25 +1051,25 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI
{
if (!m_creature->isPet() || !Owner)
return;
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) && Owner->IsHostileTo(who))//don't attack not-pvp-flaged
{
if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
float attackRadius = m_creature->GetAttackDistance(who);
if( m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who) )
{
{
if (!(rand() % RAND) )
{
m_creature->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
{
m_creature->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
SpellTimer = (rand() % 10) * 100;
AttackStart(who);
InCombat = true;
}
}
}
}
}
}
void UpdateAI(const uint32 diff)
{
@@ -1077,41 +1077,41 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI
return;
//Follow if not in combat
if (!m_creature->hasUnitState(UNIT_STAT_FOLLOW)&& !InCombat)
if (!m_creature->hasUnitState(UNIT_STAT_FOLLOW)&& !InCombat)
{
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveFollow(Owner,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE);
}
//No victim -> get new from owner (need this because MoveInLineOfSight won't work while following -> corebug)
if (!m_creature->getVictim())
{
if (InCombat)
if (InCombat)
DoStopAttack();
InCombat = false;
if(Owner->getAttackerForHelper())
AttackStart(Owner->getAttackerForHelper());
return;
}
if (SpellTimer < diff)
{
if (IsViper) //Viper
{
if (rand() % 3 == 0) //33% chance to cast
{
uint32 spell;
uint32 spell;
if( rand() % 2 == 0)
spell = SPELL_MIND_NUMBING_POISON;
else
spell = SPELL_CRIPPLING_POISON;
DoCast(m_creature->getVictim(),spell);
}
SpellTimer = VIPER_TIMER;
}
else //Venomous Snake
@@ -1120,7 +1120,7 @@ struct TRINITY_DLL_DECL npc_snake_trap_serpentsAI : public ScriptedAI
DoCast(m_creature->getVictim(),SPELL_DEADLY_POISON);
SpellTimer = VENOMOUS_SNAKE_TIMER + (rand() %5)*100;
}
}else SpellTimer-=diff;
}else SpellTimer-=diff;
DoMeleeAttackIfReady();
}
};
@@ -32,11 +32,11 @@ EndContentData */
## npc_professor_phizzlethorpe
######*/
#define SAY_PROGRESS_1 -1000235
#define SAY_PROGRESS_1 -1000235
#define SAY_PROGRESS_2 -1000236
#define SAY_PROGRESS_3 -1000237
#define EMOTE_PROGRESS_4 -1000238
#define SAY_AGGRO -1000239
#define SAY_PROGRESS_3 -1000237
#define EMOTE_PROGRESS_4 -1000238
#define SAY_AGGRO -1000239
#define SAY_PROGRESS_5 -1000240
#define SAY_PROGRESS_6 -1000241
#define SAY_PROGRESS_7 -1000242
@@ -61,7 +61,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
case 4:DoScriptText(SAY_PROGRESS_2, m_creature, player);break;
case 5:DoScriptText(SAY_PROGRESS_3, m_creature, player);break;
case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break;
case 9:
case 9:
{
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -131,14 +131,14 @@ CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature)
professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24);
professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24);
professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67);
professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000);
professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000);
professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000);
professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000);
professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56);
professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31);
professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000);
professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000);
professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000);
professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000);
professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000);
professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000);
professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31);
professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56);
professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42);
@@ -146,7 +146,7 @@ CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature)
professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24);
professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24);
professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08);
professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000);
professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000);
professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000);
return (CreatureAI*)professor_phizzlethorpeAI;
@@ -20,12 +20,12 @@ SD%Complete: 70
SDComment: Quest support: 6544, 6482
SDCategory: Ashenvale Forest
EndScriptData */
/* ContentData
npc_torek
npc_ruul_snowhoof
EndContentData */
#include "precompiled.h"
#include "../../npc/npc_escortAI.h"
@@ -43,7 +43,7 @@ EndContentData */
#define SPELL_THUNDERCLAP 8078
#define QUEST_TOREK_ASSULT 6544
#define ENTRY_SPLINTERTREE_RAIDER 12859
#define ENTRY_DURIEL 12860
#define ENTRY_SILVERWING_SENTINEL 12896
@@ -52,18 +52,18 @@ EndContentData */
struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
{
npc_torekAI(Creature *c) : npc_escortAI(c) {Reset();}
uint32 Rend_Timer;
uint32 Thunderclap_Timer;
bool Completed;
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (!player)
return;
switch (i)
{
case 1:
@@ -89,23 +89,23 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
break;
}
}
void Reset()
{
Rend_Timer = 5000;
Thunderclap_Timer = 8000;
Completed = false;
}
void Aggro(Unit* who)
{
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
}
void JustDied(Unit* killer)
{
if (PlayerGUID && !Completed)
@@ -114,14 +114,14 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
((Player*)player)->FailQuest(QUEST_TOREK_ASSULT);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
if (!UpdateVictim())
return;
if (Rend_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_REND);
@@ -135,7 +135,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
}else Thunderclap_Timer -= diff;
}
};
bool QuestAccept_npc_torek(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
@@ -145,14 +145,14 @@ bool QuestAccept_npc_torek(Player* player, Creature* creature, Quest const* ques
DoScriptText(SAY_READY, creature, player);
creature->setFaction(113);
}
return true;
}
CreatureAI* GetAI_npc_torek(Creature *_Creature)
{
npc_torekAI* thisAI = new npc_torekAI(_Creature);
thisAI->AddWaypoint(0, 1782.63, -2241.11, 109.73, 5000);
thisAI->AddWaypoint(1, 1788.88, -2240.17, 111.71);
thisAI->AddWaypoint(2, 1797.49, -2238.11, 112.31);
@@ -176,7 +176,7 @@ CreatureAI* GetAI_npc_torek(Creature *_Creature)
thisAI->AddWaypoint(20, 1776.90, -2024.56, 109.83); //win
thisAI->AddWaypoint(21, 1776.87, -2028.31, 109.83,60000);//stay
thisAI->AddWaypoint(22, 1776.90, -2028.30, 109.83);
return (CreatureAI*)thisAI;
}
@@ -184,13 +184,13 @@ CreatureAI* GetAI_npc_torek(Creature *_Creature)
# npc_ruul_snowhoof
####*/
#define QUEST_FREEDOM_TO_RUUL 6482
#define QUEST_FREEDOM_TO_RUUL 6482
#define GO_CAGE 178147
struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
{
npc_ruul_snowhoofAI(Creature *c) : npc_escortAI(c) {Reset();}
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
@@ -200,33 +200,33 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
switch(i)
{
case 0: {
case 0: {
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature);
if(Cage)
Cage->SetGoState(0);
break;}
case 13:
case 13:
m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 19:
m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
break;
case 21:{
if (player && player->GetTypeId() == TYPEID_PLAYER)
((Player*)player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature);
break; }
break; }
}
}
void Aggro(Unit* who) {}
void Reset()
{
if (!IsBeingEscorted)
@@ -251,13 +251,13 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
((Player*)player)->FailQuest(QUEST_FREEDOM_TO_RUUL);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
bool QuestAccept_npc_ruul_snowhoof(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
@@ -267,13 +267,13 @@ bool QuestAccept_npc_ruul_snowhoof(Player* player, Creature* creature, Quest con
}
return true;
}
CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature)
{
npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(_Creature);
ruul_snowhoofAI->AddWaypoint(0, 3347.250089, -694.700989, 159.925995);
ruul_snowhoofAI->AddWaypoint(1, 3341.527039, -694.725891, 161.124542, 4000);
ruul_snowhoofAI->AddWaypoint(1, 3341.527039, -694.725891, 161.124542, 4000);
ruul_snowhoofAI->AddWaypoint(2, 3338.351074, -686.088138, 163.444000);
ruul_snowhoofAI->AddWaypoint(3, 3352.744873, -677.721741, 162.316269);
ruul_snowhoofAI->AddWaypoint(4, 3370.291016, -669.366943, 160.751358);
@@ -294,14 +294,14 @@ CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature)
ruul_snowhoofAI->AddWaypoint(19,3497.619385, -510.411499, 188.345322, 1000); // Ambush 2
ruul_snowhoofAI->AddWaypoint(20,3498.498047, -497.787506, 185.806274);
ruul_snowhoofAI->AddWaypoint(21,3484.218750, -489.717529, 182.389862, 4000); // End
return (CreatureAI*)ruul_snowhoofAI;
}
void AddSC_ashenvale()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_torek";
newscript->GetAI = &GetAI_npc_torek;
@@ -23,7 +23,7 @@ EndScriptData */
#include "precompiled.h"
#define SPELL_INHIBITMAGIC 32264
#define SPELL_INHIBITMAGIC 32264
#define SPELL_ATTRACTMAGIC 32265
#define N_SPELL_CARNIVOROUSBITE 36383
#define H_SPELL_CARNIVOROUSBITE 39382
@@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
Unit *focusedTarget;
void Reset()
{
{
Inhibitmagic_Timer = 0;
Attractmagic_Timer = 28000;
Carnivorousbite_Timer = 10000;
@@ -81,12 +81,12 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
{
//Inhibitmagic_Timer
if (Inhibitmagic_Timer < diff)
{
float dist;
Map *map = m_creature->GetMap();
Map::PlayerList const &PlayerList = map->GetPlayers();
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
{
float dist;
Map *map = m_creature->GetMap();
Map::PlayerList const &PlayerList = map->GetPlayers();
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
if (i_pl->isAlive() && (dist = i_pl->GetDistance(m_creature)) < 45)
{
i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
@@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature *_Creature)
{
@@ -189,7 +189,7 @@ struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI
//DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI_mob_focus_fire(Creature *_Creature)
{
@@ -53,7 +53,7 @@ EndScriptData */
struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI
{
boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c)
boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c)
{
HeroicMode = m_creature->GetMap()->IsHeroic();
@@ -258,7 +258,7 @@ CreatureAI* GetAI_mob_syth_fire(Creature *_Creature)
struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI
{
mob_syth_arcaneAI(Creature *c) : ScriptedAI(c)
mob_syth_arcaneAI(Creature *c) : ScriptedAI(c)
{
HeroicMode = m_creature->GetMap()->IsHeroic();
@@ -310,8 +310,8 @@ CreatureAI* GetAI_mob_syth_arcane(Creature *_Creature)
struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI
{
mob_syth_frostAI(Creature *c) : ScriptedAI(c)
mob_syth_frostAI(Creature *c) : ScriptedAI(c)
{
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
@@ -362,7 +362,7 @@ CreatureAI* GetAI_mob_syth_frost(Creature *_Creature)
struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI
{
mob_syth_shadowAI(Creature *c) : ScriptedAI(c)
mob_syth_shadowAI(Creature *c) : ScriptedAI(c)
{
HeroicMode = m_creature->GetMap()->IsHeroic();
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Boss_Grandmaster_Vorpil
SD%Complete: 100
SDComment:
SDComment:
SDCategory: Auchindoun, Shadow Labyrinth
EndScriptData */
@@ -51,7 +51,7 @@ EndScriptData */
float VorpilPosition[3] = {-252.8820,-264.3030,17.1};
float VoidPortalCoords[5][3] =
float VoidPortalCoords[5][3] =
{
{-283.5894, -239.5718, 12.7},
{-306.5853, -258.4539, 12.7},
@@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
bool Intro, HelpYell;
bool sumportals;
bool HeroicMode;
uint32 ShadowBoltVolley_Timer;
uint32 DrawShadows_Timer;
uint32 summonTraveler_Timer;
@@ -288,7 +288,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE);
ShadowBoltVolley_Timer = 6000;
DrawShadows_Timer = 30000;
DrawShadows_Timer = 30000;
}else DrawShadows_Timer -= diff;
if ( summonTraveler_Timer < diff)
@@ -104,21 +104,21 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
return plr;
}
}
debug_log("SD2: Instance Shadow Labyrinth: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void HandleGameObject(uint64 guid, uint32 state)
{
Player *player = GetPlayerInMap();
if (!player || !guid)
{
debug_log("SD2: Shadow Labyrinth: HandleGameObject fail");
return;
}
if (GameObject *go = GameObject::GetGameObject(*player,guid))
go->SetGoState(state);
}
@@ -166,20 +166,20 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
Encounter[4] = data;
break;
}
if (data == DONE)
{
if (type == TYPE_OVERSEER && FelOverseerCount != 0)
return;
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << Encounter[0] << " " << Encounter[1] << " "
<< Encounter[2] << " " << Encounter[3] << " " << Encounter[4];
str_data = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
@@ -209,7 +209,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
{
return str_data.c_str();
}
void Load(const char* in)
{
if (!in)
@@ -217,16 +217,16 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream loadStream(in);
loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] >> Encounter[4];
for(uint8 i = 0; i < ENCOUNTERS; ++i)
if (Encounter[i] == IN_PROGRESS)
Encounter[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
@@ -371,7 +371,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI
}
void AttackStart(Unit *who)
{
{
if (!who || PlayerGUID)
return;
@@ -447,7 +447,7 @@ struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI
we_must_die = false;
must_die_timer = 1000;
}
void UpdateAI(const uint32 diff)
{
if(we_must_die)
@@ -471,9 +471,9 @@ struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI
return;
}
}
void AttackStart(Unit *who)
{
{
return;
}
@@ -29,7 +29,7 @@ EndScriptData */
#define SPELL_MANASTORM 21097
#define SPELL_CHILL 21098
#define SPELL_FROSTBREATH 21099
#define SPELL_REFLECT 22067
#define SPELL_REFLECT 22067
#define SPELL_CLEAVE 8255 //Perhaps not right ID
#define SPELL_ENRAGE 23537
@@ -314,16 +314,16 @@ CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature)
/*######
## npc_magwin
######*/
#define SAY_START -1000111
#define SAY_AGGRO -1000112
#define SAY_PROGRESS -1000113
#define SAY_END1 -1000114
#define SAY_END2 -1000115
#define EMOTE_HUG -1000116
#define QUEST_A_CRY_FOR_HELP 9528
struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
{
npc_magwinAI(Creature *c) : npc_escortAI(c) {Reset();}
@@ -332,7 +332,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (!player)
return;
@@ -355,7 +355,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
break;
}
}
void Aggro(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature, who);
@@ -376,7 +376,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
((Player*)player)->FailQuest(QUEST_A_CRY_FOR_HELP);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
@@ -392,7 +392,7 @@ bool QuestAccept_npc_magwin(Player* player, Creature* creature, Quest const* que
}
return true;
}
CreatureAI* GetAI_npc_magwinAI(Creature *_Creature)
{
npc_magwinAI* magwinAI = new npc_magwinAI(_Creature);
@@ -495,7 +495,7 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI
uint32 Step;
uint32 SayTimer;
bool EventStarted;
void Reset()
@@ -560,14 +560,14 @@ struct TRINITY_DLL_DECL npc_geezleAI : public ScriptedAI
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllGameObjectsWithEntryInGrid go_check(GO_NAGA_FLAG);
Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(m_creature, FlagList, go_check);
TypeContainerVisitor
<Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid>, GridTypeMapContainer> go_visit(go_search);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap()));
Player* player = NULL;
if (!FlagList.empty())
{
@@ -17,7 +17,7 @@
/* ScriptData
SDName: The_Barrens
SD%Complete: 90
SDComment: Quest support: 2458, 4921, 6981, 1719, 863
SDComment: Quest support: 2458, 4921, 6981, 1719, 863
SDCategory: Barrens
EndScriptData */
@@ -218,7 +218,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
Wave = 0;
PlayerGUID = 0;
for(uint8 i = 0; i < 6; ++i)
for(uint8 i = 0; i < 6; ++i)
{
AffrayChallenger[i] = 0;
Challenger_down[i] = false;
@@ -257,13 +257,13 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
pWarrior->FailQuest(1719);
for(uint8 i = 0; i < 6; ++i)
for(uint8 i = 0; i < 6; ++i)
{
if (AffrayChallenger[i])
if (AffrayChallenger[i])
{
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
if(pCreature) {
if(pCreature->isAlive())
if(pCreature->isAlive())
{
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -275,7 +275,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
Challenger_down[i] = false;
}
if (BigWill)
if (BigWill)
{
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
if(pCreature) {
@@ -289,7 +289,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
BigWill = 0;
}
if (!EventGrate && EventInProgress)
if (!EventGrate && EventInProgress)
{
float x,y,z;
pWarrior->GetPosition(x, y, z);
@@ -298,7 +298,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
pWarrior->AreaExploredOrEventHappens(1719);
DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, m_creature);
for(uint8 i = 0; i < 6; ++i)
for(uint8 i = 0; i < 6; ++i)
{
Creature* pCreature = m_creature->SummonCreature(AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
if(!pCreature)
@@ -314,16 +314,16 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
EventGrate = true;
}
}
else if (EventInProgress)
else if (EventInProgress)
{
if (Challenger_checker < diff)
if (Challenger_checker < diff)
{
for(uint8 i = 0; i < 6; ++i)
for(uint8 i = 0; i < 6; ++i)
{
if (AffrayChallenger[i])
if (AffrayChallenger[i])
{
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
if((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i])
if((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i])
{
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
Challenger_down[i] = true;
@@ -333,13 +333,13 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
Challenger_checker = 1000;
} else Challenger_checker -= diff;
if(Wave_Timer < diff)
if(Wave_Timer < diff)
{
if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill)
if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill)
{
DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, m_creature);
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[Wave]);
if(pCreature && (pCreature->isAlive()))
if(pCreature && (pCreature->isAlive()))
{
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -363,10 +363,10 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
Wave_Timer = 1000;
}
}
else if (Wave >= 6 && EventBigWill && BigWill)
else if (Wave >= 6 && EventBigWill && BigWill)
{
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
if (!pCreature || !pCreature->isAlive())
if (!pCreature || !pCreature->isAlive())
{
DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, m_creature);
EventInProgress = false;
@@ -445,7 +445,7 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI
Completed = true;
if (player && player->GetTypeId() == TYPEID_PLAYER)
((Player*)player)->GroupEventHappens(QUEST_ESCAPE, m_creature);
break;
break;
}
}
@@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI
std::list<HostilReference *> m_threatlist = m_creature->getThreatManager().getThreatList();
if(!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue
return;
return;
std::list<Unit *> targets;
std::list<HostilReference *>::iterator itr = m_threatlist.begin();
@@ -130,7 +130,7 @@ EndScriptData */
#define SPELL_FAN_BLADES 39954 // bugged visual
// Other defines
#define CENTER_X 676.740
#define CENTER_X 676.740
#define CENTER_Y 305.297
#define CENTER_Z 353.192
@@ -249,7 +249,7 @@ struct Yells
static Yells Conversation[]=
{
{11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true},
{0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true},
{0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true},
{11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true},
{0, NULL, AKAMA, 5000, 66, true},
{11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true},
@@ -426,7 +426,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
EnterPhase(PHASE_FLIGHT);
}
else // handle flight sequence
Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
Timer[EVENT_FLIGHT_SEQUENCE] = 1000;
}
void Aggro(Unit *who)
@@ -691,7 +691,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
break;
}
if(Phase == PHASE_TRANSFORM_SEQUENCE)
Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer;
TransformCount++;
}
@@ -796,7 +796,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
case EVENT_DRAW_SOUL:
DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL);
Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000;
Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000;
break;
//PHASE_NORMAL_2
@@ -836,7 +836,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
break;
case EVENT_EYE_BLAST:
CastEyeBlast();
CastEyeBlast();
Timer[EVENT_EYE_BLAST] = 0;
break;
@@ -906,7 +906,7 @@ struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
void Aggro(Unit *who) {DoZoneInCombat();}
void ChargeCheck()
{
{
Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0, 200, false);
if(target && (!m_creature->IsWithinCombatRange(target, FLAME_CHARGE_DISTANCE)))
{
@@ -1497,7 +1497,7 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if((!UpdateVictim())
if((!UpdateVictim())
&& !Timer[EVENT_MAIEV_STEALTH])
return;
@@ -1731,7 +1731,7 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
uint32 CheckTimer;
void Reset()
{
{
if(pInstance)
IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
else
@@ -1747,7 +1747,7 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
{
if( m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0)
if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0)
&& !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
{
m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
@@ -58,7 +58,7 @@ EndScriptData */
#define AURA_OF_SUFFERING 41292
#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support
#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294
#define ESSENCE_OF_SUFFERING_PASSIVE2 41623
#define ESSENCE_OF_SUFFERING_PASSIVE2 41623
#define SPELL_FIXATE_TARGET 41294 // dummy, select target
#define SPELL_FIXATE_TAUNT 41295 // force taunt
#define SPELL_ENRAGE 41305
@@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI
struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
{
boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
EssenceGUID = 0;
@@ -282,7 +282,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
EssenceGUID = 0;
SoulCount = 0;
SoulDeathCount = 0;
Timer = 3000;
Timer = 3000;
break;
case 6:
if(SoulCount < NUMBER_ENSLAVED_SOUL)
@@ -467,7 +467,7 @@ struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI
if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL])
for(uint8 i = 0; i < 3; ++i)
if(spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST)
if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK
if(m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK
|| m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN)
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false);
}
@@ -483,9 +483,9 @@ struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI
{
switch(rand()%3)
{
case 0: DoScriptText(DESI_SAY_SLAY1, m_creature); break;
case 1: DoScriptText(DESI_SAY_SLAY2, m_creature); break;
case 2: DoScriptText(DESI_SAY_SLAY3, m_creature); break;
case 0: DoScriptText(DESI_SAY_SLAY1, m_creature); break;
case 1: DoScriptText(DESI_SAY_SLAY2, m_creature); break;
case 2: DoScriptText(DESI_SAY_SLAY3, m_creature); break;
}
}
@@ -572,8 +572,8 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI
{
switch(rand()%2)
{
case 0: DoScriptText(ANGER_SAY_SLAY1, m_creature); break;
case 1: DoScriptText(ANGER_SAY_SLAY2, m_creature); break;
case 0: DoScriptText(ANGER_SAY_SLAY1, m_creature); break;
case 1: DoScriptText(ANGER_SAY_SLAY2, m_creature); break;
}
}
@@ -592,7 +592,7 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI
if(CheckTankTimer < diff)
{
if(m_creature->getVictim()->GetGUID() != AggroTargetGUID)
{
{
DoScriptText(ANGER_SAY_BEFORE, m_creature);
DoCast(m_creature, SPELL_SELF_SEETHE, true);
AggroTargetGUID = m_creature->getVictim()->GetGUID();
@@ -236,23 +236,23 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
ScriptedInstance *pInstance;
uint32 CheckTimer;
bool Eruption;
void Reset()
{
CheckTimer = 1500;
Eruption = false;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void Aggro(Unit *who) {}
void MoveInLineOfSight(Unit *who)
{
return; // paralyze the npc
@@ -263,7 +263,7 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
if(CheckTimer < diff)
{
uint64 SupremusGUID = pInstance->GetData64(DATA_SUPREMUS);
Creature* Supremus = ((Creature*)Unit::GetUnit((*m_creature), SupremusGUID));
Creature* Supremus = ((Creature*)Unit::GetUnit((*m_creature), SupremusGUID));
if(!Eruption && !((boss_supremusAI*)Supremus->AI())->Phase1)
{
Eruption = true;
@@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
{
if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
return;
ScriptedAI::MoveInLineOfSight(who);
}
@@ -381,7 +381,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
if(AggroTargetGUID)
{
Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID);
if(pUnit)
if(pUnit)
AttackStart(pUnit);
DoZoneInCombat();
@@ -48,7 +48,7 @@ EndScriptData */
struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
{
boss_najentusAI(Creature *c) : ScriptedAI(c)
boss_najentusAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
@@ -30,33 +30,33 @@ EndScriptData */
#define SAY_GATH_DEATH -1564093
#define SAY_GATH_SPECIAL1 -1564077
#define SAY_GATH_SPECIAL2 -1564081
#define SAY_VERA_SLAY -1564086
#define SAY_VERA_COMNT -1564089
#define SAY_VERA_DEATH -1564094
#define SAY_VERA_SPECIAL1 -1564078
#define SAY_VERA_SPECIAL2 -1564082
#define SAY_MALA_SLAY -1564087
#define SAY_MALA_COMNT -1564090
#define SAY_MALA_DEATH -1564095
#define SAY_MALA_SPECIAL1 -1564079
#define SAY_MALA_SPECIAL2 -1564083
#define SAY_ZERE_SLAY -1564088
#define SAY_ZERE_COMNT -1564091
#define SAY_ZERE_DEATH -1564096
#define SAY_ZERE_SPECIAL1 -1564080
#define SAY_ZERE_SPECIAL2 -1564084
#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly."
struct CouncilYells
{
int32 entry;
uint32 timer;
};
static CouncilYells CouncilAggro[]=
{
{-1564069, 5000}, // Gathios
@@ -64,7 +64,7 @@ static CouncilYells CouncilAggro[]=
{-1564071, 5000}, // Malande
{-1564072, 0}, // Zerevor
};
// Need to get proper timers for this later
static CouncilYells CouncilEnrage[]=
{
@@ -456,7 +456,7 @@ struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_coun
void JustDied(Unit *victim)
{
DoScriptText(SAY_GATH_DEATH, m_creature);
DoScriptText(SAY_GATH_DEATH, m_creature);
}
Unit* SelectCouncilMember()
@@ -568,12 +568,12 @@ struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_ZERE_SLAY, m_creature);
DoScriptText(SAY_ZERE_SLAY, m_creature);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_ZERE_DEATH, m_creature);
DoScriptText(SAY_ZERE_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
@@ -656,12 +656,12 @@ struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_MALA_SLAY, m_creature);
DoScriptText(SAY_MALA_SLAY, m_creature);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_MALA_DEATH, m_creature);
DoScriptText(SAY_MALA_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
@@ -730,7 +730,7 @@ struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_VERA_SLAY, m_creature);
DoScriptText(SAY_VERA_SLAY, m_creature);
}
void JustDied(Unit *victim)
@@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
return plr;
}
}
debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
@@ -132,13 +132,13 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
void HandleGameObject(uint64 guid, uint32 state)
{
Player *player = GetPlayerInMap();
if (!player || !guid)
{
debug_log("TSCR: Black Temple: HandleGameObject fail");
return;
}
if (GameObject *go = GameObject::GetGameObject(*player,guid))
go->SetGoState(state);
}
@@ -224,13 +224,13 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
HandleGameObject(NajentusGate, 0);
}
Encounters[1] = data; break;
case DATA_SHADEOFAKAMAEVENT:
case DATA_SHADEOFAKAMAEVENT:
if(data == IN_PROGRESS)
{
HandleGameObject(ShadeOfAkamaDoor, 1);
}else HandleGameObject(ShadeOfAkamaDoor, 0);
Encounters[2] = data; break;
case DATA_TERONGOREFIENDEVENT:
case DATA_TERONGOREFIENDEVENT:
if(data == IN_PROGRESS)
{
HandleGameObject(TeronDoor, 1);
@@ -247,13 +247,13 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
HandleGameObject(GuurtogDoor, 0);
}
Encounters[4] = data; break;
case DATA_RELIQUARYOFSOULSEVENT:
case DATA_RELIQUARYOFSOULSEVENT:
if(data == DONE)
{
HandleGameObject(TempleDoor, 0);
}
Encounters[5] = data; break;
case DATA_MOTHERSHAHRAZEVENT:
case DATA_MOTHERSHAHRAZEVENT:
if(data == DONE)
{
HandleGameObject(MotherDoor, 0);
@@ -274,15 +274,15 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
}
if (data == DONE)
{
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << Encounters[0] << " " << Encounters[1] << " "
<< Encounters[2] << " " << Encounters[3] << " " << Encounters[4]
<< Encounters[2] << " " << Encounters[3] << " " << Encounters[4]
<< " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7]
<< " " << Encounters[8];
str_data = saveStream.str();
SaveToDB();
@@ -312,7 +312,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
{
return str_data.c_str();
}
void Load(const char* in)
{
if (!in)
@@ -320,18 +320,18 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream loadStream(in);
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2]
>> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6]
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2]
>> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6]
>> Encounters[7] >> Encounters[8];
for(uint8 i = 0; i < ENCOUNTERS; ++i)
if (Encounters[i] == IN_PROGRESS)
Encounters[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
@@ -40,10 +40,10 @@ EndContentData */
#define C_GRIMSTONE 10096
#define C_THELDREN 16059
//4 or 6 in total? 1+2+1 / 2+2+2 / 3+3. Depending on this, code should be changed.
#define MOB_AMOUNT 4
uint32 RingMob[]=
{
8925, // Dredge Worm
@@ -53,7 +53,7 @@ uint32 RingMob[]=
8933, // Cave Creeper
8932, // Borer Beetle
};
uint32 RingBoss[]=
{
9027, // Gorosh
@@ -63,7 +63,7 @@ uint32 RingBoss[]=
9031, // Anub'shiah
9032, // Hedrum
};
float RingLocations[6][3]=
{
{604.802673, -191.081985, -54.058590}, // ring
@@ -73,16 +73,16 @@ float RingLocations[6][3]=
{631.818359, -180.548126, -52.654770}, // second gate
{627.390381, -201.075974, -52.692917} // hiding in corner
};
bool AreaTrigger_at_ring_of_law(Player *player, AreaTriggerEntry *at)
{
ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData());
if (pInstance)
{
if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE)
return false;
pInstance->SetData(TYPE_RING_OF_LAW,IN_PROGRESS);
player->SummonCreature(C_GRIMSTONE,625.559,-205.618,-52.735,2.609,TEMPSUMMON_DEAD_DESPAWN,0);
@@ -90,11 +90,11 @@ bool AreaTrigger_at_ring_of_law(Player *player, AreaTriggerEntry *at)
}
return false;
}
/*######
## npc_grimstone
######*/
//TODO: implement quest part of event (different end boss)
struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
{
@@ -106,68 +106,68 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
}
ScriptedInstance* pInstance;
uint8 EventPhase;
uint32 Event_Timer;
uint8 MobSpawnId;
uint8 MobCount;
uint32 MobDeath_Timer;
uint64 RingMobGUID[4];
uint64 RingBossGUID;
bool CanWalk;
void Reset()
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
EventPhase = 0;
Event_Timer = 1000;
MobCount = 0;
MobDeath_Timer = 0;
for(uint8 i = 0; i < MOB_AMOUNT; i++)
RingMobGUID[i] = 0;
RingBossGUID = 0;
CanWalk = false;
}
void Aggro(Unit *who) { }
void DoGate(uint32 id, uint32 state)
{
if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id)))
go->SetGoState(state);
debug_log("SD2: npc_grimstone, arena gate update state.");
}
//TODO: move them to center
void SummonRingMob()
{
if (Creature* tmp = m_creature->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0))
RingMobGUID[MobCount] = tmp->GetGUID();
++MobCount;
if (MobCount == MOB_AMOUNT)
MobDeath_Timer = 2500;
}
//TODO: move them to center
void SummonRingBoss()
{
if (Creature* tmp = m_creature->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0))
RingBossGUID = tmp->GetGUID();
MobDeath_Timer = 2500;
}
void WaypointReached(uint32 i)
{
switch(i)
@@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
break;
}
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
@@ -226,7 +226,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
}
return;
}
for(uint8 i = 0; i < MOB_AMOUNT; i++)
{
Creature *mob = (Creature*)Unit::GetUnit(*m_creature,RingMobGUID[i]);
@@ -245,7 +245,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
}
}else MobDeath_Timer -= diff;
}
if (Event_Timer)
{
if (Event_Timer <= diff)
@@ -313,21 +313,21 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
++EventPhase;
}else Event_Timer -= diff;
}
if (CanWalk)
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_grimstone(Creature *_Creature)
{
npc_grimstoneAI* Grimstone_AI = new npc_grimstoneAI(_Creature);
for(uint8 i = 0; i < 6; ++i)
Grimstone_AI->AddWaypoint(i, RingLocations[i][0], RingLocations[i][1], RingLocations[i][2]);
return (CreatureAI*)Grimstone_AI;
}
/*######
@@ -404,7 +404,7 @@ CreatureAI* GetAI_mob_phalanx(Creature *_Creature)
#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!"
#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!"
#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me."
#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more."
#define GOSSIP_ITEM_KHARAN_5 "So what happened?"
@@ -523,9 +523,9 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature,
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false);
}
if (action == GOSSIP_ACTION_TRADE)
if (action == GOSSIP_ACTION_TRADE)
player->SEND_VENDORLIST( _Creature->GetGUID() );
return true;
}
@@ -591,7 +591,7 @@ struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI
}
};
CreatureAI* GetAI_npc_dughal_stormwing(Creature *_Creature)
{
{
npc_dughal_stormwingAI* dughal_stormwingAI = new npc_dughal_stormwingAI(_Creature);
dughal_stormwingAI->AddWaypoint(0, 280.42,-82.86, -77.12,0);
@@ -635,18 +635,18 @@ bool GossipSelect_npc_dughal_stormwing(Player *player, Creature *_Creature, uint
#define SAY_WINDSOR_4_3 "Good work! We're almost there, $N. This way."
#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!"
#define SAY_WINDSOR_9 "Ah, there it is!"
#define MOB_ENTRY_REGINALD_WINDSOR 9682
#define MOB_ENTRY_REGINALD_WINDSOR 9682
Player* PlayerStart;
/*
struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
{
npc_marshal_windsorAI(Creature *c) : npc_escortAI(c)
{
npc_marshal_windsorAI(Creature *c) : npc_escortAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
Reset();
}
void WaypointReached(uint32 i)
{
switch( i )
@@ -674,9 +674,9 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
m_creature->setFaction(11);
break;
case 16:
m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
break;
case 17:
case 17:
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
break;
case 18:
@@ -692,7 +692,7 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
}
}
void Aggro(Unit* who)
void Aggro(Unit* who)
{
switch(rand()%3)
{
@@ -716,9 +716,9 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
IsOnHold = false;
if(!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED )
{
m_creature->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
m_creature->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START);
}
}
if( pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED )
{
m_creature->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
@@ -740,7 +740,7 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
}
};
CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature)
{
{
npc_marshal_windsorAI* marshal_windsorAI = new npc_marshal_windsorAI(_Creature);
marshal_windsorAI->AddWaypoint(0, 316.336,-225.528, -77.7258,7000);
@@ -769,13 +769,13 @@ CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature)
bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest const *quest )
{
if( quest->GetQuestId() == 4322 )
if( quest->GetQuestId() == 4322 )
{PlayerStart = player;
if( pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED )
{
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS);
creature->setFaction(11);
creature->setFaction(11);
}
}
@@ -800,25 +800,25 @@ bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest c
#define SAY_REGINALD_WINDSOR_14_2 "Excellent work, $N. Let's find the exit. I think I know the way. Follow me!"
#define SAY_REGINALD_WINDSOR_20_1 "We made it!"
#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring."
#define MOB_ENTRY_SHILL_DINGER 9678
#define MOB_ENTRY_CREST_KILLER 9680
#define MOB_ENTRY_SHILL_DINGER 9678
#define MOB_ENTRY_CREST_KILLER 9680
int wp = 0;
/*
struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
{
npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c)
{
Reset();
npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c)
{
Reset();
}
void WaypointReached(uint32 i)
{
wp=i;
switch( i )
{
case 0:
m_creature->setFaction(11);
m_creature->setFaction(11);
m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 1:
@@ -889,7 +889,7 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
}
}
void Aggro(Unit* who)
void Aggro(Unit* who)
{
switch(rand()%3)
{
@@ -953,7 +953,7 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
}
};
CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature)
{
{
npc_marshal_reginald_windsorAI* marshal_reginald_windsorAI = new npc_marshal_reginald_windsorAI(_Creature);
marshal_reginald_windsorAI->AddWaypoint(0, 403.61,-52.71, -63.92,4000);
@@ -1004,7 +1004,7 @@ CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature)
struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI
{
npc_tobias_seecherAI(Creature *c) :npc_escortAI(c) {Reset();}
void Aggro(Unit* who) { }
void Reset() {}
@@ -1055,7 +1055,7 @@ struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI
};
CreatureAI* GetAI_npc_tobias_seecher(Creature *_Creature)
{
{
npc_tobias_seecherAI* tobias_seecherAI = new npc_tobias_seecherAI(_Creature);
tobias_seecherAI->AddWaypoint(0, 549.21, -281.07, -75.27);
@@ -1093,11 +1093,11 @@ bool GossipSelect_npc_tobias_seecher(Player *player, Creature *_Creature, uint32
/*######
## npc_rocknot
######*/
#define SAY_GOT_BEER -1230000
#define SPELL_DRUNKEN_RAGE 14872
#define QUEST_ALE 4295
float BarWpLocations[8][3]=
{
{883.294861, -188.926300, -43.703655},
@@ -1109,7 +1109,7 @@ float BarWpLocations[8][3]=
{877.035217, -187.048080, -43.703655},
{891.198000, -197.924000, -43.620400} //home
};
uint32 BarWpWait[8]=
{
0,
@@ -1121,7 +1121,7 @@ uint32 BarWpWait[8]=
0,
0
};
struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
{
npc_rocknotAI(Creature *c) : npc_escortAI(c)
@@ -1129,7 +1129,7 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
ScriptedInstance* pInstance;
uint32 BreakKeg_Timer;
@@ -1145,18 +1145,18 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
}
void Aggro(Unit *who) { }
void DoGo(uint32 id, uint32 state)
{
if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id)))
go->SetGoState(state);
}
void WaypointReached(uint32 i)
{
if (!pInstance)
return;
switch(i)
{
case 1:
@@ -1177,12 +1177,12 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
break;
}
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (BreakKeg_Timer)
{
if (BreakKeg_Timer <= diff)
@@ -1192,7 +1192,7 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
BreakDoor_Timer = 1000;
}else BreakKeg_Timer -= diff;
}
if (BreakDoor_Timer)
{
if (BreakDoor_Timer <= diff)
@@ -1203,46 +1203,46 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
if (Unit *tmp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_PHALANX)))
tmp->setFaction(14);
//for later, this event(s) has alot more to it.
//optionally, DONE can trigger bar to go hostile.
pInstance->SetData(TYPE_BAR,DONE);
BreakDoor_Timer = 0;
}else BreakDoor_Timer -= diff;
}
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_rocknot(Creature *_Creature)
{
npc_rocknotAI* Rocknot_AI = new npc_rocknotAI(_Creature);
for(uint8 i = 0; i < 8; ++i)
Rocknot_AI->AddWaypoint(i, BarWpLocations[i][0], BarWpLocations[i][1], BarWpLocations[i][2], BarWpWait[i]);
return (CreatureAI*)Rocknot_AI;
}
bool ChooseReward_npc_rocknot(Player *player, Creature *_Creature, const Quest *_Quest, uint32 item)
{
ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData());
if (!pInstance)
return true;
if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL)
return true;
if (_Quest->GetQuestId() == QUEST_ALE)
{
if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS)
pInstance->SetData(TYPE_BAR,IN_PROGRESS);
pInstance->SetData(TYPE_BAR,SPECIAL);
//keep track of amount in instance script, returns SPECIAL if amount ok and event in progress
if (pInstance->GetData(TYPE_BAR) == SPECIAL)
{
@@ -1251,7 +1251,7 @@ bool ChooseReward_npc_rocknot(Player *player, Creature *_Creature, const Quest *
((npc_escortAI*)(_Creature->AI()))->Start(false, false, false);
}
}
return true;
}
@@ -1,25 +1,25 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_BRD_H
#define DEF_BRD_H
#define TYPE_RING_OF_LAW 1
#define TYPE_VAULT 2
#define TYPE_BAR 3
#define TYPE_TOMB_OF_SEVEN 4
#define TYPE_LYCEUM 5
#define TYPE_IRON_HALL 6
#define DATA_EMPEROR 10
#define DATA_PHALANX 11
#define DATA_ARENA1 12
#define DATA_ARENA2 13
#define DATA_ARENA3 14
#define DATA_ARENA4 15
#define DATA_GO_BAR_KEG 16
#define DATA_GO_BAR_KEG_TRAP 17
#define DATA_GO_BAR_DOOR 18
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Instance_Blackrock_Depths
SD%Complete: 100
SDComment:
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
@@ -33,10 +33,10 @@ update `instance_template` set `script`='instance_blackrock_depths' where `map`=
#include "def_blackrock_depths.h"
#define ENCOUNTERS 6
#define C_EMPEROR 9019
#define C_PHALANX 9502
#define GO_ARENA1 161525
#define GO_ARENA2 161522
#define GO_ARENA3 161524
@@ -54,17 +54,17 @@ update `instance_template` set `script`='instance_blackrock_depths' where `map`=
#define GO_GOLEM_ROOM_N 170573
#define GO_GOLEM_ROOM_S 170574
#define GO_THONE_ROOM 170575
struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
{
instance_blackrock_depths(Map *map) : ScriptedInstance(map) {Initialize();};
uint32 Encounter[ENCOUNTERS];
std::string str_data;
uint64 EmperorGUID;
uint64 PhalanxGUID;
uint64 GoArena1GUID;
uint64 GoArena2GUID;
uint64 GoArena3GUID;
@@ -84,7 +84,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
uint64 GoThoneGUID;
uint32 BarAleCount;
void Initialize()
{
EmperorGUID = 0;
@@ -109,11 +109,11 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
GoThoneGUID = 0;
BarAleCount = 0;
for(uint8 i = 0; i < ENCOUNTERS; i++)
Encounter[i] = NOT_STARTED;
}
Player* GetPlayerInMap()
{
Map::PlayerList const& players = instance->GetPlayers();
@@ -126,11 +126,11 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
return plr;
}
}
debug_log("SD2: Instance Blackrock Depths: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
switch(creature->GetEntry())
@@ -163,7 +163,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
case GO_THONE_ROOM: GoThoneGUID = go->GetGUID(); break;
}
}
void SetData(uint32 type, uint32 data)
{
Player *player = GetPlayerInMap();
@@ -173,9 +173,9 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
debug_log("SD2: Instance Blackrock Depths: SetData (Type: %u Data %u) cannot find any player.", type, data);
return;
}
debug_log("SD2: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
switch(type)
{
case TYPE_RING_OF_LAW:
@@ -210,12 +210,12 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
<< Encounter[3] << " " << Encounter[4] << " " << Encounter[5];
str_data = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
uint32 GetData(uint32 type)
{
switch(type)
@@ -238,7 +238,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
}
return 0;
}
uint64 GetData64(uint32 data)
{
switch(data)
@@ -264,12 +264,12 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
}
return 0;
}
const char* Save()
{
return str_data.c_str();
}
void Load(const char* in)
{
if (!in)
@@ -277,7 +277,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream loadStream(in);
@@ -287,16 +287,16 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
for(uint8 i = 0; i < ENCOUNTERS; ++i)
if (Encounter[i] == IN_PROGRESS)
Encounter[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData_instance_blackrock_depths(Map* map)
{
return new instance_blackrock_depths(map);
}
void AddSC_instance_blackrock_depths()
{
Script *newscript;
@@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
ScriptedInstance *pInstance;
bool HeroicMode;
@@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
@@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI
if (pInstance)
{
pInstance->SetData(TYPE_RIFT,DONE);
pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed
pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed
}
}
@@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
ScriptedInstance *pInstance;
bool HeroicMode;
@@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
@@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
HeroicMode = m_creature->GetMap()->IsHeroic();
Reset();
}
ScriptedInstance *pInstance;
bool HeroicMode;
@@ -13,7 +13,7 @@
* 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: Dark_Portal
SD%Complete: 30
@@ -26,7 +26,7 @@ npc_medivh_bm
npc_time_rift
npc_saat
EndContentData */
#include "precompiled.h"
#include "def_dark_portal.h"
@@ -42,18 +42,18 @@ EndContentData */
#define SPELL_CHANNEL 31556
#define SPELL_PORTAL_RUNE 32570 //aura(portal on ground effect)
#define SPELL_BLACK_CRYSTAL 32563 //aura
#define SPELL_PORTAL_CRYSTAL 32564 //summon
#define SPELL_BANISH_PURPLE 32566 //aura
#define SPELL_BANISH_GREEN 32567 //aura
#define SPELL_CORRUPT 31326
#define SPELL_CORRUPT_AEONUS 37853
#define C_COUNCIL_ENFORCER 17023
struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
{
npc_medivh_bmAI(Creature *c) : ScriptedAI(c)
@@ -61,9 +61,9 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
ScriptedInstance *pInstance;
uint32 SpellCorrupt_Timer;
uint32 Check_Timer;
@@ -77,25 +77,25 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
if (!pInstance)
return;
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
m_creature->CastSpell(m_creature,SPELL_CHANNEL,true);
else if (m_creature->HasAura(SPELL_CHANNEL,0))
m_creature->RemoveAura(SPELL_CHANNEL,0);
m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true);
}
void MoveInLineOfSight(Unit *who)
{
if (!pInstance)
return;
if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
return;
DoScriptText(SAY_INTRO, m_creature);
pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS);
m_creature->CastSpell(m_creature,SPELL_CHANNEL,false);
@@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
uint32 entry = who->GetEntry();
if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU)
{
{
who->StopMoving();
who->CastSpell(m_creature,SPELL_CORRUPT,false);
}
@@ -119,15 +119,15 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
}
}
}
void AttackStart(Unit *who)
{
//if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
//return;
//ScriptedAI::AttackStart(who);
}
void Aggro(Unit *who) {}
void SpellHit(Unit* caster, const SpellEntry* spell)
@@ -141,15 +141,15 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
if (spell->Id == SPELL_CORRUPT)
SpellCorrupt_Timer = 3000;
}
void JustDied(Unit* Killer)
void JustDied(Unit* Killer)
{
if (Killer->GetEntry() == m_creature->GetEntry())
return;
DoScriptText(SAY_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
@@ -177,7 +177,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
uint32 pct = pInstance->GetData(DATA_SHIELD);
Check_Timer = 5000;
if (Life25 && pct <= 25)
{
DoScriptText(SAY_WEAK25, m_creature);
@@ -194,7 +194,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
DoScriptText(SAY_WEAK75, m_creature);
Life75 = false;
}
//if we reach this it means event was running but at some point reset.
if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED)
{
@@ -212,14 +212,14 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
}
}else Check_Timer -= diff;
}
//if (!UpdateVictim())
//return;
//DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_medivh_bm(Creature *_Creature)
{
return new npc_medivh_bmAI (_Creature);
@@ -229,7 +229,7 @@ struct Wave
{
uint32 PortalMob[4]; //spawns for portal waves (in order)
};
static Wave PortalWaves[]=
{
{C_ASSAS, C_WHELP, C_CHRON, 0},
@@ -244,7 +244,7 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
ScriptedInstance *pInstance;
uint32 TimeRiftWave_Timer;
@@ -252,7 +252,7 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
uint8 mPortalCount;
uint8 mWaveId;
void Reset()
void Reset()
{
TimeRiftWave_Timer = 15000;
@@ -260,15 +260,15 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
if (!pInstance)
return;
mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT);
if (mPortalCount < 6)
mWaveId = 0;
else if (mPortalCount > 12)
mWaveId = 2;
else mWaveId = 1;
}
void Aggro(Unit *who) {}
@@ -286,32 +286,32 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
float x,y,z;
m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z);
//normalize Z-level if we can, if rift is not at ground level.
z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y));
Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
if (Summon)
{
if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH)))
Summon->AddThreat(temp,0.0f);
}
}
void DoSelectSummon()
{
uint32 entry = 0;
if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3)
mRiftWaveCount = 0;
entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount];
debug_log("SD2: npc_time_rift: summoning wave creature (Wave %u, Entry %u).",mRiftWaveCount,entry);
++mRiftWaveCount;
if (entry == C_WHELP)
{
for(uint8 i = 0; i < 3; i++)
@@ -323,23 +323,23 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
{
if (!pInstance)
return;
if (TimeRiftWave_Timer < diff)
{
DoSelectSummon();
TimeRiftWave_Timer = 15000;
}else TimeRiftWave_Timer -= diff;
if (m_creature->IsNonMeleeSpellCasted(false))
return;
debug_log("SD2: npc_time_rift: not casting anylonger, i need to die.");
m_creature->setDeathState(JUST_DIED);
pInstance->SetData(TYPE_RIFT,SPECIAL);
}
};
CreatureAI* GetAI_npc_time_rift(Creature *_Creature)
{
return new npc_time_riftAI (_Creature);
@@ -350,7 +350,7 @@ CreatureAI* GetAI_npc_time_rift(Creature *_Creature)
#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon"
#define SPELL_CHRONO_BEACON 34975
#define ITEM_CHRONO_BEACON 24289
bool GossipHello_npc_saat(Player *player, Creature *_Creature)
{
if (_Creature->isQuestGiver())
@@ -368,11 +368,11 @@ bool GossipHello_npc_saat(Player *player, Creature *_Creature)
player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID());
return true;
}
player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID());
return true;
}
bool GossipSelect_npc_saat(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
if (action == GOSSIP_ACTION_INFO_DEF+1)
@@ -382,7 +382,7 @@ bool GossipSelect_npc_saat(Player *player, Creature *_Creature, uint32 sender, u
}
return true;
}
void AddSC_dark_portal()
{
Script *newscript;
@@ -391,7 +391,7 @@ void AddSC_dark_portal()
newscript->Name = "npc_medivh_bm";
newscript->GetAI = &GetAI_npc_medivh_bm;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_time_rift";
newscript->GetAI = &GetAI_npc_time_rift;
@@ -1,21 +1,21 @@
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_DARKPORTAL_H
#define DEF_DARKPORTAL_H
#define TYPE_MEDIVH 1
#define TYPE_RIFT 2
#define DATA_MEDIVH 10
#define DATA_PORTAL_COUNT 11
#define DATA_SHIELD 12
#define WORLD_STATE_BM 2541
#define WORLD_STATE_BM_SHIELD 2540
#define WORLD_STATE_BM_RIFT 2784
#define QUEST_OPENING_PORTAL 10297
#define QUEST_MASTER_TOUCH 9836
@@ -13,14 +13,14 @@
* 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_Dark_Portal
SD%Complete: 50
SDComment: Quest support: 9836, 10297. Currently in progress.
SDCategory: Caverns of Time, The Dark Portal
EndScriptData */
#include "precompiled.h"
#include "def_dark_portal.h"
@@ -28,12 +28,12 @@ EndScriptData */
#define C_MEDIVH 15608
#define C_TIME_RIFT 17838
#define SPELL_RIFT_CHANNEL 31387
#define RIFT_BOSS 1
inline uint32 RandRiftBoss() { return rand()%2 ? C_RKEEP : C_RLORD; }
float PortalLocation[4][4]=
{
{-2041.06, 7042.08, 29.99, 1.30},
@@ -41,13 +41,13 @@ float PortalLocation[4][4]=
{-1885.82, 7107.36, 22.32, 3.07},
{-1928.11, 7175.95, 22.11, 3.44}
};
struct Wave
{
uint32 PortalBoss; //protector of current portal
uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed
};
static Wave RiftWaves[]=
{
{RIFT_BOSS, 0},
@@ -57,44 +57,44 @@ static Wave RiftWaves[]=
{RIFT_BOSS, 120000},
{C_AEONUS, 0}
};
struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
{
instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();};
uint32 Encounter[ENCOUNTERS];
uint32 mRiftPortalCount;
uint32 mShieldPercent;
uint8 mRiftWaveCount;
uint8 mRiftWaveId;
uint32 NextPortal_Timer;
uint64 MedivhGUID;
uint8 CurrentRiftId;
void Initialize()
{
MedivhGUID = 0;
Clear();
}
void Clear()
{
for(uint8 i = 0; i < ENCOUNTERS; i++)
Encounter[i] = NOT_STARTED;
mRiftPortalCount = 0;
mShieldPercent = 100;
mRiftWaveCount = 0;
mRiftWaveId = 0;
CurrentRiftId = 0;
NextPortal_Timer = 0;
}
Player* GetPlayerInMap()
{
Map::PlayerList const& players = instance->GetPlayers();
@@ -107,11 +107,11 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
return plr;
}
}
debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void UpdateBMWorldState(uint32 id, uint32 state)
{
Map::PlayerList const& players = instance->GetPlayers();
@@ -125,19 +125,19 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
}
}else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
}
void InitWorldState(bool Enable = true)
{
UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0);
UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100);
UpdateBMWorldState(WORLD_STATE_BM_RIFT,0);
}
bool IsEncounterInProgress()
{
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
return true;
return false;
}
@@ -154,7 +154,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
if (creature->GetEntry() == C_MEDIVH)
MedivhGUID = creature->GetGUID();
}
//what other conditions to check?
bool CanProgressEvent()
{
@@ -180,7 +180,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
return mRiftWaveId;
}
}
void SetData(uint32 type, uint32 data)
{
Player *player = GetPlayerInMap();
@@ -190,7 +190,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
return;
}
switch(type)
{
case TYPE_MEDIVH:
@@ -231,7 +231,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh);
}
}
Encounter[0] = data;
}
break;
@@ -246,7 +246,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
break;
}
}
uint32 GetData(uint32 type)
{
switch(type)
@@ -262,7 +262,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
}
return 0;
}
uint64 GetData64(uint32 data)
{
if (data == DATA_MEDIVH)
@@ -283,17 +283,17 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y));
debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry);
Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(),
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
if (Summon)
return Summon;
debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
return NULL;
}
void DoSpawnPortal()
{
Player *player = GetPlayerInMap();
@@ -301,7 +301,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
return;
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
{
{
for(uint8 i = 0; i < 4; i++)
{
int tmp = rand()%4;
@@ -316,18 +316,18 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
TEMPSUMMON_CORPSE_DESPAWN,0);
if (temp)
{
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Unit* boss = SummonedPortalBoss(temp))
{
if (boss->GetEntry() == C_AEONUS)
{
boss->AddThreat(medivh,0.0f);
}
else
else
{
boss->AddThreat(temp,0.0f);
temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false);
@@ -336,10 +336,10 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
}
break;
}
}
}
}
}
void Update(uint32 diff)
{
if (Encounter[1] != IN_PROGRESS)
@@ -365,12 +365,12 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
}
}
};
InstanceData* GetInstanceData_instance_dark_portal(Map* map)
{
return new instance_dark_portal(map);
}
void AddSC_instance_dark_portal()
{
Script *newscript;
@@ -492,10 +492,10 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
if(target)
Doomfire->AI()->AttackStart(target);
if(rand()%2 == 0)
if(rand()%2 == 0)
DoScriptText(SAY_DOOMFIRE1, m_creature);
else
DoScriptText(SAY_DOOMFIRE2, m_creature);
DoScriptText(SAY_DOOMFIRE2, m_creature);
}
}
@@ -594,7 +594,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
}else EnrageTimer -= diff;
if(CheckDistanceTimer < diff)
{
{
// To simplify the check, we simply summon a creature in the location and then check how far we are from the creature
Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
if(Check)
@@ -667,7 +667,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
{
if(rand()%2 == 0)
DoScriptText(SAY_AIR_BURST1, m_creature);
else
else
DoScriptText(SAY_AIR_BURST2, m_creature);
@@ -208,7 +208,7 @@ bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature)
bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
if (action == GOSSIP_ACTION_INFO_DEF)
if (action == GOSSIP_ACTION_INFO_DEF)
{
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1);
@@ -34,7 +34,7 @@ float AllianceBase[4][3]=
};
// Locations for summoning waves in Horde base
float HordeBase[4][3]=
float HordeBase[4][3]=
{
{5554.399, -2581.419, 1480.820},
{5538.996, -2577.742, 1479.790},
@@ -83,7 +83,7 @@ void hyjalAI::Reset()
break;
}
//Bools
//Bools
EventBegun = false;
FirstBossDead = false;
SecondBossDead = false;
@@ -131,7 +131,7 @@ void hyjalAI::EnterEvadeMode()
if(m_creature->isAlive())
m_creature->GetMotionMaster()->MoveTargetedHome();
m_creature->SetLootRecipient(NULL);
InCombat = false;
@@ -295,12 +295,12 @@ void hyjalAI::Talk(uint32 id)
void hyjalAI::UpdateWorldState(uint32 id, uint32 state)
{
Map * map = m_creature->GetMap();
if(!map->IsDungeon())
if(!map->IsDungeon())
return;
Map::PlayerList const& players = map->GetPlayers();
if (!players.isEmpty())
{
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
@@ -46,25 +46,25 @@ struct Wave
static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base
{ // Rage Winterchill Wave 1-8
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false},
// All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron
{RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true},
{RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true},
// Anetheron Wave 1-8
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false},
{CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false},
{CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false},
{CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false},
{GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false},
// All 8 Waves are summoned, summon Anatheron
{ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}
};
@@ -147,7 +147,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance
void UpdateWorldState(uint32 id, uint32 state)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
@@ -35,12 +35,12 @@ bool GOHello_go_barrel_old_hillsbrad(Player *player, GameObject* _GO)
if (!pInstance)
return false;
if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE)
return false;
pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS);
return false;
}
@@ -30,7 +30,7 @@ EndScriptData */
#define TARETHA_ENTRY 18887
#define DRAKE_ENTRY 17848
#define QUEST_ENTRY_DIVERSION 10283
#define LODGE_QUEST_TRIGGER 20155
@@ -68,15 +68,15 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
return plr;
}
}
debug_log("SD2: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void UpdateOHWorldState()
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
@@ -124,10 +124,10 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
{
if (mBarrelCount >= 5)
return;
++mBarrelCount;
UpdateOHWorldState();
debug_log("SD2: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount);
Encounter[0] = IN_PROGRESS;
@@ -126,22 +126,22 @@ bool GossipSelect_npc_erozion(Player *player, Creature *_Creature, uint32 sender
#define SAY_TH_EPOCH_WONDER -1560031
#define SAY_TH_EPOCH_KILL_TARETHA -1560032
#define SAY_TH_EVENT_COMPLETE -1560033
#define SAY_TH_RANDOM_LOW_HP1 -1560034
#define SAY_TH_RANDOM_LOW_HP2 -1560035
#define SAY_TH_RANDOM_DIE1 -1560036
#define SAY_TH_RANDOM_DIE2 -1560037
#define SAY_TH_RANDOM_AGGRO1 -1560038
#define SAY_TH_RANDOM_AGGRO2 -1560039
#define SAY_TH_RANDOM_AGGRO3 -1560040
#define SAY_TH_RANDOM_AGGRO4 -1560041
#define SAY_TH_RANDOM_KILL1 -1560042
#define SAY_TH_RANDOM_KILL2 -1560043
#define SAY_TH_RANDOM_KILL3 -1560044
#define SAY_TH_LEAVE_COMBAT1 -1560045
#define SAY_TH_LEAVE_COMBAT2 -1560046
#define SAY_TH_LEAVE_COMBAT3 -1560047
@@ -269,7 +269,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
case 29:
DoScriptText(SAY_TH_SKARLOC_MEET, m_creature);
m_creature->SummonCreature(17862,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
//temporary,skarloc should rather be triggered to walk up to thrall
//temporary,skarloc should rather be triggered to walk up to thrall
break;
case 30:
IsOnHold = true;
@@ -364,7 +364,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
//trigger taretha to run down outside
if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
{
{
if (Creature* Taretha = ((Creature*)Unit::GetUnit(*m_creature, TarethaGUID)))
((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, PlayerGUID);
}
@@ -380,13 +380,13 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
pPlayer->KilledMonster(20156,m_creature->GetGUID());
}
}
//alot will happen here, thrall and taretha talk, erozion appear at spot to explain
m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
break;
}
}
void Reset()
{
@@ -477,7 +477,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
// Don't do a yell if he kills self (if player goes too far or at the end).
if(slayer == m_creature)
if(slayer == m_creature)
return;
switch(rand()%2)
@@ -666,7 +666,7 @@ CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature *_Creature)
bool GossipHello_npc_thrall_old_hillsbrad(Player *player, Creature *_Creature)
{
if( _Creature->isQuestGiver() )
{
{
player->PrepareQuestMenu( _Creature->GetGUID() );
player->SendPreparedQuest(_Creature->GetGUID());
}
@@ -132,7 +132,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
Creature* pAdvisor = NULL;
for( int i=0; i<3; i++ )
if(RAdvisors[i])
{
pAdvisor = ((Creature*)Unit::GetUnit((*m_creature), RAdvisors[i]));
@@ -145,8 +145,8 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
}
pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
}
}
void EventSharkkisDeath()
@@ -290,7 +290,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
break;
}
}
}
}
if( continueTriggering )
{
DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES);
@@ -338,7 +338,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
{
Pet->DealDamage( Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false );
}
SummonedPet = 0;
if( pInstance )
@@ -404,7 +404,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
DoCast(m_creature->getVictim(), SPELL_MULTISHOT);
Multishot_Timer = 20000;
}else Multishot_Timer -= diff;
//TheBeastWithin_Timer
if(TheBeastWithin_Timer < diff)
{
@@ -416,7 +416,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI
}
TheBeastWithin_Timer = 30000;
}else TheBeastWithin_Timer -= diff;
//Pet_Timer
if(Pet_Timer < diff && pet == false)
{
@@ -704,7 +704,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
break;
case 1:
pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS));
break;
break;
case 2:
pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS));
break;
@@ -713,7 +713,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
break;
}
}else pUnit = m_creature;
return pUnit;
}
};
@@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
Reset();
}
ScriptedInstance* pInstance;
@@ -124,7 +124,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
}
void SummonBeams()
{
{
Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0);
if(beamer)
{
@@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
beams[0]=beamer->GetGUID();
}
beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
if(beamer)
{
beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true);
@@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
}
}
void DeSummonBeams()
{
{
for(uint8 i=0;i<2;i++)
{
Creature* mob = (Creature*)Unit::GetUnit(*m_creature,beams[i]);
@@ -66,8 +66,8 @@ EndScriptData */
#define TAINTED_ELEMENTAL 22009
#define COILFANG_STRIDER 22056
#define COILFANG_ELITE 22055
#define TOXIC_SPOREBAT 22140
#define TOXIC_SPORES_TRIGGER 22207
#define TOXIC_SPOREBAT 22140
#define TOXIC_SPORES_TRIGGER 22207
float ElementPos[8][4] =
{
@@ -81,7 +81,7 @@ float ElementPos[8][4] =
{-58.9, -901.6, 21.5, 6}
};
float ElementWPPos[8][3] =
float ElementWPPos[8][3] =
{
{71.700752, -883.905884, 41.097168},
{45.039848, -868.022827, 41.097015},
@@ -93,7 +93,7 @@ float ElementWPPos[8][3] =
{69.945908, -964.663940, 41.097054}
};
float SporebatWPPos[8][3] =
float SporebatWPPos[8][3] =
{
{31.6,-896.3,59.1},
{9.1, -913.9, 56},
@@ -135,7 +135,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
Intro = false;
Reset();
CanAttack = false;//must be after reset()
CanAttack = false;//must be after reset()
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on creature create (no need do intro if wiped)
}
@@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
uint64 ShieldGeneratorChannel[4];
uint32 AggroTimer;
uint32 AggroTimer;
uint32 ShockBlast_Timer;
uint32 Entangle_Timer;
uint32 StaticCharge_Timer;
@@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
void Reset()
{
AggroTimer = 19000;
AggroTimer = 19000;
ShockBlast_Timer = 1+rand()%60000;
Entangle_Timer = 30000;
StaticCharge_Timer = 10000+rand()%15000;
@@ -193,12 +193,12 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
}
if(pInstance)
pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
ShieldGeneratorChannel[0] = 0;
ShieldGeneratorChannel[1] = 0;
ShieldGeneratorChannel[2] = 0;
ShieldGeneratorChannel[3] = 0;
m_creature->SetCorpseDelay(1000*60*60);
}
@@ -271,7 +271,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
if (!Intro)
{
Intro = true;
DoScriptText(SAY_INTRO, m_creature);
DoScriptText(SAY_INTRO, m_creature);
}
if (!CanAttack)
return;
@@ -327,9 +327,9 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
if(AggroTimer < diff)
{
CanAttack = true;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer=19000;
}else
}else
{
AggroTimer-=diff;
return;
@@ -596,7 +596,7 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
Unit *Vashj;
void Reset()
{
{
m_creature->SetSpeed(MOVE_WALK,0.6);//walk
m_creature->SetSpeed(MOVE_RUN,0.6);//run
move = 0;
@@ -628,17 +628,17 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
void Aggro(Unit *who) { return; }
void MoveInLineOfSight(Unit *who){return;}
void UpdateAI(const uint32 diff)
{
if(!pInstance)
return;
return;
if (!Vashj)
if (!Vashj)
{
return;
}
if(move < diff)
{
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
@@ -678,9 +678,9 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
{
//call Unsummon()
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
move = 1000;
}else move -= diff;
}else move -= diff;
}
};
@@ -777,12 +777,12 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI
void Aggro(Unit *who)
{
}
void MoveInLineOfSight(Unit *who)
{
}
void MovementInform(uint32 type, uint32 id)
@@ -807,7 +807,7 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI
m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
movement_timer = 6000;
}else movement_timer -= diff;
//toxic spores
if(bolt_timer < diff)
{
@@ -986,7 +986,7 @@ bool ItemUse_item_tainted_core(Player *player, Item* _Item, SpellCastTargets con
if(Channel)
{
//call Unsummon()
Channel->setDeathState(JUST_DIED);
Channel->setDeathState(JUST_DIED);
}
pInstance->SetData(identifier, 1);
@@ -40,7 +40,7 @@ EndScriptData */
#define SPELL_MINDBLAST 37531
// --- Spells used by Inner Demons and creature ID
#define INNER_DEMON_ID 21857
#define INNER_DEMON_ID 21857
#define AURA_DEMONIC_ALIGNMENT 37713
#define SPELL_SHADOWBOLT 39309
#define SPELL_SOUL_LINK 38007
@@ -80,13 +80,13 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
}
uint32 ShadowBolt_Timer;
uint32 Link_Timer;
uint64 victimGUID;
void Reset()
{
ShadowBolt_Timer = 10000;
ShadowBolt_Timer = 10000;
Link_Timer = 1000;
}
void JustDied(Unit *victim)
@@ -136,7 +136,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
{
DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false);
ShadowBolt_Timer = 10000;
}else ShadowBolt_Timer -= diff;
}else ShadowBolt_Timer -= diff;
DoMeleeAttackIfReady();
}
@@ -149,7 +149,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
m_creature->GetPosition(x,y,z);
pInstance = (c->GetInstanceData()) ? ((ScriptedInstance*)c->GetInstanceData()) : NULL;
Demon = 0;
for(uint8 i = 0; i < 3; i++)//clear guids
SpellBinderGUID[i] = 0;
Reset();
@@ -164,14 +164,14 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
uint32 Berserk_Timer;
uint32 InnerDemons_Timer;
uint32 BanishTimer;
bool DealDamage;
bool NeedThreatReset;
bool DemonForm;
bool IsFinalForm;
bool EnrageUsed;
float x,y,z;
uint64 InnderDemon[5];
uint32 InnderDemon_Count;
uint64 Demon;
@@ -203,7 +203,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
m_creature->SetCorpseDelay(1000*60*60);
if(pInstance)
pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED);
}
void CheckChannelers(bool DoEvade = true)
@@ -228,7 +228,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0);
if (binder)
SpellBinderGUID[i] = binder->GetGUID();
}
}
void MoveInLineOfSight(Unit *who)
@@ -272,14 +272,14 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
// channelers == 0 remove banish aura
if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH, 0))
{
{
// removing banish aura
m_creature->RemoveAurasDueToSpell(AURA_BANISH);
// Leotheras is getting immune again
// Leotheras is getting immune again
m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true);
// changing model to bloodelf
// changing model to bloodelf
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_NIGHTELF);
// and reseting equipment
@@ -292,7 +292,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
if(victim)
m_creature->getThreatManager().addThreat(victim, 1);
StartEvent();
}
}
}
else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH, 0))
{
@@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
// changing model
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, MODEL_DEMON);
// and removing weapons
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
@@ -418,7 +418,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if(newTarget)
{
DoResetThreat();
DoResetThreat();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ());
}
@@ -427,13 +427,13 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
// reseting after changing forms and after ending whirlwind
if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND, 0))
{
{
// when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding)
if(DemonForm)
InnerDemons_Timer = 30000;
else
Whirlwind_Timer = 15000;
NeedThreatReset = false;
DoResetThreat();
m_creature->GetMotionMaster()->Clear();
@@ -486,7 +486,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
m_creature->StopMoving();
if(ChaosBlast_Timer < diff)
{
// will cast only when in range of spell
// will cast only when in range of spell
if(m_creature->GetDistance(m_creature->getVictim()) < 30)
{
//m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, true);
@@ -499,13 +499,13 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
if(InnerDemons_Timer < diff)
{
std::list<HostilReference *>& ThreatList = m_creature->getThreatManager().getThreatList();
std::vector<Unit *> TargetList;
std::vector<Unit *> TargetList;
for(std::list<HostilReference *>::iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
{
Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
if(tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5)
TargetList.push_back( tempTarget );
}
}
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_INSIDIOUS_WHISPER);
for(std::vector<Unit *>::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr)
{
@@ -516,7 +516,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
{
((ScriptedAI *)demon->AI())->AttackStart( (*itr) );
((mob_inner_demonAI *)demon->AI())->victimGUID = (*itr)->GetGUID();
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
@@ -631,15 +631,15 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI
//ChaosBlast_Timer
if(m_creature->GetDistance(m_creature->getVictim()) < 30)
m_creature->StopMoving();
if(ChaosBlast_Timer < diff)
{
// will cast only when in range od spell
// will cast only when in range od spell
if(m_creature->GetDistance(m_creature->getVictim()) < 30)
{
//m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true);
int damage = 100;
m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
ChaosBlast_Timer = 3000;
}
}else ChaosBlast_Timer -= diff;
@@ -705,12 +705,12 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI
DoCast(leotheras, BANISH_BEAM);
}
}
}
}
void UpdateAI(const uint32 diff)
{
if(pInstance)
{
{
if(!leotherasGUID)
leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS);
@@ -722,7 +722,7 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI
AttackStart(victim);
}
}
if(!UpdateVictim())
{
CastChanneling();
@@ -757,7 +757,7 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI
for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i)
if(i_pl->m_currentSpells[i])
isCasting = true;
if(isCasting)
{
DoCast(i_pl, SPELL_EARTHSHOCK);
@@ -52,7 +52,7 @@ EndScriptData */
#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one.
#define SPELL_HAMSTRING 26211
float AddPos[9][3] =
float AddPos[9][3] =
{
{2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z
{12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z
@@ -64,7 +64,7 @@ float AddPos[9][3] =
{14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z
{42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z
};
enum RotationType
{
NOROTATE = 0,
@@ -74,7 +74,7 @@ enum RotationType
struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c)
boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
@@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
}*/
}
void MoveInLineOfSight(Unit *who)
{
if (!who || m_creature->getVictim())
@@ -143,18 +143,18 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
{
float attackRadius = m_creature->GetAttackDistance(who);
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who))
AttackStart(who);
AttackStart(who);
}
}
void Aggro(Unit *who)
{
if(pInstance)
pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
if (!who || m_creature->getVictim())
if (!who || m_creature->getVictim())
return;
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
{
float attackRadius = m_creature->GetAttackDistance(who);
@@ -170,7 +170,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
}
void Rotate(const uint32 diff)
{
{
bool Spout = false;
switch (RotType)
{
@@ -211,7 +211,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
if(SpoutAnimTimer<diff)
{
DoCast(m_creature,SPELL_SPOUT_ANIM,true);
SpoutAnimTimer = 1000;
SpoutAnimTimer = 1000;
}else SpoutAnimTimer-=diff;
Map *map = m_creature->GetMap();
@@ -241,7 +241,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
RotTimer=20000;
if(victim)
SpoutAngle = m_creature->GetAngle(victim);
SpoutAngle = m_creature->GetAngle(victim);
m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true);
//DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim
}
@@ -260,7 +260,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER, 0))
@@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
Submerged = true;
}else PhaseTimer-=diff;
}
if(!Submerged && RotType == NOROTATE)//is not spouting and not submerged
{
if(SpoutTimer < diff)
@@ -318,13 +318,13 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
if(WaterboltTimer < diff)
{
Unit* target = SelectUnit(SELECT_TARGET_NEAREST,0,14,true);
Unit* target = SelectUnit(SELECT_TARGET_NEAREST,0,14,true);
if(!target)
{
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if(target)
DoCast(target,SPELL_WATERBOLT);
}
DoCast(target,SPELL_WATERBOLT);
}
WaterboltTimer = 3000;
}else WaterboltTimer -= diff;
@@ -352,10 +352,10 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
PhaseTimer = 120000;
return;
}else PhaseTimer-=diff;
if(!m_creature->isInCombat())
m_creature->SetInCombatState(false);
if(!Spawned)
{
m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -397,7 +397,7 @@ CreatureAI* GetAI_mob_coilfang_guardian(Creature *_Creature)
struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
{
mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c)
mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c)
{
Reset();
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT);
@@ -407,7 +407,7 @@ struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
uint32 MultiShotTimer;
uint32 ShootBowTimer;
void Reset()
{
MultiShotTimer = 10000;
@@ -417,7 +417,7 @@ struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
void Aggro(Unit *who)
{
}
void MoveInLineOfSight(Unit *who)
@@ -434,7 +434,7 @@ struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
{
if(MultiShotTimer < diff)
{
if(m_creature->getVictim())
if(m_creature->getVictim())
DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true);
MultiShotTimer = 10000;
@@ -444,7 +444,7 @@ struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
if(ShootBowTimer < diff)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
int bp0 = 1100;
if(target)
m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true);
@@ -141,7 +141,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS);
}
void KilledUnit(Unit *victim)
@@ -161,9 +161,9 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
if (pInstance)
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
}
void Aggro(Unit *who)
{
void Aggro(Unit *who)
{
PlayerList = &((InstanceMap*)m_creature->GetMap())->GetPlayers();
Playercount = PlayerList->getSize();
StartEvent();
@@ -212,7 +212,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
DoScriptText(EMOTE_EARTHQUAKE, m_creature);
Earthquake = false;
Earthquake_Timer = 40000+rand()%5000;
}
}
}else Earthquake_Timer -= diff;
//TidalWave_Timer
@@ -234,7 +234,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
set<int>::iterator itr;
for(uint8 i = 0; i < 4; i++)
{
counter = 0;
counter = 0;
do{target = SelectUnit(SELECT_TARGET_RANDOM, 1, 50, true); //target players only
if(counter < Playercount)
break;
@@ -44,7 +44,7 @@ bool GOHello_go_bridge_console(Player *player, GameObject* go)
if (pInstance)
pInstance->SetData(DATA_CONTROL_CONSOLE, DONE);
return true;
}
@@ -42,13 +42,13 @@ bool GOHello_go_main_chambers_access_panel(Player *player, GameObject* _GO)
if (!pInstance)
return false;
if (_GO->GetEntry() == ACCESS_PANEL_HYDRO && pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE)
pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL);
if (_GO->GetEntry() == ACCESS_PANEL_MEK && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE)
pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL);
return true;
}
@@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
return plr;
}
}
debug_log("SD2: Instance Steamvault: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
@@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance
void SetData(uint32 type, uint32 data)
{
Player *player = GetPlayerInMap();
if (!player)
{
debug_log("SD2: Instance Steamvault: SetData (Type: %u Data %u) cannot find any player.", type, data);
@@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM1);
State=CANNON_BLAST_INITIATED;
break;
case CANNON_BLAST_INITIATED:
case CANNON_BLAST_INITIATED:
PiratesDelay_Timer = PIRATES_DELAY_TIMER;
if(CannonBlast_Timer<diff)
{
@@ -83,9 +83,9 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
LeverStucked();
IronCladDoor->Yell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0);
DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM2);
State = PIRATES_ATTACK;
State = PIRATES_ATTACK;
}else
CannonBlast_Timer-=diff;
CannonBlast_Timer-=diff;
break;
case PIRATES_ATTACK:
if(PiratesDelay_Timer<diff)
@@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
DefiasPirate2 = IronCladDoor->SummonCreature(657,IronCladDoor->GetPositionX() + 3,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
DefiasCompanion = IronCladDoor->SummonCreature(3450,IronCladDoor->GetPositionX() + 2,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
}
void MoveCreaturesInside()
{
MoveCreatureInside(DefiasPirate1);
@@ -155,14 +155,14 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
{
if (type == EVENT_STATE)
{
if (DefiasCannon && IronCladDoor)
State=data;
if (DefiasCannon && IronCladDoor)
State=data;
}
}
uint32 GetData(uint32 type)
{
if (type == EVENT_STATE)
if (type == EVENT_STATE)
return State;
return 0;
}
@@ -221,7 +221,7 @@ void AddSC_instance_deadmines()
newscript->Name = "instance_deadmines";
newscript->GetInstanceData = &GetInstanceData_instance_deadmines;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_defias_gunpowder";
newscript->pItemUse = &ItemUse_item_defias_gunpowder;
@@ -97,13 +97,13 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI
}
void JustDied(Unit* killer)
{
{
m_creature->setFaction(35);
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
npc_escortAI::UpdateAI(diff);
}
};
@@ -543,7 +543,7 @@ bool GOHello_go_second_trial(Player *player, GameObject* _GO)
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
//cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(_GO->GetMap(), _GO));
cell_lock->Visit(cell_lock, grid_unit_searcher, *(_GO->GetMap()));
if ( event_controller )
((master_kelerun_bloodmournAI*)event_controller->AI())->StartEvent();
@@ -583,7 +583,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
Summons.Summon(summoned);
}
void SummonedCreatureDespawn(Creature* summoned)
void SummonedCreatureDespawn(Creature* summoned)
{
Summons.Despawn(summoned);
++KillCount;
@@ -670,7 +670,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
bool Completed;
bool Progress;
uint64 PlayerGUID;
void Reset()
{
EndTimer = 0;
@@ -681,7 +681,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
}
void Aggro(Unit* who){}
void MoveInLineOfSight(Unit* who)
{
if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) && !Progress)
@@ -704,7 +704,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
{
summoned->AI()->AttackStart(m_creature);
}
void JustDied(Unit* killer)
{
if (PlayerGUID && !Completed)
@@ -714,7 +714,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
((Player*)player)->FailQuest(QUEST_POWERING_OUR_DEFENSES);
}
}
void UpdateAI(const uint32 diff)
{
if(EndTimer < diff && Progress)
@@ -743,7 +743,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
}else WaveTimer -= diff;
}
};
CreatureAI* GetAI_npc_infused_crystalAI(Creature *_Creature)
{
return new npc_infused_crystalAI (_Creature);
@@ -134,7 +134,7 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO)
/*######
## npc_ranger_lilatha
######*/
#define SAY_START -1000140
#define SAY_PROGRESS1 -1000141
#define SAY_PROGRESS2 -1000142
@@ -142,7 +142,7 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO)
#define SAY_END1 -1000144
#define SAY_END2 -1000145
#define SAY_CAPTAIN_ANSWER -1000146
#define QUEST_ESCAPE_FROM_THE_CATACOMBS 9212
#define GO_CAGE 181152
#define NPC_CAPTAIN_HELIOS 16220
@@ -152,7 +152,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {Reset();}
std::list<GameObject*> CageList;
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
@@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
switch(i)
{
case 0:
case 0:
{
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
GameObject* Cage = FindGameObject(GO_CAGE, 20, m_creature);
@@ -173,10 +173,10 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
}
case 5:
DoScriptText(SAY_PROGRESS1, m_creature, player);
case 11:
case 11:
DoScriptText(SAY_PROGRESS2, m_creature, player);
m_creature->SetOrientation(4.762841);
break;
break;
case 18:
{
DoScriptText(SAY_PROGRESS3, m_creature, player);
@@ -185,30 +185,30 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
Summ1->Attack(m_creature, true);
Summ2->Attack(player, true);
m_creature->AI()->AttackStart(Summ1);
break;
break;
}
case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 30:
if (player && player->GetTypeId() == TYPEID_PLAYER)
((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature);
((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature);
break;
case 32:
case 32:
m_creature->SetOrientation(2.978281);
DoScriptText(SAY_END1, m_creature, player);
break;
break;
case 33:
m_creature->SetOrientation(5.858011);
DoScriptText(SAY_END2, m_creature, player);
Unit* CaptainHelios = FindCreature(NPC_CAPTAIN_HELIOS, 50, m_creature);
if(CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player);
break;
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player);
break;
}
}
void Aggro(Unit* who) {}
void Reset()
{
if (!IsBeingEscorted)
@@ -218,7 +218,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
if(Cage)
Cage->SetGoState(1);
}
void JustDied(Unit* killer)
{
if (PlayerGUID)
@@ -228,13 +228,13 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
bool QuestAccept_npc_ranger_lilatha(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
@@ -244,11 +244,11 @@ bool QuestAccept_npc_ranger_lilatha(Player* player, Creature* creature, Quest co
}
return true;
}
CreatureAI* GetAI_npc_ranger_lilathaAI(Creature *_Creature)
{
npc_ranger_lilathaAI* ranger_lilathaAI = new npc_ranger_lilathaAI(_Creature);
ranger_lilathaAI->AddWaypoint(0, 7545.07, -7359.87, 162.354, 4000); // Say0
ranger_lilathaAI->AddWaypoint(1, 7550.048340, -7362.237793, 162.235657);
ranger_lilathaAI->AddWaypoint(2, 7566.976074, -7364.315430, 161.738770);
@@ -283,11 +283,11 @@ CreatureAI* GetAI_npc_ranger_lilathaAI(Creature *_Creature)
ranger_lilathaAI->AddWaypoint(31, 7603.768066, -7667.000488, 153.997726);
ranger_lilathaAI->AddWaypoint(32, 7603.768066, -7667.000488, 153.997726, 4000); // Say4 & Set orientation
ranger_lilathaAI->AddWaypoint(33, 7603.768066, -7667.000488, 153.997726, 8000); // Say5 & Set orientation
ranger_lilathaAI->AddWaypoint(34, 7603.768066, -7667.000488, 153.997726);
ranger_lilathaAI->AddWaypoint(34, 7603.768066, -7667.000488, 153.997726);
return (CreatureAI*)ranger_lilathaAI;
}
void AddSC_ghostlands()
{
Script *newscript;
@@ -51,7 +51,7 @@ EndScriptData */
struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
{
boss_gruulAI(Creature *c) : ScriptedAI(c)
boss_gruulAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
@@ -122,7 +122,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
void KilledUnit()
{
switch(rand()%3)
{
{
case 0: DoScriptText(SAY_SLAY1, m_creature); break;
case 1: DoScriptText(SAY_SLAY2, m_creature); break;
case 2: DoScriptText(SAY_SLAY3, m_creature); break;
@@ -132,7 +132,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
{
pInstance->SetData(DATA_MAULGAREVENT, DONE);
@@ -178,7 +178,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
GetCouncil();
DoScriptText(SAY_AGGRO, m_creature);
pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID());
pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS);
@@ -237,9 +237,9 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
Phase2 = true;
DoScriptText(SAY_ENRAGE, m_creature);
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
}
if(Phase2)
@@ -251,7 +251,7 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (target)
AttackStart(target);
DoCast(target, SPELL_BERSERKER_C);
DoCast(target, SPELL_BERSERKER_C);
Charging_Timer = 20000;
}else Charging_Timer -= diff;
@@ -416,7 +416,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
}
}
void UpdateAI(const uint32 diff)
{
//Only if not incombat check if the event is started
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Boss_Kelidan_The_Breaker
SD%Complete: 100
SDComment:
SDComment:
SDCategory: Hellfire Citadel, Blood Furnace
EndScriptData */
@@ -182,7 +182,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DIE, m_creature);
if(pInstance)
if(pInstance)
pInstance->SetData(DATA_KELIDANEVENT, DONE);
}
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Instance_Blood_Furnace
SD%Complete: 85
SDComment:
SDComment:
SDCategory: Hellfire Citadel, Blood Furnace
EndScriptData */
@@ -63,21 +63,21 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
return plr;
}
}
debug_log("TSCR: Instance Blood Furnace: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void HandleGameObject(uint64 guid, uint32 state)
{
Player *player = GetPlayerInMap();
if (!player || !guid)
{
debug_log("TSCR: Blood Furnace: HandleGameObject fail");
return;
}
if (GameObject *go = GameObject::GetGameObject(*player,guid))
go->SetGoState(state);
}
@@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI
Turn_Timer = 0;
UnsummonCheck = 5000;
}
void Aggro(Unit* who) {}
void JustSummoned(Creature *summoned)
@@ -309,7 +309,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI
void SummonAdds()
{
if(!summoned)
{
{
Creature* Vazruden = m_creature->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000);
VazrudenGUID = Vazruden->GetGUID();
Creature* Nazan = m_creature->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000);
@@ -406,7 +406,7 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI
break;
}
}
};
};
struct TRINITY_DLL_DECL mob_hellfire_sentryAI : public ScriptedAI
{
@@ -55,7 +55,7 @@ static Yell RandomTaunt[]=
#define MOB_CHANNELLER 17256
#define MOB_ABYSSAL 17454
#define SPELL_BLASTNOVA 30616
#define SPELL_BLASTNOVA 30616
#define SPELL_CLEAVE 30619
#define SPELL_QUAKE_TRIGGER 30657 // must be cast with 30561 as the proc spell
#define SPELL_QUAKE_KNOCKBACK 30571
@@ -125,7 +125,7 @@ struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true);
FireBlast_Timer = 5000;
Despawn_Timer = 10000;
Despawn_Timer = 10000;
}
}
@@ -169,9 +169,9 @@ struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI
struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
{
boss_magtheridonAI(Creature *c) : ScriptedAI(c)
boss_magtheridonAI(Creature *c) : ScriptedAI(c)
{
pInstance =(ScriptedInstance*)m_creature->GetInstanceData();
pInstance =(ScriptedInstance*)m_creature->GetInstanceData();
m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
@@ -208,7 +208,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
bool NeedCheckCube;
void Reset()
{
{
if(pInstance)
{
pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED);
@@ -379,10 +379,10 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
Blaze_Timer = 20000 + rand()%20000;
}else Blaze_Timer -= diff;
if(!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3
if(!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3
&& !m_creature->IsNonMeleeSpellCasted(false) // blast nova
&& !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
{
{
Phase3 = true;
DoScriptText(SAY_CHAMBER_DESTROY, m_creature);
m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true);
@@ -471,8 +471,8 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
return;
if(ShadowBoltVolley_Timer < diff)
{
DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY);
@@ -497,7 +497,7 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI
{
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
m_creature->CastSpell(target, SPELL_BURNING_ABYSSAL, true);
Infernal_Timer = 30000 + rand()%10000;
Infernal_Timer = 30000 + rand()%10000;
}else Infernal_Timer -= diff;
DoMeleeAttackIfReady();
@@ -58,7 +58,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
MagtheridonGUID = 0;
ChannelerGUID.clear();
DoorGUID = 0;
ColumnGUID.clear();
ColumnGUID.clear();
CageTimer = 0;
RespawnTimer = 0;
@@ -1,4 +1,4 @@
/* Copyright (C) 2008 - 2009 BroodWyrm */
/* Copyright (C) 2008 - 2009 BroodWyrm */
#include "precompiled.h"
#define SPELL_BLADE_DANCE 30739
@@ -51,11 +51,11 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
uint32 Assassins_Timer;
uint32 summoned;
uint32 summoned;
bool InBlade;
uint32 target_num;
void Reset()
{
removeAdds();
@@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
if(id != 1)
return;
if(target_num > 0) // to prevent loops
{
Wait_Timer = 1;
@@ -160,7 +160,7 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
Unit* temp = Unit::GetUnit((*m_creature),*itr);
if(temp && temp->isAlive())
{
(*temp).GetMotionMaster()->Clear(true);
(*temp).GetMotionMaster()->Clear(true);
m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
((Creature*)temp)->RemoveCorpse();
}
@@ -181,10 +181,10 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
}
void SpawnAssassin()
{
m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000);
}
void UpdateAI(const uint32 diff)
@@ -276,10 +276,10 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
tempy = m_creature->GetPositionY();
if ( tempx > 255 || tempx < 205)
{
EnterEvadeMode();
EnterEvadeMode();
}
resetcheck_timer = 5000;
}else resetcheck_timer -= diff;
}else resetcheck_timer -= diff;
}
};
@@ -72,10 +72,10 @@ struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI
{
DoScriptText(SAY_INTRO, m_creature);
}
void Aggro(Unit *who)
{
switch(rand()%2)
switch(rand()%2)
{
case 0: DoScriptText(SAY_AGGRO1, m_creature); break;
case 1: DoScriptText(SAY_AGGRO2, m_creature); break;
@@ -97,7 +97,7 @@ struct TRINITY_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI
case 2: DoScriptText(SAY_KILL3, m_creature); break;
}
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
@@ -240,15 +240,15 @@ bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature,
{
switch(action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
case GOSSIP_ACTION_INFO_DEF + 1:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player,33659,true); //TaxiPath 584 (Gateways Murket and Shaadraz)
break;
break;
case GOSSIP_ACTION_INFO_DEF + 2:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player,33825,true); //TaxiPath 587 (Aerial Assault Flight (Horde))
break;
case GOSSIP_ACTION_INFO_DEF + 3:
case GOSSIP_ACTION_INFO_DEF + 3:
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player,34578,true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge)
break;
@@ -259,7 +259,7 @@ bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature,
/*######
## npc_wounded_blood_elf
######*/
#define SAY_ELF_START -1000117
#define SAY_ELF_SUMMON1 -1000118
#define SAY_ELF_RESTING -1000119
@@ -268,7 +268,7 @@ bool GossipSelect_npc_wing_commander_brack(Player *player, Creature *_Creature,
#define SAY_ELF_AGGRO -1000122
#define QUEST_ROAD_TO_FALCON_WATCH 9375
struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
{
npc_wounded_blood_elfAI(Creature *c) : npc_escortAI(c) {Reset();}
@@ -279,7 +279,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
if (!player)
return;
switch (i)
{
case 0:
@@ -311,7 +311,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
break;
}
}
void Reset()
{
if (!IsBeingEscorted)
@@ -323,7 +323,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
if (IsBeingEscorted)
DoScriptText(SAY_ELF_AGGRO, m_creature);
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
@@ -342,13 +342,13 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
((Player*)player)->FailQuest(QUEST_ROAD_TO_FALCON_WATCH);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_wounded_blood_elf(Creature *_Creature)
{
npc_wounded_blood_elfAI* welfAI = new npc_wounded_blood_elfAI(_Creature);
@@ -381,10 +381,10 @@ CreatureAI* GetAI_npc_wounded_blood_elf(Creature *_Creature)
welfAI->AddWaypoint(25, -656.74, 4147.72, 64.11);
welfAI->AddWaypoint(26, -652.22, 4137.50, 64.58);
welfAI->AddWaypoint(27, -649.99, 4136.38, 64.63, 30000);// Award Quest Credit
return (CreatureAI*)welfAI;
}
bool QuestAccept_npc_wounded_blood_elf(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
@@ -393,7 +393,7 @@ bool QuestAccept_npc_wounded_blood_elf(Player* player, Creature* creature, Quest
// Change faction so mobs attack
creature->setFaction(775);
}
return true;
}
@@ -432,7 +432,7 @@ void AddSC_hellfire_peninsula()
newscript->pGossipHello = &GossipHello_npc_wing_commander_brack;
newscript->pGossipSelect = &GossipSelect_npc_wing_commander_brack;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_wounded_blood_elf";
newscript->GetAI = &GetAI_npc_wounded_blood_elf;
@@ -170,7 +170,7 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
if(PlayerGUID)
{
Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
if(plr && ((Player*)plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
if(plr && ((Player*)plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
((Player*)plr)->KilledMonster(25086, m_creature->GetGUID());
}
DoCast(m_creature, ENRAGE);
@@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
switch(rand()%2)
{
case 0: DoScriptText(SAY_KILL1, m_creature); break;
case 1: DoScriptText(SAY_KILL2, m_creature); break;
case 1: DoScriptText(SAY_KILL2, m_creature); break;
}
}
@@ -65,7 +65,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
void KilledUnit(Unit* Victim)
{
if(rand()%2)
if(rand()%2)
return;
switch(rand()%3)
@@ -117,19 +117,19 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
if (Holyfire_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_HOLYFIRE);
Holyfire_Timer = 8000 + rand()%17000; //Anywhere from 8 to 25 seconds, good luck having several of those in a row!
Holyfire_Timer = 8000 + rand()%17000; //Anywhere from 8 to 25 seconds, good luck having several of those in a row!
}else Holyfire_Timer -= diff;
if (Holywrath_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_HOLYWRATH);
Holywrath_Timer = 20000+(rand()%10000); //20-30 secs sounds nice
}else Holywrath_Timer -= diff;
DoMeleeAttackIfReady();
@@ -203,7 +203,7 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
{
DoScriptText(SAY_DEATH, m_creature);
if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight))
pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
void UpdateAI(const uint32 diff)
@@ -293,8 +293,8 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
void SpellHit(Unit *source, const SpellEntry *spell)
{
if(spell->Mechanic == MECHANIC_DISARM)
DoScriptText(SAY_DISARMED, m_creature);
if(spell->Mechanic == MECHANIC_DISARM)
DoScriptText(SAY_DISARMED, m_creature);
}
};
@@ -147,7 +147,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0))
@@ -326,7 +326,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
//Gouge highest aggro, and attack second highest
if (Gouge_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_GOUGE);
DoCast(m_creature->getVictim(), SPELL_GOUGE);
Gouge_Timer = 40000;
}else Gouge_Timer -= diff;
@@ -23,7 +23,7 @@ EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
//phase 1
#define SPELL_BELLOWING_ROAR 39427
#define SPELL_CHARRED_EARTH 30129
@@ -44,7 +44,7 @@ EndScriptData */
#define YELL_LAND_PHASE_2 "Insects! Let me show you my strength up close!"
#define EMOTE_BREATH "takes a deep breath."
float IntroWay[8][3] =
float IntroWay[8][3] =
{
{-11053.37,-1794.48,149},
{-11141.07,-1841.40,125},
@@ -52,11 +52,11 @@ float IntroWay[8][3] =
{-11189.20,-1931.25,125},
{-11153.76,-1948.93,125},
{-11128.73,-1929.75,125},
{-11140 , -1915 ,122},
{-11140 , -1915 ,122},
{-11163 , -1903 ,91.473}
};
//float IntroWay[5][3] =
//float IntroWay[5][3] =
//{
// {-11000.00, -1765.75, 140.40},
// {-11000.00, -1765.75, 171.00},
@@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Intro = true;
Reset();
Reset();
}
ScriptedInstance* pInstance;
@@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
Phase =1;
FlyCount = 0;
MovePhase = 0;
m_creature->SetSpeed(MOVE_RUN, 2.0f);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -139,7 +139,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
m_creature->GetMotionMaster()->MoveTargetedHome();
}
}
void HandleTerraceDoors(bool open)
{
if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1)))
@@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
{
if(pInstance)
pInstance->SetData(DATA_NIGHTBANE_EVENT, DONE);
HandleTerraceDoors(true);
}
@@ -179,7 +179,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
ScriptedAI::AttackStart(who);
}
}
void MovementInform(uint32 type, uint32 id)
{
if(type != POINT_MOTION_TYPE)
@@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
return;
}
WaitTimer = 1;
}
@@ -201,7 +201,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
{
if(id == 0)
{
DoTextEmote(EMOTE_BREATH, NULL, true);
DoTextEmote(EMOTE_BREATH, NULL, true);
Flying = false;
Phase = 2;
return;
@@ -240,7 +240,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
(*m_creature).GetMotionMaster()->Clear(false);
(*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
Flying = true;
FlyTimer = 45000+rand()%15000; //timer wrong between 45 and 60 seconds
@@ -259,37 +259,37 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
if(Intro)
{
if(MovePhase >= 7)
{
{
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
}
else
else
{
m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
++MovePhase;
}
}
if(Flying)
{
if(MovePhase >= 7)
{
{
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
}
else
else
{
m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
++MovePhase;
}
}
WaitTimer = 0;
}else WaitTimer -= diff;
if(!UpdateVictim())
if(!UpdateVictim())
return;
if(Flying)
@@ -318,7 +318,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
if (CharredEarthTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target,SPELL_CHARRED_EARTH);
CharredEarthTimer = 20000; //timer
}else CharredEarthTimer -= diff;
@@ -326,7 +326,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
if (TailSweepTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (!m_creature->HasInArc( M_PI, target))
if (!m_creature->HasInArc( M_PI, target))
DoCast(target,SPELL_TAIL_SWEEP);
TailSweepTimer = 15000;//timer
}else TailSweepTimer -= diff;
@@ -335,24 +335,24 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target,SPELL_SEARING_CINDERS);
SearingCindersTimer = 10000; //timer
SearingCindersTimer = 10000; //timer
}else SearingCindersTimer -= diff;
uint32 Prozent;
Prozent = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
if (Prozent < 75 && FlyCount == 0) // first take off 75%
TakeOff();
if (Prozent < 75 && FlyCount == 0) // first take off 75%
TakeOff();
if (Prozent < 50 && FlyCount == 1) // secound take off 50%
TakeOff();
if (Prozent < 25 && FlyCount == 2) // third take off 25%
if (Prozent < 50 && FlyCount == 1) // secound take off 50%
TakeOff();
if (Prozent < 25 && FlyCount == 2) // third take off 25%
TakeOff();
DoMeleeAttackIfReady();
}
//Phase 2 "FLYING FIGHT"
if (Phase == 2)
{
@@ -368,7 +368,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
{
DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES);
DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES);
RainBones = true;
SmokingBlastTimer = 20000;
}else RainofBonesTimer -= diff;
@@ -394,20 +394,20 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
{
if (Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0))
DoCast(target,SPELL_FIREBALL_BARRAGE);
FireballBarrageTimer = 20000; //Timer
FireballBarrageTimer = 20000; //Timer
}else FireballBarrageTimer -= diff;
if (FlyTimer < diff) //landing
{
if(rand()%2 == 0)
DoYell(YELL_LAND_PHASE_1, LANG_UNIVERSAL, NULL);
else
DoYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL);
else
DoYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL);
(*m_creature).GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
Flying = true;
Flying = true;
}else FlyTimer -= diff;
}
}
@@ -156,7 +156,7 @@ struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
{
boss_malchezaarAI(Creature *c) : ScriptedAI(c)
boss_malchezaarAI(Creature *c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
@@ -251,7 +251,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
}
if (FrostCooldown)
{
{
if (FrostCooldown >= diff)
FrostCooldown -= diff;
else FrostCooldown = 0;
@@ -32,20 +32,20 @@ EndScriptData */
#define SAY_DOROTHEE_SUMMON -1532026
#define SAY_DOROTHEE_TITO_DEATH -1532027
#define SAY_DOROTHEE_AGGRO -1532028
#define SAY_ROAR_AGGRO -1532029
#define SAY_ROAR_DEATH -1532030
#define SAY_ROAR_SLAY -1532031
#define SAY_STRAWMAN_AGGRO -1532032
#define SAY_STRAWMAN_DEATH -1532033
#define SAY_STRAWMAN_SLAY -1532034
#define SAY_TINHEAD_AGGRO -1532035
#define SAY_TINHEAD_DEATH -1532036
#define SAY_TINHEAD_SLAY -1532037
#define EMOTE_RUST -1532038
#define SAY_CRONE_AGGRO -1532039
#define SAY_CRONE_AGGRO2 -1532040
#define SAY_CRONE_DEATH -1532041
@@ -855,7 +855,7 @@ CreatureAI* GetAI_boss_bigbadwolf(Creature* _Creature)
#define SAY_JULIANNE_DEATH02 -1532049
#define SAY_JULIANNE_RESURRECT -1532050
#define SAY_JULIANNE_SLAY -1532051
#define SAY_ROMULO_AGGRO -1532052
#define SAY_ROMULO_DEATH -1532053
#define SAY_ROMULO_ENTER -1532054
@@ -46,7 +46,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
uint32 Encounters[ENCOUNTERS];
uint32 OperaEvent;
uint32 OperaEvent;
uint32 OzDeathCount;
uint64 CurtainGUID;
@@ -96,7 +96,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < ENCOUNTERS; ++i)
if (Encounters[i] == IN_PROGRESS)
if (Encounters[i] == IN_PROGRESS)
return true;
return false;
@@ -192,7 +192,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
void SetData64(uint32 identifier, uint64 data)
{
switch(identifier)
{
{
case DATA_IMAGE_OF_MEDIVH: ImageGUID = data;
}
}
@@ -484,7 +484,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, m_creature->GetGUID());
(*m_creature).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
Step = 0;
}else
}else
{
m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
@@ -591,11 +591,11 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
}
return 50000;
case 15:
arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return 5000;
default : return 9999999;
}
default : return 9999999;
}
}
void UpdateAI(const uint32 diff)
@@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
}
}
void KilledUnit(Unit* victim)
{
if(victim && (victim->GetTypeId() == TYPEID_PLAYER))
@@ -177,7 +177,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
void SetThreatList(Creature* SummonedUnit)
{
if(!SummonedUnit)
if(!SummonedUnit)
return;
std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
@@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
Map::PlayerList const &PlayerList = map->GetPlayers();
Map::PlayerList::const_iterator i;
for (i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
{
if(Player* i_pl = i->getSource())
{
i_pl->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
@@ -419,10 +419,10 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
GravityLapseTimer = 30000;
GravityLapsePhase = 4;
for(uint8 i = 0; i < 3; ++i)
{
{
Creature* Orb = m_creature->SummonCreature(CREATURE_ARCANE_SPHERE,KaelLocations[3+i][0],KaelLocations[3+i][1],LOCATION_Z,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000);
if(Orb)
{
if(Orb)
{
SetThreatList(Orb);
Unit *target = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,i);
if(target)
@@ -564,7 +564,7 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
DoCast(m_creature->getVictim(), SPELL_PHOENIX_FIREBALL);
}
BurnTimer = 2000;
}else BurnTimer -= diff;
}else BurnTimer -= diff;
//DoMeleeAttackIfReady();
}
@@ -586,7 +586,7 @@ struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
if(HatchTimer < diff)
{
Creature *bird = DoSpawnCreature(CREATURE_PHOENIX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 60000);
@@ -695,7 +695,7 @@ bool GOHello_go_movie_orb(Player *player, GameObject* _GO)
WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4);
data << (uint32)164;
player->GetSession()->SendPacket(&data);
if (player->GetQuestStatus(11490) == QUEST_STATUS_INCOMPLETE)
{
Unit *qUnit = player->SummonCreature(25042,player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()-10,0,TEMPSUMMON_CORPSE_DESPAWN,0);
@@ -99,7 +99,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Adds.clear();
//SummonAdds();
Reset();
Reset();
Heroic = c->GetMap()->IsHeroic();
}
@@ -192,7 +192,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
{
pAdd->AI()->EnterEvadeMode();
pAdd->GetMotionMaster()->MovePoint(0,LackeyLocations[i][0], LackeyLocations[i][1], POS_Z);
}
}
if(!pAdd || (pAdd && pAdd->isDead()))
{
if(pAdd)
@@ -751,7 +751,7 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI
if(!UpdateVictim() )
return;
boss_priestess_guestAI::UpdateAI(diff);
boss_priestess_guestAI::UpdateAI(diff);
if(Polymorph_Timer < diff)
{
@@ -816,7 +816,7 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI
x = rand()%2 ? x+10+rand()%10 : x-10-rand()%10;
y = rand()%2 ? y+10+rand()%10 : y-10-rand()%10;
m_creature->Relocate(x,y,z);
m_creature->SendMonsterMove(x, y, m_creature->GetPositionZ(), 0,0,0);
m_creature->SendMonsterMove(x, y, m_creature->GetPositionZ(), 0,0,0);
}
Blink_Timer = 8000;
}else Blink_Timer -= diff;
@@ -1206,7 +1206,7 @@ struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI
boss_priestess_guestAI::UpdateAI(diff);
if(Goblin_Dragon_Gun_Timer < diff)
{
{
if (m_creature->GetDistance(m_creature->getVictim()) <= 5)
{
Goblin_Dragon_Gun_Timer = 10000;
@@ -113,7 +113,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
pInstance->SetData(DATA_SELIN_EVENT, DONE);
else pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
}else error_log(ERROR_INST_DATA);
DrainLifeTimer = 3000 + rand()%4000;
DrainManaTimer = DrainLifeTimer + 5000;
FelExplosionTimer = 2100;
@@ -106,29 +106,29 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
{
switch(identifier)
{
case DATA_SELIN_EVENT:
Encounters[0] = data;
case DATA_SELIN_EVENT:
Encounters[0] = data;
if(data==DONE)
{
DoorState[0] = 0;
SaveToDB();
}
break;
case DATA_VEXALLUS_EVENT:
Encounters[1] = data;
case DATA_VEXALLUS_EVENT:
Encounters[1] = data;
if(data==DONE)
{
DoorState[1] = 0;
SaveToDB();
}
break;
case DATA_DELRISSA_EVENT:
Encounters[2] = data;
case DATA_DELRISSA_EVENT:
Encounters[2] = data;
if(data==DONE)
{
DoorState[2] = 0;
SaveToDB();
}
}
break;
case DATA_KAELTHAS_EVENT: Encounters[3] = data; break;
@@ -177,20 +177,20 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
{
switch(go->GetEntry())
{
case 187896:
VexallusDoorGUID = go->GetGUID();
case 187896:
VexallusDoorGUID = go->GetGUID();
go->SetGoState(DoorState[1]);
break;
//SunwellRaid Gate 02
case 187979:
SelinDoorGUID = go->GetGUID();
case 187979:
SelinDoorGUID = go->GetGUID();
go->SetGoState(DoorState[0]);
break;
//Assembly Chamber Door
case 188065: SelinEncounterDoorGUID = go->GetGUID(); break;
case 187770:
DelrissaDoorGUID = go->GetGUID();
go->SetGoState(DoorState[2]);
case 187770:
DelrissaDoorGUID = go->GetGUID();
go->SetGoState(DoorState[2]);
break;
case 188165: KaelStatue[0] = go->GetGUID(); break;
case 188166: KaelStatue[1] = go->GetGUID(); break;
@@ -66,7 +66,7 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if(pInstance)
pInstance->SetData(DATA_GOLEMAGG_DEATH, 0);
}
@@ -28,18 +28,18 @@ EndScriptData */
#define SAY_SLAY -1409005
#define SAY_SPECIAL -1409006
#define SAY_DEFEAT -1409007
#define SAY_SUMMON_MAJ -1409008
#define SAY_ARRIVAL1_RAG -1409009
#define SAY_ARRIVAL2_MAJ -1409010
#define SAY_ARRIVAL3_RAG -1409011
#define SAY_ARRIVAL5_RAG -1409012
#define SPAWN_RAG_X 838.51
#define SPAWN_RAG_Y -829.84
#define SPAWN_RAG_Z -232.00
#define SPAWN_RAG_O 1.70
#define SPELL_MAGIC_REFLECTION 20619
#define SPELL_DAMAGE_REFLECTION 21075
@@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance
return false;
};
void OnObjectCreate(GameObject *go)
{
switch(go->GetEntry())
@@ -188,7 +188,7 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance
}
return 0;
}
}
uint32 GetData(uint32 type)
{
@@ -201,7 +201,7 @@ bool GossipSelect_npc_silva_filnaveth(Player *player, Creature *_Creature, uint3
## npc_clintar_spirit
######*/
float Clintar_spirit_WP[41][5] =
float Clintar_spirit_WP[41][5] =
{
//pos_x pos_y pos_z orien waitTime
{7465.28, -3115.46, 439.327, 0.83, 4000},
@@ -524,7 +524,7 @@ CreatureAI* GetAI_npc_clintar_spirit(Creature *_Creature)
# npc_clintar_dreamwalker
####*/
#define CLINTAR_SPIRIT 22916
#define CLINTAR_SPIRIT 22916
bool QuestAccept_npc_clintar_dreamwalker(Player *player, Creature *creature, Quest const *quest )
{
@@ -538,7 +538,7 @@ bool QuestAccept_npc_clintar_dreamwalker(Player *player, Creature *creature, Que
}
/*####
#
#
####*/
void AddSC_moonglade()
@@ -97,7 +97,7 @@ struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI
void MovementInform(uint32 type, uint32 id)
{
if(type == POINT_MOTION_TYPE)
{
{
switch(STATE)
{
case 1:
@@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI
{
switch(STATE)
{
case 2:
case 2:
STATE = 3; wait = 7000;
m_creature->UpdateEntry(23622,HORDE);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
@@ -68,11 +68,11 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
{
DoScriptText(SAY_GREET, m_creature);
HasTaunted = true;
}
ScriptedAI::MoveInLineOfSight(who);
}
@@ -13,20 +13,20 @@
* 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_Four_Horsemen
SD%Complete: 75
SDComment: Lady Blaumeux, Thane Korthazz, Sir Zeliek, Baron Rivendare
SDCategory: Naxxramas
EndScriptData */
#include "precompiled.h"
//all horsemen
#define SPELL_SHIELDWALL 29061
#define SPELL_BESERK 26662
//lady blaumeux
#define SAY_BLAU_AGGRO -1533044
#define SAY_BLAU_TAUNT1 -1533045
@@ -35,25 +35,25 @@
#define SAY_BLAU_SPECIAL -1533048
#define SAY_BLAU_SLAY -1533049
#define SAY_BLAU_DEATH -1533050
#define SPELL_MARK_OF_BLAUMEUX 28833
#define SPELL_UNYILDING_PAIN 57381
#define SPELL_VOIDZONE 28863
#define H_SPELL_VOIDZONE 57463
#define SPELL_SHADOW_BOLT 57374
#define H_SPELL_SHADOW_BOLT 57464
#define C_SPIRIT_OF_BLAUMEUX 16776
struct TRINITY_DLL_DECL boss_lady_blaumeuxAI : public ScriptedAI
{
boss_lady_blaumeuxAI(Creature *c) : ScriptedAI(c) {Reset();}
uint32 Mark_Timer;
uint32 VoidZone_Timer;
bool ShieldWall1;
bool ShieldWall2;
void Reset()
{
Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
@@ -61,34 +61,34 @@
ShieldWall1 = true;
ShieldWall2 = true;
}
void Aggro(Unit *who)
{
DoScriptText(SAY_BLAU_AGGRO, m_creature);
}
void KilledUnit(Unit* Victim)
{
DoScriptText(SAY_BLAU_SLAY, m_creature);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_BLAU_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
// Mark of Blaumeux
if (Mark_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MARK_OF_BLAUMEUX);
Mark_Timer = 12000;
}else Mark_Timer -= diff;
// Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
{
@@ -106,23 +106,23 @@
ShieldWall2 = false;
}
}
// Void Zone
if (VoidZone_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_VOIDZONE);
VoidZone_Timer = 12000;
}else VoidZone_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_lady_blaumeux(Creature *_Creature)
{
return new boss_lady_blaumeuxAI (_Creature);
}
//baron rivendare
#define SAY_RIVE_AGGRO1 -1533065
#define SAY_RIVE_AGGRO2 -1533066
@@ -134,21 +134,21 @@
#define SAY_RIVE_TAUNT2 -1533072
#define SAY_RIVE_TAUNT3 -1533073
#define SAY_RIVE_DEATH -1533074
#define SPELL_MARK_OF_RIVENDARE 28834
#define SPELL_UNHOLY_SHADOW 28882
#define H_SPELL_UNHOLY_SHADOW 57369
#define C_SPIRIT_OF_RIVENDARE 0 //creature entry not known yet
struct TRINITY_DLL_DECL boss_rivendare_naxxAI : public ScriptedAI
{
boss_rivendare_naxxAI(Creature *c) : ScriptedAI(c) {Reset();}
void Reset()
{
}
void Aggro(Unit *who)
{
switch(rand()%3)
@@ -158,7 +158,7 @@
case 2: DoScriptText(SAY_RIVE_AGGRO3, m_creature); break;
}
}
void KilledUnit(Unit* Victim)
{
switch(rand()%2)
@@ -167,26 +167,26 @@
case 1: DoScriptText(SAY_RIVE_SLAY2, m_creature); break;
}
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_RIVE_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_rivendare_naxx(Creature *_Creature)
{
return new boss_rivendare_naxxAI (_Creature);
}
//thane korthazz
#define SAY_KORT_AGGRO -1533051
#define SAY_KORT_TAUNT1 -1533052
@@ -195,21 +195,21 @@
#define SAY_KORT_SPECIAL -1533055
#define SAY_KORT_SLAY -1533056
#define SAY_KORT_DEATH -1533057
#define SPELL_MARK_OF_KORTHAZZ 28832
#define SPELL_METEOR 26558 // m_creature->getVictim() auto-area spell but with a core problem
#define C_SPIRIT_OF_KORTHAZZ 16778
struct TRINITY_DLL_DECL boss_thane_korthazzAI : public ScriptedAI
{
boss_thane_korthazzAI(Creature *c) : ScriptedAI(c) {Reset();}
uint32 Mark_Timer;
uint32 Meteor_Timer;
bool ShieldWall1;
bool ShieldWall2;
void Reset()
{
Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
@@ -217,34 +217,34 @@
ShieldWall1 = true;
ShieldWall2 = true;
}
void Aggro(Unit *who)
{
DoScriptText(SAY_KORT_AGGRO, m_creature);
}
void KilledUnit(Unit* Victim)
{
DoScriptText(SAY_KORT_SLAY, m_creature);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_KORT_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
// Mark of Korthazz
if (Mark_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MARK_OF_KORTHAZZ);
Mark_Timer = 12000;
}else Mark_Timer -= diff;
// Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
{
@@ -262,23 +262,23 @@
ShieldWall2 = false;
}
}
// Meteor
if (Meteor_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_METEOR);
Meteor_Timer = 20000; // wrong
}else Meteor_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_thane_korthazz(Creature *_Creature)
{
return new boss_thane_korthazzAI (_Creature);
}
//sir zeliek
#define SAY_ZELI_AGGRO -1533058
#define SAY_ZELI_TAUNT1 -1533059
@@ -287,24 +287,24 @@
#define SAY_ZELI_SPECIAL -1533062
#define SAY_ZELI_SLAY -1533063
#define SAY_ZELI_DEATH -1533064
#define SPELL_MARK_OF_ZELIEK 28835
#define SPELL_HOLY_WRATH 28883
#define H_SPELL_HOLY_WRATH 57466
#define SPELL_HOLY_BOLT 57376
#define H_SPELL_HOLY_BOLT 57465
#define C_SPIRIT_OF_ZELIREK 16777
struct TRINITY_DLL_DECL boss_sir_zeliekAI : public ScriptedAI
{
boss_sir_zeliekAI(Creature *c) : ScriptedAI(c) {Reset();}
uint32 Mark_Timer;
uint32 HolyWrath_Timer;
bool ShieldWall1;
bool ShieldWall2;
void Reset()
{
Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
@@ -312,35 +312,35 @@
ShieldWall1 = true;
ShieldWall2 = true;
}
void Aggro(Unit *who)
{
DoScriptText(SAY_ZELI_AGGRO, m_creature);
}
void KilledUnit(Unit* Victim)
{
DoScriptText(SAY_ZELI_SLAY, m_creature);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_ZELI_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
// Mark of Zeliek
if (Mark_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MARK_OF_ZELIEK);
Mark_Timer = 12000;
}else Mark_Timer -= diff;
// Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
{
@@ -358,42 +358,42 @@
ShieldWall2 = false;
}
}
// Holy Wrath
if (HolyWrath_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_HOLY_WRATH);
HolyWrath_Timer = 12000;
}else HolyWrath_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_sir_zeliek(Creature *_Creature)
{
return new boss_sir_zeliekAI (_Creature);
}
void AddSC_boss_four_horsemen()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_lady_blaumeux";
newscript->GetAI = &GetAI_boss_lady_blaumeux;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_rivendare_naxx";
newscript->GetAI = &GetAI_boss_rivendare_naxx;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_thane_korthazz";
newscript->GetAI = &GetAI_boss_thane_korthazz;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_sir_zeliek";
newscript->GetAI = &GetAI_boss_sir_zeliek;
@@ -29,34 +29,34 @@ EndScriptData */
#define SAY_SAPP_DIALOG3 -1533086
#define SAY_SAPP_DIALOG4_LICH -1533087
#define SAY_SAPP_DIALOG5 -1533088
//when cat dies
#define SAY_CAT_DIED -1533089
//when each of the 4 wing bosses dies
#define SAY_TAUNT1 -1533090
#define SAY_TAUNT2 -1533091
#define SAY_TAUNT3 -1533092
#define SAY_TAUNT4 -1533093
#define SAY_SUMMON_MINIONS -1533105 //start of phase 1
#define SAY_AGGRO1 -1533094 //start of phase 2
#define SAY_AGGRO2 -1533095
#define SAY_AGGRO3 -1533096
#define SAY_SLAY1 -1533097
#define SAY_SLAY2 -1533098
#define SAY_DEATH -1533099
#define SAY_CHAIN1 -1533100
#define SAY_CHAIN2 -1533101
#define SAY_FROST_BLAST -1533102
#define SAY_REQUEST_AID -1533103 //start of phase 3
#define SAY_ANSWER_REQUEST -1533104 //lich king answer
#define SAY_SPECIAL1_MANA_DET -1533106
#define SAY_SPECIAL3_MANA_DET -1533107
#define SAY_SPECIAL2_DISPELL -1533108
@@ -36,7 +36,7 @@ EndScriptData */
#define H_SPELL_CRIPPLE 54814
#define SPELL_CURSE_PLAGUEBRINGER 28213
#define H_SPELL_CURSE_PLAGUEBRINGER 54835
#define SOUND_DEATH 8848
#define SOUND_DEATH 8848
#define C_PLAGUED_WARRIOR 16984
@@ -27,19 +27,19 @@ EndScriptData */
#define SAY_STAL_AGGRO -1533023
#define SAY_STAL_SLAY -1533024
#define SAY_STAL_DEATH -1533025
#define SPELL_POWERSURGE 28134
//Feugen
#define SAY_FEUG_AGGRO -1533026
#define SAY_FEUG_SLAY -1533027
#define SAY_FEUG_DEATH -1533028
#define SPELL_MANABURN 28135
//both
#define SPELL_WARSTOMP 28125
//Thaddus
#define SAY_GREET -1533029
#define SAY_AGGRO1 -1533030
@@ -336,7 +336,7 @@ bool GOHello_go_manaforge_control_console(Player *player, GameObject* _GO)
/*######
## npc_commander_dawnforge
######*/
// The Speech of Dawnforge, Ardonis & Pathaleon
#define SAY_COMMANDER_DAWNFORGE_1 -1000128
#define SAY_ARCANIST_ARDONIS_1 -1000129
@@ -352,7 +352,7 @@ bool GOHello_go_manaforge_control_console(Player *player, GameObject* _GO)
#define QUEST_INFO_GATHERING 10198
#define SPELL_SUNFURY_DISGUISE 34603
// Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image
int CreatureEntry[3][1] =
{
@@ -375,10 +375,10 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
uint32 PhaseSubphase;
uint32 Phase_Timer;
bool isEvent;
float angle_dawnforge;
float angle_ardonis;
void Reset()
{
playerGUID = 0;
@@ -390,7 +390,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
Phase_Timer = 4000;
isEvent = false;
}
void Aggro(Unit *who) { }
//Select any creature in a grid
@@ -402,33 +402,33 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*m_creature, entry, true, range);
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_creature, pCreature, creature_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, creature_searcher,*(m_creature->GetMap()));
return pCreature;
}
void JustSummoned(Creature *summoned)
{
pathaleonGUID = summoned->GetGUID();
}
// Emote Ardonis and Pathaleon
void Turn_to_Pathaleons_Image()
{
Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID);
Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID);
Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID);
if (!ardonis || !pathaleon || !player)
return;
//Calculate the angle to Pathaleon
angle_dawnforge = m_creature->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
@@ -444,7 +444,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
ardonis->SetStandState(UNIT_STAND_STATE_KNEEL);
}
//Set them back to each other
void Turn_to_eachother()
{
@@ -454,10 +454,10 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
if (!player)
return;
angle_dawnforge = m_creature->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
angle_ardonis = ardonis->GetAngle(m_creature->GetPositionX(), m_creature->GetPositionY());
//Turn Dawnforge and update
m_creature->SetOrientation(angle_dawnforge);
m_creature->SendUpdateToPlayer(player);
@@ -470,7 +470,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
ardonis->SetStandState(UNIT_STAND_STATE_STAND);
}
}
bool CanStartEvent(Player *player)
{
if (!isEvent)
@@ -481,13 +481,13 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
ardonisGUID = ardonis->GetGUID();
playerGUID = player->GetGUID();
isEvent = true;
Turn_to_eachother();
return true;
}
debug_log("TSCR: npc_commander_dawnforge event already in progress, need to wait.");
return false;
}
@@ -504,23 +504,23 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
Phase_Timer -= diff;
return;
}
Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID);
Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID);
Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID);
if (!ardonis || !player)
{
Reset();
return;
}
if (Phase > 4 && !pathaleon)
{
Reset();
return;
}
//Phase 1 Dawnforge say
switch (Phase)
{
@@ -623,12 +623,12 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
}
}
};
CreatureAI* GetAI_npc_commander_dawnforge(Creature* _Creature)
{
return new npc_commander_dawnforgeAI(_Creature);
}
Creature* SearchDawnforge(Player *source, uint32 entry, float range)
{
Creature* pCreature = NULL;
@@ -637,31 +637,31 @@ Creature* SearchDawnforge(Player *source, uint32 entry, float range)
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*source, entry, true, range);
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(source, pCreature, creature_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, creature_searcher,*(source->GetMap()));
return pCreature;
}
bool AreaTrigger_at_commander_dawnforge(Player *player, AreaTriggerEntry *at)
{
//if player lost aura or not have at all, we should not try start event.
if (!player->HasAura(SPELL_SUNFURY_DISGUISE,0))
return false;
if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
{
Creature* Dawnforge = SearchDawnforge(player, CreatureEntry[1][0], 30.0f);
if (!Dawnforge)
return false;
if (((npc_commander_dawnforgeAI*)Dawnforge->AI())->CanStartEvent(player))
return true;
}
@@ -719,7 +719,7 @@ bool GossipHello_npc_professor_dabiri(Player *player, Creature *_Creature)
if(player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778, 1))
player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
return true;
@@ -852,7 +852,7 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI
{
Unit* target = Unit::GetUnit((*m_creature), PlayerGUID);
if(target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent)
if(target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent)
&& ((Player*)target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE)
{
DoScriptText(EMOTE_WEAK, m_creature);
@@ -919,15 +919,15 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI
((Player*)player)->FailQuest(Q_ALMABTRIEB);
}
}
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (!player)
return;
switch(i)
switch(i)
{
case 3: //first spawn
m_creature->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -1031,7 +1031,7 @@ void AddSC_netherstorm()
newscript->Name = "npc_commander_dawnforge";
newscript->GetAI = &GetAI_npc_commander_dawnforge;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "at_commander_dawnforge";
newscript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge;
@@ -25,7 +25,7 @@ EndScriptData */
#define SAY_AGGRO -1249000
#define SAY_KILL -1249001
#define SAY_PHASE_2_TRANS -1249002
#define SAY_PHASE_2_TRANS -1249002
#define SAY_PHASE_3_TRANS -1249003
#define EMOTE_BREATH -1249004
@@ -263,7 +263,7 @@ struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI
if(random<4){
m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);}
}
void SummonWhelps(uint32 Phase)
{
if(Phase == 2)

Some files were not shown because too many files have changed in this diff Show More