[11311] Add SCRIPT_COMMAND_ATTACK_START to initiate attack by creature.

../docs/script_commands.txt updated for details

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-04-03 19:52:06 +02:00
parent b92ebd994f
commit acb6372d29
5 changed files with 102 additions and 1 deletions

View file

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