mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[11823] Add SCRIPT_COMMAND_MODIFY_NPC_FLAG to change NPC flags by db-script
Note that the npc flags will be restored when the npc respawns Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
1606bb2e45
commit
46e604a089
5 changed files with 100 additions and 8 deletions
|
|
@ -578,6 +578,21 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case SCRIPT_COMMAND_MODIFY_NPC_FLAGS:
|
||||
{
|
||||
if (tmp.npcFlag.creatureEntry && !ObjectMgr::GetCreatureTemplate(tmp.npcFlag.creatureEntry))
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has datalong3 = %u in SCRIPT_COMMAND_MODIFY_NPC_FLAGS for script id %u, but this creature_template does not exist.", tablename, tmp.run.creatureEntry, tmp.id);
|
||||
continue;
|
||||
}
|
||||
if (tmp.npcFlag.creatureEntry && !tmp.npcFlag.searchRadius)
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has datalong3 = %u in SCRIPT_COMMAND_MODIFY_NPC_FLAGS for script id %u, but search radius is too small (datalong4 = %u).", tablename, tmp.run.creatureEntry, tmp.id, tmp.run.searchRadius);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (scripts.find(tmp.id) == scripts.end())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue