[11309] Extend SCRIPT_COMMAND_EMOTE, allow search for nearby creature to do the emote

Also allow play emote on Player when player is source.
Gameobject may be source of script but are only allowed as searcher for creature when defined.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-04-03 17:55:13 +02:00
parent c81eafd1c1
commit c93256e477
5 changed files with 63 additions and 7 deletions

View file

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