*fix Jaina stucking bug after evade
*small fixes to retreat events (spell visuals) --HG-- branch : trunk
This commit is contained in:
@@ -66,6 +66,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
|
|||||||
void SetCanMelee(bool usemelee) { CanMelee = usemelee; }
|
void SetCanMelee(bool usemelee) { CanMelee = usemelee; }
|
||||||
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
|
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
|
||||||
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
|
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
|
||||||
|
bool GetAttack() { return Attack; }//used in EnterEvadeMode override
|
||||||
|
|
||||||
// EscortAI variables
|
// EscortAI variables
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -299,6 +299,8 @@ hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature)
|
|||||||
RespawnTimer = 10000;
|
RespawnTimer = 10000;
|
||||||
DoRespawn = false;
|
DoRespawn = false;
|
||||||
DoHide = false;
|
DoHide = false;
|
||||||
|
MassTeleportTimer = 0;
|
||||||
|
DoMassTeleport = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hyjalAI::JustSummoned(Creature *summoned)
|
void hyjalAI::JustSummoned(Creature *summoned)
|
||||||
@@ -388,6 +390,7 @@ void hyjalAI::Reset()
|
|||||||
void hyjalAI::EnterEvadeMode()
|
void hyjalAI::EnterEvadeMode()
|
||||||
{
|
{
|
||||||
m_creature->InterruptNonMeleeSpells(true);
|
m_creature->InterruptNonMeleeSpells(true);
|
||||||
|
if(m_creature->GetEntry() != JAINA)
|
||||||
m_creature->RemoveAllAuras();
|
m_creature->RemoveAllAuras();
|
||||||
m_creature->DeleteThreatList();
|
m_creature->DeleteThreatList();
|
||||||
m_creature->CombatStop();
|
m_creature->CombatStop();
|
||||||
@@ -403,6 +406,7 @@ void hyjalAI::EnterEvadeMode()
|
|||||||
|
|
||||||
void hyjalAI::Aggro(Unit *who)
|
void hyjalAI::Aggro(Unit *who)
|
||||||
{
|
{
|
||||||
|
if(IsDummy)return;
|
||||||
for(uint8 i = 0; i < 2; ++i)
|
for(uint8 i = 0; i < 2; ++i)
|
||||||
if(Spell[i].Cooldown)
|
if(Spell[i].Cooldown)
|
||||||
SpellTimer[i] = Spell[i].Cooldown;
|
SpellTimer[i] = Spell[i].Cooldown;
|
||||||
@@ -410,6 +414,18 @@ void hyjalAI::Aggro(Unit *who)
|
|||||||
Talk(ATTACKED);
|
Talk(ATTACKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void hyjalAI::MoveInLineOfSight(Unit *who)
|
||||||
|
{
|
||||||
|
if(IsDummy)return;
|
||||||
|
if (IsBeingEscorted && !GetAttack())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(m_creature->getVictim() || !m_creature->canStartAttack(who))
|
||||||
|
return;
|
||||||
|
|
||||||
|
AttackStart(who);
|
||||||
|
}
|
||||||
|
|
||||||
void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
|
||||||
{
|
{
|
||||||
uint32 random = rand()%4;
|
uint32 random = rand()%4;
|
||||||
@@ -682,7 +698,9 @@ void hyjalAI::Retreat()
|
|||||||
{
|
{
|
||||||
JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||||
((hyjalAI*)JainaDummy->AI())->IsDummy = true;
|
((hyjalAI*)JainaDummy->AI())->IsDummy = true;
|
||||||
JainaDummy->CastSpell(JainaDummy, SPELL_TELEPORT_VISUAL, true);
|
DummyGuid = JainaDummy->GetGUID();
|
||||||
|
//((hyjalAI*)JainaDummy->AI())->MassTeleportTimer = 20000;
|
||||||
|
//((hyjalAI*)JainaDummy->AI())->DoMassTeleport = true;
|
||||||
}
|
}
|
||||||
AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]);
|
AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]);
|
||||||
Start(false, false, false);
|
Start(false, false, false);
|
||||||
@@ -754,6 +772,11 @@ void hyjalAI::UpdateAI(const uint32 diff)
|
|||||||
{
|
{
|
||||||
if(IsDummy)
|
if(IsDummy)
|
||||||
{
|
{
|
||||||
|
if(MassTeleportTimer < diff && DoMassTeleport)
|
||||||
|
{
|
||||||
|
m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false);
|
||||||
|
DoMassTeleport = false;
|
||||||
|
}else MassTeleportTimer -= diff;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(DoHide)
|
if(DoHide)
|
||||||
@@ -780,6 +803,9 @@ void hyjalAI::UpdateAI(const uint32 diff)
|
|||||||
HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
|
HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
|
||||||
HideNearPos(5563, -2763.19);
|
HideNearPos(5563, -2763.19);
|
||||||
HideNearPos(5542.2, -2629.36);
|
HideNearPos(5542.2, -2629.36);
|
||||||
|
for(uint8 i = 0; i < 65; i++)//summon fires
|
||||||
|
m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
|
||||||
|
|
||||||
}
|
}
|
||||||
else m_creature->SetVisibility(VISIBILITY_ON);
|
else m_creature->SetVisibility(VISIBILITY_ON);
|
||||||
break;
|
break;
|
||||||
@@ -808,15 +834,16 @@ void hyjalAI::UpdateAI(const uint32 diff)
|
|||||||
}
|
}
|
||||||
if(Overrun)
|
if(Overrun)
|
||||||
DoOverrun(Faction, diff);
|
DoOverrun(Faction, diff);
|
||||||
if(m_creature->GetEntry() == 17772)
|
/* if(m_creature->GetEntry() == 17772)
|
||||||
{
|
{
|
||||||
if(!m_creature->HasAura(SPELL_BRILLIANCE_AURA,0))
|
if(!m_creature->HasAura(SPELL_BRILLIANCE_AURA,0))
|
||||||
DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
|
DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
|
||||||
}
|
}*/
|
||||||
if(bRetreat)
|
if(bRetreat)
|
||||||
{
|
{
|
||||||
if(RetreatTimer < diff)
|
if(RetreatTimer < diff)
|
||||||
{
|
{
|
||||||
|
IsDummy = true;
|
||||||
bRetreat = false;
|
bRetreat = false;
|
||||||
HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
|
HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
|
||||||
switch(m_creature->GetEntry())
|
switch(m_creature->GetEntry())
|
||||||
@@ -995,7 +1022,19 @@ void hyjalAI::WaypointReached(uint32 i)
|
|||||||
{
|
{
|
||||||
m_creature->Yell("Hurry, we don't have much time",0,0);
|
m_creature->Yell("Hurry, we don't have much time",0,0);
|
||||||
WaitForTeleport = true;
|
WaitForTeleport = true;
|
||||||
TeleportTimer = 15000;
|
TeleportTimer = 20000;
|
||||||
|
if(m_creature->GetEntry() == JAINA)
|
||||||
|
m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false);
|
||||||
|
if(m_creature->GetEntry() == THRALL && DummyGuid)
|
||||||
|
{
|
||||||
|
Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid);
|
||||||
|
if(Dummy)
|
||||||
|
{
|
||||||
|
((hyjalAI*)((Creature*)Dummy)->AI())->DoMassTeleport = true;
|
||||||
|
((hyjalAI*)((Creature*)Dummy)->AI())->MassTeleportTimer = 20000;
|
||||||
|
Dummy->CastSpell(m_creature,SPELL_MASS_TELEPORT,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
//do some talking
|
//do some talking
|
||||||
//all alive guards walk near here
|
//all alive guards walk near here
|
||||||
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
|
||||||
@@ -1064,6 +1103,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
|||||||
{
|
{
|
||||||
(*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
|
(*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
|
||||||
(*itr)->setFaction(35);//make them friendly so mobs won't attack them
|
(*itr)->setFaction(35);//make them friendly so mobs won't attack them
|
||||||
|
(*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DoCast(m_creature, SPELL_TELEPORT_VISUAL);
|
DoCast(m_creature, SPELL_TELEPORT_VISUAL);
|
||||||
@@ -1122,6 +1162,9 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1://horde
|
case 1://horde
|
||||||
|
for(uint8 i = 0; i < 65; i++)//summon fires
|
||||||
|
m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,9 +38,10 @@
|
|||||||
#define ARCHIMONDE 17968
|
#define ARCHIMONDE 17968
|
||||||
|
|
||||||
#define SPELL_TELEPORT_VISUAL 41232
|
#define SPELL_TELEPORT_VISUAL 41232
|
||||||
|
#define SPELL_MASS_TELEPORT 16807
|
||||||
|
|
||||||
//Spells for Jaina
|
//Spells for Jaina
|
||||||
#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon
|
#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon(it should, but is removed in evade..)
|
||||||
#define SPELL_BLIZZARD 31266
|
#define SPELL_BLIZZARD 31266
|
||||||
#define SPELL_PYROBLAST 31263
|
#define SPELL_PYROBLAST 31263
|
||||||
#define SPELL_SUMMON_ELEMENTALS 31264
|
#define SPELL_SUMMON_ELEMENTALS 31264
|
||||||
@@ -185,6 +186,7 @@ struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI
|
|||||||
void RespawnNearPos(float x, float y);
|
void RespawnNearPos(float x, float y);
|
||||||
void WaypointReached(uint32 i);
|
void WaypointReached(uint32 i);
|
||||||
void DoOverrun(uint32 faction, const uint32 diff);
|
void DoOverrun(uint32 faction, const uint32 diff);
|
||||||
|
void MoveInLineOfSight(Unit *who);
|
||||||
|
|
||||||
void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
|
void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base
|
||||||
|
|
||||||
@@ -232,6 +234,9 @@ struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI
|
|||||||
bool DoRespawn;
|
bool DoRespawn;
|
||||||
bool DoHide;
|
bool DoHide;
|
||||||
bool IsDummy;
|
bool IsDummy;
|
||||||
|
uint32 MassTeleportTimer;
|
||||||
|
bool DoMassTeleport;
|
||||||
|
uint64 DummyGuid;
|
||||||
|
|
||||||
struct Spell
|
struct Spell
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user