* Rename InstanceData to InstanceScript
* Rename *mgr to their new names in scripts project * Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker. --HG-- branch : trunk rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#include "GameEventMgr.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "ConditionMgr.h"
|
||||
@@ -708,7 +708,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
break;
|
||||
case ACTION_T_SET_INST_DATA:
|
||||
{
|
||||
InstanceData* pInst = (InstanceData*)me->GetInstanceData();
|
||||
InstanceScript* pInst = (InstanceScript*)me->GetInstanceScript();
|
||||
if (!pInst)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, me->GetEntry());
|
||||
@@ -727,7 +727,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
return;
|
||||
}
|
||||
|
||||
InstanceData* pInst = (InstanceData*)me->GetInstanceData();
|
||||
InstanceScript* pInst = (InstanceScript*)me->GetInstanceScript();
|
||||
if (!pInst)
|
||||
{
|
||||
sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, me->GetEntry());
|
||||
|
||||
@@ -513,7 +513,7 @@ void Scripted_NoMovementAI::AttackStart(Unit* pWho)
|
||||
}
|
||||
|
||||
BossAI::BossAI(Creature *c, uint32 id) : ScriptedAI(c)
|
||||
, bossId(id), summons(me), instance(c->GetInstanceData())
|
||||
, bossId(id), summons(me), instance(c->GetInstanceScript())
|
||||
, boundary(instance ? instance->GetBossBoundary(id) : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
#define SCRIPT_CAST_TYPE dynamic_cast
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#define GET_SPELL(a) (const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(a)))
|
||||
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
|
||||
class SummonList : public std::list<uint64>
|
||||
{
|
||||
@@ -250,7 +250,7 @@ struct BossAI : public ScriptedAI
|
||||
const uint32 bossId;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
InstanceData * const instance;
|
||||
InstanceScript * const instance;
|
||||
const BossBoundaryMap * const boundary;
|
||||
|
||||
void JustSummoned(Creature *summon);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#ifndef SC_INSTANCE_H
|
||||
#define SC_INSTANCE_H
|
||||
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
|
||||
#define OUT_SAVE_INST_DATA sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAB.h"
|
||||
#include "Map.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
@@ -344,7 +344,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
return false;
|
||||
}
|
||||
InstanceData* data = ((InstanceMap*)map)->GetInstanceData();
|
||||
InstanceScript* data = ((InstanceMap*)map)->GetInstanceScript();
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include "ItemEnchantmentMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "CreatureEventAIMgr.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "DBCEnums.h"
|
||||
@@ -6576,14 +6576,14 @@ bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!((InstanceMap*)map)->GetInstanceData())
|
||||
if (!((InstanceMap*)map)->GetInstanceScript())
|
||||
{
|
||||
PSendSysMessage("Map has no instance data.");
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
((InstanceMap*)map)->GetInstanceData()->SaveToDB();
|
||||
((InstanceMap*)map)->GetInstanceScript()->SaveToDB();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "GameEventMgr.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ProgressBar.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ConditionMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
@@ -119,8 +119,8 @@ bool Condition::Meets(Player * player, Unit* targetOverride)
|
||||
case CONDITION_INSTANCE_DATA:
|
||||
{
|
||||
Map *map = player->GetMap();
|
||||
if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData())
|
||||
condMeets = ((InstanceMap*)map)->GetInstanceData()->GetData(mConditionValue1) == mConditionValue2;
|
||||
if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceScript())
|
||||
condMeets = ((InstanceMap*)map)->GetInstanceScript()->GetData(mConditionValue1) == mConditionValue2;
|
||||
break;
|
||||
}
|
||||
case CONDITION_SPELL_SCRIPT_TARGET:
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "CreatureAISelector.h"
|
||||
#include "Formulas.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Util.h"
|
||||
#include "GridNotifiers.h"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Battleground.h"
|
||||
#include "Util.h"
|
||||
#include "OutdoorPvPMgr.h"
|
||||
|
||||
@@ -1251,10 +1251,10 @@ void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const
|
||||
GetBaseMap()->GetZoneAndAreaId(zoneid, areaid, m_positionX, m_positionY, m_positionZ);
|
||||
}
|
||||
|
||||
InstanceData* WorldObject::GetInstanceData()
|
||||
InstanceScript* WorldObject::GetInstanceScript()
|
||||
{
|
||||
Map *map = GetMap();
|
||||
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceData() : NULL;
|
||||
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceScript() : NULL;
|
||||
}
|
||||
|
||||
float WorldObject::GetDistanceZ(const WorldObject* obj) const
|
||||
@@ -1844,7 +1844,7 @@ void WorldObject::SetZoneScript()
|
||||
if (Map *map = FindMap())
|
||||
{
|
||||
if (map->IsDungeon())
|
||||
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceData();
|
||||
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
|
||||
else if (!map->IsBattlegroundOrArena())
|
||||
m_zoneScript = sOutdoorPvPMgr.GetZoneScript(GetZoneId());
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class WorldSession;
|
||||
class Creature;
|
||||
class Player;
|
||||
class UpdateMask;
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
class GameObject;
|
||||
class TempSummon;
|
||||
class Vehicle;
|
||||
@@ -599,7 +599,7 @@ class WorldObject : public Object, public WorldLocation
|
||||
uint32 GetAreaId() const;
|
||||
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const;
|
||||
|
||||
InstanceData* GetInstanceData();
|
||||
InstanceScript* GetInstanceScript();
|
||||
|
||||
const char* GetName() const { return m_name.c_str(); }
|
||||
void SetName(const std::string& newname) { m_name=newname; }
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ProgressBar.h"
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ void InstanceSave::SaveToDB()
|
||||
if (map)
|
||||
{
|
||||
ASSERT(map->IsDungeon());
|
||||
if (InstanceData *iData = ((InstanceMap*)map)->GetInstanceData())
|
||||
if (InstanceScript *iData = ((InstanceMap*)map)->GetInstanceScript())
|
||||
{
|
||||
data = iData->GetSaveData();
|
||||
if (!data.empty())
|
||||
|
||||
+27
-27
@@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "CreatureAI.h"
|
||||
#include "Log.h"
|
||||
|
||||
void InstanceData::SaveToDB()
|
||||
void InstanceScript::SaveToDB()
|
||||
{
|
||||
std::string data = GetSaveData();
|
||||
if (data.empty())
|
||||
@@ -36,17 +36,17 @@ void InstanceData::SaveToDB()
|
||||
CharacterDatabase.PExecute("UPDATE instance SET data = '%s' WHERE id = '%d'", data.c_str(), instance->GetInstanceId());
|
||||
}
|
||||
|
||||
void InstanceData::HandleGameObject(uint64 GUID, bool open, GameObject *go)
|
||||
void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject *go)
|
||||
{
|
||||
if (!go)
|
||||
go = instance->GetGameObject(GUID);
|
||||
if (go)
|
||||
go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
|
||||
else
|
||||
sLog.outDebug("TSCR: InstanceData: HandleGameObject failed");
|
||||
sLog.outDebug("TSCR: InstanceScript: HandleGameObject failed");
|
||||
}
|
||||
|
||||
bool InstanceData::IsEncounterInProgress() const
|
||||
bool InstanceScript::IsEncounterInProgress() const
|
||||
{
|
||||
for (std::vector<BossInfo>::const_iterator itr = bosses.begin(); itr != bosses.end(); ++itr)
|
||||
if (itr->state == IN_PROGRESS)
|
||||
@@ -55,7 +55,7 @@ bool InstanceData::IsEncounterInProgress() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void InstanceData::LoadMinionData(const MinionData *data)
|
||||
void InstanceScript::LoadMinionData(const MinionData *data)
|
||||
{
|
||||
while (data->entry)
|
||||
{
|
||||
@@ -64,10 +64,10 @@ void InstanceData::LoadMinionData(const MinionData *data)
|
||||
|
||||
++data;
|
||||
}
|
||||
sLog.outDebug("InstanceData::LoadMinionData: %u minions loaded.", doors.size());
|
||||
sLog.outDebug("InstanceScript::LoadMinionData: %u minions loaded.", doors.size());
|
||||
}
|
||||
|
||||
void InstanceData::LoadDoorData(const DoorData *data)
|
||||
void InstanceScript::LoadDoorData(const DoorData *data)
|
||||
{
|
||||
while (data->entry)
|
||||
{
|
||||
@@ -76,10 +76,10 @@ void InstanceData::LoadDoorData(const DoorData *data)
|
||||
|
||||
++data;
|
||||
}
|
||||
sLog.outDebug("InstanceData::LoadDoorData: %u doors loaded.", doors.size());
|
||||
sLog.outDebug("InstanceScript::LoadDoorData: %u doors loaded.", doors.size());
|
||||
}
|
||||
|
||||
void InstanceData::UpdateMinionState(Creature *minion, EncounterState state)
|
||||
void InstanceScript::UpdateMinionState(Creature *minion, EncounterState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ void InstanceData::UpdateMinionState(Creature *minion, EncounterState state)
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::UpdateDoorState(GameObject *door)
|
||||
void InstanceScript::UpdateDoorState(GameObject *door)
|
||||
{
|
||||
DoorInfoMap::iterator lower = doors.lower_bound(door->GetEntry());
|
||||
DoorInfoMap::iterator upper = doors.upper_bound(door->GetEntry());
|
||||
@@ -130,7 +130,7 @@ void InstanceData::UpdateDoorState(GameObject *door)
|
||||
//sLog.outError("Door %u is %s.", door->GetEntry(), open ? "opened" : "closed");
|
||||
}
|
||||
|
||||
void InstanceData::AddDoor(GameObject *door, bool add)
|
||||
void InstanceScript::AddDoor(GameObject *door, bool add)
|
||||
{
|
||||
DoorInfoMap::iterator lower = doors.lower_bound(door->GetEntry());
|
||||
DoorInfoMap::iterator upper = doors.upper_bound(door->GetEntry());
|
||||
@@ -173,7 +173,7 @@ void InstanceData::AddDoor(GameObject *door, bool add)
|
||||
UpdateDoorState(door);
|
||||
}
|
||||
|
||||
void InstanceData::AddMinion(Creature *minion, bool add)
|
||||
void InstanceScript::AddMinion(Creature *minion, bool add)
|
||||
{
|
||||
MinionInfoMap::iterator itr = minions.find(minion->GetEntry());
|
||||
if (itr == minions.end())
|
||||
@@ -185,7 +185,7 @@ void InstanceData::AddMinion(Creature *minion, bool add)
|
||||
itr->second.bossInfo->minion.erase(minion);
|
||||
}
|
||||
|
||||
bool InstanceData::SetBossState(uint32 id, EncounterState state)
|
||||
bool InstanceScript::SetBossState(uint32 id, EncounterState state)
|
||||
{
|
||||
if (id < bosses.size())
|
||||
{
|
||||
@@ -222,7 +222,7 @@ bool InstanceData::SetBossState(uint32 id, EncounterState state)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string InstanceData::LoadBossState(const char * data)
|
||||
std::string InstanceScript::LoadBossState(const char * data)
|
||||
{
|
||||
if (!data)
|
||||
return NULL;
|
||||
@@ -238,7 +238,7 @@ std::string InstanceData::LoadBossState(const char * data)
|
||||
return loadStream.str();
|
||||
}
|
||||
|
||||
std::string InstanceData::GetBossSaveData()
|
||||
std::string InstanceScript::GetBossSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
for (std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i)
|
||||
@@ -246,7 +246,7 @@ std::string InstanceData::GetBossSaveData()
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void InstanceData::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bool bUseAlternativeState)
|
||||
void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bool bUseAlternativeState)
|
||||
{
|
||||
if (!uiGuid)
|
||||
return;
|
||||
@@ -267,7 +267,7 @@ void InstanceData::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bo
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
void InstanceScript::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
{
|
||||
if (GameObject* pGo = instance->GetGameObject(uiGuid))
|
||||
{
|
||||
@@ -283,7 +283,7 @@ void InstanceData::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
{
|
||||
Map::PlayerList const& lPlayers = instance->GetPlayers();
|
||||
|
||||
@@ -298,7 +298,7 @@ void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
}
|
||||
|
||||
// Send Notify to all players in instance
|
||||
void InstanceData::DoSendNotifyToInstance(const char *format, ...)
|
||||
void InstanceScript::DoSendNotifyToInstance(const char *format, ...)
|
||||
{
|
||||
InstanceMap::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
InstanceMap::PlayerList::const_iterator i;
|
||||
@@ -311,7 +311,7 @@ void InstanceData::DoSendNotifyToInstance(const char *format, ...)
|
||||
}
|
||||
|
||||
// Complete Achievement for all players in instance
|
||||
void InstanceData::DoCompleteAchievement(uint32 achievement)
|
||||
void InstanceScript::DoCompleteAchievement(uint32 achievement)
|
||||
{
|
||||
AchievementEntry const* pAE = GetAchievementStore()->LookupEntry(achievement);
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
@@ -329,7 +329,7 @@ void InstanceData::DoCompleteAchievement(uint32 achievement)
|
||||
}
|
||||
|
||||
// Update Achievement Criteria for all players in instance
|
||||
void InstanceData::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time)
|
||||
void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -340,7 +340,7 @@ void InstanceData::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
}
|
||||
|
||||
// Start timed achievement for all players in instance
|
||||
void InstanceData::DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
void InstanceScript::DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -351,7 +351,7 @@ void InstanceData::DoStartTimedAchievement(AchievementCriteriaTimedTypes type, u
|
||||
}
|
||||
|
||||
// Stop timed achievement for all players in instance
|
||||
void InstanceData::DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -362,7 +362,7 @@ void InstanceData::DoStopTimedAchievement(AchievementCriteriaTimedTypes type, ui
|
||||
}
|
||||
|
||||
// Remove Auras due to Spell on all players in instance
|
||||
void InstanceData::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
|
||||
@@ -372,9 +372,9 @@ void InstanceData::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
pPlayer->RemoveAurasDueToSpell(spell);
|
||||
}
|
||||
|
||||
bool InstanceData::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
|
||||
{
|
||||
sLog.outError("Achievement system call InstanceData::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
|
||||
sLog.outError("Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
|
||||
instance->GetId(),criteria_id);
|
||||
return false;
|
||||
}
|
||||
+9
-3
@@ -26,6 +26,12 @@
|
||||
//#include "GameObject.h"
|
||||
//#include "Map.h"
|
||||
|
||||
#define OUT_SAVE_INST_DATA sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
#define OUT_SAVE_INST_DATA_COMPLETE sLog.outDebug("TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
#define OUT_LOAD_INST_DATA(a) sLog.outDebug("TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
|
||||
#define OUT_LOAD_INST_DATA_COMPLETE sLog.outDebug("TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
#define OUT_LOAD_INST_DATA_FAIL sLog.outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
|
||||
|
||||
class Map;
|
||||
class Unit;
|
||||
class Player;
|
||||
@@ -110,12 +116,12 @@ struct MinionInfo
|
||||
typedef std::multimap<uint32 /*entry*/, DoorInfo> DoorInfoMap;
|
||||
typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
|
||||
|
||||
class InstanceData : public ZoneScript
|
||||
class InstanceScript : public ZoneScript
|
||||
{
|
||||
public:
|
||||
|
||||
explicit InstanceData(Map *map) : instance(map) {}
|
||||
virtual ~InstanceData() {}
|
||||
explicit InstanceScript(Map *map) : instance(map) {}
|
||||
virtual ~InstanceScript() {}
|
||||
|
||||
Map *instance;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "Log.h"
|
||||
#include "GridStates.h"
|
||||
#include "CellImpl.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Config.h"
|
||||
@@ -2266,7 +2266,7 @@ bool InstanceMap::CanEnter(Player *player)
|
||||
// cannot enter while an encounter is in progress on raids
|
||||
/*Group *pGroup = player->GetGroup();
|
||||
if (!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
|
||||
if (IsRaid() && GetInstanceData() && GetInstanceData()->IsEncounterInProgress())
|
||||
if (IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
|
||||
{
|
||||
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
|
||||
return false;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
class Unit;
|
||||
class WorldPacket;
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
class Group;
|
||||
class InstanceSave;
|
||||
class Object;
|
||||
@@ -592,7 +592,7 @@ class InstanceMap : public Map
|
||||
void CreateInstanceData(bool load);
|
||||
bool Reset(uint8 method);
|
||||
uint32 GetScriptId() { return i_script_id; }
|
||||
InstanceData* GetInstanceData() { return i_data; }
|
||||
InstanceScript* GetInstanceScript() { return i_data; }
|
||||
void PermBindAllPlayers(Player *player);
|
||||
void UnloadAll();
|
||||
bool CanEnter(Player* player);
|
||||
@@ -606,7 +606,7 @@ class InstanceMap : public Map
|
||||
private:
|
||||
bool m_resetAfterUnload;
|
||||
bool m_unloadWhenEmpty;
|
||||
InstanceData* i_data;
|
||||
InstanceScript* i_data;
|
||||
uint32 i_script_id;
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "Transport.h"
|
||||
#include "GridDefines.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "DestinationHolderImp.h"
|
||||
#include "Config.h"
|
||||
#include "World.h"
|
||||
|
||||
@@ -593,12 +593,12 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff)
|
||||
#undef SCR_MAP_BGN
|
||||
#undef SCR_MAP_END
|
||||
|
||||
InstanceData* ScriptMgr::CreateInstanceData(InstanceMap* map)
|
||||
InstanceScript* ScriptMgr::CreateInstanceData(InstanceMap* map)
|
||||
{
|
||||
ASSERT(map);
|
||||
|
||||
GET_SCRIPT_RET(InstanceMapScript, map->GetScriptId(), tmpscript, NULL);
|
||||
return tmpscript->GetInstanceData(map);
|
||||
return tmpscript->GetInstanceScript(map);
|
||||
}
|
||||
|
||||
bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Item* target)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
class Player;
|
||||
class Creature;
|
||||
class CreatureAI;
|
||||
class InstanceData;
|
||||
class InstanceScript;
|
||||
class SpellScript;
|
||||
class Quest;
|
||||
class Item;
|
||||
@@ -421,8 +421,8 @@ class InstanceMapScript : public ScriptObject, public MapScript<InstanceMap>
|
||||
|
||||
bool IsDatabaseBound() const { return true; }
|
||||
|
||||
// Gets an InstanceData object for this instance.
|
||||
virtual InstanceData* GetInstanceData(InstanceMap* map) const { return NULL; }
|
||||
// Gets an InstanceScript object for this instance.
|
||||
virtual InstanceScript* GetInstanceScript(InstanceMap* map) const { return NULL; }
|
||||
};
|
||||
|
||||
class BattlegroundMapScript : public ScriptObject, public MapScript<BattlegroundMap>
|
||||
@@ -852,7 +852,7 @@ class ScriptMgr
|
||||
|
||||
public: /* InstanceMapScript */
|
||||
|
||||
InstanceData* CreateInstanceData(InstanceMap* map);
|
||||
InstanceScript* CreateInstanceData(InstanceMap* map);
|
||||
|
||||
public: /* ItemScript */
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "DBCEnums.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "InstanceData.h"
|
||||
#include "InstanceScript.h"
|
||||
|
||||
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
|
||||
@@ -384,7 +384,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Script->GossipSelect (_player, unit, _player->PlayerTalkClass->GossipOptionSender (option), _player->PlayerTalkClass->GossipOptionAction (option)))
|
||||
if (!Script->OnGossipSelect (_player, unit, _player->PlayerTalkClass->GossipOptionSender (option), _player->PlayerTalkClass->GossipOptionAction (option)))
|
||||
unit->OnGossipSelect (_player, option);
|
||||
}
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user