mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
6dd7f784cf
commit
70d9d4ef24
5 changed files with 91 additions and 1 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue