mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Scripts/Karazhan): Chess pieces reset to correct positions (#21061)
This commit is contained in:
@@ -1424,6 +1424,7 @@ struct npc_chesspiece : public ScriptedAI
|
||||
_instance = creature->GetInstanceScript();
|
||||
|
||||
_currentOrientation = GetDefaultOrientationForTeam();
|
||||
_homePosition = creature->GetPosition();
|
||||
|
||||
_nextMoveTimer = urand(8 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||
|
||||
@@ -1457,6 +1458,8 @@ struct npc_chesspiece : public ScriptedAI
|
||||
{
|
||||
me->SetResistance(SpellSchools(i), 0);
|
||||
}
|
||||
|
||||
me->NearTeleportTo(_homePosition);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
@@ -2044,6 +2047,7 @@ private:
|
||||
KarazhanChessOrientationType _currentOrientation;
|
||||
|
||||
bool _teamControlledByRaid;
|
||||
Position _homePosition;
|
||||
};
|
||||
|
||||
struct npc_chess_move_trigger : public ScriptedAI
|
||||
|
||||
@@ -271,9 +271,6 @@ public:
|
||||
piece->RemoveAllAuras();
|
||||
piece->setDeathState(DeathState::JustRespawned);
|
||||
piece->SetHealth(piece->GetMaxHealth());
|
||||
float x, y, z, o;
|
||||
piece->GetHomePosition(x, y, z, o);
|
||||
piece->NearTeleportTo(x, y, z, o);
|
||||
piece->AI()->DoAction(ACTION_CHESS_PIECE_RESET_ORIENTATION);
|
||||
piece->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
piece->AI()->Reset();
|
||||
|
||||
Reference in New Issue
Block a user