Core/SAI: Implemented Gameobject action allowing to send SMSG_GAMEOBJECT_CUSTOM_ANIM with parameter set in param1
This commit is contained in:
@@ -1453,6 +1453,18 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
|
||||
(*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed,e.action.interruptSpellCasting.spell_id,e.action.interruptSpellCasting.withInstant);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SEND_GO_CUSTOM_ANIM:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (!targets)
|
||||
return;
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++)
|
||||
if (IsGameObject((*itr)))
|
||||
(*itr)->ToGameObject()->SendCustomAnim(e.action.sendGoCustomAnim.anim);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -769,6 +769,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
|
||||
case SMART_ACTION_SET_UNIT_FIELD_BYTES_1:
|
||||
case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1:
|
||||
case SMART_ACTION_INTERRUPT_SPELL:
|
||||
case SMART_ACTION_SEND_GO_CUSTOM_ANIM:
|
||||
break;
|
||||
default:
|
||||
sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
|
||||
@@ -445,12 +445,13 @@ enum SMART_ACTION
|
||||
SMART_ACTION_RANDOM_MOVE = 89, // maxDist
|
||||
|
||||
SMART_ACTION_SET_UNIT_FIELD_BYTES_1 = 90, // bytes, target
|
||||
|
||||
SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1 = 91, // bytes, target
|
||||
|
||||
SMART_ACTION_INTERRUPT_SPELL = 92,
|
||||
|
||||
SMART_ACTION_END = 93,
|
||||
SMART_ACTION_SEND_GO_CUSTOM_ANIM = 93, // anim id
|
||||
|
||||
SMART_ACTION_END = 94,
|
||||
};
|
||||
|
||||
struct SmartAction
|
||||
@@ -829,6 +830,11 @@ struct SmartAction
|
||||
uint32 spell_id;
|
||||
bool withInstant;
|
||||
} interruptSpellCasting;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 anim;
|
||||
} sendGoCustomAnim;
|
||||
struct
|
||||
{
|
||||
uint32 param1;
|
||||
|
||||
Reference in New Issue
Block a user