Core/Scripts: Removed CAST_CRE define
This commit is contained in:
1 parent
355029fb4f
commit
156fb824a4
16 files changed
+65
-59
No files matched your search
@@ -2264,7 +2264,7 @@ public:
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
GETUNIT(Illidan, IllidanGUID);
|
||||
if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode())
|
||||
if (!Illidan || Illidan->ToCreature()->IsInEvadeMode())
|
||||
{
|
||||
me->SetVisible(false);
|
||||
me->setDeathState(JUST_DIED);
|
||||
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
{
|
||||
Unit* member = Unit::GetUnit(*me, Council[i]);
|
||||
if (member && member->isAlive())
|
||||
CAST_CRE(member)->AI()->AttackStart(target);
|
||||
member->ToCreature()->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
-15
@@ -542,27 +542,31 @@ public:
|
||||
if (Spitfire_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_SPITFIRE_TOTEM);
|
||||
Unit* SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM);
|
||||
if (SpitfireTotem)
|
||||
{
|
||||
CAST_CRE(SpitfireTotem)->AI()->AttackStart(me->getVictim());
|
||||
}
|
||||
if (Unit* SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM))
|
||||
SpitfireTotem->ToCreature()->AI()->AttackStart(me->getVictim());
|
||||
|
||||
Spitfire_Timer = 60000;
|
||||
} else Spitfire_Timer -= diff;
|
||||
}
|
||||
else
|
||||
Spitfire_Timer -= diff;
|
||||
|
||||
//PoisonCleansing_Timer
|
||||
if (PoisonCleansing_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_POISON_CLEANSING_TOTEM);
|
||||
PoisonCleansing_Timer = 30000;
|
||||
} else PoisonCleansing_Timer -= diff;
|
||||
}
|
||||
else
|
||||
PoisonCleansing_Timer -= diff;
|
||||
|
||||
//Earthbind_Timer
|
||||
if (Earthbind_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_EARTHBIND_TOTEM);
|
||||
Earthbind_Timer = 45000;
|
||||
} else Earthbind_Timer -= diff;
|
||||
}
|
||||
else
|
||||
Earthbind_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -665,17 +669,19 @@ public:
|
||||
{
|
||||
//DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work
|
||||
Cyclone_Timer = 30000+rand()%10000;
|
||||
Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000);
|
||||
if (Cyclone)
|
||||
|
||||
if (Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000))
|
||||
{
|
||||
CAST_CRE(Cyclone)->SetObjectScale(3.0f);
|
||||
Cyclone->ToCreature()->SetObjectScale(3.0f);
|
||||
Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Cyclone->setFaction(me->getFaction());
|
||||
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
Cyclone->AI()->AttackStart(target);
|
||||
}
|
||||
} else Cyclone_Timer -= diff;
|
||||
}
|
||||
else
|
||||
Cyclone_Timer -= diff;
|
||||
|
||||
//Heal_Timer
|
||||
if (Heal_Timer <= diff)
|
||||
@@ -684,14 +690,14 @@ public:
|
||||
Unit* unit = NULL;
|
||||
|
||||
while (unit == NULL || !unit->isAlive())
|
||||
{
|
||||
unit = selectAdvisorUnit();
|
||||
}
|
||||
|
||||
if (unit && unit->isAlive())
|
||||
DoCast(unit, SPELL_HEAL);
|
||||
Heal_Timer = 60000;
|
||||
} else Heal_Timer -= diff;
|
||||
}
|
||||
else
|
||||
Heal_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -786,7 +786,7 @@ public:
|
||||
{
|
||||
// check if vashj is death
|
||||
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))
|
||||
if (!Vashj || !Vashj->isAlive() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3)
|
||||
{
|
||||
// remove
|
||||
me->setDeathState(DEAD);
|
||||
@@ -796,7 +796,9 @@ public:
|
||||
}
|
||||
|
||||
CheckTimer = 1000;
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
else
|
||||
CheckTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ class boss_warbringer_omrogg : public CreatureScript
|
||||
|
||||
pLeftHead->AI()->Talk(YELL_DIE_L);
|
||||
|
||||
CAST_AI(mob_omrogg_heads::mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell();
|
||||
CAST_AI(mob_omrogg_heads::mob_omrogg_headsAI, pRightHead->ToCreature()->AI())->DoDeathYell();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_OMROGG, DONE);
|
||||
|
||||
+4
-4
@@ -167,9 +167,9 @@ class boss_warchief_kargath_bladefist : public CreatureScript
|
||||
Unit* temp = Unit::GetUnit(*me, *itr);
|
||||
if (temp && temp->isAlive())
|
||||
{
|
||||
(*temp).GetMotionMaster()->Clear(true);
|
||||
temp->GetMotionMaster()->Clear(true);
|
||||
me->DealDamage(temp, temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
CAST_CRE(temp)->RemoveCorpse();
|
||||
temp->ToCreature()->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
adds.clear();
|
||||
@@ -179,9 +179,9 @@ class boss_warchief_kargath_bladefist : public CreatureScript
|
||||
Unit* temp = Unit::GetUnit(*me, *itr);
|
||||
if (temp && temp->isAlive())
|
||||
{
|
||||
(*temp).GetMotionMaster()->Clear(true);
|
||||
temp->GetMotionMaster()->Clear(true);
|
||||
me->DealDamage(temp, temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
CAST_CRE(temp)->RemoveCorpse();
|
||||
temp->ToCreature()->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
assassins.clear();
|
||||
|
||||
@@ -474,17 +474,16 @@ public:
|
||||
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->setFaction(1194);
|
||||
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
|
||||
if (Creepjack)
|
||||
if (Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20))
|
||||
{
|
||||
CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
|
||||
Creepjack->ToCreature()->AI()->EnterEvadeMode();
|
||||
Creepjack->setFaction(1194);
|
||||
Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
|
||||
if (Malone)
|
||||
|
||||
if (Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20))
|
||||
{
|
||||
CAST_CRE(Malone)->AI()->EnterEvadeMode();
|
||||
Malone->ToCreature()->AI()->EnterEvadeMode();
|
||||
Malone->setFaction(1194);
|
||||
Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
@@ -558,18 +557,17 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->RemoveAllAuras();
|
||||
|
||||
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
|
||||
if (Creepjack)
|
||||
if (Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20))
|
||||
{
|
||||
CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
|
||||
Creepjack->ToCreature()->AI()->EnterEvadeMode();
|
||||
Creepjack->setFaction(1194);
|
||||
Creepjack->GetMotionMaster()->MoveTargetedHome();
|
||||
Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
|
||||
if (Malone)
|
||||
|
||||
if (Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20))
|
||||
{
|
||||
CAST_CRE(Malone)->AI()->EnterEvadeMode();
|
||||
Malone->ToCreature()->AI()->EnterEvadeMode();
|
||||
Malone->setFaction(1194);
|
||||
Malone->GetMotionMaster()->MoveTargetedHome();
|
||||
Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
Reference in new issue
Block a user