[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

@ -750,6 +750,30 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
}
}
break;
case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL:
if (action.mount.creatureId != 0 || action.mount.modelId != 0)
{
if (action.mount.creatureId && !sCreatureStorage.LookupEntry<CreatureInfo>(action.mount.creatureId))
{
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId);
action.morph.creatureId = 0;
}
if (action.mount.modelId)
{
if (action.mount.creatureId)
{
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.mount.modelId, action.mount.creatureId);
action.mount.modelId = 0;
}
else if (!sCreatureDisplayInfoStore.LookupEntry(action.mount.modelId))
{
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId);
action.mount.modelId = 0;
}
}
}
break;
case ACTION_T_EVADE: //No Params
case ACTION_T_FLEE_FOR_ASSIST: //No Params
case ACTION_T_DIE: //No Params