Skip to content

Commit

Permalink
Leviathan: Minor style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Jul 10, 2024
1 parent 4bab3b3 commit 39b922b
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ static const float afHodirFury[MAX_HODIR_FURY][3] =
static const float afMimironInferno[3] = {329.1809f, 8.02577f, 410.887f};

static const std::vector<uint32> addEntries = {NPC_LEVIATHAN_SEAT, NPC_LEVIATHAN_TURRET, NPC_DEFENSE_TURRET, NPC_OVERLOAD_DEVICE};
static const std::vector<uint32> playerVehicleEntries = {NPC_SALVAGED_SIEGE_ENGINE, NPC_SALVAGED_SIEGE_TURRET, NPC_SALVAGED_CHOPPER, NPC_SALVAGED_DEMOLISHER, NPC_SALVAGED_DEMOLISHER_SEAT};

/*######
## boss_flame_leviathan
Expand Down Expand Up @@ -994,7 +993,7 @@ struct PursueLeviathan : public SpellScript
return false;
if (!target->IsVehicle())
return false;
if (auto vehicleInfo = target->GetVehicleInfo())
if (VehicleInfo* vehicleInfo = target->GetVehicleInfo())
if (vehicleInfo->GetPassenger(0))
return true;
return false;
Expand Down Expand Up @@ -1172,14 +1171,15 @@ struct HookshotAura : public AuraScript
// 62323 - Hookshot
struct Hookshot : public SpellScript
{
static constexpr float checkDist = 30.f * 30.f;
bool OnCheckTarget(const Spell* spell, Unit* target, SpellEffectIndex eff) const override
{
if (eff != EFFECT_INDEX_0)
return true;
Unit* caster = spell->GetCaster();
if (!caster || !target)
return true;
if (caster->GetPosition().GetDistance(target->GetPosition()) > 30.f * 30.f)
if (caster->GetPosition().GetDistance(target->GetPosition()) > checkDist)
return false;
if (target->HasAura(SPELL_SYSTEMS_SHUTDOWN))
return false;
Expand Down Expand Up @@ -1446,6 +1446,10 @@ struct ReadyToFly : public SpellScript
}
};

enum SafetyContainerID : uint32
{
NPC_PYRITE_SAFETY_CONTAINER = 33218,
};
// 64979 - Anti-Air Rocket
struct AntiAirRocket : public SpellScript
{
Expand All @@ -1454,7 +1458,7 @@ struct AntiAirRocket : public SpellScript
Unit* caster = spell->GetAffectiveCaster();
if (!caster->IsEnemy(target))
return false;
if (target->GetEntry() == 33218)
if (target->GetEntry() == NPC_PYRITE_SAFETY_CONTAINER)
return false;
return true;
}
Expand All @@ -1468,7 +1472,7 @@ struct RopeBeam : public AuraScript
if (apply)
return;
Unit* caster = aura->GetCaster();
if (!caster || caster->GetEntry() != 33218)
if (!caster || caster->GetEntry() != NPC_PYRITE_SAFETY_CONTAINER)
return;
caster->CastSpell(nullptr, SPELL_COSMETIC_PARACHITE, TRIGGERED_OLD_TRIGGERED);
caster->GetMotionMaster()->MoveFall();
Expand Down

0 comments on commit 39b922b

Please sign in to comment.