mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 18:43:48 +00:00
converted all tabs to 4 spaces
This commit is contained in:
@@ -7,25 +7,25 @@ REWRITTEN BY XINEF
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
TYPE_EAST_WING_PROGRESS = 0,
|
||||
TYPE_WEST_WING_PROGRESS = 1,
|
||||
TYPE_PYLONS_STATE = 2,
|
||||
TYPE_NORTH_WING_PROGRESS = 3,
|
||||
TYPE_NORTH_WING_BOSSES = 4,
|
||||
TYPE_EAST_WING_PROGRESS = 0,
|
||||
TYPE_WEST_WING_PROGRESS = 1,
|
||||
TYPE_PYLONS_STATE = 2,
|
||||
TYPE_NORTH_WING_PROGRESS = 3,
|
||||
TYPE_NORTH_WING_BOSSES = 4,
|
||||
|
||||
ALL_PYLONS_OFF = 0x1F
|
||||
ALL_PYLONS_OFF = 0x1F
|
||||
};
|
||||
|
||||
enum GoIds
|
||||
{
|
||||
GO_DIRE_MAUL_FORCE_FIELD = 179503,
|
||||
GO_GORDOK_TRIBUTE = 179564
|
||||
GO_DIRE_MAUL_FORCE_FIELD = 179503,
|
||||
GO_GORDOK_TRIBUTE = 179564
|
||||
};
|
||||
|
||||
enum NpcIds
|
||||
{
|
||||
NPC_IMMOL_THAR = 11496,
|
||||
NPC_HIGHBORNE_SUMMONER = 11466
|
||||
NPC_IMMOL_THAR = 11496,
|
||||
NPC_HIGHBORNE_SUMMONER = 11466
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,146 +8,146 @@ REWRITTEN BY XINEF
|
||||
|
||||
class instance_dire_maul : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_dire_maul() : InstanceMapScript("instance_dire_maul", 429) { }
|
||||
public:
|
||||
instance_dire_maul() : InstanceMapScript("instance_dire_maul", 429) { }
|
||||
|
||||
struct instance_dire_maul_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_dire_maul_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
struct instance_dire_maul_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_dire_maul_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_eastWingProgress = 0;
|
||||
_westWingProgress = 0;
|
||||
_pylonsState = 0;
|
||||
_northWingProgress = 0;
|
||||
_northWingBosses = 0;
|
||||
_immoltharGUID = 0;
|
||||
}
|
||||
void Initialize()
|
||||
{
|
||||
_eastWingProgress = 0;
|
||||
_westWingProgress = 0;
|
||||
_pylonsState = 0;
|
||||
_northWingProgress = 0;
|
||||
_northWingBosses = 0;
|
||||
_immoltharGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_IMMOL_THAR:
|
||||
_immoltharGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HIGHBORNE_SUMMONER:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
creature->DespawnOrUnsummon(5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_IMMOL_THAR:
|
||||
_immoltharGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HIGHBORNE_SUMMONER:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
creature->DespawnOrUnsummon(5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_DIRE_MAUL_FORCE_FIELD:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_GORDOK_TRIBUTE:
|
||||
{
|
||||
uint32 fullLootMode = 0x3F;
|
||||
for (uint32 i = 0; i < _northWingBosses; ++i)
|
||||
fullLootMode >>= 1;
|
||||
void OnGameObjectCreate(GameObject* gameobject)
|
||||
{
|
||||
switch (gameobject->GetEntry())
|
||||
{
|
||||
case GO_DIRE_MAUL_FORCE_FIELD:
|
||||
if (_pylonsState == ALL_PYLONS_OFF)
|
||||
gameobject->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_GORDOK_TRIBUTE:
|
||||
{
|
||||
uint32 fullLootMode = 0x3F;
|
||||
for (uint32 i = 0; i < _northWingBosses; ++i)
|
||||
fullLootMode >>= 1;
|
||||
|
||||
gameobject->SetLootMode(fullLootMode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
gameobject->SetLootMode(fullLootMode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_EAST_WING_PROGRESS:
|
||||
_eastWingProgress = data;
|
||||
instance->LoadGrid(-56.59f, -269.12f);
|
||||
break;
|
||||
case TYPE_WEST_WING_PROGRESS:
|
||||
_westWingProgress = data;
|
||||
instance->LoadGrid(132.626f, 625.913f);
|
||||
break;
|
||||
case TYPE_NORTH_WING_PROGRESS:
|
||||
_northWingProgress = data;
|
||||
break;
|
||||
case TYPE_NORTH_WING_BOSSES:
|
||||
_northWingBosses |= (1 << _northWingBosses);
|
||||
break;
|
||||
case TYPE_PYLONS_STATE:
|
||||
if (_pylonsState & data)
|
||||
return;
|
||||
_pylonsState |= data;
|
||||
if (_pylonsState == ALL_PYLONS_OFF) // all five active, 31
|
||||
{
|
||||
instance->LoadGrid(-38.08f, 812.44f);
|
||||
if (Creature* immol = instance->GetCreature(_immoltharGUID))
|
||||
{
|
||||
immol->setActive(true);
|
||||
immol->GetAI()->SetData(1, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_EAST_WING_PROGRESS:
|
||||
_eastWingProgress = data;
|
||||
instance->LoadGrid(-56.59f, -269.12f);
|
||||
break;
|
||||
case TYPE_WEST_WING_PROGRESS:
|
||||
_westWingProgress = data;
|
||||
instance->LoadGrid(132.626f, 625.913f);
|
||||
break;
|
||||
case TYPE_NORTH_WING_PROGRESS:
|
||||
_northWingProgress = data;
|
||||
break;
|
||||
case TYPE_NORTH_WING_BOSSES:
|
||||
_northWingBosses |= (1 << _northWingBosses);
|
||||
break;
|
||||
case TYPE_PYLONS_STATE:
|
||||
if (_pylonsState & data)
|
||||
return;
|
||||
_pylonsState |= data;
|
||||
if (_pylonsState == ALL_PYLONS_OFF) // all five active, 31
|
||||
{
|
||||
instance->LoadGrid(-38.08f, 812.44f);
|
||||
if (Creature* immol = instance->GetCreature(_immoltharGUID))
|
||||
{
|
||||
immol->setActive(true);
|
||||
immol->GetAI()->SetData(1, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SaveToDB();
|
||||
}
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == TYPE_EAST_WING_PROGRESS)
|
||||
return _eastWingProgress;
|
||||
else if (type == TYPE_WEST_WING_PROGRESS)
|
||||
return _westWingProgress;
|
||||
else if (type == TYPE_NORTH_WING_PROGRESS)
|
||||
return _northWingProgress;
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == TYPE_EAST_WING_PROGRESS)
|
||||
return _eastWingProgress;
|
||||
else if (type == TYPE_WEST_WING_PROGRESS)
|
||||
return _westWingProgress;
|
||||
else if (type == TYPE_NORTH_WING_PROGRESS)
|
||||
return _northWingProgress;
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D M " << _eastWingProgress << ' ' << _westWingProgress << ' ' << _pylonsState << ' ' << _northWingProgress << ' ' << _northWingBosses;
|
||||
return saveStream.str();
|
||||
}
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D M " << _eastWingProgress << ' ' << _westWingProgress << ' ' << _pylonsState << ' ' << _northWingProgress << ' ' << _northWingBosses;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'D' && dataHead2 == 'M')
|
||||
{
|
||||
loadStream >> _eastWingProgress;
|
||||
loadStream >> _westWingProgress;
|
||||
loadStream >> _pylonsState;
|
||||
loadStream >> _northWingProgress;
|
||||
loadStream >> _northWingBosses;
|
||||
}
|
||||
}
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'D' && dataHead2 == 'M')
|
||||
{
|
||||
loadStream >> _eastWingProgress;
|
||||
loadStream >> _westWingProgress;
|
||||
loadStream >> _pylonsState;
|
||||
loadStream >> _northWingProgress;
|
||||
loadStream >> _northWingBosses;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _eastWingProgress;
|
||||
uint32 _westWingProgress;
|
||||
uint32 _pylonsState;
|
||||
uint32 _northWingProgress;
|
||||
uint32 _northWingBosses;
|
||||
private:
|
||||
uint32 _eastWingProgress;
|
||||
uint32 _westWingProgress;
|
||||
uint32 _pylonsState;
|
||||
uint32 _northWingProgress;
|
||||
uint32 _northWingBosses;
|
||||
|
||||
uint64 _immoltharGUID;
|
||||
};
|
||||
uint64 _immoltharGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_dire_maul_InstanceMapScript(map);
|
||||
}
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_dire_maul_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_dire_maul()
|
||||
|
||||
Reference in New Issue
Block a user