diff options
| author | Ovahlord <dreadkiller@gmx.de> | 2024-02-29 14:43:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-29 14:43:37 +0100 |
| commit | c541eda54d7e0dddeec329a6beac2948e0b0a40b (patch) | |
| tree | 90bead53d03937a1c55f4c12cd7f370a8ca13d8d /src/server/scripts | |
| parent | 792a4d6c8bab4a8e874c6f0e583f915d05b8d8b3 (diff) | |
Core/Creatures: implemented most movement related static flags and migrated existing movement data into static flags (#29541)
* implemented CREATURE_STATIC_FLAG_AQUATIC - creatures cannot leave liquids
* implemented CREATURE_STATIC_FLAG_AMPHIBIOUS - creatures can enter and leave liquids but remain on the ocean floor when swimming is not enabled until engaged
* implemented CREATURE_STATIC_FLAG_FLOATING - creatures have their gravity on spawn / reset disabled
* implemented CREATURE_STATIC_FLAG_SESSILE - creatures are rooted in place
* implemented CREATURE_STATIC_FLAG_CAN_SWIM - creature can swim in liquids
* implemented CREATURE_STATIC_FLAG_3_CANNOT_SWIM - Amphibious creatures cannot toggle on swimming
* implemented CREATURE_STATIC_FLAG_3_CANNOT_TURN - Creatures cannot turn at all
* implemented CREATURE_STATIC_FLAG_4_PREVENT_SWIM - Amphibious creatures won't toggle on swimming until their victim starts leaving the ocean floor
* partially implemented CREATURE_STATIC_FLAG_3_CANNOT_PENETRATE_WATER
* deprecated CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE as this flag was a hackfix to a wrong implementation that is now gone
Diffstat (limited to 'src/server/scripts')
3 files changed, 6 insertions, 9 deletions
diff --git a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp index 541ec3c53b0..7ab449b9191 100644 --- a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp +++ b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp @@ -492,8 +492,6 @@ struct npc_joren_ironstock : public ScriptedAI void JustAppeared() override { - me->SetTemplateRooted(true); - _scheduler.Schedule(1s, [this](TaskContext task) { if (Creature* invader = me->SummonCreature(NPC_ROCKJAW_INVADER, Trinity::Containers::SelectRandomContainerElement(RockjawInvaderSpawnPoints), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 18s)) diff --git a/src/server/scripts/ExilesReach/zone_exiles_reach.cpp b/src/server/scripts/ExilesReach/zone_exiles_reach.cpp index 0ec3d94693f..e5f0e36616d 100644 --- a/src/server/scripts/ExilesReach/zone_exiles_reach.cpp +++ b/src/server/scripts/ExilesReach/zone_exiles_reach.cpp @@ -4460,7 +4460,7 @@ struct npc_briarpatch_prisoner : public ScriptedAI void JustAppeared() override { me->SetDisableGravity(true); - me->SetTemplateRooted(true); + me->SetControlled(true, UNIT_STATE_ROOT); me->CastSpell(me, SPELL_NECROTIC_RITUAL_DNT); } @@ -4470,7 +4470,7 @@ struct npc_briarpatch_prisoner : public ScriptedAI { me->RemoveAllAuras(); me->SetDisableGravity(false); - me->SetTemplateRooted(false); + me->SetControlled(false, UNIT_STATE_ROOT); me->GetMotionMaster()->MoveJump(BriarpatchPrisonerJumpToPosition, 7.9894905f, 19.29110336303710937f); Talk(SAY_GET_OUT_OF_HERE); _events.ScheduleEvent(EVENT_RUN_TO_PLAINS, 4s); @@ -6277,7 +6277,7 @@ struct npc_captain_garrick_q55879 : public ScriptedAI if (!boar) return; - boar->SetTemplateRooted(false); + boar->SetControlled(false, UNIT_STATE_ROOT); me->CastSpell(boar, SPELL_RIDE_VEHICLE_CAPTIAN_BOAR); } break; @@ -6372,7 +6372,7 @@ struct npc_giant_boar_vehicle_q55879 : public VehicleAI { if (apply && passenger->IsPlayer()) { - me->SetTemplateRooted(true); + me->SetControlled(true, UNIT_STATE_ROOT); passenger->SetMovedUnit(me); passenger->CastSpell(passenger, SPELL_PING_GARRICK_TO_RIDE_BOAR); // Ping Garrick to ride Boar (DNT) passenger->CastSpell(passenger, SPELL_UPDATE_PHASE_SHIFT); @@ -6388,7 +6388,7 @@ struct npc_giant_boar_vehicle_q55879 : public VehicleAI if (spellInfo->Id == SPELL_ENHANCED_BOAR_PING_VEHICLE) { me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); - me->SetTemplateRooted(true); + me->SetControlled(true, UNIT_STATE_ROOT); me->CastSpell(me, SPELL_ENHANCED_BOAR_CHARGE); _endOfScene = true; _events.ScheduleEvent(EVENT_GIANT_BOAR_SIZE_ONE, 4s); @@ -6434,7 +6434,7 @@ struct npc_giant_boar_vehicle_q55879 : public VehicleAI _events.ScheduleEvent(EVENT_GIANT_BOAR_UNROOT, 500ms); break; case EVENT_GIANT_BOAR_UNROOT: - me->SetTemplateRooted(false); + me->SetControlled(false, UNIT_STATE_ROOT); break; default: break; diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp index 0a774e75a1e..4d959dce9c1 100644 --- a/src/server/scripts/Kalimdor/zone_durotar.cpp +++ b/src/server/scripts/Kalimdor/zone_durotar.cpp @@ -211,7 +211,6 @@ struct npc_durotar_tiki_target : public ScriptedAI void JustAppeared() override { me->SetReactState(REACT_PASSIVE); - me->SetTemplateRooted(true); DoCastSelf(TiKiTargetMask[urand(0, 2)]); DoCastSelf(SPELL_ARCANE_MISSILES_TRAINER); } |
