mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +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();
|
_instance = creature->GetInstanceScript();
|
||||||
|
|
||||||
_currentOrientation = GetDefaultOrientationForTeam();
|
_currentOrientation = GetDefaultOrientationForTeam();
|
||||||
|
_homePosition = creature->GetPosition();
|
||||||
|
|
||||||
_nextMoveTimer = urand(8 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
_nextMoveTimer = urand(8 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||||
|
|
||||||
@@ -1457,6 +1458,8 @@ struct npc_chesspiece : public ScriptedAI
|
|||||||
{
|
{
|
||||||
me->SetResistance(SpellSchools(i), 0);
|
me->SetResistance(SpellSchools(i), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
me->NearTeleportTo(_homePosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||||
@@ -2044,6 +2047,7 @@ private:
|
|||||||
KarazhanChessOrientationType _currentOrientation;
|
KarazhanChessOrientationType _currentOrientation;
|
||||||
|
|
||||||
bool _teamControlledByRaid;
|
bool _teamControlledByRaid;
|
||||||
|
Position _homePosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct npc_chess_move_trigger : public ScriptedAI
|
struct npc_chess_move_trigger : public ScriptedAI
|
||||||
|
|||||||
@@ -271,9 +271,6 @@ public:
|
|||||||
piece->RemoveAllAuras();
|
piece->RemoveAllAuras();
|
||||||
piece->setDeathState(DeathState::JustRespawned);
|
piece->setDeathState(DeathState::JustRespawned);
|
||||||
piece->SetHealth(piece->GetMaxHealth());
|
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->AI()->DoAction(ACTION_CHESS_PIECE_RESET_ORIENTATION);
|
||||||
piece->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
piece->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||||
piece->AI()->Reset();
|
piece->AI()->Reset();
|
||||||
|
|||||||
Reference in New Issue
Block a user