* Huge merge with original branch

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

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