Ported .Net Core commits:

hondacrx:
- Initial commit: Switch to .Net Core 2.0
- Fix build and removed not needed files
Fabi:
- Updated solution platforms.
- Changed folder structure.
- Change library target framework to netstandard2.0.
- Updated solution platforms again...
- Removed windows specific kernel32 function usage (Ctrl-C handler).
This commit is contained in:
Fabian
2017-10-26 17:23:44 +02:00
parent 227702e19c
commit a3dc7b3f48
844 changed files with 26064 additions and 1824 deletions
+111
View File
@@ -0,0 +1,111 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.Entities;
using Game.Network.Packets;
namespace Game.Arenas
{
public class BladesEdgeArena : Arena
{
public override void StartingEventCloseDoors()
{
for (int i = BladeEdgeObjectTypes.Door1; i <= BladeEdgeObjectTypes.Door4; ++i)
SpawnBGObject(i, BattlegroundConst.RespawnImmediately);
for (int i = BladeEdgeObjectTypes.Buff1; i <= BladeEdgeObjectTypes.Buff2; ++i)
SpawnBGObject(i, BattlegroundConst.RespawnOneDay);
}
public override void StartingEventOpenDoors()
{
for (int i = BladeEdgeObjectTypes.Door1; i <= BladeEdgeObjectTypes.Door4; ++i)
DoorOpen(i);
for (int i = BladeEdgeObjectTypes.Buff1; i <= BladeEdgeObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
}
public override void HandleAreaTrigger(Player player, uint trigger, bool entered)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
switch (trigger)
{
case 4538: // buff trigger?
case 4539: // buff trigger?
break;
default:
base.HandleAreaTrigger(player, trigger, entered);
break;
}
}
public override void FillInitialWorldStates(InitWorldStates packet)
{
packet.AddState(0x9f3, 1);
base.FillInitialWorldStates(packet);
}
public override bool SetupBattleground()
{
bool result = true;
result &= AddObject(BladeEdgeObjectTypes.Door1, BladeEfgeGameObjects.Door1, 6287.277f, 282.1877f, 3.810925f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, BattlegroundConst.RespawnImmediately);
result &= AddObject(BladeEdgeObjectTypes.Door2, BladeEfgeGameObjects.Door2, 6189.546f, 241.7099f, 3.101481f, 0.8813917f, 0, 0, 0.4265689f, 0.9044551f, BattlegroundConst.RespawnImmediately);
result &= AddObject(BladeEdgeObjectTypes.Door3, BladeEfgeGameObjects.Door3, 6299.116f, 296.5494f, 3.308032f, 0.8813917f, 0, 0, 0.4265689f, 0.9044551f, BattlegroundConst.RespawnImmediately);
result &= AddObject(BladeEdgeObjectTypes.Door4, BladeEfgeGameObjects.Door4, 6177.708f, 227.3481f, 3.604374f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, BattlegroundConst.RespawnImmediately);
if (!result)
{
Log.outError(LogFilter.Sql, "BatteGroundBE: Failed to spawn door object!");
return false;
}
result &= AddObject(BladeEdgeObjectTypes.Buff1, BladeEfgeGameObjects.Buff1, 6249.042f, 275.3239f, 11.22033f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120);
result &= AddObject(BladeEdgeObjectTypes.Buff2, BladeEfgeGameObjects.Buff2, 6228.26f, 249.566f, 11.21812f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120);
if (!result)
{
Log.outError(LogFilter.Sql, "BladesEdgeArena: Failed to spawn buff object!");
return false;
}
return true;
}
}
struct BladeEdgeObjectTypes
{
public const int Door1 = 0;
public const int Door2 = 1;
public const int Door3 = 2;
public const int Door4 = 3;
public const int Buff1 = 4;
public const int Buff2 = 5;
public const int Max = 6;
}
struct BladeEfgeGameObjects
{
public const uint Door1 = 183971;
public const uint Door2 = 183973;
public const uint Door3 = 183970;
public const uint Door4 = 183972;
public const uint Buff1 = 184663;
public const uint Buff2 = 184664;
}
}
+241
View File
@@ -0,0 +1,241 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Framework.Dynamic;
using Game.Entities;
using Game.Network.Packets;
namespace Game.Arenas
{
class DalaranSewersArena : Arena
{
public DalaranSewersArena()
{
_events = new EventMap();
}
public override void StartingEventCloseDoors()
{
for (int i = DalaranSewersObjectTypes.Door1; i <= DalaranSewersObjectTypes.Door2; ++i)
SpawnBGObject(i, BattlegroundConst.RespawnImmediately);
}
public override void StartingEventOpenDoors()
{
for (int i = DalaranSewersObjectTypes.Door1; i <= DalaranSewersObjectTypes.Door2; ++i)
DoorOpen(i);
for (int i = DalaranSewersObjectTypes.Buff1; i <= DalaranSewersObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, RandomHelper.URand(DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax));
_events.ScheduleEvent(DalaranSewersEvents.PipeKnockback, DalaranSewersData.PipeKnockbackFirstDelay);
SpawnBGObject(DalaranSewersObjectTypes.Water2, BattlegroundConst.RespawnImmediately);
DoorOpen(DalaranSewersObjectTypes.Water1); // Turn off collision
DoorOpen(DalaranSewersObjectTypes.Water2);
// Remove effects of Demonic Circle Summon
foreach (var pair in GetPlayers())
{
Player player = _GetPlayer(pair, "BattlegroundDS::StartingEventOpenDoors");
if (player)
player.RemoveAurasDueToSpell(DalaranSewersSpells.DemonicCircle);
}
}
public override void HandleAreaTrigger(Player player, uint trigger, bool entered)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
switch (trigger)
{
case 5347:
case 5348:
// Remove effects of Demonic Circle Summon
player.RemoveAurasDueToSpell(DalaranSewersSpells.DemonicCircle);
// Someone has get back into the pipes and the knockback has already been performed,
// so we reset the knockback count for kicking the player again into the arena.
_events.ScheduleEvent(DalaranSewersEvents.PipeKnockback, DalaranSewersData.PipeKnockbackDelay);
break;
default:
base.HandleAreaTrigger(player, trigger, entered);
break;
}
}
public override void FillInitialWorldStates(InitWorldStates packet)
{
packet.AddState(3610, 1);
base.FillInitialWorldStates(packet);
}
public override bool SetupBattleground()
{
bool result = true;
result &= AddObject(DalaranSewersObjectTypes.Door1, DalaranSewersGameObjects.Door1, 1350.95f, 817.2f, 20.8096f, 3.15f, 0, 0, 0.99627f, 0.0862864f, BattlegroundConst.RespawnImmediately);
result &= AddObject(DalaranSewersObjectTypes.Door2, DalaranSewersGameObjects.Door2, 1232.65f, 764.913f, 20.0729f, 6.3f, 0, 0, 0.0310211f, -0.999519f, BattlegroundConst.RespawnImmediately);
if (!result)
{
Log.outError(LogFilter.Sql, "DalaranSewersArena: Failed to spawn door object!");
return false;
}
// buffs
result &= AddObject(DalaranSewersObjectTypes.Buff1, DalaranSewersGameObjects.Buff1, 1291.7f, 813.424f, 7.11472f, 4.64562f, 0, 0, 0.730314f, -0.683111f, 120);
result &= AddObject(DalaranSewersObjectTypes.Buff2, DalaranSewersGameObjects.Buff2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f, 120);
if (!result)
{
Log.outError(LogFilter.Sql, "DalaranSewersArena: Failed to spawn buff object!");
return false;
}
result &= AddObject(DalaranSewersObjectTypes.Water1, DalaranSewersGameObjects.Water1, 1291.56f, 790.837f, 7.1f, 3.14238f, 0, 0, 0.694215f, -0.719768f, 120);
result &= AddObject(DalaranSewersObjectTypes.Water2, DalaranSewersGameObjects.Water2, 1291.56f, 790.837f, 7.1f, 3.14238f, 0, 0, 0.694215f, -0.719768f, 120);
result &= AddCreature(DalaranSewersData.NpcWaterSpout, DalaranSewersCreatureTypes.WaterfallKnockback, 1292.587f, 790.2205f, 7.19796f, 3.054326f, TeamId.Neutral, BattlegroundConst.RespawnImmediately);
result &= AddCreature(DalaranSewersData.NpcWaterSpout, DalaranSewersCreatureTypes.PipeKnockback1, 1369.977f, 817.2882f, 16.08718f, 3.106686f, TeamId.Neutral, BattlegroundConst.RespawnImmediately);
result &= AddCreature(DalaranSewersData.NpcWaterSpout, DalaranSewersCreatureTypes.PipeKnockback2, 1212.833f, 765.3871f, 16.09484f, 0.0f, TeamId.Neutral, BattlegroundConst.RespawnImmediately);
if (!result)
{
Log.outError(LogFilter.Sql, "DalaranSewersArena: Failed to spawn collision object!");
return false;
}
return true;
}
public override void PostUpdateImpl(uint diff)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
_events.ExecuteEvents(eventId =>
{
switch (eventId)
{
case DalaranSewersEvents.WaterfallWarning:
// Add the water
DoorClose(DalaranSewersObjectTypes.Water2);
_events.ScheduleEvent(DalaranSewersEvents.WaterfallOn, DalaranSewersData.WaterWarningDuration);
break;
case DalaranSewersEvents.WaterfallOn:
// Active collision and start knockback timer
DoorClose(DalaranSewersObjectTypes.Water1);
_events.ScheduleEvent(DalaranSewersEvents.WaterfallOff, DalaranSewersData.WaterfallDuration);
_events.ScheduleEvent(DalaranSewersEvents.WaterfallKnockback, DalaranSewersData.WaterfallKnockbackTimer);
break;
case DalaranSewersEvents.WaterfallOff:
// Remove collision and water
DoorOpen(DalaranSewersObjectTypes.Water1);
DoorOpen(DalaranSewersObjectTypes.Water2);
_events.CancelEvent(DalaranSewersEvents.WaterfallKnockback);
_events.ScheduleEvent(DalaranSewersEvents.WaterfallWarning, RandomHelper.URand(DalaranSewersData.WaterfallTimerMin, DalaranSewersData.WaterfallTimerMax));
break;
case DalaranSewersEvents.WaterfallKnockback:
{
// Repeat knockback while the waterfall still active
Creature waterSpout = GetBGCreature(DalaranSewersCreatureTypes.WaterfallKnockback);
if (waterSpout)
waterSpout.CastSpell(waterSpout, DalaranSewersSpells.WaterSpout, true);
_events.ScheduleEvent(eventId, DalaranSewersData.WaterfallKnockbackTimer);
}
break;
case DalaranSewersEvents.PipeKnockback:
{
for (int i = DalaranSewersCreatureTypes.PipeKnockback1; i <= DalaranSewersCreatureTypes.PipeKnockback2; ++i)
{
Creature waterSpout = GetBGCreature(i);
if (waterSpout)
waterSpout.CastSpell(waterSpout, DalaranSewersSpells.Flush, true);
}
}
break;
}
});
}
EventMap _events;
}
struct DalaranSewersEvents
{
public const int WaterfallWarning = 1; // Water starting to fall, but no LoS Blocking nor movement blocking
public const uint WaterfallOn = 2; // LoS and Movement blocking active
public const uint WaterfallOff = 3;
public const uint WaterfallKnockback = 4;
public const uint PipeKnockback = 5;
}
struct DalaranSewersObjectTypes
{
public const int Door1 = 0;
public const int Door2 = 1;
public const int Water1 = 2; // Collision
public const int Water2 = 3;
public const int Buff1 = 4;
public const int Buff2 = 5;
public const int Max = 6;
}
struct DalaranSewersGameObjects
{
public const uint Door1 = 192642;
public const uint Door2 = 192643;
public const uint Water1 = 194395; // Collision
public const uint Water2 = 191877;
public const uint Buff1 = 184663;
public const uint Buff2 = 184664;
}
struct DalaranSewersCreatureTypes
{
public const int WaterfallKnockback = 0;
public const int PipeKnockback1 = 1;
public const int PipeKnockback2 = 2;
public const int Max = 3;
}
struct DalaranSewersData
{
// These values are NOT blizzlike... need the correct data!
public const uint WaterfallTimerMin = 30000;
public const uint WaterfallTimerMax = 60000;
public const uint WaterWarningDuration = 5000;
public const uint WaterfallDuration = 30000;
public const uint WaterfallKnockbackTimer = 1500;
public const uint PipeKnockbackFirstDelay = 5000;
public const uint PipeKnockbackDelay = 3000;
public const uint PipeKnockbackTotalCount = 2;
public const uint NpcWaterSpout = 28567;
}
struct DalaranSewersSpells
{
public const uint Flush = 57405; // Visual And Target Selector For The Starting Knockback From The Pipe
public const uint FlushKnockback = 61698; // Knockback Effect For Previous Spell (Triggered, Not Needed To Be Cast)
public const uint WaterSpout = 58873; // Knockback Effect Of The Central Waterfall
public const uint DemonicCircle = 48018; // Demonic Circle Summon
}
}
+108
View File
@@ -0,0 +1,108 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.Entities;
using Game.Network.Packets;
namespace Game.Arenas
{
public class NagrandArena : Arena
{
public override void StartingEventCloseDoors()
{
for (int i = NagrandArenaObjectTypes.Door1; i <= NagrandArenaObjectTypes.Door4; ++i)
SpawnBGObject(i, BattlegroundConst.RespawnImmediately);
}
public override void StartingEventOpenDoors()
{
for (int i = NagrandArenaObjectTypes.Door1; i <= NagrandArenaObjectTypes.Door4; ++i)
DoorOpen(i);
for (int i = NagrandArenaObjectTypes.Buff1; i <= NagrandArenaObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
}
public override void HandleAreaTrigger(Player player, uint trigger, bool entered)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
switch (trigger)
{
case 4536: // buff trigger?
case 4537: // buff trigger?
break;
default:
base.HandleAreaTrigger(player, trigger, entered);
break;
}
}
public override void FillInitialWorldStates(InitWorldStates packet)
{
packet.AddState(0xa11, 1);
base.FillInitialWorldStates(packet);
}
public override bool SetupBattleground()
{
bool result = true;
result &= AddObject(NagrandArenaObjectTypes.Door1, NagrandArenaObjects.Door1, 4031.854f, 2966.833f, 12.6462f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, BattlegroundConst.RespawnImmediately);
result &= AddObject(NagrandArenaObjectTypes.Door2, NagrandArenaObjects.Door2, 4081.179f, 2874.97f, 12.39171f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, BattlegroundConst.RespawnImmediately);
result &= AddObject(NagrandArenaObjectTypes.Door3, NagrandArenaObjects.Door3, 4023.709f, 2981.777f, 10.70117f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, BattlegroundConst.RespawnImmediately);
result &= AddObject(NagrandArenaObjectTypes.Door4, NagrandArenaObjects.Door4, 4090.064f, 2858.438f, 10.23631f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, BattlegroundConst.RespawnImmediately);
if (!result)
{
Log.outError(LogFilter.Sql, "NagrandArena: Failed to spawn door object!");
return false;
}
result &= AddObject(NagrandArenaObjectTypes.Buff1, NagrandArenaObjects.Buff1, 4009.189941f, 2895.250000f, 13.052700f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120);
result &= AddObject(NagrandArenaObjectTypes.Buff2, NagrandArenaObjects.Buff2, 4103.330078f, 2946.350098f, 13.051300f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120);
if (!result)
{
Log.outError(LogFilter.Sql, "NagrandArena: Failed to spawn buff object!");
return false;
}
return true;
}
}
struct NagrandArenaObjectTypes
{
public const int Door1 = 0;
public const int Door2 = 1;
public const int Door3 = 2;
public const int Door4 = 3;
public const int Buff1 = 4;
public const int Buff2 = 5;
public const int Max = 6;
}
struct NagrandArenaObjects
{
public const uint Door1 = 183978;
public const uint Door2 = 183980;
public const uint Door3 = 183977;
public const uint Door4 = 183979;
public const uint Buff1 = 184663;
public const uint Buff2 = 184664;
}
}
+264
View File
@@ -0,0 +1,264 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Framework.Dynamic;
using Game.Entities;
using Game.Network.Packets;
namespace Game.Arenas
{
class RingofValorArena : Arena
{
public RingofValorArena()
{
_events = new EventMap();
}
public override bool SetupBattleground()
{
bool result = true;
result &= AddObject(RingofValorObjectTypes.Elevator1, RingofValorGameObjects.Elevator1, 763.536377f, -294.535767f, 0.505383f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Elevator2, RingofValorGameObjects.Elevator2, 763.506348f, -273.873352f, 0.505383f, 0.000000f, 0, 0, 0, 0);
if (!result)
{
Log.outError(LogFilter.Sql, "RingofValorArena: Failed to spawn elevator object!");
return false;
}
result &= AddObject(RingofValorObjectTypes.Buff1, RingofValorGameObjects.Buff1, 735.551819f, -284.794678f, 28.276682f, 0.034906f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Buff2, RingofValorGameObjects.Buff2, 791.224487f, -284.794464f, 28.276682f, 2.600535f, 0, 0, 0, 0);
if (!result)
{
Log.outError(LogFilter.Sql, "RingofValorArena: Failed to spawn buff object!");
return false;
}
result &= AddObject(RingofValorObjectTypes.Fire1, RingofValorGameObjects.Fire1, 743.543457f, -283.799469f, 28.286655f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Fire2, RingofValorGameObjects.Fire2, 782.971802f, -283.799469f, 28.286655f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Firedoor1, RingofValorGameObjects.Firedoor1, 743.711060f, -284.099609f, 27.542587f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Firedoor2, RingofValorGameObjects.Firedoor2, 783.221252f, -284.133362f, 27.535686f, 0.000000f, 0, 0, 0, 0);
if (!result)
{
Log.outError(LogFilter.Sql, "RingofValorArena: Failed to spawn fire/firedoor object!");
return false;
}
result &= AddObject(RingofValorObjectTypes.Gear1, RingofValorGameObjects.Gear1, 763.664551f, -261.872986f, 26.686588f, 0.000000f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Gear2, RingofValorGameObjects.Gear2, 763.578979f, -306.146149f, 26.665222f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Pulley1, RingofValorGameObjects.Pulley1, 700.722290f, -283.990662f, 39.517582f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Pulley2, RingofValorGameObjects.Pulley2, 826.303833f, -283.996429f, 39.517582f, 0.000000f, 0, 0, 0, 0);
if (!result)
{
Log.outError(LogFilter.Sql, "RingofValorArena: Failed to spawn gear/pully object!");
return false;
}
result &= AddObject(RingofValorObjectTypes.Pilar1, RingofValorGameObjects.Pilar1, 763.632385f, -306.162384f, 25.909504f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Pilar2, RingofValorGameObjects.Pilar2, 723.644287f, -284.493256f, 24.648525f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Pilar3, RingofValorGameObjects.Pilar3, 763.611145f, -261.856750f, 25.909504f, 0.000000f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.Pilar4, RingofValorGameObjects.Pilar4, 802.211609f, -284.493256f, 24.648525f, 0.000000f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.PilarCollision1, RingofValorGameObjects.PilarCollision1, 763.632385f, -306.162384f, 30.639660f, 3.141593f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.PilarCollision2, RingofValorGameObjects.PilarCollision2, 723.644287f, -284.493256f, 32.382710f, 0.000000f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.PilarCollision3, RingofValorGameObjects.PilarCollision3, 763.611145f, -261.856750f, 30.639660f, 0.000000f, 0, 0, 0, 0);
result &= AddObject(RingofValorObjectTypes.PilarCollision4, RingofValorGameObjects.PilarCollision4, 802.211609f, -284.493256f, 32.382710f, 3.141593f, 0, 0, 0, 0);
if (!result)
{
Log.outError(LogFilter.Sql, "RingofValorArena: Failed to spawn pilar object!");
return false;
}
return true;
}
public override void StartingEventOpenDoors()
{
// Buff respawn
SpawnBGObject(RingofValorObjectTypes.Buff1, 90);
SpawnBGObject(RingofValorObjectTypes.Buff2, 90);
// Elevators
DoorOpen(RingofValorObjectTypes.Elevator1);
DoorOpen(RingofValorObjectTypes.Elevator2);
_events.ScheduleEvent(RingofValorEvents.OpenFences, 20133);
// Should be false at first, TogglePillarCollision will do it.
TogglePillarCollision(true);
}
public override void HandleAreaTrigger(Player player, uint trigger, bool entered)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
switch (trigger)
{
case 5224:
case 5226:
// fire was removed in 3.2.0
case 5473:
case 5474:
break;
default:
base.HandleAreaTrigger(player, trigger, entered);
break;
}
}
public override void FillInitialWorldStates(InitWorldStates packet)
{
packet.AddState(0xe1a, 1);
base.FillInitialWorldStates(packet);
}
public override void PostUpdateImpl(uint diff)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
_events.Update(diff);
_events.ExecuteEvents(eventId =>
{
switch (eventId)
{
case RingofValorEvents.OpenFences:
// Open fire (only at game start)
for (byte i = RingofValorObjectTypes.Fire1; i <= RingofValorObjectTypes.Firedoor2; ++i)
DoorOpen(i);
_events.ScheduleEvent(RingofValorEvents.CloseFire, 5000);
break;
case RingofValorEvents.CloseFire:
for (byte i = RingofValorObjectTypes.Fire1; i <= RingofValorObjectTypes.Firedoor2; ++i)
DoorClose(i);
// Fire got closed after five seconds, leaves twenty seconds before toggling pillars
_events.ScheduleEvent(RingofValorEvents.SwitchPillars, 20000);
break;
case RingofValorEvents.SwitchPillars:
TogglePillarCollision(true);
_events.Repeat(25000);
break;
}
});
}
void TogglePillarCollision(bool enable)
{
// Toggle visual pillars, pulley, gear, and collision based on previous state
for (int i = RingofValorObjectTypes.Pilar1; i <= RingofValorObjectTypes.Gear2; ++i)
{
if (enable)
DoorOpen(i);
else
DoorClose(i);
}
for (byte i = RingofValorObjectTypes.Pilar2; i <= RingofValorObjectTypes.Pulley2; ++i)
{
if (enable)
DoorClose(i);
else
DoorOpen(i);
}
for (byte i = RingofValorObjectTypes.Pilar1; i <= RingofValorObjectTypes.PilarCollision4; ++i)
{
GameObject go = GetBGObject(i);
if (go)
{
if (i >= RingofValorObjectTypes.PilarCollision1)
{
GameObjectState state = ((go.GetGoInfo().Door.startOpen != 0) == enable) ? GameObjectState.Active : GameObjectState.Ready;
go.SetGoState(state);
}
foreach (var guid in GetPlayers().Keys)
{
Player player = Global.ObjAccessor.FindPlayer(guid);
if (player)
go.SendUpdateToPlayer(player);
}
}
}
}
EventMap _events;
}
struct RingofValorEvents
{
public const int OpenFences = 0;
public const int SwitchPillars = 1;
public const int CloseFire = 2;
}
struct RingofValorObjectTypes
{
public const int Buff1 = 1;
public const int Buff2 = 2;
public const int Fire1 = 3;
public const int Fire2 = 4;
public const int Firedoor1 = 5;
public const int Firedoor2 = 6;
public const int Pilar1 = 7;
public const int Pilar3 = 8;
public const int Gear1 = 9;
public const int Gear2 = 10;
public const int Pilar2 = 11;
public const int Pilar4 = 12;
public const int Pulley1 = 13;
public const int Pulley2 = 14;
public const int PilarCollision1 = 15;
public const int PilarCollision2 = 16;
public const int PilarCollision3 = 17;
public const int PilarCollision4 = 18;
public const int Elevator1 = 19;
public const int Elevator2= 20;
public const int Max = 21;
}
struct RingofValorGameObjects
{
public const uint Buff1 = 184663;
public const uint Buff2 = 184664;
public const uint Fire1 = 192704;
public const uint Fire2 = 192705;
public const uint Firedoor2 = 192387;
public const uint Firedoor1 = 192388;
public const uint Pulley1 = 192389;
public const uint Pulley2 = 192390;
public const uint Gear1 = 192393;
public const uint Gear2 = 192394;
public const uint Elevator1 = 194582;
public const uint Elevator2 = 194586;
public const uint PilarCollision1 = 194580; // Axe
public const uint PilarCollision2 = 194579; // Arena
public const uint PilarCollision3 = 194581; // Lightning
public const uint PilarCollision4 = 194578; // Ivory
public const uint Pilar1 = 194583; // Axe
public const uint Pilar2 = 194584; // Arena
public const uint Pilar3 = 194585; // Lightning
public const uint Pilar4 = 194587; // Ivory
}
}
@@ -0,0 +1,102 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.Entities;
using Game.Network.Packets;
namespace Game.Arenas
{
class RuinsofLordaeronArena : Arena
{
public override bool SetupBattleground()
{
bool result = true;
result &= AddObject(RuinsofLordaeronObjectTypes.Door1, RuinsofLordaeronObjectTypes.Door1, 1293.561f, 1601.938f, 31.60557f, -1.457349f, 0, 0, -0.6658813f, 0.7460576f);
result &= AddObject(RuinsofLordaeronObjectTypes.Door2, RuinsofLordaeronObjectTypes.Door2, 1278.648f, 1730.557f, 31.60557f, 1.684245f, 0, 0, 0.7460582f, 0.6658807f);
if (!result)
{
Log.outError(LogFilter.Sql, "RuinsofLordaeronArena: Failed to spawn door object!");
return false;
}
result &= AddObject(RuinsofLordaeronObjectTypes.Buff1, RuinsofLordaeronObjectTypes.Buff1, 1328.719971f, 1632.719971f, 36.730400f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120);
result &= AddObject(RuinsofLordaeronObjectTypes.Buff2, RuinsofLordaeronObjectTypes.Buff2, 1243.300049f, 1699.170044f, 34.872601f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120);
if (!result)
{
Log.outError(LogFilter.Sql, "RuinsofLordaeronArena: Failed to spawn buff object!");
return false;
}
return true;
}
public override void StartingEventCloseDoors()
{
for (int i = RuinsofLordaeronObjectTypes.Door1; i <= RuinsofLordaeronObjectTypes.Door2; ++i)
SpawnBGObject(i, BattlegroundConst.RespawnImmediately);
}
public override void StartingEventOpenDoors()
{
for (int i = RuinsofLordaeronObjectTypes.Door1; i <= RuinsofLordaeronObjectTypes.Door2; ++i)
DoorOpen(i);
for (int i = RuinsofLordaeronObjectTypes.Buff1; i <= RuinsofLordaeronObjectTypes.Buff2; ++i)
SpawnBGObject(i, 60);
}
public override void HandleAreaTrigger(Player player, uint trigger, bool entered)
{
if (GetStatus() != BattlegroundStatus.InProgress)
return;
switch (trigger)
{
case 4696: // buff trigger?
case 4697: // buff trigger?
break;
default:
base.HandleAreaTrigger(player, trigger, entered);
break;
}
}
public override void FillInitialWorldStates(InitWorldStates packet)
{
packet.AddState(0xbba, 1);
base.FillInitialWorldStates(packet);
}
}
struct RuinsofLordaeronObjectTypes
{
public const int Door1 = 0;
public const int Door2 = 1;
public const int Buff1 = 2;
public const int Buff2 = 3;
public const int Max = 4;
}
struct RuinsofLordaeronGameObjects
{
public const uint Door1 = 185918;
public const uint Door2 = 185917;
public const uint Buff1 = 184663;
public const uint Buff2 = 184664;
}
}
+23
View File
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Game.Arenas
{
class TigersPeak
{
}
}
+23
View File
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Game.Arenas
{
class TolvironArena
{
}
}