diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-09-09 16:21:27 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-02-26 15:30:15 +0100 |
commit | e941d7e04b41e9f7236db6981b7ddb1d071453ea (patch) | |
tree | 6c8f40a24a5e993646f9abc11035a7e2f50c0d65 /src/server/game/Scripting/ScriptMgr.cpp | |
parent | 9c36dd7e947d483767b545b79e586c95e29e4305 (diff) |
Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep.
(cherry picked from commit b3d44d6c366c7e4f12a6ce30ee5cf6b9bff68a06)
Game/Scripting: Follow-up to b3d44d6. Fix script selection for creatures on difficulty > 0.
(cherry picked from commit 91c2b3162d350ab1a09053574ad67f45f089175b)
Build fix.
(cherry picked from commit a9f1151f2ca56394e315d0b07741c240ef59c2ff)
Fine, this time I actually built it. Promise.
(cherry picked from commit 0c2c88ed5025d9b51b6cbdf0603ceaf1ea54c80a)
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.cpp')
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 7c94aa3ed55..8ad749ef53a 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1706,6 +1706,15 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, Creature* creature) return tmpscript->GetDialogStatus(player, creature); } +bool ScriptMgr::CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureTemplate const* actTemplate, CreatureData const* cData, Map const* map) +{ + ASSERT(actTemplate); + + CreatureTemplate const* baseTemplate = sObjectMgr->GetCreatureTemplate(entry); + GET_SCRIPT_RET(CreatureScript, baseTemplate->ScriptID, tmpscript, true); + return tmpscript->CanSpawn(spawnId, entry, baseTemplate, actTemplate, cData, map); +} + CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature) { ASSERT(creature); |