diff options
Diffstat (limited to 'src/server/game/Scripting')
| -rw-r--r-- | src/server/game/Scripting/ScriptMgr.cpp | 38 | ||||
| -rw-r--r-- | src/server/game/Scripting/ScriptMgr.h | 4 |
2 files changed, 0 insertions, 42 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index de42459a367..8df91f40ff5 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1599,44 +1599,6 @@ bool ScriptMgr::OnCastItemCombatSpell(Player* player, Unit* victim, SpellInfo co return tmpscript->OnCastItemCombatSpell(player, victim, spellInfo, item); } -bool ScriptMgr::CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureData const* cData, Map const* map) -{ - ASSERT(map); - CreatureTemplate const* baseTemplate = sObjectMgr->GetCreatureTemplate(entry); - ASSERT(baseTemplate); - - // find out which template we'd be using - CreatureTemplate const* actTemplate = nullptr; - DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(map->GetDifficultyID()); - while (!actTemplate && difficultyEntry) - { - int32 idx = CreatureTemplate::DifficultyIDToDifficultyEntryIndex(difficultyEntry->ID); - if (idx == -1) - break; - - if (baseTemplate->DifficultyEntry[idx]) - { - actTemplate = sObjectMgr->GetCreatureTemplate(baseTemplate->DifficultyEntry[idx]); - break; - } - - if (!difficultyEntry->FallbackDifficultyID) - break; - - difficultyEntry = sDifficultyStore.LookupEntry(difficultyEntry->FallbackDifficultyID); - } - - if (!actTemplate) - actTemplate = baseTemplate; - - uint32 scriptId = baseTemplate->ScriptID; - if (cData && cData->scriptId) - scriptId = cData->scriptId; - - GET_SCRIPT_RET(CreatureScript, scriptId, tmpscript, true); - return tmpscript->CanSpawn(spawnId, entry, baseTemplate, actTemplate, cData, map); -} - CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature) { ASSERT(creature); diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index cf02fcad7a8..bd3e383572c 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -420,9 +420,6 @@ class TC_GAME_API CreatureScript : public UnitScript public: - // Called when the creature tries to spawn. Return false to block spawn and re-evaluate on next tick. - virtual bool CanSpawn(ObjectGuid::LowType /*spawnId*/, uint32 /*entry*/, CreatureTemplate const* /*baseTemplate*/, CreatureTemplate const* /*actTemplate*/, CreatureData const* /*cData*/, Map const* /*map*/) const { return true; } - // Called when a CreatureAI object is needed for the creature. virtual CreatureAI* GetAI(Creature* /*creature*/) const = 0; }; @@ -989,7 +986,6 @@ class TC_GAME_API ScriptMgr public: /* CreatureScript */ - bool CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureData const* cData, Map const* map); CreatureAI* GetCreatureAI(Creature* creature); public: /* GameObjectScript */ |
