mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
feat(Core/SAI): Implement SMART_ACTION_SET_ANIM_TIER (#24143)
This commit is contained in:
@@ -3289,6 +3289,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_ANIM_TIER:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
if (IsUnit(target))
|
||||
target->ToUnit()->SetAnimTier(AnimTier(e.action.animTier.animTier));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Unhandled Action type {}", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
break;
|
||||
|
||||
@@ -884,6 +884,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e)
|
||||
case SMART_ACTION_MOVEMENT_RESUME: return sizeof(SmartAction::move);
|
||||
case SMART_ACTION_WORLD_SCRIPT: return sizeof(SmartAction::worldStateScript);
|
||||
case SMART_ACTION_DISABLE_REWARD: return sizeof(SmartAction::reward);
|
||||
case SMART_ACTION_SET_ANIM_TIER: return sizeof(SmartAction::animTier);
|
||||
case SMART_ACTION_DISMOUNT: return NO_PARAMS;
|
||||
default:
|
||||
LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an action with no unused params specified in SmartAIMgr::CheckUnusedActionParams(), please report this.",
|
||||
@@ -1897,6 +1898,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_ANIM_TIER:
|
||||
if (e.action.animTier.animTier >= uint32(AnimTier::Max))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid animtier %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.animTier.animTier);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SMART_ACTION_AUTO_ATTACK:
|
||||
return IsSAIBoolValid(e, e.action.autoAttack.attack);
|
||||
case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
|
||||
|
||||
@@ -721,8 +721,9 @@ enum SMART_ACTION
|
||||
SMART_ACTION_MOVEMENT_RESUME = 236, // timerOverride
|
||||
SMART_ACTION_WORLD_SCRIPT = 237, // eventId, param
|
||||
SMART_ACTION_DISABLE_REWARD = 238, // reputation 0/1, loot 0/1
|
||||
SMART_ACTION_SET_ANIM_TIER = 239, // animtier
|
||||
|
||||
SMART_ACTION_AC_END = 239, // placeholder
|
||||
SMART_ACTION_AC_END = 240, // placeholder
|
||||
};
|
||||
|
||||
enum class SmartActionSummonCreatureFlags
|
||||
@@ -1502,6 +1503,11 @@ struct SmartAction
|
||||
SAIBool reputation;
|
||||
SAIBool loot;
|
||||
} reward;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 animTier;
|
||||
} animTier;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user