diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-09-09 16:21:27 +0200 |
---|---|---|
committer | treeston <treeston.mmoc@gmail.com> | 2016-09-09 16:21:27 +0200 |
commit | b3d44d6c366c7e4f12a6ce30ee5cf6b9bff68a06 (patch) | |
tree | 5b0518a14d556de4944ebaa977a17a1ce2f5955a /src/server/game/Scripting/ScriptMgr.h | |
parent | 9180bcd404ff0a89144bbe834a2efe189bd0eb86 (diff) |
Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep.
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 233e56aadb2..d0f9ad32f1c 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -66,6 +66,8 @@ struct AchievementCriteriaData; struct AuctionEntry; struct ConditionSourceInfo; struct Condition; +struct CreatureTemplate; +struct CreatureData; struct ItemTemplate; struct OutdoorPvPData; @@ -432,6 +434,9 @@ class TC_GAME_API CreatureScript : public UnitScript, public UpdatableScript<Cre // Called when the dialog status between a player and the creature is requested. virtual uint32 GetDialogStatus(Player* /*player*/, Creature* /*creature*/) { return DIALOG_STATUS_SCRIPTED_NO_STATUS; } + // Called when the creature tries to spawn. Return false to block spawn and re-evaluate on next tick. + virtual bool CanSpawn(ObjectGuid::LowType /*spawnId*/, CreatureTemplate const* /*cTemplate*/, CreatureData const* /*cData*/, Map const* /*map*/) { return true; } + // Called when a CreatureAI object is needed for the creature. virtual CreatureAI* GetAI(Creature* /*creature*/) const { return NULL; } }; @@ -957,6 +962,7 @@ class TC_GAME_API ScriptMgr bool OnQuestSelect(Player* player, Creature* creature, Quest const* quest); bool OnQuestReward(Player* player, Creature* creature, Quest const* quest, uint32 opt); uint32 GetDialogStatus(Player* player, Creature* creature); + bool CanSpawn(ObjectGuid::LowType spawnId, CreatureTemplate const* cTemplate, CreatureData const* cData, Map const* map); CreatureAI* GetCreatureAI(Creature* creature); void OnCreatureUpdate(Creature* creature, uint32 diff); |