[11582] Implement SCRIPT_COMMAND_STAND_STATE to use in *_scripts tables

Set the stand state (enum UnitStandStateType) of any Unit*

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-06-01 09:27:35 +02:00
parent 6dd7f784cf
commit 70d9d4ef24
5 changed files with 91 additions and 1 deletions

View file

@ -559,6 +559,25 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename)
}
break;
}
case SCRIPT_COMMAND_STAND_STATE:
{
if (tmp.standState.stand_state > UNIT_STAND_STATE_CUSTOM)
{
sLog.outErrorDb("Table `%s` has invalid stand state (datalong = %u) in SCRIPT_COMMAND_STAND_STATE for script id %u", tablename, tmp.standState.stand_state, tmp.id);
continue;
}
if (tmp.standState.creatureEntry && !ObjectMgr::GetCreatureTemplate(tmp.standState.creatureEntry))
{
sLog.outErrorDb("Table `%s` has datalong2 = %u in SCRIPT_COMMAND_STAND_STATE for script id %u, but this creature_template does not exist.", tablename, tmp.standState.creatureEntry, tmp.id);
continue;
}
if (tmp.standState.creatureEntry && !tmp.standState.searchRadius)
{
sLog.outErrorDb("Table `%s` has datalong2 = %u in SCRIPT_COMMAND_STAND_STATE for script id %u, but search radius is too small (datalong3 = %u).", tablename, tmp.standState.creatureEntry, tmp.id, tmp.standState.searchRadius);
continue;
}
break;
}
}
if (scripts.find(tmp.id) == scripts.end())