Merge [SD2]
r1046 Fixed misc bugs in various scripts:
Initialize variables, correct indexes too big/small, correct local declaration of pointers already declared in outer scopes.
r1047 Fixed a few more, continued from previous commit.
r1048 Initialize variables for 4 more scripts.
r1049 Fixing more uninitialized variables in misc scripts.
r1050 Fixed memory leaks in delrissa script and few other possible crashes.
--HG--
branch : trunk
This commit is contained in:
@@ -241,7 +241,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
|
||||
// Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later.
|
||||
if(ExplosionCount < 3)
|
||||
{
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
for(uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Unit* pUnit = NULL;
|
||||
if(TargetGUID[i])
|
||||
|
||||
@@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
uint32 spawnCreatureID;
|
||||
uint32 spawnCreatureID = 0;
|
||||
|
||||
switch(rand()%3)
|
||||
{
|
||||
|
||||
+2
-1
@@ -32,7 +32,8 @@ EndScriptData */
|
||||
#define SPELL_RIFT_CHANNEL 31387
|
||||
|
||||
#define RIFT_BOSS 1
|
||||
inline uint32 RandRiftBoss() { return rand()%2 ? C_RKEEP : C_RLORD; }
|
||||
|
||||
inline uint32 RandRiftBoss() { return ((rand()%2) ? C_RKEEP : C_RLORD); }
|
||||
|
||||
float PortalLocation[4][4]=
|
||||
{
|
||||
|
||||
@@ -77,6 +77,7 @@ struct mob_ancient_wispAI : public ScriptedAI
|
||||
mob_ancient_wispAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
ArchimondeGUID = 0;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
@@ -85,9 +86,11 @@ struct mob_ancient_wispAI : public ScriptedAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ArchimondeGUID = 0;
|
||||
CheckTimer = 1000;
|
||||
|
||||
if (pInstance)
|
||||
ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
|
||||
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
@@ -97,25 +100,15 @@ struct mob_ancient_wispAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!ArchimondeGUID)
|
||||
{
|
||||
if (pInstance)
|
||||
ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
|
||||
}
|
||||
|
||||
if (CheckTimer < diff)
|
||||
{
|
||||
if (ArchimondeGUID)
|
||||
{
|
||||
Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID);
|
||||
if (Archimonde)
|
||||
if (Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID))
|
||||
{
|
||||
if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
|
||||
DoCast(m_creature, SPELL_DENOUEMENT_WISP);
|
||||
else
|
||||
DoCast(Archimonde, SPELL_ANCIENT_SPARK);
|
||||
}
|
||||
}
|
||||
CheckTimer = 1000;
|
||||
}else CheckTimer -= diff;
|
||||
}
|
||||
@@ -356,10 +349,15 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
if (summoned->GetEntry() == CREATURE_ANCIENT_WISP)
|
||||
summoned->AI()->AttackStart(m_creature);
|
||||
else
|
||||
{
|
||||
summoned->setFaction(m_creature->getFaction());
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT)
|
||||
{
|
||||
@@ -526,12 +524,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
|
||||
|
||||
if (SummonWispTimer < diff)
|
||||
{
|
||||
Creature* Wisp = DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
if (Wisp)
|
||||
{
|
||||
Wisp->AI()->AttackStart(m_creature);
|
||||
CAST_AI(mob_ancient_wispAI, Wisp->AI())->ArchimondeGUID = m_creature->GetGUID();
|
||||
}
|
||||
DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
|
||||
SummonWispTimer = 1500;
|
||||
++WispCount;
|
||||
}else SummonWispTimer -= diff;
|
||||
|
||||
@@ -606,7 +606,7 @@ uint32 hyjalAI::GetInstanceData(uint32 Event)
|
||||
void hyjalAI::Talk(uint32 id)
|
||||
{
|
||||
std::list<uint8> index;
|
||||
for(uint8 i = 0; i < 10; i++)
|
||||
for(uint8 i = 0; i < 9; ++i)
|
||||
{
|
||||
if(Faction == 0) // Alliance
|
||||
{
|
||||
|
||||
@@ -178,6 +178,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
|
||||
npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
HadMount = false;
|
||||
m_creature->setActive(true);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -221,6 +221,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
|
||||
RandChat_Timer = 90000;
|
||||
|
||||
Phase3 = false;
|
||||
NeedCheckCube = false;
|
||||
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
@@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
if (!player || player->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
switch (i)
|
||||
@@ -176,9 +176,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
|
||||
case 27:
|
||||
DoScriptText(SAY_ELF_COMPLETE, m_creature, player);
|
||||
// Award quest credit
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature);
|
||||
((Player*)player)->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,9 +318,9 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
targets.erase(targets.begin()+rand()%targets.size());
|
||||
|
||||
int i = 0;
|
||||
for(std::vector<Unit *>::iterator itr = targets.begin(); itr!= targets.end(); ++itr, ++i)
|
||||
for(std::vector<Unit *>::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i)
|
||||
{
|
||||
Unit *target = *itr;
|
||||
Unit *target = *iter;
|
||||
if(target)
|
||||
{
|
||||
enfeeble_targets[i] = target->GetGUID();
|
||||
|
||||
@@ -199,7 +199,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
|
||||
std::ostringstream saveStream;
|
||||
saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
|
||||
<< Encounters[3] << " " << Encounters[4] << " " << Encounters[5] << " " << Encounters[6] << " "
|
||||
<< Encounters[7] << " " << Encounters[8] << " " << Encounters[9] << " " << Encounters[10];
|
||||
<< Encounters[7] << " " << Encounters[8] << " " << Encounters[9] << " " << Encounters[10] << " " << Encounters[11];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
|
||||
@@ -128,16 +128,22 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
|
||||
Phase = 0;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KAELTHAS_EVENT, 0);
|
||||
{
|
||||
pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
|
||||
if (GameObject* Door = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_KAEL_DOOR)))
|
||||
Door->SetGoState(GO_STATE_ACTIVE); // 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
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (GameObject* EncounterDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_KAEL_DOOR)))
|
||||
EncounterDoor->SetGoState(GO_STATE_ACTIVE); // Open the encounter door
|
||||
}
|
||||
@@ -150,12 +156,12 @@ struct TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (GameObject* EncounterDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_KAEL_DOOR)))
|
||||
EncounterDoor->SetGoState(GO_STATE_READY); //Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
|
||||
@@ -46,19 +46,24 @@ static Speech PlayerDeath[]=
|
||||
{-1585021},
|
||||
};
|
||||
|
||||
#define SAY_AGGRO -1585012
|
||||
#define SAY_DEATH -1585022
|
||||
enum
|
||||
{
|
||||
SAY_AGGRO = -1585012,
|
||||
SAY_DEATH = -1585022,
|
||||
|
||||
#define SPELL_DISPEL_MAGIC 27609
|
||||
#define SPELL_FLASH_HEAL 17843
|
||||
#define SPELL_SW_PAIN_NORMAL 14032
|
||||
#define SPELL_SW_PAIN_HEROIC 15654
|
||||
#define SPELL_SHIELD 44291
|
||||
#define SPELL_RENEW_NORMAL 44174
|
||||
#define SPELL_RENEW_HEROIC 46192
|
||||
SPELL_DISPEL_MAGIC = 27609,
|
||||
SPELL_FLASH_HEAL = 17843,
|
||||
SPELL_SW_PAIN_NORMAL = 14032,
|
||||
SPELL_SW_PAIN_HEROIC = 15654,
|
||||
SPELL_SHIELD = 44291,
|
||||
SPELL_RENEW_NORMAL = 44174,
|
||||
SPELL_RENEW_HEROIC = 46192,
|
||||
|
||||
#define ORIENT 4.98
|
||||
#define POS_Z -19.9215
|
||||
MAX_ACTIVE_LACKEY = 4
|
||||
};
|
||||
|
||||
const float fOrientation = 4.98;
|
||||
const float fZLocation = -19.921;
|
||||
|
||||
float LackeyLocations[4][2]=
|
||||
{
|
||||
@@ -68,7 +73,7 @@ float LackeyLocations[4][2]=
|
||||
{129.988, 17.2355},
|
||||
};
|
||||
|
||||
const uint32 AddEntry[8]=
|
||||
const uint32 m_auiAddEntries[] =
|
||||
{
|
||||
24557, //Kagani Nightstrike
|
||||
24558, //Elris Duskhallow
|
||||
@@ -80,29 +85,21 @@ const uint32 AddEntry[8]=
|
||||
24556, //Zelfan
|
||||
};
|
||||
|
||||
struct Add
|
||||
{
|
||||
Add(uint32 _entry, uint64 _guid)
|
||||
{
|
||||
entry = _entry;
|
||||
guid = _guid;
|
||||
}
|
||||
|
||||
uint32 entry;
|
||||
uint64 guid;
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
{
|
||||
boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
Heroic = c->GetMap()->IsHeroic();
|
||||
memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID));
|
||||
LackeyEntryList.clear();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
bool Heroic;
|
||||
|
||||
std::vector<Add*> Adds;
|
||||
std::vector<uint32> LackeyEntryList;
|
||||
uint64 m_auiLackeyGUID[MAX_ACTIVE_LACKEY];
|
||||
|
||||
uint8 LackeysKilled;
|
||||
uint8 PlayersKilled;
|
||||
@@ -114,10 +111,6 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
uint32 DispelTimer;
|
||||
uint32 ResetTimer;
|
||||
|
||||
uint32 CombatPulseTimer; // Periodically puts all players in the instance in combat
|
||||
|
||||
bool Heroic;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
LackeysKilled = 0;
|
||||
@@ -130,10 +123,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
DispelTimer = 7500;
|
||||
ResetTimer = 5000;
|
||||
|
||||
CombatPulseTimer = 5000;
|
||||
|
||||
SummonAdds();
|
||||
CheckAdds();
|
||||
InitializeLackeys();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
@@ -146,54 +136,59 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
for(uint8 i = 0; i < Adds.size(); ++i)
|
||||
if(Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
|
||||
pAdd->AddThreat(who, 1.0f);
|
||||
for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i]))
|
||||
{
|
||||
if (!pAdd->getVictim())
|
||||
{
|
||||
who->SetInCombatWith(pAdd);
|
||||
pAdd->AddThreat(who, 0.0f);
|
||||
}
|
||||
|
||||
void SummonAdds()
|
||||
{
|
||||
if(!Adds.empty())
|
||||
return;
|
||||
|
||||
std::vector<uint32> AddList;
|
||||
for(uint8 i = 0; i < 8; ++i)
|
||||
AddList.push_back(AddEntry[i]);
|
||||
|
||||
while(AddList.size() > 4)
|
||||
AddList.erase(AddList.begin() + rand()%AddList.size());
|
||||
|
||||
for(uint8 i = 0; i < AddList.size(); ++i)
|
||||
{
|
||||
Creature* pAdd = m_creature->SummonCreature(AddList[i], LackeyLocations[i][0], LackeyLocations[i][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if (pAdd)
|
||||
{
|
||||
Add* nAdd = new Add(AddList[i], pAdd->GetGUID());
|
||||
Adds.push_back(nAdd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckAdds()
|
||||
void InitializeLackeys()
|
||||
{
|
||||
if (Adds.empty())
|
||||
return;
|
||||
uint8 j = 0;
|
||||
|
||||
uint32 n = 0;
|
||||
for(std::vector<Add*>::iterator i = Adds.begin(); i != Adds.end(); ++i, ++n)
|
||||
//it's empty, so first time
|
||||
if (LackeyEntryList.empty())
|
||||
{
|
||||
Creature* pAdd = (Unit::GetCreature(*m_creature, (*i)->guid));
|
||||
if(pAdd && pAdd->isAlive())
|
||||
//pre-allocate size for speed
|
||||
LackeyEntryList.resize((sizeof(m_auiAddEntries) / sizeof(uint32)));
|
||||
|
||||
//fill vector array with entries from creature array
|
||||
for(uint8 i = 0; i < LackeyEntryList.size(); ++i)
|
||||
LackeyEntryList[i] = m_auiAddEntries[i];
|
||||
|
||||
//remove random entries
|
||||
while(LackeyEntryList.size() > MAX_ACTIVE_LACKEY)
|
||||
LackeyEntryList.erase(LackeyEntryList.begin() + rand()%LackeyEntryList.size());
|
||||
|
||||
//summon all the remaining in vector
|
||||
for(std::vector<uint32>::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr)
|
||||
{
|
||||
pAdd->AI()->EnterEvadeMode(); // Force them out of combat and reset if they are in combat.
|
||||
if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
m_auiLackeyGUID[j] = pAdd->GetGUID();
|
||||
|
||||
++j;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pAdd = m_creature->SummonCreature((*i)->entry, LackeyLocations[n][0], LackeyLocations[n][1], POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if(pAdd)
|
||||
(*i)->guid = pAdd->GetGUID();
|
||||
else
|
||||
(*i)->guid = 0;
|
||||
for(std::vector<uint32>::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr)
|
||||
{
|
||||
Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[j]);
|
||||
|
||||
//object already removed, not exist
|
||||
if (!pAdd)
|
||||
{
|
||||
if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
m_auiLackeyGUID[j] = pAdd->GetGUID();
|
||||
}
|
||||
++j;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,10 +259,14 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
{
|
||||
uint32 health = m_creature->GetHealth();
|
||||
Unit* target = m_creature;
|
||||
for(uint8 i = 0; i < Adds.size(); ++i)
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, Adds[i]->guid))
|
||||
for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i]))
|
||||
{
|
||||
if (pAdd->isAlive() && pAdd->GetHealth() < health)
|
||||
target = pAdd;
|
||||
}
|
||||
}
|
||||
|
||||
DoCast(target, SPELL_FLASH_HEAL);
|
||||
HealTimer = 15000;
|
||||
@@ -276,13 +275,15 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
if (RenewTimer < diff)
|
||||
{
|
||||
Unit* target = m_creature;
|
||||
|
||||
if (rand()%2 == 1)
|
||||
{
|
||||
std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
|
||||
Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
|
||||
if (pAdd && pAdd->isAlive())
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
|
||||
{
|
||||
if (pAdd->isAlive())
|
||||
target = pAdd;
|
||||
}
|
||||
}
|
||||
DoCast(target,Heroic ? SPELL_RENEW_HEROIC : SPELL_RENEW_NORMAL);
|
||||
RenewTimer = 5000;
|
||||
}else RenewTimer -= diff;
|
||||
@@ -290,13 +291,16 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
if(ShieldTimer < diff)
|
||||
{
|
||||
Unit* target = m_creature;
|
||||
|
||||
if (rand()%2 == 1)
|
||||
{
|
||||
std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid))
|
||||
if (!pAdd->HasAura(SPELL_SHIELD) && pAdd->isAlive())
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
|
||||
{
|
||||
if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD))
|
||||
target = pAdd;
|
||||
}
|
||||
}
|
||||
|
||||
DoCast(target, SPELL_SHIELD);
|
||||
ShieldTimer = 7500;
|
||||
}else ShieldTimer -= diff;
|
||||
@@ -305,48 +309,39 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
|
||||
{
|
||||
Unit* target = NULL;
|
||||
bool friendly = false;
|
||||
|
||||
if (rand()%2 == 1)
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
else
|
||||
{
|
||||
friendly = true;
|
||||
|
||||
if (rand()%2 == 1)
|
||||
target = m_creature;
|
||||
else
|
||||
{
|
||||
std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
|
||||
Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
|
||||
if (pAdd && pAdd->isAlive())
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
|
||||
{
|
||||
if (pAdd->isAlive())
|
||||
target = pAdd;
|
||||
}
|
||||
}
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, SPELL_DISPEL_MAGIC);
|
||||
DispelTimer = 12000;
|
||||
}
|
||||
|
||||
if (target)
|
||||
DoCast(target, SPELL_DISPEL_MAGIC);
|
||||
|
||||
DispelTimer = 12000;
|
||||
}else DispelTimer -= diff;
|
||||
|
||||
if (SWPainTimer < diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL);
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL);
|
||||
|
||||
SWPainTimer = 10000;
|
||||
}else SWPainTimer -= diff;
|
||||
|
||||
/*
|
||||
if(CombatPulseTimer < diff)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
for(uint8 i = 0; i < Adds.size(); ++i)
|
||||
{
|
||||
if(Unit* pAdd = Unit::GetUnit(*m_creature, Add[i]->guid))
|
||||
if(pAdd->isAlive())
|
||||
DoZoneInCombat(pAdd);
|
||||
}
|
||||
|
||||
CombatPulseTimer = 10000;
|
||||
}else CombatPulseTimer -= diff;*/
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -357,15 +352,14 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
{
|
||||
boss_priestess_guestAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
Group.clear();
|
||||
pInstance = c->GetInstanceData();
|
||||
memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs));
|
||||
AcquireGUIDs();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
std::vector<Add*> Group;
|
||||
|
||||
uint64 m_auiLackeyGUIDs[MAX_ACTIVE_LACKEY];
|
||||
uint32 ResetThreatTimer;
|
||||
|
||||
bool UsedPotion;
|
||||
@@ -373,7 +367,6 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
void Reset()
|
||||
{
|
||||
UsedPotion = false;
|
||||
|
||||
ResetThreatTimer = 5000 + rand()%15000; // These guys like to switch targets often, and are not meant to be tanked.
|
||||
}
|
||||
|
||||
@@ -387,8 +380,7 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
if (Delrissa)
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))))
|
||||
{
|
||||
pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
|
||||
|
||||
@@ -407,8 +399,7 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
if (Delrissa)
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))))
|
||||
Delrissa->AI()->KilledUnit(victim);
|
||||
}
|
||||
|
||||
@@ -420,12 +411,10 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
if (Delrissa)
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))))
|
||||
{
|
||||
Group = CAST_AI(boss_priestess_delrissaAI, Delrissa->AI())->Adds;
|
||||
Add* dAdd = new Add(Delrissa->GetEntry(), Delrissa->GetGUID());
|
||||
Group.push_back(dAdd);
|
||||
for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
m_auiLackeyGUIDs[i] = ((boss_priestess_delrissaAI*)Delrissa->AI())->m_auiLackeyGUID[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,13 +475,18 @@ struct TRINITY_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_guestA
|
||||
|
||||
if (Vanish_Timer < diff)
|
||||
{
|
||||
m_creature->SetVisibility(VISIBILITY_OFF); // ...? Hacklike
|
||||
DoCast(m_creature, SPELL_VANISH);
|
||||
|
||||
Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
DoResetThreat();
|
||||
|
||||
if (pUnit)
|
||||
m_creature->AddThreat(pUnit, 1000.0f);
|
||||
|
||||
InVanish = true;
|
||||
Vanish_Timer = 30000;
|
||||
Wait_Timer = 10000;
|
||||
DoResetThreat();
|
||||
m_creature->AddThreat(SelectUnit(SELECT_TARGET_RANDOM, 0), 1000.0f);
|
||||
}else Vanish_Timer -= diff;
|
||||
|
||||
if (InVanish)
|
||||
@@ -626,19 +620,25 @@ struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI
|
||||
|
||||
if (Seed_of_Corruption_Timer < diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SEED_OF_CORRUPTION);
|
||||
if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_SEED_OF_CORRUPTION);
|
||||
|
||||
Seed_of_Corruption_Timer = 10000;
|
||||
}else Seed_of_Corruption_Timer -= diff;
|
||||
|
||||
if (Curse_of_Agony_Timer < diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_CURSE_OF_AGONY);
|
||||
if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_CURSE_OF_AGONY);
|
||||
|
||||
Curse_of_Agony_Timer = 13000;
|
||||
}else Curse_of_Agony_Timer -= diff;
|
||||
|
||||
if (Fear_Timer < diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FEAR);
|
||||
if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_FEAR);
|
||||
|
||||
Fear_Timer = 10000;
|
||||
}else Fear_Timer -= diff;
|
||||
|
||||
@@ -764,7 +764,9 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI
|
||||
|
||||
if (Blizzard_Timer < diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLIZZARD);
|
||||
if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_BLIZZARD);
|
||||
|
||||
Blizzard_Timer = 8000;
|
||||
}else Blizzard_Timer -= diff;
|
||||
|
||||
@@ -878,7 +880,10 @@ struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI
|
||||
|
||||
//if nobody is in melee range than try to use Intercept
|
||||
if (!InMeleeRange)
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_INTERCEPT_STUN);
|
||||
{
|
||||
if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_INTERCEPT_STUN);
|
||||
}
|
||||
|
||||
Intercept_Stun_Timer = 10000;
|
||||
}else Intercept_Stun_Timer -= diff;
|
||||
@@ -925,7 +930,7 @@ struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI
|
||||
#define SPELL_WING_CLIP 44286
|
||||
#define SPELL_FREEZING_TRAP 44136
|
||||
|
||||
#define CREATURE_SLIVER 24552
|
||||
#define NPC_SLIVER 24552
|
||||
|
||||
/*struct TRINITY_DLL_DECL mob_sliverAI : public ScriptedAI
|
||||
{
|
||||
@@ -945,10 +950,9 @@ struct TRINITY_DLL_DECL boss_warlord_salarisAI : public boss_priestess_guestAI
|
||||
struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
|
||||
{
|
||||
//Hunter
|
||||
boss_garaxxasAI(Creature *c) : boss_priestess_guestAI(c) {}
|
||||
boss_garaxxasAI(Creature *c) : boss_priestess_guestAI(c) { m_uiPetGUID = 0; }
|
||||
|
||||
//uint64 SliverGUID;
|
||||
bool HasSummonedSliver;
|
||||
uint64 m_uiPetGUID;
|
||||
|
||||
uint32 Aimed_Shot_Timer;
|
||||
uint32 Shoot_Timer;
|
||||
@@ -959,9 +963,6 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
//SliverGUID = 0;
|
||||
HasSummonedSliver = false;
|
||||
|
||||
Aimed_Shot_Timer = 6000;
|
||||
Shoot_Timer = 2500;
|
||||
Concussive_Shot_Timer = 8000;
|
||||
@@ -969,9 +970,18 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
|
||||
Wing_Clip_Timer = 4000;
|
||||
Freezing_Trap_Timer = 15000;
|
||||
|
||||
Unit* pPet = Unit::GetUnit(*m_creature,m_uiPetGUID);
|
||||
if (!pPet)
|
||||
m_creature->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
|
||||
boss_priestess_guestAI::Reset();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
m_uiPetGUID = pSummoned->GetGUID();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
boss_priestess_guestAI::JustDied(killer);
|
||||
@@ -979,17 +989,6 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!HasSummonedSliver)
|
||||
{
|
||||
Creature* Sliver = m_creature->SummonCreature(CREATURE_SLIVER, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (Sliver)
|
||||
{
|
||||
//CAST_AI(mob_sliverAI, Sliver->AI())->GaraxxasGUID = m_creature->GetGUID();
|
||||
//SliverGUID = Sliver->GetGUID();
|
||||
HasSummonedSliver = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
@@ -1111,7 +1110,9 @@ struct TRINITY_DLL_DECL boss_apokoAI : public boss_priestess_guestAI
|
||||
|
||||
if (Purge_Timer < diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_PURGE);
|
||||
if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, SPELL_PURGE);
|
||||
|
||||
Purge_Timer = 15000;
|
||||
}else Purge_Timer -= diff;
|
||||
|
||||
@@ -1198,9 +1199,9 @@ struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI
|
||||
|
||||
if (Recombobulate_Timer < diff)
|
||||
{
|
||||
for(uint8 i = 0; i < Group.size(); ++i)
|
||||
for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, Group[i]->guid))
|
||||
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUIDs[i]))
|
||||
{
|
||||
if (pAdd->IsPolymorphed())
|
||||
{
|
||||
@@ -1209,6 +1210,7 @@ struct TRINITY_DLL_DECL boss_zelfanAI : public boss_priestess_guestAI
|
||||
}
|
||||
}
|
||||
}
|
||||
Recombobulate_Timer = 2000;
|
||||
}else Recombobulate_Timer -= diff;
|
||||
|
||||
if (High_Explosive_Sheep_Timer < diff)
|
||||
|
||||
@@ -212,23 +212,17 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
|
||||
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
|
||||
if (!HasSubmergedOnce)
|
||||
{
|
||||
DoScriptText(SAY_REINFORCEMENTS1, m_creature);
|
||||
|
||||
// summon 10 elementals
|
||||
Unit* target = NULL;
|
||||
for(int i = 0; i < 9;i++)
|
||||
for(int i = 0; i < 9; ++i)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if(target)
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
{
|
||||
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
|
||||
if(Summoned)
|
||||
(Summoned->AI())->AttackStart(target);
|
||||
if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,19 +231,17 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
|
||||
DoCast(m_creature,SPELL_RAGSUBMERGE);
|
||||
Attack_Timer = 90000;
|
||||
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
DoScriptText(SAY_REINFORCEMENTS2, m_creature);
|
||||
|
||||
Unit* target = NULL;
|
||||
for(int i = 0; i < 9;i++)
|
||||
for(int i = 0; i < 9; ++i)
|
||||
{
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if(target)
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
|
||||
{
|
||||
Summoned = m_creature->SummonCreature(12143,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000);
|
||||
if(Summoned)
|
||||
(Summoned->AI())->AttackStart(target);
|
||||
if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,7 +262,8 @@ struct TRINITY_DLL_DECL boss_ragnarosAI : public Scripted_NoMovementAI
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||
m_creature->resetAttackTimer();
|
||||
}
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
//MagmaBurst_Timer
|
||||
if (MagmaBurst_Timer < diff)
|
||||
|
||||
@@ -49,7 +49,7 @@ CreatureAI* GetAI_mob_ancient_core_hound(Creature *_Creature)
|
||||
ai->Spell[0].First_Cast = 10000;
|
||||
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
uint32 RandDebuff;
|
||||
uint32 RandDebuff = 0;
|
||||
switch(rand()%6)
|
||||
{
|
||||
case 0 : RandDebuff = SPELL_GROUND_STOMP; break;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
struct TRINITY_DLL_DECL boss_anubrekhanAI : public BossAI
|
||||
{
|
||||
boss_anubrekhanAI(Creature *c) : BossAI(c, BOSS_ANUBREKHAN) {}
|
||||
boss_anubrekhanAI(Creature *c) : BossAI(c, BOSS_ANUBREKHAN) { HasTaunted = false; }
|
||||
|
||||
bool HasTaunted;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ bool GossipHello_npc_archmage_malin(Player *player, Creature *_Creature)
|
||||
|
||||
bool GossipSelect_npc_archmage_malin(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
if(action = GOSSIP_ACTION_INFO_DEF)
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
_Creature->CastSpell(player, 42711, true);
|
||||
|
||||
@@ -76,11 +76,11 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
for(uint8 i = 0; i < ENCOUNTERS; ++i)
|
||||
Encounter[i] = NOT_STARTED;
|
||||
|
||||
for(uint8 i = 0; i < 5; i++)
|
||||
IsSilverHandDead[5] = false;
|
||||
for(uint8 i = 0; i < 5; ++i)
|
||||
IsSilverHandDead[i] = false;
|
||||
|
||||
BaronRun_Timer = 0;
|
||||
SlaugtherSquare_Timer = 0;
|
||||
|
||||
@@ -189,7 +189,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
|
||||
|
||||
float Portal_Y(float x, float radius)
|
||||
{
|
||||
float z;
|
||||
float z = 0.0f;
|
||||
|
||||
switch(rand()%2)
|
||||
{
|
||||
|
||||
@@ -913,8 +913,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
|
||||
{
|
||||
eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (p)
|
||||
if (Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
Portal = p->GetGUID();
|
||||
}
|
||||
|
||||
@@ -924,8 +923,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
|
||||
|
||||
void JustDied(Unit* who)
|
||||
{
|
||||
Unit* p = Unit::GetUnit(*m_creature, Portal);
|
||||
if (p)
|
||||
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
|
||||
p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
}
|
||||
|
||||
@@ -960,8 +958,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
|
||||
//MindflayTimer
|
||||
if (MindflayTimer < diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
|
||||
DoCast(target,SPELL_MIND_FLAY);
|
||||
|
||||
@@ -975,8 +972,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
|
||||
{
|
||||
claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (p)
|
||||
if (Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
Portal = p->GetGUID();
|
||||
}
|
||||
|
||||
@@ -987,8 +983,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
|
||||
|
||||
void JustDied(Unit* who)
|
||||
{
|
||||
Unit* p = Unit::GetUnit(*m_creature, Portal);
|
||||
if (p)
|
||||
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
|
||||
p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
}
|
||||
|
||||
@@ -1015,15 +1010,13 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
|
||||
if (!m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
if (EvadeTimer < diff)
|
||||
{
|
||||
Unit* p = Unit::GetUnit(*m_creature, Portal);
|
||||
if (p)
|
||||
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
|
||||
p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
|
||||
//Dissapear and reappear at new position
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (!target)
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
@@ -1033,8 +1026,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
|
||||
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
|
||||
{
|
||||
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
|
||||
Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (p)
|
||||
if (Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
Portal = p->GetGUID();
|
||||
|
||||
GroundRuptureTimer = 500;
|
||||
@@ -1069,8 +1061,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
|
||||
{
|
||||
giant_claw_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (p)
|
||||
if (Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
Portal = p->GetGUID();
|
||||
}
|
||||
|
||||
@@ -1082,8 +1073,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
|
||||
|
||||
void JustDied(Unit* who)
|
||||
{
|
||||
Unit* p = Unit::GetUnit(*m_creature, Portal);
|
||||
if (p)
|
||||
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
|
||||
p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
}
|
||||
|
||||
@@ -1111,15 +1101,13 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
|
||||
if (!m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
if (EvadeTimer < diff)
|
||||
{
|
||||
Unit* p = Unit::GetUnit(*m_creature, Portal);
|
||||
if (p)
|
||||
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
|
||||
p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
|
||||
//Dissapear and reappear at new position
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (!target)
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
@@ -1129,8 +1117,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
|
||||
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
|
||||
{
|
||||
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
|
||||
Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (p)
|
||||
if (Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
Portal = p->GetGUID();
|
||||
|
||||
GroundRuptureTimer = 500;
|
||||
@@ -1173,8 +1160,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
|
||||
{
|
||||
giant_eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (p)
|
||||
if (Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
Portal = p->GetGUID();
|
||||
}
|
||||
|
||||
@@ -1183,8 +1169,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
|
||||
|
||||
void JustDied(Unit* who)
|
||||
{
|
||||
Unit* p = Unit::GetUnit(*m_creature, Portal);
|
||||
if (p)
|
||||
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
|
||||
p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false);
|
||||
}
|
||||
|
||||
@@ -1208,8 +1193,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
|
||||
//BeamTimer
|
||||
if (BeamTimer < diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
|
||||
DoCast(target,SPELL_GREEN_BEAM);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user