mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
attempt to stop mobs casting and fleeing while stunned or confused
--HG-- branch : trunk
This commit is contained in:
@@ -14789,24 +14789,37 @@ void Unit::SetControlled(bool apply, UnitState state)
|
||||
if (hasUnitState(state))
|
||||
return;
|
||||
|
||||
addUnitState(state);
|
||||
|
||||
switch(state)
|
||||
{
|
||||
case UNIT_STAT_STUNNED:
|
||||
{
|
||||
addUnitState(state);
|
||||
SetStunned(true);
|
||||
CastStop();
|
||||
}
|
||||
break;
|
||||
case UNIT_STAT_ROOT:
|
||||
if (!hasUnitState(UNIT_STAT_STUNNED))
|
||||
SetRooted(true);
|
||||
{
|
||||
addUnitState(state);
|
||||
SetRooted(true);
|
||||
}
|
||||
break;
|
||||
case UNIT_STAT_CONFUSED:
|
||||
if (!hasUnitState(UNIT_STAT_STUNNED))
|
||||
{
|
||||
addUnitState(state);
|
||||
SetConfused(true);
|
||||
CastStop();
|
||||
}
|
||||
break;
|
||||
case UNIT_STAT_FLEEING:
|
||||
if (!hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED))
|
||||
{
|
||||
addUnitState(state);
|
||||
SetFeared(true);
|
||||
CastStop();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user