Core/Misc: added loading error message for SCRIPT_COMMAND_PLAY_ANIMKIT

SMSG_PLAY_ONE_SHOT_ANIM_KIT can now be used in waypoint_scripts
This commit is contained in:
Aokromes committed 2017-02-19 09:46:43 +01:00
1 parent fda6446838
commit f430d2fd31
3 files changed
+25 -1

No files matched your search

+11
View File
@@ -112,6 +112,7 @@ std::string GetScriptCommandName(ScriptCommands command)
case SCRIPT_COMMAND_CLOSE_GOSSIP: res = "SCRIPT_COMMAND_CLOSE_GOSSIP"; break;
case SCRIPT_COMMAND_PLAYMOVIE: res = "SCRIPT_COMMAND_PLAYMOVIE"; break;
case SCRIPT_COMMAND_MOVEMENT: res = "SCRIPT_COMMAND_MOVEMENT"; break;
case SCRIPT_COMMAND_PLAY_ANIMKIT: res = "SCRIPT_COMMAND_PLAY_ANIMKIT"; break;
default:
{
char sz[32];
@@ -5109,6 +5110,16 @@ void ObjectMgr::LoadScripts(ScriptsType type)
}
break;
}
case SCRIPT_COMMAND_PLAY_ANIMKIT:
{
if (!sAnimKitStore.LookupEntry(tmp.PlayAnimKit.AnimKitID))
{
TC_LOG_ERROR("sql.sql", "Table `%s` has invalid AnimKid id (datalong = %u) in SCRIPT_COMMAND_PLAY_ANIMKIT for script id %u",
tableName.c_str(), tmp.PlayAnimKit.AnimKitID, tmp.id);
continue;
}
break;
}
default:
break;
}
+8 -1
View File
@@ -113,7 +113,8 @@ enum ScriptCommands
SCRIPT_COMMAND_MODEL = 32, // source = Creature, datalong = model id
SCRIPT_COMMAND_CLOSE_GOSSIP = 33, // source = Player
SCRIPT_COMMAND_PLAYMOVIE = 34, // source = Player, datalong = movie id
SCRIPT_COMMAND_MOVEMENT = 35 // source = Creature, datalong = MovementType, datalong2 = MovementDistance (spawndist f.ex.), dataint = pathid
SCRIPT_COMMAND_MOVEMENT = 35, // source = Creature, datalong = MovementType, datalong2 = MovementDistance (spawndist f.ex.), dataint = pathid
SCRIPT_COMMAND_PLAY_ANIMKIT = 36 // source = Creature, datalong = AnimKit id
};
// Benchmarked: Faster than std::unordered_map (insert/find)
@@ -369,6 +370,12 @@ struct ScriptInfo
uint32 MovementDistance; // datalong2
int32 Path; // dataint
} Movement;
struct // SCRIPT_COMMAND_PLAY_ANIMKIT (35)
{
uint32 AnimKitID; // datalong
} PlayAnimKit;
};
std::string GetDebugInfo() const;
+6
View File
@@ -894,6 +894,12 @@ void Map::ScriptsProcess()
}
break;
case SCRIPT_COMMAND_PLAY_ANIMKIT:
// Source must be Creature.
if (Creature* cSource = _GetScriptCreature(source, true, step.script))
cSource->PlayOneShotAnimKit(step.script->PlayAnimKit.AnimKitID);
break;
default:
TC_LOG_ERROR("scripts", "Unknown script command %s.", step.script->GetDebugInfo().c_str());
break;