*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)

*Fix a possible crash in Spell::DoAllEffectOnTarget

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-17 15:35:07 -07:00
parent f21f47005d
commit 26b5e033ff
2257 changed files with 750 additions and 103852 deletions
+2 -111
View File
@@ -1,7 +1,6 @@
/* Copyright (C) 2006 - 2008 TrinityScript <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#include "precompiled.h"
#include "Config/Config.h"
#include "Database/DatabaseEnv.h"
@@ -10,39 +9,30 @@
#include "ProgressBar.h"
#include "../system/ScriptLoader.h"
#include "../system/system.h"
#define _FULLVERSION "TrinityScript"
#ifndef _TRINITY_SCRIPT_CONFIG
# define _TRINITY_SCRIPT_CONFIG "trinitycore.conf"
#endif _TRINITY_SCRIPT_CONFIG
int num_sc_scripts;
Script *m_scripts[MAX_SCRIPTS];
Config TScriptConfig;
void FillSpellSummary();
void LoadOverridenSQLData();
void LoadOverridenDBCData();
void LoadDatabase()
{
//Get db string from file
std::string dbstring = TScriptConfig.GetStringDefault("WorldDatabaseInfo", "");
if (dbstring.empty())
{
error_log("TSCR: Missing world database info from configuration file. Load database aborted.");
return;
}
//Initialize connection to DB
if (!dbstring.empty() && TScriptDB.Initialize(dbstring.c_str()))
{
outstring_log("TSCR: TrinityScript database initialized successfully.");
outstring_log("");
pSystemMgr.LoadVersion();
pSystemMgr.LoadScriptTexts();
pSystemMgr.LoadScriptTextsCustom();
@@ -53,29 +43,22 @@ void LoadDatabase()
error_log("TSCR: Unable to connect to database at %s. Load database aborted.", dbstring.c_str());
return;
}
TScriptDB.HaltDelayThread();
}
struct TSpellSummary {
uint8 Targets; // set of enum SelectTarget
uint8 Effects; // set of enum SelectEffect
}extern *SpellSummary;
TRINITY_DLL_EXPORT
void ScriptsFree()
{
// Free Spell Summary
delete []SpellSummary;
// Free resources before library unload
for(uint16 i =0;i<MAX_SCRIPTS;++i)
for (uint16 i =0; i<MAX_SCRIPTS; ++i)
delete m_scripts[i];
num_sc_scripts = 0;
}
TRINITY_DLL_EXPORT
void ScriptsInit(char const* cfg_file = "trinitycore.conf")
{
@@ -88,41 +71,30 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
outstring_log(" |___/ |_| ");
outstring_log("Trinity Script initializing %s", _FULLVERSION);
outstring_log("");
//Get configuration file
if (!TScriptConfig.SetSource(cfg_file))
error_log("TSCR: Unable to open configuration file. Database will be unaccessible. Configuration values will use default.");
else
outstring_log("TSCR: Using configuration file %s",cfg_file);
outstring_log("");
//Load database (must be called after SD2Config.SetSource).
LoadDatabase();
outstring_log("TSCR: Loading C++ scripts");
barGoLink bar(1);
bar.step();
outstring_log("");
for(uint16 i =0;i<MAX_SCRIPTS;++i)
for (uint16 i =0; i<MAX_SCRIPTS; ++i)
m_scripts[i]=NULL;
FillSpellSummary();
AddScripts();
outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
outstring_log(">> Load Overriden SQL Data.");
LoadOverridenSQLData();
outstring_log(">> Load Overriden DBC Data.");
LoadOverridenDBCData();
}
//*********************************
//*** Functions used globally ***
void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
{
if (!pSource)
@@ -130,23 +102,18 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
error_log("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry);
return;
}
if (iTextEntry >= 0)
{
error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
return;
}
const StringTextData* pData = pSystemMgr.GetTextData(iTextEntry);
if (!pData)
{
error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
return;
}
debug_log("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote);
if(pData->uiSoundId)
{
if(GetSoundEntriesStore()->LookupEntry(pData->uiSoundId))
@@ -156,7 +123,6 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
else
error_log("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
}
if(pData->uiEmote)
{
if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER)
@@ -164,7 +130,6 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
else
error_log("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId());
}
switch(pData->uiType)
{
case CHAT_TYPE_SAY:
@@ -198,10 +163,8 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
break;
}
}
//*********************************
//*** Functions used internally ***
void Script::RegisterSelf()
{
int id = GetScriptId(Name.c_str());
@@ -216,10 +179,8 @@ void Script::RegisterSelf()
delete this;
}
}
//********************************
//*** Functions to be Exported ***
TRINITY_DLL_EXPORT
void OnLogin(Player *pPlayer)
{
@@ -227,7 +188,6 @@ void OnLogin(Player *pPlayer)
if (!tmpscript || !tmpscript->pOnLogin) return;
tmpscript->pOnLogin(pPlayer);
}
TRINITY_DLL_EXPORT
void OnLogout(Player *pPlayer)
{
@@ -235,7 +195,6 @@ void OnLogout(Player *pPlayer)
if (!tmpscript || !tmpscript->pOnLogout) return;
tmpscript->pOnLogout(pPlayer);
}
TRINITY_DLL_EXPORT
void OnPVPKill(Player *killer, Player *killed)
{
@@ -243,7 +202,6 @@ void OnPVPKill(Player *killer, Player *killed)
if (!tmpscript || !tmpscript->pOnPVPKill) return;
tmpscript->pOnPVPKill(killer, killed);
}
TRINITY_DLL_EXPORT
bool OnSpellCast (Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, uint32 i, SpellEntry const *spell)
{
@@ -251,7 +209,6 @@ bool OnSpellCast (Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, u
if (!tmpscript || !tmpscript->pOnSpellCast) return true;
return tmpscript->pOnSpellCast(pUnitTarget,pItemTarget,pGoTarget,i,spell);
}
TRINITY_DLL_EXPORT
uint32 OnGetXP(Player *pPlayer, uint32 amount)
{
@@ -259,7 +216,6 @@ uint32 OnGetXP(Player *pPlayer, uint32 amount)
if (!tmpscript || !tmpscript->pOnGetXP) return amount;
return tmpscript->pOnGetXP(pPlayer,amount);
}
TRINITY_DLL_EXPORT
uint32 OnGetMoney(Player *pPlayer, int32 amount)
{
@@ -267,7 +223,6 @@ uint32 OnGetMoney(Player *pPlayer, int32 amount)
if (!tmpscript || !tmpscript->pOnGetMoney) return amount;
return tmpscript->pOnGetMoney(pPlayer,amount);
}
TRINITY_DLL_EXPORT
bool OnPlayerChat(Player *pPlayer, const char *text)
{
@@ -275,7 +230,6 @@ bool OnPlayerChat(Player *pPlayer, const char *text)
if (!tmpscript || !tmpscript->pOnPlayerChat) return true;
return tmpscript->pOnPlayerChat(pPlayer,text);
}
TRINITY_DLL_EXPORT
void OnServerStartup()
{
@@ -283,7 +237,6 @@ void OnServerStartup()
if (!tmpscript || !tmpscript->pOnServerStartup) return;
tmpscript->pOnServerStartup();
}
TRINITY_DLL_EXPORT
void OnServerShutdown()
{
@@ -291,7 +244,6 @@ void OnServerShutdown()
if (!tmpscript || !tmpscript->pOnServerShutdown) return;
tmpscript->pOnServerShutdown();
}
TRINITY_DLL_EXPORT
void OnAreaChange(Player *pPlayer, AreaTableEntry const *pArea)
{
@@ -299,7 +251,6 @@ void OnAreaChange(Player *pPlayer, AreaTableEntry const *pArea)
if (!tmpscript || !tmpscript->pOnAreaChange) return;
tmpscript->pOnAreaChange(pPlayer, pArea);
}
TRINITY_DLL_EXPORT
bool OnItemClick (Player *pPlayer, Item *pItem)
{
@@ -307,7 +258,6 @@ bool OnItemClick (Player *pPlayer, Item *pItem)
if (!tmpscript || !tmpscript->pOnItemClick) return true;
return tmpscript->pOnItemClick(pPlayer,pItem);
}
TRINITY_DLL_EXPORT
bool OnItemOpen (Player *pPlayer, Item *pItem)
{
@@ -315,7 +265,6 @@ bool OnItemOpen (Player *pPlayer, Item *pItem)
if (!tmpscript || !tmpscript->pOnItemOpen) return true;
return tmpscript->pOnItemOpen(pPlayer,pItem);
}
TRINITY_DLL_EXPORT
bool OnGoClick (Player *pPlayer, GameObject *pGameObject)
{
@@ -323,7 +272,6 @@ bool OnGoClick (Player *pPlayer, GameObject *pGameObject)
if (!tmpscript || !tmpscript->pOnGoClick) return true;
return tmpscript->pOnGoClick(pPlayer,pGameObject);
}
TRINITY_DLL_EXPORT
void OnCreatureKill (Player *pPlayer, Creature *pCreature)
{
@@ -331,259 +279,202 @@ void OnCreatureKill (Player *pPlayer, Creature *pCreature)
if (!tmpscript || !tmpscript->pOnCreatureKill) return;
tmpscript->pOnCreatureKill(pPlayer,pCreature);
}
TRINITY_DLL_EXPORT
char const* ScriptsVersion()
{
return "Default Trinity scripting library";
}
TRINITY_DLL_EXPORT
bool GossipHello (Player * pPlayer, Creature* pCreature)
{
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pGossipHello) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGossipHello(pPlayer, pCreature);
}
TRINITY_DLL_EXPORT
bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
debug_log("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction);
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pGossipSelect) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGossipSelect(pPlayer, pCreature, uiSender, uiAction);
}
TRINITY_DLL_EXPORT
bool GossipSelectWithCode(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* sCode)
{
debug_log("TSCR: Gossip selection with code, sender: %d, action: %d", uiSender, uiAction);
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pGossipSelectWithCode) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGossipSelectWithCode(pPlayer, pCreature, uiSender, uiAction, sCode);
}
TRINITY_DLL_EXPORT
bool GOSelect(Player* pPlayer, GameObject* pGO, uint32 uiSender, uint32 uiAction)
{
if(!pGO)
return false;
debug_log("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction);
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if(!tmpscript || !tmpscript->pGOSelect) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGOSelect(pPlayer, pGO, uiSender, uiAction);
}
TRINITY_DLL_EXPORT
bool GOSelectWithCode(Player* pPlayer, GameObject* pGO, uint32 uiSender, uint32 uiAction, const char* sCode)
{
if(!pGO)
return false;
debug_log("TSCR: Gossip selection, sender: %d, action: %d",uiSender, uiAction);
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if(!tmpscript || !tmpscript->pGOSelectWithCode) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGOSelectWithCode(pPlayer, pGO, uiSender ,uiAction, sCode);
}
TRINITY_DLL_EXPORT
bool QuestAccept(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pQuestAccept) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pQuestAccept(pPlayer, pCreature, pQuest);
}
TRINITY_DLL_EXPORT
bool QuestSelect(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pQuestSelect) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pQuestSelect(pPlayer, pCreature, pQuest);
}
TRINITY_DLL_EXPORT
bool QuestComplete(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pQuestComplete) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pQuestComplete(pPlayer, pCreature, pQuest);
}
TRINITY_DLL_EXPORT
bool ChooseReward(Player* pPlayer, Creature* pCreature, Quest const* pQuest, uint32 opt)
{
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pChooseReward) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pChooseReward(pPlayer, pCreature, pQuest, opt);
}
TRINITY_DLL_EXPORT
uint32 NPCDialogStatus(Player* pPlayer, Creature* pCreature)
{
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pNPCDialogStatus) return 100;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pNPCDialogStatus(pPlayer, pCreature);
}
TRINITY_DLL_EXPORT
uint32 GODialogStatus(Player* pPlayer, GameObject* pGO)
{
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if (!tmpscript || !tmpscript->pGODialogStatus) return 100;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGODialogStatus(pPlayer, pGO);
}
TRINITY_DLL_EXPORT
bool ItemHello(Player* pPlayer, Item* pItem, Quest const* pQuest)
{
Script *tmpscript = m_scripts[pItem->GetProto()->ScriptId];
if (!tmpscript || !tmpscript->pItemHello) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pItemHello(pPlayer, pItem, pQuest);
}
TRINITY_DLL_EXPORT
bool ItemQuestAccept(Player* pPlayer, Item* pItem, Quest const* pQuest)
{
Script *tmpscript = m_scripts[pItem->GetProto()->ScriptId];
if (!tmpscript || !tmpscript->pItemQuestAccept) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pItemQuestAccept(pPlayer, pItem, pQuest);
}
TRINITY_DLL_EXPORT
bool GOHello(Player* pPlayer, GameObject* pGO)
{
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if (!tmpscript || !tmpscript->pGOHello) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGOHello(pPlayer, pGO);
}
TRINITY_DLL_EXPORT
bool GOQuestAccept(Player* pPlayer, GameObject* pGO, Quest const* pQuest)
{
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if (!tmpscript || !tmpscript->pGOQuestAccept) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGOQuestAccept(pPlayer, pGO, pQuest);
}
TRINITY_DLL_EXPORT
bool GOChooseReward(Player* pPlayer, GameObject* pGO, Quest const* pQuest, uint32 opt)
{
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if (!tmpscript || !tmpscript->pGOChooseReward) return false;
pPlayer->PlayerTalkClass->ClearMenus();
return tmpscript->pGOChooseReward(pPlayer, pGO, pQuest, opt);
}
TRINITY_DLL_EXPORT
bool AreaTrigger(Player* pPlayer, AreaTriggerEntry * atEntry)
{
Script *tmpscript = m_scripts[GetAreaTriggerScriptId(atEntry->id)];
if (!tmpscript || !tmpscript->pAreaTrigger) return false;
return tmpscript->pAreaTrigger(pPlayer, atEntry);
}
TRINITY_DLL_EXPORT
CreatureAI* GetAI(Creature* pCreature)
{
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->GetAI) return NULL;
return tmpscript->GetAI(pCreature);
}
TRINITY_DLL_EXPORT
bool ItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)
{
Script *tmpscript = m_scripts[pItem->GetProto()->ScriptId];
if (!tmpscript || !tmpscript->pItemUse) return false;
return tmpscript->pItemUse(pPlayer, pItem, targets);
}
TRINITY_DLL_EXPORT
bool ItemExpire(Player* pPlayer, ItemPrototype const * pItemProto)
{
Script *tmpscript = m_scripts[pItemProto->ScriptId];
if (!tmpscript || !tmpscript->pItemExpire) return true;
return tmpscript->pItemExpire(pPlayer, pItemProto);
}
TRINITY_DLL_EXPORT
bool EffectDummyCreature(Unit *caster, uint32 spellId, uint32 effIndex, Creature *crTarget)
{
Script *tmpscript = m_scripts[crTarget->GetScriptId()];
if (!tmpscript || !tmpscript->pEffectDummyCreature) return false;
return tmpscript->pEffectDummyCreature(caster, spellId, effIndex, crTarget);
}
TRINITY_DLL_EXPORT
bool EffectDummyGameObj(Unit *caster, uint32 spellId, uint32 effIndex, GameObject *gameObjTarget)
{
Script *tmpscript = m_scripts[gameObjTarget->GetGOInfo()->ScriptId];
if (!tmpscript || !tmpscript->pEffectDummyGameObj) return false;
return tmpscript->pEffectDummyGameObj(caster, spellId, effIndex, gameObjTarget);
}
TRINITY_DLL_EXPORT
bool EffectDummyItem(Unit *caster, uint32 spellId, uint32 effIndex, Item *itemTarget)
{
Script *tmpscript = m_scripts[itemTarget->GetProto()->ScriptId];
if (!tmpscript || !tmpscript->pEffectDummyItem) return false;
return tmpscript->pEffectDummyItem(caster, spellId, effIndex, itemTarget);
}
TRINITY_DLL_EXPORT
InstanceData* CreateInstanceData(Map *map)
{
if (!map->IsDungeon()) return NULL;
Script *tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()];
if (!tmpscript || !tmpscript->GetInstanceData) return NULL;
return tmpscript->GetInstanceData(map);
}
-13
View File
@@ -4,14 +4,11 @@
*
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_SCRIPTMGR_H
#define SC_SCRIPTMGR_H
#include "Common.h"
#include "Platform/CompilerDefs.h"
#include "DBCStructure.h"
class Player;
class Creature;
class CreatureAI;
@@ -24,11 +21,9 @@ class Map;
class Unit;
class WorldObject;
struct ItemPrototype;
#define MAX_SCRIPTS 5000 //72 bytes each (approx 351kb)
#define VISIBLE_RANGE (166.0f) //MAX visible range (size of grid)
#define DEFAULT_TEXT "<Trinity Script Text Entry Missing!>"
struct Script
{
Script() :
@@ -39,9 +34,7 @@ struct Script
pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL),
GetAI(NULL), GetInstanceData(NULL)
{}
std::string Name;
//Methods to be scripted
void (*pOnLogin )(Player*);
void (*pOnLogout )(Player*);
@@ -79,22 +72,17 @@ struct Script
bool (*pEffectDummyCreature )(Unit*, uint32, uint32, Creature* );
bool (*pEffectDummyGameObj )(Unit*, uint32, uint32, GameObject* );
bool (*pEffectDummyItem )(Unit*, uint32, uint32, Item* );
CreatureAI* (*GetAI)(Creature*);
InstanceData* (*GetInstanceData)(Map*);
void RegisterSelf();
};
//Generic scripting text function
void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
#if COMPILER == COMPILER_GNU
#define FUNC_PTR(name,callconvention,returntype,parameters) typedef returntype(*name)parameters __attribute__ ((callconvention));
#else
#define FUNC_PTR(name, callconvention, returntype, parameters) typedef returntype(callconvention *name)parameters;
#endif
#ifdef WIN32
#define TRINITY_DLL_EXPORT extern "C" __declspec(dllexport)
#elif defined( __GNUC__ )
@@ -102,6 +90,5 @@ void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target = NULL);
#else
#define TRINITY_DLL_EXPORT extern "C" export
#endif
#endif
+2 -86
View File
@@ -1,23 +1,19 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
/* ScriptData
SDName: Npc_EscortAI
SD%Complete: 100
SDComment:
SDCategory: Npc
EndScriptData */
#include "precompiled.h"
#include "escort_ai.h"
enum ePoints
{
POINT_LAST_POINT = 0xFFFFFF,
POINT_HOME = 0xFFFFFE
};
npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
m_uiPlayerGUID(0),
MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
@@ -34,40 +30,32 @@ npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature),
m_bCanReturnToStart(false),
ScriptWP(false)
{}
void npc_escortAI::AttackStart(Unit* pWho)
{
if (!pWho)
return;
if (m_creature->Attack(pWho, true))
{
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
m_creature->GetMotionMaster()->MovementExpired();
if (IsCombatMovement())
m_creature->GetMotionMaster()->MoveChase(pWho);
}
}
//see followerAI
bool npc_escortAI::AssistPlayerInCombat(Unit* pWho)
{
if (!pWho || !pWho->getVictim())
return false;
//experimental (unknown) flag not present
if (!(m_creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK13))
return false;
//not a player
if (!pWho->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
return false;
//never attack friendly
if (m_creature->IsFriendlyTo(pWho))
return false;
//too far away and no free sight?
if (m_creature->IsWithinDistInMap(pWho, GetMaxPlayerDistance()) && m_creature->IsWithinLOSInMap(pWho))
{
@@ -84,20 +72,16 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho)
return true;
}
}
return false;
}
void npc_escortAI::MoveInLineOfSight(Unit* pWho)
{
if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(m_creature))
{
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho))
return;
if (!m_creature->canFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
return;
if (m_creature->IsHostileTo(pWho))
{
float fAttackRadius = m_creature->GetAttackDistance(pWho);
@@ -117,17 +101,15 @@ void npc_escortAI::MoveInLineOfSight(Unit* pWho)
}
}
}
void npc_escortAI::JustDied(Unit* pKiller)
{
if (!HasEscortState(STATE_ESCORT_ESCORTING) || !m_uiPlayerGUID || !m_pQuestForEscort)
return;
if (Player* pPlayer = GetPlayerForEscort())
{
if (Group* pGroup = pPlayer->GetGroup())
{
for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
for (GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
{
if (Player* pMember = pRef->getSource())
{
@@ -143,37 +125,29 @@ void npc_escortAI::JustDied(Unit* pKiller)
}
}
}
void npc_escortAI::JustRespawned()
{
m_uiEscortState = STATE_ESCORT_NONE;
if (!IsCombatMovement())
SetCombatMovement(true);
//add a small delay before going to first waypoint, normal in near all cases
m_uiWPWaitTimer = 2500;
if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A)
me->RestoreFaction();
Reset();
}
void npc_escortAI::ReturnToLastPoint()
{
float x, y, z, o;
m_creature->GetHomePosition(x, y, z, o);
m_creature->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z);
}
void npc_escortAI::EnterEvadeMode()
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
m_creature->SetLootRecipient(NULL);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
AddEscortState(STATE_ESCORT_RETURNING);
@@ -182,20 +156,17 @@ void npc_escortAI::EnterEvadeMode()
}
else
m_creature->GetMotionMaster()->MoveTargetedHome();
Reset();
}
bool npc_escortAI::IsPlayerOrGroupInRange()
{
if (Player* pPlayer = GetPlayerForEscort())
{
if (Group* pGroup = pPlayer->GetGroup())
{
for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
for (GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
{
Player* pMember = pRef->getSource();
if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance()))
{
return true;
@@ -211,7 +182,6 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
}
return false;
}
void npc_escortAI::UpdateAI(const uint32 uiDiff)
{
//Waypoint Updating
@@ -225,20 +195,15 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (DespawnAtEnd)
{
debug_log("TSCR: EscortAI reached end of waypoints");
if (m_bCanReturnToStart)
{
float fRetX, fRetY, fRetZ;
m_creature->GetRespawnCoord(fRetX, fRetY, fRetZ);
m_creature->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ);
m_uiWPWaitTimer = 0;
debug_log("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ);
return;
}
if (m_bCanInstantRespawn)
{
m_creature->setDeathState(JUST_DIED);
@@ -246,31 +211,25 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
}
else
m_creature->ForcedDespawn();
return;
}
else
{
debug_log("TSCR: EscortAI reached end of waypoints with Despawn off");
return;
}
}
if (!HasEscortState(STATE_ESCORT_PAUSED))
{
m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
WaypointStart(CurrentWP->id);
m_uiWPWaitTimer = 0;
}
}
else
m_uiWPWaitTimer -= uiDiff;
}
//Check if player or any member of his group is within range
if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !m_creature->getVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
{
@@ -279,7 +238,6 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
if (DespawnAtFar && !IsPlayerOrGroupInRange())
{
debug_log("TSCR: EscortAI failed because player/group was to far away or not found");
if (m_bCanInstantRespawn)
{
m_creature->setDeathState(JUST_DIED);
@@ -287,49 +245,39 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
}
else
m_creature->ForcedDespawn();
return;
}
m_uiPlayerCheckTimer = 1000;
}
else
m_uiPlayerCheckTimer -= uiDiff;
}
UpdateEscortAI(uiDiff);
}
void npc_escortAI::UpdateEscortAI(const uint32 uiDiff)
{
if (CanMelee && UpdateVictim())
DoMeleeAttackIfReady();
}
void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
{
if (uiMoveType != POINT_MOTION_TYPE || !HasEscortState(STATE_ESCORT_ESCORTING))
return;
//Combat start position reached, continue waypoint movement
if (uiPointId == POINT_LAST_POINT)
{
debug_log("TSCR: EscortAI has returned to original position before combat");
if (m_bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else if (!m_bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE))
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
RemoveEscortState(STATE_ESCORT_RETURNING);
if (!m_uiWPWaitTimer)
m_uiWPWaitTimer = 1;
}
else if (uiPointId == POINT_HOME)
{
debug_log("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list.");
CurrentWP = WaypointList.begin();
m_uiWPWaitTimer = 1;
}
@@ -341,18 +289,13 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId)
error_log("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u", uiPointId, CurrentWP->id);
return;
}
debug_log("TSCR: EscortAI Waypoint %u reached", CurrentWP->id);
//Call WP function
WaypointReached(CurrentWP->id);
m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1;
++CurrentWP;
}
}
/*
void npc_escortAI::OnPossess(bool apply)
{
@@ -371,13 +314,10 @@ void npc_escortAI::OnPossess(bool apply)
}
}
*/
void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs)
{
Escort_Waypoint t(id, x, y, z, WaitTimeMs);
WaypointList.push_back(t);
// i think SD2 no longer uses this function
ScriptWP = true;
/*PointMovement wp;
@@ -389,23 +329,18 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait
wp.m_uiWaitTime = WaitTimeMs;
PointMovementMap[wp.m_uiCreatureEntry].push_back(wp);*/
}
void npc_escortAI::FillPointMovementListForCreature()
{
std::vector<ScriptPointMove> const &pPointsEntries = pSystemMgr.GetPointMoveList(m_creature->GetEntry());
if (pPointsEntries.empty())
return;
std::vector<ScriptPointMove>::const_iterator itr;
for (itr = pPointsEntries.begin(); itr != pPointsEntries.end(); ++itr)
{
Escort_Waypoint pPoint(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime);
WaypointList.push_back(pPoint);
}
}
void npc_escortAI::SetRun(bool bRun)
{
if (bRun)
@@ -424,7 +359,6 @@ void npc_escortAI::SetRun(bool bRun)
}
m_bIsRunning = bRun;
}
//TODO: get rid of this many variables passed in function.
void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, const Quest* pQuest, bool bInstantRespawn, bool bCanLoopPath)
{
@@ -433,70 +367,52 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID,
error_log("TSCR ERROR: EscortAI attempt to Start while in combat.");
return;
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
error_log("TSCR: EscortAI attempt to Start while already escorting.");
return;
}
if(!ScriptWP) // sd2 never adds wp in script, but tc does
{
if (!WaypointList.empty())
WaypointList.clear();
FillPointMovementListForCreature();
}
if (WaypointList.empty())
{
error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint).");
return;
}
//set variables
m_bIsActiveAttacker = bIsActiveAttacker;
m_bIsRunning = bRun;
m_uiPlayerGUID = uiPlayerGUID;
m_pQuestForEscort = pQuest;
m_bCanInstantRespawn = bInstantRespawn;
m_bCanReturnToStart = bCanLoopPath;
if (m_bCanReturnToStart && m_bCanInstantRespawn)
debug_log("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MoveIdle();
debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
}
//disable npcflags
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
debug_log("TSCR: EscortAI started with %u waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %u", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
CurrentWP = WaypointList.begin();
//Set initial speed
if (m_bIsRunning)
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
else
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
AddEscortState(STATE_ESCORT_ESCORTING);
}
void npc_escortAI::SetEscortPaused(bool bPaused)
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
return;
if (bPaused)
AddEscortState(STATE_ESCORT_PAUSED);
else
-29
View File
@@ -1,14 +1,10 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_ESCORTAI_H
#define SC_ESCORTAI_H
#include "../system/system.h"
#define DEFAULT_MAX_PLAYER_DISTANCE 50
struct Escort_Waypoint
{
Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w)
@@ -19,14 +15,12 @@ struct Escort_Waypoint
z = _z;
WaitTimeMs = _w;
}
uint32 id;
float x;
float y;
float z;
uint32 WaitTimeMs;
};
enum eEscortState
{
STATE_ESCORT_NONE = 0x000, //nothing in progress
@@ -34,76 +28,53 @@ enum eEscortState
STATE_ESCORT_RETURNING = 0x002, //escort is returning after being in combat
STATE_ESCORT_PAUSED = 0x004 //will not proceed with waypoints before state is removed
};
struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
{
public:
explicit npc_escortAI(Creature* pCreature);
~npc_escortAI() {}
// CreatureAI functions
void AttackStart(Unit* who);
void MoveInLineOfSight(Unit* who);
void JustDied(Unit*);
void JustRespawned();
void ReturnToLastPoint();
void EnterEvadeMode();
void UpdateAI(const uint32); //the "internal" update, calls UpdateEscortAI()
virtual void UpdateEscortAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
void MovementInform(uint32, uint32);
// EscortAI functions
void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0);
virtual void WaypointReached(uint32 uiPointId) = 0;
virtual void WaypointStart(uint32 uiPointId) {}
void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false);
void SetRun(bool bRun = true);
void SetEscortPaused(bool uPaused);
bool HasEscortState(uint32 uiEscortState) { return (m_uiEscortState & uiEscortState); }
void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; }
float GetMaxPlayerDistance() { return MaxPlayerDistance; }
void SetCanMelee(bool usemelee) { CanMelee = usemelee; }
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; }
uint64 GetEventStarterGUID() { return m_uiPlayerGUID; }
protected:
Player* GetPlayerForEscort() { return (Player*)Unit::GetUnit(*m_creature, m_uiPlayerGUID); }
private:
bool AssistPlayerInCombat(Unit* pWho);
bool IsPlayerOrGroupInRange();
void FillPointMovementListForCreature();
void AddEscortState(uint32 uiEscortState) { m_uiEscortState |= uiEscortState; }
void RemoveEscortState(uint32 uiEscortState) { m_uiEscortState &= ~uiEscortState; }
uint64 m_uiPlayerGUID;
uint32 m_uiWPWaitTimer;
uint32 m_uiPlayerCheckTimer;
uint32 m_uiEscortState;
float MaxPlayerDistance;
const Quest* m_pQuestForEscort; //generally passed in Start() when regular escort script.
std::list<Escort_Waypoint> WaypointList;
std::list<Escort_Waypoint>::iterator CurrentWP;
bool m_bIsActiveAttacker; //obsolete, determined by faction.
bool m_bIsRunning; //all creatures are walking by default (has flag MOVEMENTFLAG_WALK)
bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used)
+3 -66
View File
@@ -1,50 +1,40 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
/* ScriptData
SDName: FollowerAI
SD%Complete: 50
SDComment: This AI is under development
SDCategory: Npc
EndScriptData */
#include "precompiled.h"
#include "follower_ai.h"
const float MAX_PLAYER_DISTANCE = 100.0f;
enum ePoints
{
POINT_COMBAT_START = 0xFFFFFF
};
FollowerAI::FollowerAI(Creature* pCreature) : ScriptedAI(pCreature),
m_uiLeaderGUID(0),
m_pQuestForFollow(NULL),
m_uiUpdateFollowTimer(2500),
m_uiFollowState(STATE_FOLLOW_NONE)
{}
void FollowerAI::AttackStart(Unit* pWho)
{
if (!pWho)
return;
if (m_creature->Attack(pWho, true))
{
m_creature->AddThreat(pWho, 0.0f);
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
if (m_creature->hasUnitState(UNIT_STAT_FOLLOW))
m_creature->clearUnitState(UNIT_STAT_FOLLOW);
if (IsCombatMovement())
m_creature->GetMotionMaster()->MoveChase(pWho);
}
}
//This part provides assistance to a player that are attacked by pWho, even if out of normal aggro range
//It will cause m_creature to attack pWho that are attacking _any_ player (which has been confirmed may happen also on offi)
//The flag (type_flag) is unconfirmed, but used here for further research and is a good candidate.
@@ -52,19 +42,15 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho)
{
if (!pWho || !pWho->getVictim())
return false;
//experimental (unknown) flag not present
if (!(m_creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK13))
return false;
//not a player
if (!pWho->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
return false;
//never attack friendly
if (m_creature->IsFriendlyTo(pWho))
return false;
//too far away and no free sight?
if (m_creature->IsWithinDistInMap(pWho, MAX_PLAYER_DISTANCE) && m_creature->IsWithinLOSInMap(pWho))
{
@@ -81,20 +67,16 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho)
return true;
}
}
return false;
}
void FollowerAI::MoveInLineOfSight(Unit* pWho)
{
if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(m_creature))
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho))
return;
if (!m_creature->canFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE)
return;
if (m_creature->IsHostileTo(pWho))
{
float fAttackRadius = m_creature->GetAttackDistance(pWho);
@@ -114,18 +96,16 @@ void FollowerAI::MoveInLineOfSight(Unit* pWho)
}
}
}
void FollowerAI::JustDied(Unit* pKiller)
{
if (!HasFollowState(STATE_FOLLOW_INPROGRESS) || !m_uiLeaderGUID || !m_pQuestForFollow)
return;
//TODO: need a better check for quests with time limit.
if (Player* pPlayer = GetLeaderForFollower())
{
if (Group* pGroup = pPlayer->GetGroup())
{
for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
for (GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
{
if (Player* pMember = pRef->getSource())
{
@@ -141,31 +121,24 @@ void FollowerAI::JustDied(Unit* pKiller)
}
}
}
void FollowerAI::JustRespawned()
{
m_uiFollowState = STATE_FOLLOW_NONE;
if (!IsCombatMovement())
SetCombatMovement(true);
if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A)
m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A);
Reset();
}
void FollowerAI::EnterEvadeMode()
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
m_creature->SetLootRecipient(NULL);
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
debug_log("TSCR: FollowerAI left combat, returning to CombatStartPosition.");
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
{
float fPosX, fPosY, fPosZ;
@@ -178,10 +151,8 @@ void FollowerAI::EnterEvadeMode()
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
m_creature->GetMotionMaster()->MoveTargetedHome();
}
Reset();
}
void FollowerAI::UpdateAI(const uint32 uiDiff)
{
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !m_creature->getVictim())
@@ -194,26 +165,21 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
m_creature->ForcedDespawn();
return;
}
bool bIsMaxRangeExceeded = true;
if (Player* pPlayer = GetLeaderForFollower())
{
if (HasFollowState(STATE_FOLLOW_RETURNING))
{
debug_log("TSCR: FollowerAI is returning to leader.");
RemoveFollowState(STATE_FOLLOW_RETURNING);
m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
return;
}
if (Group* pGroup = pPlayer->GetGroup())
{
for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
for (GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
{
Player* pMember = pRef->getSource();
if (pMember && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE))
{
bIsMaxRangeExceeded = false;
@@ -227,36 +193,29 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
bIsMaxRangeExceeded = false;
}
}
if (bIsMaxRangeExceeded)
{
debug_log("TSCR: FollowerAI failed because player/group was to far away or not found");
m_creature->ForcedDespawn();
return;
}
m_uiUpdateFollowTimer = 1000;
}
else
m_uiUpdateFollowTimer -= uiDiff;
}
UpdateFollowerAI(uiDiff);
}
void FollowerAI::UpdateFollowerAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
void FollowerAI::MovementInform(uint32 uiMotionType, uint32 uiPointId)
{
if (uiMotionType != POINT_MOTION_TYPE || !HasFollowState(STATE_FOLLOW_INPROGRESS))
return;
if (uiPointId == POINT_COMBAT_START)
{
if (GetLeaderForFollower())
@@ -268,7 +227,6 @@ void FollowerAI::MovementInform(uint32 uiMotionType, uint32 uiPointId)
m_creature->ForcedDespawn();
}
}
void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const Quest* pQuest)
{
if (m_creature->getVictim())
@@ -276,37 +234,27 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const
debug_log("TSCR: FollowerAI attempt to StartFollow while in combat.");
return;
}
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
error_log("TSCR: FollowerAI attempt to StartFollow while already following.");
return;
}
//set variables
m_uiLeaderGUID = pLeader->GetGUID();
if (uiFactionForFollower)
m_creature->setFaction(uiFactionForFollower);
m_pQuestForFollow = pQuest;
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
debug_log("TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
}
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
AddFollowState(STATE_FOLLOW_INPROGRESS);
m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
debug_log("TSCR: FollowerAI start follow %s (GUID %u)", pLeader->GetName(), m_uiLeaderGUID);
}
Player* FollowerAI::GetLeaderForFollower()
{
if (Player* pLeader = Unit::GetPlayer(m_uiLeaderGUID))
@@ -317,10 +265,9 @@ Player* FollowerAI::GetLeaderForFollower()
{
if (Group* pGroup = pLeader->GetGroup())
{
for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
for (GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
{
Player* pMember = pRef->getSource();
if (pMember && pMember->isAlive() && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE))
{
debug_log("TSCR: FollowerAI GetLeader changed and returned new leader.");
@@ -332,22 +279,18 @@ Player* FollowerAI::GetLeaderForFollower()
}
}
}
debug_log("TSCR: FollowerAI GetLeader can not find suitable leader.");
return NULL;
}
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
{
if (m_creature->hasUnitState(UNIT_STAT_FOLLOW))
{
m_creature->clearUnitState(UNIT_STAT_FOLLOW);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
}
if (bWithEndEvent)
AddFollowState(STATE_FOLLOW_POSTEVENT);
else
@@ -355,23 +298,18 @@ void FollowerAI::SetFollowComplete(bool bWithEndEvent)
if (HasFollowState(STATE_FOLLOW_POSTEVENT))
RemoveFollowState(STATE_FOLLOW_POSTEVENT);
}
AddFollowState(STATE_FOLLOW_COMPLETE);
}
void FollowerAI::SetFollowPaused(bool bPaused)
{
if (!HasFollowState(STATE_FOLLOW_INPROGRESS) || HasFollowState(STATE_FOLLOW_COMPLETE))
return;
if (bPaused)
{
AddFollowState(STATE_FOLLOW_PAUSED);
if (m_creature->hasUnitState(UNIT_STAT_FOLLOW))
{
m_creature->clearUnitState(UNIT_STAT_FOLLOW);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
@@ -380,7 +318,6 @@ void FollowerAI::SetFollowPaused(bool bPaused)
else
{
RemoveFollowState(STATE_FOLLOW_PAUSED);
if (Player* pLeader = GetLeaderForFollower())
m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
}
-21
View File
@@ -1,12 +1,9 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_FOLLOWERAI_H
#define SC_FOLLOWERAI_H
#include "../system/system.h"
enum eFollowState
{
STATE_FOLLOW_NONE = 0x000,
@@ -17,51 +14,33 @@ enum eFollowState
STATE_FOLLOW_PREEVENT = 0x010, //not implemented (allow pre event to run, before follow is initiated)
STATE_FOLLOW_POSTEVENT = 0x020 //can be set at complete and allow post event to run
};
class TRINITY_DLL_DECL FollowerAI : public ScriptedAI
{
public:
explicit FollowerAI(Creature* pCreature);
~FollowerAI() {}
//virtual void WaypointReached(uint32 uiPointId) = 0;
void MovementInform(uint32 uiMotionType, uint32 uiPointId);
void AttackStart(Unit*);
void MoveInLineOfSight(Unit*);
void EnterEvadeMode();
void JustDied(Unit*);
void JustRespawned();
void UpdateAI(const uint32); //the "internal" update, calls UpdateFollowerAI()
virtual void UpdateFollowerAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
void StartFollow(Player* pPlayer, uint32 uiFactionForFollower = 0, const Quest* pQuest = NULL);
void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow
void SetFollowComplete(bool bWithEndEvent = false);
bool HasFollowState(uint32 uiFollowState) { return (m_uiFollowState & uiFollowState); }
protected:
Player* GetLeaderForFollower();
private:
void AddFollowState(uint32 uiFollowState) { m_uiFollowState |= uiFollowState; }
void RemoveFollowState(uint32 uiFollowState) { m_uiFollowState &= ~uiFollowState; }
bool AssistPlayerInCombat(Unit* pWho);
uint64 m_uiLeaderGUID;
uint32 m_uiUpdateFollowTimer;
uint32 m_uiFollowState;
const Quest* m_pQuestForFollow; //normally we have a quest
};
#endif
-31
View File
@@ -13,84 +13,67 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Guard_AI
SD%Complete: 90
SDComment:
SDCategory: Guards
EndScriptData */
#include "precompiled.h"
#include "guard_ai.h"
// **** This script is for use within every single guard to save coding time ****
#define GENERIC_CREATURE_COOLDOWN 5000
#define SAY_GUARD_SIL_AGGRO1 -1070001
#define SAY_GUARD_SIL_AGGRO2 -1070002
#define SAY_GUARD_SIL_AGGRO3 -1070003
guardAI::guardAI(Creature* pCreature) : ScriptedAI(pCreature),
GlobalCooldown(0),
BuffTimer(0)
{}
void guardAI::Reset()
{
GlobalCooldown = 0;
BuffTimer = 0; //Rebuff as soon as we can
}
void guardAI::EnterCombat(Unit *who)
{
if (m_creature->GetEntry() == 15184)
DoScriptText(RAND(SAY_GUARD_SIL_AGGRO1,SAY_GUARD_SIL_AGGRO2,SAY_GUARD_SIL_AGGRO3), m_creature, who);
if (SpellEntry const *spell = m_creature->reachWithSpellAttack(who))
DoCastSpell(who, spell);
}
void guardAI::JustDied(Unit *Killer)
{
//Send Zone Under Attack message to the LocalDefense and WorldDefense Channels
if (Player* pKiller = Killer->GetCharmerOrOwnerPlayerOrPlayerItself())
m_creature->SendZoneUnderAttackMessage(pKiller);
}
void guardAI::UpdateAI(const uint32 diff)
{
//Always decrease our global cooldown first
if (GlobalCooldown > diff)
GlobalCooldown -= diff;
else GlobalCooldown = 0;
//Buff timer (only buff when we are alive and not in combat
if (m_creature->isAlive() && !m_creature->isInCombat())
if (BuffTimer < diff)
{
//Find a spell that targets friendly and applies an aura (these are generally buffs)
SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
if (info && !GlobalCooldown)
{
//Cast the buff spell
DoCastSpell(m_creature, info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
//Set our timer to 10 minutes before rebuff
BuffTimer = 600000;
} //Try agian in 30 seconds
else BuffTimer = 30000;
}else BuffTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
// Make sure our attack is ready and we arn't currently casting
if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
{
@@ -99,27 +82,22 @@ void guardAI::UpdateAI(const uint32 diff)
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, select a hostile spell
if (info) Healing = true;
else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
//20% chance to replace our white hit with a spell
if (info && rand() % 5 == 0 && !GlobalCooldown)
{
//Cast the spell
if (Healing)DoCastSpell(m_creature, info);
else DoCastSpell(m_creature->getVictim(), info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
}
else m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
}
}
@@ -130,15 +108,12 @@ void guardAI::UpdateAI(const uint32 diff)
{
bool Healing = false;
SpellEntry const *info = NULL;
//Select a healing spell if less than 30% hp ONLY 33% of the time
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30 && rand() % 3 == 0)
info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
if (info) Healing = true;
else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
//Found a spell, check if we arn't on cooldown
if (info && !GlobalCooldown)
{
@@ -148,14 +123,11 @@ void guardAI::UpdateAI(const uint32 diff)
(*m_creature).GetMotionMaster()->Clear(false);
(*m_creature).GetMotionMaster()->MoveIdle();
}
//Cast spell
if (Healing) DoCastSpell(m_creature,info);
else DoCastSpell(m_creature->getVictim(),info);
//Set our global cooldown
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
} //If no spells available and we arn't moving run to target
else if ((*m_creature).GetMotionMaster()->GetCurrentMovementGeneratorType()!=TARGETED_MOTION_TYPE)
{
@@ -167,7 +139,6 @@ void guardAI::UpdateAI(const uint32 diff)
}
}
}
void guardAI::DoReplyToTextEmote(uint32 em)
{
switch(em)
@@ -180,13 +151,11 @@ void guardAI::DoReplyToTextEmote(uint32 em)
case TEXTEMOTE_CHICKEN: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
}
}
void guardAI_orgrimmar::ReceiveEmote(Player* pPlayer, uint32 text_emote)
{
if (pPlayer->GetTeam()==HORDE)
DoReplyToTextEmote(text_emote);
}
void guardAI_stormwind::ReceiveEmote(Player* pPlayer, uint32 text_emote)
{
if (pPlayer->GetTeam() == ALLIANCE)
-13
View File
@@ -1,44 +1,31 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_GUARDAI_H
#define SC_GUARDAI_H
#define GENERIC_CREATURE_COOLDOWN 5000
struct TRINITY_DLL_DECL guardAI : public ScriptedAI
{
public:
explicit guardAI(Creature* pCreature);
~guardAI() {}
uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
uint32 BuffTimer; //This variable keeps track of buffs
void Reset();
void EnterCombat(Unit *who);
void JustDied(Unit *Killer);
void UpdateAI(const uint32 diff);
//common used for guards in main cities
void DoReplyToTextEmote(uint32 em);
};
struct TRINITY_DLL_DECL guardAI_orgrimmar : public guardAI
{
guardAI_orgrimmar(Creature *c) : guardAI(c) {}
void ReceiveEmote(Player *player, uint32 text_emote);
};
struct TRINITY_DLL_DECL guardAI_stormwind : public guardAI
{
guardAI_stormwind(Creature *c) : guardAI(c) {}
void ReceiveEmote(Player *player, uint32 text_emote);
};
#endif
-42
View File
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: SimpleAI
SD%Complete: 100
SDComment: Base Class for SimpleAI creatures
SDCategory: Creatures
EndScriptData */
#include "precompiled.h"
#include "simple_ai.h"
SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
{
//Clear all data
@@ -33,7 +30,6 @@ SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
Aggro_Sound[0] = 0;
Aggro_Sound[1] = 0;
Aggro_Sound[2] = 0;
Death_TextId[0] = 0;
Death_TextId[1] = 0;
Death_TextId[2] = 0;
@@ -42,7 +38,6 @@ SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
Death_Sound[2] = 0;
Death_Spell = 0;
Death_Target_Type = 0;
Kill_TextId[0] = 0;
Kill_TextId[1] = 0;
Kill_TextId[2] = 0;
@@ -51,16 +46,12 @@ SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
Kill_Sound[2] = 0;
Kill_Spell = 0;
Kill_Target_Type = 0;
memset(Spell,0,sizeof(Spell));
EnterEvadeMode();
}
void SimpleAI::Reset()
{
}
void SimpleAI::EnterCombat(Unit *who)
{
//Reset cast timers
@@ -94,35 +85,26 @@ void SimpleAI::EnterCombat(Unit *who)
if (Spell[9].First_Cast >= 0)
Spell_Timer[9] = Spell[9].First_Cast;
else Spell_Timer[9] = 1000;
uint8 random_text = urand(0,2);
//Random text
if (Aggro_TextId[random_text])
DoScriptText(Aggro_TextId[random_text], m_creature, who);
//Random sound
if (Aggro_Sound[random_text])
DoPlaySoundToSet(m_creature, Aggro_Sound[random_text]);
}
void SimpleAI::KilledUnit(Unit *victim)
{
uint8 random_text = urand(0,2);
//Random yell
if (Kill_TextId[random_text])
DoScriptText(Kill_TextId[random_text], m_creature, victim);
//Random sound
if (Kill_Sound[random_text])
DoPlaySoundToSet(m_creature, Kill_Sound[random_text]);
if (!Kill_Spell)
return;
Unit* target = NULL;
switch (Kill_Target_Type)
{
case CAST_SELF:
@@ -144,33 +126,25 @@ void SimpleAI::KilledUnit(Unit *victim)
target = victim;
break;
}
//Target is ok, cast a spell on it
if (target)
DoCast(target, Kill_Spell);
}
void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
{
//Return if damage taken won't kill us
if (m_creature->GetHealth() > damage)
return;
uint8 random_text = urand(0,2);
//Random yell
if (Death_TextId[random_text])
DoScriptText(Death_TextId[random_text], m_creature, killer);
//Random sound
if (Death_Sound[random_text])
DoPlaySoundToSet(m_creature, Death_Sound[random_text]);
if (!Death_Spell)
return;
Unit* target = NULL;
switch (Death_Target_Type)
{
case CAST_SELF:
@@ -192,36 +166,30 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
target = killer;
break;
}
//Target is ok, cast a spell on it
if (target)
DoCast(target, Death_Spell);
}
void SimpleAI::UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Spells
for (uint32 i = 0; i < 10; ++i)
{
//Spell not valid
if (!Spell[i].Enabled || !Spell[i].Spell_Id)
continue;
if (Spell_Timer[i] < diff)
{
//Check if this is a percentage based
if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > -Spell[i].First_Cast)
continue;
//Check Current spell
if (!(Spell[i].InterruptPreviousCast && m_creature->IsNonMeleeSpellCasted(false)))
{
Unit* target = NULL;
switch (Spell[i].Cast_Target_Type)
{
case CAST_SELF:
@@ -240,39 +208,29 @@ void SimpleAI::UpdateAI(const uint32 diff)
target = SelectUnit(SELECT_TARGET_RANDOM,0);
break;
}
//Target is ok, cast a spell on it and then do our random yell
if (target)
{
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
DoCast(target, Spell[i].Spell_Id);
//Yell and sound use the same number so that you can make
//the Creature yell with the correct sound effect attached
uint8 random_text = urand(0,2);
//Random yell
if (Spell[i].TextId[random_text])
DoScriptText(Spell[i].TextId[random_text], m_creature, target);
//Random sound
if (Spell[i].Text_Sound[random_text])
DoPlaySoundToSet(m_creature, Spell[i].Text_Sound[random_text]);
}
}
//Spell will cast agian when the cooldown is up
if (Spell[i].CooldownRandomAddition)
Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition);
else Spell_Timer[i] = Spell[i].Cooldown;
}else Spell_Timer[i] -= diff;
}
DoMeleeAttackIfReady();
}
-17
View File
@@ -1,10 +1,8 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_SIMPLEAI_H
#define SC_SIMPLEAI_H
enum CastTarget
{
CAST_SELF = 0, //Self cast
@@ -13,41 +11,29 @@ enum CastTarget
CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
CAST_HOSTILE_RANDOM, //Just any random target on our threat list
CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED
//Special cases
CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function
CAST_JUSTDIED_KILLER, //Only works within JustDied function
};
struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
{
SimpleAI(Creature *c);// : ScriptedAI(c);
void Reset();
void EnterCombat(Unit *who);
void KilledUnit(Unit *victim);
void DamageTaken(Unit *killer, uint32 &damage);
void UpdateAI(const uint32 diff);
public:
int32 Aggro_TextId[3];
uint32 Aggro_Sound[3];
int32 Death_TextId[3];
uint32 Death_Sound[3];
uint32 Death_Spell;
uint32 Death_Target_Type;
int32 Kill_TextId[3];
uint32 Kill_Sound[3];
uint32 Kill_Spell;
uint32 Kill_Target_Type;
struct SimpleAI_Spell
{
uint32 Spell_Id; //Spell ID to cast
@@ -57,15 +43,12 @@ public:
uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this)
bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast
bool Enabled; //Spell enabled or disabled (default: false)
//3 texts to many?
int32 TextId[3];
uint32 Text_Sound[3];
}Spell[10];
protected:
uint32 Spell_Timer[10];
};
#endif
@@ -1,6 +1,5 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#include "precompiled.h"
@@ -1,10 +1,8 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_PRECOMPILED_H
#define SC_PRECOMPILED_H
#include "../ScriptMgr.h"
#include "Cell.h"
#include "CellImpl.h"
@@ -20,7 +18,6 @@
#include "Chat.h"
#include "DBCStructure.h"
#include "DBCStores.h"
#ifdef WIN32
#include <windows.h>
BOOL APIENTRY DllMain( HANDLE hModule,
@@ -31,6 +28,5 @@ LPVOID lpReserved
return true;
}
#endif
#endif
+10 -137
View File
@@ -4,23 +4,20 @@
*
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#include "precompiled.h"
#include "Item.h"
#include "Spell.h"
#include "ObjectMgr.h"
#include "TemporarySummon.h"
// Spell summary for ScriptedAI::SelectSpell
struct TSpellSummary
{
uint8 Targets; // set of enum SelectTarget
uint8 Effects; // set of enum SelectEffect
} *SpellSummary;
void SummonList::DoZoneInCombat(uint32 entry)
{
for(iterator i = begin(); i != end();)
for (iterator i = begin(); i != end(); )
{
Creature *summon = Unit::GetCreature(*m_creature, *i);
++i;
@@ -29,10 +26,9 @@ void SummonList::DoZoneInCombat(uint32 entry)
summon->AI()->DoZoneInCombat();
}
}
void SummonList::DoAction(uint32 entry, uint32 info)
{
for(iterator i = begin(); i != end();)
for (iterator i = begin(); i != end(); )
{
Creature *summon = Unit::GetCreature(*m_creature, *i);
++i;
@@ -41,10 +37,9 @@ void SummonList::DoAction(uint32 entry, uint32 info)
summon->AI()->DoAction(info);
}
}
void SummonList::DespawnEntry(uint32 entry)
{
for(iterator i = begin(); i != end();)
for (iterator i = begin(); i != end(); )
{
Creature *summon = Unit::GetCreature(*m_creature, *i);
if(!summon)
@@ -59,7 +54,6 @@ void SummonList::DespawnEntry(uint32 entry)
++i;
}
}
void SummonList::DespawnAll()
{
while(!empty())
@@ -80,7 +74,6 @@ void SummonList::DespawnAll()
}
}
}
ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature),
m_creature(pCreature),
IsFleeing(false),
@@ -89,22 +82,18 @@ ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature),
{
HeroicMode = m_creature->GetMap()->IsHeroic();
}
void ScriptedAI::AttackStartNoMove(Unit* pWho)
{
if (!pWho)
return;
if(m_creature->Attack(pWho, false))
DoStartNoMovement(pWho);
}
void ScriptedAI::UpdateAI(const uint32 uiDiff)
{
//Check if we have a current target
if (!UpdateVictim())
return;
if (m_creature->isAttackReady())
{
//If we are within range melee the target
@@ -115,232 +104,180 @@ void ScriptedAI::UpdateAI(const uint32 uiDiff)
}
}
}
void ScriptedAI::DoStartMovement(Unit* pVictim, float fDistance, float fAngle)
{
if (pVictim)
m_creature->GetMotionMaster()->MoveChase(pVictim, fDistance, fAngle);
}
void ScriptedAI::DoStartNoMovement(Unit* pVictim)
{
if (!pVictim)
return;
m_creature->GetMotionMaster()->MoveIdle();
}
void ScriptedAI::DoStopAttack()
{
if (m_creature->getVictim())
m_creature->AttackStop();
}
void ScriptedAI::DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered)
{
if (!pTarget || m_creature->IsNonMeleeSpellCasted(false))
return;
m_creature->StopMoving();
m_creature->CastSpell(pTarget, pSpellInfo, bTriggered);
}
void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId)
{
if (!pSource)
return;
if (!GetSoundEntriesStore()->LookupEntry(uiSoundId))
{
error_log("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUIDLow());
return;
}
pSource->PlayDirectSound(uiSoundId);
}
Creature* ScriptedAI::DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime)
{
return m_creature->SummonCreature(uiId, m_creature->GetPositionX()+fX, m_creature->GetPositionY()+fY, m_creature->GetPositionZ()+fZ, fAngle, (TempSummonType)uiType, uiDespawntime);
}
Unit* ScriptedAI::SelectUnit(SelectAggroTarget target, uint32 uiPosition)
{
//ThreatList m_threatlist;
std::list<HostilReference*>& threatlist = m_creature->getThreatManager().getThreatList();
std::list<HostilReference*>::iterator itr = threatlist.begin();
std::list<HostilReference*>::reverse_iterator ritr = threatlist.rbegin();
if (uiPosition >= threatlist.size() || !threatlist.size())
return NULL;
switch (target)
{
case SELECT_TARGET_RANDOM:
advance (itr , uiPosition + (rand() % (threatlist.size() - uiPosition ) ));
return Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
break;
case SELECT_TARGET_TOPAGGRO:
advance (itr , uiPosition);
return Unit::GetUnit((*m_creature),(*itr)->getUnitGuid());
break;
case SELECT_TARGET_BOTTOMAGGRO:
advance (ritr , uiPosition);
return Unit::GetUnit((*m_creature),(*ritr)->getUnitGuid());
break;
}
return NULL;
}
SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 uiMechanic, SelectTargetType selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffects)
{
//No target so we can't cast
if (!pTarget)
return false;
//Silenced so we can't cast
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
return false;
//Using the extended script system we first create a list of viable spells
SpellEntry const* apSpell[CREATURE_MAX_SPELLS];
memset(apSpell, 0, sizeof(SpellEntry*)*CREATURE_MAX_SPELLS);
uint32 uiSpellCount = 0;
SpellEntry const* pTempSpell;
SpellRangeEntry const* pTempRange;
//Check if each spell is viable(set it to null if not)
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++)
{
pTempSpell = GetSpellStore()->LookupEntry(m_creature->m_spells[i]);
//This spell doesn't exist
if (!pTempSpell)
continue;
// Targets and Effects checked first as most used restrictions
//Check the spell targets if specified
if (selectTargets && !(SpellSummary[m_creature->m_spells[i]].Targets & (1 << (selectTargets-1))))
continue;
//Check the type of spell if we are looking for a specific spell type
if (selectEffects && !(SpellSummary[m_creature->m_spells[i]].Effects & (1 << (selectEffects-1))))
continue;
//Check for school if specified
if (uiSchool >= 0 && pTempSpell->SchoolMask & uiSchool)
continue;
//Check for spell mechanic if specified
if (uiMechanic >= 0 && pTempSpell->Mechanic != uiMechanic)
continue;
//Make sure that the spell uses the requested amount of power
if (uiPowerCostMin && pTempSpell->manaCost < uiPowerCostMin)
continue;
if (uiPowerCostMax && pTempSpell->manaCost > uiPowerCostMax)
continue;
//Continue if we don't have the mana to actually cast this spell
if (pTempSpell->manaCost > m_creature->GetPower((Powers)pTempSpell->powerType))
continue;
//Get the Range
pTempRange = GetSpellRangeStore()->LookupEntry(pTempSpell->rangeIndex);
//Spell has invalid range store so we can't use it
if (!pTempRange)
continue;
//Check if the spell meets our range requirements
if (fRangeMin && m_creature->GetSpellMinRangeForTarget(pTarget, pTempRange) < fRangeMin)
continue;
if (fRangeMax && m_creature->GetSpellMaxRangeForTarget(pTarget, pTempRange) > fRangeMax)
continue;
//Check if our target is in range
if (m_creature->IsWithinDistInMap(pTarget, m_creature->GetSpellMinRangeForTarget(pTarget, pTempRange)) || !m_creature->IsWithinDistInMap(pTarget, m_creature->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
continue;
//All good so lets add it to the spell list
apSpell[uiSpellCount] = pTempSpell;
++uiSpellCount;
}
//We got our usable spells so now lets randomly pick one
if (!uiSpellCount)
return NULL;
return apSpell[rand()%uiSpellCount];
}
bool ScriptedAI::CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered)
{
//No target so we can't cast
if (!pTarget || !pSpell)
return false;
//Silenced so we can't cast
if (!bTriggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
return false;
//Check for power
if (!bTriggered && me->GetPower((Powers)pSpell->powerType) < pSpell->manaCost)
return false;
SpellRangeEntry const* pTempRange = GetSpellRangeStore()->LookupEntry(pSpell->rangeIndex);
//Spell has invalid range store so we can't use it
if (!pTempRange)
return false;
//Unit is out of range of this spell
if (me->IsInRange(pTarget, m_creature->GetSpellMinRangeForTarget(pTarget, pTempRange), m_creature->GetSpellMaxRangeForTarget(pTarget, pTempRange)))
return false;
return true;
}
void FillSpellSummary()
{
SpellSummary = new TSpellSummary[GetSpellStore()->GetNumRows()];
SpellEntry const* pTempSpell;
for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
for (uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
{
SpellSummary[i].Effects = 0;
SpellSummary[i].Targets = 0;
pTempSpell = GetSpellStore()->LookupEntry(i);
//This spell doesn't exist
if (!pTempSpell)
continue;
for(uint32 j = 0; j < 3; ++j)
for (uint32 j = 0; j < 3; ++j)
{
//Spell targets self
if (pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_CASTER )
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SELF-1);
//Spell targets a single enemy
if (pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ENEMY ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_DST_TARGET_ENEMY )
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SINGLE_ENEMY-1);
//Spell targets AoE at enemy
if (pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_AREA_ENEMY_SRC ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_AREA_ENEMY_DST ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_DEST_DYNOBJ_ENEMY )
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_ENEMY-1);
//Spell targets an enemy
if (pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ENEMY ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_DST_TARGET_ENEMY ||
@@ -349,19 +286,16 @@ void FillSpellSummary()
pTempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_DEST_DYNOBJ_ENEMY )
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_ENEMY-1);
//Spell targets a single friend(or self)
if (pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_CASTER ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ALLY ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_PARTY )
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SINGLE_FRIEND-1);
//Spell targets aoe friends
if (pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_PARTY_CASTER ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_PARTY_TARGET ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER)
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_FRIEND-1);
//Spell targets any friend(or self)
if (pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_CASTER ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_TARGET_ALLY ||
@@ -370,28 +304,24 @@ void FillSpellSummary()
pTempSpell->EffectImplicitTargetA[j] == TARGET_UNIT_PARTY_TARGET ||
pTempSpell->EffectImplicitTargetA[j] == TARGET_SRC_CASTER)
SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_FRIEND-1);
//Make sure that this spell includes a damage effect
if (pTempSpell->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE ||
pTempSpell->Effect[j] == SPELL_EFFECT_INSTAKILL ||
pTempSpell->Effect[j] == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE ||
pTempSpell->Effect[j] == SPELL_EFFECT_HEALTH_LEECH )
SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_DAMAGE-1);
//Make sure that this spell includes a healing effect (or an apply aura with a periodic heal)
if (pTempSpell->Effect[j] == SPELL_EFFECT_HEAL ||
pTempSpell->Effect[j] == SPELL_EFFECT_HEAL_MAX_HEALTH ||
pTempSpell->Effect[j] == SPELL_EFFECT_HEAL_MECHANICAL ||
(pTempSpell->Effect[j] == SPELL_EFFECT_APPLY_AURA && pTempSpell->EffectApplyAuraName[j]== 8 ))
SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_HEALING-1);
//Make sure that this spell applies an aura
if (pTempSpell->Effect[j] == SPELL_EFFECT_APPLY_AURA )
SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_AURA-1);
}
}
}
void ScriptedAI::DoResetThreat()
{
if (!m_creature->CanHaveThreatList() || m_creature->getThreatManager().isThreatListEmpty())
@@ -399,41 +329,33 @@ void ScriptedAI::DoResetThreat()
error_log("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (m_creature entry = %d)", m_creature->GetEntry());
return;
}
std::list<HostilReference*>& threatlist = m_creature->getThreatManager().getThreatList();
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* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
if(pUnit && DoGetThreat(pUnit))
DoModifyThreatPercent(pUnit, -100);
}
}
float ScriptedAI::DoGetThreat(Unit* pUnit)
{
if(!pUnit) return 0.0f;
return m_creature->getThreatManager().getThreat(pUnit);
}
void ScriptedAI::DoModifyThreatPercent(Unit* pUnit, int32 pct)
{
if(!pUnit) return;
m_creature->getThreatManager().modifyThreatPercent(pUnit, pct);
}
void ScriptedAI::DoTeleportTo(float fX, float fY, float fZ, uint32 uiTime)
{
m_creature->Relocate(fX, fY, fZ);
m_creature->SendMonsterMove(fX, fY, fZ, uiTime);
}
void ScriptedAI::DoTeleportTo(const float fPos[4])
{
me->NearTeleportTo(fPos[0], fPos[1], fPos[2], fPos[3]);
}
void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, float fO)
{
if(!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER)
@@ -442,33 +364,27 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, flo
error_log("TSCR: Creature %u (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: %u) to x: %f y:%f z: %f o: %f. Aborted.", m_creature->GetGUID(), m_creature->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO);
return;
}
CAST_PLR(pUnit)->TeleportTo(pUnit->GetMapId(), fX, fY, fZ, fO, TELE_TO_NOT_LEAVE_COMBAT);
}
void ScriptedAI::DoTeleportAll(float fX, float fY, float fZ, float fO)
{
Map *map = m_creature->GetMap();
if (!map->IsDungeon())
return;
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 (i_pl->isAlive())
i_pl->TeleportTo(m_creature->GetMapId(), fX, fY, fZ, fO, TELE_TO_NOT_LEAVE_COMBAT);
}
Unit* ScriptedAI::DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff)
{
Unit* pUnit = NULL;
Trinity::MostHPMissingInRange u_check(m_creature, fRange, uiMinHPDiff);
Trinity::UnitLastSearcher<Trinity::MostHPMissingInRange> searcher(m_creature, pUnit, u_check);
m_creature->VisitNearbyObject(fRange, searcher);
return pUnit;
}
std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float fRange)
{
std::list<Creature*> pList;
@@ -477,7 +393,6 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float fRange)
m_creature->VisitNearbyObject(fRange, searcher);
return pList;
}
std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellid)
{
std::list<Creature*> pList;
@@ -486,51 +401,39 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float fRange, uint32
m_creature->VisitNearbyObject(fRange, searcher);
return pList;
}
Player* ScriptedAI::GetPlayerAtMinimumRange(float fMinimumRange)
{
Player* pPlayer = NULL;
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::PlayerAtMinimumRangeAway check(m_creature, fMinimumRange);
Trinity::PlayerSearcher<Trinity::PlayerAtMinimumRangeAway> searcher(m_creature, pPlayer, check);
TypeContainerVisitor<Trinity::PlayerSearcher<Trinity::PlayerAtMinimumRangeAway>, GridTypeMapContainer> visitor(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
return pPlayer;
}
void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged)
{
if (bLoadDefault)
{
if (CreatureInfo const* pInfo = GetCreatureTemplateStore(m_creature->GetEntry()))
m_creature->LoadEquipment(pInfo->equipmentId,true);
return;
}
if (uiMainHand >= 0)
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand));
if (uiOffHand >= 0)
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand));
if (uiRanged >= 0)
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged));
}
void ScriptedAI::SetCombatMovement(bool bCombatMove)
{
m_bCombatMovement = bCombatMove;
}
enum eNPCs
{
NPC_BROODLORD = 12017,
@@ -538,7 +441,6 @@ enum eNPCs
NPC_JAN_ALAI = 23578,
NPC_SARTHARION = 28860
};
// Hacklike storage used for misc creatures that are expected to evade of outside of a certain area.
// It is assumed the information is found elswehere and can be handled by mangos. So far no luck finding such information/way to extract it.
bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
@@ -550,14 +452,11 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
m_uiEvadeCheckCooldown -= uiDiff;
return false;
}
if (m_creature->IsInEvadeMode() || !m_creature->getVictim())
return false;
float fX = m_creature->GetPositionX();
float fY = m_creature->GetPositionY();
float fZ = m_creature->GetPositionZ();
switch(m_creature->GetEntry())
{
case NPC_BROODLORD: // broodlord (not move down stairs)
@@ -580,39 +479,32 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
error_log("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", m_creature->GetEntry());
return false;
}
EnterEvadeMode();
return true;
}
void Scripted_NoMovementAI::AttackStart(Unit* pWho)
{
if (!pWho)
return;
if (m_creature->Attack(pWho, true))
{
DoStartNoMovement(pWho);
}
}
BossAI::BossAI(Creature *c, uint32 id) : ScriptedAI(c)
, bossId(id), summons(me), instance(c->GetInstanceData())
, boundary(instance ? instance->GetBossBoundary(id) : NULL)
{
}
void BossAI::_Reset()
{
if(!me->isAlive())
return;
events.Reset();
summons.DespawnAll();
if(instance)
instance->SetBossState(bossId, NOT_STARTED);
}
void BossAI::_JustDied()
{
events.Reset();
@@ -620,7 +512,6 @@ void BossAI::_JustDied()
if(instance)
instance->SetBossState(bossId, DONE);
}
void BossAI::_EnterCombat()
{
me->setActive(true);
@@ -628,23 +519,20 @@ void BossAI::_EnterCombat()
if(instance)
instance->SetBossState(bossId, IN_PROGRESS);
}
void BossAI::TeleportCheaters()
{
float x, y, z;
me->GetPosition(x, y, z);
std::list<HostilReference*> &m_threatlist = me->getThreatManager().getThreatList();
for(std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
for (std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
if((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && !CheckBoundary((*itr)->getTarget()))
(*itr)->getTarget()->NearTeleportTo(x, y, z, 0);
}
bool BossAI::CheckBoundary(Unit *who)
{
if(!boundary || !who)
return true;
for(BossBoundaryMap::const_iterator itr = boundary->begin(); itr != boundary->end(); ++itr)
for (BossBoundaryMap::const_iterator itr = boundary->begin(); itr != boundary->end(); ++itr)
{
switch(itr->first)
{
@@ -682,48 +570,39 @@ bool BossAI::CheckBoundary(Unit *who)
break;
}
}
return true;
}
void BossAI::JustSummoned(Creature *summon)
{
summons.Summon(summon);
if(me->isInCombat())
DoZoneInCombat(summon);
}
void BossAI::SummonedCreatureDespawn(Creature *summon)
{
summons.Despawn(summon);
}
#define GOBJECT(x) (const_cast<GameObjectInfo*>(GetGameObjectInfo(x)))
void LoadOverridenSQLData()
{
GameObjectInfo *goInfo;
// Sunwell Plateau : Kalecgos : Spectral Rift
if(goInfo = GOBJECT(187055))
if(goInfo->type == GAMEOBJECT_TYPE_GOOBER)
goInfo->goober.lockId = 57; // need LOCKTYPE_QUICK_OPEN
// Naxxramas : Sapphiron Birth
if(goInfo = GOBJECT(181356))
if(goInfo->type == GAMEOBJECT_TYPE_TRAP)
goInfo->trap.radius = 50;
}
void LoadOverridenDBCData()
{
SpellEntry *spellInfo;
for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
for (uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
{
spellInfo = GET_SPELL(i);
if(!spellInfo)
continue;
switch(i)
{
// Black Temple : Illidan : Parasitic Shadowfiend Passive
@@ -749,23 +628,17 @@ void LoadOverridenDBCData()
}
}
Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 Entry, float MaxSearchRange)
{
Creature* pCreature = NULL;
CellPair pair(Trinity::ComputeCellPair(pSource->GetPositionX(), pSource->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*pSource, Entry, true, MaxSearchRange);
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pSource, pCreature, creature_check);
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer> creature_searcher(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, creature_searcher,*(pSource->GetMap()));
return pCreature;
}
@@ -4,28 +4,21 @@
*
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_CREATURE_H
#define SC_CREATURE_H
#include "Creature.h"
#include "CreatureAI.h"
#include "CreatureAIImpl.h"
#include "InstanceData.h"
#define SCRIPT_CAST_TYPE dynamic_cast
//#define SCRIPT_CAST_TYPE static_cast
#define CAST_PLR(a) (SCRIPT_CAST_TYPE<Player*>(a))
#define CAST_CRE(a) (SCRIPT_CAST_TYPE<Creature*>(a))
#define CAST_SUM(a) (SCRIPT_CAST_TYPE<TempSummon*>(a))
#define CAST_PET(a) (SCRIPT_CAST_TYPE<Pet*>(a))
#define CAST_AI(a,b) (SCRIPT_CAST_TYPE<a*>(b))
#define GET_SPELL(a) (const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(a)))
class ScriptedInstance;
class SummonList : public std::list<uint64>
{
public:
@@ -39,178 +32,125 @@ class SummonList : public std::list<uint64>
private:
Creature *m_creature;
};
struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
{
explicit ScriptedAI(Creature* pCreature);
~ScriptedAI() {}
//*************
//CreatureAI Functions
//*************
void AttackStartNoMove(Unit *target);
// Called at any Damage from any attacker (before damage apply)
void DamageTaken(Unit* pDone_by, uint32& uiDamage) {}
//Called at World update tick
void UpdateAI(const uint32);
//Called at creature death
void JustDied(Unit* who){}
//Called at creature killing another unit
void KilledUnit(Unit* who){}
// Called when the creature summon successfully other creature
void JustSummoned(Creature* ) {}
// Called when a summoned creature is despawned
void SummonedCreatureDespawn(Creature*) {}
// Called when hit by a spell
void SpellHit(Unit* caster, const SpellEntry *spell) {}
// Called when spell hits a target
void SpellHitTarget(Unit* target, const SpellEntry *spell) {}
//Called at waypoint reached or PointMovement end
void MovementInform(uint32 type, uint32 id){}
// Called when AI is temporarily replaced or put back when possess is applied or removed
void OnPossess(bool apply) {}
//*************
// Variables
//*************
//Pointer to creature we are manipulating
Creature* m_creature;
//For fleeing
bool IsFleeing;
bool HeroicMode;
//*************
//Pure virtual functions
//*************
//Called at creature reset either by death or evade
void Reset() {}
//Called at creature aggro either by MoveInLOS or Attack Start
void EnterCombat(Unit* who) {}
//*************
//AI Helper Functions
//*************
//Start movement toward victim
void DoStartMovement(Unit* pVictim, float fDistance = 0, float fAngle = 0);
//Start no movement on victim
void DoStartNoMovement(Unit* pVictim);
//Stop attack of current victim
void DoStopAttack();
//Cast spell by spell info
void DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered = false);
//Plays a sound to all nearby players
void DoPlaySoundToSet(WorldObject* pSource, uint32 sound);
//Drops all threat to 0%. Does not remove players from the threat list
void DoResetThreat();
float DoGetThreat(Unit* u);
void DoModifyThreatPercent(Unit* pUnit, int32 pct);
void DoTeleportTo(float fX, float fY, float fZ, uint32 uiTime = 0);
void DoTeleportTo(const float pos[4]);
void DoAction(const int32 param) {}
//Teleports a player without dropping threat (only teleports to same map)
void DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, float fO);
void DoTeleportAll(float fX, float fY, float fZ, float fO);
//Returns friendly unit with the most amount of hp missing from max hp
Unit* DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff = 1);
//Returns a list of friendly CC'd units within range
std::list<Creature*> DoFindFriendlyCC(float fRange);
//Returns a list of all friendly units missing a specific buff within range
std::list<Creature*> DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId);
//Return a player with at least minimumRange from m_creature
Player* GetPlayerAtMinimumRange(float fMinimumRange);
//Spawns a creature relative to m_creature
Creature* DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime);
//Selects a unit from the creature's current aggro list
Unit* SelectUnit(SelectAggroTarget target, uint32 uiPosition);
bool HealthBelowPct(uint32 pct) const { return me->GetHealth() * 100 < m_creature->GetMaxHealth() * pct; }
//Returns spells that meet the specified criteria from the creatures spell list
SpellEntry const* SelectSpell(Unit* Target, int32 School, int32 Mechanic, SelectTargetType Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effect);
//Checks if you can cast the specified spell
bool CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered = false);
void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE);
//Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims
void SetCombatMovement(bool CombatMove);
bool IsCombatMovement() { return m_bCombatMovement; }
bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff);
private:
bool m_bCombatMovement;
uint32 m_uiEvadeCheckCooldown;
};
struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
{
Scripted_NoMovementAI(Creature* creature) : ScriptedAI(creature) {}
//Called at each attack of m_creature by any victim
void AttackStart(Unit* who);
};
struct TRINITY_DLL_DECL BossAI : public ScriptedAI
{
BossAI(Creature *c, uint32 id);
const uint32 bossId;
EventMap events;
SummonList summons;
InstanceData * const instance;
const BossBoundaryMap * const boundary;
void JustSummoned(Creature *summon);
void SummonedCreatureDespawn(Creature *summon);
void UpdateAI(const uint32 diff) = 0;
void Reset() { _Reset(); }
void EnterCombat(Unit *who) { _EnterCombat(); }
void JustDied(Unit *killer) { _JustDied(); }
void JustReachedHome() { me->setActive(false); }
protected:
void _Reset();
void _EnterCombat();
void _JustDied();
void _JustReachedHome() { me->setActive(false); }
bool CheckInRoom()
{
if(CheckBoundary(me))
@@ -221,11 +161,8 @@ struct TRINITY_DLL_DECL BossAI : public ScriptedAI
bool CheckBoundary(Unit *who);
void TeleportCheaters();
};
// SD2's grid searchers
//return closest creature alive in grid, with range from pSource
Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 Entry, float MaxSearchRange);
#endif
-24
View File
@@ -4,18 +4,14 @@
*
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_GOSSIP_H
#define SC_GOSSIP_H
#include "Player.h"
#include "GossipDef.h"
#include "QuestDef.h"
// Gossip Item Text
#define GOSSIP_TEXT_BROWSE_GOODS "I'd like to browse your goods."
#define GOSSIP_TEXT_TRAIN "Train me!"
#define GOSSIP_TEXT_BANK "The bank"
#define GOSSIP_TEXT_IRONFORGE_BANK "The bank of Ironforge"
#define GOSSIP_TEXT_STORMWIND_BANK "The bank of Stormwind"
@@ -39,14 +35,12 @@
#define GOSSIP_TEXT_CLASSTRAINER "A class trainer"
#define GOSSIP_TEXT_PROFTRAINER "A profession trainer"
#define GOSSIP_TEXT_LEXICON "Lexicon of Power"
#define GOSSIP_TEXT_ALTERACVALLEY "Alterac Valley"
#define GOSSIP_TEXT_ARATHIBASIN "Arathi Basin"
#define GOSSIP_TEXT_WARSONGULCH "Warsong Gulch"
#define GOSSIP_TEXT_ARENA "Arena"
#define GOSSIP_TEXT_EYEOFTHESTORM "Eye of The Storm"
#define GOSSIP_TEXT_STRANDOFANCIENT "Strand of the Ancients"
#define GOSSIP_TEXT_DEATH_KNIGHT "Death Knight"
#define GOSSIP_TEXT_DRUID "Druid"
#define GOSSIP_TEXT_HUNTER "Hunter"
@@ -57,7 +51,6 @@
#define GOSSIP_TEXT_SHAMAN "Shaman"
#define GOSSIP_TEXT_MAGE "Mage"
#define GOSSIP_TEXT_WARLOCK "Warlock"
#define GOSSIP_TEXT_ALCHEMY "Alchemy"
#define GOSSIP_TEXT_BLACKSMITHING "Blacksmithing"
#define GOSSIP_TEXT_COOKING "Cooking"
@@ -72,7 +65,6 @@
#define GOSSIP_TEXT_MINING "Mining"
#define GOSSIP_TEXT_FISHING "Fishing"
#define GOSSIP_TEXT_SKINNING "Skinning"
enum eTradeskill
{
// Skill defines
@@ -91,7 +83,6 @@ enum eTradeskill
TRADESKILL_SKINNING = 13,
TRADESKILL_JEWLCRAFTING = 14,
TRADESKILL_INSCRIPTION = 15,
TRADESKILL_LEVEL_NONE = 0,
TRADESKILL_LEVEL_APPRENTICE = 1,
TRADESKILL_LEVEL_JOURNEYMAN = 2,
@@ -99,7 +90,6 @@ enum eTradeskill
TRADESKILL_LEVEL_ARTISAN = 4,
TRADESKILL_LEVEL_MASTER = 5,
TRADESKILL_LEVEL_GRAND_MASTER = 6,
// Gossip defines
GOSSIP_ACTION_TRADE = 1,
GOSSIP_ACTION_TRAIN = 2,
@@ -114,7 +104,6 @@ enum eTradeskill
GOSSIP_ACTION_INN_INFO = 11,
GOSSIP_ACTION_UNLEARN = 12,
GOSSIP_ACTION_INFO_DEF = 1000,
GOSSIP_SENDER_MAIN = 1,
GOSSIP_SENDER_INN_INFO = 2,
GOSSIP_SENDER_INFO = 3,
@@ -126,11 +115,8 @@ enum eTradeskill
GOSSIP_SENDER_SEC_MAILBOX = 9,
GOSSIP_SENDER_SEC_STABLEMASTER = 10
};
extern uint32 GetSkillLevel(Player *player,uint32 skill);
// Defined fuctions to use with player.
// This fuction add's a menu item,
// a - Icon Id
// b - Text
@@ -140,10 +126,8 @@ extern uint32 GetSkillLevel(Player *player,uint32 skill);
// f - Money value in pop up box
#define ADD_GOSSIP_ITEM(a,b,c,d) PlayerTalkClass->GetGossipMenu().AddMenuItem(a,b,c,d,"",0)
#define ADD_GOSSIP_ITEM_EXTENDED(a,b,c,d,e,f,g) PlayerTalkClass->GetGossipMenu().AddMenuItem(a,b,c,d,e,f,g)
// This fuction Sends the current menu to show to client, a - NPCTEXTID(uint32) , b - npc guid(uint64)
#define SEND_GOSSIP_MENU(a,b) PlayerTalkClass->SendGossipMenu(a,b)
// This fuction shows POI(point of interest) to client.
// a - position X
// b - position Y
@@ -152,23 +136,19 @@ extern uint32 GetSkillLevel(Player *player,uint32 skill);
// e - Data
// f - Location Name
#define SEND_POI(a,b,c,d,e,f) PlayerTalkClass->SendPointOfInterest(a,b,c,d,e,f)
// Closes the Menu
#define CLOSE_GOSSIP_MENU() PlayerTalkClass->CloseGossip()
// Fuction to tell to client the details
// a - quest object
// b - npc guid(uint64)
// c - Activate accept(bool)
#define SEND_QUEST_DETAILS(a,b,c) PlayerTalkClass->SendQuestDetails(a,b,c)
// Fuction to tell to client the requested items to complete quest
// a - quest object
// b - npc guid(uint64)
// c - Iscompletable(bool)
// d - close at cancel(bool) - in case single incomplite ques
#define SEND_REQUESTEDITEMS(a,b,c,d) PlayerTalkClass->SendRequestedItems(a,b,c,d)
// Fuctions to send NPC lists, a - is always the npc guid(uint64)
#define SEND_VENDORLIST(a) GetSession()->SendListInventory(a)
#define SEND_TRAINERLIST(a) GetSession()->SendTrainerList(a)
@@ -176,16 +156,12 @@ extern uint32 GetSkillLevel(Player *player,uint32 skill);
#define SEND_TABARDLIST(a) GetSession()->SendTabardVendorActivate(a)
#define SEND_AUCTIONLIST(a) GetSession()->SendAuctionHello(a)
#define SEND_TAXILIST(a) GetSession()->SendTaxiStatus(a)
// Ressurect's the player if is dead.
#define SEND_SPRESURRECT() GetSession()->SendSpiritResurrect()
// Get the player's honor rank.
#define GET_HONORRANK() GetHonorRank()
// -----------------------------------
// defined fuctions to use with Creature
#define QUEST_DIALOG_STATUS(a,b,c) GetSession()->getDialogStatus(a,b,c)
#endif
@@ -1,20 +1,15 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef SC_INSTANCE_H
#define SC_INSTANCE_H
#include "InstanceData.h"
#include "Map.h"
#define OUT_SAVE_INST_DATA debug_log("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
#define OUT_SAVE_INST_DATA_COMPLETE debug_log("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
#define OUT_LOAD_INST_DATA(a) debug_log("TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
#define OUT_LOAD_INST_DATA_COMPLETE debug_log("TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
#define OUT_LOAD_INST_DATA_FAIL error_log("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
#define ScriptedInstance InstanceData
#endif
@@ -1,17 +1,13 @@
#include "precompiled.h"
#include "WorldPacket.h"
#define GOSSIP_FLIGHT "I need a ride"
bool GossipHello_npc_acherus_taxi(Player* pPlayer, Creature* pCreature)
{
pPlayer->SetTaxiCheater(true);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_acherus_taxi(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
@@ -19,18 +15,17 @@ bool GossipSelect_npc_acherus_taxi(Player* pPlayer, Creature* pCreature, uint32
if (pPlayer->GetPositionZ() >=316)
{
pPlayer->GetSession()->SendDoFlight(24446, 1053);
}else{
}
else
{
pPlayer->GetSession()->SendDoFlight(24446, 1054);
}
}
return true;
}
void AddSC_npc_acherus_taxi()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_acherus_taxi";
newscript->pGossipHello = &GossipHello_npc_acherus_taxi;
@@ -1,24 +1,19 @@
#include "precompiled.h"
#include "WorldPacket.h"
#define GOSSIP_UP "My Lord, I must go to the upper floor of the temple."
#define GOSSIP_DOWN "I would like to take a flight to the ground, Lord Afrasastrasz."
#define GOSSIP_MIDDLE "Can you spare a drake to travel to Lord Afrasastrasz, in the middle of the temple?"
#define GOSSIP_TOP "Please, Let me take one of these dragons to the top floor of the temple."
#define GOSSIP_BOTTOM "Yes, Please. I would like to return to the ground floor of the temple."
#define GOSSIP_ONEDOWN "I would like to see Lord Afrasastrasz, in the middle of the temple."
bool GossipHello_npc_wyrmresttempel_middle_taxi(Player* pPlayer, Creature* pCreature)
{
pPlayer->SetTaxiCheater(true);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(12887, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_wyrmresttempel_middle_taxi(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
@@ -26,28 +21,21 @@ bool GossipSelect_npc_wyrmresttempel_middle_taxi(Player* pPlayer, Creature* pCre
pPlayer->GetSession()->SendDoFlight(6376, 881);
}
if (uiAction == GOSSIP_ACTION_INFO_DEF + 2)
{
pPlayer->GetSession()->SendDoFlight(6376, 882);
}
return true;
}
bool GossipHello_npc_wyrmresttempel_bottom_taxi(Player* pPlayer, Creature* pCreature)
{
pPlayer->SetTaxiCheater(true);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TOP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MIDDLE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(12713, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_wyrmresttempel_bottom_taxi(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 4)
@@ -55,62 +43,48 @@ bool GossipSelect_npc_wyrmresttempel_bottom_taxi(Player* pPlayer, Creature* pCre
pPlayer->GetSession()->SendDoFlight(6376, 878);
}
if (uiAction == GOSSIP_ACTION_INFO_DEF + 3)
{
pPlayer->GetSession()->SendDoFlight(6376, 883);
}
return true;
}
bool GossipHello_npc_wyrmresttempel_top_taxi(Player* pPlayer, Creature* pCreature)
{
pPlayer->SetTaxiCheater(true);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BOTTOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ONEDOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
pPlayer->SEND_GOSSIP_MENU(12714, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_wyrmresttempel_top_taxi(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 5)
{
pPlayer->GetSession()->SendDoFlight(6376, 879);
}
if (uiAction == GOSSIP_ACTION_INFO_DEF + 6)
{
pPlayer->GetSession()->SendDoFlight(6376, 880);
}
return true;
}
void AddSC_npc_wyrmresttempel_taxi()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_wyrmresttempelmiddle_taxi";
newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_middle_taxi;
newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_middle_taxi;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_wyrmresttempelbottom_taxi";
newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_bottom_taxi;
newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_bottom_taxi;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_wyrmresttempeltop_taxi";
newscript->pGossipHello = &GossipHello_npc_wyrmresttempel_top_taxi;
newscript->pGossipSelect = &GossipSelect_npc_wyrmresttempel_top_taxi;
newscript->RegisterSelf();
}
@@ -1,89 +1,68 @@
#include "precompiled.h"
#include <cstring>
//This function is called when the player logs in (every login)
void OnLogin(Player *pPlayer)
{
}
//This function is called when the player logs out
void OnLogout(Player *pPlayer)
{
}
//This function is called when the player kills another player
void OnPVPKill(Player *killer, Player *killed)
{
}
//This function is called when a players AreaID changes
void OnAreaChange(Player *pPlayer, AreaTableEntry const *pArea)
{
}
//This is called when a player kills a creature (non pvp)
void OnCreatureKill(Player *pPlayer, Creature *pCreature)
{
}
//This function is called when a player has a money exchange
int32 OnGetMoney(Player *pPlayer, int32 amount)
{
return amount;
}
//This function is called whenever a player gets XP
uint32 OnGetXP(Player *pPlayer, uint32 amount)
{
return amount;
}
//This function is called when a player clicks a GO Object
bool OnGoClick(Player *pPlayer, GameObject *pGameObject)
{
return true;
}
//This function is called when a player clicks and item
bool OnItemClick(Player *pPlayer, Item *pItem)
{
return true;
}
//This function is called when a player opens an item (like a clam)
bool OnItemOpen(Player *pPlayer, Item *pItem)
{
return true;
}
//This function is called when a player sends a chat message
bool OnPlayerChat(Player *pPlayer, const char *text)
{
return true;
}
//this function is called when the server starts
void OnServerStartup()
{
}
//this function is called when the server shuts down
void OnServerShutdown()
{
}
//this function is called when a player casts a spell
bool OnSpellCast(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, uint32 i, SpellEntry const *spell)
{
return true;
}
void AddSC_onevents()
{
Script *newscript;
@@ -103,6 +82,5 @@ bool OnSpellCast(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, ui
newscript->pOnServerShutdown = &OnServerShutdown;
newscript->pOnServerStartup = &OnServerStartup;
newscript->pOnSpellCast = &OnSpellCast;
newscript->RegisterSelf();
}
@@ -13,19 +13,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Alterac_Mountains
SD%Complete: 0
SDComment: Placeholder
SDCategory: Alterac Mountains
EndScriptData */
/* ContentData
EndContentData */
#include "precompiled.h"
/*void AddSC_alterac_mountains()
{
Script *newscript;
@@ -13,25 +13,20 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Arathi Highlands
SD%Complete: 100
SDComment: Quest support: 665
SDCategory: Arathi Highlands
EndScriptData */
/* ContentData
npc_professor_phizzlethorpe
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*######
## npc_professor_phizzlethorpe
######*/
enum eEnums
{
SAY_PROGRESS_1 = -1000235,
@@ -44,22 +39,17 @@ enum eEnums
SAY_PROGRESS_7 = -1000242,
EMOTE_PROGRESS_8 = -1000243,
SAY_PROGRESS_9 = -1000244,
QUEST_SUNKEN_TREASURE = 665,
MOB_VENGEFUL_SURGE = 2776
};
struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
{
npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {}
void WaypointReached(uint32 uiPointId)
{
Player* pPlayer = GetPlayerForEscort();
if (!pPlayer)
return;
switch(uiPointId)
{
case 4:DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer);break;
@@ -85,23 +75,19 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
break;
}
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->AI()->AttackStart(m_creature);
}
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
if (pQuest->GetQuestId() == QUEST_SUNKEN_TREASURE)
@@ -109,21 +95,17 @@ bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreatur
DoScriptText(SAY_PROGRESS_1, pCreature, pPlayer);
if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (pCreature->AI())))
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
pCreature->setFaction(113);
}
return true;
}
CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature* pCreature)
{
return new npc_professor_phizzlethorpeAI(pCreature);
}
void AddSC_arathi_highlands()
{
Script * newscript;
newscript = new Script;
newscript->Name = "npc_professor_phizzlethorpe";
newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI;
@@ -1,6 +1,5 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@@ -14,14 +13,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Blackrock_Depths
SD%Complete: 95
SDComment: Quest support: 4001, 4342, 7604, 4322. Vendor Lokhtos Darkbargainer. Need to rewrite the Jail Break support
SDCategory: Blackrock Depths
EndScriptData */
/* ContentData
go_shadowforge_brazier
at_ring_of_law
@@ -35,15 +32,12 @@ npc_marshal_reginald_windsor
npc_tobias_seecher
npc_rocknot
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
#include "def_blackrock_depths.h"
/*######
+## go_shadowforge_brazier
+######*/
bool GOHello_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo)
{
if (ScriptedInstance* pInstance = pGo->GetInstanceData())
@@ -55,20 +49,16 @@ bool GOHello_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo)
}
return false;
}
/*######
## npc_grimstone
######*/
enum eGrimstone
{
NPC_GRIMSTONE = 10096,
NPC_THELDREN = 16059,
//4 or 6 in total? 1+2+1 / 2+2+2 / 3+3. Depending on this, code should be changed.
MAX_MOB_AMOUNT = 4
};
uint32 RingMob[]=
{
8925, // Dredge Worm
@@ -78,7 +68,6 @@ uint32 RingMob[]=
8933, // Cave Creeper
8932, // Borer Beetle
};
uint32 RingBoss[]=
{
9027, // Gorosh
@@ -88,33 +77,27 @@ uint32 RingBoss[]=
9031, // Anub'shiah
9032, // Hedrum
};
bool AreaTrigger_at_ring_of_law(Player* pPlayer, AreaTriggerEntry *at)
{
if (ScriptedInstance* pInstance = pPlayer->GetInstanceData())
{
if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE)
return false;
pInstance->SetData(TYPE_RING_OF_LAW,IN_PROGRESS);
pPlayer->SummonCreature(NPC_GRIMSTONE,625.559,-205.618,-52.735,2.609,TEMPSUMMON_DEAD_DESPAWN,0);
return false;
}
return false;
}
/*######
## npc_grimstone
######*/
#define SCRIPT_TEXT1 -1000000
#define SCRIPT_TEXT2 -1000000
#define SCRIPT_TEXT3 -1000000
#define SCRIPT_TEXT4 -1000000
#define SCRIPT_TEXT5 -1000000
#define SCRIPT_TEXT6 -1000000
//TODO: implement quest part of event (different end boss)
struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
{
@@ -123,60 +106,43 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
pInstance = c->GetInstanceData();
MobSpawnId = rand()%6;
}
ScriptedInstance* pInstance;
uint8 EventPhase;
uint32 Event_Timer;
uint8 MobSpawnId;
uint8 MobCount;
uint32 MobDeath_Timer;
uint64 RingMobGUID[4];
uint64 RingBossGUID;
bool CanWalk;
void Reset()
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
EventPhase = 0;
Event_Timer = 1000;
MobCount = 0;
MobDeath_Timer = 0;
for(uint8 i = 0; i < MAX_MOB_AMOUNT; ++i)
for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i)
RingMobGUID[i] = 0;
RingBossGUID = 0;
CanWalk = false;
}
//TODO: move them to center
void SummonRingMob()
{
if (Creature* tmp = m_creature->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0))
RingMobGUID[MobCount] = tmp->GetGUID();
++MobCount;
if (MobCount == MAX_MOB_AMOUNT)
MobDeath_Timer = 2500;
}
//TODO: move them to center
void SummonRingBoss()
{
if (Creature* tmp = m_creature->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0))
RingBossGUID = tmp->GetGUID();
MobDeath_Timer = 2500;
}
void WaypointReached(uint32 i)
{
switch(i)
@@ -211,23 +177,19 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
break;
}
}
void HandleGameObject(uint32 id, bool open)
{
pInstance->HandleGameObject(pInstance->GetData64(id), open);
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (MobDeath_Timer)
{
if (MobDeath_Timer <= diff)
{
MobDeath_Timer = 2500;
if (RingBossGUID)
{
Creature *boss = Unit::GetCreature(*m_creature,RingBossGUID);
@@ -240,15 +202,13 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
}
return;
}
for(uint8 i = 0; i < MAX_MOB_AMOUNT; ++i)
for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i)
{
Creature *mob = Unit::GetCreature(*m_creature,RingMobGUID[i]);
if (mob && !mob->isAlive() && mob->isDead())
{
RingMobGUID[i] = 0;
--MobCount;
//seems all are gone, so set timer to continue and discontinue this
if (!MobCount)
{
@@ -259,7 +219,6 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
}
}else MobDeath_Timer -= diff;
}
if (Event_Timer)
{
if (Event_Timer <= diff)
@@ -327,53 +286,43 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
++EventPhase;
}else Event_Timer -= diff;
}
if (CanWalk)
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_grimstone(Creature* pCreature)
{
return new npc_grimstoneAI(pCreature);
}
/*######
## mob_phalanx
######*/
#define SPELL_THUNDERCLAP 8732
#define SPELL_FIREBALLVOLLEY 22425
#define SPELL_MIGHTYBLOW 14099
struct TRINITY_DLL_DECL mob_phalanxAI : public ScriptedAI
{
mob_phalanxAI(Creature *c) : ScriptedAI(c) {}
uint32 ThunderClap_Timer;
uint32 FireballVolley_Timer;
uint32 MightyBlow_Timer;
void Reset()
{
ThunderClap_Timer = 12000;
FireballVolley_Timer =0;
MightyBlow_Timer = 15000;
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//ThunderClap_Timer
if (ThunderClap_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
ThunderClap_Timer = 10000;
}else ThunderClap_Timer -= diff;
//FireballVolley_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
{
@@ -383,14 +332,12 @@ struct TRINITY_DLL_DECL mob_phalanxAI : public ScriptedAI
FireballVolley_Timer = 15000;
}else FireballVolley_Timer -= diff;
}
//MightyBlow_Timer
if (MightyBlow_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
MightyBlow_Timer = 10000;
}else MightyBlow_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -398,17 +345,13 @@ CreatureAI* GetAI_mob_phalanx(Creature* pCreature)
{
return new mob_phalanxAI (pCreature);
}
/*######
## npc_kharan_mighthammer
######*/
#define QUEST_4001 4001
#define QUEST_4342 4342
#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!"
#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!"
#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me."
#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more."
#define GOSSIP_ITEM_KHARAN_5 "So what happened?"
@@ -417,26 +360,20 @@ CreatureAI* GetAI_mob_phalanx(Creature* pCreature)
#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please."
#define GOSSIP_ITEM_KHARAN_9 "Indeed."
#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man."
bool GossipHello_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (pPlayer->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
if (pPlayer->GetTeam() == HORDE)
pPlayer->SEND_GOSSIP_MENU(2473, pCreature->GetGUID());
else
pPlayer->SEND_GOSSIP_MENU(2474, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -449,7 +386,6 @@ bool GossipSelect_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature, u
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
pPlayer->SEND_GOSSIP_MENU(2476, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
pPlayer->SEND_GOSSIP_MENU(2477, pCreature->GetGUID());
@@ -484,42 +420,33 @@ bool GossipSelect_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature, u
}
return true;
}
/*######
## npc_lokhtos_darkbargainer
######*/
#define ITEM_THRORIUM_BROTHERHOOD_CONTRACT 18628
#define ITEM_SULFURON_INGOT 17203
#define QUEST_A_BINDING_CONTRACT 7604
#define SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND 23059
#define GOSSIP_ITEM_SHOW_ACCESS "Show me what I have access to, Lothos."
#define GOSSIP_ITEM_GET_CONTRACT "Get Thorium Brotherhood Contract"
bool GossipHello_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pCreature->isVendor() && pPlayer->GetReputationRank(59) >= REP_FRIENDLY)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_ITEM_SHOW_ACCESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
if (pPlayer->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 &&
!pPlayer->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) &&
pPlayer->HasItemCount(ITEM_SULFURON_INGOT, 1))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
}
if (pPlayer->GetReputationRank(59) < REP_FRIENDLY)
pPlayer->SEND_GOSSIP_MENU(3673, pCreature->GetGUID());
else
pPlayer->SEND_GOSSIP_MENU(3677, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
@@ -529,23 +456,18 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature
}
if (uiAction == GOSSIP_ACTION_TRADE)
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
return true;
}
/*######
## npc_dughal_stormwing
######*/
#define QUEST_JAIL_BREAK 4322
#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!"
#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!"
/*
struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI
{
npc_dughal_stormwingAI(Creature *c) : npc_escortAI(c) {}
void WaypointReached(uint32 i)
{
switch(i)
@@ -560,10 +482,8 @@ struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI
break;
}
}
void EnterCombat(Unit* who) { }
void Reset() {}
void JustDied(Unit* killer)
{
if (IsBeingEscorted && killer == m_creature)
@@ -574,7 +494,6 @@ struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI
pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED);
}
}
void UpdateAI(const uint32 diff)
{
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
@@ -596,11 +515,9 @@ struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI
CreatureAI* GetAI_npc_dughal_stormwing(Creature* pCreature)
{
npc_dughal_stormwingAI* dughal_stormwingAI = new npc_dughal_stormwingAI(pCreature);
dughal_stormwingAI->AddWaypoint(0, 280.42,-82.86, -77.12,0);
dughal_stormwingAI->AddWaypoint(1, 287.64,-87.01, -76.79,0);
dughal_stormwingAI->AddWaypoint(2, 354.63,-64.95, -67.53,0);
return dughal_stormwingAI;
}
bool GossipHello_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature)
@@ -612,7 +529,6 @@ bool GossipHello_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature)
}
return true;
}
bool GossipSelect_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
@@ -628,7 +544,6 @@ bool GossipSelect_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature, uin
/*######
## npc_marshal_windsor
######*/
#define SAY_WINDSOR_AGGRO1 "You locked up the wrong Marshal. Prepare to be destroyed!"
#define SAY_WINDSOR_AGGRO2 "I bet you're sorry now, aren't you !?!!"
#define SAY_WINDSOR_AGGRO3 "You better hold me back $N or they are going to feel some prison house beatings."
@@ -639,7 +554,6 @@ bool GossipSelect_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature, uin
#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!"
#define SAY_WINDSOR_9 "Ah, there it is!"
#define MOB_ENTRY_REGINALD_WINDSOR 9682
Player* pPlayerStart;
/*
struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
@@ -648,7 +562,6 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
{
pInstance = c->GetInstanceData();
}
void WaypointReached(uint32 i)
{
switch(i)
@@ -693,7 +606,6 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
break;
}
}
void EnterCombat(Unit* who)
{
switch(rand()%3)
@@ -703,14 +615,11 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break;
}
}
void Reset() {}
void JustDied(Unit *slayer)
{
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED);
}
void UpdateAI(const uint32 diff)
{
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
@@ -744,7 +653,6 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
CreatureAI* GetAI_npc_marshal_windsor(Creature* pCreature)
{
npc_marshal_windsorAI* marshal_windsorAI = new npc_marshal_windsorAI(pCreature);
marshal_windsorAI->AddWaypoint(0, 316.336,-225.528, -77.7258,7000);
marshal_windsorAI->AddWaypoint(1, 316.336,-225.528, -77.7258,2000);
marshal_windsorAI->AddWaypoint(2, 322.96,-207.13, -77.87,0);
@@ -765,10 +673,8 @@ CreatureAI* GetAI_npc_marshal_windsor(Creature* pCreature)
marshal_windsorAI->AddWaypoint(17, 403.61,-51.71, -63.92,2000);
marshal_windsorAI->AddWaypoint(18, 403.61,-51.71, -63.92,1000);
marshal_windsorAI->AddWaypoint(19, 403.61,-51.71, -63.92,0);
return marshal_windsorAI;
}
bool QuestAccept_npc_marshal_windsor(Player* pPlayer, Creature* pCreature, Quest const *quest)
{
if (quest->GetQuestId() == 4322)
@@ -779,7 +685,6 @@ bool QuestAccept_npc_marshal_windsor(Player* pPlayer, Creature* pCreature, Quest
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS);
pCreature->setFaction(11);
}
}
return false;
}
@@ -787,7 +692,6 @@ bool QuestAccept_npc_marshal_windsor(Player* pPlayer, Creature* pCreature, Quest
/*######
## npc_marshal_reginald_windsor
######*/
#define SAY_REGINALD_WINDSOR_0_1 "Can you feel the power, $N??? It's time to ROCK!"
#define SAY_REGINALD_WINDSOR_0_2 "Now we just have to free Tobias and we can get out of here. This way!"
#define SAY_REGINALD_WINDSOR_5_1 "Open it."
@@ -804,7 +708,6 @@ bool QuestAccept_npc_marshal_windsor(Player* pPlayer, Creature* pCreature, Quest
#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring."
#define MOB_ENTRY_SHILL_DINGER 9678
#define MOB_ENTRY_CREST_KILLER 9680
int wp = 0;
/*
struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
@@ -812,7 +715,6 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c)
{
}
void WaypointReached(uint32 i)
{
wp=i;
@@ -870,12 +772,10 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
break;
}
}
void MoveInLineOfSight(Unit *who)
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
return;
if (who->GetTypeId() == TYPEID_PLAYER)
{
if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE)
@@ -889,7 +789,6 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
}
}
}
void EnterCombat(Unit* who)
{
switch(rand()%3)
@@ -900,12 +799,10 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
}
}
void Reset() {}
void JustDied(Unit *slayer)
{
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED);
}
void UpdateAI(const uint32 diff)
{
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
@@ -956,7 +853,6 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature* pCreature)
{
npc_marshal_reginald_windsorAI* marshal_reginald_windsorAI = new npc_marshal_reginald_windsorAI(pCreature);
marshal_reginald_windsorAI->AddWaypoint(0, 403.61,-52.71, -63.92,4000);
marshal_reginald_windsorAI->AddWaypoint(1, 403.61,-52.71, -63.92,4000);
marshal_reginald_windsorAI->AddWaypoint(2, 406.33,-54.87, -63.95,0);
@@ -992,23 +888,19 @@ CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature* pCreature)
marshal_reginald_windsorAI->AddWaypoint(32, 452.45,29.85, -70.37,7000);
marshal_reginald_windsorAI->AddWaypoint(33, 452.45,29.85, -70.37,10000);
marshal_reginald_windsorAI->AddWaypoint(34, 451.27,31.85, -70.07,0);
return marshal_reginald_windsorAI;
}
*/
/*######
## npc_tobias_seecher
######*/
#define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!"
/*
struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI
{
npc_tobias_seecherAI(Creature *c) :npc_escortAI(c) {}
void EnterCombat(Unit* who) { }
void Reset() {}
void JustDied(Unit* killer)
{
if (IsBeingEscorted && killer == m_creature)
@@ -1019,7 +911,6 @@ struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED);
}
}
void WaypointReached(uint32 i)
{
switch(i)
@@ -1035,7 +926,6 @@ struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI
break;
}
}
void UpdateAI(const uint32 diff)
{
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
@@ -1054,20 +944,16 @@ struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_tobias_seecher(Creature* pCreature)
{
npc_tobias_seecherAI* tobias_seecherAI = new npc_tobias_seecherAI(pCreature);
tobias_seecherAI->AddWaypoint(0, 549.21, -281.07, -75.27);
tobias_seecherAI->AddWaypoint(1, 554.39, -267.39, -73.68);
tobias_seecherAI->AddWaypoint(2, 533.59, -249.38, -67.04);
tobias_seecherAI->AddWaypoint(3, 519.44, -217.02, -59.34);
tobias_seecherAI->AddWaypoint(4, 506.55, -153.49, -62.34);
return tobias_seecherAI;
}
bool GossipHello_npc_tobias_seecher(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS)
@@ -1077,7 +963,6 @@ bool GossipHello_npc_tobias_seecher(Player* pPlayer, Creature* pCreature)
}
return true;
}
bool GossipSelect_npc_tobias_seecher(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
@@ -1090,47 +975,37 @@ bool GossipSelect_npc_tobias_seecher(Player* pPlayer, Creature* pCreature, uint3
return true;
}
*/
/*######
## npc_rocknot
######*/
#define SAY_GOT_BEER -1230000
#define SPELL_DRUNKEN_RAGE 14872
#define QUEST_ALE 4295
struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
{
npc_rocknotAI(Creature *c) : npc_escortAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 BreakKeg_Timer;
uint32 BreakDoor_Timer;
void Reset()
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
return;
BreakKeg_Timer = 0;
BreakDoor_Timer = 0;
}
void DoGo(uint32 id, uint32 state)
{
if (GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(id)))
pGo->SetGoState((GOState)state);
}
void WaypointReached(uint32 i)
{
if (!pInstance)
return;
switch(i)
{
case 1:
@@ -1151,12 +1026,10 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
break;
}
}
void UpdateAI(const uint32 diff)
{
if (!pInstance)
return;
if (BreakKeg_Timer)
{
if (BreakKeg_Timer <= diff)
@@ -1166,7 +1039,6 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
BreakDoor_Timer = 1000;
}else BreakKeg_Timer -= diff;
}
if (BreakDoor_Timer)
{
if (BreakDoor_Timer <= diff)
@@ -1174,44 +1046,33 @@ struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI
DoGo(DATA_GO_BAR_DOOR,2);
DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future
//spell by trap has effect61, this indicate the bar go hostile
if (Unit *tmp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_PHALANX)))
tmp->setFaction(14);
//for later, this event(s) has alot more to it.
//optionally, DONE can trigger bar to go hostile.
pInstance->SetData(TYPE_BAR,DONE);
BreakDoor_Timer = 0;
}else BreakDoor_Timer -= diff;
}
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_rocknot(Creature* pCreature)
{
return new npc_rocknotAI(pCreature);
}
bool ChooseReward_npc_rocknot(Player* pPlayer, Creature* pCreature, const Quest *_Quest, uint32 item)
{
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (!pInstance)
return true;
if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL)
return true;
if (_Quest->GetQuestId() == QUEST_ALE)
{
if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS)
pInstance->SetData(TYPE_BAR,IN_PROGRESS);
pInstance->SetData(TYPE_BAR,SPECIAL);
//keep track of amount in instance script, returns SPECIAL if amount ok and event in progress
if (pInstance->GetData(TYPE_BAR) == SPECIAL)
{
@@ -1221,44 +1082,35 @@ bool ChooseReward_npc_rocknot(Player* pPlayer, Creature* pCreature, const Quest
pEscortAI->Start(false, false);
}
}
return true;
}
/*######
##
######*/
void AddSC_blackrock_depths()
{
Script *newscript;
newscript = new Script;
newscript->Name = "go_shadowforge_brazier";
newscript->pGOHello = &GOHello_go_shadowforge_brazier;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "at_ring_of_law";
newscript->pAreaTrigger = &AreaTrigger_at_ring_of_law;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_grimstone";
newscript->GetAI = &GetAI_npc_grimstone;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_phalanx";
newscript->GetAI = &GetAI_mob_phalanx;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_kharan_mighthammer";
newscript->pGossipHello = &GossipHello_npc_kharan_mighthammer;
newscript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_lokhtos_darkbargainer";
newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer;
@@ -1271,26 +1123,22 @@ void AddSC_blackrock_depths()
newscript->pGossipSelect = &GossipSelect_npc_dughal_stormwing;
newscript->GetAI = &GetAI_npc_dughal_stormwing;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_tobias_seecher";
newscript->pGossipHello = &GossipHello_npc_tobias_seecher;
newscript->pGossipSelect = &GossipSelect_npc_tobias_seecher;
newscript->GetAI = &GetAI_npc_tobias_seecher;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_marshal_windsor";
newscript->pQuestAccept = &QuestAccept_npc_marshal_windsor;
newscript->GetAI = &GetAI_npc_marshal_windsor;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_marshal_reginald_windsor";
newscript->GetAI = &GetAI_npc_marshal_reginald_windsor;
newscript->RegisterSelf();
*/
newscript = new Script;
newscript->Name = "npc_rocknot";
newscript->GetAI = &GetAI_npc_rocknot;
@@ -13,37 +13,29 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Ambassador_Flamelash
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SPELL_FIREBLAST 15573
struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI
{
boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {}
uint32 FireBlast_Timer;
uint32 Spirit_Timer;
int Rand;
int RandX;
int RandY;
Creature* Summoned;
void Reset()
{
FireBlast_Timer = 2000;
Spirit_Timer = 24000;
}
void EnterCombat(Unit *who) {}
void SummonSpirits(Unit* victim)
{
Rand = rand()%10;
@@ -63,20 +55,17 @@ struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI
if (Summoned)
(Summoned->AI())->AttackStart(victim);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//FireBlast_Timer
if (FireBlast_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FIREBLAST);
FireBlast_Timer = 7000;
}else FireBlast_Timer -= diff;
//Spirit_Timer
if (Spirit_Timer < diff)
{
@@ -84,10 +73,8 @@ struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI
SummonSpirits(m_creature->getVictim());
SummonSpirits(m_creature->getVictim());
SummonSpirits(m_creature->getVictim());
Spirit_Timer = 30000;
}else Spirit_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -95,7 +82,6 @@ CreatureAI* GetAI_boss_ambassador_flamelash(Creature* pCreature)
{
return new boss_ambassador_flamelashAI (pCreature);
}
void AddSC_boss_ambassador_flamelash()
{
Script *newscript;
@@ -13,32 +13,26 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Anubshiah
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SPELL_SHADOWBOLT 17228
#define SPELL_CURSEOFTONGUES 15470
#define SPELL_CURSEOFWEAKNESS 17227
#define SPELL_DEMONARMOR 11735
#define SPELL_ENVELOPINGWEB 15471
struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
{
boss_anubshiahAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowBolt_Timer;
uint32 CurseOfTongues_Timer;
uint32 CurseOfWeakness_Timer;
uint32 DemonArmor_Timer;
uint32 EnvelopingWeb_Timer;
void Reset()
{
ShadowBolt_Timer = 7000;
@@ -47,24 +41,20 @@ struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
DemonArmor_Timer = 3000;
EnvelopingWeb_Timer = 16000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//ShadowBolt_Timer
if (ShadowBolt_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT);
ShadowBolt_Timer = 7000;
}else ShadowBolt_Timer -= diff;
//CurseOfTongues_Timer
if (CurseOfTongues_Timer < diff)
{
@@ -73,21 +63,18 @@ struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
if (target) DoCast(target,SPELL_CURSEOFTONGUES);
CurseOfTongues_Timer = 18000;
}else CurseOfTongues_Timer -= diff;
//CurseOfWeakness_Timer
if (CurseOfWeakness_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
CurseOfWeakness_Timer = 45000;
}else CurseOfWeakness_Timer -= diff;
//DemonArmor_Timer
if (DemonArmor_Timer < diff)
{
DoCast(m_creature,SPELL_DEMONARMOR);
DemonArmor_Timer = 300000;
}else DemonArmor_Timer -= diff;
//EnvelopingWeb_Timer
if (EnvelopingWeb_Timer < diff)
{
@@ -96,7 +83,6 @@ struct TRINITY_DLL_DECL boss_anubshiahAI : public ScriptedAI
if (target) DoCast(target,SPELL_ENVELOPINGWEB);
EnvelopingWeb_Timer = 12000;
}else EnvelopingWeb_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -104,7 +90,6 @@ CreatureAI* GetAI_boss_anubshiah(Creature* pCreature)
{
return new boss_anubshiahAI (pCreature);
}
void AddSC_boss_anubshiah()
{
Script *newscript;
@@ -13,59 +13,47 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Emperor_Dagran_Thaurissan
SD%Complete: 99
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SAY_AGGRO -1230001
#define SAY_SLAY -1230002
#define SPELL_HANDOFTHAURISSAN 17492
#define SPELL_AVATAROFFLAME 15636
struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
{
boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {}
uint32 HandOfThaurissan_Timer;
uint32 AvatarOfFlame_Timer;
//uint32 Counter;
void Reset()
{
HandOfThaurissan_Timer = 4000;
AvatarOfFlame_Timer = 25000;
//Counter= 0;
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
m_creature->CallForHelp(VISIBLE_RANGE);
}
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_SLAY, m_creature);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (HandOfThaurissan_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_HANDOFTHAURISSAN);
//3 Hands of Thaurissan will be casted
//if (Counter < 3)
//{
@@ -78,23 +66,19 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI
//Counter=0;
//}
}else HandOfThaurissan_Timer -= diff;
//AvatarOfFlame_Timer
if (AvatarOfFlame_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_AVATAROFFLAME);
AvatarOfFlame_Timer = 18000;
}else AvatarOfFlame_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_draganthaurissan(Creature* pCreature)
{
return new boss_draganthaurissanAI (pCreature);
}
void AddSC_boss_draganthaurissan()
{
Script *newscript;
@@ -13,24 +13,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_General_Angerforge
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SPELL_MIGHTYBLOW 14099
#define SPELL_HAMSTRING 9080
#define SPELL_CLEAVE 20691
struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
{
boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {}
uint32 MightyBlow_Timer;
uint32 HamString_Timer;
uint32 Cleave_Timer;
@@ -44,7 +39,6 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
int Rand2Y;
Creature* SummonedAdds;
Creature* SummonedMedics;
void Reset()
{
MightyBlow_Timer = 8000;
@@ -53,11 +47,9 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
Adds_Timer = 0;
Medics = false;
}
void EnterCombat(Unit *who)
{
}
void SummonAdds(Unit* victim)
{
Rand1 = rand()%15;
@@ -78,7 +70,6 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
if (SummonedAdds)
(SummonedAdds->AI())->AttackStart(victim);
}
void SummonMedics(Unit* victim)
{
Rand2 = rand()%10;
@@ -99,34 +90,29 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
if (SummonedMedics)
(SummonedMedics->AI())->AttackStart(victim);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//MightyBlow_Timer
if (MightyBlow_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
MightyBlow_Timer = 18000;
}else MightyBlow_Timer -= diff;
//HamString_Timer
if (HamString_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
HamString_Timer = 15000;
}else HamString_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 9000;
}else Cleave_Timer -= diff;
//Adds_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
{
@@ -136,11 +122,9 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
Adds_Timer = 25000;
} else Adds_Timer -= diff;
}
//Summon Medics
if (!Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
{
@@ -148,7 +132,6 @@ struct TRINITY_DLL_DECL boss_general_angerforgeAI : public ScriptedAI
SummonMedics(m_creature->getVictim());
Medics = true;
}
DoMeleeAttackIfReady();
}
};
@@ -156,7 +139,6 @@ CreatureAI* GetAI_boss_general_angerforge(Creature* pCreature)
{
return new boss_general_angerforgeAI (pCreature);
}
void AddSC_boss_general_angerforge()
{
Script *newscript;
@@ -13,56 +13,45 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Gorosh_the_Dervish
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SPELL_WHIRLWIND 15589
#define SPELL_MORTALSTRIKE 24573
struct TRINITY_DLL_DECL boss_gorosh_the_dervishAI : public ScriptedAI
{
boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {}
uint32 WhirlWind_Timer;
uint32 MortalStrike_Timer;
void Reset()
{
WhirlWind_Timer = 12000;
MortalStrike_Timer = 22000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//WhirlWind_Timer
if (WhirlWind_Timer < diff)
{
DoCast(m_creature,SPELL_WHIRLWIND);
WhirlWind_Timer = 15000;
}else WhirlWind_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
MortalStrike_Timer = 15000;
}else MortalStrike_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -70,7 +59,6 @@ CreatureAI* GetAI_boss_gorosh_the_dervish(Creature* pCreature)
{
return new boss_gorosh_the_dervishAI (pCreature);
}
void AddSC_boss_gorosh_the_dervish()
{
Script *newscript;
@@ -13,51 +13,40 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Grizzle
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define EMOTE_GENERIC_FRENZY_KILL -1000001
#define SPELL_GROUNDTREMOR 6524
#define SPELL_FRENZY 28371
struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI
{
boss_grizzleAI(Creature *c) : ScriptedAI(c) {}
uint32 GroundTremor_Timer;
uint32 Frenzy_Timer;
void Reset()
{
GroundTremor_Timer = 12000;
Frenzy_Timer =0;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//GroundTremor_Timer
if (GroundTremor_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_GROUNDTREMOR);
GroundTremor_Timer = 8000;
}else GroundTremor_Timer -= diff;
//Frenzy_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
{
@@ -65,11 +54,9 @@ struct TRINITY_DLL_DECL boss_grizzleAI : public ScriptedAI
{
DoCast(m_creature,SPELL_FRENZY);
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
Frenzy_Timer = 15000;
}else Frenzy_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
@@ -77,7 +64,6 @@ CreatureAI* GetAI_boss_grizzle(Creature* pCreature)
{
return new boss_grizzleAI (pCreature);
}
void AddSC_boss_grizzle()
{
Script *newscript;
@@ -13,30 +13,24 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_High_Interrogator_Gerstahn
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SPELL_SHADOWWORDPAIN 10894
#define SPELL_MANABURN 10876
#define SPELL_PSYCHICSCREAM 8122
#define SPELL_SHADOWSHIELD 22417
struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
{
boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowWordPain_Timer;
uint32 ManaBurn_Timer;
uint32 PsychicScream_Timer;
uint32 ShadowShield_Timer;
void Reset()
{
ShadowWordPain_Timer = 4000;
@@ -44,17 +38,14 @@ struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
PsychicScream_Timer = 32000;
ShadowShield_Timer = 8000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//ShadowWordPain_Timer
if (ShadowWordPain_Timer < diff)
{
@@ -63,7 +54,6 @@ struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
if (target)DoCast(target,SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = 7000;
}else ShadowWordPain_Timer -= diff;
//ManaBurn_Timer
if (ManaBurn_Timer < diff)
{
@@ -72,21 +62,18 @@ struct TRINITY_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI
if (target)DoCast(target,SPELL_MANABURN);
ManaBurn_Timer = 10000;
}else ManaBurn_Timer -= diff;
//PsychicScream_Timer
if (PsychicScream_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM);
PsychicScream_Timer = 30000;
}else PsychicScream_Timer -= diff;
//ShadowShield_Timer
if (ShadowShield_Timer < diff)
{
DoCast(m_creature,SPELL_SHADOWSHIELD);
ShadowShield_Timer = 25000;
}else ShadowShield_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -94,7 +81,6 @@ CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature* pCreature)
{
return new boss_high_interrogator_gerstahnAI (pCreature);
}
void AddSC_boss_high_interrogator_gerstahn()
{
Script *newscript;
@@ -13,49 +13,39 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Magmus
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SPELL_FIERYBURST 13900
#define SPELL_WARSTOMP 24375
struct TRINITY_DLL_DECL boss_magmusAI : public ScriptedAI
{
boss_magmusAI(Creature *c) : ScriptedAI(c) {}
uint32 FieryBurst_Timer;
uint32 WarStomp_Timer;
void Reset()
{
FieryBurst_Timer = 5000;
WarStomp_Timer =0;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//FieryBurst_Timer
if (FieryBurst_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FIERYBURST);
FieryBurst_Timer = 6000;
}else FieryBurst_Timer -= diff;
//WarStomp_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
{
@@ -65,7 +55,6 @@ struct TRINITY_DLL_DECL boss_magmusAI : public ScriptedAI
WarStomp_Timer = 8000;
}else WarStomp_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
@@ -73,7 +62,6 @@ CreatureAI* GetAI_boss_magmus(Creature* pCreature)
{
return new boss_magmusAI (pCreature);
}
void AddSC_boss_magmus()
{
Script *newscript;
@@ -13,27 +13,22 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Moira_Bronzbeard
SD%Complete: 90
SDComment: Healing of Emperor NYI
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#define SPELL_HEAL 10917
#define SPELL_RENEW 10929
#define SPELL_SHIELD 10901
#define SPELL_MINDBLAST 10947
#define SPELL_SHADOWWORDPAIN 10894
#define SPELL_SMITE 10934
struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI
{
boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {}
uint32 Heal_Timer;
uint32 MindBlast_Timer;
uint32 ShadowWordPain_Timer;
@@ -41,7 +36,6 @@ struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI
Unit* PlayerHolder;
Unit* Target;
bool Heal;
void Reset()
{
Target = NULL;
@@ -50,45 +44,38 @@ struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI
ShadowWordPain_Timer = 2000;
Smite_Timer = 8000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//MindBlast_Timer
if (MindBlast_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MINDBLAST);
MindBlast_Timer = 14000;
}else MindBlast_Timer -= diff;
//ShadowWordPain_Timer
if (ShadowWordPain_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = 18000;
}else ShadowWordPain_Timer -= diff;
//Smite_Timer
if (Smite_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SMITE);
Smite_Timer = 10000;
}else Smite_Timer -= diff;
}
};
CreatureAI* GetAI_boss_moira_bronzebeard(Creature* pCreature)
{
return new boss_moira_bronzebeardAI (pCreature);
}
void AddSC_boss_moira_bronzebeard()
{
Script *newscript;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Tomb_Of_Seven
SD%Complete: 90
SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event.
SDCategory: Blackrock Depths
EndScriptData */
#include "precompiled.h"
#include "def_blackrock_depths.h"
enum eEnums
{
SPELL_SMELT_DARK_IRON = 14891,
@@ -31,24 +28,19 @@ enum eEnums
QUEST_SPECTRAL_CHALICE = 4083,
SKILLPOINT_MIN = 230
};
#define GOSSIP_ITEM_TEACH_1 "Teach me the art of smelting dark iron"
#define GOSSIP_ITEM_TEACH_2 "Continue..."
#define GOSSIP_ITEM_TEACH_3 "[PH] Continue..."
#define GOSSIP_ITEM_TRIBUTE "I want to pay tribute"
bool GossipHello_boss_gloomrel(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 1 && pPlayer->GetSkillValue(SKILL_MINING) >= SKILLPOINT_MIN && !pPlayer->HasSpell(SPELL_SMELT_DARK_IRON))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 0 && pPlayer->GetSkillValue(SKILL_MINING) >= SKILLPOINT_MIN)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_boss_gloomrel(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -76,7 +68,6 @@ bool GossipSelect_boss_gloomrel(Player* pPlayer, Creature* pCreature, uint32 uiS
}
return true;
}
enum eSpells
{
SPELL_SHADOWBOLTVOLLEY = 15245,
@@ -85,14 +76,12 @@ enum eSpells
SPELL_DEMONARMOR = 13787,
SPELL_SUMMON_VOIDWALKERS = 15092
};
struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
{
boss_doomrelAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 ShadowVolley_Timer;
uint32 Immolate_Timer;
@@ -103,7 +92,6 @@ struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
int RandX;
int RandY;
Creature* Summoned;
void Reset()
{
ShadowVolley_Timer = 10000;
@@ -111,23 +99,18 @@ struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
CurseOfWeakness_Timer = 5000;
DemonArmor_Timer = 16000;
Voidwalkers = false;
m_creature->setFaction(FACTION_FRIEND);
// was set before event start, so set again
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
if (pInstance)
if (pInstance->GetData(DATA_GHOSTKILL) >= 7)
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
else
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void EnterCombat(Unit *who)
{
}
void EnterEvadeMode()
{
m_creature->RemoveAllAuras();
@@ -140,75 +123,61 @@ struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI
if (pInstance)
pInstance->SetData64(DATA_EVENSTARTER, 0);
}
void JustDied(Unit *who)
{
if (pInstance)
pInstance->SetData(DATA_GHOSTKILL, 1);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//ShadowVolley_Timer
if (ShadowVolley_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY);
ShadowVolley_Timer = 12000;
}else ShadowVolley_Timer -= diff;
//Immolate_Timer
if (Immolate_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_IMMOLATE);
Immolate_Timer = 25000;
}else Immolate_Timer -= diff;
//CurseOfWeakness_Timer
if (CurseOfWeakness_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS);
CurseOfWeakness_Timer = 45000;
}else CurseOfWeakness_Timer -= diff;
//DemonArmor_Timer
if (DemonArmor_Timer < diff)
{
DoCast(m_creature,SPELL_DEMONARMOR);
DemonArmor_Timer = 300000;
}else DemonArmor_Timer -= diff;
//Summon Voidwalkers
if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
{
m_creature->CastSpell(m_creature->getVictim(), SPELL_SUMMON_VOIDWALKERS, true);
Voidwalkers = true;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_doomrel(Creature* pCreature)
{
return new boss_doomrelAI (pCreature);
}
#define GOSSIP_ITEM_CHALLENGE "Your bondage is at an end, Doom'rel. I challenge you!"
#define GOSSIP_SELECT_DOOMREL "[PH] Continue..."
bool GossipHello_boss_doomrel(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(2601, pCreature->GetGUID());
return true;
}
bool GossipSelect_boss_doomrel(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -230,17 +199,14 @@ bool GossipSelect_boss_doomrel(Player* pPlayer, Creature* pCreature, uint32 uiSe
}
return true;
}
void AddSC_boss_tomb_of_seven()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_gloomrel";
newscript->pGossipHello = &GossipHello_boss_gloomrel;
newscript->pGossipSelect = &GossipSelect_boss_gloomrel;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_doomrel";
newscript->GetAI = &GetAI_boss_doomrel;
@@ -1,14 +1,11 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_BRD_H
#define DEF_BRD_H
#define FACTION_NEUTRAL 734
#define FACTION_HOSTILE 754
#define FACTION_FRIEND 35
enum eTypes
{
TYPE_RING_OF_LAW = 1,
@@ -17,20 +14,16 @@ enum eTypes
TYPE_TOMB_OF_SEVEN = 4,
TYPE_LYCEUM = 5,
TYPE_IRON_HALL = 6,
DATA_EMPEROR = 10,
DATA_PHALANX = 11,
DATA_ARENA1 = 12,
DATA_ARENA2 = 13,
DATA_ARENA3 = 14,
DATA_ARENA4 = 15,
DATA_GO_BAR_KEG = 16,
DATA_GO_BAR_KEG_TRAP = 17,
DATA_GO_BAR_DOOR = 18,
DATA_GO_CHALICE = 19,
DATA_GHOSTKILL = 20,
DATA_EVENSTARTER = 21
};
@@ -13,14 +13,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Blackrock_Depths
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
/*
update `creature_template` set `npcflag`='1',`ScriptName`='npc_dughal_stormwing' where `entry`='9022';
update `creature_template` set `ScriptName`='npc_marshal_windsor' where `entry`='9023';
@@ -28,16 +26,12 @@ update `creature_template` set `ScriptName`='npc_marshal_reginald_windsor' where
update `creature_template` set `npcflag`='1',`ScriptName`='npc_tobias_seecher' where `entry`='9679';
update `instance_template` set `script`='instance_blackrock_depths' where `map`='230';
*/
#include "precompiled.h"
#include "def_blackrock_depths.h"
#define TIMER_TOMBOFTHESEVEN 15000
enum eEnums
{
MAX_ENCOUNTER = 6,
NPC_EMPEROR = 9019,
NPC_PHALANX = 9502,
NPC_ANGERREL = 9035,
@@ -47,7 +41,6 @@ enum eEnums
NPC_SEETHREL = 9038,
NPC_GLOOMREL = 9037,
NPC_DOOMREL = 9039,
GO_ARENA1 = 161525,
GO_ARENA2 = 161522,
GO_ARENA3 = 161524,
@@ -65,21 +58,16 @@ enum eEnums
GO_GOLEM_ROOM_N = 170573,
GO_GOLEM_ROOM_S = 170574,
GO_THONE_ROOM = 170575,
GO_SPECTRAL_CHALICE = 164869,
GO_CHEST_SEVEN = 169243
};
struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
{
instance_blackrock_depths(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
uint64 EmperorGUID;
uint64 PhalanxGUID;
uint64 GoArena1GUID;
uint64 GoArena2GUID;
uint64 GoArena3GUID;
@@ -98,21 +86,17 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
uint64 GoGolemSGUID;
uint64 GoThoneGUID;
uint64 GoChestGUID;
uint32 BarAleCount;
uint32 GhostKillCount;
uint64 TombBossGUIDs[7];
uint64 TombEventStarterGUID;
uint32 TombTimer;
uint32 TombEventCounter;
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
EmperorGUID = 0;
PhalanxGUID = 0;
GoArena1GUID = 0;
GoArena2GUID = 0;
GoArena3GUID = 0;
@@ -131,17 +115,14 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
GoGolemSGUID = 0;
GoThoneGUID = 0;
GoChestGUID = 0;
BarAleCount = 0;
GhostKillCount = 0;
TombEventStarterGUID = 0;
TombTimer = TIMER_TOMBOFTHESEVEN;
TombEventCounter = 0;
for(uint8 i = 0; i < 7; ++i)
for (uint8 i = 0; i < 7; ++i)
TombBossGUIDs[i] = 0;
}
void OnCreatureCreate(Creature* pCreature, bool add)
{
switch(pCreature->GetEntry())
@@ -157,7 +138,6 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
case NPC_ANGERREL: TombBossGUIDs[6] = pCreature->GetGUID(); break;
}
}
void OnGameObjectCreate(GameObject* pGo, bool add)
{
switch(pGo->GetEntry())
@@ -188,11 +168,9 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
case GO_CHEST_SEVEN: GoChestGUID = pGo->GetGUID(); break;
}
}
void SetData64(uint32 type, uint64 data)
{
debug_log("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data);
switch(type)
{
case DATA_EVENSTARTER:
@@ -204,11 +182,9 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
break;
}
}
void SetData(uint32 type, uint32 data)
{
debug_log("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
switch(type)
{
case TYPE_RING_OF_LAW:
@@ -236,22 +212,17 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
GhostKillCount += data;
break;
}
if (data == DONE || GhostKillCount >= 7)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << GhostKillCount;
str_data = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
uint32 GetData(uint32 type)
{
switch(type)
@@ -276,7 +247,6 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
}
return 0;
}
uint64 GetData64(uint32 data)
{
switch(data)
@@ -304,12 +274,10 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
}
return 0;
}
std::string GetSaveData()
{
return str_data;
}
void Load(const char* in)
{
if (!in)
@@ -317,24 +285,19 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream loadStream(in);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
>> m_auiEncounter[4] >> m_auiEncounter[5] >> GhostKillCount;
for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
if (GhostKillCount > 0 && GhostKillCount < 7)
GhostKillCount = 0;//reset tomb of seven event
if (GhostKillCount > 7)
GhostKillCount = 7;
OUT_LOAD_INST_DATA_COMPLETE;
}
void TombOfSevenEvent()
{
if (GhostKillCount < 7 && TombBossGUIDs[TombEventCounter])
@@ -348,12 +311,11 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
}
}
}
void TombOfSevenReset()
{
HandleGameObject(GoTombExitGUID,false);//event reseted, close exit door
HandleGameObject(GoTombEnterGUID,true);//event reseted, open entrance door
for(uint8 i = 0; i < 7; ++i)
for (uint8 i = 0; i < 7; ++i)
{
if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
{
@@ -376,14 +338,12 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
TombTimer = TIMER_TOMBOFTHESEVEN;
SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED);
}
void TombOfSevenStart()
{
HandleGameObject(GoTombExitGUID,false);//event started, close exit door
HandleGameObject(GoTombEnterGUID,false);//event started, close entrance door
SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS);
}
void TombOfSevenEnd()
{
DoRespawnGameObject(GoChestGUID,DAY);
@@ -407,12 +367,10 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
TombOfSevenEnd();
}
};
InstanceData* GetInstanceData_instance_blackrock_depths(Map* pMap)
{
return new instance_blackrock_depths(pMap);
}
void AddSC_instance_blackrock_depths()
{
Script *newscript;
@@ -13,30 +13,24 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Drakkisath
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_FIRENOVA 23462
#define SPELL_CLEAVE 20691
#define SPELL_CONFLIGURATION 16805
#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility.
struct TRINITY_DLL_DECL boss_drakkisathAI : public ScriptedAI
{
boss_drakkisathAI(Creature *c) : ScriptedAI(c) {}
uint32 FireNova_Timer;
uint32 Cleave_Timer;
uint32 Confliguration_Timer;
uint32 Thunderclap_Timer;
void Reset()
{
FireNova_Timer = 6000;
@@ -44,45 +38,38 @@ struct TRINITY_DLL_DECL boss_drakkisathAI : public ScriptedAI
Confliguration_Timer = 15000;
Thunderclap_Timer = 17000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//FireNova_Timer
if (FireNova_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
FireNova_Timer = 10000;
}else FireNova_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 8000;
}else Cleave_Timer -= diff;
//Confliguration_Timer
if (Confliguration_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CONFLIGURATION);
Confliguration_Timer = 18000;
}else Confliguration_Timer -= diff;
//Thunderclap_Timer
if (Thunderclap_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
Thunderclap_Timer = 20000;
}else Thunderclap_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -90,7 +77,6 @@ CreatureAI* GetAI_boss_drakkisath(Creature* pCreature)
{
return new boss_drakkisathAI (pCreature);
}
void AddSC_boss_drakkisath()
{
Script *newscript;
@@ -13,24 +13,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Gyth
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_CORROSIVEACID 20667
#define SPELL_FREEZE 18763
#define SPELL_FLAMEBREATH 20712
struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
{
boss_gythAI(Creature *c) : ScriptedAI(c) {}
uint32 Aggro_Timer;
uint32 Dragons_Timer;
uint32 Orc_Timer;
@@ -39,7 +34,6 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
uint32 Flamebreath_Timer;
uint32 Line1Count;
uint32 Line2Count;
bool Event;
bool SummonedDragons;
bool SummonedOrcs;
@@ -47,7 +41,6 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
bool bAggro;
bool RootSelf;
Creature *SummonedCreature;
void Reset()
{
Dragons_Timer = 3000;
@@ -62,7 +55,6 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
SummonedRend = false;
bAggro = false;
RootSelf = false;
// how many times should the two lines of summoned creatures be spawned
// min 2 x 2, max 7 lines of attack in total
Line1Count = rand() % 4 + 2;
@@ -70,16 +62,13 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
Line2Count = rand() % (5 - Line1Count) + 2;
else
Line2Count = 2;
//Invisible for event start
m_creature->SetDisplayId(11686);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who)
{
}
void SummonCreatureWithRandomTarget(uint32 creatureId)
{
Unit* Summoned = m_creature->SummonCreature(creatureId, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
@@ -90,22 +79,18 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
Summoned->AddThreat(target, 1.0f);
}
}
void UpdateAI(const uint32 diff)
{
//char buf[200];
//Return since we have no target
if (!UpdateVictim())
return;
if (!RootSelf)
{
//m_creature->m_canMove = true;
DoCast(m_creature, 33356);
RootSelf = true;
}
if (!bAggro && Line1Count == 0 && Line2Count == 0)
{
if (Aggro_Timer < diff)
@@ -117,7 +102,6 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} else Aggro_Timer -= diff;
}
// Summon Dragon pack. 2 Dragons and 3 Whelps
if (!bAggro && !SummonedRend && Line1Count > 0)
{
@@ -132,7 +116,6 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
Dragons_Timer = 60000;
} else Dragons_Timer -= diff;
}
//Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps
if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0)
{
@@ -147,7 +130,6 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
Orc_Timer = 60000;
} else Orc_Timer -= diff;
}
// we take part in the fight
if (bAggro)
{
@@ -157,21 +139,18 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
CorrosiveAcid_Timer = 7000;
} else CorrosiveAcid_Timer -= diff;
// Freeze_Timer
if (Freeze_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FREEZE);
Freeze_Timer = 16000;
} else Freeze_Timer -= diff;
// Flamebreath_Timer
if (Flamebreath_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
Flamebreath_Timer = 10500;
} else Flamebreath_Timer -= diff;
//Summon Rend
if (!SummonedRend && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11
&& m_creature->GetHealth() > 0)
@@ -184,17 +163,14 @@ struct TRINITY_DLL_DECL boss_gythAI : public ScriptedAI
m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
SummonedRend = true;
}
DoMeleeAttackIfReady();
} // end if Aggro
}
};
CreatureAI* GetAI_boss_gyth(Creature* pCreature)
{
return new boss_gythAI (pCreature);
}
void AddSC_boss_gyth()
{
Script *newscript;
@@ -13,70 +13,57 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Halycon
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_CROWDPUMMEL 10887
#define SPELL_MIGHTYBLOW 14099
#define ADD_1X -169.839203
#define ADD_1Y -324.961395
#define ADD_1Z 64.401443
#define ADD_1O 3.124724
struct TRINITY_DLL_DECL boss_halyconAI : public ScriptedAI
{
boss_halyconAI(Creature *c) : ScriptedAI(c) {}
uint32 CrowdPummel_Timer;
uint32 MightyBlow_Timer;
bool Summoned;
void Reset()
{
CrowdPummel_Timer = 8000;
MightyBlow_Timer = 14000;
Summoned = false;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//CrowdPummel_Timer
if (CrowdPummel_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL);
CrowdPummel_Timer = 14000;
}else CrowdPummel_Timer -= diff;
//MightyBlow_Timer
if (MightyBlow_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW);
MightyBlow_Timer = 10000;
}else MightyBlow_Timer -= diff;
//Summon Gizrul
if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25)
{
m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
Summoned = true;
}
DoMeleeAttackIfReady();
}
};
@@ -84,7 +71,6 @@ CreatureAI* GetAI_boss_halycon(Creature* pCreature)
{
return new boss_halyconAI (pCreature);
}
void AddSC_boss_halycon()
{
Script *newscript;
@@ -13,16 +13,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Highlord_Omokk
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_WARSTOMP 24375
#define SPELL_CLEAVE 15579
#define SPELL_STRIKE 18368
@@ -30,11 +27,9 @@ EndScriptData */
#define SPELL_SUNDERARMOR 24317
#define SPELL_KNOCKAWAY 20686
#define SPELL_SLOW 22356
struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI
{
boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {}
uint32 WarStomp_Timer;
uint32 Cleave_Timer;
uint32 Strike_Timer;
@@ -42,7 +37,6 @@ struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI
uint32 SunderArmor_Timer;
uint32 KnockAway_Timer;
uint32 Slow_Timer;
void Reset()
{
WarStomp_Timer = 15000;
@@ -53,66 +47,56 @@ struct TRINITY_DLL_DECL boss_highlordomokkAI : public ScriptedAI
KnockAway_Timer = 18000;
Slow_Timer = 24000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//WarStomp_Timer
if (WarStomp_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
WarStomp_Timer = 14000;
}else WarStomp_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 8000;
}else Cleave_Timer -= diff;
//Strike_Timer
if (Strike_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_STRIKE);
Strike_Timer = 10000;
}else Strike_Timer -= diff;
//Rend_Timer
if (Rend_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_REND);
Rend_Timer = 18000;
}else Rend_Timer -= diff;
//SunderArmor_Timer
if (SunderArmor_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR);
SunderArmor_Timer = 25000;
}else SunderArmor_Timer -= diff;
//KnockAway_Timer
if (KnockAway_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
KnockAway_Timer = 12000;
}else KnockAway_Timer -= diff;
//Slow_Timer
if (Slow_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SLOW);
Slow_Timer = 18000;
}else Slow_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -120,7 +104,6 @@ CreatureAI* GetAI_boss_highlordomokk(Creature* pCreature)
{
return new boss_highlordomokkAI (pCreature);
}
void AddSC_boss_highlordomokk()
{
Script *newscript;
@@ -13,61 +13,49 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Mother_Smolderweb
SD%Complete: 100
SDComment: Uncertain how often mother's milk is casted
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_CRYSTALIZE 16104
#define SPELL_MOTHERSMILK 16468
#define SPELL_SUMMON_SPIRE_SPIDERLING 16103
struct TRINITY_DLL_DECL boss_mothersmolderwebAI : public ScriptedAI
{
boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {}
uint32 Crystalize_Timer;
uint32 MothersMilk_Timer;
void Reset()
{
Crystalize_Timer = 20000;
MothersMilk_Timer = 10000;
}
void EnterCombat(Unit *who) { }
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (m_creature->GetHealth() <= damage)
m_creature->CastSpell(m_creature,SPELL_SUMMON_SPIRE_SPIDERLING,true);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Crystalize_Timer
if (Crystalize_Timer < diff)
{
DoCast(m_creature,SPELL_CRYSTALIZE);
Crystalize_Timer = 15000;
}else Crystalize_Timer -= diff;
//MothersMilk_Timer
if (MothersMilk_Timer < diff)
{
DoCast(m_creature,SPELL_MOTHERSMILK);
MothersMilk_Timer = 5000+rand()%7500;
}else MothersMilk_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -75,7 +63,6 @@ CreatureAI* GetAI_boss_mothersmolderweb(Creature* pCreature)
{
return new boss_mothersmolderwebAI (pCreature);
}
void AddSC_boss_mothersmolderweb()
{
Script *newscript;
@@ -13,42 +13,34 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Overlord_Wyrmthalak
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_BLASTWAVE 11130
#define SPELL_SHOUT 23511
#define SPELL_CLEAVE 20691
#define SPELL_KNOCKAWAY 20686
#define ADD_1X -39.355381
#define ADD_1Y -513.456482
#define ADD_1Z 88.472046
#define ADD_1O 4.679872
#define ADD_2X -49.875881
#define ADD_2Y -511.896942
#define ADD_2Z 88.195160
#define ADD_2O 4.613114
struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
{
boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {}
uint32 BlastWave_Timer;
uint32 Shout_Timer;
uint32 Cleave_Timer;
uint32 Knockaway_Timer;
bool Summoned;
Creature *SummonedCreature;
void Reset()
{
BlastWave_Timer = 20000;
@@ -57,51 +49,43 @@ struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
Knockaway_Timer = 12000;
Summoned = false;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//BlastWave_Timer
if (BlastWave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
BlastWave_Timer = 20000;
}else BlastWave_Timer -= diff;
//Shout_Timer
if (Shout_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHOUT);
Shout_Timer = 10000;
}else Shout_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 7000;
}else Cleave_Timer -= diff;
//Knockaway_Timer
if (Knockaway_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY);
Knockaway_Timer = 14000;
}else Knockaway_Timer -= diff;
//Summon two Beserks
if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
if (SummonedCreature)
(SummonedCreature->AI())->AttackStart(target);
@@ -110,7 +94,6 @@ struct TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI
(SummonedCreature->AI())->AttackStart(target);
Summoned = true;
}
DoMeleeAttackIfReady();
}
};
@@ -118,7 +101,6 @@ CreatureAI* GetAI_boss_overlordwyrmthalak(Creature* pCreature)
{
return new boss_overlordwyrmthalakAI (pCreature);
}
void AddSC_boss_overlordwyrmthalak()
{
Script *newscript;
@@ -13,59 +13,48 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Pyroguard_Emberseer
SD%Complete: 100
SDComment: Event to activate Emberseer NYI
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_FIRENOVA 23462
#define SPELL_FLAMEBUFFET 23341
#define SPELL_PYROBLAST 17274
struct TRINITY_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI
{
boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {}
uint32 FireNova_Timer;
uint32 FlameBuffet_Timer;
uint32 PyroBlast_Timer;
void Reset()
{
FireNova_Timer = 6000;
FlameBuffet_Timer = 3000;
PyroBlast_Timer = 14000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//FireNova_Timer
if (FireNova_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
FireNova_Timer = 6000;
}else FireNova_Timer -= diff;
//FlameBuffet_Timer
if (FlameBuffet_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
FlameBuffet_Timer = 14000;
}else FlameBuffet_Timer -= diff;
//PyroBlast_Timer
if (PyroBlast_Timer < diff)
{
@@ -74,7 +63,6 @@ struct TRINITY_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI
if (target) DoCast(target,SPELL_PYROBLAST);
PyroBlast_Timer = 15000;
}else PyroBlast_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -82,7 +70,6 @@ CreatureAI* GetAI_boss_pyroguard_emberseer(Creature* pCreature)
{
return new boss_pyroguard_emberseerAI (pCreature);
}
void AddSC_boss_pyroguard_emberseer()
{
Script *newscript;
@@ -13,60 +13,49 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Quartmaster_Zigris
SD%Complete: 100
SDComment: Needs revision
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_SHOOT 16496
#define SPELL_STUNBOMB 16497
#define SPELL_HEALING_POTION 15504
#define SPELL_HOOKEDNET 15609
struct TRINITY_DLL_DECL boss_quatermasterzigrisAI : public ScriptedAI
{
boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {}
uint32 Shoot_Timer;
uint32 StunBomb_Timer;
//uint32 HelingPotion_Timer;
void Reset()
{
Shoot_Timer = 1000;
StunBomb_Timer = 16000;
//HelingPotion_Timer = 25000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Shoot_Timer
if (Shoot_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHOOT);
Shoot_Timer = 500;
}else Shoot_Timer -= diff;
//StunBomb_Timer
if (StunBomb_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_STUNBOMB);
StunBomb_Timer = 14000;
}else StunBomb_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -74,7 +63,6 @@ CreatureAI* GetAI_boss_quatermasterzigris(Creature* pCreature)
{
return new boss_quatermasterzigrisAI (pCreature);
}
void AddSC_boss_quatermasterzigris()
{
Script *newscript;
@@ -13,66 +13,54 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Rend_Blackhand
SD%Complete: 100
SDComment: Intro event NYI
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_WHIRLWIND 26038
#define SPELL_CLEAVE 20691
#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell
struct TRINITY_DLL_DECL boss_rend_blackhandAI : public ScriptedAI
{
boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {}
uint32 WhirlWind_Timer;
uint32 Cleave_Timer;
uint32 Thunderclap_Timer;
void Reset()
{
WhirlWind_Timer = 20000;
Cleave_Timer = 5000;
Thunderclap_Timer = 9000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//WhirlWind_Timer
if (WhirlWind_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_WHIRLWIND);
WhirlWind_Timer = 18000;
}else WhirlWind_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 10000;
}else Cleave_Timer -= diff;
//Thunderclap_Timer
if (Thunderclap_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
Thunderclap_Timer = 16000;
}else Thunderclap_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -80,7 +68,6 @@ CreatureAI* GetAI_boss_rend_blackhand(Creature* pCreature)
{
return new boss_rend_blackhandAI (pCreature);
}
void AddSC_boss_rend_blackhand()
{
Script *newscript;
@@ -13,54 +13,43 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Shadow_Hunter_Voshgajin
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_CURSEOFBLOOD 24673
#define SPELL_HEX 16708
#define SPELL_CLEAVE 20691
struct TRINITY_DLL_DECL boss_shadowvoshAI : public ScriptedAI
{
boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {}
uint32 CurseOfBlood_Timer;
uint32 Hex_Timer;
uint32 Cleave_Timer;
void Reset()
{
CurseOfBlood_Timer = 2000;
Hex_Timer = 8000;
Cleave_Timer = 14000;
//m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true);
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//CurseOfBlood_Timer
if (CurseOfBlood_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CURSEOFBLOOD);
CurseOfBlood_Timer = 45000;
}else CurseOfBlood_Timer -= diff;
//Hex_Timer
if (Hex_Timer < diff)
{
@@ -69,14 +58,12 @@ struct TRINITY_DLL_DECL boss_shadowvoshAI : public ScriptedAI
if (target) DoCast(target,SPELL_HEX);
Hex_Timer = 15000;
}else Hex_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 7000;
}else Cleave_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -84,7 +71,6 @@ CreatureAI* GetAI_boss_shadowvosh(Creature* pCreature)
{
return new boss_shadowvoshAI (pCreature);
}
void AddSC_boss_shadowvosh()
{
Script *newscript;
@@ -13,52 +13,42 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_The_Best
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_FLAMEBREAK 16785
#define SPELL_IMMOLATE 20294
#define SPELL_TERRIFYINGROAR 14100
struct TRINITY_DLL_DECL boss_thebeastAI : public ScriptedAI
{
boss_thebeastAI(Creature *c) : ScriptedAI(c) {}
uint32 Flamebreak_Timer;
uint32 Immolate_Timer;
uint32 TerrifyingRoar_Timer;
void Reset()
{
Flamebreak_Timer = 12000;
Immolate_Timer = 3000;
TerrifyingRoar_Timer = 23000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Flamebreak_Timer
if (Flamebreak_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FLAMEBREAK);
Flamebreak_Timer = 10000;
}else Flamebreak_Timer -= diff;
//Immolate_Timer
if (Immolate_Timer < diff)
{
@@ -67,14 +57,12 @@ struct TRINITY_DLL_DECL boss_thebeastAI : public ScriptedAI
if (target) DoCast(target,SPELL_IMMOLATE);
Immolate_Timer = 8000;
}else Immolate_Timer -= diff;
//TerrifyingRoar_Timer
if (TerrifyingRoar_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_TERRIFYINGROAR);
TerrifyingRoar_Timer = 20000;
}else TerrifyingRoar_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -82,7 +70,6 @@ CreatureAI* GetAI_boss_thebeast(Creature* pCreature)
{
return new boss_thebeastAI (pCreature);
}
void AddSC_boss_thebeast()
{
Script *newscript;
@@ -13,34 +13,28 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Warmaster_Voone
SD%Complete: 100
SDComment:
SDCategory: Blackrock Spire
EndScriptData */
#include "precompiled.h"
#define SPELL_SNAPKICK 15618
#define SPELL_CLEAVE 15579
#define SPELL_UPPERCUT 10966
#define SPELL_MORTALSTRIKE 16856
#define SPELL_PUMMEL 15615
#define SPELL_THROWAXE 16075
struct TRINITY_DLL_DECL boss_warmastervooneAI : public ScriptedAI
{
boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {}
uint32 Snapkick_Timer;
uint32 Cleave_Timer;
uint32 Uppercut_Timer;
uint32 MortalStrike_Timer;
uint32 Pummel_Timer;
uint32 ThrowAxe_Timer;
void Reset()
{
Snapkick_Timer = 8000;
@@ -50,59 +44,50 @@ struct TRINITY_DLL_DECL boss_warmastervooneAI : public ScriptedAI
Pummel_Timer = 32000;
ThrowAxe_Timer = 1000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//Snapkick_Timer
if (Snapkick_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SNAPKICK);
Snapkick_Timer = 6000;
}else Snapkick_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 12000;
}else Cleave_Timer -= diff;
//Uppercut_Timer
if (Uppercut_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_UPPERCUT);
Uppercut_Timer = 14000;
}else Uppercut_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
MortalStrike_Timer = 10000;
}else MortalStrike_Timer -= diff;
//Pummel_Timer
if (Pummel_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_PUMMEL);
Pummel_Timer = 16000;
}else Pummel_Timer -= diff;
//ThrowAxe_Timer
if (ThrowAxe_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_THROWAXE);
ThrowAxe_Timer = 8000;
}else ThrowAxe_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -110,7 +95,6 @@ CreatureAI* GetAI_boss_warmastervoone(Creature* pCreature)
{
return new boss_warmastervooneAI (pCreature);
}
void AddSC_boss_warmastervoone()
{
Script *newscript;
@@ -13,33 +13,26 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Broodlord_Lashlayer
SD%Complete: 100
SDComment:
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define SAY_AGGRO -1469000
#define SAY_LEASH -1469001
#define SPELL_CLEAVE 26350
#define SPELL_BLASTWAVE 23331
#define SPELL_MORTALSTRIKE 24573
#define SPELL_KNOCKBACK 25778
struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
{
boss_broodlordAI(Creature *c) : ScriptedAI(c) {}
uint32 Cleave_Timer;
uint32 BlastWave_Timer;
uint32 MortalStrike_Timer;
uint32 KnockBack_Timer;
void Reset()
{
Cleave_Timer = 8000; //These times are probably wrong
@@ -47,52 +40,43 @@ struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
MortalStrike_Timer = 20000;
KnockBack_Timer = 30000;
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoZoneInCombat();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 7000;
}else Cleave_Timer -= diff;
// BlastWave
if (BlastWave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
BlastWave_Timer = 8000 + rand()%8000;
}else BlastWave_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE);
MortalStrike_Timer = 25000 + rand()%10000;
}else MortalStrike_Timer -= diff;
if (KnockBack_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_KNOCKBACK);
//Drop 50% aggro
if (DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(m_creature->getVictim(),-50);
KnockBack_Timer = 15000 + rand()%15000;
}else KnockBack_Timer -= diff;
if (EnterEvadeIfOutOfCombatArea(diff))
DoScriptText(SAY_LEASH, m_creature);
DoMeleeAttackIfReady();
}
};
@@ -100,7 +84,6 @@ CreatureAI* GetAI_boss_broodlord(Creature* pCreature)
{
return new boss_broodlordAI (pCreature);
}
void AddSC_boss_broodlord()
{
Script *newscript;
@@ -13,19 +13,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Chromaggus
SD%Complete: 95
SDComment: Chromatic Mutation disabled due to lack of core support
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define EMOTE_FRENZY -1469002
#define EMOTE_SHIMMER -1469003
//These spells are actually called elemental shield
//What they do is decrease all damage by 75% then they increase
//One school of damage by 1100%
@@ -34,13 +30,11 @@ EndScriptData */
#define SPELL_SHADOW_VURNALBILTY 22279
#define SPELL_NATURE_VURNALBILTY 22280
#define SPELL_ARCANE_VURNALBILTY 22281
#define SPELL_INCINERATE 23308 //Incinerate 23308,23309
#define SPELL_TIMELAPSE 23310 //Time lapse 23310, 23311(old threat mod that was removed in 2.01)
#define SPELL_CORROSIVEACID 23313 //Corrosive Acid 23313, 23314
#define SPELL_IGNITEFLESH 23315 //Ignite Flesh 23315,23316
#define SPELL_FROSTBURN 23187 //Frost burn 23187, 23189
//Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them
//Since Scripted spells arn't coded I'll just write a function that does the same thing
#define SPELL_BROODAF_BLUE 23153 //Blue affliction 23153
@@ -48,12 +42,9 @@ EndScriptData */
#define SPELL_BROODAF_RED 23155 //Red affliction 23155 (23168 on death)
#define SPELL_BROODAF_BRONZE 23170 //Bronze Affliction 23170
#define SPELL_BROODAF_GREEN 23169 //Brood Affliction Green 23169
#define SPELL_CHROMATIC_MUT_1 23174 //Spell cast on player if they get all 5 debuffs
#define SPELL_FRENZY 28371 //The frenzy spell may be wrong
#define SPELL_ENRAGE 28747
struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
{
boss_chromaggusAI(Creature *c) : ScriptedAI(c)
@@ -82,7 +73,6 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
Breath1_Spell = SPELL_INCINERATE;
Breath2_Spell = SPELL_FROSTBURN;
break;
//B1 - TL
case 4:
Breath1_Spell = SPELL_TIMELAPSE;
@@ -100,7 +90,6 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
Breath1_Spell = SPELL_TIMELAPSE;
Breath2_Spell = SPELL_FROSTBURN;
break;
//B1 - Acid
case 8:
Breath1_Spell = SPELL_CORROSIVEACID;
@@ -118,7 +107,6 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
Breath1_Spell = SPELL_CORROSIVEACID;
Breath2_Spell = SPELL_FROSTBURN;
break;
//B1 - Ignite
case 12:
Breath1_Spell = SPELL_IGNITEFLESH;
@@ -136,7 +124,6 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
Breath1_Spell = SPELL_IGNITEFLESH;
Breath2_Spell = SPELL_FROSTBURN;
break;
//B1 - Frost
case 16:
Breath1_Spell = SPELL_FROSTBURN;
@@ -155,50 +142,40 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
Breath2_Spell = SPELL_IGNITEFLESH;
break;
};
EnterEvadeMode();
}
uint32 Breath1_Spell;
uint32 Breath2_Spell;
uint32 CurrentVurln_Spell;
uint32 Shimmer_Timer;
uint32 Breath1_Timer;
uint32 Breath2_Timer;
uint32 Affliction_Timer;
uint32 Frenzy_Timer;
bool Enraged;
void Reset()
{
CurrentVurln_Spell = 0; //We use this to store our last vurlnability spell so we can remove it later
Shimmer_Timer = 0; //Time till we change vurlnerabilites
Breath1_Timer = 30000; //First breath is 30 seconds
Breath2_Timer = 60000; //Second is 1 minute so that we can alternate
Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds
Frenzy_Timer = 15000;
Enraged = false;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Shimmer_Timer Timer
if (Shimmer_Timer < diff)
{
//Remove old vurlnability spell
if (CurrentVurln_Spell)
m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell);
//Cast new random vurlnabilty on self
uint32 spell;
switch (rand()%5)
@@ -209,33 +186,27 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
case 3: spell = SPELL_NATURE_VURNALBILTY; break;
case 4: spell = SPELL_ARCANE_VURNALBILTY; break;
}
DoCast(m_creature,spell);
CurrentVurln_Spell = spell;
DoScriptText(EMOTE_SHIMMER, m_creature);
Shimmer_Timer = 45000;
}else Shimmer_Timer -= diff;
//Breath1_Timer
if (Breath1_Timer < diff)
{
DoCast(m_creature->getVictim(),Breath1_Spell);
Breath1_Timer = 60000;
}else Breath1_Timer -= diff;
//Breath2_Timer
if (Breath2_Timer < diff)
{
DoCast(m_creature->getVictim(),Breath2_Spell);
Breath2_Timer = 60000;
}else Breath2_Timer -= diff;
//Affliction_Timer
if (Affliction_Timer < diff)
{
uint32 SpellAfflict = 0;
switch (rand()%5)
{
case 0: SpellAfflict = SPELL_BROODAF_BLUE; break;
@@ -244,20 +215,16 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break;
case 4: SpellAfflict = SPELL_BROODAF_GREEN; break;
}
std::list<HostilReference*>::iterator i;
for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end();)
for (i = m_creature->getThreatManager().getThreatList().begin(); i != m_creature->getThreatManager().getThreatList().end(); )
{
Unit* pUnit = NULL;
pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
++i;
if (pUnit)
{
//Cast affliction
DoCast(pUnit, SpellAfflict, true);
//Chromatic mutation if target is effected by all afflictions
if (pUnit->HasAura(SPELL_BROODAF_BLUE)
&& pUnit->HasAura(SPELL_BROODAF_BLACK)
@@ -267,21 +234,17 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
{
//target->RemoveAllAuras();
//DoCast(target,SPELL_CHROMATIC_MUT_1);
//Chromatic mutation is causing issues
//Assuming it is caused by a lack of core support for Charm
//So instead we instant kill our target
//WORKAROUND
if (pUnit->GetTypeId() == TYPEID_PLAYER)
pUnit->CastSpell(pUnit, 5, false);
}
}
}
Affliction_Timer = 10000;
}else Affliction_Timer -= diff;
//Frenzy_Timer
if (Frenzy_Timer < diff)
{
@@ -289,14 +252,12 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
DoScriptText(EMOTE_FRENZY, m_creature);
Frenzy_Timer = 10000 + (rand() % 5000);
}else Frenzy_Timer -= diff;
//Enrage if not already enraged and below 20%
if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
{
DoCast(m_creature,SPELL_ENRAGE);
Enraged = true;
}
DoMeleeAttackIfReady();
}
};
@@ -304,7 +265,6 @@ CreatureAI* GetAI_boss_chromaggus(Creature* pCreature)
{
return new boss_chromaggusAI (pCreature);
}
void AddSC_boss_chromaggus()
{
Script *newscript;
@@ -13,30 +13,24 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Ebonroc
SD%Complete: 50
SDComment: Shadow of Ebonroc needs core support
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define SPELL_SHADOWFLAME 22539
#define SPELL_WINGBUFFET 18500
#define SPELL_SHADOWOFEBONROC 23340
#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow
struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
{
boss_ebonrocAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
uint32 ShadowOfEbonroc_Timer;
uint32 Heal_Timer;
void Reset()
{
ShadowFlame_Timer = 15000; //These times are probably wrong
@@ -44,38 +38,32 @@ struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
ShadowOfEbonroc_Timer = 45000;
Heal_Timer = 1000;
}
void EnterCombat(Unit *who)
{
DoZoneInCombat();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Shadowflame Timer
if (ShadowFlame_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
ShadowFlame_Timer = 12000 + rand()%3000;
}else ShadowFlame_Timer -= diff;
//Wing Buffet Timer
if (WingBuffet_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
WingBuffet_Timer = 25000;
}else WingBuffet_Timer -= diff;
//Shadow of Ebonroc Timer
if (ShadowOfEbonroc_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWOFEBONROC);
ShadowOfEbonroc_Timer = 25000 + rand()%10000;
}else ShadowOfEbonroc_Timer -= diff;
if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
{
if (Heal_Timer < diff)
@@ -84,7 +72,6 @@ struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
Heal_Timer = 1000 + rand()%2000;
}else Heal_Timer -= diff;
}
DoMeleeAttackIfReady();
}
};
@@ -92,7 +79,6 @@ CreatureAI* GetAI_boss_ebonroc(Creature* pCreature)
{
return new boss_ebonrocAI (pCreature);
}
void AddSC_boss_ebonroc()
{
Script *newscript;
@@ -13,69 +13,56 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Firemaw
SD%Complete: 100
SDComment:
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define SPELL_SHADOWFLAME 22539
#define SPELL_WINGBUFFET 23339
#define SPELL_FLAMEBUFFET 23341
struct TRINITY_DLL_DECL boss_firemawAI : public ScriptedAI
{
boss_firemawAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
uint32 FlameBuffet_Timer;
void Reset()
{
ShadowFlame_Timer = 30000; //These times are probably wrong
WingBuffet_Timer = 24000;
FlameBuffet_Timer = 5000;
}
void EnterCombat(Unit *who)
{
DoZoneInCombat();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//ShadowFlame_Timer
if (ShadowFlame_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
ShadowFlame_Timer = 15000 + rand()%3000;
}else ShadowFlame_Timer -= diff;
//WingBuffet_Timer
if (WingBuffet_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
if (DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(m_creature->getVictim(),-75);
WingBuffet_Timer = 25000;
}else WingBuffet_Timer -= diff;
//FlameBuffet_Timer
if (FlameBuffet_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET);
FlameBuffet_Timer = 5000;
}else FlameBuffet_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -83,7 +70,6 @@ CreatureAI* GetAI_boss_firemaw(Creature* pCreature)
{
return new boss_firemawAI (pCreature);
}
void AddSC_boss_firemaw()
{
Script *newscript;
@@ -13,64 +13,51 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Flamegor
SD%Complete: 100
SDComment:
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define EMOTE_FRENZY -1469031
#define SPELL_SHADOWFLAME 22539
#define SPELL_WINGBUFFET 23339
#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova
struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI
{
boss_flamegorAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowFlame_Timer;
uint32 WingBuffet_Timer;
uint32 Frenzy_Timer;
void Reset()
{
ShadowFlame_Timer = 21000; //These times are probably wrong
WingBuffet_Timer = 35000;
Frenzy_Timer = 10000;
}
void EnterCombat(Unit *who)
{
DoZoneInCombat();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//ShadowFlame_Timer
if (ShadowFlame_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
ShadowFlame_Timer = 15000 + rand()%7000;
}else ShadowFlame_Timer -= diff;
//WingBuffet_Timer
if (WingBuffet_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_WINGBUFFET);
if (DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(m_creature->getVictim(),-75);
WingBuffet_Timer = 25000;
}else WingBuffet_Timer -= diff;
//Frenzy_Timer
if (Frenzy_Timer < diff)
{
@@ -78,7 +65,6 @@ struct TRINITY_DLL_DECL boss_flamegorAI : public ScriptedAI
DoCast(m_creature,SPELL_FRENZY);
Frenzy_Timer = 8000 + (rand()%2000);
}else Frenzy_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -86,7 +72,6 @@ CreatureAI* GetAI_boss_flamegor(Creature* pCreature)
{
return new boss_flamegorAI (pCreature);
}
void AddSC_boss_flamegor()
{
Script *newscript;
@@ -13,23 +13,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Nefarian
SD%Complete: 80
SDComment: Some issues with class calls effecting more than one class
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define SAY_AGGRO -1469007
#define SAY_XHEALTH -1469008
#define SAY_SHADOWFLAME -1469009
#define SAY_RAISE_SKELETONS -1469010
#define SAY_SLAY -1469011
#define SAY_DEATH -1469012
#define SAY_MAGE -1469013
#define SAY_WARRIOR -1469014
#define SAY_DRUID -1469015
@@ -39,7 +35,6 @@ EndScriptData */
#define SAY_WARLOCK -1469019
#define SAY_HUNTER -1469020
#define SAY_ROGUE -1469021
#define SPELL_SHADOWFLAME_INITIAL 22972
#define SPELL_SHADOWFLAME 22539
#define SPELL_BELLOWINGROAR 22686
@@ -47,7 +42,6 @@ EndScriptData */
#define SPELL_CLEAVE 20691
#define SPELL_TAILLASH 23364
#define SPELL_BONECONTRUST 23363 //23362, 23361
#define SPELL_MAGE 23410 //wild magic
#define SPELL_WARRIOR 23397 //beserk
#define SPELL_DRUID 23398 // cat form
@@ -57,11 +51,9 @@ EndScriptData */
#define SPELL_WARLOCK 23427 //infernals
#define SPELL_HUNTER 23436 //bow broke
#define SPELL_ROGUE 23414 //Paralise
struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
{
boss_nefarianAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowFlame_Timer;
uint32 BellowingRoar_Timer;
uint32 VeilOfShadow_Timer;
@@ -69,9 +61,7 @@ struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
uint32 TailLash_Timer;
uint32 ClassCall_Timer;
bool Phase3;
uint32 DespawnTimer;
void Reset()
{
ShadowFlame_Timer = 12000; //These times are probably wrong
@@ -81,31 +71,24 @@ struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
TailLash_Timer = 10000;
ClassCall_Timer = 35000; //35-40 seconds
Phase3 = false;
DespawnTimer = 5000;
}
void KilledUnit(Unit* Victim)
{
if (rand()%5)
return;
DoScriptText(SAY_SLAY, m_creature, Victim);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
}
void EnterCombat(Unit *who)
{
DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), m_creature);
DoCast(who,SPELL_SHADOWFLAME_INITIAL);
DoZoneInCombat();
}
void UpdateAI(const uint32 diff)
{
if(DespawnTimer < diff)
@@ -114,54 +97,45 @@ struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
m_creature->ForcedDespawn();
DespawnTimer = 5000;
}else DespawnTimer -= diff;
if (!UpdateVictim())
return;
//ShadowFlame_Timer
if (ShadowFlame_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME);
ShadowFlame_Timer = 12000;
}else ShadowFlame_Timer -= diff;
//BellowingRoar_Timer
if (BellowingRoar_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR);
BellowingRoar_Timer = 30000;
}else BellowingRoar_Timer -= diff;
//VeilOfShadow_Timer
if (VeilOfShadow_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW);
VeilOfShadow_Timer = 15000;
}else VeilOfShadow_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 7000;
}else Cleave_Timer -= diff;
//TailLash_Timer
if (TailLash_Timer < diff)
{
//Cast NYI since we need a better check for behind target
//DoCast(m_creature->getVictim(),SPELL_TAILLASH);
TailLash_Timer = 10000;
}else TailLash_Timer -= diff;
//ClassCall_Timer
if (ClassCall_Timer < diff)
{
//Cast a random class call
//On official it is based on what classes are currently on the hostil list
//but we can't do that yet so just randomly call one
switch (rand()%9)
{
case 0:
@@ -201,17 +175,14 @@ struct TRINITY_DLL_DECL boss_nefarianAI : public ScriptedAI
DoCast(m_creature,SPELL_ROGUE);
break;
}
ClassCall_Timer = 35000 + (rand() % 5000);
}else ClassCall_Timer -= diff;
//Phase3 begins when we are below X health
if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
{
Phase3 = true;
DoScriptText(SAY_RAISE_SKELETONS, m_creature);
}
DoMeleeAttackIfReady();
}
};
@@ -219,7 +190,6 @@ CreatureAI* GetAI_boss_nefarian(Creature* pCreature)
{
return new boss_nefarianAI (pCreature);
}
void AddSC_boss_nefarian()
{
Script *newscript;
@@ -13,37 +13,29 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Razorgore
SD%Complete: 50
SDComment: Needs additional review. Phase 1 NYI (Grethok the Controller)
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
//Razorgore Phase 2 Script
#define SAY_EGGS_BROKEN1 -1469022
#define SAY_EGGS_BROKEN2 -1469023
#define SAY_EGGS_BROKEN3 -1469024
#define SAY_DEATH -1469025
#define SPELL_CLEAVE 22540
#define SPELL_WARSTOMP 24375
#define SPELL_FIREBALLVOLLEY 22425
#define SPELL_CONFLAGRATION 23023
struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
{
boss_razorgoreAI(Creature *c) : ScriptedAI(c) {}
uint32 Cleave_Timer;
uint32 WarStomp_Timer;
uint32 FireballVolley_Timer;
uint32 Conflagration_Timer;
void Reset()
{
Cleave_Timer = 15000; //These times are probably wrong
@@ -51,55 +43,45 @@ struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
FireballVolley_Timer = 7000;
Conflagration_Timer = 12000;
}
void EnterCombat(Unit *who)
{
DoZoneInCombat();
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 7000 + rand()%3000;
}else Cleave_Timer -= diff;
//WarStomp_Timer
if (WarStomp_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_WARSTOMP);
WarStomp_Timer = 15000 + rand()%10000;
}else WarStomp_Timer -= diff;
//FireballVolley_Timer
if (FireballVolley_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY);
FireballVolley_Timer = 12000 + rand()%3000;
}else FireballVolley_Timer -= diff;
//Conflagration_Timer
if (Conflagration_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CONFLAGRATION);
//We will remove this threat reduction and add an aura check.
//if (DoGetThreat(m_creature->getVictim()))
//DoModifyThreatPercent(m_creature->getVictim(),-50);
Conflagration_Timer = 12000;
}else Conflagration_Timer -= diff;
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
if (m_creature->getVictim() && m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION))
{
@@ -108,16 +90,13 @@ struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
if (target)
m_creature->TauntApply(target);
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_razorgore(Creature* pCreature)
{
return new boss_razorgoreAI (pCreature);
}
void AddSC_boss_razorgore()
{
Script *newscript;
@@ -13,31 +13,25 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Vaelastrasz
SD%Complete: 75
SDComment: Burning Adrenaline not correctly implemented in core
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define SAY_LINE1 -1469026
#define SAY_LINE2 -1469027
#define SAY_LINE3 -1469028
#define SAY_HALFLIFE -1469029
#define SAY_KILLTARGET -1469030
#define GOSSIP_ITEM "Start Event <Needs Gossip Text>"
#define SPELL_ESSENCEOFTHERED 23513
#define SPELL_FLAMEBREATH 23461
#define SPELL_FIRENOVA 23462
#define SPELL_TAILSWIPE 15847
#define SPELL_BURNINGADRENALINE 23620
#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect
struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
{
boss_vaelAI(Creature *c) : ScriptedAI(c)
@@ -46,7 +40,6 @@ struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
c->setFaction(35);
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
uint64 PlayerGUID;
uint32 SpeachTimer;
uint32 SpeachNum;
@@ -58,7 +51,6 @@ struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
uint32 TailSwipe_Timer;
bool HasYelled;
bool DoingSpeach;
void Reset()
{
PlayerGUID = 0;
@@ -73,37 +65,29 @@ struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
HasYelled = false;
DoingSpeach = false;
}
void BeginSpeach(Unit* target)
{
//Stand up and begin speach
PlayerGUID = target->GetGUID();
//10 seconds
DoScriptText(SAY_LINE1, m_creature);
SpeachTimer = 10000;
SpeachNum = 0;
DoingSpeach = true;
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void KilledUnit(Unit *victim)
{
if (rand()%5)
return;
DoScriptText(SAY_KILLTARGET, m_creature, victim);
}
void EnterCombat(Unit *who)
{
DoCast(m_creature,SPELL_ESSENCEOFTHERED);
DoZoneInCombat();
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3));
}
void UpdateAI(const uint32 diff)
{
//Speach
@@ -138,37 +122,31 @@ struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
}
}else SpeachTimer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
return;
// Yell if hp lower than 15%
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled)
{
DoScriptText(SAY_HALFLIFE, m_creature);
HasYelled = true;
}
//Cleave_Timer
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
Cleave_Timer = 15000;
}else Cleave_Timer -= diff;
//FlameBreath_Timer
if (FlameBreath_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH);
FlameBreath_Timer = 4000 + rand()%4000;
}else FlameBreath_Timer -= diff;
//BurningAdrenalineCaster_Timer
if (BurningAdrenalineCaster_Timer < diff)
{
Unit* target = NULL;
int i = 0 ;
while (i < 3) // max 3 tries to get a random target with power_mana
{
@@ -180,27 +158,22 @@ struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
}
if (target) // cast on self (see below)
target->CastSpell(target,SPELL_BURNINGADRENALINE,1);
BurningAdrenalineCaster_Timer = 15000;
}else BurningAdrenalineCaster_Timer -= diff;
//BurningAdrenalineTank_Timer
if (BurningAdrenalineTank_Timer < diff)
{
// have the victim cast the spell on himself otherwise the third effect aura will be applied
// to Vael instead of the player
m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1);
BurningAdrenalineTank_Timer = 45000;
}else BurningAdrenalineTank_Timer -= diff;
//FireNova_Timer
if (FireNova_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FIRENOVA);
FireNova_Timer = 5000;
}else FireNova_Timer -= diff;
//TailSwipe_Timer
if (TailSwipe_Timer < diff)
{
@@ -209,14 +182,11 @@ struct TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI
{
DoCast(m_creature->getVictim(),SPELL_TAILSWIPE);
}*/
TailSwipe_Timer = 20000;
}else TailSwipe_Timer -= diff;
DoMeleeAttackIfReady();
}
};
void SendDefaultMenu_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time
@@ -225,28 +195,22 @@ void SendDefaultMenu_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiAc
CAST_AI(boss_vaelAI, pCreature->AI())->BeginSpeach(pPlayer);
}
}
bool GossipSelect_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiSender == GOSSIP_SENDER_MAIN)
SendDefaultMenu_boss_vael(pPlayer, pCreature, uiAction);
return true;
}
bool GossipHello_boss_vael(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID());
return true;
}
CreatureAI* GetAI_boss_vael(Creature* pCreature)
{
return new boss_vaelAI (pCreature);
}
void AddSC_boss_vael()
{
Script *newscript;
@@ -13,51 +13,40 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Victor_Nefarius
SD%Complete: 75
SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
#define SAY_GAMESBEGIN_1 -1469004
#define SAY_GAMESBEGIN_2 -1469005
#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz
#define GOSSIP_ITEM_1 "I've made no mistakes."
#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles."
#define GOSSIP_ITEM_3 "Please do."
#define CREATURE_BRONZE_DRAKANOID 14263
#define CREATURE_BLUE_DRAKANOID 14261
#define CREATURE_RED_DRAKANOID 14264
#define CREATURE_GREEN_DRAKANOID 14262
#define CREATURE_BLACK_DRAKANOID 14265
#define CREATURE_CHROMATIC_DRAKANOID 14302
#define CREATURE_NEFARIAN 11583
#define ADD_X1 -7591.151855
#define ADD_X2 -7514.598633
#define ADD_Y1 -1204.051880
#define ADD_Y2 -1150.448853
#define ADD_Z1 476.800476
#define ADD_Z2 476.796570
#define NEF_X -7445
#define NEF_Y -1332
#define NEF_Z 536
#define HIDE_X -7592
#define HIDE_Y -1264
#define HIDE_Z 481
#define SPELL_SHADOWBOLT 21077
#define SPELL_FEAR 26070
//This script is complicated
//Instead of morphing Victor Nefarius we will have him control phase 1
//And then have him spawn "Nefarian" for phase 2
@@ -66,7 +55,6 @@ EndScriptData */
//and allow players to start the event over
//If nefarian dies then he will kill himself then he will kill himself in his hiding place
//To prevent players from doing the event twice
struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
{
boss_victor_nefariusAI(Creature *c) : ScriptedAI(c)
@@ -157,7 +145,6 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
break;
}
}
uint32 SpawnedAdds;
uint32 AddSpawnTimer;
uint32 ShadowBoltTimer;
@@ -168,7 +155,6 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
uint32 DrakType2;
uint64 NefarianGUID;
uint32 NefCheckTime;
void Reset()
{
SpawnedAdds = 0;
@@ -178,20 +164,16 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier
NefarianGUID = 0;
NefCheckTime = 2000;
m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1);
m_creature->setFaction(35);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void BeginEvent(Player* target)
{
DoScriptText(SAY_GAMESBEGIN_2, m_creature);
//Trinity::Singleton<MapManager>::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
/*
list <Player*>::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i)
{
AttackStart((*i));
@@ -202,27 +184,22 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
AttackStart(target);
}
void EnterCombat(Unit *who)
{
}
void MoveInLineOfSight(Unit *who)
{
//We simply use this function to find players until we can use pMap->GetPlayers()
if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
{
//Add them to our threat list
m_creature->AddThreat(who,0.0f);
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Only do this if we haven't spawned nef yet
if (SpawnedAdds < 42)
{
@@ -233,10 +210,8 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
DoCast(target,SPELL_SHADOWBOLT);
ShadowBoltTimer = 3000 + (rand()%7000);
}else ShadowBoltTimer -= diff;
//FearTimer
if (FearTimer < diff)
{
@@ -244,10 +219,8 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
DoCast(target,SPELL_FEAR);
FearTimer = 10000 + (rand()%10000);
}else FearTimer -= diff;
//Add spawning mechanism
if (AddSpawnTimer < diff)
{
@@ -255,14 +228,11 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
uint32 CreatureID;
Creature* Spawned = NULL;
Unit* target = NULL;
//1 in 3 chance it will be a chromatic
if (rand()%3 == 0)
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
else CreatureID = DrakType1;
SpawnedAdds++;
//Spawn Creature and force it to start attacking a random target
Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
target = SelectUnit(SELECT_TARGET_RANDOM,0);
@@ -271,14 +241,11 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
Spawned->AI()->AttackStart(target);
Spawned->setFaction(103);
}
//1 in 3 chance it will be a chromatic
if (rand()%3 == 0)
CreatureID = CREATURE_CHROMATIC_DRAKANOID;
else CreatureID = DrakType2;
SpawnedAdds++;
target = NULL;
Spawned = NULL;
Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
@@ -288,26 +255,20 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
Spawned->AI()->AttackStart(target);
Spawned->setFaction(103);
}
//Begin phase 2 by spawning Nefarian and what not
if (SpawnedAdds >= 42)
{
//Teleport Victor Nefarius way out of the map
//MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0);
//Inturrupt any spell casting
m_creature->InterruptNonMeleeSpells(false);
//Root self
DoCast(m_creature,33356);
//Make super invis
DoCast(m_creature,8149);
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z);
m_creature->addUnitState(UNIT_STAT_FLEEING);
//Spawn nef and have him attack a random target
Creature* Nefarian = NULL;
Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
@@ -321,7 +282,6 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
}
else error_log("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
}
AddSpawnTimer = 4000;
}else AddSpawnTimer -= diff;
}
@@ -330,7 +290,6 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
if (NefCheckTime < diff)
{
Unit* Nefarian = Unit::GetCreature((*m_creature),NefarianGUID);
//If nef is dead then we die to so the players get out of combat
//and cannot repeat the event
if (!Nefarian || !Nefarian->isAlive())
@@ -338,25 +297,21 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI
NefarianGUID = 0;
m_creature->ForcedDespawn();
}
NefCheckTime = 2000;
}else NefCheckTime -= diff;
}
}
};
CreatureAI* GetAI_boss_victor_nefarius(Creature* pCreature)
{
return new boss_victor_nefariusAI (pCreature);
}
bool GossipHello_boss_victor_nefarius(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID());
return true;
}
bool GossipSelect_boss_victor_nefarius(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -377,11 +332,9 @@ bool GossipSelect_boss_victor_nefarius(Player* pPlayer, Creature* pCreature, uin
}
return true;
}
void AddSC_boss_victor_nefarius()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_victor_nefarius";
newscript->GetAI = &GetAI_boss_victor_nefarius;
@@ -13,13 +13,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Blackwing_Lair
SD%Complete: 0
SDComment:
SDCategory: Blackwing Lair
EndScriptData */
#include "precompiled.h"
@@ -13,41 +13,31 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Blasted_Lands
SD%Complete: 90
SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support.
SDCategory: Blasted Lands
EndScriptData */
/* ContentData
npc_deathly_usher
npc_fallen_hero_of_horde
EndContentData */
#include "precompiled.h"
/*######
## npc_deathly_usher
######*/
#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler."
#define SPELL_TELEPORT_SINGLE 12885
#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142
#define SPELL_TELEPORT_GROUP 27686
bool GossipHello_npc_deathly_usher(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && pPlayer->HasItemCount(10757, 1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_deathly_usher(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF)
@@ -55,43 +45,32 @@ bool GossipSelect_npc_deathly_usher(Player* pPlayer, Creature* pCreature, uint32
pPlayer->CLOSE_GOSSIP_MENU();
pCreature->CastSpell(pPlayer, SPELL_TELEPORT_SINGLE, true);
}
return true;
}
/*######
## npc_fallen_hero_of_horde
######*/
#define GOSSIP_H_F1 "Why are you here?"
#define GOSSIP_H_F2 "Continue story..."
#define GOSSIP_ITEM_FALLEN "Continue..."
#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?"
#define GOSSIP_ITEM_FALLEN2 "Subordinates?"
#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?"
#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero"
#define GOSSIP_ITEM_FALLEN5 "I shall"
bool GossipHello_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == HORDE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == ALLIANCE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_F1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -110,7 +89,6 @@ bool GossipSelect_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature,
pPlayer->SEND_GOSSIP_MENU(1411, pCreature->GetGUID());
}
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
pPlayer->SEND_GOSSIP_MENU(1451, pCreature->GetGUID());
@@ -142,17 +120,14 @@ bool GossipSelect_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature,
}
return true;
}
void AddSC_blasted_lands()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_deathly_usher";
newscript->pGossipHello = &GossipHello_npc_deathly_usher;
newscript->pGossipSelect = &GossipSelect_npc_deathly_usher;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_fallen_hero_of_horde";
newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde;
@@ -13,16 +13,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Kruul
SD%Complete: 100
SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back.
SDCategory: Bosses
EndScriptData */
#include "precompiled.h"
#define SPELL_SHADOWVOLLEY 21341
#define SPELL_CLEAVE 20677
#define SPELL_THUNDERCLAP 23931
@@ -30,11 +27,9 @@ EndScriptData */
#define SPELL_VOIDBOLT 21066
#define SPELL_RAGE 21340
#define SPELL_CAPTURESOUL 21054
struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
{
boss_kruulAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowVolley_Timer;
uint32 Cleave_Timer;
uint32 ThunderClap_Timer;
@@ -46,7 +41,6 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
int RandX;
int RandY;
Creature* Summoned;
void Reset()
{
ShadowVolley_Timer = 10000;
@@ -57,18 +51,14 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
Rage_Timer = 60000; //Cast rage after 1 minute
Hound_Timer = 8000;
}
void EnterCombat(Unit *who)
{
}
void KilledUnit()
{
// When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
DoCast(m_creature,SPELL_CAPTURESOUL);
}
void SummonHounds(Unit* victim)
{
Rand = rand()%10;
@@ -89,13 +79,11 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
if (Summoned)
(Summoned->AI())->AttackStart(victim);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
//ShadowVolley_Timer
if (ShadowVolley_Timer < diff)
{
@@ -103,10 +91,8 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
{
DoCast(m_creature->getVictim(),SPELL_SHADOWVOLLEY);
}
ShadowVolley_Timer = 5000;
}else ShadowVolley_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer < diff)
{
@@ -114,10 +100,8 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
{
DoCast(m_creature->getVictim(),SPELL_CLEAVE);
}
Cleave_Timer = 10000;
}else Cleave_Timer -= diff;
//ThunderClap_Timer
if (ThunderClap_Timer < diff)
{
@@ -125,17 +109,14 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
{
DoCast(m_creature->getVictim(),SPELL_THUNDERCLAP);
}
ThunderClap_Timer = 12000;
}else ThunderClap_Timer -= diff;
//TwistedReflection_Timer
if (TwistedReflection_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_TWISTEDREFLECTION);
TwistedReflection_Timer = 30000;
}else TwistedReflection_Timer -= diff;
//VoidBolt_Timer
if (VoidBolt_Timer < diff)
{
@@ -143,27 +124,22 @@ struct TRINITY_DLL_DECL boss_kruulAI : public ScriptedAI
{
DoCast(m_creature->getVictim(),SPELL_VOIDBOLT);
}
VoidBolt_Timer = 18000;
}else VoidBolt_Timer -= diff;
//Rage_Timer
if (Rage_Timer < diff)
{
DoCast(m_creature,SPELL_RAGE);
Rage_Timer = 70000;
}else Rage_Timer -= diff;
//Hound_Timer
if (Hound_Timer < diff)
{
SummonHounds(m_creature->getVictim());
SummonHounds(m_creature->getVictim());
SummonHounds(m_creature->getVictim());
Hound_Timer = 45000;
}else Hound_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -171,7 +147,6 @@ CreatureAI* GetAI_boss_kruul(Creature* pCreature)
{
return new boss_kruulAI (pCreature);
}
void AddSC_boss_kruul()
{
Script *newscript;
@@ -13,24 +13,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Burning_Steppes
SD%Complete: 100
SDComment: Quest support: 4224, 4866
SDCategory: Burning Steppes
EndScriptData */
/* ContentData
npc_ragged_john
EndContentData */
#include "precompiled.h"
/*######
## npc_ragged_john
######*/
#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him."
#define GOSSIP_SELECT1 "So what did you do?"
#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'."
@@ -43,13 +38,10 @@ EndContentData */
#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?"
#define GOSSIP_SELECT10 "Ahh... Ironfoe"
#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative"
struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
{
npc_ragged_johnAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void MoveInLineOfSight(Unit *who)
{
if (who->HasAura(16468))
@@ -60,30 +52,23 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
CAST_PLR(who)->AreaExploredOrEventHappens(4866);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
void EnterCombat(Unit *who) {}
};
CreatureAI* GetAI_npc_ragged_john(Creature* pCreature)
{
return new npc_ragged_johnAI (pCreature);
}
bool GossipHello_npc_ragged_john(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(2713, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_ragged_john(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -139,11 +124,9 @@ bool GossipSelect_npc_ragged_john(Player* pPlayer, Creature* pCreature, uint32 u
}
return true;
}
void AddSC_burning_steppes()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_ragged_john";
newscript->GetAI = &GetAI_npc_ragged_john;
@@ -13,36 +13,29 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Deadmines
SD%Complete: 0
SDComment: Placeholder
SDCategory: Deadmines
EndScriptData */
#include "precompiled.h"
#include "def_deadmines.h"
#include "Spell.h"
#define SOUND_CANNONFIRE 1400
#define SOUND_DESTROYDOOR 3079
#define SAY_MR_SMITE_ALARM1 "You there, check out that noise!"
#define SOUND_MR_SMITE_ALARM1 5775
#define SAY_MR_SMITE_ALARM2 "We're under attack! A vast, ye swabs! Repel the invaders!"
#define SOUND_MR_SMITE_ALARM2 5777
#define GO_IRONCLAD_DOOR 16397
#define GO_DEFIAS_CANNON 16398
#define GO_DOOR_LEVER 101833
#define CANNON_BLAST_TIMER 3000
#define PIRATES_DELAY_TIMER 1000
struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
{
instance_deadmines(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
GameObject* IronCladDoor;
GameObject* DefiasCannon;
GameObject* DoorLever;
@@ -52,7 +45,6 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
uint32 State;
uint32 CannonBlast_Timer;
uint32 PiratesDelay_Timer;
void Initialize()
{
IronCladDoor = NULL;
@@ -60,12 +52,10 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
DoorLever = NULL;
State = CANNON_NOT_USED;
}
virtual void Update(uint32 diff)
{
if (!IronCladDoor || !DefiasCannon || !DoorLever)
return;
switch(State)
{
case CANNON_GUNPOWDER_USED:
@@ -100,47 +90,39 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
break;
}
}
void SummonCreatures()
{
DefiasPirate1 = IronCladDoor->SummonCreature(657,IronCladDoor->GetPositionX() - 2,IronCladDoor->GetPositionY()-7,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);
}
void MoveCreaturesInside()
{
if (!DefiasPirate1 || !DefiasPirate2 || !DefiasCompanion)
return;
MoveCreatureInside(DefiasPirate1);
MoveCreatureInside(DefiasPirate2);
MoveCreatureInside(DefiasCompanion);
}
void MoveCreatureInside(Creature* pCreature)
{
pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pCreature->GetMotionMaster()->MovePoint(0, -102.7,-655.9, pCreature->GetPositionZ());
}
void ShootCannon()
{
DefiasCannon->SetGoState(GO_STATE_ACTIVE);
DoPlaySound(DefiasCannon, SOUND_CANNONFIRE);
}
void BlastOutDoor()
{
IronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
DoPlaySound(IronCladDoor, SOUND_DESTROYDOOR);
}
void LeverStucked()
{
DoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4);
}
void OnGameObjectCreate(GameObject* pGo, bool add)
{
switch(pGo->GetEntry())
@@ -156,7 +138,6 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
break;
}
}
void SetData(uint32 type, uint32 data)
{
if (type == EVENT_STATE)
@@ -165,14 +146,12 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
State=data;
}
}
uint32 GetData(uint32 type)
{
if (type == EVENT_STATE)
return State;
return 0;
}
void DoPlaySound(GameObject* unit, uint32 sound)
{
WorldPacket data(4);
@@ -180,7 +159,6 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
data << uint32(sound);
unit->SendMessageToSet(&data,false);
}
void DoPlaySoundCreature(Unit* unit, uint32 sound)
{
WorldPacket data(4);
@@ -189,15 +167,12 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance
unit->SendMessageToSet(&data,false);
}
};
/*#####
# item_Defias_Gunpowder
#####*/
bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* _Item, SpellCastTargets const& targets)
{
ScriptedInstance *pInstance = pPlayer->GetInstanceData();
if (!pInstance)
{
pPlayer->GetSession()->SendNotification("Instance script not initialized");
@@ -210,16 +185,13 @@ bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* _Item, SpellCastTarget
{
pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED);
}
pPlayer->DestroyItemCount(_Item->GetEntry(), 1, true);
return true;
}
InstanceData* GetInstanceData_instance_deadmines(Map* pMap)
{
return new instance_deadmines(pMap);
}
void AddSC_instance_deadmines()
{
Script *newscript;
@@ -227,7 +199,6 @@ void AddSC_instance_deadmines()
newscript->Name = "instance_deadmines";
newscript->GetInstanceData = &GetInstanceData_instance_deadmines;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_defias_gunpowder";
newscript->pItemUse = &ItemUse_item_defias_gunpowder;
@@ -1,14 +1,11 @@
#ifndef DEF_DEADMINES_H
#define DEF_DEADMINES_H
#include "precompiled.h"
#define CANNON_NOT_USED 1
#define CANNON_GUNPOWDER_USED 2
#define CANNON_BLAST_INITIATED 3
#define PIRATES_ATTACK 4
#define EVENT_DONE 5
#define EVENT_STATE 1
#endif
@@ -13,34 +13,26 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Dun_Morogh
SD%Complete: 50
SDComment: Quest support: 1783
SDCategory: Dun Morogh
EndScriptData */
/* ContentData
npc_narm_faulk
EndContentData */
#include "precompiled.h"
/*######
## npc_narm_faulk
######*/
// signed for 6172
#define SAY_HEAL -1000280
struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
{
uint32 lifeTimer;
bool spellHit;
npc_narm_faulkAI(Creature *c) : ScriptedAI(c) {}
void Reset()
{
lifeTimer = 120000;
@@ -48,16 +40,13 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
spellHit = false;
}
void EnterCombat(Unit *who)
{
}
void MoveInLineOfSight(Unit *who)
{
return;
}
void UpdateAI(const uint32 diff)
{
if (m_creature->IsStandState())
@@ -71,7 +60,6 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
lifeTimer -= diff;
}
}
void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
{
if (Spellkind->Id == 8593 && !spellHit)
@@ -84,17 +72,14 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
spellHit = true;
}
}
};
CreatureAI* GetAI_npc_narm_faulk(Creature* pCreature)
{
return new npc_narm_faulkAI (pCreature);
}
void AddSC_dun_morogh()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_narm_faulk";
newscript->GetAI = &GetAI_npc_narm_faulk;
@@ -13,20 +13,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Duskwood
SD%Complete: 100
SDComment: Quest Support:8735
SDCategory: Duskwood
EndScriptData */
#include "precompiled.h"
/*######
# at_twilight_grove
######*/
bool AreaTrigger_at_twilight_grove(Player* pPlayer, AreaTriggerEntry *at)
{
if (pPlayer->HasQuestForItem(21149))
@@ -45,23 +41,18 @@ bool AreaTrigger_at_twilight_grove(Player* pPlayer, AreaTriggerEntry *at)
}
return false;
};
/*######
# boss_twilight_corrupter
######*/
#define SPELL_SOUL_CORRUPTION 25805
#define SPELL_CREATURE_OF_NIGHTMARE 25806
#define SPELL_LEVEL_UP 24312
struct TRINITY_DLL_DECL boss_twilight_corrupterAI : public ScriptedAI
{
boss_twilight_corrupterAI(Creature *c) : ScriptedAI(c) {}
uint32 SoulCorruption_Timer;
uint32 CreatureOfNightmare_Timer;
uint8 KillCount;
void Reset()
{
SoulCorruption_Timer = 15000;
@@ -72,14 +63,12 @@ struct TRINITY_DLL_DECL boss_twilight_corrupterAI : public ScriptedAI
{
m_creature->MonsterYell("The Nightmare cannot be stopped!",0,m_creature->GetGUID());
}
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
m_creature->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
if (KillCount == 3)
{
DoCast(m_creature, SPELL_LEVEL_UP, true);
@@ -87,7 +76,6 @@ struct TRINITY_DLL_DECL boss_twilight_corrupterAI : public ScriptedAI
}
}
}
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
@@ -109,16 +97,13 @@ CreatureAI* GetAI_boss_twilight_corrupter(Creature* pCreature)
{
return new boss_twilight_corrupterAI (pCreature);
}
void AddSC_duskwood()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_twilight_corrupter";
newscript->GetAI = &GetAI_boss_twilight_corrupter;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "at_twilight_grove";
newscript->pAreaTrigger = &AreaTrigger_at_twilight_grove;
@@ -13,94 +13,73 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Eastern_Plaguelands
SD%Complete: 100
SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched
SDCategory: Eastern Plaguelands
EndScriptData */
/* ContentData
mobs_ghoul_flayer
npc_augustus_the_touched
npc_darrowshire_spirit
npc_tirion_fordring
EndContentData */
#include "precompiled.h"
//id8530 - cannibal ghoul
//id8531 - gibbering ghoul
//id8532 - diseased flayer
struct TRINITY_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI
{
mobs_ghoul_flayerAI(Creature *c) : ScriptedAI(c) {}
void Reset() { }
void EnterCombat(Unit* who) { }
void JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
m_creature->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
}
};
CreatureAI* GetAI_mobs_ghoul_flayer(Creature* pCreature)
{
return new mobs_ghoul_flayerAI (pCreature);
}
/*######
## npc_augustus_the_touched
######*/
bool GossipHello_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(6164))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_TRADE)
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
return true;
}
/*######
## npc_darrowshire_spirit
######*/
#define SPELL_SPIRIT_SPAWNIN 17321
struct TRINITY_DLL_DECL npc_darrowshire_spiritAI : public ScriptedAI
{
npc_darrowshire_spiritAI(Creature *c) : ScriptedAI(c) {}
void Reset()
{
DoCast(m_creature,SPELL_SPIRIT_SPAWNIN);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who) { }
};
CreatureAI* GetAI_npc_darrowshire_spirit(Creature* pCreature)
{
return new npc_darrowshire_spiritAI (pCreature);
}
bool GossipHello_npc_darrowshire_spirit(Player* pPlayer, Creature* pCreature)
{
pPlayer->SEND_GOSSIP_MENU(3873, pCreature->GetGUID());
@@ -108,29 +87,22 @@ bool GossipHello_npc_darrowshire_spirit(Player* pPlayer, Creature* pCreature)
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
return true;
}
/*######
## npc_tirion_fordring
######*/
#define GOSSIP_HELLO "I am ready to hear your tale, Tirion."
#define GOSSIP_SELECT1 "Thank you, Tirion. What of your identity?"
#define GOSSIP_SELECT2 "That is terrible."
#define GOSSIP_SELECT3 "I will, Tirion."
bool GossipHello_npc_tirion_fordring(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && pPlayer->getStandState() == UNIT_STAND_STATE_SIT)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_tirion_fordring(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -154,28 +126,23 @@ bool GossipSelect_npc_tirion_fordring(Player* pPlayer, Creature* pCreature, uint
}
return true;
}
void AddSC_eastern_plaguelands()
{
Script *newscript;
newscript = new Script;
newscript->Name = "mobs_ghoul_flayer";
newscript->GetAI = &GetAI_mobs_ghoul_flayer;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_augustus_the_touched";
newscript->pGossipHello = &GossipHello_npc_augustus_the_touched;
newscript->pGossipSelect = &GossipSelect_npc_augustus_the_touched;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_darrowshire_spirit";
newscript->GetAI = &GetAI_npc_darrowshire_spirit;
newscript->pGossipHello = &GossipHello_npc_darrowshire_spirit;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_tirion_fordring";
newscript->pGossipHello = &GossipHello_npc_tirion_fordring;
@@ -13,33 +13,25 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Elwynn_Forest
SD%Complete: 50
SDComment: Quest support: 1786
SDCategory: Elwynn Forest
EndScriptData */
/* ContentData
npc_henze_faulk
EndContentData */
#include "precompiled.h"
/*######
## npc_henze_faulk
######*/
#define SAY_HEAL -1000280
struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
{
uint32 lifeTimer;
bool spellHit;
npc_henze_faulkAI(Creature *c) : ScriptedAI(c) {}
void Reset()
{
lifeTimer = 120000;
@@ -47,16 +39,13 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
spellHit = false;
}
void EnterCombat(Unit *who)
{
}
void MoveInLineOfSight(Unit *who)
{
return;
}
void UpdateAI(const uint32 diff)
{
if (m_creature->IsStandState())
@@ -70,7 +59,6 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
lifeTimer -= diff;
}
}
void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
{
if (Spellkind->Id == 8593 && !spellHit)
@@ -83,17 +71,14 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
spellHit = true;
}
}
};
CreatureAI* GetAI_npc_henze_faulk(Creature* pCreature)
{
return new npc_henze_faulkAI (pCreature);
}
void AddSC_elwynn_forest()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_henze_faulk";
newscript->GetAI = &GetAI_npc_henze_faulk;
@@ -13,14 +13,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Eversong_Woods
SD%Complete: 100
SDComment: Quest support: 8483, 8488, 8490, 9686
SDCategory: Eversong Woods
EndScriptData */
/* ContentData
npc_prospector_anvilward
npc_apprentice_mirveda
@@ -28,35 +26,26 @@ npc_infused_crystal
npc_kelerun_bloodmourn
go_harbinger_second_trial
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*######
## npc_prospector_anvilward
######*/
#define GOSSIP_HELLO "I need a moment of your time, sir."
#define GOSSIP_SELECT "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward."
#define SAY_PR_1 -1000281
#define SAY_PR_2 -1000282
#define QUEST_THE_DWARVEN_SPY 8483
struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI
{
// CreatureAI functions
npc_prospector_anvilwardAI(Creature *c) : npc_escortAI(c) {}
// Pure Virtual Functions
void WaypointReached(uint32 i)
{
Player* pPlayer = GetPlayerForEscort();
if (!pPlayer)
return;
switch (i)
{
case 0: DoScriptText(SAY_PR_1, m_creature, pPlayer); break;
@@ -64,32 +53,26 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI
case 6: m_creature->setFaction(24); break;
}
}
void Reset()
{
me->RestoreFaction();
}
void JustDied(Unit* killer)
{
me->RestoreFaction();
}
};
CreatureAI* GetAI_npc_prospector_anvilward(Creature* pCreature)
{
return new npc_prospector_anvilwardAI(pCreature);
}
bool GossipHello_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(8239, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
@@ -106,50 +89,36 @@ bool GossipSelect_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature,
}
return true;
}
/*######
## Quest 9686 Second Trial
######*/
#define QUEST_SECOND_TRIAL 9686
#define MASTER_KELERUN_BLOODMOURN 17807
#define CHAMPION_BLOODWRATH 17809
#define CHAMPION_LIGHTREND 17810
#define CHAMPION_SWIFTBLADE 17811
#define CHAMPION_SUNSTRIKER 17812
#define HARBINGER_OF_THE_SECOND_TRIAL 182052
#define SPELL_FLASH_OF_LIGHT 19939
#define TIMER_FLASH_OF_LIGHT 3225
#define SPELL_SEAL_OF_JUSTICE 20164
#define TIMER_SEAL_OF_JUSTICE 10000
#define SPELL_JUDGEMENT_OF_LIGHT 20271
#define TIMER_JUDGEMENT_OF_LIGHT 10000
#define SPELL_SEAL_OF_COMMAND 20375
#define TIMER_SEAL_OF_COMMAND 20000
#define OFFSET_NEXT_ATTACK 750
#define FACTION_HOSTILE 45
#define FACTION_FRIENDLY 7
// missing from db
#define TEXT_SECOND_TRIAL_1 -1645006
#define TEXT_SECOND_TRIAL_2 -1645007
#define TEXT_SECOND_TRIAL_3 -1645008
#define TEXT_SECOND_TRIAL_4 -1645009
struct Locations
{
float x, y, z, o;
};
static Locations SpawnPosition[]=
{
{5.3, -11.8, 0.361, 4.2},
@@ -157,46 +126,35 @@ static Locations SpawnPosition[]=
{-5.7, -34.85, 0.361, 1.09},
{-11.9, -18, 0.361, 5.87}
};
static uint32 PaladinEntry[]= {CHAMPION_BLOODWRATH, CHAMPION_LIGHTREND, CHAMPION_SWIFTBLADE, CHAMPION_SUNSTRIKER};
/*######
## npc_second_trial_paladin
######*/
struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
{
npc_secondTrialAI(Creature *c) : ScriptedAI(c) {}
uint32 timer;
uint8 questPhase;
uint64 summonerGuid;
bool spellFlashLight;
bool spellJustice;
bool spellJudLight;
bool spellCommand;
uint32 timerFlashLight;
uint32 timerJustice;
uint32 timerJudLight;
uint32 timerCommand;
void Reset() {
timer = 2000;
questPhase = 0;
summonerGuid = 0;
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
m_creature->setFaction(FACTION_FRIENDLY);
spellFlashLight = false;
spellJustice = false;
spellJudLight = false;
spellCommand = false;
switch(m_creature->GetEntry()) {
case CHAMPION_BLOODWRATH :
spellFlashLight = true;
@@ -220,18 +178,14 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
break;
}
}
void EnterCombat(Unit *who) { }
void UpdateAI(const uint32 diff)
{
if (questPhase == 1) {
if (timer < diff) {
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
m_creature->setFaction(FACTION_HOSTILE);
questPhase = 0;
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (target && target->GetTypeId() == TYPEID_PLAYER) // only on players.
{
@@ -241,10 +195,8 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
}
else timer -= diff;
}
if (!UpdateVictim())
return;
// healer
if (spellFlashLight) {
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 70){
@@ -256,7 +208,6 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
timerFlashLight -= diff;
}
}
if (spellJustice) {
if (timerJustice < diff)
{
@@ -266,7 +217,6 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
else
timerJustice -= diff;
}
if (spellJudLight) {
if (timerJudLight < diff) {
DoCast(m_creature, SPELL_JUDGEMENT_OF_LIGHT);
@@ -275,7 +225,6 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
else
timerJudLight -= diff;
}
if (spellCommand) {
if (timerCommand < diff) {
DoCast(m_creature, TIMER_SEAL_OF_COMMAND);
@@ -284,41 +233,29 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI
else
timerCommand -= diff;
}
DoMeleeAttackIfReady();
}
void Activate(uint64 summonerguid);
void KilledUnit(Unit* Killed);
void JustDied(Unit* Killer);
};
/*######
## npc_second_trial_controller
######*/
struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI
{
master_kelerun_bloodmournAI(Creature *c) : ScriptedAI(c) {}
uint8 questPhase;
uint8 paladinPhase;
uint32 timer;
uint64 paladinGuid[4];
void Reset() {
questPhase = 0;
timer = 60000;
paladinPhase = 0;
uint64 paladinGuid[] = {0,0,0,0};
}
void EnterCombat(Unit *who) {}
void UpdateAI(const uint32 diff)
{
// Quest accepted but object not activated, object despawned (if in sync 1 minute!)
@@ -328,14 +265,11 @@ struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI
}
// fight the 4 paladin mobs phase
else if (questPhase == 2) {
if (timer < diff) {
Creature* paladinSpawn;
paladinSpawn = (Unit::GetCreature((*m_creature), paladinGuid[paladinPhase]));
if (paladinSpawn) {
CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(m_creature->GetGUID());
switch(paladinPhase) {
case 0:
DoScriptText(TEXT_SECOND_TRIAL_1,m_creature);
@@ -353,99 +287,75 @@ struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI
}
else
Reset();
questPhase=4;
timer = OFFSET_NEXT_ATTACK;
}
else timer -= diff;
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
void StartEvent()
{
if (questPhase == 1) { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code
for (int i = 0; i<4; ++i) {
Creature* Summoned;
Summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000);
if (Summoned)
paladinGuid[i] = Summoned->GetGUID();
}
timer = OFFSET_NEXT_ATTACK;
questPhase = 2;
}
}
void SecondTrialKill();
void SummonedCreatureDespawn(Creature* c) {}
};
bool GossipHello_master_kelerun_bloodmourn(Player* pPlayer, Creature* pCreature)
{
// quest only available if not already started
// Quest_template flag is set to : QUEST_FLAGS_EVENT
// Escort quests or any other event-driven quests. If player in party, all players that can accept this quest will receive confirmation box to accept quest.
// !not sure if this really works!
if (CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->questPhase == 0) {
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
pPlayer->SendPreparedQuest(pCreature->GetGUID());
}
pPlayer->SEND_GOSSIP_MENU(pCreature->GetEntry(), pCreature->GetGUID());
return true;
}
bool QuestAccept_master_kelerun_bloodmourn(Player* pPlayer, Creature* pCreature, Quest const *quest)
{
// One Player exclusive quest, wait for user go activation
if (quest->GetQuestId() == QUEST_SECOND_TRIAL)
CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->questPhase = 1;
return true;
}
void master_kelerun_bloodmournAI::SecondTrialKill() {
if (questPhase > 0) {
++paladinPhase;
if (paladinPhase < 4)
questPhase=2;
else
Reset(); // Quest Complete, QuestComplete handler is in npc_secondTrialAI::JustDied
}
}
void npc_secondTrialAI::JustDied(Unit* Killer) {
if (Killer->GetTypeId() == TYPEID_PLAYER)
{
Creature* Summoner;
Summoner = (Unit::GetCreature((*m_creature), summonerGuid));
if (Summoner)
CAST_AI(master_kelerun_bloodmournAI, Summoner->AI())->SecondTrialKill();
// last kill quest complete for group
if (m_creature->GetEntry() == CHAMPION_SUNSTRIKER) {
if (Group *pGroup = CAST_PLR(Killer)->GetGroup())
{
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *pGroupGuy = itr->getSource();
// for any leave or dead (with not released body) group member at appropriate distance
if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(m_creature) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
pGroupGuy->CompleteQuest(QUEST_SECOND_TRIAL);
@@ -458,62 +368,47 @@ void npc_secondTrialAI::JustDied(Unit* Killer) {
}
}
}
void npc_secondTrialAI::KilledUnit(Unit* Killed) {
if (Killed->GetTypeId() == TYPEID_PLAYER) {
if (CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL);
}
}
void npc_secondTrialAI::Activate(uint64 summonerguid) {
questPhase=1;
summonerGuid = summonerguid;
}
CreatureAI* GetAI_master_kelerun_bloodmourn(Creature* pCreature)
{
return new master_kelerun_bloodmournAI (pCreature);
}
CreatureAI* GetAI_npc_secondTrial(Creature* pCreature)
{
return new npc_secondTrialAI (pCreature);
}
/*######
## go_second_trial
######*/
bool GOHello_go_second_trial(Player* pPlayer, GameObject* pGO)
{
// find spawn :: master_kelerun_bloodmourn
if (Creature* pCreature = pGO->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f))
CAST_AI(master_kelerun_bloodmournAI, pCreature->AI())->StartEvent();
return true;
}
/*######
## npc_apprentice_mirveda
######*/
#define QUEST_UNEXPECTED_RESULT 8488
#define MOB_GHARZUL 15958
#define MOB_ANGERSHADE 15656
struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
{
npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {}
uint32 KillCount;
uint64 PlayerGUID;
bool Summon;
SummonList Summons;
void Reset()
{
KillCount = 0;
@@ -521,21 +416,17 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
Summons.DespawnAll();
Summon = false;
}
void EnterCombat(Unit* who){}
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
Summons.Summon(summoned);
}
void SummonedCreatureDespawn(Creature* summoned)
{
Summons.Despawn(summoned);
++KillCount;
}
void JustDied(Unit* killer)
{
if (PlayerGUID)
@@ -545,7 +436,6 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
CAST_PLR(pPlayer)->FailQuest(QUEST_UNEXPECTED_RESULT);
}
}
void UpdateAI(const uint32 diff)
{
if (KillCount >= 3)
@@ -557,7 +447,6 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
CAST_PLR(pPlayer)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
}
}
if (Summon)
{
m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
@@ -567,7 +456,6 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
}
}
};
bool QuestAccept_npc_apprentice_mirveda(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT)
@@ -577,25 +465,20 @@ bool QuestAccept_npc_apprentice_mirveda(Player* pPlayer, Creature* pCreature, Qu
}
return true;
}
CreatureAI* GetAI_npc_apprentice_mirvedaAI(Creature* pCreature)
{
return new npc_apprentice_mirvedaAI (pCreature);
}
/*######
## npc_infused_crystal
######*/
#define MOB_ENRAGED_WRAITH 17086
#define EMOTE -1000283
#define QUEST_POWERING_OUR_DEFENSES 8490
struct Location
{
float x, y, z;
};
static Location SpawnLocations[]=
{
{8270.68, -7188.53, 139.619},
@@ -607,17 +490,14 @@ static Location SpawnLocations[]=
{8278.51, -7242.13, 139.162},
{8267.97, -7239.17, 139.517}
};
struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
{
npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {}
uint32 EndTimer;
uint32 WaveTimer;
bool Completed;
bool Progress;
uint64 PlayerGUID;
void Reset()
{
EndTimer = 0;
@@ -626,7 +506,6 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
PlayerGUID = 0;
WaveTimer = 0;
}
void MoveInLineOfSight(Unit* who)
{
if (!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
@@ -640,12 +519,10 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
}
}
}
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
}
void JustDied(Unit* killer)
{
if (PlayerGUID && !Completed)
@@ -655,7 +532,6 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
CAST_PLR(pPlayer)->FailQuest(QUEST_POWERING_OUR_DEFENSES);
}
}
void UpdateAI(const uint32 diff)
{
if (EndTimer < diff && Progress)
@@ -671,7 +547,6 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
}else EndTimer -= diff;
if (WaveTimer < diff && !Completed && Progress)
{
uint32 ran1 = rand()%8;
@@ -684,46 +559,38 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
}else WaveTimer -= diff;
}
};
CreatureAI* GetAI_npc_infused_crystalAI(Creature* pCreature)
{
return new npc_infused_crystalAI (pCreature);
}
void AddSC_eversong_woods()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_prospector_anvilward";
newscript->GetAI = &GetAI_npc_prospector_anvilward;
newscript->pGossipHello = &GossipHello_npc_prospector_anvilward;
newscript->pGossipSelect = &GossipSelect_npc_prospector_anvilward;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_second_trial_controller";
newscript->GetAI = &GetAI_master_kelerun_bloodmourn;
newscript->pGossipHello = &GossipHello_master_kelerun_bloodmourn;
newscript->pQuestAccept = &QuestAccept_master_kelerun_bloodmourn;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_second_trial_paladin";
newscript->GetAI = &GetAI_npc_secondTrial;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_second_trial";
newscript->pGOHello = &GOHello_go_second_trial;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_apprentice_mirveda";
newscript->GetAI = &GetAI_npc_apprentice_mirvedaAI;
newscript->pQuestAccept = &QuestAccept_npc_apprentice_mirveda;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_infused_crystal";
newscript->GetAI = &GetAI_npc_infused_crystalAI;
@@ -13,40 +13,31 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Ghostlands
SD%Complete: 100
SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
SDCategory: Ghostlands
EndScriptData */
/* ContentData
npc_blood_knight_dawnstar
npc_budd_nedreck
npc_rathis_tomber
npc_ranger_lilatha
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*######
## npc_blood_knight_dawnstar
######*/
#define GOSSIP_H_BKD "Take Blood Knight Insignia"
bool GossipHello_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(24226,1,true))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_H_BKD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
@@ -61,25 +52,19 @@ bool GossipSelect_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature
}
return true;
}
/*######
## npc_budd_nedreck
######*/
#define GOSSIP_HBN "You gave the crew disguises?"
bool GossipHello_npc_budd_nedreck(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_budd_nedreck(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF)
@@ -89,37 +74,30 @@ bool GossipSelect_npc_budd_nedreck(Player* pPlayer, Creature* pCreature, uint32
}
return true;
}
/*######
## npc_rathis_tomber
######*/
bool GossipHello_npc_rathis_tomber(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(9152))
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
pPlayer->SEND_GOSSIP_MENU(8432, pCreature->GetGUID());
}else
pPlayer->SEND_GOSSIP_MENU(8431, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_rathis_tomber(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_TRADE)
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
return true;
}
/*#####
## go_gilded_brazier (Paladin First Trail quest (9678))
#####*/
bool GOHello_gilded_brazier(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE)
@@ -130,11 +108,9 @@ bool GOHello_gilded_brazier(Player* pPlayer, GameObject* pGo)
}
return true;
};
/*######
## npc_ranger_lilatha
######*/
enum eEnums
{
SAY_START = -1000140,
@@ -144,26 +120,20 @@ enum eEnums
SAY_END1 = -1000144,
SAY_END2 = -1000145,
SAY_CAPTAIN_ANSWER = -1000146,
QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212,
GO_CAGE = 181152,
NPC_CAPTAIN_HELIOS = 16220,
FACTION_SMOON_E = 1603,
};
struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
{
npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {}
std::list<GameObject*> CageList;
void WaypointReached(uint32 i)
{
Player* pPlayer = GetPlayerForEscort();
if (!pPlayer)
return;
switch(i)
{
case 0:
@@ -212,58 +182,48 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
break;
}
}
void Reset()
{
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_READY);
}
};
bool QuestAccept_npc_ranger_lilatha(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
pCreature->setFaction(113);
if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilathaAI, pCreature->AI()))
pEscortAI->Start(true, false, pPlayer->GetGUID());
}
return true;
}
CreatureAI* GetAI_npc_ranger_lilathaAI(Creature* pCreature)
{
return new npc_ranger_lilathaAI(pCreature);
}
void AddSC_ghostlands()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_blood_knight_dawnstar";
newscript->pGossipHello = &GossipHello_npc_blood_knight_dawnstar;
newscript->pGossipSelect = &GossipSelect_npc_blood_knight_dawnstar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_budd_nedreck";
newscript->pGossipHello = &GossipHello_npc_budd_nedreck;
newscript->pGossipSelect = &GossipSelect_npc_budd_nedreck;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_rathis_tomber";
newscript->pGossipHello = &GossipHello_npc_rathis_tomber;
newscript->pGossipSelect = &GossipSelect_npc_rathis_tomber;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_gilded_brazier";
newscript->pGOHello = &GOHello_gilded_brazier;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_ranger_lilatha";
newscript->GetAI = &GetAI_npc_ranger_lilathaAI;
@@ -13,26 +13,21 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Hinterlands
SD%Complete: 100
SDComment: Quest support: 863, 2742
SDCategory: The Hinterlands
EndScriptData */
/* ContentData
npc_00x09hl
npc_rinji
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*######
## npc_00x09hl
######*/
enum eOOX
{
SAY_OOX_START = -1000287,
@@ -40,22 +35,16 @@ enum eOOX
SAY_OOX_AGGRO2 = -1000289,
SAY_OOX_AMBUSH = -1000290,
SAY_OOX_END = -1000292,
QUEST_RESQUE_OOX_09 = 836,
NPC_MARAUDING_OWL = 7808,
NPC_VILE_AMBUSHER = 7809,
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775
};
struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI
{
npc_00x09hlAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void Reset() { }
void WaypointReached(uint32 uiPointId)
{
switch(uiPointId)
@@ -73,13 +62,12 @@ struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI
break;
}
}
void WaypointStart(uint32 uiPointId)
{
switch(uiPointId)
{
case 27:
for(uint8 i = 0; i < 3; ++i)
for (uint8 i = 0; i < 3; ++i)
{
const Position src = {147.927444f, -3851.513428f, 130.893f, 0};
Position pos;
@@ -88,7 +76,7 @@ struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI
}
break;
case 44:
for(uint8 i = 0; i < 3; ++i)
for (uint8 i = 0; i < 3; ++i)
{
const Position src = {-141.151581f, -4291.213867f, 120.130f, 0};
Position dst;
@@ -98,52 +86,42 @@ struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI
break;
}
}
void Aggro(Unit* pWho)
{
if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER)
return;
if (rand()%1)
DoScriptText(SAY_OOX_AGGRO1, m_creature);
else
DoScriptText(SAY_OOX_AGGRO2, m_creature);
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
}
};
bool QuestAccept_npc_00x09hl(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_RESQUE_OOX_09)
{
pCreature->SetStandState(UNIT_STAND_STATE_STAND);
if (pPlayer->GetTeam() == ALLIANCE)
pCreature->setFaction(FACTION_ESCORTEE_A);
else if (pPlayer->GetTeam() == HORDE)
pCreature->setFaction(FACTION_ESCORTEE_H);
DoScriptText(SAY_OOX_START, pCreature, pPlayer);
if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hlAI, pCreature->AI()))
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
}
return true;
}
CreatureAI* GetAI_npc_00x09hl(Creature* pCreature)
{
return new npc_00x09hlAI(pCreature);
}
/*######
## npc_rinji
######*/
enum eRinji
{
SAY_RIN_FREE = -1000403, //from here
@@ -153,30 +131,25 @@ enum eRinji
SAY_RIN_COMPLETE = -1000407,
SAY_RIN_PROGRESS_1 = -1000408,
SAY_RIN_PROGRESS_2 = -1000409,
QUEST_RINJI_TRAPPED = 2742,
NPC_RANGER = 2694,
NPC_OUTRUNNER = 2691,
GO_RINJI_CAGE = 142036
};
struct Location
{
float m_fX, m_fY, m_fZ;
};
Location m_afAmbushSpawn[] =
{
{191.296204, -2839.329346, 107.388},
{70.972466, -2848.674805, 109.459}
};
Location m_afAmbushMoveTo[] =
{
{166.630386, -2824.780273, 108.153},
{70.886589, -2874.335449, 116.675}
};
struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI
{
npc_rinjiAI(Creature* pCreature) : npc_escortAI(pCreature)
@@ -184,26 +157,21 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI
m_bIsByOutrunner = false;
m_iSpawnId = 0;
}
bool m_bIsByOutrunner;
uint32 m_uiPostEventCount;
uint32 m_uiPostEventTimer;
int m_iSpawnId;
void Reset()
{
m_uiPostEventCount = 0;
m_uiPostEventTimer = 3000;
}
void JustRespawned()
{
m_bIsByOutrunner = false;
m_iSpawnId = 0;
npc_escortAI::JustRespawned();
}
void EnterCombat(Unit* pWho)
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
@@ -213,45 +181,36 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI
DoScriptText(SAY_RIN_BY_OUTRUNNER, pWho);
m_bIsByOutrunner = true;
}
if (rand()%4)
return;
//only if attacked and escorter is not in combat?
DoScriptText(RAND(SAY_RIN_HELP_1,SAY_RIN_HELP_2), m_creature);
}
}
void DoSpawnAmbush(bool bFirst)
{
if (!bFirst)
m_iSpawnId = 1;
m_creature->SummonCreature(NPC_RANGER,
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
for(int i = 0; i < 2; ++i)
for (int i = 0; i < 2; ++i)
{
m_creature->SummonCreature(NPC_OUTRUNNER,
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
}
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pSummoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ);
}
void WaypointReached(uint32 uiPointId)
{
Player* pPlayer = GetPlayerForEscort();
if (!pPlayer)
return;
switch(uiPointId)
{
case 1:
@@ -271,7 +230,6 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI
break;
}
}
void UpdateEscortAI(const uint32 uiDiff)
{
//Check if we have a current target
@@ -282,7 +240,6 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI
if (m_uiPostEventTimer < uiDiff)
{
m_uiPostEventTimer = 3000;
if (Unit* pPlayer = GetPlayerForEscort())
{
switch(m_uiPostEventCount)
@@ -306,42 +263,34 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI
else
m_uiPostEventTimer -= uiDiff;
}
return;
}
DoMeleeAttackIfReady();
}
};
bool QuestAccept_npc_rinji(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_RINJI_TRAPPED)
{
if (GameObject* pGo = pCreature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
pGo->UseDoorOrButton();
if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinjiAI, pCreature->AI()))
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
}
return true;
}
CreatureAI* GetAI_npc_rinji(Creature* pCreature)
{
return new npc_rinjiAI(pCreature);
}
void AddSC_hinterlands()
{
Script* newscript;
newscript = new Script;
newscript->Name = "npc_00x09hl";
newscript->GetAI = &GetAI_npc_00x09hl;
newscript->pQuestAccept = &QuestAccept_npc_00x09hl;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_rinji";
newscript->GetAI = &GetAI_npc_rinji;
@@ -13,35 +13,28 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Ironforge
SD%Complete: 100
SDComment: Quest support: 3702
SDCategory: Ironforge
EndScriptData */
/* ContentData
npc_royal_historian_archesonus
EndContentData */
#include "precompiled.h"
/*######
## npc_royal_historian_archesonus
######*/
#define GOSSIP_ITEM_ROYAL "I am ready to listen"
#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?"
#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please."
#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??"
#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!"
bool GossipHello_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
@@ -49,10 +42,8 @@ bool GossipHello_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCrea
}
else
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -80,11 +71,9 @@ bool GossipSelect_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCre
}
return true;
}
void AddSC_ironforge()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_royal_historian_archesonus";
newscript->pGossipHello = &GossipHello_npc_royal_historian_archesonus;
@@ -13,48 +13,37 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Isle_of_Queldanas
SD%Complete: 100
SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541
SDCategory: Isle Of Quel'Danas
EndScriptData */
/* ContentData
npc_converted_sentry
npc_greengill_slave
EndContentData */
#include "precompiled.h"
/*######
## npc_converted_sentry
######*/
#define SAY_CONVERTED_1 -1000284
#define SAY_CONVERTED_2 -1000284
#define SPELL_CONVERT_CREDIT 45009
struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI
{
npc_converted_sentryAI(Creature *c) : ScriptedAI(c) {}
bool Credit;
uint32 Timer;
void Reset()
{
Credit = false;
Timer = 2500;
}
void MoveInLineOfSight(Unit *who)
{ return; }
void EnterCombat(Unit* who)
{ }
void UpdateAI(const uint32 diff)
{
if (!Credit)
@@ -66,7 +55,6 @@ struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI
DoScriptText(SAY_CONVERTED_1, m_creature);
else
DoScriptText(SAY_CONVERTED_2, m_creature);
DoCast(m_creature, SPELL_CONVERT_CREDIT);
if (m_creature->isPet())
CAST_PET(m_creature)->SetDuration(7500);
@@ -79,34 +67,26 @@ CreatureAI* GetAI_npc_converted_sentry(Creature* pCreature)
{
return new npc_converted_sentryAI (pCreature);
}
/*######
## npc_greengill_slave
######*/
#define ENRAGE 45111
#define ORB 45109
#define QUESTG 11541
#define DM 25060
struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
{
npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {}
uint64 PlayerGUID;
void EnterCombat(Unit* who){}
void Reset()
{
PlayerGUID = 0;
}
void SpellHit(Unit* caster, const SpellEntry* spell)
{
if (!caster)
return;
if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE))
{
PlayerGUID = caster->GetGUID();
@@ -125,27 +105,22 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
}
}
}
void UpdateAI(const uint32 diff)
{
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_greengill_slaveAI(Creature* pCreature)
{
return new npc_greengill_slaveAI(pCreature);
}
void AddSC_isle_of_queldanas()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_converted_sentry";
newscript->GetAI = &GetAI_npc_converted_sentry;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_greengill_slave";
newscript->GetAI = &GetAI_npc_greengill_slaveAI;
@@ -13,16 +13,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Curator
SD%Complete: 100
SDComment:
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#define SAY_AGGRO -1532057
#define SAY_SUMMON1 -1532058
#define SAY_SUMMON2 -1532059
@@ -31,27 +28,21 @@ EndScriptData */
#define SAY_KILL1 -1532062
#define SAY_KILL2 -1532063
#define SAY_DEATH -1532064
//Flare spell info
#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage
//Curator spell info
#define SPELL_HATEFUL_BOLT 30383
#define SPELL_EVOCATION 30254
#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage.
#define SPELL_BERSERK 26662
struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
{
boss_curatorAI(Creature *c) : ScriptedAI(c) {}
uint32 AddTimer;
uint32 HatefulBoltTimer;
uint32 BerserkTimer;
bool Enraged;
bool Evocating;
void Reset()
{
AddTimer = 10000;
@@ -59,30 +50,24 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
BerserkTimer = 720000; //12 minutes
Enraged = false;
Evocating = false;
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//always decrease BerserkTimer
if (BerserkTimer < diff)
{
@@ -91,20 +76,15 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
{
if (m_creature->HasAura(SPELL_EVOCATION))
m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION);
Evocating = false;
}
//may not be correct SAY (generic hard enrage)
DoScriptText(SAY_ENRAGE, m_creature);
m_creature->InterruptNonMeleeSpells(true);
DoCast(m_creature, SPELL_BERSERK);
//don't know if he's supposed to do summon/evocate after hard enrage (probably not)
Enraged = true;
}else BerserkTimer -= diff;
if (Evocating)
{
//not supposed to do anything while evocate
@@ -113,7 +93,6 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
else
Evocating = false;
}
if (!Enraged)
{
if (AddTimer < diff)
@@ -122,19 +101,16 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (AstralFlare && target)
{
AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
AstralFlare->AI()->AttackStart(target);
}
//Reduce Mana by 10% of max health
if (int32 mana = m_creature->GetMaxPower(POWER_MANA))
{
mana /= 10;
m_creature->ModifyPower(POWER_MANA, -mana);
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
if (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA) < 10)
{
@@ -153,10 +129,8 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
}
}
}
AddTimer = 10000;
}else AddTimer -= diff;
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15)
{
Enraged = true;
@@ -164,28 +138,22 @@ struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
DoScriptText(SAY_ENRAGE, m_creature);
}
}
if (HatefulBoltTimer < diff)
{
if (Enraged)
HatefulBoltTimer = 7000;
else
HatefulBoltTimer = 15000;
if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
DoCast(target, SPELL_HATEFUL_BOLT);
}else HatefulBoltTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_curator(Creature* pCreature)
{
return new boss_curatorAI (pCreature);
}
void AddSC_boss_curator()
{
Script *newscript;
@@ -13,16 +13,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Maiden_of_Virtue
SD%Complete: 100
SDComment:
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#define SAY_AGGRO -1532018
#define SAY_SLAY1 -1532019
#define SAY_SLAY2 -1532020
@@ -30,25 +27,20 @@ EndScriptData */
#define SAY_REPENTANCE1 -1532022
#define SAY_REPENTANCE2 -1532023
#define SAY_DEATH -1532024
#define SPELL_REPENTANCE 29511
#define SPELL_HOLYFIRE 29522
#define SPELL_HOLYWRATH 32445
#define SPELL_HOLYGROUND 29512
#define SPELL_BERSERK 26662
struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
{
boss_maiden_of_virtueAI(Creature *c) : ScriptedAI(c) {}
uint32 Repentance_Timer;
uint32 Holyfire_Timer;
uint32 Holywrath_Timer;
uint32 Holyground_Timer;
uint32 Enrage_Timer;
bool Enraged;
void Reset()
{
Repentance_Timer = 25000+(rand()%15000);
@@ -56,78 +48,60 @@ struct TRINITY_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI
Holywrath_Timer = 15000+(rand()%10000);
Holyground_Timer = 3000;
Enrage_Timer = 600000;
Enraged = false;
}
void KilledUnit(Unit* Victim)
{
if (urand(0,1) == 0)
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (Enrage_Timer < diff && !Enraged)
{
DoCast(m_creature, SPELL_BERSERK,true);
Enraged = true;
} else Enrage_Timer -=diff;
if (Holyground_Timer < diff)
{
DoCast(m_creature, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
Holyground_Timer = 3000;
} else Holyground_Timer -= diff;
if (Repentance_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_REPENTANCE);
DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), m_creature);
Repentance_Timer = 25000 + rand()%10000; //A little randomness on that spell
} else Repentance_Timer -= diff;
if (Holyfire_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_HOLYFIRE);
Holyfire_Timer = 8000 + rand()%15000; //Anywhere from 8 to 23 seconds, good luck having several of those in a row!
} else Holyfire_Timer -= diff;
if (Holywrath_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_HOLYWRATH);
Holywrath_Timer = 20000+(rand()%5000); //20-30 secs sounds nice
} else Holywrath_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_maiden_of_virtue(Creature* pCreature)
{
return new boss_maiden_of_virtueAI (pCreature);
}
void AddSC_boss_maiden_of_virtue()
{
Script *newscript;
@@ -13,16 +13,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Midnight
SD%Complete: 100
SDComment:
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#define SAY_MIDNIGHT_KILL -1532000
#define SAY_APPEAR1 -1532001
#define SAY_APPEAR2 -1532002
@@ -34,36 +31,27 @@ EndScriptData */
#define SAY_DEATH -1532008
#define SAY_RANDOM1 -1532009
#define SAY_RANDOM2 -1532010
#define SPELL_SHADOWCLEAVE 29832
#define SPELL_INTANGIBLE_PRESENCE 29833
#define SPELL_BERSERKER_CHARGE 26561 //Only when mounted
#define MOUNTED_DISPLAYID 16040
//Attumen (TODO: Use the summoning spell instead of Creature id. It works , but is not convenient for us)
#define SUMMON_ATTUMEN 15550
struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
{
boss_midnightAI(Creature *c) : ScriptedAI(c) {}
uint64 Attumen;
uint8 Phase;
uint32 Mount_Timer;
void Reset()
{
Phase = 1;
Attumen = 0;
Mount_Timer = 0;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetVisibility(VISIBILITY_ON);
}
void EnterCombat(Unit* who) {}
void KilledUnit(Unit *victim)
{
if (Phase == 2)
@@ -72,12 +60,10 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
DoScriptText(SAY_MIDNIGHT_KILL, pUnit);
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95)
{
Phase = 2;
@@ -117,11 +103,9 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
} else Mount_Timer -= diff;
}
}
if (Phase != 3)
DoMeleeAttackIfReady();
}
void Mount(Unit *pAttumen)
{
DoScriptText(SAY_MOUNT, pAttumen);
@@ -146,28 +130,23 @@ struct TRINITY_DLL_DECL boss_midnightAI : public ScriptedAI
//pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
Mount_Timer = 1000;
}
void SetMidnight(Creature *, uint64); //Below ..
};
CreatureAI* GetAI_boss_midnight(Creature* pCreature)
{
return new boss_midnightAI(pCreature);
}
struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
{
boss_attumenAI(Creature *c) : ScriptedAI(c)
{
Phase = 1;
CleaveTimer = urand(10000,15000);
CurseTimer = 30000;
RandomYellTimer = urand(30000,60000); //Occasionally yell
ChargeTimer = 20000;
ResetTimer = 0;
}
uint64 Midnight;
uint8 Phase;
uint32 CleaveTimer;
@@ -175,26 +154,21 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
uint32 RandomYellTimer;
uint32 ChargeTimer; //only when mounted
uint32 ResetTimer;
void Reset()
{
ResetTimer = 2000;
}
void EnterCombat(Unit* who) {}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight))
pMidnight->Kill(pMidnight);
}
void UpdateAI(const uint32 diff)
{
if (ResetTimer)
@@ -213,32 +187,26 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
m_creature->Kill(m_creature);
}
} else ResetTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
return;
if (CleaveTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWCLEAVE);
CleaveTimer = urand(10000,15000);
} else CleaveTimer -= diff;
if (CurseTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
CurseTimer = 30000;
} else CurseTimer -= diff;
if (RandomYellTimer < diff)
{
DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), m_creature);
RandomYellTimer = urand(30000,60000);
} else RandomYellTimer -= diff;
if (m_creature->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
{
if (ChargeTimer < diff)
@@ -246,7 +214,7 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
Unit *target;
std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
for (std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
if (target && !target->IsWithinDist(m_creature, ATTACK_DISTANCE, false))
@@ -255,7 +223,6 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
}
if (target_list.size())
target = *(target_list.begin()+rand()%target_list.size());
DoCast(target, SPELL_BERSERKER_CHARGE);
ChargeTimer = 20000;
} else ChargeTimer -= diff;
@@ -273,27 +240,22 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
}
}
}
DoMeleeAttackIfReady();
}
void SpellHit(Unit *source, const SpellEntry *spell)
{
if (spell->Mechanic == MECHANIC_DISARM)
DoScriptText(SAY_DISARMED, m_creature);
}
};
void boss_midnightAI::SetMidnight(Creature *pAttumen, uint64 value)
{
CAST_AI(boss_attumenAI, pAttumen->AI())->Midnight = value;
}
CreatureAI* GetAI_boss_attumen(Creature* pCreature)
{
return new boss_attumenAI (pCreature);
}
void AddSC_boss_attumen()
{
Script *newscript;
@@ -301,7 +263,6 @@ void AddSC_boss_attumen()
newscript->Name = "boss_attumen";
newscript->GetAI = &GetAI_boss_attumen;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_midnight";
newscript->GetAI = &GetAI_boss_midnight;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Moroes
SD%Complete: 95
SDComment:
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
#define SAY_AGGRO -1532011
#define SAY_SPECIAL_1 -1532012
#define SAY_SPECIAL_2 -1532013
@@ -31,15 +28,12 @@ EndScriptData */
#define SAY_KILL_2 -1532015
#define SAY_KILL_3 -1532016
#define SAY_DEATH -1532017
#define SPELL_VANISH 29448
#define SPELL_GARROTE 37066
#define SPELL_BLIND 34694
#define SPELL_GOUGE 29425
#define SPELL_FRENZY 37023
#define POS_Z 81.73
float Locations[4][3]=
{
{-10991.0, -1884.33, 0.614315},
@@ -47,7 +41,6 @@ float Locations[4][3]=
{-10978.1, -1887.07, 2.035550},
{-10975.9, -1885.81, 2.253890},
};
const uint32 Adds[6]=
{
17007,
@@ -57,32 +50,26 @@ const uint32 Adds[6]=
19875,
19876,
};
struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
{
boss_moroesAI(Creature *c) : ScriptedAI(c)
{
for(uint8 i = 0; i < 4; ++i)
for (uint8 i = 0; i < 4; ++i)
{
AddId[i] = 0;
}
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint64 AddGUID[4];
uint32 Vanish_Timer;
uint32 Blind_Timer;
uint32 Gouge_Timer;
uint32 Wait_Timer;
uint32 CheckAdds_Timer;
uint32 AddId[4];
bool InVanish;
bool Enrage;
void Reset()
{
Vanish_Timer = 30000;
@@ -90,58 +77,45 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
Gouge_Timer = 23000;
Wait_Timer = 0;
CheckAdds_Timer = 5000;
Enrage = false;
InVanish = false;
if (m_creature->GetHealth() > 0)
{
SpawnAdds();
}
if (pInstance)
pInstance->SetData(TYPE_MOROES, NOT_STARTED);
}
void StartEvent()
{
if (pInstance)
pInstance->SetData(TYPE_MOROES, IN_PROGRESS);
DoZoneInCombat();
}
void EnterCombat(Unit* who)
{
StartEvent();
DoScriptText(SAY_AGGRO, m_creature);
AddsAttack();
DoZoneInCombat();
}
void KilledUnit(Unit* victim)
{
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
}
void JustDied(Unit* victim)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(TYPE_MOROES, DONE);
DeSpawnAdds();
//remove aura from spell Garrote when Moroes dies
Map* pMap = m_creature->GetMap();
if (pMap->IsDungeon())
{
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (PlayerList.isEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0))
@@ -149,7 +123,6 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
}
}
}
void SpawnAdds()
{
DeSpawnAdds();
@@ -158,18 +131,14 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
Creature *pCreature = NULL;
std::vector<uint32> AddList;
for(uint8 i = 0; i < 6; ++i)
for (uint8 i = 0; i < 6; ++i)
AddList.push_back(Adds[i]);
while(AddList.size() > 4)
AddList.erase((AddList.begin())+(rand()%AddList.size()));
uint8 i = 0;
for(std::vector<uint32>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr)
for (std::vector<uint32>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr)
{
uint32 entry = *itr;
pCreature = m_creature->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
if (pCreature)
{
@@ -180,7 +149,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
}
}else
{
for(uint8 i = 0; i < 4; ++i)
for (uint8 i = 0; i < 4; ++i)
{
Creature *pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
if (pCreature)
@@ -190,20 +159,18 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
}
}
}
bool isAddlistEmpty()
{
for(uint8 i = 0; i < 4; ++i)
for (uint8 i = 0; i < 4; ++i)
{
if (AddId[i] == 0)
return true;
}
return false;
}
void DeSpawnAdds()
{
for(uint8 i = 0; i < 4 ; ++i)
for (uint8 i = 0; i < 4 ; ++i)
{
Creature* Temp = NULL;
if (AddGUID[i])
@@ -214,10 +181,9 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
}
}
}
void AddsAttack()
{
for(uint8 i = 0; i < 4; ++i)
for (uint8 i = 0; i < 4; ++i)
{
Creature* Temp = NULL;
if (AddGUID[i])
@@ -232,24 +198,20 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
}
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (pInstance && !pInstance->GetData(TYPE_MOROES))
{
EnterEvadeMode();
return;
}
if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
{
DoCast(m_creature, SPELL_FRENZY);
Enrage = true;
}
if (CheckAdds_Timer < diff)
{
for (uint8 i = 0; i < 4; ++i)
@@ -265,7 +227,6 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
}
CheckAdds_Timer = 5000;
} else CheckAdds_Timer -= diff;
if (!Enrage)
{
//Cast Vanish, then Garrote random victim
@@ -276,75 +237,61 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
Vanish_Timer = 30000;
Wait_Timer = 5000;
} else Vanish_Timer -= diff;
if (Gouge_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_GOUGE);
Gouge_Timer = 40000;
} else Gouge_Timer -= diff;
if (Blind_Timer < diff)
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (target && target->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinMeleeRange(target))
{
DoCast(target, SPELL_BLIND);
Blind_Timer = 40000;
}
else
Blind_Timer = 1000;
} else Blind_Timer -= diff;
}
if (InVanish)
{
if (Wait_Timer < diff)
{
DoScriptText(RAND(SAY_SPECIAL_1,SAY_SPECIAL_2), m_creature);
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
target->CastSpell(target, SPELL_GARROTE,true);
InVanish = false;
} else Wait_Timer -= diff;
}
if (!InVanish)
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI
{
ScriptedInstance* pInstance;
uint64 GuestGUID[4];
boss_moroes_guestAI(Creature* c) : ScriptedAI(c)
{
for(uint8 i = 0; i < 4; ++i)
for (uint8 i = 0; i < 4; ++i)
GuestGUID[i] = 0;
pInstance = c->GetInstanceData();
}
void Reset()
{
if (pInstance)
pInstance->SetData(TYPE_MOROES, NOT_STARTED);
}
void AcquireGUID()
{
if (!pInstance)
return;
GuestGUID[0] = pInstance->GetData64(DATA_MOROES);
Creature* Moroes = (Unit::GetCreature((*m_creature), GuestGUID[0]));
if (Moroes)
{
for(uint8 i = 0; i < 3; ++i)
for (uint8 i = 0; i < 3; ++i)
{
uint64 GUID = CAST_AI(boss_moroesAI, Moroes->AI())->AddGUID[i];
if (GUID && GUID != m_creature->GetGUID())
@@ -352,7 +299,6 @@ struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI
}
}
}
Unit* SelectTarget()
{
uint64 TempGUID = GuestGUID[rand()%5];
@@ -362,57 +308,44 @@ struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI
if (pUnit && pUnit->isAlive())
return pUnit;
}
return m_creature;
}
void UpdateAI(const uint32 diff)
{
if (pInstance && !pInstance->GetData(TYPE_MOROES))
EnterEvadeMode();
DoMeleeAttackIfReady();
}
};
#define SPELL_MANABURN 29405
#define SPELL_MINDFLY 29570
#define SPELL_SWPAIN 34441
#define SPELL_SHADOWFORM 29406
struct TRINITY_DLL_DECL boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
{
//Shadow Priest
boss_baroness_dorothea_millstipeAI(Creature *c) : boss_moroes_guestAI(c) {}
uint32 ManaBurn_Timer;
uint32 MindFlay_Timer;
uint32 ShadowWordPain_Timer;
void Reset()
{
ManaBurn_Timer = 7000;
MindFlay_Timer = 1000;
ShadowWordPain_Timer = 6000;
DoCast(m_creature,SPELL_SHADOWFORM, true);
boss_moroes_guestAI::Reset();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
boss_moroes_guestAI::UpdateAI(diff);
if (MindFlay_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MINDFLY);
MindFlay_Timer = 12000; //3sec channeled
}else MindFlay_Timer -= diff;
if (ManaBurn_Timer < diff)
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -420,7 +353,6 @@ struct TRINITY_DLL_DECL boss_baroness_dorothea_millstipeAI : public boss_moroes_
DoCast(target,SPELL_MANABURN);
ManaBurn_Timer = 5000; //3 sec cast
}else ManaBurn_Timer -= diff;
if (ShadowWordPain_Timer < diff)
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -432,49 +364,39 @@ struct TRINITY_DLL_DECL boss_baroness_dorothea_millstipeAI : public boss_moroes_
}else ShadowWordPain_Timer -= diff;
}
};
#define SPELL_HAMMEROFJUSTICE 13005
#define SPELL_JUDGEMENTOFCOMMAND 29386
#define SPELL_SEALOFCOMMAND 29385
struct TRINITY_DLL_DECL boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
{
//Retr Pally
boss_baron_rafe_dreugerAI(Creature *c) : boss_moroes_guestAI(c){}
uint32 HammerOfJustice_Timer;
uint32 SealOfCommand_Timer;
uint32 JudgementOfCommand_Timer;
void Reset()
{
HammerOfJustice_Timer = 1000;
SealOfCommand_Timer = 7000;
JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
boss_moroes_guestAI::Reset();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
boss_moroes_guestAI::UpdateAI(diff);
if (SealOfCommand_Timer < diff)
{
DoCast(m_creature,SPELL_SEALOFCOMMAND);
SealOfCommand_Timer = 32000;
JudgementOfCommand_Timer = 29000;
}else SealOfCommand_Timer -= diff;
if (JudgementOfCommand_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_JUDGEMENTOFCOMMAND);
JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
}else JudgementOfCommand_Timer -= diff;
if (HammerOfJustice_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE);
@@ -482,186 +404,144 @@ struct TRINITY_DLL_DECL boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
}else HammerOfJustice_Timer -= diff;
}
};
#define SPELL_DISPELMAGIC 15090 //Self or other guest+Moroes
#define SPELL_GREATERHEAL 29564 //Self or other guest+Moroes
#define SPELL_HOLYFIRE 29563
#define SPELL_PWSHIELD 29408
struct TRINITY_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
{
//Holy Priest
boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {}
uint32 DispelMagic_Timer;
uint32 GreaterHeal_Timer;
uint32 HolyFire_Timer;
uint32 PowerWordShield_Timer;
void Reset()
{
DispelMagic_Timer = 11000;
GreaterHeal_Timer = 1500;
HolyFire_Timer = 5000;
PowerWordShield_Timer = 1000;
AcquireGUID();
boss_moroes_guestAI::Reset();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
boss_moroes_guestAI::UpdateAI(diff);
if (PowerWordShield_Timer < diff)
{
DoCast(m_creature,SPELL_PWSHIELD);
PowerWordShield_Timer = 15000;
}else PowerWordShield_Timer -= diff;
if (GreaterHeal_Timer < diff)
{
Unit* target = SelectTarget();
DoCast(target, SPELL_GREATERHEAL);
GreaterHeal_Timer = 17000;
}else GreaterHeal_Timer -= diff;
if (HolyFire_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_HOLYFIRE);
HolyFire_Timer = 22000;
}else HolyFire_Timer -= diff;
if (DispelMagic_Timer < diff)
{
if (rand()%2)
{
Unit* target = SelectTarget();
DoCast(target, SPELL_DISPELMAGIC);
}
else
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPELMAGIC);
DispelMagic_Timer = 25000;
}else DispelMagic_Timer -= diff;
}
};
#define SPELL_CLEANSE 29380 //Self or other guest+Moroes
#define SPELL_GREATERBLESSOFMIGHT 29381 //Self or other guest+Moroes
#define SPELL_HOLYLIGHT 29562 //Self or other guest+Moroes
#define SPELL_DIVINESHIELD 41367
struct TRINITY_DLL_DECL boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
{
//Holy Pally
boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {}
uint32 Cleanse_Timer;
uint32 GreaterBless_Timer;
uint32 HolyLight_Timer;
uint32 DivineShield_Timer;
void Reset()
{
Cleanse_Timer = 13000;
GreaterBless_Timer = 1000;
HolyLight_Timer = 7000;
DivineShield_Timer = 31000;
AcquireGUID();
boss_moroes_guestAI::Reset();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
boss_moroes_guestAI::UpdateAI(diff);
if (DivineShield_Timer < diff)
{
DoCast(m_creature,SPELL_DIVINESHIELD);
DivineShield_Timer = 31000;
}else DivineShield_Timer -= diff;
if (HolyLight_Timer < diff)
{
Unit* target = SelectTarget();
DoCast(target, SPELL_HOLYLIGHT);
HolyLight_Timer = 10000;
}else HolyLight_Timer -= diff;
if (GreaterBless_Timer < diff)
{
Unit* target = SelectTarget();
DoCast(target, SPELL_GREATERBLESSOFMIGHT);
GreaterBless_Timer = 50000;
}else GreaterBless_Timer -= diff;
if (Cleanse_Timer < diff)
{
Unit* target = SelectTarget();
DoCast(target, SPELL_CLEANSE);
Cleanse_Timer = 10000;
}else Cleanse_Timer -= diff;
}
};
#define SPELL_HAMSTRING 9080
#define SPELL_MORTALSTRIKE 29572
#define SPELL_WHIRLWIND 29573
struct TRINITY_DLL_DECL boss_lord_robin_darisAI : public boss_moroes_guestAI
{
//Arms Warr
boss_lord_robin_darisAI(Creature *c) : boss_moroes_guestAI(c) {}
uint32 Hamstring_Timer;
uint32 MortalStrike_Timer;
uint32 WhirlWind_Timer;
void Reset()
{
Hamstring_Timer = 7000;
MortalStrike_Timer = 10000;
WhirlWind_Timer = 21000;
boss_moroes_guestAI::Reset();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
boss_moroes_guestAI::UpdateAI(diff);
if (Hamstring_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_HAMSTRING);
Hamstring_Timer = 12000;
}else Hamstring_Timer -= diff;
if (MortalStrike_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 18000;
}else MortalStrike_Timer -= diff;
if (WhirlWind_Timer < diff)
{
DoCast(m_creature,SPELL_WHIRLWIND);
@@ -669,57 +549,46 @@ struct TRINITY_DLL_DECL boss_lord_robin_darisAI : public boss_moroes_guestAI
}else WhirlWind_Timer -= diff;
}
};
#define SPELL_DISARM 8379
#define SPELL_HEROICSTRIKE 29567
#define SPELL_SHIELDBASH 11972
#define SPELL_SHIELDWALL 29390
struct TRINITY_DLL_DECL boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
{
//Arms Warr
boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {}
uint32 Disarm_Timer;
uint32 HeroicStrike_Timer;
uint32 ShieldBash_Timer;
uint32 ShieldWall_Timer;
void Reset()
{
Disarm_Timer = 6000;
HeroicStrike_Timer = 10000;
ShieldBash_Timer = 8000;
ShieldWall_Timer = 4000;
boss_moroes_guestAI::Reset();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
boss_moroes_guestAI::UpdateAI(diff);
if (Disarm_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_DISARM);
Disarm_Timer = 12000;
}else Disarm_Timer -= diff;
if (HeroicStrike_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_HEROICSTRIKE);
HeroicStrike_Timer = 10000;
}else HeroicStrike_Timer -= diff;
if (ShieldBash_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHIELDBASH);
ShieldBash_Timer = 13000;
}else ShieldBash_Timer -= diff;
if (ShieldWall_Timer < diff)
{
DoCast(m_creature,SPELL_SHIELDWALL);
@@ -727,76 +596,61 @@ struct TRINITY_DLL_DECL boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
}else ShieldWall_Timer -= diff;
}
};
CreatureAI* GetAI_boss_moroes(Creature* pCreature)
{
return new boss_moroesAI (pCreature);
}
CreatureAI* GetAI_baroness_dorothea_millstipe(Creature* pCreature)
{
return new boss_baroness_dorothea_millstipeAI (pCreature);
}
CreatureAI* GetAI_baron_rafe_dreuger(Creature* pCreature)
{
return new boss_baron_rafe_dreugerAI (pCreature);
}
CreatureAI* GetAI_lady_catriona_von_indi(Creature* pCreature)
{
return new boss_lady_catriona_von_indiAI (pCreature);
}
CreatureAI* GetAI_lady_keira_berrybuck(Creature* pCreature)
{
return new boss_lady_keira_berrybuckAI (pCreature);
}
CreatureAI* GetAI_lord_robin_daris(Creature* pCreature)
{
return new boss_lord_robin_darisAI (pCreature);
}
CreatureAI* GetAI_lord_crispin_ference(Creature* pCreature)
{
return new boss_lord_crispin_ferenceAI (pCreature);
}
void AddSC_boss_moroes()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_moroes";
newscript->GetAI = &GetAI_boss_moroes;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_baroness_dorothea_millstipe";
newscript->GetAI = &GetAI_baroness_dorothea_millstipe;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_baron_rafe_dreuger";
newscript->GetAI = &GetAI_baron_rafe_dreuger;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_lady_catriona_von_indi";
newscript->GetAI = &GetAI_lady_catriona_von_indi;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_lady_keira_berrybuck";
newscript->GetAI = &GetAI_lady_keira_berrybuck;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_lord_robin_daris";
newscript->GetAI = &GetAI_lord_robin_daris;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_lord_crispin_ference";
newscript->GetAI = &GetAI_lord_crispin_ference;
@@ -13,20 +13,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Netherspite
SD%Complete: 90
SDComment: Not sure about timing and portals placing
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
#define EMOTE_PHASE_PORTAL -1532089
#define EMOTE_PHASE_BANISH -1532090
#define SPELL_NETHERBURN_AURA 30522
#define SPELL_VOIDZONE 37063
#define SPELL_NETHER_INFUSION 38688
@@ -35,49 +31,42 @@ EndScriptData */
#define SPELL_BANISH_ROOT 42716
#define SPELL_EMPOWERMENT 38549
#define SPELL_NETHERSPITE_ROAR 38684
const float PortalCoord[3][3] =
{
{-11195.353516, -1613.237183, 278.237258}, // Left side
{-11137.846680, -1685.607422, 278.239258}, // Right side
{-11094.493164, -1591.969238, 279.949188} // Back side
};
enum Netherspite_Portal{
RED_PORTAL = 0, // Perseverence
GREEN_PORTAL = 1, // Serenity
BLUE_PORTAL = 2 // Dominance
};
const uint32 PortalID[3] = {17369, 17367, 17368};
const uint32 PortalVisual[3] = {30487,30490,30491};
const uint32 PortalBeam[3] = {30465,30464,30463};
const uint32 PlayerBuff[3] = {30421,30422,30423};
const uint32 NetherBuff[3] = {30466,30467,30468};
const uint32 PlayerDebuff[3] = {38637,38638,38639};
struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
{
boss_netherspiteAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
for(int i=0; i<3; ++i)
for (int i=0; i<3; ++i)
{
PortalGUID[i] = 0;
BeamTarget[i] = 0;
BeamerGUID[i] = 0;
}
// need core fix
for(int i=0; i<3; ++i)
for (int i=0; i<3; ++i)
{
if(SpellEntry *spell = (SpellEntry*)GetSpellStore()->LookupEntry(PlayerBuff[i]))
spell->AttributesEx |= SPELL_ATTR_EX_NEGATIVE;
}
}
ScriptedInstance* pInstance;
bool PortalPhase;
bool Berserk;
uint32 PhaseTimer; // timer for phase switching
@@ -89,12 +78,10 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
uint64 PortalGUID[3]; // guid's of portals
uint64 BeamerGUID[3]; // guid's of auxiliary beaming portals
uint64 BeamTarget[3]; // guid's of portals' current targets
bool IsBetween(WorldObject* u1, WorldObject* target, WorldObject* u2) // the in-line checker
{
if(!u1 || !u2 || !target)
return false;
float xn, yn, xp, yp, xh, yh;
xn = u1->GetPositionX();
yn = u1->GetPositionY();
@@ -102,30 +89,25 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
yp = u2->GetPositionY();
xh = target->GetPositionX();
yh = target->GetPositionY();
// check if target is between (not checking distance from the beam yet)
if(dist(xn,yn,xh,yh)>=dist(xn,yn,xp,yp) || dist(xp,yp,xh,yh)>=dist(xn,yn,xp,yp))
return false;
// check distance from the beam
return (abs((xn-xp)*yh+(yp-yn)*xh-xn*yp+xp*yn)/dist(xn,yn,xp,yp) < 1.5f);
}
float dist(float xa, float ya, float xb, float yb) // auxiliary method for distance
{
return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
}
void Reset()
{
Berserk = false;
NetherInfusionTimer = 540000;
VoidZoneTimer = 15000;
NetherbreathTimer = 3000;
HandleDoors(true);
DestroyPortals();
}
void SummonPortals()
{
uint8 r = rand()%4;
@@ -133,18 +115,16 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
pos[RED_PORTAL] = (r%2 ? (r>1 ? 2: 1): 0);
pos[GREEN_PORTAL] = (r%2 ? 0: (r>1 ? 2: 1));
pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0)
for(int i=0; i<3; ++i)
for (int i=0; i<3; ++i)
if(Creature *portal = m_creature->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
{
PortalGUID[i] = portal->GetGUID();
portal->AddAura(PortalVisual[i], portal);
}
}
void DestroyPortals()
{
for(int i=0; i<3; ++i)
for (int i=0; i<3; ++i)
{
if(Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[i]))
portal->DisappearAndDie();
@@ -154,23 +134,20 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
BeamTarget[i] = 0;
}
}
void UpdatePortals() // Here we handle the beams' behavior
{
for(int j=0; j<3; ++j) // j = color
for (int j=0; j<3; ++j) // j = color
if(Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[j]))
{
// the one who's been casted upon before
Unit *current = Unit::GetUnit(*portal, BeamTarget[j]);
// temporary store for the best suitable beam reciever
Unit *target = m_creature;
if(Map* map = m_creature->GetMap())
{
Map::PlayerList const& players = map->GetPlayers();
// get the best suitable target
for(Map::PlayerList::const_iterator i = players.begin(); i!=players.end(); ++i)
for (Map::PlayerList::const_iterator i = players.begin(); i!=players.end(); ++i)
{
Player* p = i->getSource();
if(p && p->isAlive() // alive
@@ -211,7 +188,6 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
m_creature->getThreatManager().addThreat(target, 100000.0f+DoGetThreat(m_creature->getVictim()));
}
}
void SwitchToPortalPhase()
{
m_creature->RemoveAurasDueToSpell(SPELL_BANISH_ROOT);
@@ -223,7 +199,6 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
EmpowermentTimer = 10000;
DoScriptText(EMOTE_PHASE_PORTAL,m_creature);
}
void SwitchToBanishPhase()
{
m_creature->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
@@ -234,41 +209,34 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
PhaseTimer = 30000;
PortalPhase = false;
DoScriptText(EMOTE_PHASE_BANISH,m_creature);
for(int i=0; i<3; ++i)
for (int i=0; i<3; ++i)
m_creature->RemoveAurasDueToSpell(NetherBuff[i]);
}
void HandleDoors(bool open) // Massive Door switcher
{
if(GameObject *Door = GameObject::GetGameObject(*m_creature, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
}
void Aggro(Unit *who)
{
HandleDoors(false);
SwitchToPortalPhase();
}
void JustDied(Unit* killer)
{
HandleDoors(true);
DestroyPortals();
}
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
// Void Zone
if(VoidZoneTimer < diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,45,true),SPELL_VOIDZONE,true);
VoidZoneTimer = 15000;
}else VoidZoneTimer -= diff;
// NetherInfusion Berserk
if(!Berserk && NetherInfusionTimer < diff)
{
@@ -276,7 +244,6 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
DoCast(m_creature, SPELL_NETHERSPITE_ROAR);
Berserk = true;
}else NetherInfusionTimer -= diff;
if(PortalPhase) // PORTAL PHASE
{
// Distribute beams and buffs
@@ -285,7 +252,6 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
UpdatePortals();
PortalTimer = 1000;
}else PortalTimer -= diff;
// Empowerment & Nether Burn
if(EmpowermentTimer < diff)
{
@@ -293,7 +259,6 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
m_creature->AddAura(SPELL_NETHERBURN_AURA, m_creature);
EmpowermentTimer = 90000;
}else EmpowermentTimer -= diff;
if(PhaseTimer < diff)
{
if(!m_creature->IsNonMeleeSpellCasted(false))
@@ -312,7 +277,6 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
DoCast(target,SPELL_NETHERBREATH);
NetherbreathTimer = 5000+rand()%2000;
}else NetherbreathTimer -= diff;
if(PhaseTimer < diff)
{
if(!m_creature->IsNonMeleeSpellCasted(false))
@@ -322,20 +286,16 @@ struct TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI
}
}else PhaseTimer -= diff;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_netherspite(Creature *_Creature)
{
return new boss_netherspiteAI(_Creature);
}
void AddSC_boss_netherspite()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_netherspite";
newscript->GetAI = GetAI_boss_netherspite;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Nightbane
SD%Complete: 80
SDComment: SDComment: Timers may incorrect
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
//phase 1
#define SPELL_BELLOWING_ROAR 39427
#define SPELL_CHARRED_EARTH 30129
@@ -36,14 +33,12 @@ EndScriptData */
#define SPELL_FIREBALL_BARRAGE 30282
#define SPELL_SEARING_CINDERS 30127
#define SPELL_SUMMON_SKELETON 30170
#define EMOTE_SUMMON "An ancient being awakens in the distance..."
#define YELL_AGGRO "What fools! I shall bring a quick end to your suffering!"
#define YELL_FLY_PHASE "Miserable vermin. I shall exterminate you from the air!"
#define YELL_LAND_PHASE_1 "Enough! I shall land and crush you myself!"
#define YELL_LAND_PHASE_2 "Insects! Let me show you my strength up close!"
#define EMOTE_BREATH "takes a deep breath."
float IntroWay[8][3] =
{
{-11053.37,-1794.48,149},
@@ -55,7 +50,6 @@ float IntroWay[8][3] =
{-11140 , -1915 ,122},
{-11163 , -1903 ,91.473}
};
struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
{
boss_nightbaneAI(Creature* c) : ScriptedAI(c)
@@ -63,14 +57,10 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
pInstance = c->GetInstanceData();
Intro = true;
}
ScriptedInstance* pInstance;
uint32 Phase;
bool RainBones;
bool Skeletons;
uint32 BellowingRoarTimer;
uint32 CharredEarthTimer;
uint32 DistractingAshTimer;
@@ -80,17 +70,13 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
uint32 SmokingBlastTimer;
uint32 FireballBarrageTimer;
uint32 SearingCindersTimer;
uint32 FlyCount;
uint32 FlyTimer;
bool Intro;
bool Flying;
bool Movement;
uint32 WaitTimer;
uint32 MovePhase;
void Reset()
{
BellowingRoarTimer = 30000;
@@ -103,16 +89,13 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
FireballBarrageTimer = 13000;
SearingCindersTimer = 14000;
WaitTimer = 1000;
Phase =1;
FlyCount = 0;
MovePhase = 0;
m_creature->SetSpeed(MOVE_RUN, 2.0f);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->setActive(true);
if (pInstance)
{
if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
@@ -120,19 +103,15 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
else
pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
}
HandleTerraceDoors(true);
Flying = false;
Movement = false;
if (!Intro)
{
m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
m_creature->GetMotionMaster()->MoveTargetedHome();
}
}
void HandleTerraceDoors(bool open)
{
if(pInstance)
@@ -141,41 +120,33 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open);
}
}
void EnterCombat(Unit *who)
{
if (pInstance)
pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
HandleTerraceDoors(false);
m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
}
void AttackStart(Unit* who)
{
if (!Intro && !Flying)
ScriptedAI::AttackStart(who);
}
void JustDied(Unit* killer)
{
if (pInstance)
pInstance->SetData(TYPE_NIGHTBANE, DONE);
HandleTerraceDoors(true);
}
void MoveInLineOfSight(Unit *who)
{
if (!Intro && !Flying)
ScriptedAI::MoveInLineOfSight(who);
}
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE)
return;
if (Intro)
{
if (id >= 8)
@@ -184,10 +155,8 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
return;
}
WaitTimer = 1;
}
if (Flying)
{
if (id == 0)
@@ -197,14 +166,12 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
Phase = 2;
return;
}
if (id == 3)
{
MovePhase = 4;
WaitTimer = 1;
return;
}
if (id == 8)
{
Flying = false;
@@ -212,36 +179,28 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
Movement = true;
return;
}
WaitTimer = 1;
}
}
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature->getVictim());
}
void TakeOff()
{
m_creature->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
(*m_creature).GetMotionMaster()->Clear(false);
(*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
Flying = true;
FlyTimer = 45000+rand()%15000; //timer wrong between 45 and 60 seconds
++FlyCount;
RainofBonesTimer = 5000; //timer wrong (maybe)
RainBones = false;
Skeletons = false;
}
void UpdateAI(const uint32 diff)
{
if (WaitTimer)
@@ -261,7 +220,6 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
++MovePhase;
}
}
if (Flying)
{
if (MovePhase >= 7)
@@ -276,16 +234,12 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
++MovePhase;
}
}
WaitTimer = 0;
}else WaitTimer -= diff;
if (!UpdateVictim())
return;
if (Flying)
return;
// Phase 1 "GROUND FIGHT"
if (Phase == 1)
{
@@ -294,26 +248,22 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
DoStartMovement(m_creature->getVictim());
Movement = false;
}
if (BellowingRoarTimer < diff)
{
DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR);
BellowingRoarTimer = 30000+rand()%10000 ; //Timer
}else BellowingRoarTimer -= diff;
if (SmolderingBreathTimer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH);
SmolderingBreathTimer = 20000;//timer
}else SmolderingBreathTimer -= diff;
if (CharredEarthTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target,SPELL_CHARRED_EARTH);
CharredEarthTimer = 20000; //timer
}else CharredEarthTimer -= diff;
if (TailSweepTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
@@ -321,29 +271,22 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
DoCast(target,SPELL_TAIL_SWEEP);
TailSweepTimer = 15000;//timer
}else TailSweepTimer -= diff;
if (SearingCindersTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target,SPELL_SEARING_CINDERS);
SearingCindersTimer = 10000; //timer
}else SearingCindersTimer -= diff;
uint32 Prozent;
Prozent = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
if (Prozent < 75 && FlyCount == 0) // first take off 75%
TakeOff();
if (Prozent < 50 && FlyCount == 1) // secound take off 50%
TakeOff();
if (Prozent < 25 && FlyCount == 2) // third take off 25%
TakeOff();
DoMeleeAttackIfReady();
}
//Phase 2 "FLYING FIGHT"
if (Phase == 2)
{
@@ -357,14 +300,12 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
Skeletons = true;
}
}
if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
{
DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES);
RainBones = true;
SmokingBlastTimer = 20000;
}else RainofBonesTimer -= diff;
if (DistractingAshTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
@@ -372,7 +313,6 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
DistractingAshTimer = 2000;//timer wrong
}else DistractingAshTimer -= diff;
}
if (RainBones)
{
if (SmokingBlastTimer < diff)
@@ -381,35 +321,29 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
SmokingBlastTimer = 1500 ; //timer wrong
}else SmokingBlastTimer -= diff;
}
if (FireballBarrageTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0))
DoCast(target,SPELL_FIREBALL_BARRAGE);
FireballBarrageTimer = 20000; //Timer
}else FireballBarrageTimer -= diff;
if (FlyTimer < diff) //landing
{
if (rand()%2 == 0)
m_creature->MonsterYell(YELL_LAND_PHASE_1, LANG_UNIVERSAL, NULL);
else
m_creature->MonsterYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL);
(*m_creature).GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
Flying = true;
}else FlyTimer -= diff;
}
}
};
CreatureAI* GetAI_boss_nightbane(Creature* pCreature)
{
return new boss_nightbaneAI (pCreature);
}
void AddSC_boss_nightbane()
{
Script *newscript;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Prince_Malchezzar
SD%Complete: 100
SDComment:
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
#define SAY_AGGRO -1532091
#define SAY_AXE_TOSS1 -1532092
#define SAY_AXE_TOSS2 -1532093
@@ -36,15 +33,12 @@ EndScriptData */
#define SAY_SUMMON1 -1532100
#define SAY_SUMMON2 -1532101
#define SAY_DEATH -1532102
// 18 Coordinates for Infernal spawns
struct InfernalPoint
{
float x,y;
};
#define INFERNAL_Z 275.5
static InfernalPoint InfernalPoints[] =
{
{-10922.8, -1985.2},
@@ -66,16 +60,12 @@ static InfernalPoint InfernalPoints[] =
{-10932.8, -1979.6},
{-10935.7, -1996.0}
};
#define TOTAL_INFERNAL_POINTS 18
//Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends
//Along with reducing healing and regen while enfeebled to 0%
//This spell effect will only reduce healing
#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2
#define SPELL_ENFEEBLE_EFFECT 41624
#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases
#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though)
#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2
@@ -87,27 +77,21 @@ static InfernalPoint InfernalPoints[] =
#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura
#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature
#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3
#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects
#define SPELL_INFERNAL_RELAY 30834
#define EQUIP_ID_AXE 33542 //Axes info
//---------Infernal code first
struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
{
netherspite_infernalAI(Creature *c) : ScriptedAI(c) ,
malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {}
uint32 HellfireTimer;
uint32 CleanupTimer;
uint32 malchezaar;
InfernalPoint *point;
void Reset() {}
void EnterCombat(Unit *who) {}
void MoveInLineOfSight(Unit *who) {}
void UpdateAI(const uint32 diff)
{
if (HellfireTimer)
@@ -117,7 +101,6 @@ struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
HellfireTimer = 0;
}
else HellfireTimer -= diff;
if (CleanupTimer)
if (CleanupTimer <= diff)
{
@@ -125,14 +108,12 @@ struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
CleanupTimer = 0;
} else CleanupTimer -= diff;
}
void KilledUnit(Unit *who)
{
Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
if (pMalchezaar)
CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
}
void SpellHit(Unit *who, const SpellEntry *spell)
{
if (spell->Id == SPELL_INFERNAL_RELAY)
@@ -143,23 +124,19 @@ struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
CleanupTimer = 170000;
}
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (done_by->GetGUID() != malchezaar)
damage = 0;
}
void Cleanup(); //below ...
};
struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
{
boss_malchezaarAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint32 EnfeebleTimer;
uint32 EnfeebleResetTimer;
@@ -171,29 +148,22 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
uint32 InfernalTimer;
uint32 AxesTargetSwitchTimer;
uint32 InfernalCleanupTimer;
std::vector<uint64> infernals;
std::vector<InfernalPoint*> positions;
uint64 axes[2];
uint64 enfeeble_targets[5];
uint64 enfeeble_health[5];
uint32 phase;
void Reset()
{
AxesCleanup();
ClearWeapons();
InfernalCleanup();
positions.clear();
for(uint8 i =0; i < 5; ++i)
for (uint8 i =0; i < 5; ++i)
enfeeble_targets[i] = 0;
for(uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
positions.push_back(&InfernalPoints[i]);
EnfeebleTimer = 30000;
EnfeebleResetTimer = 38000;
ShadowNovaTimer = 35500;
@@ -205,44 +175,35 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
AxesTargetSwitchTimer = 7500 + rand()%12500;
SunderArmorTimer = 5000 + rand()%5000;
phase = 1;
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
AxesCleanup();
ClearWeapons();
InfernalCleanup();
positions.clear();
for(uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i)
positions.push_back(&InfernalPoints[i]);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
}
void InfernalCleanup()
{
//Infernal Cleanup
for(std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
for (std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
{
Unit *pInfernal = Unit::GetUnit(*m_creature, *itr);
if (pInfernal && pInfernal->isAlive())
@@ -253,10 +214,9 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
}
infernals.clear();
}
void AxesCleanup()
{
for(uint8 i=0; i<2; ++i)
for (uint8 i=0; i<2; ++i)
{
Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
if (axe && axe->isAlive())
@@ -264,64 +224,53 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
axes[i] = 0;
}
}
void ClearWeapons()
{
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
//damage
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
m_creature->UpdateDamagePhysical(BASE_ATTACK);
}
void EnfeebleHealthEffect()
{
const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT);
if (!info)
return;
std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
std::vector<Unit *> targets;
if (!t_list.size())
return;
//begin + 1 , so we don't target the one with the highest threat
std::list<HostilReference *>::iterator itr = t_list.begin();
std::advance(itr, 1);
for(; itr!= t_list.end(); ++itr) //store the threat list in a different container
for (; itr!= t_list.end(); ++itr) //store the threat list in a different container
{
Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
//only on alive players
if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
targets.push_back(target);
}
//cut down to size if we have more than 5 targets
while(targets.size() > 5)
targets.erase(targets.begin()+rand()%targets.size());
int i = 0;
for(std::vector<Unit *>::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i)
for (std::vector<Unit *>::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i)
{
Unit *target = *iter;
if (target)
{
enfeeble_targets[i] = target->GetGUID();
enfeeble_health[i] = target->GetHealth();
target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID());
target->SetHealth(1);
}
}
}
void EnfeebleResetHealth()
{
for(uint8 i = 0; i < 5; ++i)
for (uint8 i = 0; i < 5; ++i)
{
Unit *target = Unit::GetUnit(*m_creature, enfeeble_targets[i]);
if (target && target->isAlive())
@@ -330,7 +279,6 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
enfeeble_health[i] = 0;
}
}
void SummonInfernal(const uint32 diff)
{
InfernalPoint *point = NULL;
@@ -344,9 +292,7 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
positions.erase(itr);
pos.Relocate(point->x, point->y, INFERNAL_Z);
}
Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
if (Infernal)
{
Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
@@ -354,64 +300,49 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
if (point)
CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point;
CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=m_creature->GetGUID();
infernals.push_back(Infernal->GetGUID());
DoCast(Infernal, SPELL_INFERNAL_RELAY);
}
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (EnfeebleResetTimer)
if (EnfeebleResetTimer <= diff) //Let's not forget to reset that
{
EnfeebleResetHealth();
EnfeebleResetTimer=0;
}else EnfeebleResetTimer -= diff;
if (m_creature->hasUnitState(UNIT_STAT_STUNNED)) //While shifting to phase 2 malchezaar stuns himself
return;
if (m_creature->GetUInt64Value(UNIT_FIELD_TARGET)!=m_creature->getVictim()->GetGUID())
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID());
if (phase == 1)
{
if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 60)
{
m_creature->InterruptNonMeleeSpells(false);
phase = 2;
//animation
DoCast(m_creature, SPELL_EQUIP_AXES);
//text
DoScriptText(SAY_AXE_TOSS1, m_creature);
//passive thrash aura
m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true);
//models
SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE);
//damage
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
m_creature->UpdateDamagePhysical(BASE_ATTACK);
m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
m_creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
//Sigh, updating only works on main attack , do it manually ....
m_creature->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
m_creature->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100);
}
}
@@ -420,18 +351,13 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30)
{
InfernalTimer = 15000;
phase = 3;
ClearWeapons();
//remove thrash
m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
DoScriptText(SAY_AXE_TOSS2, m_creature);
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
for(uint32 i=0; i<2; ++i)
for (uint32 i=0; i<2; ++i)
{
Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (axe)
@@ -448,25 +374,19 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
}
}
}
if (ShadowNovaTimer > 35000)
ShadowNovaTimer = EnfeebleTimer + 5000;
return;
}
if (SunderArmorTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR);
SunderArmorTimer = 10000 + rand()%8000;
}else SunderArmorTimer -= diff;
if (Cleave_Timer < diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 6000 + rand()%6000;
}else Cleave_Timer -= diff;
}
else
@@ -474,11 +394,10 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
if (AxesTargetSwitchTimer < diff)
{
AxesTargetSwitchTimer = 7500 + rand()%12500 ;
Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (target)
{
for(uint8 i = 0; i < 2; ++i)
for (uint8 i = 0; i < 2; ++i)
{
Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
if (axe)
@@ -494,27 +413,23 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
}
}
} else AxesTargetSwitchTimer -= diff;
if (AmplifyDamageTimer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AMPLIFY_DAMAGE);
AmplifyDamageTimer = 20000 + rand()%10000;
}else AmplifyDamageTimer -= diff;
}
//Time for global and double timers
if (InfernalTimer < diff)
{
SummonInfernal(diff);
InfernalTimer = phase == 3 ? 14500 : 44500; //15 secs in phase 3, 45 otherwise
}else InfernalTimer -= diff;
if (ShadowNovaTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWNOVA);
ShadowNovaTimer = phase == 3 ? 31000 : -1;
}else ShadowNovaTimer -= diff;
if (phase != 2)
{
if (SWPainTimer < diff)
@@ -524,14 +439,11 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
target = m_creature->getVictim(); // the tank
else //anyone but the tank
target = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (target)
DoCast(target, SPELL_SW_PAIN);
SWPainTimer = 20000;
}else SWPainTimer -= diff;
}
if (phase != 3)
{
if (EnfeebleTimer < diff)
@@ -542,13 +454,11 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
EnfeebleResetTimer = 9000;
}else EnfeebleTimer -= diff;
}
if (phase==2)
DoMeleeAttacksIfReady();
else
DoMeleeAttackIfReady();
}
void DoMeleeAttacksIfReady()
{
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()) && !m_creature->IsNonMeleeSpellCasted(false))
@@ -567,38 +477,31 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
}
}
}
void Cleanup(Creature *infernal, InfernalPoint *point)
{
for(std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
for (std::vector<uint64>::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr)
if (*itr == infernal->GetGUID())
{
infernals.erase(itr);
break;
}
positions.push_back(point);
}
};
void netherspite_infernalAI::Cleanup()
{
Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
if (pMalchezaar && pMalchezaar->isAlive())
CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(m_creature, point);
}
CreatureAI* GetAI_netherspite_infernal(Creature* pCreature)
{
return new netherspite_infernalAI (pCreature);
}
CreatureAI* GetAI_boss_malchezaar(Creature* pCreature)
{
return new boss_malchezaarAI (pCreature);
}
void AddSC_boss_malchezaar()
{
Script *newscript;
@@ -606,7 +509,6 @@ void AddSC_boss_malchezaar()
newscript->Name = "boss_malchezaar";
newscript->GetAI = &GetAI_boss_malchezaar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "netherspite_infernal";
newscript->GetAI = &GetAI_netherspite_infernal;
@@ -13,19 +13,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Shade_of_Aran
SD%Complete: 95
SDComment: Flame wreath missing cast animation, mods won't triggere.
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#include "simple_ai.h"
#include "def_karazhan.h"
#include "GameObject.h"
#define SAY_AGGRO1 -1532073
#define SAY_AGGRO2 -1532074
#define SAY_AGGRO3 -1532075
@@ -42,7 +39,6 @@ EndScriptData */
#define SAY_TIMEOVER -1532086
#define SAY_DEATH -1532087
#define SAY_ATIESH -1532088 //Atiesh is equipped by a raid member
//Spells
#define SPELL_FROSTBOLT 29954
#define SPELL_FIREBALL 29953
@@ -61,58 +57,46 @@ EndScriptData */
#define SPELL_DRINK 30024
#define SPELL_POTION 32453
#define SPELL_AOE_PYROBLAST 29978
//Creature Spells
#define SPELL_CIRCULAR_BLIZZARD 29951 //29952 is the REAL circular blizzard that leaves persistant blizzards that last for 10 seconds
#define SPELL_WATERBOLT 31012
#define SPELL_SHADOW_PYRO 29978
//Creatures
#define CREATURE_WATER_ELEMENTAL 17167
#define CREATURE_SHADOW_OF_ARAN 18254
#define CREATURE_ARAN_BLIZZARD 17161
enum SuperSpell
{
SUPER_FLAME = 0,
SUPER_BLIZZARD,
SUPER_AE,
};
struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
{
boss_aranAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 SecondarySpellTimer;
uint32 NormalCastTimer;
uint32 SuperCastTimer;
uint32 BerserkTimer;
uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering.
uint8 LastSuperSpell;
uint32 FlameWreathTimer;
uint32 FlameWreathCheckTime;
uint64 FlameWreathTarget[3];
float FWTargPosX[3];
float FWTargPosY[3];
uint32 CurrentNormalSpell;
uint32 ArcaneCooldown;
uint32 FireCooldown;
uint32 FrostCooldown;
uint32 DrinkInturruptTimer;
bool ElementalsSpawned;
bool Drinking;
bool DrinkInturrupted;
void Reset()
{
SecondarySpellTimer = 5000;
@@ -120,23 +104,17 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
SuperCastTimer = 35000;
BerserkTimer = 720000;
CloseDoorTimer = 15000;
LastSuperSpell = rand()%3;
FlameWreathTimer = 0;
FlameWreathCheckTime = 0;
CurrentNormalSpell = 0;
ArcaneCooldown = 0;
FireCooldown = 0;
FrostCooldown = 0;
DrinkInturruptTimer = 10000;
ElementalsSpawned = false;
Drinking = false;
DrinkInturrupted = false;
if (pInstance)
{
// Not in progress
@@ -144,57 +122,47 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
}
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
{
pInstance->SetData(TYPE_ARAN, DONE);
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true);
}
}
void EnterCombat(Unit *who)
{
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
if (pInstance)
{
pInstance->SetData(TYPE_ARAN, IN_PROGRESS);
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false);
}
}
void FlameWreathEffect()
{
std::vector<Unit*> targets;
std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
if (!t_list.size())
return;
//store the threat list in a different container
for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
for (std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
//only on alive players
if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
targets.push_back(target);
}
//cut down to size if we have more than 3 targets
while(targets.size() > 3)
targets.erase(targets.begin()+rand()%targets.size());
uint32 i = 0;
for(std::vector<Unit*>::iterator itr = targets.begin(); itr!= targets.end(); ++itr)
for (std::vector<Unit*>::iterator itr = targets.begin(); itr!= targets.end(); ++itr)
{
if (*itr)
{
@@ -206,12 +174,10 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
}
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CloseDoorTimer)
{
if (CloseDoorTimer <= diff)
@@ -223,7 +189,6 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
}
}else CloseDoorTimer -= diff;
}
//Cooldowns for casts
if (ArcaneCooldown)
{
@@ -231,28 +196,23 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
ArcaneCooldown -= diff;
else ArcaneCooldown = 0;
}
if (FireCooldown)
{
if (FireCooldown >= diff)
FireCooldown -= diff;
else FireCooldown = 0;
}
if (FrostCooldown)
{
if (FrostCooldown >= diff)
FrostCooldown -= diff;
else FrostCooldown = 0;
}
if (!Drinking && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20)
{
Drinking = true;
m_creature->InterruptNonMeleeSpells(false);
DoScriptText(SAY_DRINK, m_creature);
if (!DrinkInturrupted)
{
m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true);
@@ -262,7 +222,6 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
DrinkInturruptTimer = 10000;
}
}
//Drink Inturrupt
if (Drinking && DrinkInturrupted)
{
@@ -272,7 +231,6 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000);
m_creature->CastSpell(m_creature, SPELL_POTION, false);
}
//Drink Inturrupt Timer
if (Drinking && !DrinkInturrupted)
if (DrinkInturruptTimer >= diff)
@@ -285,11 +243,9 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
DrinkInturrupted = true;
Drinking = false;
}
//Don't execute any more code if we are drinking
if (Drinking)
return;
//Normal casts
if (NormalCastTimer < diff)
{
@@ -299,10 +255,8 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!target)
return;
uint32 Spells[3];
uint8 AvailableSpells = 0;
//Check for what spells are not on cooldown
if (!ArcaneCooldown)
{
@@ -319,7 +273,6 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
Spells[AvailableSpells] = SPELL_FROSTBOLT;
AvailableSpells++;
}
//If no available spells wait 1 second and try again
if (AvailableSpells)
{
@@ -329,12 +282,10 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
}
NormalCastTimer = 1000;
}else NormalCastTimer -= diff;
if (SecondarySpellTimer < diff)
{
switch (rand()%2)
{
case 0:
DoCast(m_creature, SPELL_AOE_CS);
break;
@@ -345,11 +296,9 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
}
SecondarySpellTimer = 5000 + (rand()%15000);
}else SecondarySpellTimer -= diff;
if (SuperCastTimer < diff)
{
uint8 Available[2];
switch (LastSuperSpell)
{
case SUPER_AE:
@@ -365,47 +314,36 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
Available[1] = SUPER_AE;
break;
}
LastSuperSpell = Available[rand()%2];
switch (LastSuperSpell)
{
case SUPER_AE:
if (rand()%2)
DoScriptText(SAY_EXPLOSION1, m_creature);
else
DoScriptText(SAY_EXPLOSION2, m_creature);
m_creature->CastSpell(m_creature, SPELL_BLINK_CENTER, true);
m_creature->CastSpell(m_creature, SPELL_PLAYERPULL, true);
m_creature->CastSpell(m_creature, SPELL_MASSSLOW, true);
m_creature->CastSpell(m_creature, SPELL_AEXPLOSION, false);
break;
case SUPER_FLAME:
if (rand()%2)
DoScriptText(SAY_FLAMEWREATH1, m_creature);
else
DoScriptText(SAY_FLAMEWREATH2, m_creature);
FlameWreathTimer = 20000;
FlameWreathCheckTime = 500;
FlameWreathTarget[0] = 0;
FlameWreathTarget[1] = 0;
FlameWreathTarget[2] = 0;
FlameWreathEffect();
break;
case SUPER_BLIZZARD:
if (rand()%2)
DoScriptText(SAY_BLIZZARD1, m_creature);
else
DoScriptText(SAY_BLIZZARD2, m_creature);
if (Creature* pSpawn = m_creature->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
{
pSpawn->setFaction(m_creature->getFaction());
@@ -413,14 +351,11 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
}
break;
}
SuperCastTimer = 35000 + (rand()%5000);
}else SuperCastTimer -= diff;
if (!ElementalsSpawned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
{
ElementalsSpawned = true;
for (uint32 i = 0; i < 4; ++i)
{
if (Creature* pUnit = m_creature->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
@@ -429,10 +364,8 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
pUnit->setFaction(m_creature->getFaction());
}
}
DoScriptText(SAY_ELEMENTALS, m_creature);
}
if (BerserkTimer < diff)
{
for (uint32 i = 0; i < 5; ++i)
@@ -443,26 +376,21 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
pUnit->setFaction(m_creature->getFaction());
}
}
DoScriptText(SAY_TIMEOVER, m_creature);
BerserkTimer = 60000;
}else BerserkTimer -= diff;
//Flame Wreath check
if (FlameWreathTimer)
{
if (FlameWreathTimer >= diff)
FlameWreathTimer -= diff;
else FlameWreathTimer = 0;
if (FlameWreathCheckTime < diff)
{
for (uint32 i = 0; i < 3; ++i)
{
if (!FlameWreathTarget[i])
continue;
Unit* pUnit = Unit::GetUnit(*m_creature, FlameWreathTarget[i]);
if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
{
@@ -474,17 +402,14 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
FlameWreathCheckTime = 500;
}else FlameWreathCheckTime -= diff;
}
if (ArcaneCooldown && FireCooldown && FrostCooldown)
DoMeleeAttackIfReady();
}
void DamageTaken(Unit* pAttacker, uint32 &damage)
{
if (!DrinkInturrupted && Drinking && damage)
DrinkInturrupted = true;
}
void SpellHit(Unit* pAttacker, const SpellEntry* Spell)
{
//We only care about inturrupt effects and only if they are durring a spell currently being casted
@@ -492,13 +417,10 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
Spell->Effect[1]!=SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effect[2]!=SPELL_EFFECT_INTERRUPT_CAST) || !m_creature->IsNonMeleeSpellCasted(false))
return;
//Inturrupt effect
m_creature->InterruptNonMeleeSpells(false);
//Normally we would set the cooldown equal to the spell duration
//but we do not have access to the DurationStore
switch (CurrentNormalSpell)
{
case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break;
@@ -507,25 +429,19 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
}
}
};
struct TRINITY_DLL_DECL water_elementalAI : public ScriptedAI
{
water_elementalAI(Creature *c) : ScriptedAI(c) {}
uint32 CastTimer;
void Reset()
{
CastTimer = 2000 + (rand()%3000);
}
void EnterCombat(Unit* who) {}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CastTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
@@ -533,34 +449,27 @@ struct TRINITY_DLL_DECL water_elementalAI : public ScriptedAI
}else CastTimer -= diff;
}
};
CreatureAI* GetAI_boss_aran(Creature* pCreature)
{
return new boss_aranAI (pCreature);
}
CreatureAI* GetAI_water_elemental(Creature* pCreature)
{
return new water_elementalAI (pCreature);
}
// CONVERT TO ACID
CreatureAI* GetAI_shadow_of_aran(Creature* pCreature)
{
outstring_log("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry());
SimpleAI* ai = new SimpleAI (pCreature);
ai->Spell[0].Enabled = true;
ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO;
ai->Spell[0].Cooldown = 5000;
ai->Spell[0].First_Cast = 1000;
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
ai->EnterEvadeMode();
return ai;
}
void AddSC_boss_shade_of_aran()
{
Script *newscript;
@@ -568,12 +477,10 @@ void AddSC_boss_shade_of_aran()
newscript->Name = "boss_shade_of_aran";
newscript->GetAI = &GetAI_boss_aran;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_shadow_of_aran";
newscript->GetAI = &GetAI_shadow_of_aran;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_aran_elemental";
newscript->GetAI = &GetAI_water_elemental;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Terestian_Illhoof
SD%Complete: 95
SDComment: Complete! Needs adjustments to use spell though.
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
#define SAY_SLAY1 -1532065
#define SAY_SLAY2 -1532066
#define SAY_DEATH -1532067
@@ -32,7 +29,6 @@ EndScriptData */
#define SAY_SACRIFICE2 -1532070
#define SAY_SUMMON1 -1532071
#define SAY_SUMMON2 -1532072
#define SPELL_SUMMON_DEMONCHAINS 30120 // Summons demonic chains that maintain the ritual of sacrifice.
#define SPELL_DEMON_CHAINS 30206 // Instant - Visual Effect
#define SPELL_ENRAGE 23537 // Increases the caster's attack speed by 50% and the Physical damage it deals by 219 to 281 for 10 min.
@@ -41,38 +37,29 @@ EndScriptData */
#define SPELL_BERSERK 32965 // Increases attack speed by 75%. Periodically casts Shadow Bolt Volley.
#define SPELL_SUMMON_FIENDISIMP 30184 // Summons a Fiendish Imp.
#define SPELL_SUMMON_IMP 30066 // Summons Kil'rek
#define SPELL_FIENDISH_PORTAL 30171 // Opens portal and summons Fiendish Portal, 2 sec cast
#define SPELL_FIENDISH_PORTAL_1 30179 // Opens portal and summons Fiendish Portal, instant cast
#define SPELL_FIREBOLT 30050 // Blasts a target for 150 Fire damage.
#define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%.
#define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec.
#define CREATURE_DEMONCHAINS 17248
#define CREATURE_FIENDISHIMP 17267
#define CREATURE_PORTAL 17265
#define CREATURE_KILREK 17229
struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
{
mob_kilrekAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint64 TerestianGUID;
uint32 AmplifyTimer;
void Reset()
{
TerestianGUID = 0;
AmplifyTimer = 2000;
}
void EnterCombat(Unit *who)
{
if (!pInstance)
@@ -81,7 +68,6 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
return;
}
}
void JustDied(Unit* Killer)
{
if (pInstance)
@@ -95,40 +81,31 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
}
}else ERROR_INST_DATA(m_creature);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (AmplifyTimer < diff)
{
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature->getVictim(),SPELL_AMPLIFY_FLAMES);
AmplifyTimer = 10000 + rand()%10000;
}else AmplifyTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL mob_demon_chainAI : public ScriptedAI
{
mob_demon_chainAI(Creature *c) : ScriptedAI(c) {}
uint64 SacrificeGUID;
void Reset()
{
SacrificeGUID = 0;
}
void EnterCombat(Unit* who) {}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void JustDied(Unit *killer)
{
if (SacrificeGUID)
@@ -139,55 +116,44 @@ struct TRINITY_DLL_DECL mob_demon_chainAI : public ScriptedAI
}
}
};
struct TRINITY_DLL_DECL mob_fiendish_portalAI : public PassiveAI
{
mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(m_creature){}
SummonList summons;
void Reset()
{
summons.DespawnAll();
}
void JustSummoned(Creature* summon)
{
summons.Summon(summon);
DoZoneInCombat(summon);
}
void DespawnAllImp()
{
summons.DespawnAll();
}
};
struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
{
boss_terestianAI(Creature *c) : ScriptedAI(c)
{
for(uint8 i = 0; i < 2; ++i)
for (uint8 i = 0; i < 2; ++i)
PortalGUID[i] = 0;
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint64 PortalGUID[2];
uint8 PortalsCount;
uint32 SacrificeTimer;
uint32 ShadowboltTimer;
uint32 SummonTimer;
uint32 BerserkTimer;
bool SummonedPortals;
bool Berserk;
void Reset()
{
for(uint8 i = 0; i < 2; ++i)
for (uint8 i = 0; i < 2; ++i)
{
if (PortalGUID[i])
{
@@ -196,25 +162,19 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
CAST_AI(mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp();
pPortal->ForcedDespawn();
}
PortalGUID[i] = 0;
}
}
PortalsCount = 0;
SacrificeTimer = 30000;
ShadowboltTimer = 5000;
SummonTimer = 10000;
BerserkTimer = 600000;
SummonedPortals = false;
Berserk = false;
if (pInstance)
pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED);
m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
if(Minion* Kilrek = m_creature->GetFirstMinion())
{
if(!Kilrek->isAlive())
@@ -225,19 +185,16 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
}
else DoCast(m_creature, SPELL_SUMMON_IMP, true);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void JustSummoned(Creature* pSummoned)
{
if (pSummoned->GetEntry() == CREATURE_PORTAL)
{
PortalGUID[PortalsCount] = pSummoned->GetGUID();
PortalsCount++;
if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1)
{
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
@@ -245,36 +202,29 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
}
}
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
}
void JustDied(Unit *killer)
{
for(uint8 i = 0; i < 2; ++i)
for (uint8 i = 0; i < 2; ++i)
{
if (PortalGUID[i])
{
if (Creature* pPortal = Unit::GetCreature((*m_creature), PortalGUID[i]))
pPortal->ForcedDespawn();
PortalGUID[i] = 0;
}
}
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(TYPE_TERESTIAN, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (SacrificeTimer < diff)
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
@@ -282,7 +232,6 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
{
DoCast(target, SPELL_SACRIFICE, true);
DoCast(target, SPELL_SUMMON_DEMONCHAINS, true);
Creature* Chains = m_creature->FindNearestCreature(CREATURE_DEMONCHAINS, 5000);
if (Chains)
{
@@ -293,21 +242,17 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
}
}
}else SacrificeTimer -= diff;
if (ShadowboltTimer < diff)
{
DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT);
ShadowboltTimer = 10000;
}else ShadowboltTimer -= diff;
if (SummonTimer < diff)
{
if(!PortalGUID[0])
DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL, false);
if(!PortalGUID[1])
DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
if(PortalGUID[0] && PortalGUID[1])
{
if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[rand()%2]))
@@ -315,7 +260,6 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
SummonTimer = 5000;
}
}else SummonTimer -= diff;
if (!Berserk)
{
if (BerserkTimer < diff)
@@ -324,69 +268,53 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
Berserk = true;
}else BerserkTimer -= diff;
}
DoMeleeAttackIfReady();
}
};
#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage.
struct TRINITY_DLL_DECL mob_fiendish_impAI : public ScriptedAI
{
mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {}
uint32 FireboltTimer;
void Reset()
{
FireboltTimer = 2000;
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
void EnterCombat(Unit *who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (FireboltTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBOLT);
FireboltTimer = 2200;
}else FireboltTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_mob_kilrek(Creature* pCreature)
{
return new mob_kilrekAI (pCreature);
}
CreatureAI* GetAI_mob_fiendish_imp(Creature* pCreature)
{
return new mob_fiendish_impAI (pCreature);
}
CreatureAI* GetAI_mob_fiendish_portal(Creature* pCreature)
{
return new mob_fiendish_portalAI (pCreature);
}
CreatureAI* GetAI_boss_terestian_illhoof(Creature* pCreature)
{
return new boss_terestianAI (pCreature);
}
CreatureAI* GetAI_mob_demon_chain(Creature* pCreature)
{
return new mob_demon_chainAI(pCreature);
}
void AddSC_boss_terestian_illhoof()
{
Script *newscript;
@@ -394,22 +322,18 @@ void AddSC_boss_terestian_illhoof()
newscript->Name = "boss_terestian_illhoof";
newscript->GetAI = &GetAI_boss_terestian_illhoof;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_fiendish_imp";
newscript->GetAI = &GetAI_mob_fiendish_imp;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name= "mob_fiendish_portal";
newscript->GetAI = &GetAI_mob_fiendish_portal;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_kilrek";
newscript->GetAI = &GetAI_mob_kilrek;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_demon_chain";
newscript->GetAI = &GetAI_mob_demon_chain;
File diff suppressed because it is too large Load Diff
@@ -2,10 +2,8 @@
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_KARAZHAN_H
#define DEF_KARAZHAN_H
enum eEnums
{
TYPE_ATTUMEN = 1,
@@ -20,10 +18,8 @@ enum eEnums
TYPE_CHESS = 10,
TYPE_MALCHEZZAR = 11,
TYPE_NIGHTBANE = 12,
DATA_OPERA_PERFORMANCE = 13,
DATA_OPERA_OZ_DEATHCOUNT = 14,
DATA_KILREK = 15,
DATA_TERESTIAN = 16,
DATA_MOROES = 17,
@@ -35,20 +31,17 @@ enum eEnums
DATA_GO_NETHER_DOOR = 23,
DATA_GO_GAME_DOOR = 24,
DATA_GO_GAME_EXIT_DOOR = 25,
DATA_IMAGE_OF_MEDIVH = 26,
DATA_MASTERS_TERRACE_DOOR_1 = 27,
DATA_MASTERS_TERRACE_DOOR_2 = 28,
DATA_GO_SIDE_ENTRANCE_DOOR = 29
};
enum OperaEvents
{
EVENT_OZ = 1,
EVENT_HOOD = 2,
EVENT_RAJ = 3
};
#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
#endif
@@ -13,19 +13,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Karazhan
SD%Complete: 70
SDComment: Instance Script for Karazhan to help in various encounters. TODO: GameObject visibility for Opera event.
SDCategory: Karazhan
EndScriptData */
#include "precompiled.h"
#include "def_karazhan.h"
#define MAX_ENCOUNTER 12
/*
0 - Attumen + Midnight (optional)
1 - Moroes
@@ -40,17 +36,13 @@ EndScriptData */
10 - Prince Malchezzar
11 - Nightbane
*/
struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
{
instance_karazhan(Map* pMap) : ScriptedInstance(pMap) {Initialize();}
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string strSaveData;
uint32 m_uiOperaEvent;
uint32 m_uiOzDeathCount;
uint64 m_uiCurtainGUID;
uint64 m_uiStageDoorLeftGUID;
uint64 m_uiStageDoorRightGUID;
@@ -66,23 +58,18 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
uint64 MastersTerraceDoor[2];
uint64 ImageGUID;
uint64 DustCoveredChest;
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
m_uiOperaEvent = urand(1,3);
m_uiOzDeathCount = 0;
m_uiCurtainGUID = 0;
m_uiStageDoorLeftGUID = 0;
m_uiStageDoorRightGUID = 0;
m_uiKilrekGUID = 0;
m_uiTerestianGUID = 0;
m_uiMoroesGUID = 0;
m_uiLibraryDoor = 0;
m_uiMassiveDoor = 0;
m_uiSideEntranceDoor = 0;
@@ -94,16 +81,13 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
ImageGUID = 0;
DustCoveredChest = 0;
}
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool add)
{
switch (pCreature->GetEntry())
@@ -113,7 +97,6 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case 15687: m_uiMoroesGUID = pCreature->GetGUID(); break;
}
}
void SetData(uint32 type, uint32 uiData)
{
switch (type)
@@ -149,23 +132,18 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
m_uiOzDeathCount = 0;
break;
}
if (uiData == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " "
<< m_auiEncounter[7] << " " << m_auiEncounter[8] << " " << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11];
strSaveData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
void SetData64(uint32 identifier, uint64 data)
{
switch(identifier)
@@ -173,7 +151,6 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case DATA_IMAGE_OF_MEDIVH: ImageGUID = data;
}
}
void OnGameObjectCreate(GameObject* pGo, bool add)
{
switch(pGo->GetEntry())
@@ -205,26 +182,21 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
break;
case 185119: DustCoveredChest = pGo->GetGUID(); break;
}
switch(m_uiOperaEvent)
{
//TODO: Set Object visibilities for Opera based on performance
case EVENT_OZ:
break;
case EVENT_HOOD:
break;
case EVENT_RAJ:
break;
}
}
std::string GetSaveData()
{
return strSaveData;
}
uint32 GetData(uint32 uiData)
{
switch (uiData)
@@ -245,10 +217,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case DATA_OPERA_OZ_DEATHCOUNT: return m_uiOzDeathCount;
case DATA_IMAGE_OF_MEDIVH: return ImageGUID;
}
return 0;
}
uint64 GetData64(uint32 uiData)
{
switch (uiData)
@@ -268,10 +238,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0];
case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1];
}
return 0;
}
void Load(const char* chrIn)
{
if (!chrIn)
@@ -279,25 +247,21 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(chrIn);
std::istringstream loadStream(chrIn);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]
>> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7]
>> m_auiEncounter[8] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11];
for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
m_auiEncounter[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData_instance_karazhan(Map* pMap)
{
return new instance_karazhan(pMap);
}
void AddSC_instance_karazhan()
{
Script *newscript;
@@ -13,49 +13,39 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Karazhan
SD%Complete: 100
SDComment: Support for Barnes (Opera controller) and Berthold (Doorman), Support for Quest 9645.
SDCategory: Karazhan
EndScriptData */
/* ContentData
npc_barnes
npc_berthold
npc_image_of_medivh
EndContentData */
#include "precompiled.h"
#include "def_karazhan.h"
#include "escort_ai.h"
/*######
# npc_barnesAI
######*/
#define GOSSIP_READY "I'm not an actor."
#define SAY_READY "Splendid, I'm going to get the audience ready. Break a leg!"
#define SAY_OZ_INTRO1 "Finally, everything is in place. Are you ready for your big stage debut?"
#define OZ_GOSSIP1 "I'm not an actor."
#define SAY_OZ_INTRO2 "Don't worry, you'll be fine. You look like a natural!"
#define OZ_GOSSIP2 "Ok, I'll give it a try, then."
#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?"
#define RAJ_GOSSIP1 "I've never been more ready."
#define OZ_GM_GOSSIP1 "[GM] Change event to EVENT_OZ"
#define OZ_GM_GOSSIP2 "[GM] Change event to EVENT_HOOD"
#define OZ_GM_GOSSIP3 "[GM] Change event to EVENT_RAJ"
struct Dialogue
{
int32 textid;
uint32 timer;
};
static Dialogue OzDialogue[]=
{
{-1532103, 6000},
@@ -63,7 +53,6 @@ static Dialogue OzDialogue[]=
{-1532105, 9000},
{-1532106, 15000}
};
static Dialogue HoodDialogue[]=
{
{-1532107, 6000},
@@ -71,7 +60,6 @@ static Dialogue HoodDialogue[]=
{-1532109, 14000},
{-1532110, 15000}
};
static Dialogue RAJDialogue[]=
{
{-1532111, 5000},
@@ -79,7 +67,6 @@ static Dialogue RAJDialogue[]=
{-1532113, 14000},
{-1532114, 14000}
};
// Entries and spawn locations for creatures in Oz event
float Spawns[6][2]=
{
@@ -90,16 +77,12 @@ float Spawns[6][2]=
{17603, -10892}, // Grandmother
{17534, -10900}, // Julianne
};
#define CREATURE_SPOTLIGHT 19525
#define SPELL_SPOTLIGHT 25824
#define SPELL_TUXEDO 32616
#define SPAWN_Z 90.5
#define SPAWN_Y -1758
#define SPAWN_O 4.738
struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
{
npc_barnesAI(Creature* c) : npc_escortAI(c)
@@ -108,54 +91,39 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
m_uiEventId = 0;
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint64 m_uiSpotlightGUID;
uint32 TalkCount;
uint32 TalkTimer;
uint32 WipeTimer;
uint32 m_uiEventId;
bool PerformanceReady;
bool RaidWiped;
void Reset()
{
m_uiSpotlightGUID = 0;
TalkCount = 0;
TalkTimer = 2000;
WipeTimer = 5000;
PerformanceReady = false;
if (pInstance)
m_uiEventId = pInstance->GetData(DATA_OPERA_PERFORMANCE);
}
void StartEvent()
{
if (!pInstance)
return;
pInstance->SetData(TYPE_OPERA, IN_PROGRESS);
//resets count for this event, in case earlier failed
if (m_uiEventId == EVENT_OZ)
pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS);
Start(false, false);
}
void EnterCombat(Unit* who) {}
void WaypointReached(uint32 i)
{
if (!pInstance)
return;
switch(i)
{
case 0:
@@ -165,7 +133,6 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
case 4:
TalkCount = 0;
SetEscortPaused(true);
if (Creature* pSpotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT,
m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
@@ -185,11 +152,9 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
break;
}
}
void Talk(uint32 count)
{
int32 text = 0;
switch(m_uiEventId)
{
case EVENT_OZ:
@@ -198,14 +163,12 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
if (OzDialogue[count].timer)
TalkTimer = OzDialogue[count].timer;
break;
case EVENT_HOOD:
if (HoodDialogue[count].textid)
text = HoodDialogue[count].textid;
if (HoodDialogue[count].timer)
TalkTimer = HoodDialogue[count].timer;
break;
case EVENT_RAJ:
if (RAJDialogue[count].textid)
text = RAJDialogue[count].textid;
@@ -213,17 +176,14 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
TalkTimer = RAJDialogue[count].timer;
break;
}
if (text)
DoScriptText(text, m_creature);
}
void PrepareEncounter()
{
debug_log("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
uint8 index = 0;
uint8 count = 0;
switch(m_uiEventId)
{
case EVENT_OZ:
@@ -239,12 +199,10 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
count = index+1;
break;
}
for(; index < count; ++index)
for (; index < count; ++index)
{
uint32 entry = ((uint32)Spawns[index][0]);
float PosX = Spawns[index][1];
if (Creature* pCreature = m_creature->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
{
// In case database has bad flags
@@ -252,14 +210,11 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
}
RaidWiped = false;
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
if (HasEscortState(STATE_ESCORT_PAUSED))
{
if (TalkTimer < diff)
@@ -268,18 +223,15 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
{
if (Creature* pSpotlight = Unit::GetCreature(*m_creature, m_uiSpotlightGUID))
pSpotlight->ForcedDespawn();
SetEscortPaused(false);
return;
}
Talk(TalkCount);
++TalkCount;
}
else
TalkTimer -= diff;
}
if (PerformanceReady)
{
if (!RaidWiped)
@@ -288,13 +240,11 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
{
Map* pMap = m_creature->GetMap();
if (!pMap->IsDungeon()) return;
Map::PlayerList const &PlayerList = pMap->GetPlayers();
if (PlayerList.isEmpty())
return;
RaidWiped = true;
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()->isGameMaster())
{
@@ -302,27 +252,22 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
break;
}
}
if (RaidWiped)
{
RaidWiped = true;
EnterEvadeMode();
return;
}
WipeTimer = 15000;
}else WipeTimer -= diff;
}
}
}
};
CreatureAI* GetAI_npc_barnesAI(Creature* pCreature)
{
return new npc_barnesAI(pCreature);
}
bool GossipHello_npc_barnes(Player* pPlayer, Creature* pCreature)
{
if (ScriptedInstance* pInstance = pCreature->GetInstanceData())
@@ -331,34 +276,28 @@ bool GossipHello_npc_barnes(Player* pPlayer, Creature* pCreature)
if (pInstance->GetData(TYPE_MOROES) == DONE && pInstance->GetData(TYPE_OPERA) != DONE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
if (pPlayer->isGameMaster())
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
}
if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI,pCreature->AI()))
{
if (!pBarnesAI->RaidWiped)
pPlayer->SEND_GOSSIP_MENU(8970, pCreature->GetGUID());
else
pPlayer->SEND_GOSSIP_MENU(8975, pCreature->GetGUID());
return true;
}
}
}
pPlayer->SEND_GOSSIP_MENU(8978, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI, pCreature->AI());
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
@@ -385,21 +324,16 @@ bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 uiSend
outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID());
break;
}
return true;
}
/*###
# npc_berthold
####*/
enum eBerthold
{
SPELL_TELEPORT = 39567
};
#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library"
bool GossipHello_npc_berthold(Player* pPlayer, Creature* pCreature)
{
if (ScriptedInstance* pInstance = pCreature->GetInstanceData())
@@ -408,24 +342,19 @@ bool GossipHello_npc_berthold(Player* pPlayer, Creature* pCreature)
if (pInstance->GetData(TYPE_ARAN) == DONE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
}
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_berthold(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, true);
pPlayer->CLOSE_GOSSIP_MENU();
return true;
}
/*###
# npc_image_of_medivh
####*/
#define SAY_DIALOG_MEDIVH_1 "You've got my attention, dragon. You'll find I'm not as easily scared as the villagers below."
#define SAY_DIALOG_ARCANAGOS_2 "Your dabbling in the arcane has gone too far, Medivh. You've attracted the attention of powers beyond your understanding. You must leave Karazhan at once!"
#define SAY_DIALOG_MEDIVH_3 "You dare challenge me at my own dwelling? Your arrogance is astounding, even for a dragon!"
@@ -435,38 +364,29 @@ bool GossipSelect_npc_berthold(Player* pPlayer, Creature* pCreature, uint32 uiSe
#define EMOTE_DIALOG_MEDIVH_7 "begins to cast a spell of great power, weaving his own essence into the magic."
#define SAY_DIALOG_ARCANAGOS_8 "What have you done, wizard? This cannot be! I'm burning from... within!"
#define SAY_DIALOG_MEDIVH_9 "He should not have angered me. I must go... recover my strength now..."
#define MOB_ARCANAGOS 17652
#define SPELL_FIRE_BALL 30967
#define SPELL_UBER_FIREBALL 30971
#define SPELL_CONFLAGRATION_BLAST 30977
#define SPELL_MANA_SHIELD 31635
static float MedivPos[4] = {-11161.49,-1902.24,91.48,1.94};
static float ArcanagosPos[4] = {-11169.75,-1881.48,95.39,4.83};
struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
{
npc_image_of_medivhAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint64 ArcanagosGUID;
uint32 YellTimer;
uint32 Step;
uint32 FireMedivhTimer;
uint32 FireArcanagosTimer;
bool EventStarted;
void Reset()
{
ArcanagosGUID = 0;
if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
{
pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, m_creature->GetGUID());
@@ -479,7 +399,6 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
}
}
void EnterCombat(Unit* who){}
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE)
@@ -491,7 +410,6 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
m_creature->SetOrientation(MedivPos[3]);
}
}
void StartEvent()
{
Step = 1;
@@ -507,7 +425,6 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
YellTimer = 10000;
}
uint32 NextStep(uint32 Step)
{
Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
@@ -566,7 +483,6 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
case 14:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->ClearInCombat();
if (pMap->IsDungeon())
{
InstanceMap::PlayerList const &PlayerList = pMap->GetPlayers();
@@ -585,12 +501,9 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
return 5000;
default : return 9999999;
}
}
void UpdateAI(const uint32 diff)
{
if (YellTimer < diff)
{
if (EventStarted)
@@ -598,51 +511,42 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
YellTimer = NextStep(Step++);
}
}else YellTimer -= diff;
if (Step >= 7 && Step <= 12)
{
Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
if (FireArcanagosTimer < diff)
{
if (arca)
arca->CastSpell(m_creature, SPELL_FIRE_BALL, false);
FireArcanagosTimer = 6000;
}else FireArcanagosTimer -= diff;
if (FireMedivhTimer < diff)
{
if (arca)
DoCast(arca, SPELL_FIRE_BALL);
FireMedivhTimer = 5000;
}else FireMedivhTimer -= diff;
}
}
};
CreatureAI* GetAI_npc_image_of_medivh(Creature* pCreature)
{
return new npc_image_of_medivhAI(pCreature);
}
void AddSC_karazhan()
{
Script* newscript;
newscript = new Script;
newscript->GetAI = &GetAI_npc_barnesAI;
newscript->Name = "npc_barnes";
newscript->pGossipHello = &GossipHello_npc_barnes;
newscript->pGossipSelect = &GossipSelect_npc_barnes;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_berthold";
newscript->pGossipHello = &GossipHello_npc_berthold;
newscript->pGossipSelect = &GossipSelect_npc_berthold;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_image_of_medivh";
newscript->GetAI = &GetAI_npc_image_of_medivh;
@@ -13,46 +13,35 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Loch_Modan
SD%Complete: 100
SDComment: Quest support: 3181
SDCategory: Loch Modan
EndScriptData */
/* ContentData
npc_mountaineer_pebblebitty
EndContentData */
#include "precompiled.h"
/*######
## npc_mountaineer_pebblebitty
######*/
#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge"
#define GOSSIP_MP1 "But i need to get there, now open the gate!"
#define GOSSIP_MP2 "Ok, so what is this other way?"
#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable."
#define GOSSIP_MP4 "Yes..."
#define GOSSIP_MP5 "Ok, i'll try to remember that."
#define GOSSIP_MP6 "A key? Ok!"
bool GossipHello_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (!pPlayer->GetQuestRewardStatus(3181) == 1)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch (uiAction)
@@ -87,11 +76,9 @@ bool GossipSelect_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreatu
}
return true;
}
void AddSC_loch_modan()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_mountaineer_pebblebitty";
newscript->pGossipHello = &GossipHello_npc_mountaineer_pebblebitty;
@@ -13,18 +13,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Felblood_Kaelthas
SD%Complete: 80
SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets.
SDCategory: Magisters' Terrace
EndScriptData */
#include "precompiled.h"
#include "def_magisters_terrace.h"
#include "WorldPacket.h"
#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell.
#define SAY_PHOENIX -1585024
#define SAY_FLAMESTRIKE -1585025
@@ -32,25 +29,19 @@ EndScriptData */
#define SAY_TIRED -1585027
#define SAY_RECAST_GRAVITY -1585028
#define SAY_DEATH -1585029
/*** Spells ***/
// Phase 1 spells
#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target
#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050
#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?)
#define SPELL_PHOENIX_BURN 44197 // A spell Phoenix uses to damage everything around
#define SPELL_REBIRTH_DMG 44196 // DMG if a Phoenix rebirth happen
#define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part
#define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part
#define SPELL_FLAMESTRIKE2 44191 // Flamestrike indicator before the damage
#define SPELL_FLAMESTRIKE3 44192 // Summons the trigger + animation (projectile)
#define SPELL_SHOCK_BARRIER 46165 // Heroic only; 10k damage shield, followed by Pyroblast
#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage
// Phase 2 spells
#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse
#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range
@@ -59,12 +50,10 @@ EndScriptData */
#define SPELL_GRAVITY_LAPSE_DOT 44226 // Knocks up in the air and applies a 300 DPS DoT.
#define SPELL_ARCANE_SPHERE_PASSIVE 44263 // Passive auras on Arcane Spheres
#define SPELL_POWER_FEEDBACK 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse
/*** Creatures ***/
#define CREATURE_PHOENIX 24674
#define CREATURE_PHOENIX_EGG 24675
#define CREATURE_ARCANE_SPHERE 24708
/** Locations **/
float KaelLocations[3][2]=
{
@@ -72,9 +61,7 @@ float KaelLocations[3][2]=
{140.823883, 195.403046},
{156.574188, 195.650482},
};
#define LOCATION_Z -16.727455
struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
{
boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c)
@@ -82,17 +69,13 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
pInstance = c->GetInstanceData();
Heroic = c->GetMap()->IsHeroic();
}
ScriptedInstance* pInstance;
uint32 FireballTimer;
uint32 PhoenixTimer;
uint32 FlameStrikeTimer;
uint32 CombatPulseTimer;
//Heroic only
uint32 PyroblastTimer;
uint32 GravityLapseTimer;
uint32 GravityLapsePhase;
// 0 = No Gravity Lapse
@@ -100,16 +83,13 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
// 2 = Teleported people to self
// 3 = Knocked people up in the air
// 4 = Applied an aura that allows them to fly, channeling visual, relased Arcane Orbs.
bool FirstGravityLapse;
bool Heroic;
bool HasTaunted;
uint8 Phase;
// 0 = Not started
// 1 = Fireball; Summon Phoenix; Flamestrike
// 2 = Gravity Lapses
void Reset()
{
// TODO: Timers
@@ -117,17 +97,12 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
PhoenixTimer = 10000;
FlameStrikeTimer = 25000;
CombatPulseTimer = 0;
PyroblastTimer = 60000;
GravityLapseTimer = 0;
GravityLapsePhase = 0;
FirstGravityLapse = true;
HasTaunted = false;
Phase = 0;
if (pInstance)
{
pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
@@ -136,33 +111,26 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
// Small door opened after event are expected to be closed by default
}
}
void JustDied(Unit *killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (!pInstance)
return;
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true);
// Open the encounter door
}
void DamageTaken(Unit* done_by, uint32 &damage)
{
if (damage > m_creature->GetHealth())
RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
}
void EnterCombat(Unit *who)
{
if (!pInstance)
return;
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), false);
//Close the encounter door, open it in JustDied/Reset
}
void MoveInLineOfSight(Unit *who)
{
if (!HasTaunted && m_creature->IsWithinDistInMap(who, 40.0))
@@ -170,18 +138,15 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
DoScriptText(SAY_AGGRO, m_creature);
HasTaunted = true;
}
ScriptedAI::MoveInLineOfSight(who);
}
void SetThreatList(Creature* SummonedUnit)
{
if (!SummonedUnit)
return;
std::list<HostilReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
std::list<HostilReference*>::iterator i = m_threatlist.begin();
for(i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
if (pUnit && pUnit->isAlive())
@@ -191,7 +156,6 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
}
}
}
void TeleportPlayersToSelf()
{
float x = KaelLocations[0][0];
@@ -207,7 +171,6 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
}
DoCast(m_creature, SPELL_TELEPORT_CENTER, true);
}
void CastGravityLapseKnockUp()
{
std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
@@ -219,7 +182,6 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID());
}
}
void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
{
std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
@@ -239,7 +201,6 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
}
}
}
void RemoveGravityLapse()
{
std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
@@ -250,7 +211,6 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
{
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
WorldPacket data(12);
data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
data.append(pUnit->GetPackGUID());
@@ -259,13 +219,11 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
}
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
switch(Phase)
{
case 0:
@@ -282,22 +240,17 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
PyroblastTimer = 60000;
}else PyroblastTimer -= diff;
}
if (FireballTimer < diff)
{
DoCast(m_creature->getVictim(), Heroic ? SPELL_FIREBALL_HEROIC : SPELL_FIREBALL_NORMAL);
FireballTimer = 2000 + rand()%4000;
}else FireballTimer -= diff;
if (PhoenixTimer < diff)
{
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1);
uint32 random = rand()%2 + 1;
float x = KaelLocations[random][0];
float y = KaelLocations[random][1];
Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
if (Phoenix)
{
@@ -305,12 +258,9 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
SetThreatList(Phoenix);
Phoenix->AI()->AttackStart(target);
}
DoScriptText(SAY_PHOENIX, m_creature);
PhoenixTimer = 60000;
}else PhoenixTimer -= diff;
if (FlameStrikeTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
@@ -322,7 +272,6 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
}
FlameStrikeTimer = 15000 + rand()%10000;
}else FlameStrikeTimer -= diff;
// Below 50%
if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
{
@@ -334,11 +283,9 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
GravityLapsePhase = 0;
Phase = 1;
}
DoMeleeAttackIfReady();
}
break;
case 1:
{
if (GravityLapseTimer < diff)
@@ -350,7 +297,6 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
{
DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
FirstGravityLapse = false;
if (pInstance)
{
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_LEFT), true);
@@ -360,35 +306,29 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
{
DoScriptText(SAY_RECAST_GRAVITY, m_creature);
}
DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
GravityLapsePhase = 1;
break;
case 1:
TeleportPlayersToSelf();
GravityLapseTimer = 1000;
GravityLapsePhase = 2;
break;
case 2:
CastGravityLapseKnockUp();
GravityLapseTimer = 1000;
GravityLapsePhase = 3;
break;
case 3:
CastGravityLapseFly();
GravityLapseTimer = 30000;
GravityLapsePhase = 4;
for(uint8 i = 0; i < 3; ++i)
for (uint8 i = 0; i < 3; ++i)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
if (Orb && target)
{
@@ -396,12 +336,9 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
Orb->AddThreat(target, 1.0f);
Orb->AI()->AttackStart(target);
}
}
DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
break;
case 4:
m_creature->InterruptNonMeleeSpells(false);
DoScriptText(SAY_TIRED, m_creature);
@@ -417,27 +354,21 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
}
}
};
struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI
{
mob_felkael_flamestrikeAI(Creature *c) : ScriptedAI(c)
{
Heroic = c->GetMap()->IsHeroic();
}
uint32 FlameStrikeTimer;
bool Heroic;
void Reset()
{
FlameStrikeTimer = 5000;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->setFaction(14);
DoCast(m_creature, SPELL_FLAMESTRIKE2, true);
}
void EnterCombat(Unit *who) {}
void MoveInLineOfSight(Unit *who) {}
void UpdateAI(const uint32 diff)
@@ -449,20 +380,17 @@ struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI
} else FlameStrikeTimer -= diff;
}
};
struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
{
mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 BurnTimer;
uint32 Death_Timer;
bool Rebirth;
bool FakeDeath;
void Reset()
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
@@ -473,20 +401,16 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
Rebirth = false;
FakeDeath = false;
}
void EnterCombat(Unit* who) {}
void DamageTaken(Unit* pKiller, uint32 &damage)
{
if (damage < m_creature->GetHealth())
return;
//Prevent glitch if in fake death
if (FakeDeath)
{
damage = 0;
return;
}
//Don't really die in all phases of Kael'Thas
if (pInstance && pInstance->GetData(DATA_KAELTHAS_EVENT) == 0)
@@ -494,7 +418,6 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
//prevent death
damage = 0;
FakeDeath = true;
m_creature->InterruptNonMeleeSpells(false);
m_creature->SetHealth(0);
m_creature->StopMoving();
@@ -508,19 +431,14 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
}
}
void JustDied(Unit* slayer)
{
m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
}
void UpdateAI(const uint32 diff)
{
//If we are fake death, we cast revbirth and after that we kill the phoenix to spawn the egg.
if (FakeDeath)
{
@@ -529,10 +447,8 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
DoCast(m_creature, SPELL_REBIRTH_DMG);
Rebirth = true;
}
if (Rebirth)
{
if (Death_Timer < diff)
{
m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
@@ -542,12 +458,9 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
}else Death_Timer -= diff;
}
}
if (!UpdateVictim())
return;
if (BurnTimer < diff)
{
//spell Burn should possible do this, but it doesn't, so do this for now.
@@ -555,26 +468,19 @@ struct TRINITY_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI
m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false);
BurnTimer += 2000;
} BurnTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI
{
mob_felkael_phoenix_eggAI(Creature *c) : ScriptedAI(c) {}
uint32 HatchTimer;
void Reset()
{
HatchTimer = 10000;
}
void EnterCombat(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
if (HatchTimer < diff)
@@ -582,40 +488,31 @@ struct TRINITY_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI
m_creature->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
m_creature->Kill(m_creature);
} else HatchTimer -= diff;
}
};
struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI
{
mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) {Reset();}
uint32 DespawnTimer;
uint32 ChangeTargetTimer;
void Reset()
{
DespawnTimer = 30000;
ChangeTargetTimer = urand(6000,12000);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
m_creature->setFaction(14);
DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true);
}
void EnterCombat(Unit* who) {}
void UpdateAI(const uint32 diff)
{
if (DespawnTimer < diff)
m_creature->Kill(m_creature);
else DespawnTimer -= diff;
//Return since we have no target
if (!UpdateVictim())
return;
if (ChangeTargetTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
@@ -624,61 +521,49 @@ struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI
m_creature->TauntApply(target);
AttackStart(target);
}
ChangeTargetTimer = urand(5000,15000);
} else ChangeTargetTimer -= diff;
}
};
CreatureAI* GetAI_boss_felblood_kaelthas(Creature* c)
{
return new boss_felblood_kaelthasAI(c);
}
CreatureAI* GetAI_mob_arcane_sphere(Creature* c)
{
return new mob_arcane_sphereAI(c);
}
CreatureAI* GetAI_mob_felkael_phoenix(Creature* c)
{
return new mob_felkael_phoenixAI(c);
}
CreatureAI* GetAI_mob_felkael_phoenix_egg(Creature* c)
{
return new mob_felkael_phoenix_eggAI(c);
}
CreatureAI* GetAI_mob_felkael_flamestrike(Creature* c)
{
return new mob_felkael_flamestrikeAI(c);
}
void AddSC_boss_felblood_kaelthas()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_felblood_kaelthas";
newscript->GetAI = &GetAI_boss_felblood_kaelthas;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_arcane_sphere";
newscript->GetAI = &GetAI_mob_arcane_sphere;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_felkael_phoenix";
newscript->GetAI = &GetAI_mob_felkael_phoenix;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_felkael_phoenix_egg";
newscript->GetAI = &GetAI_mob_felkael_phoenix_egg;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_felkael_flamestrike";
newscript->GetAI = &GetAI_mob_felkael_flamestrike;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Selin_Fireheart
SD%Complete: 90
SDComment: Heroic and Normal Support. Needs further testing.
SDCategory: Magister's Terrace
EndScriptData */
#include "precompiled.h"
#include "def_magisters_terrace.h"
#define SAY_AGGRO -1585000
#define SAY_ENERGY -1585001
#define SAY_EMPOWERED -1585002
@@ -31,36 +28,29 @@ EndScriptData */
#define SAY_KILL_2 -1585004
#define SAY_DEATH -1585005
#define EMOTE_CRYSTAL -1585006
//Crystal effect spells
#define SPELL_FEL_CRYSTAL_COSMETIC 44374
#define SPELL_FEL_CRYSTAL_DUMMY 44329
#define SPELL_FEL_CRYSTAL_VISUAL 44355
#define SPELL_MANA_RAGE 44320 // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target
//Selin's spells
#define SPELL_DRAIN_LIFE 44294
#define SPELL_FEL_EXPLOSION 44314
#define SPELL_DRAIN_MANA 46153 // Heroic only
#define CRYSTALS_NUMBER 5
#define DATA_CRYSTALS 6
#define CREATURE_FEL_CRYSTAL 24722
struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
{
boss_selin_fireheartAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
Crystals.clear();
//GUIDs per instance is static, so we only need to load them once.
if (pInstance)
{
uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
for(uint8 i = 0; i < size; ++i)
for (uint8 i = 0; i < size; ++i)
{
uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
debug_log("TSCR: Selin: Adding Fel Crystal %u to list", guid);
@@ -69,29 +59,23 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
}
Heroic = c->GetMap()->IsHeroic();
}
ScriptedInstance* pInstance;
bool Heroic;
std::list<uint64> Crystals;
uint32 DrainLifeTimer;
uint32 DrainManaTimer;
uint32 FelExplosionTimer;
uint32 DrainCrystalTimer;
uint32 EmpowerTimer;
bool IsDraining;
bool DrainingCrystal;
uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course).
void Reset()
{
if (pInstance)
{
//for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for (std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
//Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]);
Unit* pUnit = Unit::GetUnit(*m_creature, *itr);
@@ -99,42 +83,36 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
{
if (!pUnit->isAlive())
CAST_CRE(pUnit)->Respawn(); // Let MaNGOS handle setting death state, etc.
// Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
}
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
// Small door opened after event are expected to be closed by default
// Set Inst data for encounter
pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
}else error_log(ERROR_INST_DATA);
DrainLifeTimer = 3000 + rand()%4000;
DrainManaTimer = DrainLifeTimer + 5000;
FelExplosionTimer = 2100;
DrainCrystalTimer = 10000 + rand()%5000;
DrainCrystalTimer = 20000 + rand()%5000;
EmpowerTimer = 10000;
IsDraining = false;
DrainingCrystal = false;
CrystalGUID = 0;
}
void SelectNearestCrystal()
{
if (Crystals.empty())
return;
float ShortestDistance = 0;
CrystalGUID = 0;
Unit* pCrystal = NULL;
Unit* CrystalChosen = NULL;
//for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for (std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
pCrystal = NULL;
//pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]);
@@ -153,25 +131,20 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
{
DoScriptText(SAY_ENERGY, m_creature);
DoScriptText(EMOTE_CRYSTAL, m_creature);
CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true);
float x, y, z; // coords that we move to, close to the crystal.
CrystalChosen->GetClosePoint(x, y, z, m_creature->GetObjectSize(), CONTACT_DISTANCE);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
DrainingCrystal = true;
}
}
void ShatterRemainingCrystals()
{
if (Crystals.empty())
return;
//for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for (std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
//Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i]));
Creature* pCrystal = Unit::GetCreature(*m_creature, *itr);
@@ -179,21 +152,17 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
pCrystal->Kill(pCrystal);
}
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
//Close the encounter door, open it in JustDied/Reset
}
void KilledUnit(Unit* victim)
{
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
}
void MovementInform(uint32 type, uint32 id)
{
if (type == POINT_MOTION_TYPE && id == 1)
@@ -215,25 +184,20 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
}
}
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (!pInstance)
return;
pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in
ShatterRemainingCrystals();
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (!DrainingCrystal)
{
uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
@@ -244,7 +208,6 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE);
DrainLifeTimer = 10000;
} else DrainLifeTimer -= diff;
// Heroic only
if (Heroic)
{
@@ -255,7 +218,6 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
} else DrainManaTimer -= diff;
}
}
if (FelExplosionTimer < diff)
{
if (!m_creature->IsNonMeleeSpellCasted(false))
@@ -264,7 +226,6 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
FelExplosionTimer = 2000;
}
} else FelExplosionTimer -= diff;
// If below 10% mana, start recharging
maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
@@ -276,7 +237,6 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
else DrainCrystalTimer = 20000 + rand()%5000;
} else DrainCrystalTimer -= diff;
}
}else
{
if (IsDraining)
@@ -285,41 +245,32 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
{
IsDraining = false;
DrainingCrystal = false;
DoScriptText(SAY_EMPOWERED, m_creature);
Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
if (CrystalChosen && CrystalChosen->isAlive())
// Use Deal Damage to kill it, not setDeathState.
CrystalChosen->Kill(CrystalChosen);
CrystalGUID = 0;
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
} else EmpowerTimer -= diff;
}
}
DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun.
}
};
CreatureAI* GetAI_boss_selin_fireheart(Creature* pCreature)
{
return new boss_selin_fireheartAI (pCreature);
};
struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI
{
mob_fel_crystalAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void EnterCombat(Unit* who) {}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff) {}
void JustDied(Unit* killer)
{
if (ScriptedInstance* pInstance = m_creature->GetInstanceData())
@@ -343,21 +294,17 @@ struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI
} else error_log(ERROR_INST_DATA);
}
};
CreatureAI* GetAI_mob_fel_crystal(Creature* pCreature)
{
return new mob_fel_crystalAI (pCreature);
};
void AddSC_boss_selin_fireheart()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_selin_fireheart";
newscript->GetAI = &GetAI_boss_selin_fireheart;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_fel_crystal";
newscript->GetAI = &GetAI_mob_fel_crystal;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Vexallus
SD%Complete: 90
SDComment: Heroic and Normal support. Needs further testing.
SDCategory: Magister's Terrace
EndScriptData */
#include "precompiled.h"
#include "def_magisters_terrace.h"
enum eEnums
{
SAY_AGGRO = -1585007,
@@ -31,32 +28,25 @@ enum eEnums
SAY_OVERLOAD = -1585009,
SAY_KILL = -1585010,
EMOTE_DISCHARGE_ENERGY = -1585011,
//is this text for real?
//#define SAY_DEATH "What...happen...ed."
//Pure energy spell info
SPELL_ENERGY_BOLT = 46156,
SPELL_ENERGY_FEEDBACK = 44335,
//Vexallus spell info
SPELL_CHAIN_LIGHTNING = 44318,
SPELL_H_CHAIN_LIGHTNING = 46380, //heroic spell
SPELL_OVERLOAD = 44353,
SPELL_ARCANE_SHOCK = 44319,
SPELL_H_ARCANE_SHOCK = 46381, //heroic spell
SPELL_SUMMON_PURE_ENERGY = 44322, //mod scale -10
H_SPELL_SUMMON_PURE_ENERGY1 = 46154, //mod scale -5
H_SPELL_SUMMON_PURE_ENERGY2 = 46159, //mod scale -5
//Creatures
NPC_PURE_ENERGY = 24745,
INTERVAL_MODIFIER = 15,
INTERVAL_SWITCH = 6
};
struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
{
boss_vexallusAI(Creature *c) : ScriptedAI(c)
@@ -64,16 +54,13 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
pInstance = c->GetInstanceData();
Heroic = c->GetMap()->IsHeroic();
}
ScriptedInstance* pInstance;
bool Heroic;
uint32 ChainLightningTimer;
uint32 ArcaneShockTimer;
uint32 OverloadTimer;
uint32 IntervalHealthAmount;
bool Enraged;
void Reset()
{
ChainLightningTimer = 8000;
@@ -81,44 +68,35 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
OverloadTimer = 1200;
IntervalHealthAmount = 1;
Enraged = false;
if (pInstance)
pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
}
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_KILL, m_creature);
}
void JustDied(Unit *victim)
{
if (pInstance)
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
}
void JustSummoned(Creature *summoned)
{
if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0))
summoned->GetMotionMaster()->MoveFollow(temp,0,0);
//spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok
summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,m_creature->GetGUID());
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (!Enraged)
{
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
@@ -132,10 +110,8 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
}
else
++IntervalHealthAmount;
DoScriptText(SAY_ENERGY, m_creature);
DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature);
if (Heroic)
{
m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY1,false);
@@ -143,28 +119,22 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
}
else
m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false);
//below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos
m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (Heroic)
m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
}
if (ChainLightningTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(target, Heroic ? SPELL_H_CHAIN_LIGHTNING : SPELL_CHAIN_LIGHTNING);
ChainLightningTimer = 8000;
}else ChainLightningTimer -= diff;
if (ArcaneShockTimer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (target)
DoCast(target, Heroic ? SPELL_H_ARCANE_SHOCK : SPELL_ARCANE_SHOCK);
ArcaneShockTimer = 8000;
}else ArcaneShockTimer -= diff;
}
@@ -173,26 +143,20 @@ struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
if (OverloadTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_OVERLOAD);
OverloadTimer = 2000;
}else OverloadTimer -= diff;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_vexallus(Creature* pCreature)
{
return new boss_vexallusAI (pCreature);
};
struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
{
mob_pure_energyAI(Creature *c) : ScriptedAI(c) {}
void Reset() { }
void JustDied(Unit* slayer)
{
if (Unit *temp = m_creature->GetOwner())
@@ -201,26 +165,21 @@ struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
}
}
void EnterCombat(Unit *who) { }
void MoveInLineOfSight(Unit *who) { }
void AttackStart(Unit *who) { }
};
CreatureAI* GetAI_mob_pure_energy(Creature* pCreature)
{
return new mob_pure_energyAI (pCreature);
};
void AddSC_boss_vexallus()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_vexallus";
newscript->GetAI = &GetAI_boss_vexallus;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_pure_energy";
newscript->GetAI = &GetAI_mob_pure_energy;
@@ -1,31 +1,24 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_MAGISTERS_TERRACE_H
#define DEF_MAGISTERS_TERRACE_H
#define DATA_SELIN_EVENT 1
#define DATA_VEXALLUS_EVENT 2
#define DATA_DELRISSA_EVENT 3
#define DATA_KAELTHAS_EVENT 4
#define DATA_SELIN 5
#define DATA_FEL_CRYSTAL 6
#define DATA_FEL_CRYSTAL_SIZE 7
#define DATA_VEXALLUS_DOOR 8
#define DATA_SELIN_DOOR 9
#define DATA_DELRISSA 10
#define DATA_DELRISSA_DOOR 11
#define DATA_SELIN_ENCOUNTER_DOOR 12
#define DATA_KAEL_DOOR 13
#define DATA_KAEL_STATUE_LEFT 14
#define DATA_KAEL_STATUE_RIGHT 15
#define DATA_DELRISSA_DEATH_COUNT 16
#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy."
#endif
@@ -13,36 +13,28 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Magisters_Terrace
SD%Complete: 60
SDComment: Designed only for Selin Fireheart
SDCategory: Magister's Terrace
EndScriptData */
#include "precompiled.h"
#include "def_magisters_terrace.h"
#define MAX_ENCOUNTER 4
/*
0 - Selin Fireheart
1 - Vexallus
2 - Priestess Delrissa
3 - Kael'thas Sunstrider
*/
struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
{
instance_magisters_terrace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 DelrissaDeathCount;
std::list<uint64> FelCrystals;
std::list<uint64>::iterator CrystalItr;
uint64 SelinGUID;
uint64 DelrissaGUID;
uint64 VexallusDoorGUID;
@@ -51,17 +43,12 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
uint64 DelrissaDoorGUID;
uint64 KaelDoorGUID;
uint64 KaelStatue[2];
bool InitializedItr;
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
FelCrystals.clear();
DelrissaDeathCount = 0;
SelinGUID = 0;
DelrissaGUID = 0;
VexallusDoorGUID = 0;
@@ -71,18 +58,15 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
KaelDoorGUID = 0;
KaelStatue[0] = 0;
KaelStatue[1] = 0;
InitializedItr = false;
}
bool IsEncounterInProgress() const
{
for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
uint32 GetData(uint32 identifier)
{
switch(identifier)
@@ -96,7 +80,6 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
}
return 0;
}
void SetData(uint32 identifier, uint32 data)
{
switch(identifier)
@@ -115,7 +98,6 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
m_auiEncounter[2] = data;
break;
case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break;
case DATA_DELRISSA_DEATH_COUNT:
if (data == SPECIAL)
++DelrissaDeathCount;
@@ -124,7 +106,6 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
break;
}
}
void OnCreatureCreate(Creature* pCreature, bool add)
{
switch(pCreature->GetEntry())
@@ -134,7 +115,6 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
case 24722: FelCrystals.push_back(pCreature->GetGUID()); break;
}
}
void OnGameObjectCreate(GameObject* pGo, bool add)
{
switch(pGo->GetEntry())
@@ -150,7 +130,6 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
case 188166: KaelStatue[1] = pGo->GetGUID(); break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
@@ -164,7 +143,6 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
case DATA_KAEL_DOOR: return KaelDoorGUID;
case DATA_KAEL_STATUE_LEFT: return KaelStatue[0];
case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1];
case DATA_FEL_CRYSTAL:
{
if (FelCrystals.empty())
@@ -172,13 +150,11 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
error_log("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data");
return 0;
}
if (!InitializedItr)
{
CrystalItr = FelCrystals.begin();
InitializedItr = true;
}
uint64 guid = *CrystalItr;
++CrystalItr;
return guid;
@@ -187,16 +163,13 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance
return 0;
}
};
InstanceData* GetInstanceData_instance_magisters_terrace(Map* pMap)
{
return new instance_magisters_terrace(pMap);
}
void AddSC_instance_magisters_terrace()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_magisters_terrace";
newscript->GetInstanceData = &GetInstanceData_instance_magisters_terrace;
@@ -13,24 +13,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Magisters_Terrace
SD%Complete: 100
SDComment: Quest support: 11490(post-event)
SDCategory: Magisters Terrace
EndScriptData */
/* ContentData
npc_kalecgos
EndContentData */
#include "precompiled.h"
/*######
## npc_kalecgos
######*/
enum eEnums
{
SPELL_TRANSFORM_TO_KAEL = 44670,
@@ -38,57 +33,43 @@ enum eEnums
NPC_KAEL = 24848, //human form entry
POINT_ID_LAND = 1
};
const float afKaelLandPoint[] = {225.045, -276.236, -5.434};
#define GOSSIP_ITEM_KAEL_1 "Who are you?"
#define GOSSIP_ITEM_KAEL_2 "What can we do to assist you?"
#define GOSSIP_ITEM_KAEL_3 "What brings you to the Sunwell?"
#define GOSSIP_ITEM_KAEL_4 "You're not alone here?"
#define GOSSIP_ITEM_KAEL_5 "What would Kil'jaeden want with a mortal woman?"
// This is friendly keal that appear after used Orb.
// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is
struct TRINITY_DLL_DECL npc_kalecgosAI : public ScriptedAI
{
npc_kalecgosAI(Creature* pCreature) : ScriptedAI(pCreature) { }
uint32 m_uiTransformTimer;
void Reset()
{
m_uiTransformTimer = 0;
// we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here
if (m_creature->GetEntry() != NPC_KAEL)
m_creature->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
}
void MovementInform(uint32 uiType, uint32 uiPointId)
{
if (uiType != POINT_MOTION_TYPE)
return;
if (uiPointId == POINT_ID_LAND)
m_uiTransformTimer = MINUTE*IN_MILISECONDS;
}
// some targeting issues with the spell, so use this workaround as temporary solution
void DoWorkaroundForQuestCredit()
{
Map* pMap = m_creature->GetMap();
if (!pMap || pMap->IsHeroic())
return;
Map::PlayerList const &lList = pMap->GetPlayers();
if (lList.isEmpty())
return;
SpellEntry const* pSpell = GetSpellStore()->LookupEntry(SPELL_ORB_KILL_CREDIT);
for(Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i)
for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i)
{
if (Player* pPlayer = i->getSource())
{
@@ -97,7 +78,6 @@ struct TRINITY_DLL_DECL npc_kalecgosAI : public ScriptedAI
}
}
}
void UpdateAI(const uint32 uiDiff)
{
if (m_uiTransformTimer)
@@ -106,33 +86,26 @@ struct TRINITY_DLL_DECL npc_kalecgosAI : public ScriptedAI
{
m_creature->CastSpell(m_creature,SPELL_ORB_KILL_CREDIT,false);
DoWorkaroundForQuestCredit();
// Transform and update entry, now ready for quest/read gossip
m_creature->CastSpell(m_creature,SPELL_TRANSFORM_TO_KAEL,false);
m_creature->UpdateEntry(NPC_KAEL);
m_uiTransformTimer = 0;
}else m_uiTransformTimer -= uiDiff;
}
}
};
CreatureAI* GetAI_npc_kalecgos(Creature* pCreature)
{
return new npc_kalecgosAI(pCreature);
}
bool GossipHello_npc_kalecgos(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(12498, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_kalecgos(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
@@ -157,14 +130,11 @@ bool GossipSelect_npc_kalecgos(Player* pPlayer, Creature* pCreature, uint32 uiSe
pPlayer->SEND_GOSSIP_MENU(12608, pCreature->GetGUID());
break;
}
return true;
}
void AddSC_magisters_terrace()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_kalecgos";
newscript->GetAI = &GetAI_npc_kalecgos;
@@ -13,47 +13,37 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Baron_Geddon
SD%Complete: 100
SDComment:
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#define EMOTE_SERVICE -1409000
#define SPELL_INFERNO 19695
#define SPELL_IGNITEMANA 19659
#define SPELL_LIVINGBOMB 20475
#define SPELL_ARMAGEDDOM 20479
struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI
{
boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {}
uint32 Inferno_Timer;
uint32 IgniteMana_Timer;
uint32 LivingBomb_Timer;
void Reset()
{
Inferno_Timer = 45000; //These times are probably wrong
IgniteMana_Timer = 30000;
LivingBomb_Timer = 35000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//If we are <2% hp cast Armageddom
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2)
{
@@ -62,32 +52,26 @@ struct TRINITY_DLL_DECL boss_baron_geddonAI : public ScriptedAI
DoScriptText(EMOTE_SERVICE, m_creature);
return;
}
//Inferno_Timer
if (Inferno_Timer < diff)
{
DoCast(m_creature,SPELL_INFERNO);
Inferno_Timer = 45000;
}else Inferno_Timer -= diff;
//IgniteMana_Timer
if (IgniteMana_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_IGNITEMANA);
IgniteMana_Timer = 30000;
}else IgniteMana_Timer -= diff;
//LivingBomb_Timer
if (LivingBomb_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_LIVINGBOMB);
LivingBomb_Timer = 35000;
}else LivingBomb_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -95,7 +79,6 @@ CreatureAI* GetAI_boss_baron_geddon(Creature* pCreature)
{
return new boss_baron_geddonAI (pCreature);
}
void AddSC_boss_baron_geddon()
{
Script *newscript;
@@ -13,98 +13,78 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Garr
SD%Complete: 50
SDComment: Adds NYI
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
// Garr spells
#define SPELL_ANTIMAGICPULSE 19492
#define SPELL_MAGMASHACKLES 19496
#define SPELL_ENRAGE 19516 //Stacking enrage (stacks to 10 times)
//Add spells
#define SPELL_ERUPTION 19497
#define SPELL_IMMOLATE 20294
struct TRINITY_DLL_DECL boss_garrAI : public ScriptedAI
{
boss_garrAI(Creature *c) : ScriptedAI(c) {}
uint32 AntiMagicPulse_Timer;
uint32 MagmaShackles_Timer;
uint32 CheckAdds_Timer;
uint64 Add[8];
bool Enraged[8];
void Reset()
{
AntiMagicPulse_Timer = 25000; //These times are probably wrong
MagmaShackles_Timer = 15000;
CheckAdds_Timer = 2000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//AntiMagicPulse_Timer
if (AntiMagicPulse_Timer < diff)
{
DoCast(m_creature,SPELL_ANTIMAGICPULSE);
AntiMagicPulse_Timer = 10000 + rand()%5000;
}else AntiMagicPulse_Timer -= diff;
//MagmaShackles_Timer
if (MagmaShackles_Timer < diff)
{
DoCast(m_creature,SPELL_MAGMASHACKLES);
MagmaShackles_Timer = 8000 + rand()%4000;
}else MagmaShackles_Timer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL mob_fireswornAI : public ScriptedAI
{
mob_fireswornAI(Creature *c) : ScriptedAI(c) {}
uint32 Immolate_Timer;
void Reset()
{
Immolate_Timer = 4000; //These times are probably wrong
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Immolate_Timer
if (Immolate_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_IMMOLATE);
Immolate_Timer = 5000 + rand()%5000;
}else Immolate_Timer -= diff;
//Cast Erruption and let them die
if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.10)
{
@@ -112,7 +92,6 @@ struct TRINITY_DLL_DECL mob_fireswornAI : public ScriptedAI
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
}
DoMeleeAttackIfReady();
}
};
@@ -120,21 +99,17 @@ CreatureAI* GetAI_boss_garr(Creature* pCreature)
{
return new boss_garrAI (pCreature);
}
CreatureAI* GetAI_mob_firesworn(Creature* pCreature)
{
return new mob_fireswornAI (pCreature);
}
void AddSC_boss_garr()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_garr";
newscript->GetAI = &GetAI_boss_garr;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_firesworn";
newscript->GetAI = &GetAI_mob_firesworn;
@@ -13,42 +13,33 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Gehennas
SD%Complete: 90
SDComment: Adds MC NYI
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#define SPELL_SHADOWBOLT 19728
#define SPELL_RAINOFFIRE 19717
#define SPELL_GEHENNASCURSE 19716
struct TRINITY_DLL_DECL boss_gehennasAI : public ScriptedAI
{
boss_gehennasAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowBolt_Timer;
uint32 RainOfFire_Timer;
uint32 GehennasCurse_Timer;
void Reset()
{
ShadowBolt_Timer = 6000;
RainOfFire_Timer = 10000;
GehennasCurse_Timer = 12000;
}
void EnterCombat(Unit *who) { }
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//ShadowBolt_Timer
if (ShadowBolt_Timer < diff)
{
@@ -56,23 +47,19 @@ struct TRINITY_DLL_DECL boss_gehennasAI : public ScriptedAI
DoCast(bTarget,SPELL_SHADOWBOLT);
ShadowBolt_Timer = 7000;
}else ShadowBolt_Timer -= diff;
//RainOfFire_Timer
if (RainOfFire_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_RAINOFFIRE);
RainOfFire_Timer = 4000 + rand()%8000;
}else RainOfFire_Timer -= diff;
//GehennasCurse_Timer
if (GehennasCurse_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_GEHENNASCURSE);
GehennasCurse_Timer = 22000 + rand()%8000;
}else GehennasCurse_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -80,7 +67,6 @@ CreatureAI* GetAI_boss_gehennas(Creature* pCreature)
{
return new boss_gehennasAI (pCreature);
}
void AddSC_boss_gehennas()
{
Script *newscript;
@@ -13,17 +13,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Golemagg
SD%Complete: 90
SDComment: Timers need to be confirmed, Golemagg's Trust need to be checked
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#include "def_molten_core.h"
enum eEnums
{
SPELL_MAGMASPLASH = 13879,
@@ -31,65 +28,53 @@ enum eEnums
SPELL_EARTHQUAKE = 19798,
SPELL_ENRAGE = 19953,
SPELL_GOLEMAGG_TRUST = 20553,
// Core Rager
EMOTE_LOWHP = -1409002,
SPELL_MANGLE = 19820
};
struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI
{
boss_golemaggAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = pCreature->GetInstanceData();
}
ScriptedInstance* m_pInstance;
uint32 m_uiPyroblastTimer;
uint32 m_uiEarthquakeTimer;
uint32 m_uiBuffTimer;
bool m_bEnraged;
void Reset()
{
m_uiPyroblastTimer = 7*IN_MILISECONDS; // These timers are probably wrong
m_uiEarthquakeTimer = 3*IN_MILISECONDS;
m_uiBuffTimer = 2.5*IN_MILISECONDS;
m_bEnraged = false;
m_creature->CastSpell(m_creature, SPELL_MAGMASPLASH, true);
}
void JustDied(Unit* pKiller)
{
if (m_pInstance)
m_pInstance->SetData(DATA_GOLEMAGG_DEATH, 0);
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//Pyroblast
if (m_uiPyroblastTimer < uiDiff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_PYROBLAST);
m_uiPyroblastTimer = 7*IN_MILISECONDS;
}
else
m_uiPyroblastTimer -= uiDiff;
// Enrage
if (!m_bEnraged && m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*10)
{
DoCast(m_creature, SPELL_ENRAGE);
m_bEnraged = true;
}
// Earthquake
if (m_bEnraged)
{
@@ -101,7 +86,6 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI
else
m_uiEarthquakeTimer -= uiDiff;
}
/*
// Golemagg's Trust
if (m_uiBuffTimer < uiDiff)
@@ -112,27 +96,21 @@ struct TRINITY_DLL_DECL boss_golemaggAI : public ScriptedAI
else
m_uiBuffTimer -= uiDiff;
*/
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI
{
mob_core_ragerAI(Creature *c) : ScriptedAI(c)
{
m_pInstance = c->GetInstanceData();
}
ScriptedInstance* m_pInstance;
uint32 m_uiMangleTimer;
void Reset()
{
m_uiMangleTimer = 7*IN_MILISECONDS; // These times are probably wrong
}
void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
{
if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*50)
@@ -152,12 +130,10 @@ struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI
}
}
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
// Mangle
if (m_uiMangleTimer < uiDiff)
{
@@ -166,30 +142,24 @@ struct TRINITY_DLL_DECL mob_core_ragerAI : public ScriptedAI
}
else
m_uiMangleTimer -= uiDiff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_golemagg(Creature* pCreature)
{
return new boss_golemaggAI (pCreature);
}
CreatureAI* GetAI_mob_core_rager(Creature* pCreature)
{
return new mob_core_ragerAI (pCreature);
}
void AddSC_boss_golemagg()
{
Script* newscript;
newscript = new Script;
newscript->Name = "boss_golemagg";
newscript->GetAI = &GetAI_boss_golemagg;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_core_rager";
newscript->GetAI = &GetAI_mob_core_rager;
@@ -13,65 +13,53 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Lucifron
SD%Complete: 100
SDComment:
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#define SPELL_IMPENDINGDOOM 19702
#define SPELL_LUCIFRONCURSE 19703
#define SPELL_SHADOWSHOCK 20603
struct TRINITY_DLL_DECL boss_lucifronAI : public ScriptedAI
{
boss_lucifronAI(Creature *c) : ScriptedAI(c) {}
uint32 ImpendingDoom_Timer;
uint32 LucifronCurse_Timer;
uint32 ShadowShock_Timer;
void Reset()
{
ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate
LucifronCurse_Timer = 20000; //Initial cast after 20 seconds
ShadowShock_Timer = 6000; //6 seconds
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Impending doom timer
if (ImpendingDoom_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_IMPENDINGDOOM);
ImpendingDoom_Timer = 20000;
}else ImpendingDoom_Timer -= diff;
//Lucifron's curse timer
if (LucifronCurse_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_LUCIFRONCURSE);
LucifronCurse_Timer = 15000;
}else LucifronCurse_Timer -= diff;
//Shadowshock
if (ShadowShock_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOWSHOCK);
ShadowShock_Timer = 6000;
}else ShadowShock_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -79,7 +67,6 @@ CreatureAI* GetAI_boss_lucifron(Creature* pCreature)
{
return new boss_lucifronAI (pCreature);
}
void AddSC_boss_lucifron()
{
Script *newscript;
@@ -13,50 +13,39 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Magmadar
SD%Complete: 75
SDComment: Conflag on ground nyi, fear causes issues without VMAPs
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#define EMOTE_FRENZY -1409001
#define SPELL_FRENZY 19451
#define SPELL_MAGMASPIT 19449 //This is actually a buff he gives himself
#define SPELL_PANIC 19408
#define SPELL_LAVABOMB 19411 //This calls a dummy server side effect that isn't implemented yet
#define SPELL_LAVABOMB_ALT 19428 //This is the spell that the lava bomb casts
struct TRINITY_DLL_DECL boss_magmadarAI : public ScriptedAI
{
boss_magmadarAI(Creature *c) : ScriptedAI(c) {}
uint32 Frenzy_Timer;
uint32 Panic_Timer;
uint32 Lavabomb_Timer;
void Reset()
{
Frenzy_Timer = 30000;
Panic_Timer = 20000;
Lavabomb_Timer = 12000;
m_creature->CastSpell(m_creature,SPELL_MAGMASPIT,true);
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Frenzy_Timer
if (Frenzy_Timer < diff)
{
@@ -64,23 +53,19 @@ struct TRINITY_DLL_DECL boss_magmadarAI : public ScriptedAI
DoCast(m_creature,SPELL_FRENZY);
Frenzy_Timer = 15000;
}else Frenzy_Timer -= diff;
//Panic_Timer
if (Panic_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_PANIC);
Panic_Timer = 35000;
}else Panic_Timer -= diff;
//Lavabomb_Timer
if (Lavabomb_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_LAVABOMB_ALT);
Lavabomb_Timer = 12000;
}else Lavabomb_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -88,7 +73,6 @@ CreatureAI* GetAI_boss_magmadar(Creature* pCreature)
{
return new boss_magmadarAI (pCreature);
}
void AddSC_boss_magmadar()
{
Script *newscript;
@@ -13,108 +13,86 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Majordomo_Executus
SD%Complete: 30
SDComment: Correct spawning and Event NYI
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#define SAY_AGGRO -1409003
#define SAY_SPAWN -1409004
#define SAY_SLAY -1409005
#define SAY_SPECIAL -1409006
#define SAY_DEFEAT -1409007
#define SAY_SUMMON_MAJ -1409008
#define SAY_ARRIVAL1_RAG -1409009
#define SAY_ARRIVAL2_MAJ -1409010
#define SAY_ARRIVAL3_RAG -1409011
#define SAY_ARRIVAL5_RAG -1409012
#define SPAWN_RAG_X 838.51
#define SPAWN_RAG_Y -829.84
#define SPAWN_RAG_Z -232.00
#define SPAWN_RAG_O 1.70
#define SPELL_MAGIC_REFLECTION 20619
#define SPELL_DAMAGE_REFLECTION 21075
#define SPELL_BLASTWAVE 20229
#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50%
#define SPELL_TELEPORT 20618
#define SPELL_SUMMON_RAGNAROS 19774
#define ENTRY_FLAMEWALKER_HEALER 11663
#define ENTRY_FLAMEWALKER_ELITE 11664
struct TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI
{
boss_majordomoAI(Creature *c) : ScriptedAI(c) {}
uint32 MagicReflection_Timer;
uint32 DamageReflection_Timer;
uint32 Blastwave_Timer;
void Reset()
{
MagicReflection_Timer = 30000; //Damage reflection first so we alternate
DamageReflection_Timer = 15000;
Blastwave_Timer = 10000;
}
void KilledUnit(Unit* victim)
{
if (rand()%5)
return;
DoScriptText(SAY_SLAY, m_creature);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Cast Ageis if less than 50% hp
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
{
DoCast(m_creature,SPELL_AEGIS);
}
//MagicReflection_Timer
// if (MagicReflection_Timer < diff)
// {
// DoCast(m_creature, SPELL_MAGICREFLECTION);
//60 seconds until we should cast this agian
// MagicReflection_Timer = 30000;
// }else MagicReflection_Timer -= diff;
//DamageReflection_Timer
// if (DamageReflection_Timer < diff)
// {
// DoCast(m_creature, SPELL_DAMAGEREFLECTION);
//60 seconds until we should cast this agian
// DamageReflection_Timer = 30000;
// }else DamageReflection_Timer -= diff;
//Blastwave_Timer
if (Blastwave_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_BLASTWAVE);
Blastwave_Timer = 10000;
}else Blastwave_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -122,7 +100,6 @@ CreatureAI* GetAI_boss_majordomo(Creature* pCreature)
{
return new boss_majordomoAI (pCreature);
}
void AddSC_boss_majordomo()
{
Script *newscript;
@@ -13,83 +13,67 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Ragnaros
SD%Complete: 75
SDComment: Intro Dialog and event NYI
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#define SAY_REINFORCEMENTS1 -1409013
#define SAY_REINFORCEMENTS2 -1409014
#define SAY_HAND -1409015
#define SAY_WRATH -1409016
#define SAY_KILL -1409017
#define SAY_MAGMABURST -1409018
#define SPELL_HANDOFRAGNAROS 19780
#define SPELL_WRATHOFRAGNAROS 20566
#define SPELL_LAVABURST 21158
#define SPELL_MAGMABURST 20565 //Ranged attack
#define SPELL_SONSOFFLAME_DUMMY 21108 //Server side effect
#define SPELL_RAGSUBMERGE 21107 //Stealth aura
#define SPELL_RAGEMERGE 20568
#define SPELL_MELTWEAPON 21388
#define SPELL_ELEMENTALFIRE 20564
#define SPELL_ERRUPTION 17731
#define ADD_1X 848.740356
#define ADD_1Y -816.103455
#define ADD_1Z -229.74327
#define ADD_1O 2.615287
#define ADD_2X 852.560791
#define ADD_2Y -849.861511
#define ADD_2Z -228.560974
#define ADD_2O 2.836073
#define ADD_3X 808.710632
#define ADD_3Y -852.845764
#define ADD_3Z -227.914963
#define ADD_3O 0.964207
#define ADD_4X 786.597107
#define ADD_4Y -821.132874
#define ADD_4Z -226.350128
#define ADD_4O 0.949377
#define ADD_5X 796.219116
#define ADD_5Y -800.948059
#define ADD_5Z -226.010361
#define ADD_5O 0.560603
#define ADD_6X 821.602539
#define ADD_6Y -782.744109
#define ADD_6Z -226.023575
#define ADD_6O 6.157440
#define ADD_7X 844.924744
#define ADD_7Y -769.453735
#define ADD_7Z -225.521698
#define ADD_7O 4.4539958
#define ADD_8X 839.823364
#define ADD_8Y -810.869385
#define ADD_8Z -229.683182
#define ADD_8O 4.693108
struct TRINITY_DLL_DECL boss_ragnarosAI : public ScriptedAI
{
boss_ragnarosAI(Creature *c) : ScriptedAI(c)
{
SetCombatMovement(false);
}
uint32 WrathOfRagnaros_Timer;
uint32 HandOfRagnaros_Timer;
uint32 LavaBurst_Timer;
@@ -103,7 +87,6 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public ScriptedAI
bool HasSubmergedOnce;
bool WasBanished;
bool HasAura;
void Reset()
{
WrathOfRagnaros_Timer = 30000;
@@ -117,23 +100,18 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public ScriptedAI
HasYelledMagmaBurst = false;
HasSubmergedOnce = false;
WasBanished = false;
m_creature->CastSpell(m_creature,SPELL_MELTWEAPON,true);
HasAura = true;
}
void KilledUnit(Unit* victim)
{
if (rand()%5)
return;
DoScriptText(SAY_KILL, m_creature);
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (WasBanished && Attack_Timer < diff)
@@ -149,78 +127,64 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public ScriptedAI
//Do nothing while banished
return;
}
//Return since we have no target
if (!UpdateVictim())
return;
//WrathOfRagnaros_Timer
if (WrathOfRagnaros_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_WRATHOFRAGNAROS);
if (rand()%2 == 0)
{
DoScriptText(SAY_WRATH, m_creature);
}
WrathOfRagnaros_Timer = 30000;
}else WrathOfRagnaros_Timer -= diff;
//HandOfRagnaros_Timer
if (HandOfRagnaros_Timer < diff)
{
DoCast(m_creature,SPELL_HANDOFRAGNAROS);
if (rand()%2==0)
{
DoScriptText(SAY_HAND, m_creature);
}
HandOfRagnaros_Timer = 25000;
}else HandOfRagnaros_Timer -= diff;
//LavaBurst_Timer
if (LavaBurst_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_LAVABURST);
LavaBurst_Timer = 10000;
}else LavaBurst_Timer -= diff;
//Erruption_Timer
if (LavaBurst_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_ERRUPTION);
Erruption_Timer = 20000 + rand()%25000;
}else Erruption_Timer -= diff;
//ElementalFire_Timer
if (ElementalFire_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_ELEMENTALFIRE);
ElementalFire_Timer = 10000 + rand()%4000;
}else ElementalFire_Timer -= diff;
//Submerge_Timer
if (!WasBanished && Submerge_Timer < diff)
{
//Creature spawning and ragnaros becomming unattackable
//is not very well supported in the core
//so added normaly spawning and banish workaround and attack again after 90 secs.
m_creature->InterruptNonMeleeSpells(false);
//Root self
DoCast(m_creature,23973);
m_creature->setFaction(35);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
if (!HasSubmergedOnce)
{
DoScriptText(SAY_REINFORCEMENTS1, m_creature);
// summon 10 elementals
for(uint8 i = 0; i < 9; ++i)
for (uint8 i = 0; i < 9; ++i)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
@@ -228,18 +192,15 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public ScriptedAI
pSummoned->AI()->AttackStart(pTarget);
}
}
HasSubmergedOnce = true;
WasBanished = true;
DoCast(m_creature,SPELL_RAGSUBMERGE);
Attack_Timer = 90000;
}
else
{
DoScriptText(SAY_REINFORCEMENTS2, m_creature);
for(uint8 i = 0; i < 9; ++i)
for (uint8 i = 0; i < 9; ++i)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
@@ -247,15 +208,12 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public ScriptedAI
pSummoned->AI()->AttackStart(pTarget);
}
}
WasBanished = true;
DoCast(m_creature,SPELL_RAGSUBMERGE);
Attack_Timer = 90000;
}
Submerge_Timer = 180000;
}else Submerge_Timer -= diff;
//If we are within range melee the target
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
@@ -272,14 +230,12 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public ScriptedAI
if (MagmaBurst_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MAGMABURST);
if (!HasYelledMagmaBurst)
{
//Say our dialog
DoScriptText(SAY_MAGMABURST, m_creature);
HasYelledMagmaBurst = true;
}
MagmaBurst_Timer = 2500;
}else MagmaBurst_Timer -= diff;
}
@@ -289,7 +245,6 @@ CreatureAI* GetAI_boss_ragnaros(Creature* pCreature)
{
return new boss_ragnarosAI (pCreature);
}
void AddSC_boss_ragnaros()
{
Script *newscript;
@@ -13,31 +13,25 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Shazzrah
SD%Complete: 75
SDComment: Teleport NYI
SDCategory: Molten Core
EndScriptData */
#include "precompiled.h"
#define SPELL_ARCANEEXPLOSION 19712
#define SPELL_SHAZZRAHCURSE 19713
#define SPELL_DEADENMAGIC 19714
#define SPELL_COUNTERSPELL 19715
struct TRINITY_DLL_DECL boss_shazzrahAI : public ScriptedAI
{
boss_shazzrahAI(Creature *c) : ScriptedAI(c) {}
uint32 ArcaneExplosion_Timer;
uint32 ShazzrahCurse_Timer;
uint32 DeadenMagic_Timer;
uint32 Countspell_Timer;
uint32 Blink_Timer;
void Reset()
{
ArcaneExplosion_Timer = 6000; //These times are probably wrong
@@ -46,47 +40,39 @@ struct TRINITY_DLL_DECL boss_shazzrahAI : public ScriptedAI
Countspell_Timer = 15000;
Blink_Timer = 30000;
}
void EnterCombat(Unit *who)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_ARCANEEXPLOSION);
ArcaneExplosion_Timer = 5000 + rand()%4000;
}else ArcaneExplosion_Timer -= diff;
//ShazzrahCurse_Timer
if (ShazzrahCurse_Timer < diff)
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target) DoCast(target,SPELL_SHAZZRAHCURSE);
ShazzrahCurse_Timer = 25000 + rand()%5000;
}else ShazzrahCurse_Timer -= diff;
//DeadenMagic_Timer
if (DeadenMagic_Timer < diff)
{
DoCast(m_creature,SPELL_DEADENMAGIC);
DeadenMagic_Timer = 35000;
}else DeadenMagic_Timer -= diff;
//Countspell_Timer
if (Countspell_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_COUNTERSPELL);
Countspell_Timer = 16000 + rand()%4000;
}else Countspell_Timer -= diff;
//Blink_Timer
if (Blink_Timer < diff)
{
@@ -94,17 +80,14 @@ struct TRINITY_DLL_DECL boss_shazzrahAI : public ScriptedAI
// Blink is not working cause of LoS System we need to do this hardcoded.
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
{
DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
DoCast(target,SPELL_ARCANEEXPLOSION);
DoResetThreat();
}
Blink_Timer = 45000;
}else Blink_Timer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -112,7 +95,6 @@ CreatureAI* GetAI_boss_shazzrah(Creature* pCreature)
{
return new boss_shazzrahAI (pCreature);
}
void AddSC_boss_shazzrah()
{
Script *newscript;

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