mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Script: Clean-Up in Scripts.
InstanceScript* Instance -> InstanceScript* instance Signed-off-by: Gyx <2359980687@qq.com>
This commit is contained in:
@@ -1204,7 +1204,7 @@ class npc_crok_scourgebane : public CreatureScript
|
||||
struct npc_argent_captainAI : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_argent_captainAI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()), _firstDeath(true)
|
||||
npc_argent_captainAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), _firstDeath(true)
|
||||
{
|
||||
FollowAngle = PET_FOLLOW_ANGLE;
|
||||
FollowDist = PET_FOLLOW_DIST;
|
||||
@@ -1232,7 +1232,7 @@ struct npc_argent_captainAI : public ScriptedAI
|
||||
{
|
||||
if (action == ACTION_START_GAUNTLET)
|
||||
{
|
||||
if (Creature* crok = ObjectAccessor::GetCreature(*me, Instance->GetData64(DATA_CROK_SCOURGEBANE)))
|
||||
if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_CROK_SCOURGEBANE)))
|
||||
{
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
FollowAngle = me->GetAngle(crok) + me->GetOrientation();
|
||||
@@ -1276,7 +1276,7 @@ struct npc_argent_captainAI : public ScriptedAI
|
||||
if (!me->GetVehicle())
|
||||
{
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
if (Creature* crok = ObjectAccessor::GetCreature(*me, Instance->GetData64(DATA_CROK_SCOURGEBANE)))
|
||||
if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_CROK_SCOURGEBANE)))
|
||||
me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_IDLE);
|
||||
}
|
||||
|
||||
@@ -1309,14 +1309,14 @@ struct npc_argent_captainAI : public ScriptedAI
|
||||
}
|
||||
|
||||
Talk(SAY_CAPTAIN_RESURRECTED);
|
||||
me->UpdateEntry(newEntry, Instance->GetData(DATA_TEAM_IN_INSTANCE), me->GetCreatureData());
|
||||
me->UpdateEntry(newEntry, instance->GetData(DATA_TEAM_IN_INSTANCE), me->GetCreatureData());
|
||||
DoCast(me, SPELL_UNDEATH, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
EventMap Events;
|
||||
InstanceScript* Instance;
|
||||
InstanceScript* instance;
|
||||
float FollowAngle;
|
||||
float FollowDist;
|
||||
bool IsUndead;
|
||||
|
||||
@@ -145,13 +145,13 @@ public:
|
||||
{
|
||||
boss_lady_vashjAI (Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Instance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
Intro = false;
|
||||
JustCreated = true;
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped)
|
||||
}
|
||||
|
||||
InstanceScript* Instance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 ShieldGeneratorChannel[4];
|
||||
|
||||
@@ -204,8 +204,8 @@ public:
|
||||
if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]))
|
||||
remo->setDeathState(JUST_DIED);
|
||||
|
||||
if (Instance)
|
||||
Instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
|
||||
ShieldGeneratorChannel[0] = 0;
|
||||
ShieldGeneratorChannel[1] = 0;
|
||||
ShieldGeneratorChannel[2] = 0;
|
||||
@@ -230,8 +230,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (Instance)
|
||||
Instance->SetData(DATA_LADYVASHJEVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_LADYVASHJEVENT, DONE);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
@@ -240,13 +240,13 @@ public:
|
||||
|
||||
Phase = 1;
|
||||
|
||||
if (Instance)
|
||||
Instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (Instance)
|
||||
if (instance)
|
||||
{
|
||||
// remove old tainted cores to prevent cheating in phase 2
|
||||
Map* map = me->GetMap();
|
||||
@@ -517,7 +517,7 @@ public:
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
// Start Phase 3
|
||||
if (Instance && Instance->GetData(DATA_CANSTARTPHASE3))
|
||||
if (instance && instance->GetData(DATA_CANSTARTPHASE3))
|
||||
{
|
||||
// set life 50%
|
||||
me->SetHealth(me->CountPctFromMaxHealth(50));
|
||||
@@ -555,10 +555,10 @@ public:
|
||||
{
|
||||
mob_enchanted_elementalAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Instance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* Instance;
|
||||
InstanceScript* instance;
|
||||
uint32 Move;
|
||||
uint32 Phase;
|
||||
float X, Y, Z;
|
||||
@@ -589,8 +589,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (Instance)
|
||||
VashjGUID = Instance->GetData64(DATA_LADYVASHJ);
|
||||
if (instance)
|
||||
VashjGUID = instance->GetData64(DATA_LADYVASHJ);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
@@ -599,7 +599,7 @@ public:
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!Instance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (!VashjGUID)
|
||||
@@ -649,10 +649,10 @@ public:
|
||||
{
|
||||
mob_tainted_elementalAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Instance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* Instance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 PoisonBoltTimer;
|
||||
uint32 DespawnTimer;
|
||||
@@ -665,8 +665,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Instance)
|
||||
if (Creature* vashj = Unit::GetCreature((*me), Instance->GetData64(DATA_LADYVASHJ)))
|
||||
if (instance)
|
||||
if (Creature* vashj = Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ)))
|
||||
CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath();
|
||||
}
|
||||
|
||||
@@ -718,11 +718,11 @@ public:
|
||||
{
|
||||
mob_toxic_sporebatAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Instance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
InstanceScript* Instance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 MovementTimer;
|
||||
uint32 ToxicSporeTimer;
|
||||
@@ -780,10 +780,10 @@ public:
|
||||
// CheckTimer
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
if (Instance)
|
||||
if (instance)
|
||||
{
|
||||
// check if vashj is death
|
||||
Unit* Vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ));
|
||||
Unit* Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ));
|
||||
if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3))
|
||||
{
|
||||
// remove
|
||||
@@ -814,10 +814,10 @@ public:
|
||||
{
|
||||
mob_shield_generator_channelAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Instance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* Instance;
|
||||
InstanceScript* instance;
|
||||
uint32 CheckTimer;
|
||||
bool Casted;
|
||||
|
||||
@@ -834,12 +834,12 @@ public:
|
||||
|
||||
void UpdateAI (const uint32 diff)
|
||||
{
|
||||
if (!Instance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
Unit* vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ));
|
||||
Unit* vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ));
|
||||
|
||||
if (vashj && vashj->isAlive())
|
||||
{
|
||||
|
||||
@@ -80,10 +80,10 @@ public:
|
||||
{
|
||||
boss_the_lurker_belowAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me)
|
||||
{
|
||||
Instance = creature->GetInstanceScript();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* Instance;
|
||||
InstanceScript* instance;
|
||||
SummonList Summons;
|
||||
|
||||
bool Spawned;
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
|
||||
bool CheckCanStart()//check if players fished
|
||||
{
|
||||
if (Instance && Instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
|
||||
if (instance && instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -128,10 +128,10 @@ public:
|
||||
|
||||
Summons.DespawnAll();
|
||||
|
||||
if (Instance)
|
||||
if (instance)
|
||||
{
|
||||
Instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
|
||||
Instance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
|
||||
instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
|
||||
}
|
||||
DoCast(me, SPELL_SUBMERGE); // submerge anim
|
||||
me->SetVisible(false); // we start invis under water, submerged
|
||||
@@ -141,10 +141,10 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Instance)
|
||||
if (instance)
|
||||
{
|
||||
Instance->SetData(DATA_THELURKERBELOWEVENT, DONE);
|
||||
Instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS);
|
||||
instance->SetData(DATA_THELURKERBELOWEVENT, DONE);
|
||||
instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS);
|
||||
}
|
||||
|
||||
Summons.DespawnAll();
|
||||
@@ -152,8 +152,8 @@ public:
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (Instance)
|
||||
Instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
|
||||
Scripted_NoMovementAI::EnterCombat(who);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user