[10365] Implement ACTION_T_MOUNT_TO_ENTRY_OR_MODEL (43) for creature eventAI.

Read doc/EventAI.txt for details.
SQL query to update existing scripts are included (convert from using ACTION_T_SET_UNIT_FIELD, field 68)

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-08-17 19:47:41 +02:00
parent 40f70138da
commit 821bb9fcc4
9 changed files with 64 additions and 3 deletions

View file

@ -804,6 +804,28 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_InvinceabilityHpLevel = action.invincibility_hp_level.hp_level;
break;
}
case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL:
{
if (action.mount.creatureId || action.mount.modelId)
{
// set model based on entry from creature_template
if (action.mount.creatureId)
{
if (CreatureInfo const* cInfo = GetCreatureTemplateStore(action.mount.creatureId))
{
uint32 display_id = Creature::ChooseDisplayId(0, cInfo);
m_creature->Mount(display_id);
}
}
//if no param1, then use value from param2 (modelId)
else
m_creature->Mount(action.mount.modelId);
}
else
m_creature->Unmount();
break;
}
}
}