Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From fafc1961c248391e9c64a90078205a3bfa716167 Mon Sep 17 00:00:00 2001
- From: fateswhisper <[email protected]>
- Date: Wed, 16 Apr 2014 16:07:10 +0400
- Subject: [PATCH] Implementation 1vs1 arena
- ---
- .../2014-04-16 characters_arena_1_v_1.sql | 2 +
- .../world/2014-04-16-00 world.sai.sql | 76 +++++
- .../world/2014-04-16-01 world.creature.sql | 2 +
- .../world/2014_04_16_00_world_sai.sql | 76 -----
- src/server/game/Battlegrounds/ArenaTeam.cpp | 4 +-
- src/server/game/Battlegrounds/ArenaTeam.h | 2 +-
- src/server/game/Battlegrounds/Battleground.cpp | 5 +
- src/server/game/Battlegrounds/Battleground.h | 2 +-
- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +-
- .../game/Battlegrounds/BattlegroundQueue.cpp | 2 +
- src/server/game/Entities/Player/Player.cpp | 1 +
- src/server/game/Handlers/BattleGroundHandler.cpp | 5 +
- src/server/game/Handlers/PetitionsHandler.cpp | 4 +-
- src/server/game/Scripting/ScriptLoader.cpp | 2 +
- src/server/game/World/World.cpp | 8 +
- src/server/game/World/World.h | 7 +
- src/server/scripts/Custom/CMakeLists.txt | 2 +
- src/server/scripts/Custom/npc_arena1v1.cpp | 309 +++++++++++++++++++++
- src/server/scripts/Custom/npc_arena1v1.h | 69 +++++
- src/server/worldserver/worldserver.conf.dist | 65 +++++
- 20 files changed, 564 insertions(+), 81 deletions(-)
- create mode 100644 sql/updates aztec/characters/2014-04-16 characters_arena_1_v_1.sql
- create mode 100644 sql/updates aztec/world/2014-04-16-00 world.sai.sql
- create mode 100644 sql/updates aztec/world/2014-04-16-01 world.creature.sql
- delete mode 100644 sql/updates aztec/world/2014_04_16_00_world_sai.sql
- create mode 100644 src/server/scripts/Custom/npc_arena1v1.cpp
- create mode 100644 src/server/scripts/Custom/npc_arena1v1.h
- diff --git a/sql/updates aztec/characters/2014-04-16 characters_arena_1_v_1.sql b/sql/updates aztec/characters/2014-04-16 characters_arena_1_v_1.sql
- new file mode 100644
- index 0000000..9f6e4a4
- --- /dev/null
- +++ b/sql/updates aztec/characters/2014-04-16 characters_arena_1_v_1.sql
- @@ -0,0 +1,2 @@
- +-- Delete all 5v5 teams and members (core will crash if any 5v5 team exist)
- +DELETE arena_team_member, arena_team FROM arena_team_member, arena_team WHERE arena_team_member.arenaTeamId = arena_team.arenaTeamId AND arena_team.type = 5;
- diff --git a/sql/updates aztec/world/2014-04-16-00 world.sai.sql b/sql/updates aztec/world/2014-04-16-00 world.sai.sql
- new file mode 100644
- index 0000000..7f0c476
- --- /dev/null
- +++ b/sql/updates aztec/world/2014-04-16-00 world.sai.sql
- @@ -0,0 +1,76 @@
- +-- Runes of Compulsion (Quest: 12093)
- +SET @RUNEWEAVER := 26820; -- Iron Rune-Weaver
- +SET @RUNE := 26785; -- Directional Rune
- +SET @DR1 := 188471; -- Directional Rune 1
- +SET @DR2 := 188505; -- Directional Rune 2
- +SET @DR3 := 188506; -- Directional Rune 3
- +SET @DR4 := 188507; -- Directional Rune 4
- +SET @OD := 26920; -- Overseer Durval
- +SET @OK := 26921; -- Overseer Korgan
- +SET @OL := 26922; -- Overseer Lochli
- +SET @OB := 26923; -- Overseer Brunon
- +
- +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@RUNEWEAVER, @RUNE, @OD, @OK, @OL, @OB);
- +UPDATE `creature_template` SET `faction_A`=1954, `faction_H`=1954 WHERE `entry` IN (@OD, @OK, @OL, @OB);
- +UPDATE `gameobject_template` SET `flags`=16 WHERE `entry` IN (@DR1, @DR2, @DR3, @DR4);
- +
- +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@RUNEWEAVER, @RUNE, @OD, @OK, @OL, @OB);
- +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@RUNE*100);
- +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
- +(@RUNEWEAVER, 0, 0, 1, 1, 0, 100, 1, 1000, 1000, 1000, 1000, 11, 47463, 2, 0, 0, 0, 0, 11, @RUNE, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Channel Rune-Weaver Channel on Directional Rune'),
- +(@RUNEWEAVER, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR1, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 1'),
- +(@RUNEWEAVER, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR2, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 2'),
- +(@RUNEWEAVER, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR3, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 3'),
- +(@RUNEWEAVER, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR4, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 4'),
- +(@RUNEWEAVER, 0, 5, 0, 25, 0, 100, 0, 0, 0, 0, 0, 45, 2, 1, 0, 0, 0, 0, 11, @RUNE, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On Reset - Set Data 2 1 on Directional Rune'),
- +(@RUNEWEAVER, 0, 6, 0, 0, 0, 100, 0, 4000, 7000, 10000, 16000, 11, 52713, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - Combat - Cast Rune Weaving on victim'),
- +(@RUNEWEAVER, 0, 7, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 11, @RUNE, 50, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On Death - Set Data 1 1 on Directional Rune'),
- +(@RUNE, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Directional Rune - On Data 1 1 - Increase Phase'),
- +(@RUNE, 0, 1, 0, 38, 0, 100, 0, 2, 1, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Directional Rune - On Data 2 1 - Reset to Phase 0'),
- +(@RUNE, 0, 2, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OD, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 4485.58, -4655.58, 77.65009, 3.228859, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Durval'),
- +(@RUNE, 0, 3, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OK, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 4317.391, -4882.59, 33.49857, 4.520403, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Korgan'),
- +(@RUNE, 0, 4, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OL, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 4215.784, -5049.129, 5.86421, 2.75762, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Lochli'),
- +(@RUNE, 0, 5, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OB, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 3986.997, -5246.744, 7.280532, 0.8901179, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Brunon'),
- +(@RUNE, 0, 6, 0, 60, 8, 100, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Directional Rune - On Update OOC in Phase 4 - Reset to Phase 0'),
- +(@OD, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Durval - On Just Summoned - Say'),
- +(@OD, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Durval - On Link - Cast Spawn - Blue Lightning'),
- +(@OD, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR1, 10, 0, 0, 0, 0, 0, 'Overseer Durval - On Link - Activate Directional Rune 1'),
- +(@OD, 0, 3, 0, 0, 0, 100, 0, 5000, 9000, 8000, 11000, 11, 52715, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Overseer Durval - In Combat - Cast Rune of Destruction'),
- +(@OK, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - On Just Summoned - Say'),
- +(@OK, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - On Link - Cast Spawn - Blue Lightning'),
- +(@OK, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR2, 10, 0, 0, 0, 0, 0, 'Overseer Korgan - On Link - Activate Directional Rune 2'),
- +(@OK, 0, 3, 0, 0, 0, 100, 0, 3000, 5000, 7000, 9000, 11, 32018, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - In Combat - Cast Call Lightning'),
- +(@OK, 0, 4, 0, 2, 0, 100, 0, 0, 30, 12000, 16000, 11, 52714, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - Between 0-30% Health - Cast Revitalizing Rune'),
- +(@OL, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Lochli - On Just Summoned - Say'),
- +(@OL, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Lochli - On Link - Cast Spawn - Blue Lightning'),
- +(@OL, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR3, 10, 0, 0, 0, 0, 0, 'Overseer Lochli - On Link - Activate Directional Rune 3'),
- +(@OL, 0, 3, 0, 0, 0, 100, 0, 8000, 12000, 11000, 15000, 11, 52717, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Lochli - In Combat - Cast Thunderstorm'),
- +(@OB, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Brunon - On Just Summoned - Say'),
- +(@OB, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Brunon - On Link - Cast Spawn - Blue Lightning'),
- +(@OB, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR4, 10, 0, 0, 0, 0, 0, 'Overseer Brunon - On Link - Activate Directional Rune 4');
- +
- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@RUNE;
- +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
- +(22, 3, @RUNE, 0, 0, 30, 1, @DR1, 5, 0, 0, 0, 0, '', 'Execute SAI id 2 only if within 5 yards of Directional Rune 1'),
- +(22, 4, @RUNE, 0, 0, 30, 1, @DR2, 5, 0, 0, 0, 0, '', 'Execute SAI id 3 only if within 5 yards of Directional Rune 2'),
- +(22, 5, @RUNE, 0, 0, 30, 1, @DR3, 5, 0, 0, 0, 0, '', 'Execute SAI id 4 only if within 5 yards of Directional Rune 3'),
- +(22, 6, @RUNE, 0, 0, 30, 1, @DR4, 5, 0, 0, 0, 0, '', 'Execute SAI id 5 only if within 5 yards of Directional Rune 4');
- +
- +DELETE FROM `creature_text` WHERE `entry` IN (@OD, @OK, @OL, @OB);
- +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
- +(@OD, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26090),
- +(@OD, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26091),
- +(@OD, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26092),
- +(@OD, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26089),
- +(@OK, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26090),
- +(@OK, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26091),
- +(@OK, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26092),
- +(@OK, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26089),
- +(@OL, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26090),
- +(@OL, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26091),
- +(@OL, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26092),
- +(@OL, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26089),
- +(@OB, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26090),
- +(@OB, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26091),
- +(@OB, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26092),
- +(@OB, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26089);
- \ No newline at end of file
- diff --git a/sql/updates aztec/world/2014-04-16-01 world.creature.sql b/sql/updates aztec/world/2014-04-16-01 world.creature.sql
- new file mode 100644
- index 0000000..876e9fd
- --- /dev/null
- +++ b/sql/updates aztec/world/2014-04-16-01 world.creature.sql
- @@ -0,0 +1,2 @@
- +UPDATE `creature_template` SET `name`='1v1 Arena', `subname`='Arena Battlemaster', `ScriptName`='npc_1v1arena' WHERE `entry`=50002;
- +UPDATE `creature` SET `position_x`=-1865.04, `position_y`=-4136.98, `position_z`=10.7252, `orientation`=5.4452 WHERE `guid`=213320;
- \ No newline at end of file
- diff --git a/sql/updates aztec/world/2014_04_16_00_world_sai.sql b/sql/updates aztec/world/2014_04_16_00_world_sai.sql
- deleted file mode 100644
- index 7f0c476..0000000
- --- a/sql/updates aztec/world/2014_04_16_00_world_sai.sql
- +++ /dev/null
- @@ -1,76 +0,0 @@
- --- Runes of Compulsion (Quest: 12093)
- -SET @RUNEWEAVER := 26820; -- Iron Rune-Weaver
- -SET @RUNE := 26785; -- Directional Rune
- -SET @DR1 := 188471; -- Directional Rune 1
- -SET @DR2 := 188505; -- Directional Rune 2
- -SET @DR3 := 188506; -- Directional Rune 3
- -SET @DR4 := 188507; -- Directional Rune 4
- -SET @OD := 26920; -- Overseer Durval
- -SET @OK := 26921; -- Overseer Korgan
- -SET @OL := 26922; -- Overseer Lochli
- -SET @OB := 26923; -- Overseer Brunon
- -
- -UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@RUNEWEAVER, @RUNE, @OD, @OK, @OL, @OB);
- -UPDATE `creature_template` SET `faction_A`=1954, `faction_H`=1954 WHERE `entry` IN (@OD, @OK, @OL, @OB);
- -UPDATE `gameobject_template` SET `flags`=16 WHERE `entry` IN (@DR1, @DR2, @DR3, @DR4);
- -
- -DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@RUNEWEAVER, @RUNE, @OD, @OK, @OL, @OB);
- -DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@RUNE*100);
- -INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
- -(@RUNEWEAVER, 0, 0, 1, 1, 0, 100, 1, 1000, 1000, 1000, 1000, 11, 47463, 2, 0, 0, 0, 0, 11, @RUNE, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Channel Rune-Weaver Channel on Directional Rune'),
- -(@RUNEWEAVER, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR1, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 1'),
- -(@RUNEWEAVER, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR2, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 2'),
- -(@RUNEWEAVER, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR3, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 3'),
- -(@RUNEWEAVER, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 15, @DR4, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On spawn & reset - Reset Directional Rune 4'),
- -(@RUNEWEAVER, 0, 5, 0, 25, 0, 100, 0, 0, 0, 0, 0, 45, 2, 1, 0, 0, 0, 0, 11, @RUNE, 30, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On Reset - Set Data 2 1 on Directional Rune'),
- -(@RUNEWEAVER, 0, 6, 0, 0, 0, 100, 0, 4000, 7000, 10000, 16000, 11, 52713, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - Combat - Cast Rune Weaving on victim'),
- -(@RUNEWEAVER, 0, 7, 0, 6, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 11, @RUNE, 50, 0, 0, 0, 0, 0, 'Iron Rune-Weaver - On Death - Set Data 1 1 on Directional Rune'),
- -(@RUNE, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Directional Rune - On Data 1 1 - Increase Phase'),
- -(@RUNE, 0, 1, 0, 38, 0, 100, 0, 2, 1, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Directional Rune - On Data 2 1 - Reset to Phase 0'),
- -(@RUNE, 0, 2, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OD, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 4485.58, -4655.58, 77.65009, 3.228859, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Durval'),
- -(@RUNE, 0, 3, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OK, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 4317.391, -4882.59, 33.49857, 4.520403, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Korgan'),
- -(@RUNE, 0, 4, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OL, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 4215.784, -5049.129, 5.86421, 2.75762, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Lochli'),
- -(@RUNE, 0, 5, 0, 60, 8, 100, 0, 0, 0, 0, 0, 12, @OB, 1, 120000, 0, 0, 0, 8, 0, 0, 0, 3986.997, -5246.744, 7.280532, 0.8901179, 'Directional Rune - On Update OOC in Phase 4 - Summon Overseer Brunon'),
- -(@RUNE, 0, 6, 0, 60, 8, 100, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Directional Rune - On Update OOC in Phase 4 - Reset to Phase 0'),
- -(@OD, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Durval - On Just Summoned - Say'),
- -(@OD, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Durval - On Link - Cast Spawn - Blue Lightning'),
- -(@OD, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR1, 10, 0, 0, 0, 0, 0, 'Overseer Durval - On Link - Activate Directional Rune 1'),
- -(@OD, 0, 3, 0, 0, 0, 100, 0, 5000, 9000, 8000, 11000, 11, 52715, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Overseer Durval - In Combat - Cast Rune of Destruction'),
- -(@OK, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - On Just Summoned - Say'),
- -(@OK, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - On Link - Cast Spawn - Blue Lightning'),
- -(@OK, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR2, 10, 0, 0, 0, 0, 0, 'Overseer Korgan - On Link - Activate Directional Rune 2'),
- -(@OK, 0, 3, 0, 0, 0, 100, 0, 3000, 5000, 7000, 9000, 11, 32018, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - In Combat - Cast Call Lightning'),
- -(@OK, 0, 4, 0, 2, 0, 100, 0, 0, 30, 12000, 16000, 11, 52714, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Korgan - Between 0-30% Health - Cast Revitalizing Rune'),
- -(@OL, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Lochli - On Just Summoned - Say'),
- -(@OL, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Lochli - On Link - Cast Spawn - Blue Lightning'),
- -(@OL, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR3, 10, 0, 0, 0, 0, 0, 'Overseer Lochli - On Link - Activate Directional Rune 3'),
- -(@OL, 0, 3, 0, 0, 0, 100, 0, 8000, 12000, 11000, 15000, 11, 52717, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Lochli - In Combat - Cast Thunderstorm'),
- -(@OB, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Brunon - On Just Summoned - Say'),
- -(@OB, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 11, 47693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Overseer Brunon - On Link - Cast Spawn - Blue Lightning'),
- -(@OB, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 15, @DR4, 10, 0, 0, 0, 0, 0, 'Overseer Brunon - On Link - Activate Directional Rune 4');
- -
- -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@RUNE;
- -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
- -(22, 3, @RUNE, 0, 0, 30, 1, @DR1, 5, 0, 0, 0, 0, '', 'Execute SAI id 2 only if within 5 yards of Directional Rune 1'),
- -(22, 4, @RUNE, 0, 0, 30, 1, @DR2, 5, 0, 0, 0, 0, '', 'Execute SAI id 3 only if within 5 yards of Directional Rune 2'),
- -(22, 5, @RUNE, 0, 0, 30, 1, @DR3, 5, 0, 0, 0, 0, '', 'Execute SAI id 4 only if within 5 yards of Directional Rune 3'),
- -(22, 6, @RUNE, 0, 0, 30, 1, @DR4, 5, 0, 0, 0, 0, '', 'Execute SAI id 5 only if within 5 yards of Directional Rune 4');
- -
- -DELETE FROM `creature_text` WHERE `entry` IN (@OD, @OK, @OL, @OB);
- -INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
- -(@OD, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26090),
- -(@OD, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26091),
- -(@OD, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26092),
- -(@OD, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Durval', 26089),
- -(@OK, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26090),
- -(@OK, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26091),
- -(@OK, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26092),
- -(@OK, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Korgan', 26089),
- -(@OL, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26090),
- -(@OL, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26091),
- -(@OL, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26092),
- -(@OL, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Lochli', 26089),
- -(@OB, 0, 0, 'You''ll pay for this!', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26090),
- -(@OB, 0, 1, 'Fool! You''ll never get away with this!', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26091),
- -(@OB, 0, 2, 'You dare to defy the sons of iron?', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26092),
- -(@OB, 0, 3, 'What do you think you''re doing?', 12, 0, 100, 25, 0, 0, 'Overseer Brunon', 26089);
- \ No newline at end of file
- diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
- index 2ca6053..2dbc70d 100644
- --- a/src/server/game/Battlegrounds/ArenaTeam.cpp
- +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
- @@ -439,7 +439,7 @@ void ArenaTeam::Query(WorldSession* session)
- WorldPacket data(SMSG_ARENA_TEAM_QUERY_RESPONSE, 4*7+GetName().size()+1);
- data << uint32(GetId()); // team id
- data << GetName(); // team name
- - data << uint32(GetType()); // arena team type (2=2x2, 3=3x3 or 5=5x5)
- + data << uint32(GetType() == 1 ? 5 : GetType()); // arena team type (2=2x2, 3=3x3 or 1=1x1(modify 1 to 5, so player can see arenateam in 5v5 slot))
- data << uint32(BackgroundColor); // background color
- data << uint32(EmblemStyle); // emblem style
- data << uint32(EmblemColor); // emblem color
- @@ -611,6 +611,8 @@ uint32 ArenaTeam::GetPoints(uint32 memberRating)
- points *= 0.76f;
- else if (Type == ARENA_TEAM_3v3)
- points *= 0.88f;
- + else if (Type == ARENA_TEAM_5v5) // 1v1 Arena
- + points *= sWorld->getFloatConfig(CONFIG_ARENA_1V1_ARENAPOINTS_MULTI);
- return (uint32) points;
- }
- diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h
- index cd9e2be..1f78c84 100644
- --- a/src/server/game/Battlegrounds/ArenaTeam.h
- +++ b/src/server/game/Battlegrounds/ArenaTeam.h
- @@ -82,7 +82,7 @@ enum ArenaTeamTypes
- {
- ARENA_TEAM_2v2 = 2,
- ARENA_TEAM_3v3 = 3,
- - ARENA_TEAM_5v5 = 5
- + ARENA_TEAM_5v5 = 1 // 1v1 Arena - 5v5 doesn't exist anymore
- };
- struct ArenaTeamMember
- diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
- index 3d42338..768cfdf 100644
- --- a/src/server/game/Battlegrounds/Battleground.cpp
- +++ b/src/server/game/Battlegrounds/Battleground.cpp
- @@ -478,6 +478,11 @@ inline void Battleground::_ProcessJoin(uint32 diff)
- // First start warning - 2 or 1 minute
- SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL);
- }
- +
- + // 1v1 Arena - Start arena after 15s, when all players are in arena
- + if(GetArenaType() == ARENA_TYPE_5v5 && GetStartDelayTime() > StartDelayTimes[BG_STARTING_EVENT_THIRD] && (m_PlayersCount[0] + m_PlayersCount[1]) == 2)
- + SetStartDelayTime(StartDelayTimes[BG_STARTING_EVENT_THIRD]);
- +
- // After 1 minute or 30 seconds, warning is signaled
- else if (GetStartDelayTime() <= StartDelayTimes[BG_STARTING_EVENT_SECOND] && !(m_Events & BG_STARTING_EVENT_2))
- {
- diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
- index 01d8b50..e7b3806 100644
- --- a/src/server/game/Battlegrounds/Battleground.h
- +++ b/src/server/game/Battlegrounds/Battleground.h
- @@ -201,7 +201,7 @@ enum ArenaType
- {
- ARENA_TYPE_2v2 = 2,
- ARENA_TYPE_3v3 = 3,
- - ARENA_TYPE_5v5 = 5
- + ARENA_TYPE_5v5 = 1 // 1v1 Arena - 5v5 doesn't exist anymore
- };
- enum BattlegroundType
- diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
- index 220fca6..1fd8ab3 100644
- --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
- +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
- @@ -606,7 +606,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
- maxPlayersPerTeam = 3;
- break;
- case ARENA_TYPE_5v5:
- - maxPlayersPerTeam = 5;
- + maxPlayersPerTeam = 1; // 1v1 Arena
- break;
- }
- diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
- index cd33b9f..83e7986 100644
- --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
- +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
- @@ -167,6 +167,7 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
- {
- ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(arenateamid);
- if (Team)
- + if ((Team->GetType() == ARENA_TYPE_5v5 && sWorld->getBoolConfig(CONFIG_ARENA_1V1_ANNOUNCER)) || Team->GetType() != ARENA_TYPE_5v5)
- sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
- }
- @@ -385,6 +386,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
- // announce to world if arena team left queue for rated match, show only once
- if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
- if (ArenaTeam* Team = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
- + if (Team && ((Team->GetType() == ARENA_TYPE_5v5 && sWorld->getBoolConfig(CONFIG_ARENA_1V1_ANNOUNCER)) || Team->GetType() != ARENA_TYPE_5v5))
- sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
- // if player leaves queue and he is invited to rated arena match, then he have to lose
- diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
- index 0a65c5c..6b8f1cb 100644
- --- a/src/server/game/Entities/Player/Player.cpp
- +++ b/src/server/game/Entities/Player/Player.cpp
- @@ -22022,6 +22022,7 @@ uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const
- uint32 max_personal_rating = 0;
- for (uint8 i = minarenaslot; i < MAX_ARENA_SLOT; ++i)
- {
- + if(i == 2 && sWorld->getBoolConfig(CONFIG_ARENA_1V1_VENDOR_RATING) == false) continue;
- if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamId(i)))
- {
- uint32 p_rating = GetArenaPersonalRating(i);
- diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
- index 866aced..9e70bcd 100644
- --- a/src/server/game/Handlers/BattleGroundHandler.cpp
- +++ b/src/server/game/Handlers/BattleGroundHandler.cpp
- @@ -34,6 +34,7 @@
- #include "Opcodes.h"
- #include "DisableMgr.h"
- #include "Group.h"
- +#include "../../scripts/Custom/npc_arena1v1.h"
- #include "Cfbg/Cfbg.h"
- @@ -447,6 +448,10 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
- if (!_player->IsInvitedForBattlegroundQueueType(bgQueueTypeId))
- return; // cheating?
- + // 1v1 Arena. Player can't join arena when forbidden talents are used.
- + if(bgQueueTypeId == BATTLEGROUND_QUEUE_5v5 && Arena1v1CheckTalents(_player) == false)
- + return;
- +
- if (!_player->InBattleground())
- _player->SetBattlegroundEntryPoint();
- diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
- index d02b898..f57f2e8 100644
- --- a/src/server/game/Handlers/PetitionsHandler.cpp
- +++ b/src/server/game/Handlers/PetitionsHandler.cpp
- @@ -953,7 +953,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
- }
- else
- {
- - data << uint8(3); // count
- + data << uint8(2); // count
- // 2v2
- data << uint32(1); // index
- data << uint32(ARENA_TEAM_CHARTER_2v2); // charter entry
- @@ -969,12 +969,14 @@ void WorldSession::SendPetitionShowList(uint64 guid)
- data << uint32(3); // unknown
- data << uint32(3); // required signs?
- // 5v5
- + /* Disable purchase 5v5 petition - edit to 1v1 doesn't work (client prevent it)
- data << uint32(3); // index
- data << uint32(ARENA_TEAM_CHARTER_5v5); // charter entry
- data << uint32(CHARTER_DISPLAY_ID); // charter display id
- data << uint32(ARENA_TEAM_CHARTER_5v5_COST); // charter cost
- data << uint32(5); // unknown
- data << uint32(5); // required signs?
- + */
- }
- SendPacket(&data);
- diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
- index 97fa24f..d0f9b0c 100644
- --- a/src/server/game/Scripting/ScriptLoader.cpp
- +++ b/src/server/game/Scripting/ScriptLoader.cpp
- @@ -1449,6 +1449,7 @@ void AddSC_fast_arena_start();
- void AddSC_npc_Arena_resetMMR();
- void Add_SC_Custom_Rates();
- void AddSC_REFORGER_NPC();
- +void AddSC_npc_1v1arena();
- #endif
- void AddCustomScripts()
- @@ -1462,5 +1463,6 @@ void AddCustomScripts()
- AddSC_npc_Arena_resetMMR();
- Add_SC_Custom_Rates();
- AddSC_REFORGER_NPC();
- + AddSC_npc_1v1arena();
- #endif
- }
- diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
- index 0eed446..bce84d9 100644
- --- a/src/server/game/World/World.cpp
- +++ b/src/server/game/World/World.cpp
- @@ -1060,6 +1060,14 @@ void World::LoadConfigSettings(bool reload)
- m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetBoolDefault("Arena.ArenaSeason.InProgress", true);
- m_bool_configs[CONFIG_ARENA_LOG_EXTENDED_INFO] = sConfigMgr->GetBoolDefault("ArenaLog.ExtendedInfo", false);
- + m_bool_configs[CONFIG_ARENA_1V1_ENABLE] = sConfigMgr->GetBoolDefault("Arena.1v1.Enable", true);
- + m_bool_configs[CONFIG_ARENA_1V1_ANNOUNCER] = sConfigMgr->GetBoolDefault("Arena.1v1.Announcer", false);
- + m_int_configs[CONFIG_ARENA_1V1_MIN_LEVEL] = sConfigMgr->GetIntDefault("Arena.1v1.MinLevel", 80);
- + m_int_configs[CONFIG_ARENA_1V1_COSTS] = sConfigMgr->GetIntDefault("Arena.1v1.Costs", 400000);
- + m_bool_configs[CONFIG_ARENA_1V1_VENDOR_RATING] = sConfigMgr->GetBoolDefault("Arena.1v1.VendorRating", false);
- + m_float_configs[CONFIG_ARENA_1V1_ARENAPOINTS_MULTI] = sConfigMgr->GetFloatDefault("Arena.1v1.ArenaPointsMulti", 0.64f);
- + m_bool_configs[CONFIG_ARENA_1V1_BLOCK_FORBIDDEN_TALENTS] = sConfigMgr->GetBoolDefault("Arena.1v1.BlockForbiddenTalents", true);
- +
- m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetBoolDefault("OffhandCheckAtSpellUnlearn", true);
- m_bool_configs[BATTLEGROUND_CROSSFACTION_ENABLED] = sConfigMgr->GetBoolDefault("CrossfactionBG.enable", true);
- diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
- index bd47237..2b04f79 100644
- --- a/src/server/game/World/World.h
- +++ b/src/server/game/World/World.h
- @@ -129,6 +129,10 @@ enum WorldBoolConfigs
- CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY,
- CONFIG_ARENA_SEASON_IN_PROGRESS,
- CONFIG_ARENA_LOG_EXTENDED_INFO,
- + CONFIG_ARENA_1V1_ENABLE,
- + CONFIG_ARENA_1V1_ANNOUNCER,
- + CONFIG_ARENA_1V1_VENDOR_RATING,
- + CONFIG_ARENA_1V1_BLOCK_FORBIDDEN_TALENTS,
- CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN,
- CONFIG_VMAP_INDOOR_CHECK,
- CONFIG_START_ALL_SPELLS,
- @@ -188,6 +192,7 @@ enum WorldFloatConfigs
- CONFIG_STATS_LIMITS_PARRY,
- CONFIG_STATS_LIMITS_BLOCK,
- CONFIG_STATS_LIMITS_CRIT,
- + CONFIG_ARENA_1V1_ARENAPOINTS_MULTI,
- FLOAT_CONFIG_VALUE_COUNT
- };
- @@ -295,6 +300,8 @@ enum WorldIntConfigs
- CONFIG_ARENA_START_RATING,
- CONFIG_ARENA_START_PERSONAL_RATING,
- CONFIG_ARENA_START_MATCHMAKER_RATING,
- + CONFIG_ARENA_1V1_MIN_LEVEL,
- + CONFIG_ARENA_1V1_COSTS,
- CONFIG_MAX_WHO,
- CONFIG_HONOR_AFTER_DUEL,
- CONFIG_PVP_TOKEN_MAP_TYPE,
- diff --git a/src/server/scripts/Custom/CMakeLists.txt b/src/server/scripts/Custom/CMakeLists.txt
- index f3844da..6124ea4 100644
- --- a/src/server/scripts/Custom/CMakeLists.txt
- +++ b/src/server/scripts/Custom/CMakeLists.txt
- @@ -18,6 +18,8 @@ set(scripts_STAT_SRCS
- Custom/npc_Arena_resetMMR.cpp
- Custom/custom_rates.cpp
- Custom/Reforging.cpp
- + Custom/npc_arena1v1.cpp
- + Custom/npc_arena1v1.h
- )
- message(" -> Prepared: Custom")
- diff --git a/src/server/scripts/Custom/npc_arena1v1.cpp b/src/server/scripts/Custom/npc_arena1v1.cpp
- new file mode 100644
- index 0000000..d00049d
- --- /dev/null
- +++ b/src/server/scripts/Custom/npc_arena1v1.cpp
- @@ -0,0 +1,309 @@
- +/*
- + *
- + * Copyright (C) 2013 Emu-Devstore <http://emu-devstore.com/>
- + * Written by Teiby <http://www.teiby.de/>
- + *
- + */
- +
- +#include "ScriptMgr.h"
- +#include "ArenaTeamMgr.h"
- +#include "Common.h"
- +#include "DisableMgr.h"
- +#include "BattlegroundMgr.h"
- +#include "Battleground.h"
- +#include "ArenaTeam.h"
- +#include "Language.h"
- +#include "npc_arena1v1.h"
- +
- +
- +class npc_1v1arena : public CreatureScript
- +{
- +public:
- + npc_1v1arena() : CreatureScript("npc_1v1arena")
- + {
- + }
- +
- +
- + bool JoinQueueArena(Player* player, Creature* me, bool isRated)
- + {
- + if(!player || !me)
- + return false;
- +
- + if(sWorld->getIntConfig(CONFIG_ARENA_1V1_MIN_LEVEL) > player->getLevel())
- + return false;
- +
- + uint64 guid = player->GetGUID();
- + uint8 arenaslot = ArenaTeam::GetSlotByType(ARENA_TEAM_5v5);
- + uint8 arenatype = ARENA_TYPE_5v5;
- + uint32 arenaRating = 0;
- + uint32 matchmakerRating = 0;
- +
- + // ignore if we already in BG or BG queue
- + if (player->InBattleground())
- + return false;
- +
- + //check existance
- + Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(BATTLEGROUND_AA);
- + if (!bg)
- + {
- + TC_LOG_ERROR("network", "Battleground: template bg (all arenas) not found");
- + return false;
- + }
- +
- + if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, BATTLEGROUND_AA, NULL))
- + {
- + ChatHandler(player->GetSession()).PSendSysMessage(LANG_ARENA_DISABLED);
- + return false;
- + }
- +
- + BattlegroundTypeId bgTypeId = bg->GetTypeID();
- + BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, arenatype);
- + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), player->getLevel());
- + if (!bracketEntry)
- + return false;
- +
- + GroupJoinBattlegroundResult err = ERR_GROUP_JOIN_BATTLEGROUND_FAIL;
- +
- + // check if already in queue
- + if (player->GetBattlegroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES)
- + //player is already in this queue
- + return false;
- + // check if has free queue slots
- + if (!player->HasFreeBattlegroundQueueId())
- + return false;
- +
- + uint32 ateamId = 0;
- +
- + if(isRated)
- + {
- + ateamId = player->GetArenaTeamId(arenaslot);
- + ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(ateamId);
- + if (!at)
- + {
- + player->GetSession()->SendNotInArenaTeamPacket(arenatype);
- + return false;
- + }
- +
- + // get the team rating for queueing
- + arenaRating = at->GetRating();
- + matchmakerRating = arenaRating;
- + // the arenateam id must match for everyone in the group
- +
- + if (arenaRating <= 0)
- + arenaRating = 1;
- + }
- +
- + BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
- + bg->SetRated(isRated);
- +
- + GroupQueueInfo* ginfo = bgQueue.AddGroup(player, NULL, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, matchmakerRating, ateamId);
- + uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
- + uint32 queueSlot = player->AddBattlegroundQueueId(bgQueueTypeId);
- +
- + WorldPacket data;
- + // send status packet (in queue)
- + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype, 0);
- + player->GetSession()->SendPacket(&data);
- +
- + sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
- +
- + return true;
- + }
- +
- +
- + bool CreateArenateam(Player* player, Creature* me)
- + {
- + if(!player || !me)
- + return false;
- +
- + uint8 slot = ArenaTeam::GetSlotByType(ARENA_TEAM_5v5);
- + if (slot >= MAX_ARENA_SLOT)
- + return false;
- +
- + // Check if player is already in an arena team
- + if (player->GetArenaTeamId(slot))
- + {
- + player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, player->GetName(), "", ERR_ALREADY_IN_ARENA_TEAM);
- + return false;
- + }
- +
- +
- + // Teamname = playername
- + // if teamname exist, we have to choose another name (playername + number)
- + int i = 1;
- + std::stringstream teamName;
- + teamName << player->GetName();
- + do
- + {
- + if(sArenaTeamMgr->GetArenaTeamByName(teamName.str()) != NULL) // teamname exist, so choose another name
- + {
- + teamName.str(std::string());
- + teamName << player->GetName() << i;
- + }
- + else
- + break;
- + } while (i < 100); // should never happen
- +
- + // Create arena team
- + ArenaTeam* arenaTeam = new ArenaTeam();
- +
- + if (!arenaTeam->Create(player->GetGUID(), ARENA_TEAM_5v5, teamName.str(), 4283124816, 45, 4294242303, 5, 4294705149))
- + {
- + delete arenaTeam;
- + return false;
- + }
- +
- + // Register arena team
- + sArenaTeamMgr->AddArenaTeam(arenaTeam);
- + arenaTeam->AddMember(player->GetGUID());
- +
- + ChatHandler(player->GetSession()).SendSysMessage("1v1 Arenateam successful created!");
- +
- + return true;
- + }
- +
- +
- + bool OnGossipHello(Player* player, Creature* me)
- + {
- + if(!player || !me)
- + return true;
- +
- + if(sWorld->getBoolConfig(CONFIG_ARENA_1V1_ENABLE) == false)
- + {
- + ChatHandler(player->GetSession()).SendSysMessage("1v1 disabled!");
- + return true;
- + }
- +
- + if(player->InBattlegroundQueueForBattlegroundQueueType(BATTLEGROUND_QUEUE_5v5))
- + player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_CHAT, "Leave queue 1v1 Arena", GOSSIP_SENDER_MAIN, 3, "Are you sure?", 0, false);
- + else
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Sign up 1v1 Arena (unrated)", GOSSIP_SENDER_MAIN, 20);
- +
- + if(player->GetArenaTeamId(ArenaTeam::GetSlotByType(ARENA_TEAM_5v5)) == NULL)
- + player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_CHAT, "Create new 1v1 Arenateam", GOSSIP_SENDER_MAIN, 1, "Create 1v1 arenateam?", sWorld->getIntConfig(CONFIG_ARENA_1V1_COSTS), false);
- + else
- + {
- + if(player->InBattlegroundQueueForBattlegroundQueueType(BATTLEGROUND_QUEUE_5v5) == false)
- + {
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Sign up 1v1 Arena (rated)", GOSSIP_SENDER_MAIN, 2);
- + player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_CHAT, "Disband arenateam", GOSSIP_SENDER_MAIN, 5, "Are you sure?", 0, false);
- + }
- +
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Show statistics", GOSSIP_SENDER_MAIN, 4);
- + }
- +
- + // player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Script Info", GOSSIP_SENDER_MAIN, 8);
- + player->SEND_GOSSIP_MENU(68, me->GetGUID());
- + return true;
- + }
- +
- +
- +
- + bool OnGossipSelect(Player* player, Creature* me, uint32 /*uiSender*/, uint32 uiAction)
- + {
- + if(!player || !me)
- + return true;
- +
- + player->PlayerTalkClass->ClearMenus();
- +
- + switch (uiAction)
- + {
- + case 1: // Create new Arenateam
- + {
- + if(sWorld->getIntConfig(CONFIG_ARENA_1V1_MIN_LEVEL) <= player->getLevel())
- + {
- + if(player->GetMoney() >= sWorld->getIntConfig(CONFIG_ARENA_1V1_COSTS) && CreateArenateam(player, me))
- + player->ModifyMoney(sWorld->getIntConfig(CONFIG_ARENA_1V1_COSTS) * -1);
- + }
- + else
- + {
- + ChatHandler(player->GetSession()).PSendSysMessage("You need level %u+ to create an 1v1 arenateam.", sWorld->getIntConfig(CONFIG_ARENA_1V1_MIN_LEVEL));
- + player->CLOSE_GOSSIP_MENU();
- + return true;
- + }
- + }
- + break;
- +
- + case 2: // Join Queue Arena (rated)
- + {
- + if(Arena1v1CheckTalents(player) && JoinQueueArena(player, me, true) == false)
- + ChatHandler(player->GetSession()).SendSysMessage("Something went wrong while join queue.");
- +
- + player->CLOSE_GOSSIP_MENU();
- + return true;
- + }
- + break;
- +
- + case 20: // Join Queue Arena (unrated)
- + {
- + if(Arena1v1CheckTalents(player) && JoinQueueArena(player, me, false) == false)
- + ChatHandler(player->GetSession()).SendSysMessage("Something went wrong while join queue.");
- +
- + player->CLOSE_GOSSIP_MENU();
- + return true;
- + }
- + break;
- +
- + case 3: // Leave Queue
- + {
- + WorldPacket Data;
- + Data << (uint8)0x1 << (uint8)0x0 << (uint32)BATTLEGROUND_AA << (uint16)0x0 << (uint8)0x0;
- + player->GetSession()->HandleBattleFieldPortOpcode(Data);
- + player->CLOSE_GOSSIP_MENU();
- + return true;
- + }
- + break;
- +
- + case 4: // get statistics
- + {
- + ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(player->GetArenaTeamId(ArenaTeam::GetSlotByType(ARENA_TEAM_5v5)));
- + if(at)
- + {
- + std::stringstream s;
- + s << "Rating: " << at->GetStats().Rating;
- + s << "\nRank: " << at->GetStats().Rank;
- + s << "\nSeason Games: " << at->GetStats().SeasonGames;
- + s << "\nSeason Wins: " << at->GetStats().SeasonWins;
- + s << "\nWeek Games: " << at->GetStats().WeekGames;
- + s << "\nWeek Wins: " << at->GetStats().WeekWins;
- +
- + ChatHandler(player->GetSession()).PSendSysMessage(s.str().c_str());
- + }
- + }
- + break;
- +
- +
- + case 5: // Disband arenateam
- + {
- + WorldPacket Data;
- + Data << (uint32)player->GetArenaTeamId(ArenaTeam::GetSlotByType(ARENA_TEAM_5v5));
- + player->GetSession()->HandleArenaTeamLeaveOpcode(Data);
- + ChatHandler(player->GetSession()).SendSysMessage("Arenateam deleted!");
- + player->CLOSE_GOSSIP_MENU();
- + return true;
- + }
- + break;
- +
- + case 8: // Script Info
- + {
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Developer: Teiby", GOSSIP_SENDER_MAIN, uiAction);
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Website: www.teiby.de", GOSSIP_SENDER_MAIN, uiAction);
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Version: 2.1", GOSSIP_SENDER_MAIN, uiAction);
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "<-- Back", GOSSIP_SENDER_MAIN, 7);
- + player->SEND_GOSSIP_MENU(68, me->GetGUID());
- + return true;
- + }
- + break;
- +
- + }
- +
- + OnGossipHello(player, me);
- + return true;
- + }
- +};
- +
- +
- +void AddSC_npc_1v1arena()
- +{
- + new npc_1v1arena();
- +}
- \ No newline at end of file
- diff --git a/src/server/scripts/Custom/npc_arena1v1.h b/src/server/scripts/Custom/npc_arena1v1.h
- new file mode 100644
- index 0000000..2e0efbe
- --- /dev/null
- +++ b/src/server/scripts/Custom/npc_arena1v1.h
- @@ -0,0 +1,69 @@
- +/*
- + *
- + * Copyright (C) 2013 Emu-Devstore <http://emu-devstore.com/>
- + * Written by Teiby <http://www.teiby.de/>
- + *
- + */
- +
- +#ifndef ARENA_1V1_H
- +#define ARENA_1V1_H
- +
- +// TalentTab.dbc -> TalentTabID
- +const uint32 FORBIDDEN_TALENTS_IN_1V1_ARENA[] =
- +{
- + // Healer
- + 201, // PriestDiscipline
- + 202, // PriestHoly
- + 382, // PaladinHoly
- + 262, // ShamanRestoration
- + 282, // DruidRestoration
- +
- + // Tanks
- + //383, // PaladinProtection
- + //163, // WarriorProtection
- +
- + 0 // End
- +};
- +
- +
- +// Return false, if player have invested more than 35 talentpoints in a forbidden talenttree.
- +static bool Arena1v1CheckTalents(Player* player)
- +{
- + if(!player)
- + return false;
- +
- + if(sWorld->getBoolConfig(CONFIG_ARENA_1V1_BLOCK_FORBIDDEN_TALENTS) == false)
- + return true;
- +
- + uint32 count = 0;
- + for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
- + {
- + TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentId);
- +
- + if (!talentInfo)
- + continue;
- +
- + for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
- + {
- + if (talentInfo->RankID[rank] == 0)
- + continue;
- +
- + if (player->HasTalent(talentInfo->RankID[rank], player->GetActiveSpec()))
- + {
- + for(int8 i = 0; FORBIDDEN_TALENTS_IN_1V1_ARENA[i] != 0; i++)
- + if(FORBIDDEN_TALENTS_IN_1V1_ARENA[i] == talentInfo->TalentTab)
- + count += rank + 1;
- + }
- + }
- + }
- +
- + if(count >= 36)
- + {
- + ChatHandler(player->GetSession()).SendSysMessage("You can't join, because you have invested too many points in a forbidden talent. Please edit your talents.");
- + return false;
- + }
- + else
- + return true;
- +}
- +
- +#endif
- \ No newline at end of file
- diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
- index 03400fb..b509026 100644
- --- a/src/server/worldserver/worldserver.conf.dist
- +++ b/src/server/worldserver/worldserver.conf.dist
- @@ -3178,4 +3178,69 @@ Anticheat.DetectionsEnabled = 31
- Anticheat.MaxReportsForDailyReport = 70
- #
- +###################################################################################################
- +# 1V1 ARENA CONFIG
- +#
- +# Arena.1v1.Enable
- +# Description: Enable the 1v1 arena.
- +# Default: 0 - (Disabled)
- +# 1 - (Enabled)
- +
- +Arena.1v1.Enable = 1
- +
- +#
- +# Arena.1v1.Announcer
- +# Description: Announce 1v1 arena queue status to chat.
- +# Arena.QueueAnnouncer.Enable must be enabled.
- +# Default: 0 - (Disabled)
- +# 1 - (Enabled)
- +
- +Arena.1v1.Announcer = 0
- +
- +#
- +# Arena.1v1.MinLevel
- +# Description: Min level to create an arena team
- +# Default: 80
- +
- +Arena.1v1.MinLevel = 80
- +
- +#
- +# Arena.1v1.Costs
- +# Description: Costs for create an arena team
- +# Default: 400000 - (40 gold)
- +
- +Arena.1v1.Costs = 400000
- +
- +#
- +# Arena.1v1.VendorRating
- +# Description: If true, 1v1 rating will use to calculate highest personal-rating (extended costs).
- +# Note: The vendor-item will show as not buyable (red), but players can buy it, if enabled and rating is high enough.
- +# Default: 0 - (false)
- +# 1 - (true)
- +
- +Arena.1v1.VendorRating = 0
- +
- +#
- +# Arena.1v1.ArenaPointsMulti
- +# Description: An 5v5 arena team with 1500 rating will gain 344 points per week (blizzlike).
- +# 3v3 with same rating will gain 302 points (5v5points * 0.88)
- +# 2v2 will gain 261 points (5v5points * 0.76)
- +# and 1v1 will gain 167 points (5v5points * 0.64)
- +# With this multiplier you can modify the arenapoints for 1v1.
- +# Default: 0.64
- +
- +Arena.1v1.ArenaPointsMulti = 0.64
- +
- +#
- +# Arena.1v1.BlockForbiddenTalents
- +# Description: If true, healers can't join 1v1 arena, if they invested more than 35 talentpoints in a healing-talenttree.
- +# You can also block tanks and other talents, if you modify FORBIDDEN_TALENTS_IN_1V1_ARENA in the npc_arena1v1.h file (hardcoding). See TalentTab.dbc for available talents (you will need an DBC-Editor).
- +# Default: 1 - (true)
- +# 0 - (false)
- +
- +Arena.1v1.BlockForbiddenTalents = 1
- +
- +#
- +###################################################################################################
- +
- ###################################################################################################
- \ No newline at end of file
- --
- 2.1.1.1.g1fb337f
Advertisement
Add Comment
Please, Sign In to add comment