Skip to content

Commit

Permalink
Leviathan: Fix friendly fire and mulitboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Aug 25, 2024
1 parent 477979a commit 74d9cc6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
4 changes: 4 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -964,10 +964,13 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(62910,'spell_mimirons_inferno_leviathan'),
(62912,'spell_thorims_hammer_leviathan'),
(62336,'spell_hookshot_aura'),
(62363,'spell_anti_air_rocket'),
(62374,'spell_pursue_leviathan'),
(62382,'spell_ignis_brittle'),
(62399,'spell_overload_circuit'),
(62475,'spell_systems_shutdown'),
(62634,'spell_demolisher_mortar'),
(62635,'spell_demolisher_mortar'),
(62789,'spell_heart_overload'),
(62826,'spell_energy_orb_dummy'),
(62828,'spell_recharge_robot'),
Expand Down Expand Up @@ -1000,6 +1003,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(64568,'spell_blood_reserve_enchant'),
(64979,'spell_anti_air_rocket'),
(64998,'spell_ready_to_fly'),
(65044,'spell_flames_leviathan'),
(65045,'spell_flames_leviathan'),
(65121,'spell_searing_light'),
(65667,'spell_ignis_heat'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ struct FreyasWard : public SpellScript
}
};

// 65045 - Flames
// 65045, 65044 - Flames
struct FlamesLeviathan : public SpellScript
{
bool OnCheckTarget(const Spell* spell, Unit* target, SpellEffectIndex /*eff*/) const override
Expand Down Expand Up @@ -1450,7 +1450,7 @@ enum SafetyContainerID : uint32
{
NPC_PYRITE_SAFETY_CONTAINER = 33218,
};
// 64979 - Anti-Air Rocket
// 64979, 62363 - Anti-Air Rocket
struct AntiAirRocket : public SpellScript
{
bool OnCheckTarget(const Spell* spell, Unit* target, SpellEffectIndex eff) const override
Expand All @@ -1464,6 +1464,18 @@ struct AntiAirRocket : public SpellScript
}
};

// 62634, 62635 - Mortar
struct DemolisherMortar : public SpellScript
{
bool OnCheckTarget(const Spell* spell, Unit* target, SpellEffectIndex eff) const override
{
Unit* caster = spell->GetAffectiveCaster();
if (!caster->IsEnemy(target))
return false;
return true;
}
};

// 63605 - Rope Beam
struct RopeBeam : public AuraScript
{
Expand Down Expand Up @@ -1562,6 +1574,7 @@ void AddSC_boss_flame_leviathan()
RegisterSpellScript<FreyasWard>("spell_freyas_ward_leviathan");
RegisterSpellScript<ReadyToFly>("spell_ready_to_fly");
RegisterSpellScript<AntiAirRocket>("spell_anti_air_rocket");
RegisterSpellScript<DemolisherMortar>("spell_demolisher_mortar");
RegisterSpellScript<RopeBeam>("spell_rope_beam");
RegisterSpellScript<FlameLeviathanBuff>("spell_flame_leviathan_buff");
}
12 changes: 11 additions & 1 deletion src/game/Entities/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ void VehicleInfo::Initialize()
vehicle->SetPowerType(Powers(powerEntry->power));
}

// Experimental
if (vehicleFlags & (VEHICLE_FLAG_UNK8 | VEHICLE_FLAG_UNK7))
{
vehicle->SetCanEnterCombat(false);
if (vehicle->AI())
vehicle->AI()->SetReactState(REACT_PASSIVE);
}

m_isInitialized = true;
}

Expand Down Expand Up @@ -303,7 +311,9 @@ void VehicleInfo::Board(Unit* passenger, uint8 seat)
float lx = 0.f, ly = 0.f, lz = 0.f, lo = 0.f;
GetSeatCoordinates(seatEntry, lx, ly, lz);

BoardPassenger(passenger, lx, ly, lz, lo, seat); // Use TransportBase to store the passenger
if(!BoardPassenger(passenger, lx, ly, lz, lo, seat)) // Use TransportBase to store the passenger
return;

if (auto* rootVehicle = static_cast<Unit*>(m_owner)->FindRootVehicle())
passenger->SetRootVehicle(rootVehicle->GetObjectGuid());

Expand Down

0 comments on commit 74d9cc6

Please sign in to comment.