Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Achievements/AchievementMgr.cpp src/server/game/Battlefield/Battlefield.h src/server/game/Battlegrounds/ArenaScore.h src/server/game/Battlegrounds/ArenaTeam.cpp src/server/game/Battlegrounds/ArenaTeam.h src/server/game/Battlegrounds/ArenaTeamMgr.cpp src/server/game/Battlegrounds/BattlegroundMgr.cpp src/server/game/Battlegrounds/BattlegroundMgr.h src/server/game/Battlegrounds/BattlegroundQueue.h src/server/game/Battlegrounds/BattlegroundScore.h src/server/game/Battlegrounds/Zones/BattlegroundAB.h src/server/game/Battlegrounds/Zones/BattlegroundAV.h src/server/game/Battlegrounds/Zones/BattlegroundEY.h src/server/game/Battlegrounds/Zones/BattlegroundIC.h src/server/game/Battlegrounds/Zones/BattlegroundSA.h src/server/game/Battlegrounds/Zones/BattlegroundWS.h src/server/game/DungeonFinding/LFG.h src/server/game/DungeonFinding/LFGMgr.cpp src/server/game/DungeonFinding/LFGMgr.h src/server/game/DungeonFinding/LFGQueue.cpp src/server/game/DungeonFinding/LFGQueue.h src/server/game/Entities/Corpse/Corpse.cpp src/server/game/Entities/Creature/Creature.cpp src/server/game/Entities/Creature/GossipDef.cpp src/server/game/Entities/Creature/GossipDef.h src/server/game/Entities/Creature/TemporarySummon.cpp src/server/game/Entities/DynamicObject/DynamicObject.cpp src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Object/Object.h src/server/game/Entities/Object/ObjectDefines.h src/server/game/Entities/Object/Updates/UpdateData.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Unit/Unit.h src/server/game/Globals/ObjectAccessor.cpp src/server/game/Globals/ObjectAccessor.h src/server/game/Globals/ObjectMgr.cpp src/server/game/Groups/Group.cpp src/server/game/Groups/Group.h src/server/game/Guilds/Guild.cpp src/server/game/Guilds/Guild.h src/server/game/Handlers/AuctionHouseHandler.cpp src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Handlers/CalendarHandler.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/ChatHandler.cpp src/server/game/Handlers/GroupHandler.cpp src/server/game/Handlers/GuildHandler.cpp src/server/game/Handlers/ItemHandler.cpp src/server/game/Handlers/LFGHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Handlers/MovementHandler.cpp src/server/game/Handlers/NPCHandler.cpp src/server/game/Handlers/PetHandler.cpp src/server/game/Handlers/QueryHandler.cpp src/server/game/Handlers/QuestHandler.cpp src/server/game/Handlers/TradeHandler.cpp src/server/game/Handlers/VehicleHandler.cpp src/server/game/Movement/Spline/MoveSplineInit.cpp src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSession.h src/server/game/Spells/Spell.cpp src/server/scripts/Commands/cs_debug.cpp src/server/scripts/Commands/cs_gm.cpp src/server/scripts/Commands/cs_misc.cpp src/server/scripts/Commands/cs_modify.cpp src/server/scripts/Commands/cs_reset.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp src/server/scripts/Kalimdor/zone_azshara.cpp src/server/scripts/Kalimdor/zone_durotar.cpp src/server/scripts/Kalimdor/zone_moonglade.cpp src/server/scripts/Kalimdor/zone_orgrimmar.cpp src/server/scripts/Kalimdor/zone_ungoro_crater.cpp src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp src/server/scripts/Spells/spell_dk.cpp src/server/scripts/Spells/spell_generic.cpp src/server/shared/Packets/ByteBuffer.h
This commit is contained in:
@@ -1705,14 +1705,14 @@ CREATE TABLE `groups` (
|
||||
`lootMethod` tinyint(3) unsigned NOT NULL,
|
||||
`looterGuid` int(10) unsigned NOT NULL,
|
||||
`lootThreshold` tinyint(3) unsigned NOT NULL,
|
||||
`icon1` int(10) unsigned NOT NULL,
|
||||
`icon2` int(10) unsigned NOT NULL,
|
||||
`icon3` int(10) unsigned NOT NULL,
|
||||
`icon4` int(10) unsigned NOT NULL,
|
||||
`icon5` int(10) unsigned NOT NULL,
|
||||
`icon6` int(10) unsigned NOT NULL,
|
||||
`icon7` int(10) unsigned NOT NULL,
|
||||
`icon8` int(10) unsigned NOT NULL,
|
||||
`icon1` bigint(20) unsigned NOT NULL,
|
||||
`icon2` bigint(20) unsigned NOT NULL,
|
||||
`icon3` bigint(20) unsigned NOT NULL,
|
||||
`icon4` bigint(20) unsigned NOT NULL,
|
||||
`icon5` bigint(20) unsigned NOT NULL,
|
||||
`icon6` bigint(20) unsigned NOT NULL,
|
||||
`icon7` bigint(20) unsigned NOT NULL,
|
||||
`icon8` bigint(20) unsigned NOT NULL,
|
||||
`groupType` tinyint(3) unsigned NOT NULL,
|
||||
`difficulty` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`raiddifficulty` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
ALTER TABLE `groups`
|
||||
MODIFY `icon1` BIGINT(20) UNSIGNED NOT NULL,
|
||||
MODIFY `icon2` BIGINT(20) UNSIGNED NOT NULL,
|
||||
MODIFY `icon3` BIGINT(20) UNSIGNED NOT NULL,
|
||||
MODIFY `icon4` BIGINT(20) UNSIGNED NOT NULL,
|
||||
MODIFY `icon5` BIGINT(20) UNSIGNED NOT NULL,
|
||||
MODIFY `icon6` BIGINT(20) UNSIGNED NOT NULL,
|
||||
MODIFY `icon7` BIGINT(20) UNSIGNED NOT NULL,
|
||||
MODIFY `icon8` BIGINT(20) UNSIGNED NOT NULL;
|
||||
@@ -0,0 +1,4 @@
|
||||
--
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` = 39238;
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(39238, 'spell_q10929_fumping');
|
||||
@@ -0,0 +1,101 @@
|
||||
DELETE FROM `creature_text` WHERE `entry` IN(17843,17875,17853,17664);
|
||||
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
|
||||
(17843, 0, 0, 'I want all of your trackers out in search of the criminal, Matis the Cruel. I have given trusted agents of the Hand flare guns. Should you or one of your trackers see the flare, it means that an agent has found Matis and needs assistance. And remember, tracker, Matis is to be brought back to me alive.', 12, 7, 100, 1, 0, 0, 'Vindicator Kuros',14454),
|
||||
(17875, 0, 0, 'I am at your service, my lord.', 12, 7, 100, 0, 0, 0, 'Hunter of the Hand',14453),
|
||||
(17875, 1, 0, 'It will be done, my lord.', 12, 7, 100, 1, 0, 0, 'Hunter of the Hand',14455),
|
||||
(17875, 2, 0, '%s calls forth their bretheren.', 16, 7, 100, 22, 0, 0, 'Hunter of the Hand',14456),
|
||||
(17875, 3, 0, 'Brothers and sisters, tonight we hunt! A blood elf known as Matis must be brought to justice! The first to find him gets one week''s vacation aboard the Exodar!', 12, 7, 100, 1, 0, 0, 'Hunter of the Hand',14457),
|
||||
(17875, 4, 0, 'Onward! The wilds of Bloodmyst await!', 12, 7, 100, 1, 0, 0, 'Hunter of the Hand',14458),
|
||||
(17853, 0, 0, 'We''ve got you now, Matis the Cruel!', 12, 0, 100, 0, 0, 0, 'Tracker of the Hand',0), -- 14446 but tc fills $n with player name rather than npc name
|
||||
(17853, 1, 0, 'Return to Kuros. I will bring him to Blood Watch.', 12, 7, 100, 0, 0, 0, 'Tracker of the Hand',14445),
|
||||
(17664, 0, 0, 'You will regret this, maggot.', 12, 0, 100, 0, 0, 0, 'Matis the Cruel',14449),
|
||||
(17664, 1, 0, '%s falls unconscious.', 16, 0, 100, 0, 0, 0, 'Matis the Cruel',14444);
|
||||
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(17843,17875,17853,17664);
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`IN(17843,17875,17853,17664) AND `source_type`=0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(1784300,1785300,1787500) AND `source_type`=9;
|
||||
|
||||
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
|
||||
(17843, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - On Spawn - Set Phase 1'),
|
||||
(17843, 0, 1, 0, 19, 1, 100, 0, 9711, 0, 0, 0, 80, 1784300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - On Quest Accept (Matis the Cruel) - Run Script (Phase 1)'),
|
||||
|
||||
(17875, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 53, 0, 17875, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Data Set - Start WP'),
|
||||
(17875, 0, 1, 2, 40, 0, 100, 0, 7, 17875, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 17843, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Reached WP7 - Set Orientation'),
|
||||
(17875, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Reached WP7 - Set Bytes 1'),
|
||||
(17875, 0, 3, 4, 38, 0, 100, 0, 2, 2, 0, 0, 29, 10, 0, 0, 0, 0, 0, 19, 17843, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Data Set - Start Closest path'),
|
||||
(17875, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 1787500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Data Set - Run Script'),
|
||||
(17875, 0, 5, 6, 38, 0, 100, 0, 3, 3, 0, 0, 91, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Data Set - Remove Bytes 1'),
|
||||
(17875, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 5, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Data Set - Play emote OneShotRoar'),
|
||||
(17875, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, 1787500, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Data Set - Start WP (Path 06)'),
|
||||
(17875, 0, 8, 0, 40, 0, 100, 0, 9, 1787500, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - On Reached WP9 (Path 06) - Despawn'),
|
||||
|
||||
(17853, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 17664, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - On Just Summoned - Face Matis the Cruel'),
|
||||
(17853, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - On Just Summoned - Say Line 1'),
|
||||
(17853, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - On Just Summoned - Set Aggresive'),
|
||||
(17853, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - On Just Summoned - Set Data to Matis the Cruel'),
|
||||
(17853, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - On Just Summoned - Set Phase 2'),
|
||||
(17853, 0, 5, 0, 38, 2, 100, 0, 1, 1, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 17664, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - On Data Set 1 1 (Phase 2) - Set Data 2 2 on Matis the Cruel'),
|
||||
(17853, 0, 6, 0, 38, 0, 100, 0, 2, 2, 0, 0, 80, 1785300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - On Data Set 2 2 - Run Script'),
|
||||
|
||||
(17664, 0, 0, 1, 38, 0, 100, 0, 1, 1, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 17853, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Face Tracker of the Hand'),
|
||||
(17664, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Say Line 1'),
|
||||
(17664, 0, 2, 12, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 17853, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Attack Tracker of the hand'),
|
||||
(17664, 0, 3, 0, 9, 0, 100, 0, 5, 30, 0, 0, 11, 6660, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Range - Cast Shoot'),
|
||||
(17664, 0, 4, 0, 2, 0, 100, 1, 25, 50, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 17853, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Between 25 - 50% HP - Set Data on Tracker of the Hand'),
|
||||
(17664, 0, 5, 6, 38, 0, 100, 0, 2, 2, 0, 0, 90, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Set Bytes 1'),
|
||||
(17664, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Disable Combat Movement'),
|
||||
(17664, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Disable Auto Attack'),
|
||||
(17664, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Say Line 2'),
|
||||
(17664, 0, 9, 10, 61, 0, 100, 0, 25, 50, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 17853, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Set Data 2 2 Tracker of the Hand'),
|
||||
(17664, 0, 10, 11, 61, 0, 100, 0, 0, 0, 0, 0, 11, 31336, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Cast Matis Captured DND'),
|
||||
(17664, 0, 11, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Despawn After 15 Seconds'),
|
||||
(17664, 0, 12, 0, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Matis the Cruel - On Data Set - Set Invincibility HP'),
|
||||
|
||||
(1787500, 9, 0, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Hunter of the Hand - Script - Set Bytes 1'),
|
||||
(1785300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - Script - Evade'),
|
||||
(1785300, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - Script - Say Line 2'),
|
||||
(1785300, 9, 2, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Tracker of the Hand - Script - Despawn'),
|
||||
|
||||
|
||||
(1784300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Set Phase 2'),
|
||||
(1784300, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 17875, 1, 90000, 0, 0, 0, 8, 0, 0, 0, -1968.402, -11914.17, 51.70642, 1.356192, 'Vindicator Kuros - Script - Summon Hunter of the Hand'),
|
||||
(1784300, 9, 2, 0, 0, 0, 100, 0, 500, 500, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 17875, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Set Data on Hunter of the Hand'),
|
||||
(1784300, 9, 3, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 17875, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Say Line 1 on Hunter of the Hand'),
|
||||
(1784300, 9, 4, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Say Line 1'),
|
||||
(1784300, 9, 5, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 17875, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Say Line 2 on Hunter of the Hand'),
|
||||
(1784300, 9, 6, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 17875, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Say Line 3 on Hunter of the Hand'),
|
||||
(1784300, 9, 7, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 107, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Summon Group'),
|
||||
(1784300, 9, 8, 0, 0, 0, 100, 0, 500, 500, 0, 0, 45, 2, 2, 0, 0, 0, 0, 9, 17875, 20, 200, 0, 0, 0, 0, 'Vindicator Kuros - Script - Set Data Hunter of the Hand'),
|
||||
(1784300, 9, 9, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 19, 17875, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Say Line 4 on Hunter of the Hand'),
|
||||
(1784300, 9, 10, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 19, 17875, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Say Line 5 on Hunter of the Hand'),
|
||||
(1784300, 9, 11, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 3, 3, 0, 0, 0, 0, 9, 17875, 0, 200, 0, 0, 0, 0, 'Vindicator Kuros - Script - Say Line 5 on Hunter of the Hand'),
|
||||
(1784300, 9, 12, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vindicator Kuros - Script - Set Phase 1');
|
||||
|
||||
DELETE FROM `waypoints` WHERE `entry` IN(17875,1787500);
|
||||
|
||||
INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
|
||||
(17875, 1,-1969.763, -11915.72, 52.07651, 'Hunter of the Hand'),
|
||||
(17875, 2,-1968.785, -11915.93, 52.07651, 'Hunter of the Hand'),
|
||||
(17875, 3,-1967.934, -11912.02, 51.25421, 'Hunter of the Hand'),
|
||||
(17875, 4,-1967.082, -11908.12, 50.62921, 'Hunter of the Hand'),
|
||||
(17875, 5,-1966.443, -11905.19, 50.00854, 'Hunter of the Hand'),
|
||||
(17875, 6,-1965.19, -11899.45, 49.74685, 'Hunter of the Hand'),
|
||||
(17875, 7,-1965.19, -11899.45, 49.74685, 'Hunter of the Hand'),
|
||||
(1787500, 1,-1944.068, -11891.86, 48.60638, 'Hunter of the Hand'),
|
||||
(1787500, 2,-1940.068, -11890.86, 47.85638, 'Hunter of the Hand'),
|
||||
(1787500, 3,-1934.318, -11889.36, 47.35638, 'Hunter of the Hand'),
|
||||
(1787500, 4,-1929.568, -11888.36, 46.60638, 'Hunter of the Hand'),
|
||||
(1787500, 5,-1924.818, -11887.11, 46.10638, 'Hunter of the Hand'),
|
||||
(1787500, 6,-1920.068, -11885.86, 45.35638, 'Hunter of the Hand'),
|
||||
(1787500, 7,-1917.068, -11885.11, 44.60638, 'Hunter of the Hand'),
|
||||
(1787500, 8,-1914.318, -11884.36, 44.10638, 'Hunter of the Hand'),
|
||||
(1787500, 9,-1910.318, -11883.36, 42.60638, 'Hunter of the Hand');
|
||||
|
||||
DELETE FROM `creature_summon_groups` WHERE `summonerId`=17843;
|
||||
INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES
|
||||
(17843, 0, 1, 17875, -1928.623, -11922.95, 47.65023, 1.884956, 1, 60000),
|
||||
(17843, 0, 1, 17875, -1910.806, -11892.78, 43.87496, 0.541052, 1, 60000),
|
||||
(17843, 0, 1, 17875, -1921.778, -11862.54, 51.3028, 3.892084, 1, 60000),
|
||||
(17843, 0, 1, 17875, -1932.146, -11854.41, 51.7948, 2.9147, 1, 60000),
|
||||
(17843, 0, 1, 17875, -1909.906, -11867.79, 44.27838, 4.642576, 1, 60000),
|
||||
(17843, 0, 1, 17875, -1918.49, -11907.37, 46.20815, 0.541052, 1, 60000);
|
||||
@@ -0,0 +1,57 @@
|
||||
UPDATE `gameobject_template` SET `flags`=40 WHERE `entry`=193188; -- Doodad_GunDrak_Trapdoor_01
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (57068,57071,57072,54988);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13,1,57068,0,0,31,0,3,30298,127032,0,0, '', 'Cosmetic - Fire Beam Mammoth'),
|
||||
(13,1,57071,0,0,31,0,3,30298,127035,0,0, '', 'Cosmetic - Fire Beam Snake'),
|
||||
(13,1,57072,0,0,31,0,3,30298,127033,0,0, '', 'Cosmetic - Fire Beam Elemental'),
|
||||
(13,1,54988,0,0,31,0,3,22517,0,0,0, '', 'Heart Beam Visual');
|
||||
|
||||
UPDATE `creature_addon` SET `auras`=NULL WHERE `guid`=127213;
|
||||
|
||||
UPDATE `creature_model_info` SET `bounding_radius`=0.3875, `combat_reach`=6.25 WHERE `modelid`=26278;
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (54956,59827);
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(54956,'spell_gal_darah_impaling_charge'),
|
||||
(59827,'spell_gal_darah_impaling_charge');
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry` IN (29304, 29305, 29306, 29932, 29573);
|
||||
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES
|
||||
(29304, 0, 0, 'Drakkari gonna kill anybody who tressspasss on these landsss!', 14, 0, 100, 0, 0, 14443, 31711, 'Slad''ran - Aggro'),
|
||||
(29304, 1, 0, 'You not breathin''? Good.', 14, 0, 100, 0, 0, 14446, 31712, 'Slad''ran - Slay 1'),
|
||||
(29304, 1, 1, 'Ssscared now?', 14, 0, 100, 0, 0, 14447, 31713, 'Slad''ran - Slay 2'),
|
||||
(29304, 1, 2, 'I eat you next, mon.', 14, 0, 100, 0, 0, 14448, 31714, 'Slad''ran - Slay 3'),
|
||||
(29304, 2, 0, 'I sssee now... Ssscourge wasss not... our greatessst enemy....', 14, 0, 100, 0, 0, 14449, 31715, 'Slad''ran - Death'),
|
||||
(29304, 3, 0, 'Minionsss of the scale, heed my call!', 14, 0, 100, 0, 0, 14444, 30369, 'Slad''ran - Summon Snakes'),
|
||||
(29304, 4, 0, 'A thousssand fangsss gonna rend your flesh!', 14, 0, 100, 0, 0, 14445, 30370, 'Slad''ran - Summon Constrictors'),
|
||||
(29304, 5, 0, '%s begins to cast Poison Nova!', 41, 0, 100, 0, 0, 0, 30757, 'Slad''ran - Poison Nova'),
|
||||
(29304, 6, 0, 'As %s falls, the altar set into the floor on his balcony begins to glow faintly.', 16, 0, 100, 0, 0, 0, 31199, 'Slad''ran - Activate Altar'),
|
||||
|
||||
(29305, 0, 0, 'We fought back da Scourge. What chance joo thinkin'' JOO got?', 14, 0, 100, 0, 0, 14721, 31427, 'Moorabi - Aggro'),
|
||||
(29305, 1, 0, 'I crush joo cockroaches!', 14, 0, 100, 0, 0, 14725, 31430, 'Moorabi - Slay 1'),
|
||||
(29305, 1, 1, 'Who gonna stop me? You?', 14, 0, 100, 0, 0, 14726, 31431, 'Moorabi - Slay 2'),
|
||||
(29305, 1, 2, 'Not so tough now!!', 14, 0, 100, 0, 0, 14727, 31432, 'Moorabi - Slay 3'),
|
||||
(29305, 2, 0, 'If our gods can die... den so can we....', 14, 0, 100, 0, 0, 14728, 31433, 'Moorabi - Death'),
|
||||
(29305, 3, 0, 'Get ready for somethin''... much... BIGGAH!', 14, 0, 100, 0, 0, 14722, 31428, 'Moorabi - Transform'),
|
||||
(29305, 4, 0, 'Da ground gonna swallow you up!', 14, 0, 100, 0, 0, 14723, 31429, 'Moorabi - Quake'),
|
||||
(29305, 5, 0, '%s begins to transform!', 41, 0, 100, 0, 0, 0, 30385, 'Moorabi - Begin Transform'),
|
||||
(29305, 6, 0, '%s transforms into a Mammoth!', 16, 0, 100, 0, 0, 0, 30388, 'Moorabi - Transformed'),
|
||||
(29305, 7, 0, 'As %s falls, the altar set into the floor on his balcony begins to glow faintly.', 16, 0, 100, 0, 0, 0, 31199, 'Moorabi - Activate Altar'),
|
||||
|
||||
(29306, 0, 0, 'I''m gonna spill your guts, mon!', 14, 0, 100, 0, 0, 14430, 32534, 'Gal''darah - Aggro'),
|
||||
(29306, 1, 0, 'What a rush!', 14, 0, 100, 0, 0, 14436, 32540, 'Gal''darah - Slay 1'),
|
||||
(29306, 1, 1, 'Who needs gods when we ARE gods?', 14, 0, 100, 0, 0, 14437, 32541, 'Gal''darah - Slay 2'),
|
||||
(29306, 1, 2, 'I told ya so!', 14, 0, 100, 0, 0, 14438, 32542, 'Gal''darah - Slay 3'),
|
||||
(29306, 2, 0, 'Even the mighty... can fall.', 14, 0, 100, 0, 0, 14439, 32543, 'Gal''darah - Death'),
|
||||
(29306, 3, 0, 'Gut them! Impale them!', 14, 0, 100, 0, 0, 14433, 32537, 'Gal''darah - Summon Rhino 1'),
|
||||
(29306, 3, 1, 'KILL THEM ALL!', 14, 0, 100, 0, 0, 14434, 32538, 'Gal''darah - Summon Rhino 2'),
|
||||
(29306, 3, 2, 'Say hello to my BIG friend!', 14, 0, 100, 0, 0, 14435, 32539, 'Gal''darah - Summon Rhino 3'),
|
||||
(29306, 4, 0, 'Ain''t gonna be nothin'' left after this!', 14, 0, 100, 0, 0, 14431, 32535, 'Gal''darah - Transform 1'),
|
||||
(29306, 5, 0, 'You wanna see power? I''m gonna show you power!', 14, 0, 100, 0, 0, 14432, 32536, 'Gal''darah - Transform 2'),
|
||||
(29306, 6, 0, '$n is impaled!', 41, 0, 100, 0, 0, 0, 30718, 'Gal''darah - Impale'),
|
||||
|
||||
(29932, 0, 0, 'Something stirs in the pool of mojo...', 16, 0, 100, 0, 0, 0, 30740, 'Eck the Ferocious'),
|
||||
|
||||
(29573, 0, 0, '%s gathers its mojo and surges forward!', 16, 0, 100, 0, 0, 0, 30717, 'Drakkari Elemental - Mojo'),
|
||||
(29573, 1, 0, 'As the last remnants of the %s seep into the ground, the altar set into the floor nearby begins to glow faintly.', 16, 0, 100, 0, 0, 0, 31226, 'Drakkari Elemental - Death');
|
||||
@@ -0,0 +1,90 @@
|
||||
SET @CGuid := 74518;
|
||||
|
||||
DELETE FROM `creature` WHERE `id`IN(24014,29393)AND `guid` BETWEEN @CGUID AND @CGUID+3;
|
||||
UPDATE `creature_template` SET `faction`=21, `unit_flags`=33536, `unit_flags2`=2099200 WHERE `entry`=29394;
|
||||
|
||||
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
|
||||
(@CGUID+0, 24014, 571, 1, 1, 2846.022, -3855.99, 248.6132, 5.315152, 120, 0, 0), -- 24014 (Area: 495)
|
||||
(@CGUID+1, 24014, 571, 1, 1, 2846.136, -3866.035, 248.6132, 0.4537856, 120, 0, 0), -- 24014 (Area: 495)
|
||||
(@CGUID+2, 24014, 571, 1, 1, 2855.766, -3859.292, 248.6132, 3.944444, 120, 0, 0), -- 24014 (Area: 495)
|
||||
(@CGUID+3, 29393, 571, 1, 1, 2851.356, -3863.74, 248.6132, 5.305801, 120, 0, 0); -- 29393 (Area: 495)
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry` IN(29394,24023);
|
||||
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
|
||||
(29394, 0, 0, 'Not yet, Ymiron, I have other plans for you. You will serve me better within Utgarde Pinnacle. And if these insects survive to find you again, you will get the chance to avenge your wife.', 14, 0, 100, 1, 0, 14748, 'The Lich King',23803),
|
||||
(24023, 0, 0, 'Give me your souls that I might slay the enemy!', 14, 0, 100, 0, 0, 13774, 'Queen Angerboda',22622),
|
||||
(24023, 1, 0, 'You will not stop my work here! My husband-king will awaken!', 14, 0, 100, 0, 0, 13775, 'Queen Angerboda',22636),
|
||||
(24023, 2, 0, 'The ritual proceeds too slowly. More sacrifices are needed!', 14, 0, 100, 0, 0, 0, 'Queen Angerboda',23802),
|
||||
(24023, 2, 1, 'Soon, my love. Soon you will waken and all of Azeroth will know fear!', 14, 0, 100, 0, 0, 0, 'Queen Angerboda',23795),
|
||||
(24023, 2, 2, 'Awaken, Ymiron, the time of your continued reign is nigh.', 14, 0, 100, 0, 0, 0, 'Queen Angerboda',23796),
|
||||
(24023, 2, 3, 'Double your efforts! King Ymiron will awaken and then he will ascend!', 14, 0, 100, 0, 0, 0, 'Queen Angerboda',23799),
|
||||
(24023, 2, 4, 'Sleep no longer, my love. With the might of the Lich King behind you, the world will tremble.', 14, 0, 100, 0, 0, 0, 'Queen Angerboda',23797),
|
||||
(24023, 2, 5, 'Why is this ritual taking so long? Your master promised that your assistance would speed the process!', 14, 0, 100, 0, 0, 0, 'Queen Angerboda',23798);
|
||||
|
||||
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`IN(24023,29394,29394,29393);
|
||||
UPDATE `creature_template` SET `unit_flags`=768 WHERE `entry`=29393;
|
||||
UPDATE `creature_template` SET `unit_flags`=32768 WHERE `entry`=24023;
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN(42808,42809);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 42808, 0, 0, 31, 0, 3, 24014, 0, 0, 0, 0, '', 'Queen Angerbodas On Reaction 2 Beam - Targets Necrolord'),
|
||||
(13, 1, 42809, 0, 0, 31, 0, 3, 24023, 0, 0, 0, 0, '', 'Queen Angerboda Soul Absorption - Targets Queen Angerboda');
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(-@CGUID,-@CGUID-1,-@CGUID-2,24023,2402300,2401400,29394,2939400,29393);
|
||||
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
|
||||
(24023, 0, 0, 0, 1, 2, 100, 0, 0, 0, 1000, 1000, 11, 44473, 0, 0, 0, 0, 0, 19, 29393, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - OOC (Phase 2) - Cast Queen Angerboda: Soul Beam'),
|
||||
(24023, 0, 1, 0, 1, 1, 100, 0, 0, 0, 1000, 1000, 11, 42808, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - OOC (Phase 2) - Cast Queen Angerboda: Soul Beam'),
|
||||
(24023, 0, 2, 0, 10, 0, 100, 0, 0, 50, 60000, 90000, 80, 2402300, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - OOC LOS (Phase 2) - Run Script'),
|
||||
(24023, 0, 3, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - OOC LOS (Phase 2) - Run Script'),
|
||||
(24023, 0, 4, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - On Agro - Say Line 2'),
|
||||
(24023, 0, 5, 0, 6, 0, 100, 0, 0, 0, 0, 0, 12, 29394, 1, 60000, 0, 0, 0, 8, 0, 0, 0, 2850.257, -3872.007, 248.6132, 1.413717, 'Queen Angerboda - On Death - Summon the Lich king'),
|
||||
(24023, 0, 6, 7, 25, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - On Reset - Set Phase 2'),
|
||||
(24023, 0, 7, 8, 61, 0, 100, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 10, @CGUID, 24014, 0, 0, 0, 0, 0, 'Queen Angerboda - On Reset - Respawn Necrolord 1'),
|
||||
(24023, 0, 8, 8, 61, 0, 100, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 10, @CGUID+1, 24014, 0, 0, 0, 0, 0, 'Queen Angerboda - On Reset - Respawn Necrolord 2'),
|
||||
(24023, 0, 9, 8, 61, 0, 100, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 10, @CGUID+2, 24014, 0, 0, 0, 0, 0, 'Queen Angerboda - On Reset - Respawn Necrolord 3'),
|
||||
(24023, 0, 10, 0, 1, 0, 100, 0, 0, 45000, 45000, 90000, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - OOC - Say'),
|
||||
|
||||
(29394, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 2939400, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - On Just Summoned - Run Script'),
|
||||
(29394, 0, 1, 0, 1, 2, 100, 0, 0, 0, 1000, 1000, 11, 42811, 0, 0, 0, 0, 0, 19, 29393, 0, 0, 0, 0, 0, 0, 'The Lich King - OOC (Phase 2) - Cast Teleport Other'),
|
||||
(29393, 0, 0, 1, 38, 0, 100, 0, 1, 1, 0, 0, 11, 34427, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'King Ymiron - On Data Set - Cast Ethereal Teleport'),
|
||||
(29393, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'King Ymiron - On Data Set - Cast Ethereal Teleport'),
|
||||
(2939400, 9, 1, 0, 0, 0, 100, 0, 500, 500, 0, 0, 11, 34427, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Cast Ethereal Teleport'),
|
||||
(2939400, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Say'),
|
||||
(2939400, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, 29393, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Set Orientation'),
|
||||
(2939400, 9, 4, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Cast Teleport Other'),
|
||||
(2939400, 9, 5, 0, 0, 0, 100, 0, 15000, 15000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 29393, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Despawn King Ymiron'),
|
||||
(2939400, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Cast Teleport Other'),
|
||||
(2939400, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 92, 0, 42811, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Interupt'),
|
||||
(2939400, 9, 8, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 34427, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Cast Ethereal Teleport'),
|
||||
(2939400, 9, 9, 0, 0, 0, 100, 0, 500, 500, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'The Lich King - Script 1 - Despawn'),
|
||||
(2402300, 9, 1, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 92, 0, 44473, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - Script 1 - Interupt'),
|
||||
(2402300, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - Script 1 - Remove Aura Queen Angerboda: Soul Beam'),
|
||||
(2402300, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - Script 1 - Say Line 1'),
|
||||
(2402300, 9, 4, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 9, 24014, 0, 100, 0, 0, 0, 0, 'Queen Angerboda - Script 1 - Set Data'),
|
||||
(2402300, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - Script 1 - Set Data'),
|
||||
(2401400, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Queen Angerboda - Script 1 - Set Data'),
|
||||
(-@CGUID, 0, 0, 0, 1, 2, 100, 0, 0, 0, 3000, 3000, 11, 44473, 0, 0, 0, 0, 0, 19, 29393, 0, 0, 0, 0, 0, 0, 'Necrolord - OOC (Phase 2) - Cast Queen Angerboda: Soul Beam'),
|
||||
(-@CGUID, 0, 1, 2, 38, 0, 100, 0, 1, 1, 0, 0, 92, 0, 44473, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 11, 42809, 0, 0, 0, 0, 0, 19, 24023, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2401400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID, 0, 5, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID, 0, 6, 0, 25, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID-1, 0, 0, 0, 1, 2, 100, 0, 0, 0, 3000, 3000, 11, 44473, 0, 0, 0, 0, 0, 19, 29393, 0, 0, 0, 0, 0, 0, 'Necrolord - OOC (Phase 2) - Cast Queen Angerboda: Soul Beam'),
|
||||
(-@CGUID-1, 0, 1, 2, 38, 0, 100, 0, 1, 1, 0, 0, 92, 0, 44473, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID-1, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID-1, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 11, 42809, 0, 0, 0, 0, 0, 19, 24023, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID-1, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2401400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID-1, 0, 5, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID-1, 0, 6, 0, 25, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID-2, 0, 0, 0, 1, 2, 100, 0, 0, 0, 3000, 3000, 11, 44473, 0, 0, 0, 0, 0, 19, 29393, 0, 0, 0, 0, 0, 0, 'Necrolord - OOC (Phase 2) - Cast Queen Angerboda: Soul Beam'),
|
||||
(-@CGUID-2, 0, 1, 2, 38, 0, 100, 0, 1, 1, 0, 0, 92, 0, 44473, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID-2, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID-2, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 11, 42809, 0, 0, 0, 0, 0, 19, 24023, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Cast Queen Angerboda Soul Absorption'),
|
||||
(-@CGUID-2, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 2401400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID-2, 0, 5, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die'),
|
||||
(-@CGUID-2, 0, 6, 0, 25, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Necrolord - On Data Set - Die');
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry`=29394;
|
||||
INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
|
||||
(29394, 0, 0x0, 0x0, '41408'); -- 29394 - 41408
|
||||
@@ -0,0 +1,95 @@
|
||||
-- Nexus Guardian SAI
|
||||
SET @ENTRY := 26276;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,3400,4800,11,47425,64,0,0,0,0,2,0,0,0,0,0,0,0,"Nexus Guardian - Combat CMC - Cast 'Frost Breath'"),
|
||||
(@ENTRY,0,1,0,9,0,100,0,0,5,9000,13000,11,51857,1,0,0,0,0,2,0,0,0,0,0,0,0,"Nexus Guardian - Within 0-5 Range - Cast 'Frost Cleave'");
|
||||
|
||||
-- Saragosa SAI
|
||||
SET @ENTRY := 26232;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,3400,6200,11,51779,64,0,0,0,0,2,0,0,0,0,0,0,0,"Saragosa - In Combat CMC - Cast 'Frostfire Bolt'"),
|
||||
(@ENTRY,0,1,0,0,0,100,0,8500,17500,20100,40100,11,15063,1,0,0,0,0,1,0,0,0,0,0,0,0,"Saragosa - In Combat - Cast 'Frost Nova'");
|
||||
|
||||
-- Snowfall Glade Shaman SAI
|
||||
SET @ENTRY := 26201;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,1,0,100,0,1000,1000,600000,600000,11,12550,1,0,0,0,0,1,0,0,0,0,0,0,0,"Snowfall Glade Shaman - Out of Combat - Cast 'Lightning Shield'"),
|
||||
(@ENTRY,0,1,0,0,0,100,0,0,0,3400,4800,11,12548,64,0,0,0,0,2,0,0,0,0,0,0,0,"Snowfall Glade Shaman - In Combat CMC - Cast 'Frost Shock'"),
|
||||
(@ENTRY,0,2,0,14,0,100,0,4000,40,23000,30000,11,11986,1,0,0,0,0,7,0,0,0,0,0,0,0,"Snowfall Glade Shaman - Friendly At 4000 Health - Cast 'Healing Wave'");
|
||||
|
||||
-- Snowfall Glade Wolvar SAI
|
||||
SET @ENTRY := 26198;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,2300,3900,11,43413,64,0,0,0,0,2,0,0,0,0,0,0,0,"Snowfall Glade Wolvar - In Combat CMC - Cast 'Throw Spear'"),
|
||||
(@ENTRY,0,1,0,9,0,100,0,0,20,9000,14000,11,6533,1,0,0,0,0,2,0,0,0,0,0,0,0,"Snowfall Glade Wolvar - Within 0-20 Range - Cast 'Net'");
|
||||
|
||||
-- Storm Tempest SAI
|
||||
SET @ENTRY := 26045;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,63,0,100,0,0,0,0,0,11,8609,2,0,0,0,0,1,0,0,0,0,0,0,0,"Storm Tempest - On Just Created - Cast 'Cyclone Visual Spawn (DND)' (No Repeat)"),
|
||||
(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,12,23837,2,120000,0,0,0,8,0,0,0,3404,4133,18,6,"Storm Tempest - Out of Combat - Summon Creature 'ELM General Purpose Bunny'(No Repeat)"),
|
||||
(@ENTRY,0,2,0,60,0,100,1,1000,1000,7000,8000,11,40136,2,0,0,0,0,19,23837,5,0,0,0,0,0,"Storm Tempest - On Update - Cast 'Lightning Cloud' (No Repeat)"),
|
||||
(@ENTRY,0,3,0,4,0,100,1,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,"Storm Tempest - On Aggro - Say Line 0 (No Repeat)"),
|
||||
(@ENTRY,0,4,0,0,0,100,0,0,30,6000,7500,11,15659,64,0,0,0,0,2,0,0,0,0,0,0,0,"Storm Tempest - In Combat CMC - Cast 'Chain Lightning'"),
|
||||
(@ENTRY,0,5,0,0,0,100,0,8000,11000,9000,14000,11,31272,0,0,0,0,0,2,0,0,0,0,0,0,0,"Storm Tempest - In Combat - Cast 'Wind Shock'"),
|
||||
(@ENTRY,0,6,7,6,0,100,0,0,0,0,0,51,0,0,0,0,0,0,9,23837,0,10,0,0,0,0,"Storm Tempest - On Just Died - Kill Target"),
|
||||
(@ENTRY,0,7,8,61,0,100,0,0,0,0,0,81,16777216,0,0,0,0,0,19,26048,10,0,0,0,0,0,"Storm Tempest - On Just Died - Set Npc Flag Spellclick"),
|
||||
(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,85,46424,2,0,0,0,0,16,0,0,0,0,0,0,0,"Storm Tempest - On Just Died - Invoker Cast 'Power of the Storm'");
|
||||
|
||||
-- Coldarra Spellweaver SAI
|
||||
SET @ENTRY := 25722;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,600,5300,11,34447,64,0,0,0,0,2,0,0,0,0,0,0,0,"Coldarra Spellweaver - In Combat CMC - Cast 'Arcane Missiles' (No Repeat)");
|
||||
|
||||
-- Coldarra Spellbinder SAI
|
||||
SET @ENTRY := 25719;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,3900,5800,11,9672,64,0,0,0,0,2,0,0,0,0,0,0,0,"Coldarra Spellbinder - In Combat CMC - Cast 'Frostbolt'"),
|
||||
(@ENTRY,0,1,0,0,0,100,0,1700,13500,172100,172100,11,50583,1,0,0,0,0,1,0,0,0,0,0,0,0,"Coldarra Spellbinder - In Combat - Cast 'Summon Frozen Spheres'");
|
||||
|
||||
-- Inquisitor Caleras SAI
|
||||
SET @ENTRY := 25720;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,3400,6200,11,15043,64,0,0,0,0,2,0,0,0,0,0,0,0,"Inquisitor Caleras - In Combat CMC - Cast 'Frostbolt'"),
|
||||
(@ENTRY,0,1,0,0,0,100,0,9800,21300,18400,18400,11,32192,1,0,0,0,0,1,0,0,0,0,0,0,0,"Inquisitor Caleras - In Combat - Cast 'Frost Nova'");
|
||||
|
||||
-- Bloodspore Firestarter SAI
|
||||
SET @ENTRY := 25470;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,1,0,100,0,1000,1000,600000,600000,11,45985,1,1,0,0,0,1,0,0,0,0,0,0,0,"Bloodspore Firestarter - Out of Combat - Cast 'Flaming Touch'"),
|
||||
(@ENTRY,0,1,0,0,0,100,0,0,0,3800,6200,11,20793,64,0,0,0,0,2,0,0,0,0,0,0,0,"Bloodspore Firestarter - In Combat CMC - Cast 'Fireball'");
|
||||
|
||||
-- Winterfin Oracle SAI
|
||||
SET @ENTRY := 25216;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,11,50272,1,0,0,0,0,1,0,0,0,0,0,0,0,"Winterfin Oracle - On Aggro - Cast 'Unstable Magic'"),
|
||||
(@ENTRY,0,1,0,0,1,100,0,0,0,2700,5600,11,9532,64,0,0,0,0,2,0,0,0,0,0,0,0,"Winterfin Oracle - In Combat CMC - Cast 'Lightning Bolt'"),
|
||||
(@ENTRY,0,2,0,2,0,100,1,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Winterfin Oracle - Between 0-15% Health - Flee For Assist (No Repeat)");
|
||||
|
||||
-- Budd's Bodyguard SAI
|
||||
SET @ENTRY := 25145;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,2300,3900,11,23337,64,0,0,0,0,2,0,0,0,0,0,0,0,"Budd's Bodyguard - In Combat CMC - Cast 'Shoot'"),
|
||||
(@ENTRY,0,1,0,9,0,100,0,0,20,8000,13000,11,12024,1,0,0,0,0,2,0,0,0,0,0,0,0,"Budd's Bodyguard - Within 0-20 Range - Cast 'Net'");
|
||||
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE `creature_text`
|
||||
CHANGE `BroadcastTextID` `BroadcastTextId` MEDIUMINT(6) DEFAULT 0 NOT NULL AFTER `sound`,
|
||||
ADD COLUMN `TextRange` TINYINT(3) UNSIGNED DEFAULT 0 NOT NULL AFTER `BroadcastTextId`;
|
||||
|
||||
-- Zone
|
||||
UPDATE `creature_text` SET `TextRange`=2 WHERE `entry`=15214;
|
||||
|
||||
-- Map
|
||||
UPDATE `creature_text` SET `TextRange`=3 WHERE `entry` IN (29, 14848, 22515, 26527, 27915, 30084);
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
UPDATE `smart_scripts` SET `link`=9 WHERE `entryorguid`=24023 AND `source_type`=0 AND `id`=8 AND `link`=8;
|
||||
UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=24023 AND `source_type`=0 AND `id`=9 AND `link`=8;
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry` IN(23780,24041,23778,24252,28313);
|
||||
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`,`BroadcastTextID`) VALUES
|
||||
(23780, 1, 0, 'Send these scumbags back to hell! Fire at will!', 14, 0, 100, 0, 0, 0, 'High Executor Anselm',22687),
|
||||
(23780, 2, 0, 'Archers at the ready! Hold your fire!', 14, 0, 100, 0, 0, 0, 'High Executor Anselm',22662),
|
||||
(23780, 3, 0, 'What fool dares to enter her majesty''s dominion unannounced?', 14, 0, 100, 0, 0, 0, 'High Executor Anselm',22663),
|
||||
(23780, 4, 0, 'Is that all you''ve come to say?', 12, 0, 100, 0, 0, 0, 'High Executor Anselm',22686),
|
||||
(24041, 0, 0, 'Arthas is prepared to offer you power beyond your imagination. The puny army you lead here would pale in comparison to the phalanxes at your command if you returned to the Scourge''s embrace.', 12, 0, 100, 0, 0, 0, 'Prince Keleseth',22671),
|
||||
(24041, 1, 0, 'Behold the Vrykul! A race that has perfected war and destruction to the point of an art form. Already they''ve cast their lot with the Lich King! Their dwellings surround you and their numbers are easily five times yours.', 12, 0, 100, 0, 0, 0, 'Prince Keleseth',22722),
|
||||
(24041, 2, 0, 'The choice is yours, Anselm. Return to the Lich King''s army and fight alongside them or remain loyal to your so-called queen and suffer their wrath as they drive you from their homelands!', 12, 0, 100, 0, 0, 0, 'Prince Keleseth',22723),
|
||||
(24041, 3, 0, 'Such a futile gesture.', 12, 0, 100, 0, 0, 0, 'Prince Keleseth',22758),
|
||||
(24041, 4, 0, 'Listen to your men''s dying breaths as I drink in their souls!', 12, 0, 100, 0, 0, 0, 'Prince Keleseth',22766),
|
||||
(24041, 5, 0, 'This will not be the last you hear of me. I will return to spit on your corpse after Utgarde''s armies have descended upon you!', 12, 0, 100, 25, 0, 0, 'Prince Keleseth',22764),
|
||||
(23778, 0, 0, 'Keep them split from their main force!', 14, 0, 100, 0, 0, 0, 'Dark Ranger Lyana',22382),
|
||||
(23778, 0, 1, 'Cover fire, now!', 14, 0, 100, 0, 0, 0, 'Dark Ranger Lyana',22381),
|
||||
(23778, 0, 2, 'Keep firing! Cut off their reinforcements!', 14, 0, 100, 0, 0, 0, 'Dark Ranger Lyana',22380),
|
||||
(24252, 0, 0, 'The foot bone''s connected to the... hip bone! The hip bone''s connected to this... other bone! Hmmmhmmmmhmmm...', 12, 1, 100, 0, 0, 0, '"Hacksaw" Jenny',23066),
|
||||
(24252, 0, 1, 'It''s hard work putting these things together!', 12, 1, 100, 0, 0, 0, '"Hacksaw" Jenny',23065),
|
||||
(28313, 0, 0, 'Longrunner, your fodder... err, people will be a valuable resource against the vrykul. Did I say resource? I meant, ''ally.'' ', 12, 1, 100, 25, 0, 0, 'Apothecary Scyllis',27727);
|
||||
|
||||
DELETE FROM `creature_summon_groups` WHERE `summonerId`=23780;
|
||||
INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES
|
||||
(23780, 0, 1, 24041, 1872.434, -6088.859, 16.2164, 4.480728, 1, 120000),
|
||||
(23780, 0, 1, 24044, 1874.466, -6086.84, 16.18892, 4.502949, 1, 120000),
|
||||
(23780, 0, 1, 24044, 1869.646, -6086.073, 15.54029, 4.572762, 1, 120000),
|
||||
(23780, 0, 1, 24044, 1874.853, -6082.172, 15.52153, 4.502949, 1, 120000),
|
||||
(23780, 0, 1, 24044, 1869.973, -6082.041, 15.13161, 4.572762, 1, 120000),
|
||||
|
||||
(23780, 0, 2, 23883, 1860.395, -6158.918, 23.70322, 1.48353, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1861.823, -6159.1, 23.71347, 1.518436, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1863.592, -6159.383, 23.73547, 1.570796, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1865.439, -6159.756, 23.76573, 1.58825, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1867.87, -6161.885, 23.78007, 1.64061, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1865.965, -6161.611, 23.77313, 1.605703, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1867.106, -6160.068, 23.77399, 1.64061, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1860.735, -6160.702, 23.73123, 1.64061, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1862.237, -6161.036, 23.74415, 1.53589, 1, 120000),
|
||||
(23780, 0, 2, 23883, 1864.234, -6161.245, 23.76622, 1.570796, 1, 120000);
|
||||
|
||||
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`IN(23780,24041,24044,23883,23778,24252,28314);
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN(23780,24044,24041,2378000,23883,2404400,2404401,2404402,2404403,23778,24252,28314);
|
||||
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
|
||||
(23778, 0, 0, 0, 1, 0, 100, 0, 0, 45000, 90000, 180000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Ranger Lyana - OOC - Say'),
|
||||
(24252, 0, 0, 0, 1, 0, 100, 0, 0, 90000, 180000, 360000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, '"Hacksaw" Jenny - OOC - Say'),
|
||||
(28314, 0, 0, 0, 19, 0, 100, 0, 12566, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 28313, 0, 0, 0, 0, 0, 0, 'Longrunner Nanik - On Quest Accept (Help for camp Winterhoof) - Say on Apothecary Scyllis'),
|
||||
(23883, 0, 0, 0, 1, 2, 100, 0, 0, 2000, 2000, 3000, 11, 42905, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Crossbowman - OOC (Phase 2) - Cast Time-Warped Shoot'),
|
||||
(23883, 0, 1, 0, 38, 0, 100, 0, 1, 1, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Crossbowman - On Data Set - Set Phase 2'),
|
||||
(23883, 0, 2, 0, 38, 0, 100, 0, 2, 2, 0, 0, 11, 45254, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Crossbowman - On Data Set - Cast Suicide'),
|
||||
(23883, 0, 3, 0, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Crossbowman - On Just Summoned - Set Passive'),
|
||||
(23780, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - On Spawn - Set Phase 2'),
|
||||
(23780, 0, 1, 0, 20, 2, 100, 0, 11234, 0, 0, 0, 80, 2378000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - On Quest Reward (Report to Anselm) - Run Script'),
|
||||
(24041, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 24041, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Keleseth - On Just Summoned - Start WP'),
|
||||
(24041, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Keleseth - On Just Summoned - Set Passive'),
|
||||
(24041, 0, 2, 0, 40, 0, 100, 0, 2, 24041, 0, 0, 45, 1, 1, 0, 0, 0, 0, 9, 24044, 0, 200, 0, 0, 0, 0, 'Prince Keleseth - On Just Summoned - Set Data'),
|
||||
(24041, 0, 3, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, 42982, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Keleseth - On Data Set - Cast Vampire Prince Teleport'),
|
||||
(24041, 0, 4, 0, 38, 0, 100, 0, 2, 2, 0, 0, 11, 43056, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Prince Keleseth - On Data Set - Cast Vampire Soul Retrieve Channel'),
|
||||
(24044, 0, 5, 0, 38, 0, 100, 0, 3, 3, 0, 0, 11, 43066, 0, 0, 0, 0, 0, 19, 23883, 0, 0, 0, 0, 0, 0, 'Prince Keleseth - On Data Set - Cast Cone of Cold'),
|
||||
(24044, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 87, 2404400,2404401,2404402,2404403, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Guard - On Data Set - Run Random script'),
|
||||
(24044, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Guard - On Just Summoned - Set Passive'),
|
||||
(24044, 0, 2, 0, 38, 0, 100, 0, 2, 2, 0, 0, 17, 375, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Guard - On Data Set - Set Emote State STATE_READY2H'),
|
||||
(2404400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 0, 2404400, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Guard - Script 1 - Set WP Path 1'),
|
||||
(2404401, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 0, 2404401, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Guard - Script 2 - Set WP Path 2'),
|
||||
(2404402, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 0, 2404402, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Guard - Script 3 - Set WP Path 3'),
|
||||
(2404403, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 0, 2404403, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Winterskorn Guard - Script 4 - Set WP Path 4'),
|
||||
(2378000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Set Phase 1'),
|
||||
(2378000, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Summon Group 1'),
|
||||
(2378000, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 107, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Summon Group 2'),
|
||||
(2378000, 9, 4, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 5, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 6, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 7, 0, 0, 0, 100, 0, 12000, 12000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 8, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 9, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 9, 23883, 0, 200, 0, 0, 0, 0, 'High Executor Anselm - Script - Set Data on Forsaken Crossbow Man'),
|
||||
(2378000, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 9, 24044, 0, 200, 0, 0, 0, 0, 'High Executor Anselm - Script - Set Data on Forsaken Crossbow Man'),
|
||||
(2378000, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 12, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 13, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 45, 3, 3, 0, 0, 0, 0, 9, 24044, 0, 200, 0, 0, 0, 0, 'High Executor Anselm - Script - Set Data on Forsaken Crossbow Man'),
|
||||
(2378000, 9, 14, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 15, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 9, 23883, 0, 200, 0, 0, 0, 0, 'High Executor Anselm - Script - Set Data on Forsaken Crossbow Man'),
|
||||
(2378000, 9, 16, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 17, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 18, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Say'),
|
||||
(2378000, 9, 19, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Set Phase 2'),
|
||||
(2378000, 9, 20, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 19, 24041, 0, 0, 0, 0, 0, 0, 'High Executor Anselm - Script - Despawn Prince Keleseth'),
|
||||
(2378000, 9, 21, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 9, 24044, 0, 200, 0, 0, 0, 0, 'High Executor Anselm - Script - Despawn Prince Keleseth');
|
||||
|
||||
|
||||
DELETE FROM `waypoints` WHERE `entry` IN(24041,2404400,2404401,2404402,2404403);
|
||||
INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
|
||||
(24041, 1,1869.068, -6103.232, 18.61364, 'Prince Keleseth'),
|
||||
(24041, 2,1868.818, -6103.982, 18.61364, 'Prince Keleseth'),
|
||||
(24041, 3,1868.568, -6107.982, 19.11364, 'Prince Keleseth'),
|
||||
(24041, 4,1868.068, -6111.732, 19.61364, 'Prince Keleseth'),
|
||||
(24041, 5,1867.818, -6114.482, 20.36364, 'Prince Keleseth'),
|
||||
(24041, 6,1867.64, -6114.858, 20.70264, 'Prince Keleseth'),
|
||||
(24041, 7, 1867.64, -6114.858, 20.70264, 'Prince Keleseth'),
|
||||
(24041, 8,1867.39, -6115.358, 20.70264, 'Prince Keleseth'),
|
||||
(24041, 9,1866.89, -6118.108, 21.20264, 'Prince Keleseth'),
|
||||
(24041, 10,1866.64, -6120.108, 21.95264, 'Prince Keleseth'),
|
||||
(24041, 11,1865.917, -6123.001, 22.53001, 'Prince Keleseth'),
|
||||
(24041, 12,1865.417, -6128.001, 23.28001, 'Prince Keleseth'),
|
||||
(2404400, 1,1875.425, -6090.365, 17.16468, 'Winterskorn Guard'),
|
||||
(2404400, 2,1872.005, -6118.739, 21.11884, 'Winterskorn Guard'),
|
||||
(2404400, 3,1871.447, -6121.616, 22.15128, 'Winterskorn Guard'),
|
||||
(2404400, 4,1870.969, -6123.601, 23.02849, 'Winterskorn Guard'),
|
||||
(2404400, 5,1870.273, -6129.765, 23.70144, 'Winterskorn Guard'),
|
||||
(2404400, 6,1868.965, -6133.233, 23.70714, 'Winterskorn Guard'),
|
||||
(2404400, 7,1869.78, -6135.36, 23.69079, 'Winterskorn Guard'),
|
||||
(2404401, 1,1872.459, -6087.843, 16.14432, 'Winterskorn Guard'),
|
||||
(2404401, 2,1875.459, -6089.593, 16.89432, 'Winterskorn Guard'),
|
||||
(2404401, 3,1874.702, -6092.098, 16.92072, 'Winterskorn Guard'),
|
||||
(2404401, 4,1870.703, -6117.124, 20.66587, 'Winterskorn Guard'),
|
||||
(2404401, 5,1870.083, -6119.843, 21.78509, 'Winterskorn Guard'),
|
||||
(2404401, 6,1869.592, -6122.629, 22.48122, 'Winterskorn Guard'),
|
||||
(2404401, 7,1869.204, -6126.333, 23.55935, 'Winterskorn Guard'),
|
||||
(2404402, 1,1869.436, -6101.171, 17.9098, 'Winterskorn Guard'),
|
||||
(2404402, 2,1868.036, -6112.884, 19.76395, 'Winterskorn Guard'),
|
||||
(2404402, 3,1867.521, -6115.753, 20.59173, 'Winterskorn Guard'),
|
||||
(2404402, 4,1866.822, -6117.842, 21.29473, 'Winterskorn Guard'),
|
||||
(2404402, 5,1866.265, -6120.752, 21.82966, 'Winterskorn Guard'),
|
||||
(2404402, 6,1865.867, -6124.451, 22.92881, 'Winterskorn Guard'),
|
||||
(2404403, 1,1865.726, -6101.417, 17.51821, 'Winterskorn Guard'),
|
||||
(2404403, 2,1865.292, -6105.095, 18.34744, 'Winterskorn Guard'),
|
||||
(2404403, 3,1864.667, -6110.865, 19.50322, 'Winterskorn Guard'),
|
||||
(2404403, 4,1864.29, -6113.655, 19.8951, 'Winterskorn Guard'),
|
||||
(2404403, 5,1863.765, -6115.762, 20.65482, 'Winterskorn Guard'),
|
||||
(2404403, 6,1863.103, -6118.501, 21.33856, 'Winterskorn Guard'),
|
||||
(2404403, 7,1862.853, -6120.251, 22.08856, 'Winterskorn Guard'),
|
||||
(2404403, 8,1862.581, -6121.738, 22.45348, 'Winterskorn Guard'),
|
||||
(2404403, 9,1862.182, -6125.501, 23.30622, 'Winterskorn Guard');
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN(42905,43066,43055,43053,42982,43056,43054);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 42905, 0, 0, 31, 0, 3, 24044, 0, 0, 0, 0, '', 'Time-Warped Shoot targets Winterskorn Guard'),
|
||||
(13, 1, 43055, 0, 0, 31, 0, 3, 23883, 0, 0, 0, 0, '', 'Vampire Soul Retrieve targets Forsaken Crossbowman'),
|
||||
(13, 1, 43053, 0, 0, 31, 0, 3, 24041, 0, 0, 0, 0, '', 'Vampire Soul Expel targets Prince Keleseth'),
|
||||
(13, 1, 42982, 0, 0, 31, 0, 3, 23883, 0, 0, 0, 0, '', 'Vampire Prince Teleport targets Forsaken Crossbowman'),
|
||||
(13, 1, 43056, 0, 0, 31, 0, 3, 23883, 0, 0, 0, 0, '', 'Vampire Soul Retrieve channel targets Forsaken Crossbowman'),
|
||||
(13, 2, 43056, 0, 0, 31, 0, 3, 23883, 0, 0, 0, 0, '', 'Vampire Soul Retrieve channel targets Forsaken Crossbowman'),
|
||||
(13, 1, 43054, 0, 0, 31, 0, 3, 24041, 0, 0, 0, 0, '', 'Vampire Soul Expel Channeltargets Prince Keleseth');
|
||||
@@ -0,0 +1,14 @@
|
||||
-- Proenitus, Azuremyst Isle
|
||||
UPDATE `creature_template` SET `gossip_menu_id`=7305 WHERE `entry`=16477;
|
||||
-- 8667 before quest 9280 or 9369 is completed, 8669 after quest 9280 or 9369 is completed
|
||||
DELETE FROM `gossip_menu` WHERE `entry`=7305;
|
||||
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
|
||||
(7305,8667),
|
||||
(7305,8669);
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7305;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(14, 7305, 8669, 0, 0, 8, 0, 9280, 0, 0, 0, 0, 0, '', 'Proenitus - Show Gossip Text only if Replenishing the Healing Crystals rewarded - or'),
|
||||
(14, 7305, 8669, 0, 1, 8, 0, 9369, 0, 0, 0, 0, 0, '', 'Proenitus - Show Gossip Text only if Replenishing the Healing Crystals rewarded - or'),
|
||||
(14, 7305, 8667, 0, 0, 8, 0, 9280, 0, 0, 1, 0, 0, '', 'Proenitus - Show Gossip Text only if Replenishing the Healing Crystals not rewarded - and'),
|
||||
(14, 7305, 8667, 0, 0, 8, 0, 9369, 0, 0, 1, 0, 0, '', 'Proenitus - Show Gossip Text only if Replenishing the Healing Crystals not rewarded');
|
||||
@@ -0,0 +1,25 @@
|
||||
-- Reanimated Frost Wyrm SAI
|
||||
SET @ENTRY := 26841;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,0,0,100,0,0,0,5000,7000,11,47425,64,0,0,0,0,2,0,0,0,0,0,0,0,"Reanimated Frost Wyrm - In Combat CMC - Cast 'Frost Breath'");
|
||||
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (1169630, 1169640, 1169650, 1169660, 1169670, 1169680, 1169740, 1169750, 1169760, 1169770, 1169780, 1169790, 1169800, 1169810, 1169820, 1169910, 1169920, 1169930, 1170010, 1170020, 1170030, 1170040, 1170050, 1170060, 1170070, 1170190, 1170220, 1170230, 1170480, 1170490, 1170500, 1170510, 1170520, 1170530, 1170550, 1170560);
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (1311770, 1311780, 1099150, 1099160, 1099270, 1158790);
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (1081500, 1081510, 1081520, 1081550, 1081560, 1081580);
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (971330, 971340, 971350, 971390, 971400, 1076260);
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (1181900, 1181890, 1181860, 1181850, 1181880);
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (404970, 404980, 404990, 405000, 405010, 405020, 405030, 405040, 405050, 1124010);
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (1033880, 1033910, 1033940, 1033960, 1033980, 1034000, 1034030, 1034110);
|
||||
UPDATE `waypoint_data` SET `move_type`=1 WHERE `id` IN (1311770,1311780);
|
||||
|
||||
UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE id IN (26175);
|
||||
|
||||
UPDATE `creature_addon` SET bytes1=50331648 WHERE `guid`=118406;
|
||||
UPDATE `creature_template_addon` SET bytes1=0, bytes2=1 WHERE `entry` IN (728, 731, 3862, 9696, 10200, 11361, 30219);
|
||||
|
||||
DELETE FROM `creature_equip_template` WHERE `entry`=27361;
|
||||
INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`,`VerifiedBuild`) VALUES
|
||||
(27361, 1, 35312, 0, 0, 12340),
|
||||
(27361, 2, 1903, 0, 0, 12340);
|
||||
@@ -0,0 +1,77 @@
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN(43055,43053,43056,43054);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 2, 43056, 0, 0, 31, 0, 3, 23883, 0, 0, 0, 0, '', 'Vampire Soul Retrieve channel targets Forsaken Crossbowman'),
|
||||
(13, 4, 43056, 0, 0, 31, 0, 3, 23883, 0, 0, 0, 0, '', 'Vampire Soul Retrieve channel targets Forsaken Crossbowman');
|
||||
|
||||
-- Marin Noggenfogger SAI
|
||||
SET @ENTRY := 7564;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,20,0,100,0,2662,0,0,0,80,@ENTRY*100+00,0,0,0,0,0,1,0,0,0,0,0,0,0,"Marin Noggenfogger - On Quest '2662' Finished - Run Script");
|
||||
|
||||
-- Actionlist SAI
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9;
|
||||
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
|
||||
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Marin Noggenfogger - On Script - Remove Npc Flag Questgiver"),
|
||||
(@ENTRY*100,9,1,0,0,0,100,0,500,500,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Marin Noggenfogger - On Script - Say Line 0"),
|
||||
(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,5,432,0,0,0,0,0,1,0,0,0,0,0,0,0,"Marin Noggenfogger - On Script - Play Emote 432"),
|
||||
(@ENTRY*100,9,3,0,0,0,100,0,5000,5000,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Marin Noggenfogger - On Script - Add Npc Flag Questgiver");
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry`=7564;
|
||||
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
|
||||
(7564, 0, 0, 'I''m going to carefully mix this - oops! ...Well, I spilled a little, but it''s ready!', 12, 0, 100, 0, 0, 0, 'Marin Noggenfogger', 4548);
|
||||
|
||||
-- Sprinkle SAI
|
||||
SET @ENTRY := 7583;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
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
|
||||
(@ENTRY,0,0,0,20,0,100,0,2641,0,0,0,80,@ENTRY*100+00,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Quest '' Finished - Run Script");
|
||||
|
||||
-- Actionlist SAI
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9;
|
||||
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
|
||||
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Remove Npc Flag Questgiver"),
|
||||
(@ENTRY*100,9,1,0,0,0,100,0,500,500,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Say Line 0"),
|
||||
(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,5,432,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Play Emote 432"),
|
||||
(@ENTRY*100,9,3,0,0,0,100,0,5000,5000,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Add Npc Flag Questgiver");
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry`=7583;
|
||||
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
|
||||
(7583, 0, 0, 'Just sit tight while i get this prepared for you!', 12, 0, 100, 0, 0, 0, 'Sprinkle', 3661);
|
||||
|
||||
UPDATE `smart_scripts` SET `event_type`=11 WHERE `entryorguid`=29327 AND `source_type`=0 AND `id`=1 AND `link`=0;
|
||||
UPDATE `smart_scripts` SET `link`=4 WHERE `entryorguid`=29327 AND `source_type`=0 AND `id`=3 AND `link`=0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=29327 AND `source_type`=0 AND `id`=4;
|
||||
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
|
||||
(29327, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 180000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frost Leopard - On Gossip Option 0 Selected - Despawn After 3 mins');
|
||||
UPDATE `creature_template` SET `unit_flags`=0 WHERE `entry`=29319;
|
||||
|
||||
UPDATE `smart_scripts` SET `event_type`=11 WHERE `entryorguid`=29319 AND `source_type`=0 AND `id`=1 AND `link`=0;
|
||||
UPDATE `smart_scripts` SET `link`=4 WHERE `entryorguid`=29319 AND `source_type`=0 AND `id`=3 AND `link`=0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=29319 AND `source_type`=0 AND `id`=4;
|
||||
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
|
||||
(29319, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 180000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Icepaw Bear - On Gossip Option 0 Selected - Despawn After 3 mins');
|
||||
|
||||
UPDATE `creature_template` SET `unit_flags`=262400 WHERE `entry`=33007;
|
||||
UPDATE `creature_template` SET `unit_flags`=262400 WHERE `entry`=33008;
|
||||
UPDATE `creature_template` SET `unit_flags`=32768 WHERE `entry`=29319;
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` IN(33007,33008,29319);
|
||||
INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
|
||||
(33007, 0, 0x0, 0x1, '42386'), -- 33007 - 42386
|
||||
(33008, 0, 0x0, 0x1, '54240 42386'), -- 33008 - 54240, 42386
|
||||
(29319, 0, 0x0, 0x1, '54240'); -- 29319 - 54240
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN(2932701,2932703,2931901,2931903) AND `id`=2;
|
||||
|
||||
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
|
||||
(2932701, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 19, 262400, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frost Leopard - On Script - Remove Unit Flags'),
|
||||
(2932703, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 19, 262400, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Frost Leopard - On Script - Remove Unit Flags'),
|
||||
(2931901, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 19, 262400, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Icepaw Bear - On Script - Remove Unit Flags'),
|
||||
(2931903, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 19, 262400, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Icepaw Bear - On Script - Remove Unit Flags');
|
||||
|
||||
UPDATE `smart_scripts` SET `event_param3`=12000, `event_param4`=19000 WHERE `entryorguid`=3752 AND `id`=2;
|
||||
UPDATE `smart_scripts` SET `event_param3`=12000, `event_param4`=19000 WHERE `entryorguid`=3755 AND `id`=2;
|
||||
UPDATE `smart_scripts` SET `event_param3`=12000, `event_param4`=19000 WHERE `entryorguid`=3754 AND `id`=2;
|
||||
@@ -0,0 +1,42 @@
|
||||
SET @OGUID := 75983;
|
||||
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=17606;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=17606 AND `source_type`=0;
|
||||
|
||||
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
|
||||
(17606,0,0,0,1,0,100,0,0,0,300000,600000,11,12544,0,0,0,0,0,1,0,0,0,0,0,0,0,'Sunhawk Reclaimer - OOC - Cast Frost Armor'),
|
||||
(17606,0,1,0,4,0,100,0,0,0,0,0,11,12544,0,0,0,0,0,1,0,0,0,0,0,0,0,'Sunhawk Reclaimer - On Agro - Cast Frost Armor'),
|
||||
(17606,0,2,0,0,0,100,0,0,3000,4500,5000,11,19816,64,0,0,0,0,2,0,0,0,0,0,0,0,'Sunhawk Reclaimer - IC - Cast Fireball');
|
||||
|
||||
DELETE FROM `gameobject` WHERE `id`=181898;
|
||||
INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES
|
||||
(@OGUID+00, 181898, 530, 1, 1, -2128.94, -11347.78, 63.18245, 5.846854, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+01, 181898, 530, 1, 1, -2090.865, -11338.04, 62.10437, 0.8726639, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+02, 181898, 530, 1, 1, -2114.608, -11316.94, 63.31125, 2.635444, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+03, 181898, 530, 1, 1, -2102.472, -11289.79, 63.27425, 5.462882, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+04, 181898, 530, 1, 1, -2094.636, -11376.86, 63.56096, 2.583081, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+05, 181898, 530, 1, 1, -2158.835, -11376.7, 65.99394, 4.363324, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+06, 181898, 530, 1, 1, -2144.111, -11395.16, 68.00031, 1.378809, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+07, 181898, 530, 1, 1, -2108.114, -11325.42, 63.28682, 3.019413, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+08, 181898, 530, 1, 1, -2055.864, -11367.56, 63.91008, 1.431168, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+09, 181898, 530, 1, 1, -2074.024, -11286.16, 65.40942, 5.235988, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+10, 181898, 530, 1, 1, -2050.685, -11284.97, 67.24374, 2.164206, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+11, 181898, 530, 1, 1, -2092.109, -11241.65, 68.33092, 3.054327, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+12, 181898, 530, 1, 1, -2047.771, -11247.62, 78.15426, 3.455756, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+13, 181898, 530, 1, 1, -2093.055, -11278.73, 64.95576, 2.82743, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+14, 181898, 530, 1, 1, -2072.344, -11255.33, 68.58928, 6.021387, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+15, 181898, 530, 1, 1, -2136.231, -11360.67, 63.38724, 3.403396, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+16, 181898, 530, 1, 1, -2005.523, -11315.54, 62.96782, 2.321287, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+17, 181898, 530, 1, 1, -2014.982, -11348.47, 65.60223, 3.892087, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+18, 181898, 530, 1, 1, -2090.292, -11311.16, 63.29559, 1.221729, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+19, 181898, 530, 1, 1, -2075.02, -11326.98, 62.18038, 0.4014249, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+20, 181898, 530, 1, 1, -2072.561, -11347.09, 62.11678, 0.9250238, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+21, 181898, 530, 1, 1, -2036.568, -11329.65, 66.35213, 0.9599299, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+22, 181898, 530, 1, 1, -2106.364, -11361.37, 63.50148, 2.844883, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+23, 181898, 530, 1, 1, -2057.144, -11409.91, 57.81938, 4.607672, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+24, 181898, 530, 1, 1, -2116.335, -11416.35, 66.44828, 2.652894, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+25, 181898, 530, 1, 1, -2126.774, -11243.78, 66.18503, 5.480334, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+26, 181898, 530, 1, 1, -2108.323, -11212.03, 78.05769, 1.692969, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+27, 181898, 530, 1, 1, -2121.754, -11306.33, 63.27412, 4.921829, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+28, 181898, 530, 1, 1, -2073.555, -11372.19, 63.8179, 3.124123, 0, 0, 0, 1, 120, 255, 1), -- 181898 (Area: 3525)
|
||||
(@OGUID+29, 181898, 530, 1, 1, -2103.406, -11396.29, 63.33431, 6.126106, 0, 0, 0, 1, 120, 255, 1); -- 181898 (Area: 3525)
|
||||
@@ -0,0 +1,279 @@
|
||||
-- Stormpeak Wyrm proper spawning and waypoints
|
||||
|
||||
DELETE FROM `creature` WHERE `guid` IN (101053,101062,101074,101075,101077,101116,101087);
|
||||
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
|
||||
(101053,29753,571,1,1,7452.299,-1354.762,942.6544,1.972222,120,0,0),
|
||||
(101062,29753,571,1,1,7236.676,-1416.466,931.475,0.1919862,120,0,0),
|
||||
(101074,29753,571,1,1,7353.788,-1644.01,1141.247,1.745329,120,0,0),
|
||||
(101075,29753,571,1,1,7248.159,-1659.583,1080.83,1.099557,120,0,0),
|
||||
(101077,29753,571,1,1,6998.847,-1445.083,984.7883,6.126106,120,0,0),
|
||||
(101116,29753,571,1,1,7144.828,-1255.926,1100.343,5.77704,120,0,0),
|
||||
(101087,29753,571,1,1,7135.227,-1283.292,1091.594,5.72468,120,0,0);
|
||||
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=7584.947,`position_y`=-1634.492,`position_z`=1212.406,`orientation`=2.059489 WHERE `guid`=101123;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=7694.302,`position_y`=-1493.291,`position_z`=1177.766,`orientation`=2.70526 WHERE `guid`=101124;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=7596.796,`position_y`=-1506.441,`position_z`=1053.565,`orientation`=2.199115 WHERE `guid`=101125;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=7684.877,`position_y`=-1422.165,`position_z`=1176.521,`orientation`=2.80998 WHERE `guid`=101126;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=7477.212,`position_y`=-1534.251,`position_z`=1038.112,`orientation`=2.146755 WHERE `guid`=101127;
|
||||
|
||||
DELETE FROM `creature_addon` WHERE `guid` IN (101123,101124,101125,101126,101127,101053,101062,101074,101075,101077,101116,101087);
|
||||
INSERT INTO `creature_addon` (`guid`,`bytes1`,`bytes2`,`auras`) VALUES
|
||||
(101123,50331649,1, ''),(101124,50331649,1, ''),(101125,50331649,1, ''),(101126,50331649,1, ''),(101127,50331649,1, ''),(101053,50331649,1, ''),
|
||||
(101062,50331649,1, ''),(101074,50331649,1, ''),(101075,50331649,1, ''),(101077,50331649,1, ''),(101116,50331649,1, ''),(101087,50331649,1, '');
|
||||
|
||||
DELETE FROM `waypoint_data` WHERE `id` IN (1011090,1011110,1011120,1011210,1011230,1011240);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101000;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7501.124,`position_y`=-1449.262,`position_z`=1017.798 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7501.124,-1449.262,1017.798,0,0,1,0,100,0),
|
||||
(@PATH,2,7376.508,-1303.557,1049.854,0,0,1,0,100,0),
|
||||
(@PATH,3,7325.549,-1146.471,1046.354,0,0,1,0,100,0),
|
||||
(@PATH,4,7422.022,-1135.82,1033.438,0,0,1,0,100,0),
|
||||
(@PATH,5,7518.522,-1237.663,1056.826,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101107;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7286.94,`position_y`=-1422.521,`position_z`=978.0876 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7286.94,-1422.521,978.0876,0,0,1,0,100,0),
|
||||
(@PATH,2,7141.904,-1431.155,978.0876,0,0,1,0,100,0),
|
||||
(@PATH,3,7141.696,-1557.372,978.0876,0,0,1,0,100,0),
|
||||
(@PATH,4,7391.402,-1533.6,1071.171,0,0,1,0,100,0),
|
||||
(@PATH,5,7711.191,-1351.858,1194.367,0,0,1,0,100,0),
|
||||
(@PATH,6,7616.785,-1342.911,1117.866,0,0,1,0,100,0),
|
||||
(@PATH,7,7441.751,-1377.483,985.6154,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101108;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7451.667,`position_y`=-1273.214,`position_z`=958.2651 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7451.667,-1273.214,958.2651,0,0,1,0,100,0),
|
||||
(@PATH,2,7438.734,-1387.923,990.5983,0,0,1,0,100,0),
|
||||
(@PATH,3,7339.777,-1394.429,954.5706,0,0,1,0,100,0),
|
||||
(@PATH,4,7277.429,-1311.084,941.7929,0,0,1,0,100,0),
|
||||
(@PATH,5,7389.834,-1218.347,954.5706,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101109;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7361.022,`position_y`=-1158.353,`position_z`=980.812 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7361.022,-1158.353,980.812,0,0,1,0,100,0),
|
||||
(@PATH,2,7505.094,-1216.21,980.812,0,0,1,0,100,0),
|
||||
(@PATH,3,7458.424,-1438.003,1005.173,0,0,1,0,100,0),
|
||||
(@PATH,4,7528.125,-1725.565,1300.173,0,0,1,0,100,0),
|
||||
(@PATH,5,7422.311,-1569.981,1141.312,0,0,1,0,100,0),
|
||||
(@PATH,6,7330.956,-1412.603,980.812,0,0,1,0,100,0),
|
||||
(@PATH,7,7303.932,-1283.664,980.812,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101110;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7468.895,`position_y`=-1421.992,`position_z`=1035.363 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7468.895,-1421.992,1035.363,0,0,1,0,100,0),
|
||||
(@PATH,2,7499.714,-1349.263,1035.363,0,0,1,0,100,0),
|
||||
(@PATH,3,7436.533,-1280.687,1035.363,0,0,1,0,100,0),
|
||||
(@PATH,4,7396.054,-1281.403,1035.363,0,0,1,0,100,0),
|
||||
(@PATH,5,7298.188,-1334.745,1035.363,0,0,1,0,100,0),
|
||||
(@PATH,6,7306.776,-1409.522,1035.363,0,0,1,0,100,0),
|
||||
(@PATH,7,7403.804,-1456.458,1035.363,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101111;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7146.302,`position_y`=-1430.093,`position_z`=1026.784 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7146.302,-1430.093,1026.784,0,0,1,0,100,0),
|
||||
(@PATH,2,7277.046,-1312.483,941.7841,0,0,1,0,100,0),
|
||||
(@PATH,3,7350.68,-1247.736,932.9788,0,0,1,0,100,0),
|
||||
(@PATH,4,7462.04,-1145.189,1073.34,0,0,1,0,100,0),
|
||||
(@PATH,5,7534.368,-1192.623,1109.757,0,0,1,0,100,0),
|
||||
(@PATH,6,7491.979,-1297.336,1075.256,0,0,1,0,100,0),
|
||||
(@PATH,7,7435.823,-1388.198,963.8117,0,0,1,0,100,0),
|
||||
(@PATH,8,7374.318,-1466.145,951.8396,0,0,1,0,100,0),
|
||||
(@PATH,9,7270.311,-1513.188,983.5063,0,0,1,0,100,0),
|
||||
(@PATH,10,7186.261,-1542.495,999.2841,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101112;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7265.552,`position_y`=-1393.914,`position_z`=944.9113 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7265.552,-1393.914,944.9113,0,0,1,0,100,0),
|
||||
(@PATH,2,7286.167,-1323.842,960.5223,0,0,1,0,100,0),
|
||||
(@PATH,3,7397.717,-1365.071,953.9946,0,0,1,0,100,0),
|
||||
(@PATH,4,7411.863,-1480.148,974.6611,0,0,1,0,100,0),
|
||||
(@PATH,5,7293.046,-1491.665,952.7723,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101113;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7415.385,`position_y`=-1216.037,`position_z`=904.5762 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7415.385,-1216.037,904.5762,0,0,1,0,100,0),
|
||||
(@PATH,2,7414.542,-1215.5,904.5762,0,0,1,0,100,0),
|
||||
(@PATH,3,7133.187,-1316.918,1033.504,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101114;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7325.963,`position_y`=-1333.517,`position_z`=1030.937 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7325.963,-1333.517,1030.937,0,0,1,0,100,0),
|
||||
(@PATH,2,7292.63,-1292.261,1030.937,0,0,1,0,100,0),
|
||||
(@PATH,3,7242.074,-1296.146,1030.937,0,0,1,0,100,0),
|
||||
(@PATH,4,7221.022,-1309.755,1030.937,0,0,1,0,100,0),
|
||||
(@PATH,5,7184.733,-1362.635,1030.937,0,0,1,0,100,0),
|
||||
(@PATH,6,7258.752,-1422.953,1030.937,0,0,1,0,100,0),
|
||||
(@PATH,7,7322.385,-1391.359,1030.937,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101115;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7324.458,`position_y`=-1450.861,`position_z`=1008.698 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7324.458,-1450.861,1008.698,0,0,1,0,100,0),
|
||||
(@PATH,2,7325.36,-1451.292,1008.698,0,0,1,0,100,0),
|
||||
(@PATH,3,7386.206,-1228.145,918.316,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101117;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7136.357,`position_y`=-1325.542,`position_z`=1034.863 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7136.357,-1325.542,1034.863,0,0,1,0,100,0),
|
||||
(@PATH,2,7135.358,-1325.567,1034.863,0,0,1,0,100,0),
|
||||
(@PATH,3,7313.184,-1221.475,952.9126,0,0,1,0,100,0),
|
||||
(@PATH,4,7282.429,-1268.767,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,5,7309.16,-1330.981,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,6,7367.971,-1345.04,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,7,7421.329,-1313.719,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,8,7452.836,-1261.122,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,9,7428.057,-1204.526,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,10,7386.783,-1192.458,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,11,7339.101,-1202.982,952.9125,0,0,1,0,100,0),
|
||||
(@PATH,12,7313.184,-1221.475,952.9126,0,0,1,0,100,0),
|
||||
(@PATH,13,7282.429,-1268.767,952.9125,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101118;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7232.853,`position_y`=-1552.436,`position_z`=1018.612 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7232.853,-1552.436,1018.612,0,0,1,0,100,0),
|
||||
(@PATH,2,7307.723,-1450.282,1031.335,0,0,1,0,100,0),
|
||||
(@PATH,3,7331.675,-1329.285,1071.668,0,0,1,0,100,0),
|
||||
(@PATH,4,7358.584,-1200.453,1095.084,0,0,1,0,100,0),
|
||||
(@PATH,5,7466.604,-1189.773,1087.835,0,0,1,0,100,0),
|
||||
(@PATH,6,7551.937,-1306.039,1036.918,0,0,1,0,100,0),
|
||||
(@PATH,7,7448.903,-1429.033,989.2788,0,0,1,0,100,0),
|
||||
(@PATH,8,7265.264,-1460.603,924.7513,0,0,1,0,100,0),
|
||||
(@PATH,9,7092.603,-1462.597,1039.613,0,0,1,0,100,0),
|
||||
(@PATH,10,6996.566,-1627.143,1060.558,0,0,1,0,100,0),
|
||||
(@PATH,11,7050.83,-1759.601,1026.474,0,0,1,0,100,0),
|
||||
(@PATH,12,7171.794,-1623.425,1024.391,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101119;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7259.109,`position_y`=-1469.671,`position_z`=987.5555 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7259.109,-1469.671,987.5555,0,0,1,0,100,0),
|
||||
(@PATH,2,7301.777,-1415.748,987.5555,0,0,1,0,100,0),
|
||||
(@PATH,3,7272.482,-1346.15,987.5555,0,0,1,0,100,0),
|
||||
(@PATH,4,7209.799,-1353.067,987.5555,0,0,1,0,100,0),
|
||||
(@PATH,5,7162.837,-1385.03,987.5555,0,0,1,0,100,0),
|
||||
(@PATH,6,7167.143,-1445.456,987.5555,0,0,1,0,100,0),
|
||||
(@PATH,7,7194.672,-1478.044,987.5555,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101120;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7327.854,`position_y`=-1587.84,`position_z`=1019.788 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7327.854,-1587.84,1019.788,0,0,1,0,100,0),
|
||||
(@PATH,2,7289.005,-1581.716,1019.788,0,0,1,0,100,0),
|
||||
(@PATH,3,7237.962,-1537.732,1019.788,0,0,1,0,100,0),
|
||||
(@PATH,4,7256.116,-1485.327,1019.788,0,0,1,0,100,0),
|
||||
(@PATH,5,7329.179,-1461.23,1019.788,0,0,1,0,100,0),
|
||||
(@PATH,6,7373.025,-1497.708,1019.788,0,0,1,0,100,0),
|
||||
(@PATH,7,7376.84,-1544.165,1019.788,0,0,1,0,100,0),
|
||||
(@PATH,8,7361.692,-1568.81,1019.788,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101121;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7199.313,`position_y`=-1325.969,`position_z`=978.4598 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7199.313,-1325.969,978.4598,0,0,1,0,100,0),
|
||||
(@PATH,2,7170.299,-1447.351,1015.265,0,0,1,0,100,0),
|
||||
(@PATH,3,7248.966,-1581.538,1015.265,0,0,1,0,100,0),
|
||||
(@PATH,4,7413.176,-1485.288,1031.738,0,0,1,0,100,0),
|
||||
(@PATH,5,7400.03,-1300.325,978.4598,0,0,1,0,100,0),
|
||||
(@PATH,6,7290.922,-1270.148,1009.015,0,0,1,0,100,0);
|
||||
|
||||
-- Pathing for Stormpeak Wyrm Entry: 29753
|
||||
SET @NPC := 101122;
|
||||
SET @PATH := @NPC * 10;
|
||||
UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=7202.806,`position_y`=-1459.161,`position_z`=960.2362 WHERE `guid`=@NPC;
|
||||
DELETE FROM `creature_addon` WHERE `guid`=@NPC;
|
||||
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`,`auras`) VALUES (@NPC,@PATH,50331648,1, '');
|
||||
DELETE FROM `waypoint_data` WHERE `id`=@PATH;
|
||||
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
|
||||
(@PATH,1,7202.806,-1459.161,960.2362,0,0,1,0,100,0),
|
||||
(@PATH,2,7251.087,-1367.685,984.6526,0,0,1,0,100,0),
|
||||
(@PATH,3,7332.536,-1407.866,956.3196,0,0,1,0,100,0),
|
||||
(@PATH,4,7354.014,-1492.446,984.6526,0,0,1,0,100,0),
|
||||
(@PATH,5,7307.592,-1550.958,984.6525,0,0,1,0,100,0),
|
||||
(@PATH,6,7252.655,-1530.636,984.6526,0,0,1,0,100,0);
|
||||
@@ -236,7 +236,7 @@ namespace VMAP
|
||||
MapData::iterator map_iter = mapData.find(mapID);
|
||||
if (map_iter == mapData.end())
|
||||
{
|
||||
printf("spawning Map %d\n", mapID);
|
||||
printf("spawning Map %u\n", mapID);
|
||||
mapData[mapID] = current = new MapSpawns();
|
||||
}
|
||||
else current = (*map_iter).second;
|
||||
|
||||
@@ -164,7 +164,7 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
continue;
|
||||
}
|
||||
|
||||
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0);
|
||||
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE);
|
||||
bool spellUsed = false;
|
||||
|
||||
// Some spells can target enemy or friendly (DK Ghoul's Leap)
|
||||
@@ -192,7 +192,7 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
// No enemy, check friendly
|
||||
if (!spellUsed)
|
||||
{
|
||||
for (std::set<uint64>::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
|
||||
for (GuidSet::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
|
||||
{
|
||||
Unit* ally = ObjectAccessor::GetUnit(*me, *tar);
|
||||
|
||||
@@ -215,7 +215,7 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
}
|
||||
else if (me->GetVictim() && CanAttack(me->GetVictim()) && spellInfo->CanBeUsedInCombat())
|
||||
{
|
||||
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0);
|
||||
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE);
|
||||
if (spell->CanAutoCast(me->GetVictim()))
|
||||
targetSpellStore.push_back(std::make_pair(me->GetVictim(), spell));
|
||||
else
|
||||
|
||||
@@ -57,7 +57,7 @@ class PetAI : public CreatureAI
|
||||
void UpdateAllies();
|
||||
|
||||
TimeTracker i_tracker;
|
||||
std::set<uint64> m_AllySet;
|
||||
GuidSet m_AllySet;
|
||||
uint32 m_updateAlliesTimer;
|
||||
|
||||
Unit* SelectNextTarget(bool allowAutoSelect) const;
|
||||
|
||||
@@ -35,7 +35,7 @@ int TotemAI::Permissible(Creature const* creature)
|
||||
return PERMIT_BASE_NO;
|
||||
}
|
||||
|
||||
TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid(0)
|
||||
TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid()
|
||||
{
|
||||
ASSERT(c->IsTotem());
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
||||
me->CastSpell(victim, me->ToTotem()->GetSpell(), false);
|
||||
}
|
||||
else
|
||||
i_victimGuid = 0;
|
||||
i_victimGuid.Clear();
|
||||
}
|
||||
|
||||
void TotemAI::AttackStart(Unit* /*victim*/)
|
||||
|
||||
@@ -39,7 +39,7 @@ class TotemAI : public CreatureAI
|
||||
static int Permissible(Creature const* creature);
|
||||
|
||||
private:
|
||||
uint64 i_victimGuid;
|
||||
ObjectGuid i_victimGuid;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -137,8 +137,8 @@ class UnitAI
|
||||
virtual void DoAction(int32 /*param*/) { }
|
||||
virtual uint32 GetData(uint32 /*id = 0*/) const { return 0; }
|
||||
virtual void SetData(uint32 /*id*/, uint32 /*value*/) { }
|
||||
virtual void SetGUID(uint64 /*guid*/, int32 /*id*/ = 0) { }
|
||||
virtual uint64 GetGUID(int32 /*id*/ = 0) const { return 0; }
|
||||
virtual void SetGUID(ObjectGuid /*guid*/, int32 /*id*/ = 0) { }
|
||||
virtual ObjectGuid GetGUID(int32 /*id*/ = 0) const { return ObjectGuid::Empty; }
|
||||
|
||||
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
|
||||
// Select the targets satisfying the predicate.
|
||||
|
||||
@@ -38,16 +38,11 @@ void CreatureAI::OnCharmed(bool /*apply*/)
|
||||
AISpellInfoType* UnitAI::AISpellInfo;
|
||||
AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; }
|
||||
|
||||
void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= NULL*/)
|
||||
void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= nullptr*/)
|
||||
{
|
||||
sCreatureTextMgr->SendChat(me, id, whisperTarget);
|
||||
}
|
||||
|
||||
void CreatureAI::TalkToMap(uint8 id, WorldObject const* whisperTarget /*= NULL*/)
|
||||
{
|
||||
sCreatureTextMgr->SendChat(me, id, whisperTarget, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
|
||||
}
|
||||
|
||||
void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToNearestTarget /* = 50.0f*/)
|
||||
{
|
||||
if (!creature)
|
||||
|
||||
@@ -78,8 +78,8 @@ class CreatureAI : public UnitAI
|
||||
Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
|
||||
public:
|
||||
void Talk(uint8 id, WorldObject const* whisperTarget = NULL);
|
||||
void TalkToMap(uint8 id, WorldObject const* whisperTarget = NULL);
|
||||
void Talk(uint8 id, WorldObject const* whisperTarget = nullptr);
|
||||
|
||||
explicit CreatureAI(Creature* creature) : UnitAI(creature), me(creature), m_MoveInLineOfSight_locked(false) { }
|
||||
|
||||
virtual ~CreatureAI() { }
|
||||
@@ -165,14 +165,12 @@ class CreatureAI : public UnitAI
|
||||
|
||||
/// == Fields =======================================
|
||||
|
||||
// Pointer to controlled by AI creature
|
||||
//Creature* const me;
|
||||
|
||||
virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) { }
|
||||
|
||||
virtual void OnSpellClick(Unit* /*clicker*/, bool& /*result*/) { }
|
||||
|
||||
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
|
||||
|
||||
protected:
|
||||
virtual void MoveInLineOfSight(Unit* /*who*/);
|
||||
|
||||
|
||||
@@ -311,8 +311,8 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o
|
||||
if (Player* player = unit->ToPlayer())
|
||||
player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
else
|
||||
TC_LOG_ERROR("scripts", "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.",
|
||||
me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
|
||||
TC_LOG_ERROR("scripts", "Creature %s Tried to teleport non-player unit (%s) to x: %f y:%f z: %f o: %f. Aborted.",
|
||||
me->GetGUID().ToString().c_str(), unit->GetGUID().ToString().c_str(), x, y, z, o);
|
||||
}
|
||||
|
||||
void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
||||
|
||||
@@ -40,7 +40,7 @@ class InstanceScript;
|
||||
class SummonList
|
||||
{
|
||||
public:
|
||||
typedef std::list<uint64> StorageType;
|
||||
typedef GuidList StorageType;
|
||||
typedef StorageType::iterator iterator;
|
||||
typedef StorageType::const_iterator const_iterator;
|
||||
typedef StorageType::size_type size_type;
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
{
|
||||
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
|
||||
StorageType listCopy = storage_;
|
||||
Trinity::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max);
|
||||
Trinity::Containers::RandomResizeList<ObjectGuid, Predicate>(listCopy, predicate, max);
|
||||
for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); )
|
||||
{
|
||||
Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
|
||||
@@ -126,7 +126,7 @@ class EntryCheckPredicate
|
||||
{
|
||||
public:
|
||||
EntryCheckPredicate(uint32 entry) : _entry(entry) { }
|
||||
bool operator()(uint64 guid) { return GUID_ENPART(guid) == _entry; }
|
||||
bool operator()(ObjectGuid guid) { return guid.GetEntry() == _entry; }
|
||||
|
||||
private:
|
||||
uint32 _entry;
|
||||
@@ -135,7 +135,7 @@ class EntryCheckPredicate
|
||||
class DummyEntryCheckPredicate
|
||||
{
|
||||
public:
|
||||
bool operator()(uint64) { return true; }
|
||||
bool operator()(ObjectGuid) { return true; }
|
||||
};
|
||||
|
||||
struct ScriptedAI : public CreatureAI
|
||||
|
||||
@@ -23,10 +23,10 @@ SDComment:
|
||||
SDCategory: Npc
|
||||
EndScriptData */
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Points
|
||||
{
|
||||
@@ -35,7 +35,6 @@ enum Points
|
||||
};
|
||||
|
||||
npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature),
|
||||
m_uiPlayerGUID(0),
|
||||
m_uiWPWaitTimer(2500),
|
||||
m_uiPlayerCheckTimer(1000),
|
||||
m_uiEscortState(STATE_ESCORT_NONE),
|
||||
@@ -430,7 +429,7 @@ void npc_escortAI::SetRun(bool on)
|
||||
}
|
||||
|
||||
/// @todo get rid of this many variables passed in function.
|
||||
void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, uint64 playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
|
||||
void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false */, ObjectGuid playerGUID /* = 0 */, Quest const* quest /* = NULL */, bool instantRespawn /* = false */, bool canLoopPath /* = false */, bool resetWaypoints /* = true */)
|
||||
{
|
||||
if (me->GetVictim())
|
||||
{
|
||||
@@ -486,7 +485,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("scripts", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
|
||||
TC_LOG_DEBUG("scripts", "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, %s", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID.ToString().c_str());
|
||||
|
||||
CurrentWP = WaypointList.begin();
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ struct npc_escortAI : public ScriptedAI
|
||||
virtual void WaypointReached(uint32 pointId) = 0;
|
||||
virtual void WaypointStart(uint32 /*pointId*/) { }
|
||||
|
||||
void Start(bool isActiveAttacker = true, bool run = false, uint64 playerGUID = 0, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
|
||||
void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = NULL, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
|
||||
|
||||
void SetRun(bool on = true);
|
||||
void SetEscortPaused(bool on);
|
||||
@@ -103,7 +103,7 @@ struct npc_escortAI : public ScriptedAI
|
||||
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
|
||||
bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override
|
||||
void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; }
|
||||
uint64 GetEventStarterGUID() { return m_uiPlayerGUID; }
|
||||
ObjectGuid GetEventStarterGUID() { return m_uiPlayerGUID; }
|
||||
|
||||
protected:
|
||||
Player* GetPlayerForEscort() { return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); }
|
||||
@@ -116,7 +116,7 @@ struct npc_escortAI : public ScriptedAI
|
||||
void AddEscortState(uint32 escortState) { m_uiEscortState |= escortState; }
|
||||
void RemoveEscortState(uint32 escortState) { m_uiEscortState &= ~escortState; }
|
||||
|
||||
uint64 m_uiPlayerGUID;
|
||||
ObjectGuid m_uiPlayerGUID;
|
||||
uint32 m_uiWPWaitTimer;
|
||||
uint32 m_uiPlayerCheckTimer;
|
||||
uint32 m_uiEscortState;
|
||||
|
||||
@@ -23,10 +23,10 @@ SDComment: This AI is under development
|
||||
SDCategory: Npc
|
||||
EndScriptData */
|
||||
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedFollowerAI.h"
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
|
||||
const float MAX_PLAYER_DISTANCE = 100.0f;
|
||||
|
||||
@@ -36,7 +36,6 @@ enum Points
|
||||
};
|
||||
|
||||
FollowerAI::FollowerAI(Creature* creature) : ScriptedAI(creature),
|
||||
m_uiLeaderGUID(0),
|
||||
m_uiUpdateFollowTimer(2500),
|
||||
m_uiFollowState(STATE_FOLLOW_NONE),
|
||||
m_pQuestForFollow(NULL)
|
||||
@@ -320,7 +319,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
|
||||
|
||||
me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||
|
||||
TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName().c_str(), m_uiLeaderGUID);
|
||||
TC_LOG_DEBUG("scripts", "FollowerAI start follow %s (%s)", player->GetName().c_str(), m_uiLeaderGUID.ToString().c_str());
|
||||
}
|
||||
|
||||
Player* FollowerAI::GetLeaderForFollower()
|
||||
|
||||
@@ -71,7 +71,7 @@ class FollowerAI : public ScriptedAI
|
||||
|
||||
bool AssistPlayerInCombat(Unit* who);
|
||||
|
||||
uint64 m_uiLeaderGUID;
|
||||
ObjectGuid m_uiLeaderGUID;
|
||||
uint32 m_uiUpdateFollowTimer;
|
||||
uint32 m_uiFollowState;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
|
||||
mDespawnState = 0;
|
||||
|
||||
mEscortInvokerCheckTimer = 1000;
|
||||
mFollowGuid = 0;
|
||||
mFollowGuid.Clear();
|
||||
mFollowDist = 0;
|
||||
mFollowAngle = 0;
|
||||
mFollowCredit = 0;
|
||||
@@ -540,7 +540,7 @@ void SmartAI::JustRespawned()
|
||||
mJustReset = true;
|
||||
JustReachedHome();
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
|
||||
mFollowGuid = 0;//do not reset follower on Reset(), we need it after combat evade
|
||||
mFollowGuid.Clear();//do not reset follower on Reset(), we need it after combat evade
|
||||
mFollowDist = 0;
|
||||
mFollowAngle = 0;
|
||||
mFollowCredit = 0;
|
||||
@@ -674,8 +674,8 @@ void SmartAI::OnCharmed(bool apply)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
|
||||
|
||||
if (!apply && !me->IsInEvadeMode() && me->GetUInt64Value(UNIT_FIELD_CHARMEDBY))
|
||||
if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetUInt64Value(UNIT_FIELD_CHARMEDBY)))
|
||||
if (!apply && !me->IsInEvadeMode() && me->GetCharmerGUID())
|
||||
if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID()))
|
||||
AttackStart(charmer);
|
||||
}
|
||||
|
||||
@@ -694,11 +694,11 @@ void SmartAI::SetData(uint32 id, uint32 value)
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, NULL, id, value);
|
||||
}
|
||||
|
||||
void SmartAI::SetGUID(uint64 /*guid*/, int32 /*id*/) { }
|
||||
void SmartAI::SetGUID(ObjectGuid /*guid*/, int32 /*id*/) { }
|
||||
|
||||
uint64 SmartAI::GetGUID(int32 /*id*/) const
|
||||
ObjectGuid SmartAI::GetGUID(int32 /*id*/) const
|
||||
{
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void SmartAI::SetRun(bool run)
|
||||
@@ -800,7 +800,7 @@ void SmartAI::StopFollow()
|
||||
player->GroupEventHappens(mFollowCredit, me);
|
||||
}
|
||||
|
||||
mFollowGuid = 0;
|
||||
mFollowGuid.Clear();
|
||||
mFollowDist = 0;
|
||||
mFollowAngle = 0;
|
||||
mFollowCredit = 0;
|
||||
|
||||
@@ -154,10 +154,10 @@ class SmartAI : public CreatureAI
|
||||
void SetData(uint32 id, uint32 value) override;
|
||||
|
||||
// Used in scripts to share variables
|
||||
void SetGUID(uint64 guid, int32 id = 0) override;
|
||||
void SetGUID(ObjectGuid guid, int32 id = 0) override;
|
||||
|
||||
// Used in scripts to share variables
|
||||
uint64 GetGUID(int32 id = 0) const override;
|
||||
ObjectGuid GetGUID(int32 id = 0) const override;
|
||||
|
||||
//core related
|
||||
static int Permissible(const Creature*);
|
||||
@@ -199,7 +199,7 @@ class SmartAI : public CreatureAI
|
||||
uint32 mFollowArrivedTimer;
|
||||
uint32 mFollowCredit;
|
||||
uint32 mFollowArrivedEntry;
|
||||
uint64 mFollowGuid;
|
||||
ObjectGuid mFollowGuid;
|
||||
float mFollowDist;
|
||||
float mFollowAngle;
|
||||
|
||||
|
||||
@@ -51,9 +51,6 @@ SmartScript::SmartScript()
|
||||
mUseTextTimer = false;
|
||||
mTalkerEntry = 0;
|
||||
mTemplate = SMARTAI_TEMPLATE_BASIC;
|
||||
meOrigGUID = 0;
|
||||
goOrigGUID = 0;
|
||||
mLastInvoker = 0;
|
||||
mScriptType = SMART_SCRIPT_TYPE_CREATURE;
|
||||
isProcessingTimedActionList = false;
|
||||
}
|
||||
@@ -79,7 +76,7 @@ void SmartScript::OnReset()
|
||||
}
|
||||
}
|
||||
ProcessEventsFor(SMART_EVENT_RESET);
|
||||
mLastInvoker = 0;
|
||||
mLastInvoker.Clear();
|
||||
}
|
||||
|
||||
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
|
||||
@@ -509,10 +506,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
go->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0);
|
||||
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_CAST:: %s: %u casts spell %u on target %u with castflags %u",
|
||||
GetLogNameForGuid(me ? me->GetGUID() : go->GetGUID()), me ? me->GetGUIDLow() : go->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
|
||||
(me ? me->GetGUID() : go->GetGUID()).GetTypeName(), me ? me->GetGUIDLow() : go->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
|
||||
}
|
||||
else
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (%s) already has the aura", e.action.cast.spell, (*itr)->GetGUID().ToString().c_str());
|
||||
}
|
||||
|
||||
delete targets;
|
||||
@@ -543,7 +540,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
tempLastInvoker->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
|
||||
}
|
||||
else
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (%s) already has the aura", e.action.cast.spell, (*itr)->GetGUID().ToString().c_str());
|
||||
}
|
||||
|
||||
delete targets;
|
||||
@@ -939,9 +936,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!targets)
|
||||
break;
|
||||
|
||||
instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID());
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: " UI64FMTD,
|
||||
e.action.setInstanceData64.field, targets->front()->GetGUID());
|
||||
instance->SetGuidData(e.action.setInstanceData64.field, targets->front()->GetGUID());
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: %s",
|
||||
e.action.setInstanceData64.field, targets->front()->GetGUID().ToString().c_str());
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -1277,13 +1274,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_STORE_VARIABLE_DECIMAL:
|
||||
{
|
||||
if (mStoredDecimals.find(e.action.storeVar.id) != mStoredDecimals.end())
|
||||
mStoredDecimals.erase(e.action.storeVar.id);
|
||||
mStoredDecimals[e.action.storeVar.id] = e.action.storeVar.number;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_STORE_TARGET_LIST:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
@@ -1568,20 +1558,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (IsCreature(*itr))
|
||||
{
|
||||
if (!meOrigGUID)
|
||||
meOrigGUID = me ? me->GetGUID() : 0;
|
||||
if (!goOrigGUID)
|
||||
goOrigGUID = go ? go->GetGUID() : 0;
|
||||
if (!meOrigGUID && me)
|
||||
meOrigGUID = me->GetGUID();
|
||||
if (!goOrigGUID && go)
|
||||
goOrigGUID = go->GetGUID();
|
||||
go = NULL;
|
||||
me = (*itr)->ToCreature();
|
||||
break;
|
||||
}
|
||||
else if (IsGameObject(*itr))
|
||||
{
|
||||
if (!meOrigGUID)
|
||||
meOrigGUID = me ? me->GetGUID() : 0;
|
||||
if (!goOrigGUID)
|
||||
goOrigGUID = go ? go->GetGUID() : 0;
|
||||
if (!meOrigGUID && me)
|
||||
meOrigGUID = me->GetGUID();
|
||||
if (!goOrigGUID && go)
|
||||
goOrigGUID = go->GetGUID();
|
||||
go = (*itr)->ToGameObject();
|
||||
me = NULL;
|
||||
break;
|
||||
@@ -1723,7 +1713,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
unit->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0);
|
||||
}
|
||||
else
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId()));
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (%s) already has the aura", e.action.cast.spell, (*it)->GetGUID().ToString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2637,7 +2627,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
{
|
||||
if (me)
|
||||
{
|
||||
uint64 charmerOrOwnerGuid = me->GetCharmerOrOwnerGUID();
|
||||
ObjectGuid charmerOrOwnerGuid = me->GetCharmerOrOwnerGUID();
|
||||
|
||||
if (!charmerOrOwnerGuid)
|
||||
charmerOrOwnerGuid = me->GetCreatorGUID();
|
||||
|
||||
@@ -197,14 +197,14 @@ class SmartScript
|
||||
go = o;
|
||||
}
|
||||
}
|
||||
goOrigGUID = 0;
|
||||
meOrigGUID = 0;
|
||||
goOrigGUID.Clear();
|
||||
meOrigGUID.Clear();
|
||||
}
|
||||
|
||||
//TIMED_ACTIONLIST (script type 9 aka script9)
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry);
|
||||
Unit* GetLastInvoker();
|
||||
uint64 mLastInvoker;
|
||||
ObjectGuid mLastInvoker;
|
||||
|
||||
private:
|
||||
void IncPhase(int32 p = 1)
|
||||
@@ -224,14 +224,13 @@ class SmartScript
|
||||
SmartAIEventList mTimedActionList;
|
||||
bool isProcessingTimedActionList;
|
||||
Creature* me;
|
||||
uint64 meOrigGUID;
|
||||
ObjectGuid meOrigGUID;
|
||||
GameObject* go;
|
||||
uint64 goOrigGUID;
|
||||
ObjectGuid goOrigGUID;
|
||||
AreaTriggerEntry const* trigger;
|
||||
SmartScriptType mScriptType;
|
||||
uint32 mEventPhase;
|
||||
|
||||
std::unordered_map<int32, int32> mStoredDecimals;
|
||||
uint32 mPathId;
|
||||
SmartAIEventList mStoredEvents;
|
||||
std::list<uint32>mRemIDs;
|
||||
|
||||
@@ -1055,7 +1055,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_DIE:
|
||||
case SMART_ACTION_SET_IN_COMBAT_WITH_ZONE:
|
||||
case SMART_ACTION_SET_ACTIVE:
|
||||
case SMART_ACTION_STORE_VARIABLE_DECIMAL:
|
||||
case SMART_ACTION_WP_RESUME:
|
||||
case SMART_ACTION_KILL_UNIT:
|
||||
case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL:
|
||||
|
||||
@@ -480,7 +480,7 @@ enum SMART_ACTION
|
||||
SMART_ACTION_SET_FLY = 60, // 0/1
|
||||
SMART_ACTION_SET_SWIM = 61, // 0/1
|
||||
SMART_ACTION_TELEPORT = 62, // mapID,
|
||||
SMART_ACTION_STORE_VARIABLE_DECIMAL = 63, // varID, number
|
||||
// 63 unused
|
||||
SMART_ACTION_STORE_TARGET_LIST = 64, // varID,
|
||||
SMART_ACTION_WP_RESUME = 65, // none
|
||||
SMART_ACTION_SET_ORIENTATION = 66, //
|
||||
@@ -1360,7 +1360,7 @@ struct SmartScriptHolder
|
||||
typedef std::unordered_map<uint32, WayPoint*> WPPath;
|
||||
|
||||
typedef std::list<WorldObject*> ObjectList;
|
||||
typedef std::list<uint64> GuidList;
|
||||
|
||||
class ObjectGuidList
|
||||
{
|
||||
ObjectList* m_objectList;
|
||||
@@ -1393,7 +1393,7 @@ public:
|
||||
if (WorldObject* obj = ObjectAccessor::GetWorldObject(*m_baseObject, *itr))
|
||||
m_objectList->push_back(obj);
|
||||
else
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::mTargetStorage stores a guid to an invalid object: " UI64FMTD, *itr);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::mTargetStorage stores a guid to an invalid object: %s", itr->ToString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +81,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId)
|
||||
{
|
||||
do
|
||||
{
|
||||
uint32 guidLow = (*result)[0].GetUInt32();
|
||||
uint64 guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid guid(HIGHGUID_PLAYER, (*result)[0].GetUInt32());
|
||||
|
||||
// Kick if player is online
|
||||
if (Player* p = ObjectAccessor::FindPlayer(guid))
|
||||
|
||||
@@ -504,37 +504,37 @@ void AchievementMgr<Guild>::ResetAchievementCriteria(AchievementCriteriaTypes /*
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void AchievementMgr<T>::DeleteFromDB(uint32 /*lowguid*/)
|
||||
void AchievementMgr<T>::DeleteFromDB(ObjectGuid /*guid*/)
|
||||
{
|
||||
}
|
||||
|
||||
template<>
|
||||
void AchievementMgr<Player>::DeleteFromDB(uint32 lowguid)
|
||||
void AchievementMgr<Player>::DeleteFromDB(ObjectGuid guid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
template<>
|
||||
void AchievementMgr<Guild>::DeleteFromDB(uint32 lowguid)
|
||||
void AchievementMgr<Guild>::DeleteFromDB(ObjectGuid guid)
|
||||
{
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA);
|
||||
stmt->setUInt32(0, lowguid);
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
@@ -557,11 +557,11 @@ void AchievementMgr<Player>::SaveToDB(SQLTransaction& trans)
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT);
|
||||
stmt->setUInt16(0, iter->first);
|
||||
stmt->setUInt32(1, GetOwner()->GetGUID());
|
||||
stmt->setUInt32(1, GetOwner()->GetGUID().GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACHIEVEMENT);
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID());
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, iter->first);
|
||||
stmt->setUInt32(2, uint32(iter->second.date));
|
||||
trans->Append(stmt);
|
||||
@@ -578,14 +578,14 @@ void AchievementMgr<Player>::SaveToDB(SQLTransaction& trans)
|
||||
continue;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA);
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID());
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, iter->first);
|
||||
trans->Append(stmt);
|
||||
|
||||
if (iter->second.counter)
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACHIEVEMENT_PROGRESS);
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID());
|
||||
stmt->setUInt32(0, GetOwner()->GetGUID().GetCounter());
|
||||
stmt->setUInt16(1, iter->first);
|
||||
stmt->setUInt32(2, iter->second.counter);
|
||||
stmt->setUInt32(3, uint32(iter->second.date));
|
||||
@@ -616,8 +616,8 @@ void AchievementMgr<Guild>::SaveToDB(SQLTransaction& trans)
|
||||
stmt->setUInt32(0, GetOwner()->GetId());
|
||||
stmt->setUInt16(1, itr->first);
|
||||
stmt->setUInt32(2, itr->second.date);
|
||||
for (std::set<uint64>::const_iterator gItr = itr->second.guids.begin(); gItr != itr->second.guids.end(); ++gItr)
|
||||
guidstr << GUID_LOPART(*gItr) << ',';
|
||||
for (GuidSet::const_iterator gItr = itr->second.guids.begin(); gItr != itr->second.guids.end(); ++gItr)
|
||||
guidstr << gItr->GetCounter() << ',';
|
||||
|
||||
stmt->setString(3, guidstr.str());
|
||||
trans->Append(stmt);
|
||||
@@ -640,7 +640,7 @@ void AchievementMgr<Guild>::SaveToDB(SQLTransaction& trans)
|
||||
stmt->setUInt16(1, itr->first);
|
||||
stmt->setUInt64(2, itr->second.counter);
|
||||
stmt->setUInt32(3, itr->second.date);
|
||||
stmt->setUInt32(4, GUID_LOPART(itr->second.CompletedGUID));
|
||||
stmt->setUInt32(4, itr->second.CompletedGUID.GetCounter());
|
||||
trans->Append(stmt);
|
||||
}
|
||||
}
|
||||
@@ -735,7 +735,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
|
||||
ca.date = time_t(fields[1].GetUInt32());
|
||||
Tokenizer guids(fields[2].GetString(), ' ');
|
||||
for (uint32 i = 0; i < guids.size(); ++i)
|
||||
ca.guids.insert(MAKE_NEW_GUID(atol(guids[i]), 0, HIGHGUID_PLAYER));
|
||||
ca.guids.insert(ObjectGuid(HIGHGUID_PLAYER, uint32(atol(guids[i]))));
|
||||
|
||||
ca.changed = false;
|
||||
|
||||
@@ -753,7 +753,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
|
||||
uint32 id = fields[0].GetUInt16();
|
||||
uint32 counter = fields[1].GetUInt32();
|
||||
time_t date = time_t(fields[2].GetUInt32());
|
||||
uint64 guid = fields[3].GetUInt32();
|
||||
uint32 guid = fields[3].GetUInt32();
|
||||
|
||||
AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(id);
|
||||
if (!criteria)
|
||||
@@ -773,7 +773,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
|
||||
CriteriaProgress& progress = m_criteriaProgress[id];
|
||||
progress.counter = counter;
|
||||
progress.date = date;
|
||||
progress.CompletedGUID = MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER);
|
||||
progress.CompletedGUID = ObjectGuid(HIGHGUID_PLAYER, guid);
|
||||
progress.changed = false;
|
||||
} while (criteriaResult->NextRow());
|
||||
}
|
||||
@@ -804,7 +804,7 @@ void AchievementMgr<Player>::Reset()
|
||||
m_completedAchievements.clear();
|
||||
_achievementPoints = 0;
|
||||
m_criteriaProgress.clear();
|
||||
DeleteFromDB(GetOwner()->GetGUIDLow());
|
||||
DeleteFromDB(GetOwner()->GetGUID());
|
||||
|
||||
// re-fill data
|
||||
CheckAllAchievementCriteria(GetOwner());
|
||||
@@ -844,7 +844,7 @@ void AchievementMgr<Guild>::Reset()
|
||||
|
||||
_achievementPoints = 0;
|
||||
m_completedAchievements.clear();
|
||||
DeleteFromDB(GetOwner()->GetId());
|
||||
DeleteFromDB(GetOwner()->GetGUID());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -883,7 +883,7 @@ void AchievementMgr<T>::SendAchievementEarned(AchievementEntry const* achievemen
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
|
||||
data.append(GetOwner()->GetPackGUID());
|
||||
data << GetOwner()->GetPackGUID();
|
||||
data << uint32(achievement->ID);
|
||||
data.AppendPackedTime(time(NULL));
|
||||
data << uint32(0); // does not notify player ingame
|
||||
@@ -933,7 +933,7 @@ void AchievementMgr<Player>::SendCriteriaUpdate(AchievementCriteriaEntry const*
|
||||
// the counter is packed like a packed Guid
|
||||
data.appendPackGUID(progress->counter);
|
||||
|
||||
data.appendPackGUID(GetOwner()->GetGUID());
|
||||
data << GetOwner()->GetPackGUID();
|
||||
if (!entry->timeLimit)
|
||||
data << uint32(0);
|
||||
else
|
||||
@@ -950,7 +950,7 @@ void AchievementMgr<Guild>::SendCriteriaUpdate(AchievementCriteriaEntry const* e
|
||||
//will send response to criteria progress request
|
||||
WorldPacket data(SMSG_GUILD_CRITERIA_DATA, 3 + 1 + 1 + 8 + 8 + 4 + 4 + 4 + 4 + 4);
|
||||
|
||||
ObjectGuid counter = progress->counter; // for accessing every byte individually
|
||||
ObjectGuid counter(progress->counter); // for accessing every byte individually
|
||||
ObjectGuid guid = progress->CompletedGUID;
|
||||
|
||||
data.WriteBits(1, 21);
|
||||
@@ -1047,12 +1047,12 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type,
|
||||
if (referencePlayer->IsGameMaster())
|
||||
{
|
||||
TC_LOG_DEBUG("achievement", "UpdateAchievementCriteria: [Player %s GM mode on] %s, %s (%u), " UI64FMTD ", " UI64FMTD ", " UI64FMTD
|
||||
, referencePlayer->GetName().c_str(), GetLogNameForGuid(GetOwner()->GetGUID()), AchievementGlobalMgr::GetCriteriaTypeString(type), type, miscValue1, miscValue2, miscValue3);
|
||||
, referencePlayer->GetName().c_str(), GetOwner()->GetGUID().ToString().c_str(), AchievementGlobalMgr::GetCriteriaTypeString(type), type, miscValue1, miscValue2, miscValue3);
|
||||
return;
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("achievement", "UpdateAchievementCriteria: %s, %s (%u), " UI64FMTD ", " UI64FMTD ", " UI64FMTD
|
||||
, GetLogNameForGuid(GetOwner()->GetGUID()), AchievementGlobalMgr::GetCriteriaTypeString(type), type, miscValue1, miscValue2, miscValue3);
|
||||
, GetOwner()->GetGUID().ToString().c_str(), AchievementGlobalMgr::GetCriteriaTypeString(type), type, miscValue1, miscValue2, miscValue3);
|
||||
|
||||
// Lua_GetGuildLevelEnabled() is checked in achievement UI to display guild tab
|
||||
if (IsGuild<T>() && !sWorld->getBoolConfig(CONFIG_GUILD_LEVELING_ENABLED))
|
||||
@@ -1660,8 +1660,8 @@ void AchievementMgr<T>::SetCriteriaProgress(AchievementCriteriaEntry const* entr
|
||||
if (entry->timeLimit && timedIter == m_timedAchievements.end())
|
||||
return;
|
||||
|
||||
TC_LOG_DEBUG("achievement", "SetCriteriaProgress(%u, " UI64FMTD ") for (%s GUID: %u)",
|
||||
entry->ID, changeValue, GetLogNameForGuid(GetOwner()->GetGUID()), GUID_LOPART(GetOwner()->GetGUID()));
|
||||
TC_LOG_DEBUG("achievement", "SetCriteriaProgress(%u, " UI64FMTD ") for (%s)",
|
||||
entry->ID, changeValue, GetOwner()->GetGUID().ToString().c_str());
|
||||
|
||||
CriteriaProgress* progress = GetCriteriaProgress(entry);
|
||||
if (!progress)
|
||||
@@ -1899,7 +1899,7 @@ void AchievementMgr<Guild>::CompletedAchievement(AchievementEntry const* achieve
|
||||
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS)
|
||||
if (Guild* guild = referencePlayer->GetGuild())
|
||||
guild->AddGuildNews(GUILD_NEWS_GUILD_ACHIEVEMENT, 0, achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID);
|
||||
guild->AddGuildNews(GUILD_NEWS_GUILD_ACHIEVEMENT, ObjectGuid::Empty, achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID);
|
||||
|
||||
SendAchievementEarned(achievement);
|
||||
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
|
||||
@@ -1949,7 +1949,7 @@ void AchievementMgr<T>::SendAllAchievementData(Player* /*receiver*/) const
|
||||
data.WriteBits(numCriteria, 21);
|
||||
for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr)
|
||||
{
|
||||
counter = itr->second.counter;
|
||||
counter.Set(itr->second.counter);
|
||||
|
||||
data.WriteBit(guid[4]);
|
||||
data.WriteBit(counter[3]);
|
||||
@@ -2052,7 +2052,7 @@ void AchievementMgr<Player>::SendAchievementInfo(Player* receiver, uint32 /*achi
|
||||
data.WriteBit(guid[2]);
|
||||
for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr)
|
||||
{
|
||||
counter = itr->second.counter;
|
||||
counter.Set(itr->second.counter);
|
||||
|
||||
data.WriteBit(counter[5]);
|
||||
data.WriteBit(counter[3]);
|
||||
@@ -2159,7 +2159,7 @@ void AchievementMgr<Guild>::SendAchievementInfo(Player* receiver, uint32 achieve
|
||||
if (progress == m_criteriaProgress.end())
|
||||
continue;
|
||||
|
||||
counter = progress->second.counter;
|
||||
counter.Set(progress->second.counter);
|
||||
guid = progress->second.CompletedGUID;
|
||||
|
||||
criteriaBits.WriteBit(counter[4]);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCEnums.h"
|
||||
#include "DBCStores.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
class Unit;
|
||||
class Player;
|
||||
@@ -41,7 +42,7 @@ struct CriteriaProgress
|
||||
{
|
||||
uint64 counter;
|
||||
time_t date; // latest update time.
|
||||
uint64 CompletedGUID; // GUID of the player that completed this criteria (guild achievements)
|
||||
ObjectGuid CompletedGUID; // GUID of the player that completed this criteria (guild achievements)
|
||||
bool changed;
|
||||
};
|
||||
|
||||
@@ -233,7 +234,7 @@ typedef std::unordered_map<uint32, AchievementRewardLocale> AchievementRewardLoc
|
||||
struct CompletedAchievementData
|
||||
{
|
||||
time_t date;
|
||||
std::set<uint64> guids;
|
||||
GuidSet guids;
|
||||
bool changed;
|
||||
};
|
||||
|
||||
@@ -255,7 +256,7 @@ class AchievementMgr
|
||||
~AchievementMgr();
|
||||
|
||||
void Reset();
|
||||
static void DeleteFromDB(uint32 lowguid);
|
||||
static void DeleteFromDB(ObjectGuid lowguid);
|
||||
void LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult);
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 = 0, uint64 miscValue2 = 0, bool evenIfCriteriaComplete = false);
|
||||
|
||||
@@ -92,7 +92,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
return;
|
||||
|
||||
uint32 bidderAccId = 0;
|
||||
uint64 bidderGuid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid bidderGuid(HIGHGUID_PLAYER, auction->bidder);
|
||||
Player* bidder = ObjectAccessor::FindPlayer(bidderGuid);
|
||||
// data for gm.log
|
||||
std::string bidderName;
|
||||
@@ -115,11 +115,12 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
|
||||
if (logGmTrade)
|
||||
{
|
||||
ObjectGuid ownerGuid = ObjectGuid(HIGHGUID_PLAYER, auction->owner);
|
||||
std::string ownerName;
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(auction->owner, ownerName))
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(ownerGuid, ownerName))
|
||||
ownerName = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||
|
||||
uint32 ownerAccId = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner);
|
||||
uint32 ownerAccId = sObjectMgr->GetPlayerAccountIdByGUID(ownerGuid);
|
||||
|
||||
sLog->outCommand(bidderAccId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)",
|
||||
bidderName.c_str(), bidderAccId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, ownerName.c_str(), ownerAccId);
|
||||
@@ -150,7 +151,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
|
||||
void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTransaction& trans)
|
||||
{
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid owner_guid(HIGHGUID_PLAYER, auction->owner);
|
||||
Player* owner = ObjectAccessor::FindPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist (online or offline)
|
||||
@@ -162,7 +163,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTrans
|
||||
//call this method to send mail to auction owner, when auction is successful, it does not clear ram
|
||||
void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransaction& trans)
|
||||
{
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid owner_guid(HIGHGUID_PLAYER, auction->owner);
|
||||
Player* owner = ObjectAccessor::FindPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist
|
||||
@@ -193,7 +194,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti
|
||||
if (!pItem)
|
||||
return;
|
||||
|
||||
uint64 owner_guid = MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid owner_guid(HIGHGUID_PLAYER, auction->owner);
|
||||
Player* owner = ObjectAccessor::FindPlayer(owner_guid);
|
||||
uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid);
|
||||
// owner exist
|
||||
@@ -211,7 +212,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti
|
||||
//this function sends mail to old bidder
|
||||
void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans)
|
||||
{
|
||||
uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid oldBidder_guid(HIGHGUID_PLAYER, auction->bidder);
|
||||
Player* oldBidder = ObjectAccessor::FindPlayer(oldBidder_guid);
|
||||
|
||||
uint32 oldBidder_accId = 0;
|
||||
@@ -233,7 +234,7 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 new
|
||||
//this function sends mail, when auction is cancelled to old bidder
|
||||
void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans, Item* item)
|
||||
{
|
||||
uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid bidder_guid = ObjectGuid(HIGHGUID_PLAYER, auction->bidder);
|
||||
Player* bidder = ObjectAccessor::FindPlayer(bidder_guid);
|
||||
|
||||
uint32 bidder_accId = 0;
|
||||
@@ -291,7 +292,7 @@ void AuctionHouseMgr::LoadAuctionItems()
|
||||
}
|
||||
|
||||
Item* item = NewItemOrBag(proto);
|
||||
if (!item->LoadFromDB(item_guid, 0, fields, itemEntry))
|
||||
if (!item->LoadFromDB(item_guid, ObjectGuid::Empty, fields, itemEntry))
|
||||
{
|
||||
delete item;
|
||||
continue;
|
||||
@@ -851,7 +852,7 @@ std::string AuctionEntry::BuildAuctionMailBody(uint32 lowGuid, uint32 bid, uint3
|
||||
{
|
||||
std::ostringstream strm;
|
||||
strm.width(16);
|
||||
strm << std::right << std::hex << MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER); // HIGHGUID_PLAYER always present, even for empty guids
|
||||
strm << std::right << std::hex << ObjectGuid(HIGHGUID_PLAYER, lowGuid).GetRawValue(); // HIGHGUID_PLAYER always present, even for empty guids
|
||||
strm << std::dec << ':' << bid << ':' << buyout;
|
||||
strm << ':' << deposit << ':' << cut;
|
||||
return strm.str();
|
||||
|
||||
@@ -37,7 +37,6 @@ Battlefield::Battlefield()
|
||||
m_isActive = false;
|
||||
m_DefenderTeam = TEAM_NEUTRAL;
|
||||
|
||||
m_Guid = 0;
|
||||
m_TypeId = 0;
|
||||
m_BattleId = 0;
|
||||
m_ZoneId = 0;
|
||||
@@ -57,7 +56,6 @@ Battlefield::Battlefield()
|
||||
m_LastResurrectTimer = 30 * IN_MILLISECONDS;
|
||||
m_StartGroupingTimer = 0;
|
||||
m_StartGrouping = false;
|
||||
StalkerGuid = 0;
|
||||
}
|
||||
|
||||
Battlefield::~Battlefield()
|
||||
@@ -300,7 +298,7 @@ void Battlefield::KickAfkPlayers()
|
||||
KickPlayerFromBattlefield(*itr);
|
||||
}
|
||||
|
||||
void Battlefield::KickPlayerFromBattlefield(uint64 guid)
|
||||
void Battlefield::KickPlayerFromBattlefield(ObjectGuid guid)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
if (player->GetZoneId() == GetZoneId())
|
||||
@@ -360,10 +358,7 @@ void Battlefield::DoPlaySoundToAll(uint32 SoundID)
|
||||
data << uint32(SoundID);
|
||||
data << uint64(0);
|
||||
|
||||
for (int team = 0; team < BG_TEAMS_COUNT; team++)
|
||||
for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(*itr))
|
||||
player->SendDirectMessage(&data);
|
||||
BroadcastPacketToWar(data);
|
||||
}
|
||||
|
||||
bool Battlefield::HasPlayer(Player* player) const
|
||||
@@ -446,18 +441,10 @@ void Battlefield::BroadcastPacketToWar(WorldPacket& data) const
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void Battlefield::SendWarningToAllInZone(uint32 entry)
|
||||
void Battlefield::SendWarning(uint8 id, WorldObject const* target /*= nullptr*/)
|
||||
{
|
||||
if (Creature* stalker = GetCreature(StalkerGuid))
|
||||
// FIXME: replaced CHAT_TYPE_END with CHAT_MSG_BG_SYSTEM_NEUTRAL to fix compile, it's a guessed change :/
|
||||
sCreatureTextMgr->SendChat(stalker, (uint8) entry, NULL, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE);
|
||||
}
|
||||
|
||||
void Battlefield::SendWarningToPlayer(Player* player, uint32 entry)
|
||||
{
|
||||
if (player)
|
||||
if (Creature* stalker = GetCreature(StalkerGuid))
|
||||
sCreatureTextMgr->SendChat(stalker, (uint8)entry, player);
|
||||
sCreatureTextMgr->SendChat(stalker, id, target);
|
||||
}
|
||||
|
||||
void Battlefield::SendUpdateWorldState(uint32 field, uint32 value)
|
||||
@@ -503,17 +490,17 @@ void Battlefield::ShowNpc(Creature* creature, bool aggressive)
|
||||
Group* Battlefield::GetFreeBfRaid(TeamId TeamId)
|
||||
{
|
||||
for (GuidSet::const_iterator itr = m_Groups[TeamId].begin(); itr != m_Groups[TeamId].end(); ++itr)
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(*itr))
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(itr->GetCounter()))
|
||||
if (!group->IsFull())
|
||||
return group;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Group* Battlefield::GetGroupPlayer(uint64 guid, TeamId TeamId)
|
||||
Group* Battlefield::GetGroupPlayer(ObjectGuid guid, TeamId TeamId)
|
||||
{
|
||||
for (GuidSet::const_iterator itr = m_Groups[TeamId].begin(); itr != m_Groups[TeamId].end(); ++itr)
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(*itr))
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(itr->GetCounter()))
|
||||
if (group->IsMember(guid))
|
||||
return group;
|
||||
|
||||
@@ -598,7 +585,7 @@ WorldSafeLocsEntry const* Battlefield::GetClosestGraveYard(Player* player)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Battlefield::AddPlayerToResurrectQueue(uint64 npcGuid, uint64 playerGuid)
|
||||
void Battlefield::AddPlayerToResurrectQueue(ObjectGuid npcGuid, ObjectGuid playerGuid)
|
||||
{
|
||||
for (uint8 i = 0; i < m_GraveyardList.size(); i++)
|
||||
{
|
||||
@@ -613,7 +600,7 @@ void Battlefield::AddPlayerToResurrectQueue(uint64 npcGuid, uint64 playerGuid)
|
||||
}
|
||||
}
|
||||
|
||||
void Battlefield::RemovePlayerFromResurrectQueue(uint64 playerGuid)
|
||||
void Battlefield::RemovePlayerFromResurrectQueue(ObjectGuid playerGuid)
|
||||
{
|
||||
for (uint8 i = 0; i < m_GraveyardList.size(); i++)
|
||||
{
|
||||
@@ -628,7 +615,7 @@ void Battlefield::RemovePlayerFromResurrectQueue(uint64 playerGuid)
|
||||
}
|
||||
}
|
||||
|
||||
void Battlefield::SendAreaSpiritHealerQueryOpcode(Player* player, uint64 guid)
|
||||
void Battlefield::SendAreaSpiritHealerQueryOpcode(Player* player, ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 12);
|
||||
uint32 time = m_LastResurrectTimer; // resurrect every 30 seconds
|
||||
@@ -645,8 +632,8 @@ BfGraveyard::BfGraveyard(Battlefield* battlefield)
|
||||
m_Bf = battlefield;
|
||||
m_GraveyardId = 0;
|
||||
m_ControlTeam = TEAM_NEUTRAL;
|
||||
m_SpiritGuide[0] = 0;
|
||||
m_SpiritGuide[1] = 0;
|
||||
m_SpiritGuide[0].Clear();
|
||||
m_SpiritGuide[1].Clear();
|
||||
}
|
||||
|
||||
void BfGraveyard::Initialize(TeamId startControl, uint32 graveyardId)
|
||||
@@ -673,7 +660,7 @@ float BfGraveyard::GetDistance(Player* player)
|
||||
return player->GetDistance2d(safeLoc->x, safeLoc->y);
|
||||
}
|
||||
|
||||
void BfGraveyard::AddPlayer(uint64 playerGuid)
|
||||
void BfGraveyard::AddPlayer(ObjectGuid playerGuid)
|
||||
{
|
||||
if (!m_ResurrectQueue.count(playerGuid))
|
||||
{
|
||||
@@ -684,7 +671,7 @@ void BfGraveyard::AddPlayer(uint64 playerGuid)
|
||||
}
|
||||
}
|
||||
|
||||
void BfGraveyard::RemovePlayer(uint64 playerGuid)
|
||||
void BfGraveyard::RemovePlayer(ObjectGuid playerGuid)
|
||||
{
|
||||
m_ResurrectQueue.erase(m_ResurrectQueue.find(playerGuid));
|
||||
|
||||
@@ -756,7 +743,7 @@ void BfGraveyard::RelocateDeadPlayers()
|
||||
}
|
||||
}
|
||||
|
||||
bool BfGraveyard::HasNpc(uint64 guid)
|
||||
bool BfGraveyard::HasNpc(ObjectGuid guid)
|
||||
{
|
||||
if (!m_SpiritGuide[0] || !m_SpiritGuide[1])
|
||||
return false;
|
||||
@@ -837,25 +824,25 @@ GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z
|
||||
return go;
|
||||
}
|
||||
|
||||
Creature* Battlefield::GetCreature(uint64 GUID)
|
||||
Creature* Battlefield::GetCreature(ObjectGuid guid)
|
||||
{
|
||||
if (!m_Map)
|
||||
return NULL;
|
||||
return m_Map->GetCreature(GUID);
|
||||
return m_Map->GetCreature(guid);
|
||||
}
|
||||
|
||||
GameObject* Battlefield::GetGameObject(uint64 GUID)
|
||||
GameObject* Battlefield::GetGameObject(ObjectGuid guid)
|
||||
{
|
||||
if (!m_Map)
|
||||
return NULL;
|
||||
return m_Map->GetGameObject(GUID);
|
||||
return m_Map->GetGameObject(guid);
|
||||
}
|
||||
|
||||
// *******************************************************
|
||||
// ******************* CapturePoint **********************
|
||||
// *******************************************************
|
||||
|
||||
BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_capturePointGUID(0)
|
||||
BfCapturePoint::BfCapturePoint(Battlefield* battlefield) : m_Bf(battlefield), m_capturePointGUID()
|
||||
{
|
||||
m_team = TEAM_NEUTRAL;
|
||||
m_value = 0;
|
||||
@@ -920,7 +907,7 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint)
|
||||
|
||||
TC_LOG_DEBUG("bg.battlefield", "Creating capture point %u", capturePoint->GetEntry());
|
||||
|
||||
m_capturePointGUID = MAKE_NEW_GUID(capturePoint->GetGUIDLow(), capturePoint->GetEntry(), HIGHGUID_GAMEOBJECT);
|
||||
m_capturePointGUID = ObjectGuid(HIGHGUID_GAMEOBJECT, capturePoint->GetEntry(), capturePoint->GetGUIDLow());
|
||||
|
||||
// check info existence
|
||||
GameObjectTemplate const* goinfo = capturePoint->GetGOInfo();
|
||||
@@ -965,7 +952,7 @@ bool BfCapturePoint::DelCapturePoint()
|
||||
capturePoint->Delete();
|
||||
capturePoint = NULL;
|
||||
}
|
||||
m_capturePointGUID = 0;
|
||||
m_capturePointGUID.Clear();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1101,7 +1088,7 @@ void BfCapturePoint::SendUpdateWorldState(uint32 field, uint32 value)
|
||||
player->SendUpdateWorldState(field, value);
|
||||
}
|
||||
|
||||
void BfCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid)
|
||||
void BfCapturePoint::SendObjectiveComplete(uint32 id, ObjectGuid guid)
|
||||
{
|
||||
uint8 team;
|
||||
switch (m_State)
|
||||
|
||||
@@ -65,9 +65,8 @@ class Unit;
|
||||
class Battlefield;
|
||||
class BfGraveyard;
|
||||
|
||||
typedef std::set<uint64> GuidSet;
|
||||
typedef std::vector<BfGraveyard*> GraveyardVect;
|
||||
typedef std::map<uint64, time_t> PlayerTimerMap;
|
||||
typedef std::map<ObjectGuid, time_t> PlayerTimerMap;
|
||||
|
||||
class BfCapturePoint
|
||||
{
|
||||
@@ -82,7 +81,7 @@ class BfCapturePoint
|
||||
void SendUpdateWorldState(uint32 field, uint32 value);
|
||||
|
||||
// Send kill notify to players in the controlling faction
|
||||
void SendObjectiveComplete(uint32 id, uint64 guid);
|
||||
void SendObjectiveComplete(uint32 id, ObjectGuid guid);
|
||||
|
||||
// Used when player is activated/inactivated in the area
|
||||
virtual bool HandlePlayerEnter(Player* player);
|
||||
@@ -133,7 +132,7 @@ class BfCapturePoint
|
||||
uint32 m_capturePointEntry;
|
||||
|
||||
// Gameobject related to that capture point
|
||||
uint64 m_capturePointGUID;
|
||||
ObjectGuid m_capturePointGUID;
|
||||
};
|
||||
|
||||
class BfGraveyard
|
||||
@@ -155,10 +154,10 @@ class BfGraveyard
|
||||
void SetSpirit(Creature* spirit, TeamId team);
|
||||
|
||||
// Add a player to the graveyard
|
||||
void AddPlayer(uint64 player_guid);
|
||||
void AddPlayer(ObjectGuid player_guid);
|
||||
|
||||
// Remove a player from the graveyard
|
||||
void RemovePlayer(uint64 player_guid);
|
||||
void RemovePlayer(ObjectGuid player_guid);
|
||||
|
||||
// Resurrect players
|
||||
void Resurrect();
|
||||
@@ -167,10 +166,10 @@ class BfGraveyard
|
||||
void RelocateDeadPlayers();
|
||||
|
||||
// Check if this graveyard has a spirit guide
|
||||
bool HasNpc(uint64 guid);
|
||||
bool HasNpc(ObjectGuid guid);
|
||||
|
||||
// Check if a player is in this graveyard's resurrect queue
|
||||
bool HasPlayer(uint64 guid) { return m_ResurrectQueue.find(guid) != m_ResurrectQueue.end(); }
|
||||
bool HasPlayer(ObjectGuid guid) { return m_ResurrectQueue.find(guid) != m_ResurrectQueue.end(); }
|
||||
|
||||
// Get the graveyard's ID.
|
||||
uint32 GetGraveyardId() const { return m_GraveyardId; }
|
||||
@@ -178,7 +177,7 @@ class BfGraveyard
|
||||
protected:
|
||||
TeamId m_ControlTeam;
|
||||
uint32 m_GraveyardId;
|
||||
uint64 m_SpiritGuide[BG_TEAMS_COUNT];
|
||||
ObjectGuid m_SpiritGuide[BG_TEAMS_COUNT];
|
||||
GuidSet m_ResurrectQueue;
|
||||
Battlefield* m_Bf;
|
||||
};
|
||||
@@ -223,7 +222,7 @@ class Battlefield : public ZoneScript
|
||||
|
||||
uint32 GetTypeId() { return m_TypeId; }
|
||||
uint32 GetZoneId() { return m_ZoneId; }
|
||||
uint64 GetGUID() { return m_Guid; }
|
||||
ObjectGuid GetGUID() { return m_Guid; }
|
||||
|
||||
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2 = 0);
|
||||
|
||||
@@ -239,7 +238,7 @@ class Battlefield : public ZoneScript
|
||||
* \brief Kick player from battlefield and teleport him to kick-point location
|
||||
* \param guid : guid of player who must be kick
|
||||
*/
|
||||
void KickPlayerFromBattlefield(uint64 guid);
|
||||
void KickPlayerFromBattlefield(ObjectGuid guid);
|
||||
|
||||
/// Called when player (player) enter in zone
|
||||
void HandlePlayerEnterZone(Player* player, uint32 zone);
|
||||
@@ -268,7 +267,7 @@ class Battlefield : public ZoneScript
|
||||
*/
|
||||
Group* GetFreeBfRaid(TeamId TeamId);
|
||||
/// Return battlefield group where player is.
|
||||
Group* GetGroupPlayer(uint64 guid, TeamId TeamId);
|
||||
Group* GetGroupPlayer(ObjectGuid guid, TeamId TeamId);
|
||||
/// Force player to join a battlefield group
|
||||
bool AddOrSetPlayerToCorrectBfGroup(Player* player);
|
||||
|
||||
@@ -276,8 +275,8 @@ class Battlefield : public ZoneScript
|
||||
// Find which graveyard the player must be teleported to to be resurrected by spiritguide
|
||||
WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
|
||||
virtual void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
|
||||
void RemovePlayerFromResurrectQueue(uint64 player_guid);
|
||||
virtual void AddPlayerToResurrectQueue(ObjectGuid npc_guid, ObjectGuid player_guid);
|
||||
void RemovePlayerFromResurrectQueue(ObjectGuid player_guid);
|
||||
void SetGraveyardNumber(uint32 number) { m_GraveyardList.resize(number); }
|
||||
BfGraveyard* GetGraveyardById(uint32 id) const;
|
||||
|
||||
@@ -286,8 +285,8 @@ class Battlefield : public ZoneScript
|
||||
Creature* SpawnCreature(uint32 entry, Position const& pos, TeamId /*teamId*/);
|
||||
GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o);
|
||||
|
||||
Creature* GetCreature(uint64 GUID);
|
||||
GameObject* GetGameObject(uint64 GUID);
|
||||
Creature* GetCreature(ObjectGuid guid);
|
||||
GameObject* GetGameObject(ObjectGuid guid);
|
||||
|
||||
// Script-methods
|
||||
|
||||
@@ -306,8 +305,7 @@ class Battlefield : public ZoneScript
|
||||
/// Called when a player enter in battlefield zone
|
||||
virtual void OnPlayerEnterZone(Player* /*player*/) { }
|
||||
|
||||
void SendWarningToAllInZone(uint32 entry);
|
||||
void SendWarningToPlayer(Player* player, uint32 entry);
|
||||
void SendWarning(uint8 id, WorldObject const* target = nullptr);
|
||||
|
||||
void PlayerAcceptInviteToQueue(Player* player);
|
||||
void PlayerAcceptInviteToWar(Player* player);
|
||||
@@ -323,7 +321,7 @@ class Battlefield : public ZoneScript
|
||||
/// Return if we can use mount in battlefield
|
||||
bool CanFlyIn() { return !m_isActive; }
|
||||
|
||||
void SendAreaSpiritHealerQueryOpcode(Player* player, uint64 guid);
|
||||
void SendAreaSpiritHealerQueryOpcode(Player* player, ObjectGuid guid);
|
||||
|
||||
void StartBattle();
|
||||
void EndBattle(bool endByTimer);
|
||||
@@ -344,9 +342,9 @@ class Battlefield : public ZoneScript
|
||||
void InitStalker(uint32 entry, Position const& pos);
|
||||
|
||||
protected:
|
||||
uint64 m_Guid;
|
||||
ObjectGuid m_Guid;
|
||||
|
||||
uint64 StalkerGuid;
|
||||
ObjectGuid StalkerGuid;
|
||||
uint32 m_Timer; // Global timer for event
|
||||
bool m_IsEnabled;
|
||||
bool m_isActive;
|
||||
|
||||
@@ -123,7 +123,7 @@ Battlefield* BattlefieldMgr::GetBattlefieldByBattleId(uint32 battleId)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Battlefield* BattlefieldMgr::GetBattlefieldByGUID(uint64 guid)
|
||||
Battlefield* BattlefieldMgr::GetBattlefieldByGUID(ObjectGuid guid)
|
||||
{
|
||||
for (BattlefieldSet::iterator itr = _battlefieldSet.begin(); itr != _battlefieldSet.end(); ++itr)
|
||||
if ((*itr)->GetGUID() == guid)
|
||||
|
||||
@@ -44,7 +44,7 @@ class BattlefieldMgr
|
||||
// return assigned battlefield
|
||||
Battlefield* GetBattlefieldToZoneId(uint32 zoneId);
|
||||
Battlefield* GetBattlefieldByBattleId(uint32 battleId);
|
||||
Battlefield* GetBattlefieldByGUID(uint64 guid);
|
||||
Battlefield* GetBattlefieldByGUID(ObjectGuid guid);
|
||||
|
||||
ZoneScript* GetZoneScript(uint32 zoneId);
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ void BattlefieldWG::OnBattleStart()
|
||||
// Initialize vehicle counter
|
||||
UpdateCounterVehicle(true);
|
||||
// Send start warning to all players
|
||||
SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_START);
|
||||
SendWarning(BATTLEFIELD_WG_TEXT_START);
|
||||
}
|
||||
|
||||
void BattlefieldWG::UpdateCounterVehicle(bool init)
|
||||
@@ -301,7 +301,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
|
||||
if (m_titansRelicGUID)
|
||||
if (GameObject* relic = GetGameObject(m_titansRelicGUID))
|
||||
relic->RemoveFromWorld();
|
||||
m_titansRelicGUID = 0;
|
||||
m_titansRelicGUID.Clear();
|
||||
|
||||
// Remove turret
|
||||
for (GuidSet::const_iterator itr = CanonList.begin(); itr != CanonList.end(); ++itr)
|
||||
@@ -409,9 +409,9 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
|
||||
}
|
||||
|
||||
if (!endByTimer) // win alli/horde
|
||||
SendWarningToAllInZone((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_WIN_KEEP : BATTLEFIELD_WG_TEXT_WIN_KEEP + 1);
|
||||
SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_WIN_KEEP : BATTLEFIELD_WG_TEXT_WIN_KEEP + 1);
|
||||
else // defend alli/horde
|
||||
SendWarningToAllInZone((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_DEFEND_KEEP : BATTLEFIELD_WG_TEXT_DEFEND_KEEP + 1);
|
||||
SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_DEFEND_KEEP : BATTLEFIELD_WG_TEXT_DEFEND_KEEP + 1);
|
||||
}
|
||||
|
||||
// *******************************************************
|
||||
@@ -442,7 +442,7 @@ void BattlefieldWG::DoCompleteOrIncrementAchievement(uint32 achievement, Player*
|
||||
|
||||
void BattlefieldWG::OnStartGrouping()
|
||||
{
|
||||
SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_WILL_START);
|
||||
SendWarning(BATTLEFIELD_WG_TEXT_WILL_START);
|
||||
}
|
||||
|
||||
uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId) const
|
||||
@@ -689,7 +689,7 @@ void BattlefieldWG::PromotePlayer(Player* killer)
|
||||
{
|
||||
killer->RemoveAura(SPELL_RECRUIT);
|
||||
killer->CastSpell(killer, SPELL_CORPORAL, true);
|
||||
SendWarningToPlayer(killer, BATTLEFIELD_WG_TEXT_FIRSTRANK);
|
||||
SendWarning(BATTLEFIELD_WG_TEXT_FIRSTRANK, killer);
|
||||
}
|
||||
else
|
||||
killer->CastSpell(killer, SPELL_RECRUIT, true);
|
||||
@@ -700,7 +700,7 @@ void BattlefieldWG::PromotePlayer(Player* killer)
|
||||
{
|
||||
killer->RemoveAura(SPELL_CORPORAL);
|
||||
killer->CastSpell(killer, SPELL_LIEUTENANT, true);
|
||||
SendWarningToPlayer(killer, BATTLEFIELD_WG_TEXT_SECONDRANK);
|
||||
SendWarning(BATTLEFIELD_WG_TEXT_SECONDRANK, killer);
|
||||
}
|
||||
else
|
||||
killer->CastSpell(killer, SPELL_CORPORAL, true);
|
||||
@@ -1065,7 +1065,6 @@ BfWGGameObjectBuilding::BfWGGameObjectBuilding(BattlefieldWG* wg)
|
||||
{
|
||||
m_WG = wg;
|
||||
m_Team = 0;
|
||||
m_BuildGUID = 0;
|
||||
m_Type = 0;
|
||||
m_WorldState = 0;
|
||||
m_State = 0;
|
||||
@@ -1117,13 +1116,13 @@ void BfWGGameObjectBuilding::Damaged()
|
||||
|
||||
// Send warning message
|
||||
if (m_NameId) // tower damage + name
|
||||
m_WG->SendWarningToAllInZone(m_NameId);
|
||||
m_WG->SendWarning(m_NameId);
|
||||
|
||||
for (uint64 guid : m_CreatureTopList[m_WG->GetAttackerTeam()])
|
||||
for (ObjectGuid guid : m_CreatureTopList[m_WG->GetAttackerTeam()])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->HideNpc(creature);
|
||||
|
||||
for (uint64 guid : m_TurretTopList)
|
||||
for (ObjectGuid guid : m_TurretTopList)
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->HideNpc(creature);
|
||||
|
||||
@@ -1141,7 +1140,7 @@ void BfWGGameObjectBuilding::Destroyed()
|
||||
|
||||
// Warn players
|
||||
if (m_NameId)
|
||||
m_WG->SendWarningToAllInZone(m_NameId);
|
||||
m_WG->SendWarning(m_NameId);
|
||||
|
||||
switch (m_Type)
|
||||
{
|
||||
@@ -1331,34 +1330,34 @@ void BfWGGameObjectBuilding::Init(GameObject* go, uint32 type, uint32 worldstate
|
||||
|
||||
void BfWGGameObjectBuilding::UpdateCreatureAndGo()
|
||||
{
|
||||
for (uint64 guid : m_CreatureTopList[m_WG->GetDefenderTeam()])
|
||||
for (ObjectGuid guid : m_CreatureTopList[m_WG->GetDefenderTeam()])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->HideNpc(creature);
|
||||
|
||||
for (uint64 guid : m_CreatureTopList[m_WG->GetAttackerTeam()])
|
||||
for (ObjectGuid guid : m_CreatureTopList[m_WG->GetAttackerTeam()])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->ShowNpc(creature, true);
|
||||
|
||||
for (uint64 guid : m_CreatureBottomList[m_WG->GetDefenderTeam()])
|
||||
for (ObjectGuid guid : m_CreatureBottomList[m_WG->GetDefenderTeam()])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->HideNpc(creature);
|
||||
|
||||
for (uint64 guid : m_CreatureBottomList[m_WG->GetAttackerTeam()])
|
||||
for (ObjectGuid guid : m_CreatureBottomList[m_WG->GetAttackerTeam()])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->ShowNpc(creature, true);
|
||||
|
||||
for (uint64 guid : m_GameObjectList[m_WG->GetDefenderTeam()])
|
||||
for (ObjectGuid guid : m_GameObjectList[m_WG->GetDefenderTeam()])
|
||||
if (GameObject* object = m_WG->GetGameObject(guid))
|
||||
object->SetRespawnTime(RESPAWN_ONE_DAY);
|
||||
|
||||
for (uint64 guid : m_GameObjectList[m_WG->GetAttackerTeam()])
|
||||
for (ObjectGuid guid : m_GameObjectList[m_WG->GetAttackerTeam()])
|
||||
if (GameObject* object = m_WG->GetGameObject(guid))
|
||||
object->SetRespawnTime(RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BfWGGameObjectBuilding::UpdateTurretAttack(bool disable)
|
||||
{
|
||||
for (uint64 guid : m_TowerCannonBottomList)
|
||||
for (ObjectGuid guid : m_TowerCannonBottomList)
|
||||
{
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
{
|
||||
@@ -1391,7 +1390,7 @@ void BfWGGameObjectBuilding::UpdateTurretAttack(bool disable)
|
||||
}
|
||||
}
|
||||
|
||||
for (uint64 guid : m_TurretTopList)
|
||||
for (ObjectGuid guid : m_TurretTopList)
|
||||
{
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
{
|
||||
@@ -1448,7 +1447,7 @@ void WGWorkshop::GiveControlTo(uint8 team, bool init)
|
||||
{
|
||||
// Send warning message to all player to inform a faction attack to a workshop
|
||||
// alliance / horde attacking a workshop
|
||||
bf->SendWarningToAllInZone(teamControl ? WorkshopsData[workshopId].text : WorkshopsData[workshopId].text + 1);
|
||||
bf->SendWarning(teamControl ? WorkshopsData[workshopId].text : WorkshopsData[workshopId].text + 1);
|
||||
break;
|
||||
}
|
||||
case BATTLEFIELD_WG_TEAM_ALLIANCE:
|
||||
@@ -1460,7 +1459,7 @@ void WGWorkshop::GiveControlTo(uint8 team, bool init)
|
||||
|
||||
// Warning message
|
||||
if (!init) // workshop taken - alliance
|
||||
bf->SendWarningToAllInZone(team == BATTLEFIELD_WG_TEAM_ALLIANCE ? WorkshopsData[workshopId].text : WorkshopsData[workshopId].text + 1);
|
||||
bf->SendWarning(team == BATTLEFIELD_WG_TEAM_ALLIANCE ? WorkshopsData[workshopId].text : WorkshopsData[workshopId].text + 1);
|
||||
|
||||
// Found associate graveyard and update it
|
||||
if (workshopId < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
|
||||
@@ -1492,7 +1491,6 @@ void WGWorkshop::Save()
|
||||
WintergraspWorkshopData::WintergraspWorkshopData(BattlefieldWG* wg)
|
||||
{
|
||||
m_WG = wg;
|
||||
m_BuildGUID = 0;
|
||||
m_Type = 0;
|
||||
m_State = 0;
|
||||
m_WorldState = 0;
|
||||
@@ -1532,28 +1530,28 @@ void WintergraspWorkshopData::GiveControlTo(uint8 team, bool init)
|
||||
{
|
||||
// Send warning message to all player for inform a faction attack a workshop
|
||||
// alliance / horde attacking workshop
|
||||
m_WG->SendWarningToAllInZone(m_TeamControl ? m_NameId : m_NameId + 1);
|
||||
m_WG->SendWarning(m_TeamControl ? m_NameId : m_NameId + 1);
|
||||
break;
|
||||
}
|
||||
case BATTLEFIELD_WG_TEAM_ALLIANCE:
|
||||
{
|
||||
// Show Alliance creature
|
||||
for (uint64 guid : m_CreatureOnPoint[TEAM_ALLIANCE])
|
||||
for (ObjectGuid guid : m_CreatureOnPoint[TEAM_ALLIANCE])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->ShowNpc(creature, creature->GetEntry() != 30499);
|
||||
|
||||
// Hide Horde creature
|
||||
for (uint64 guid : m_CreatureOnPoint[TEAM_HORDE])
|
||||
for (ObjectGuid guid : m_CreatureOnPoint[TEAM_HORDE])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->HideNpc(creature);
|
||||
|
||||
// Show Alliance gameobject
|
||||
for (uint64 guid : m_GameObjectOnPoint[TEAM_ALLIANCE])
|
||||
for (ObjectGuid guid : m_GameObjectOnPoint[TEAM_ALLIANCE])
|
||||
if (GameObject* object = m_WG->GetGameObject(guid))
|
||||
object->SetRespawnTime(RESPAWN_IMMEDIATELY);
|
||||
|
||||
// Hide Horde gameobject
|
||||
for (uint64 guid : m_GameObjectOnPoint[TEAM_HORDE])
|
||||
for (ObjectGuid guid : m_GameObjectOnPoint[TEAM_HORDE])
|
||||
if (GameObject* object = m_WG->GetGameObject(guid))
|
||||
object->SetRespawnTime(RESPAWN_ONE_DAY);
|
||||
|
||||
@@ -1564,7 +1562,7 @@ void WintergraspWorkshopData::GiveControlTo(uint8 team, bool init)
|
||||
|
||||
// Warning message
|
||||
if (!init) // workshop taken - alliance
|
||||
m_WG->SendWarningToAllInZone(m_NameId);
|
||||
m_WG->SendWarning(m_NameId);
|
||||
|
||||
// Found associate graveyard and update it
|
||||
if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
|
||||
@@ -1577,22 +1575,22 @@ void WintergraspWorkshopData::GiveControlTo(uint8 team, bool init)
|
||||
case BATTLEFIELD_WG_TEAM_HORDE:
|
||||
{
|
||||
// Show Horde creature
|
||||
for (uint64 guid : m_CreatureOnPoint[TEAM_HORDE])
|
||||
for (ObjectGuid guid : m_CreatureOnPoint[TEAM_HORDE])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->ShowNpc(creature, creature->GetEntry() != 30400);
|
||||
|
||||
// Hide Alliance creature
|
||||
for (uint64 guid : m_CreatureOnPoint[TEAM_ALLIANCE])
|
||||
for (ObjectGuid guid : m_CreatureOnPoint[TEAM_ALLIANCE])
|
||||
if (Creature* creature = m_WG->GetCreature(guid))
|
||||
m_WG->HideNpc(creature);
|
||||
|
||||
// Hide Alliance gameobject
|
||||
for (uint64 guid : m_GameObjectOnPoint[TEAM_ALLIANCE])
|
||||
for (ObjectGuid guid : m_GameObjectOnPoint[TEAM_ALLIANCE])
|
||||
if (GameObject* object = m_WG->GetGameObject(guid))
|
||||
object->SetRespawnTime(RESPAWN_ONE_DAY);
|
||||
|
||||
// Show Horde gameobject
|
||||
for (uint64 guid : m_GameObjectOnPoint[TEAM_HORDE])
|
||||
for (ObjectGuid guid : m_GameObjectOnPoint[TEAM_HORDE])
|
||||
if (GameObject* object = m_WG->GetGameObject(guid))
|
||||
object->SetRespawnTime(RESPAWN_IMMEDIATELY);
|
||||
|
||||
@@ -1602,7 +1600,7 @@ void WintergraspWorkshopData::GiveControlTo(uint8 team, bool init)
|
||||
|
||||
// Warning message
|
||||
if (!init) // workshop taken - horde
|
||||
m_WG->SendWarningToAllInZone(m_NameId + 1);
|
||||
m_WG->SendWarning(m_NameId + 1);
|
||||
|
||||
// Update graveyard control
|
||||
if (m_Type < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST)
|
||||
|
||||
@@ -383,7 +383,7 @@ class BattlefieldWG : public Battlefield
|
||||
GameObject* GetRelic() { return GetGameObject(m_titansRelicGUID); }
|
||||
|
||||
/// Define relic object
|
||||
void SetRelic(uint64 relicGUID) { m_titansRelicGUID = relicGUID; }
|
||||
void SetRelic(ObjectGuid relicGUID) { m_titansRelicGUID = relicGUID; }
|
||||
|
||||
/// Check if players can interact with the relic (Only if the last door has been broken)
|
||||
bool CanInteractWithRelic() { return m_isRelicInteractible; }
|
||||
@@ -429,7 +429,7 @@ class BattlefieldWG : public Battlefield
|
||||
uint32 m_tenacityStack;
|
||||
uint32 m_saveTimer;
|
||||
|
||||
uint64 m_titansRelicGUID;
|
||||
ObjectGuid m_titansRelicGUID;
|
||||
};
|
||||
|
||||
uint32 const VehNumWorldState[] = { 3680, 3490 };
|
||||
@@ -578,7 +578,7 @@ struct WintergraspBuildingSpawnData
|
||||
|
||||
struct WintergraspRebuildableBuildingData
|
||||
{
|
||||
uint64 Guid;
|
||||
ObjectGuid Guid;
|
||||
uint32 entry;
|
||||
uint32 WorldState;
|
||||
float x;
|
||||
@@ -1068,7 +1068,7 @@ struct BfWGGameObjectBuilding
|
||||
BattlefieldWG* m_WG;
|
||||
|
||||
// Linked gameobject
|
||||
uint64 m_BuildGUID;
|
||||
ObjectGuid m_BuildGUID;
|
||||
|
||||
// eWGGameObjectBuildingType
|
||||
uint32 m_Type;
|
||||
@@ -1132,7 +1132,7 @@ struct WGWorkshop
|
||||
struct WintergraspWorkshopData
|
||||
{
|
||||
BattlefieldWG* m_WG; // Pointer to wintergrasp
|
||||
uint64 m_BuildGUID;
|
||||
ObjectGuid m_BuildGUID;
|
||||
uint32 m_Type;
|
||||
uint32 m_State; // For worldstate
|
||||
uint32 m_WorldState;
|
||||
|
||||
@@ -62,7 +62,7 @@ void Arena::AddPlayer(Player* player)
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void Arena::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/)
|
||||
void Arena::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
@@ -94,7 +94,7 @@ void Arena::HandleKillPlayer(Player* player, Player* killer)
|
||||
CheckWinConditions();
|
||||
}
|
||||
|
||||
void Arena::RemovePlayerAtLeave(uint64 guid, bool transport, bool sendPacket)
|
||||
void Arena::RemovePlayerAtLeave(ObjectGuid guid, bool transport, bool sendPacket)
|
||||
{
|
||||
if (isRated() && GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ void Arena::EndBattleground(uint32 winner)
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
|
||||
for (auto const& score : PlayerScores)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(score.first, 0, HIGHGUID_PLAYER)))
|
||||
if (Player* player = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, score.first)))
|
||||
{
|
||||
TC_LOG_DEBUG("bg.arena", "Statistics match Type: %u for %s (GUID: %u, Team: %d, IP: %s): %s",
|
||||
GetArenaType(), player->GetName().c_str(), score.first, player->GetArenaTeamId(GetArenaType() == 5 ? 2 : GetArenaType() == 3),
|
||||
|
||||
@@ -42,7 +42,7 @@ class Arena : public Battleground
|
||||
Arena();
|
||||
|
||||
void AddPlayer(Player* player) override;
|
||||
void RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) override;
|
||||
void RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/) override;
|
||||
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
void UpdateArenaWorldState();
|
||||
@@ -50,7 +50,7 @@ class Arena : public Battleground
|
||||
void HandleKillPlayer(Player* player, Player* killer) override;
|
||||
|
||||
private:
|
||||
void RemovePlayerAtLeave(uint64 guid, bool transport, bool sendPacket) override;
|
||||
void RemovePlayerAtLeave(ObjectGuid guid, bool transport, bool sendPacket) override;
|
||||
void CheckWinConditions() override;
|
||||
void EndBattleground(uint32 winner) override;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ struct ArenaScore : public BattlegroundScore
|
||||
friend class Arena;
|
||||
|
||||
protected:
|
||||
ArenaScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), TeamId(team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE) { }
|
||||
ArenaScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), TeamId(team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE) { }
|
||||
|
||||
void AppendToPacket(WorldPacket& data, ByteBuffer& content) final override
|
||||
{
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "ArenaTeam.h"
|
||||
#include "World.h"
|
||||
#include "Group.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
ArenaTeam::ArenaTeam()
|
||||
: TeamId(0), Type(0), TeamName(), CaptainGuid(0), BackgroundColor(0), EmblemStyle(0), EmblemColor(0),
|
||||
: TeamId(0), Type(0), TeamName(), CaptainGuid(), BackgroundColor(0), EmblemStyle(0), EmblemColor(0),
|
||||
BorderStyle(0), BorderColor(0)
|
||||
{
|
||||
Stats.WeekGames = 0;
|
||||
@@ -41,16 +41,14 @@ ArenaTeam::ArenaTeam()
|
||||
ArenaTeam::~ArenaTeam()
|
||||
{ }
|
||||
|
||||
bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string const& arenaTeamName,
|
||||
uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor,
|
||||
uint8 borderStyle, uint32 borderColor)
|
||||
bool ArenaTeam::Create(ObjectGuid captainGuid, uint8 type, std::string const& teamName, uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor, uint8 borderStyle, uint32 borderColor)
|
||||
{
|
||||
// Check if captain is present
|
||||
if (!ObjectAccessor::FindPlayer(captainGuid))
|
||||
return false;
|
||||
|
||||
// Check if arena team name is already taken
|
||||
if (sArenaTeamMgr->GetArenaTeamByName(arenaTeamName))
|
||||
if (sArenaTeamMgr->GetArenaTeamByName(teamName))
|
||||
return false;
|
||||
|
||||
// Generate new arena team id
|
||||
@@ -59,13 +57,13 @@ bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string const& arenaT
|
||||
// Assign member variables
|
||||
CaptainGuid = captainGuid;
|
||||
Type = type;
|
||||
TeamName = arenaTeamName;
|
||||
TeamName = teamName;
|
||||
BackgroundColor = backgroundColor;
|
||||
EmblemStyle = emblemStyle;
|
||||
EmblemColor = emblemColor;
|
||||
BorderStyle = borderStyle;
|
||||
BorderColor = borderColor;
|
||||
uint32 captainLowGuid = GUID_LOPART(captainGuid);
|
||||
uint32 captainLowGuid = captainGuid.GetCounter();
|
||||
|
||||
// Save arena team to db
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM);
|
||||
@@ -88,7 +86,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string const& arenaT
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ArenaTeam::AddMember(uint64 playerGuid)
|
||||
bool ArenaTeam::AddMember(ObjectGuid playerGuid)
|
||||
{
|
||||
std::string playerName;
|
||||
uint8 playerClass;
|
||||
@@ -109,7 +107,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
|
||||
// 0 1
|
||||
// SELECT name, class FROM characters WHERE guid = ?
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_CLASS);
|
||||
stmt->setUInt32(0, GUID_LOPART(playerGuid));
|
||||
stmt->setUInt32(0, playerGuid.GetCounter());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (!result)
|
||||
@@ -122,7 +120,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
|
||||
// Check if player is already in a similar arena team
|
||||
if ((player && player->GetArenaTeamId(GetSlot())) || Player::GetArenaTeamIdFromDB(playerGuid, GetType()) != 0)
|
||||
{
|
||||
TC_LOG_DEBUG("bg.arena", "Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());
|
||||
TC_LOG_DEBUG("bg.arena", "Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), playerGuid.GetCounter(), GetType());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -136,7 +134,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
|
||||
|
||||
// Try to get player's match maker rating from db and fall back to config setting if not found
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MATCH_MAKER_RATING);
|
||||
stmt->setUInt32(0, GUID_LOPART(playerGuid));
|
||||
stmt->setUInt32(0, playerGuid.GetCounter());
|
||||
stmt->setUInt8(1, GetSlot());
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
@@ -167,7 +165,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
|
||||
// Save player's arena team membership to db
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM_MEMBER);
|
||||
stmt->setUInt32(0, TeamId);
|
||||
stmt->setUInt32(1, GUID_LOPART(playerGuid));
|
||||
stmt->setUInt32(1, playerGuid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
// Inform player if online
|
||||
@@ -181,7 +179,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
|
||||
player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("bg.arena", "Player: %s [GUID: %u] joined arena team type: %u [Id: %u, Name: %s].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId(), GetName().c_str());
|
||||
TC_LOG_INFO("bg.arena", "Player: %s [GUID: %u] joined arena team type: %u [Id: %u, Name: %s].", playerName.c_str(), playerGuid.GetCounter(), GetType(), GetId(), GetName().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -195,7 +193,7 @@ bool ArenaTeam::LoadArenaTeamFromDB(QueryResult result)
|
||||
|
||||
TeamId = fields[0].GetUInt32();
|
||||
TeamName = fields[1].GetString();
|
||||
CaptainGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
CaptainGuid = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt32());
|
||||
Type = fields[3].GetUInt8();
|
||||
BackgroundColor = fields[4].GetUInt32();
|
||||
EmblemStyle = fields[5].GetUInt8();
|
||||
@@ -234,7 +232,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
|
||||
break;
|
||||
|
||||
ArenaTeamMember newMember;
|
||||
newMember.Guid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
newMember.Guid = ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt32());
|
||||
newMember.WeekGames = fields[2].GetUInt16();
|
||||
newMember.WeekWins = fields[3].GetUInt16();
|
||||
newMember.SeasonGames = fields[4].GetUInt16();
|
||||
@@ -247,7 +245,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
|
||||
// Delete member if character information is missing
|
||||
if (newMember.Name.empty())
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));
|
||||
TC_LOG_ERROR("sql.sql", "ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, newMember.Guid.GetCounter());
|
||||
DelMember(newMember.Guid, true);
|
||||
continue;
|
||||
}
|
||||
@@ -284,7 +282,7 @@ bool ArenaTeam::SetName(std::string const& name)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ArenaTeam::SetCaptain(uint64 guid)
|
||||
void ArenaTeam::SetCaptain(ObjectGuid guid)
|
||||
{
|
||||
// Disable remove/promote buttons
|
||||
Player* oldCaptain = ObjectAccessor::FindPlayer(GetCaptain());
|
||||
@@ -296,7 +294,7 @@ void ArenaTeam::SetCaptain(uint64 guid)
|
||||
|
||||
// Update database
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_CAPTAIN);
|
||||
stmt->setUInt32(0, GUID_LOPART(guid));
|
||||
stmt->setUInt32(0, guid.GetCounter());
|
||||
stmt->setUInt32(1, GetId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
@@ -313,7 +311,7 @@ void ArenaTeam::SetCaptain(uint64 guid)
|
||||
}
|
||||
}
|
||||
|
||||
void ArenaTeam::DelMember(uint64 guid, bool cleanDb)
|
||||
void ArenaTeam::DelMember(ObjectGuid guid, bool cleanDb)
|
||||
{
|
||||
// Remove member from team
|
||||
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
|
||||
@@ -337,7 +335,7 @@ void ArenaTeam::DelMember(uint64 guid, bool cleanDb)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ARENA_TEAM_MEMBER);
|
||||
stmt->setUInt32(0, GetId());
|
||||
stmt->setUInt32(1, GUID_LOPART(guid));
|
||||
stmt->setUInt32(1, guid.GetCounter());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
}
|
||||
@@ -347,7 +345,7 @@ void ArenaTeam::Disband(WorldSession* session)
|
||||
// Broadcast update
|
||||
if (session)
|
||||
{
|
||||
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
|
||||
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, ObjectGuid::Empty, 2, session->GetPlayerName(), GetName(), "");
|
||||
if (Player* player = session->GetPlayer())
|
||||
TC_LOG_DEBUG("bg.arena", "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u, Name: %s].", player->GetName().c_str(), player->GetGUIDLow(), GetType(), GetId(), GetName().c_str());
|
||||
}
|
||||
@@ -471,7 +469,7 @@ void ArenaTeam::NotifyStatsChanged()
|
||||
SendStats(player->GetSession());
|
||||
}
|
||||
|
||||
void ArenaTeam::Inspect(WorldSession* session, uint64 guid)
|
||||
void ArenaTeam::Inspect(WorldSession* session, ObjectGuid guid)
|
||||
{
|
||||
ArenaTeamMember* member = GetMember(guid);
|
||||
if (!member)
|
||||
@@ -518,7 +516,7 @@ void ArenaTeam::BroadcastPacket(WorldPacket* packet)
|
||||
player->GetSession()->SendPacket(packet);
|
||||
}
|
||||
|
||||
void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCount, std::string const& str1, std::string const& str2, std::string const& str3)
|
||||
void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, ObjectGuid guid, uint8 strCount, std::string const& str1, std::string const& str2, std::string const& str3)
|
||||
{
|
||||
WorldPacket data(SMSG_ARENA_TEAM_EVENT, 1+1+1);
|
||||
data << uint8(event);
|
||||
@@ -558,7 +556,7 @@ void ArenaTeam::MassInviteToEvent(WorldSession* session)
|
||||
{
|
||||
if (itr->Guid != session->GetPlayer()->GetGUID())
|
||||
{
|
||||
data.appendPackGUID(itr->Guid);
|
||||
data << itr->Guid.WriteAsPacked();
|
||||
data << uint8(0); // unk
|
||||
}
|
||||
}
|
||||
@@ -594,7 +592,7 @@ uint8 ArenaTeam::GetTypeBySlot(uint8 slot)
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
bool ArenaTeam::IsMember(uint64 guid) const
|
||||
bool ArenaTeam::IsMember(ObjectGuid guid) const
|
||||
{
|
||||
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
|
||||
if (itr->Guid == guid)
|
||||
@@ -781,7 +779,7 @@ void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32
|
||||
}
|
||||
}
|
||||
|
||||
void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 matchmakerRatingChange)
|
||||
void ArenaTeam::OfflineMemberLost(ObjectGuid guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
|
||||
{
|
||||
// Called for offline player after ending rated arena match!
|
||||
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
|
||||
@@ -793,7 +791,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, i
|
||||
itr->ModifyPersonalRating(NULL, mod, GetType());
|
||||
|
||||
// update matchmaker rating
|
||||
itr->ModifyMatchmakerRating(matchmakerRatingChange, GetSlot());
|
||||
itr->ModifyMatchmakerRating(MatchmakerRatingChange, GetSlot());
|
||||
|
||||
// update personal played stats
|
||||
itr->WeekGames += 1;
|
||||
@@ -856,11 +854,11 @@ void ArenaTeam::SaveToDB()
|
||||
stmt->setUInt16(3, itr->SeasonGames);
|
||||
stmt->setUInt16(4, itr->SeasonWins);
|
||||
stmt->setUInt32(5, GetId());
|
||||
stmt->setUInt32(6, GUID_LOPART(itr->Guid));
|
||||
stmt->setUInt32(6, itr->Guid.GetCounter());
|
||||
trans->Append(stmt);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHARACTER_ARENA_STATS);
|
||||
stmt->setUInt32(0, GUID_LOPART(itr->Guid));
|
||||
stmt->setUInt32(0, itr->Guid.GetCounter());
|
||||
stmt->setUInt8(1, GetSlot());
|
||||
stmt->setUInt16(2, itr->MatchMakerRating);
|
||||
trans->Append(stmt);
|
||||
@@ -902,7 +900,7 @@ ArenaTeamMember* ArenaTeam::GetMember(const std::string& name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ArenaTeamMember* ArenaTeam::GetMember(uint64 guid)
|
||||
ArenaTeamMember* ArenaTeam::GetMember(ObjectGuid guid)
|
||||
{
|
||||
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
|
||||
if (itr->Guid == guid)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "Define.h"
|
||||
#include "QueryResult.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <map>
|
||||
@@ -82,7 +83,7 @@ enum ArenaTeamTypes
|
||||
|
||||
struct ArenaTeamMember
|
||||
{
|
||||
uint64 Guid;
|
||||
ObjectGuid Guid;
|
||||
std::string Name;
|
||||
uint8 Class;
|
||||
uint16 WeekGames;
|
||||
@@ -114,9 +115,7 @@ class ArenaTeam
|
||||
ArenaTeam();
|
||||
~ArenaTeam();
|
||||
|
||||
bool Create(uint64 captainGuid, uint8 type, std::string const& teamName,
|
||||
uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor,
|
||||
uint8 borderStyle, uint32 borderColor);
|
||||
bool Create(ObjectGuid captainGuid, uint8 type, std::string const& teamName, uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor, uint8 borderStyle, uint32 borderColor);
|
||||
void Disband(WorldSession* session);
|
||||
void Disband();
|
||||
|
||||
@@ -127,25 +126,25 @@ class ArenaTeam
|
||||
uint8 GetSlot() const { return GetSlotByType(GetType()); }
|
||||
static uint8 GetSlotByType(uint32 type);
|
||||
static uint8 GetTypeBySlot(uint8 slot);
|
||||
uint64 GetCaptain() const { return CaptainGuid; }
|
||||
ObjectGuid GetCaptain() const { return CaptainGuid; }
|
||||
std::string const& GetName() const { return TeamName; }
|
||||
const ArenaTeamStats& GetStats() const { return Stats; }
|
||||
|
||||
uint32 GetRating() const { return Stats.Rating; }
|
||||
uint32 GetAverageMMR(Group* group) const;
|
||||
|
||||
void SetCaptain(uint64 guid);
|
||||
void SetCaptain(ObjectGuid guid);
|
||||
bool SetName(std::string const& name);
|
||||
bool AddMember(uint64 PlayerGuid);
|
||||
void DelMember(uint64 guid, bool cleanDb);
|
||||
bool AddMember(ObjectGuid PlayerGuid);
|
||||
void DelMember(ObjectGuid guid, bool cleanDb);
|
||||
|
||||
size_t GetMembersSize() const { return Members.size(); }
|
||||
bool Empty() const { return Members.empty(); }
|
||||
MemberList::iterator m_membersBegin() { return Members.begin(); }
|
||||
MemberList::iterator m_membersEnd() { return Members.end(); }
|
||||
bool IsMember(uint64 guid) const;
|
||||
bool IsMember(ObjectGuid guid) const;
|
||||
|
||||
ArenaTeamMember* GetMember(uint64 guid);
|
||||
ArenaTeamMember* GetMember(ObjectGuid guid);
|
||||
ArenaTeamMember* GetMember(std::string const& name);
|
||||
|
||||
bool IsFighting() const;
|
||||
@@ -156,7 +155,7 @@ class ArenaTeam
|
||||
void SaveToDB();
|
||||
|
||||
void BroadcastPacket(WorldPacket* packet);
|
||||
void BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCount, std::string const& str1, std::string const& str2, std::string const& str3);
|
||||
void BroadcastEvent(ArenaTeamEvents event, ObjectGuid guid, uint8 strCount, std::string const& str1, std::string const& str2, std::string const& str3);
|
||||
void NotifyStatsChanged();
|
||||
|
||||
void MassInviteToEvent(WorldSession* session);
|
||||
@@ -164,18 +163,20 @@ class ArenaTeam
|
||||
void Roster(WorldSession* session);
|
||||
void Query(WorldSession* session);
|
||||
void SendStats(WorldSession* session);
|
||||
void Inspect(WorldSession* session, uint64 guid);
|
||||
void Inspect(WorldSession* session, ObjectGuid guid);
|
||||
|
||||
uint32 GetPoints(uint32 MemberRating);
|
||||
int32 GetMatchmakerRatingMod(uint32 ownRating, uint32 opponentRating, bool won);
|
||||
int32 GetRatingMod(uint32 ownRating, uint32 opponentRating, bool won);
|
||||
float GetChanceAgainst(uint32 ownRating, uint32 opponentRating);
|
||||
int32 WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change);
|
||||
void MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange);
|
||||
int32 LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change);
|
||||
void MemberLost(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange = -12);
|
||||
void OfflineMemberLost(ObjectGuid guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange = -12);
|
||||
|
||||
static int32 GetMatchmakerRatingMod(uint32 ownRating, uint32 opponentRating, bool won);
|
||||
static int32 GetRatingMod(uint32 ownRating, uint32 opponentRating, bool won);
|
||||
static float GetChanceAgainst(uint32 ownRating, uint32 opponentRating);
|
||||
|
||||
int32 WonAgainst(uint32 ownMMRating, uint32 opponentMMRating, int32& rating_change);
|
||||
void MemberWon(Player* player, uint32 againstMatchmakerRating, int32 matchmakerRatingChange = 12);
|
||||
|
||||
int32 LostAgainst(uint32 ownMMRating, uint32 opponentMMRating, int32& rating_change);
|
||||
void MemberLost(Player* player, uint32 againstMatchmakerRating, int32 matchmakerRatingChange = -12);
|
||||
void OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 matchmakerRatingChange = -12);
|
||||
|
||||
void FinishWeek();
|
||||
void FinishGame(int32 mod);
|
||||
@@ -185,7 +186,7 @@ class ArenaTeam
|
||||
uint32 TeamId;
|
||||
uint8 Type;
|
||||
std::string TeamName;
|
||||
uint64 CaptainGuid;
|
||||
ObjectGuid CaptainGuid;
|
||||
|
||||
uint32 BackgroundColor; // ARGB format
|
||||
uint8 EmblemStyle; // icon id
|
||||
|
||||
@@ -59,7 +59,7 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) co
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid) const
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(ObjectGuid guid) const
|
||||
{
|
||||
for (ArenaTeamContainer::const_iterator itr = ArenaTeamStore.begin(); itr != ArenaTeamStore.end(); ++itr)
|
||||
if (itr->second->GetCaptain() == guid)
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
ArenaTeam* GetArenaTeamById(uint32 arenaTeamId) const;
|
||||
ArenaTeam* GetArenaTeamByName(std::string const& arenaTeamName) const;
|
||||
ArenaTeam* GetArenaTeamByCaptain(uint64 guid) const;
|
||||
ArenaTeam* GetArenaTeamByCaptain(ObjectGuid guid) const;
|
||||
|
||||
void LoadArenaTeams();
|
||||
void AddArenaTeam(ArenaTeam* arenaTeam);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Trinity
|
||||
class BattlegroundChatBuilder
|
||||
{
|
||||
public:
|
||||
BattlegroundChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, va_list* args = NULL)
|
||||
BattlegroundChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, va_list* args = NULL)
|
||||
: _msgtype(msgtype), _textId(textId), _source(source), _args(args) { }
|
||||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
@@ -72,7 +72,7 @@ namespace Trinity
|
||||
}
|
||||
|
||||
ChatMsg _msgtype;
|
||||
int32 _textId;
|
||||
uint32 _textId;
|
||||
Player const* _source;
|
||||
va_list* _args;
|
||||
};
|
||||
@@ -80,7 +80,7 @@ namespace Trinity
|
||||
class Battleground2ChatBuilder
|
||||
{
|
||||
public:
|
||||
Battleground2ChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, int32 arg1, int32 arg2)
|
||||
Battleground2ChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, uint32 arg1, uint32 arg2)
|
||||
: _msgtype(msgtype), _textId(textId), _source(source), _arg1(arg1), _arg2(arg2) { }
|
||||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
@@ -97,10 +97,10 @@ namespace Trinity
|
||||
|
||||
private:
|
||||
ChatMsg _msgtype;
|
||||
int32 _textId;
|
||||
uint32 _textId;
|
||||
Player const* _source;
|
||||
int32 _arg1;
|
||||
int32 _arg2;
|
||||
uint32 _arg1;
|
||||
uint32 _arg2;
|
||||
};
|
||||
} // namespace Trinity
|
||||
|
||||
@@ -114,7 +114,6 @@ void Battleground::BroadcastWorker(Do& _do)
|
||||
|
||||
Battleground::Battleground()
|
||||
{
|
||||
m_Guid = 0;
|
||||
m_TypeID = BATTLEGROUND_TYPE_NONE;
|
||||
m_RandomTypeID = BATTLEGROUND_TYPE_NONE;
|
||||
m_InstanceID = 0;
|
||||
@@ -137,7 +136,6 @@ Battleground::Battleground()
|
||||
m_IsRated = false;
|
||||
m_BuffChange = false;
|
||||
m_IsRandom = false;
|
||||
m_Name = "";
|
||||
m_LevelMin = 0;
|
||||
m_LevelMax = 0;
|
||||
m_InBGFreeSlotQueue = false;
|
||||
@@ -335,10 +333,10 @@ inline void Battleground::_ProcessResurrect(uint32 diff)
|
||||
{
|
||||
if (GetReviveQueueSize())
|
||||
{
|
||||
for (std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
for (std::map<ObjectGuid, GuidVector>::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
{
|
||||
Creature* sh = NULL;
|
||||
for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
for (GuidVector::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr2);
|
||||
if (!player)
|
||||
@@ -369,7 +367,7 @@ inline void Battleground::_ProcessResurrect(uint32 diff)
|
||||
}
|
||||
else if (m_LastResurrectTime > 500) // Resurrect players only half a second later, to see spirit heal effect on NPC
|
||||
{
|
||||
for (std::vector<uint64>::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
for (GuidVector::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
if (!player)
|
||||
@@ -595,7 +593,7 @@ inline void Battleground::_ProcessLeave(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
Player* Battleground::_GetPlayer(uint64 guid, bool offlineRemove, char const* context) const
|
||||
Player* Battleground::_GetPlayer(ObjectGuid guid, bool offlineRemove, char const* context) const
|
||||
{
|
||||
Player* player = NULL;
|
||||
if (!offlineRemove)
|
||||
@@ -603,7 +601,7 @@ Player* Battleground::_GetPlayer(uint64 guid, bool offlineRemove, char const* co
|
||||
player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player)
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::%s: player (GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
context, GUID_LOPART(guid), m_MapId, m_InstanceID);
|
||||
context, guid.GetCounter(), m_MapId, m_InstanceID);
|
||||
}
|
||||
return player;
|
||||
}
|
||||
@@ -655,7 +653,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player*
|
||||
|
||||
void Battleground::SendChatMessage(Creature* source, uint8 textId, WorldObject* target /*= NULL*/)
|
||||
{
|
||||
sCreatureTextMgr->SendChat(source, textId, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
|
||||
sCreatureTextMgr->SendChat(source, textId, target);
|
||||
}
|
||||
|
||||
void Battleground::PlaySoundToAll(uint32 SoundID)
|
||||
@@ -904,7 +902,7 @@ void Battleground::BlockMovement(Player* player)
|
||||
player->SetClientControl(player, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave()
|
||||
}
|
||||
|
||||
void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket)
|
||||
void Battleground::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket)
|
||||
{
|
||||
uint32 team = GetPlayerTeam(guid);
|
||||
bool participant = false;
|
||||
@@ -918,7 +916,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
participant = true;
|
||||
}
|
||||
|
||||
BattlegroundScoreMap::iterator itr2 = PlayerScores.find(GUID_LOPART(guid));
|
||||
BattlegroundScoreMap::iterator itr2 = PlayerScores.find(guid.GetCounter());
|
||||
if (itr2 != PlayerScores.end())
|
||||
{
|
||||
delete itr2->second; // delete player's score
|
||||
@@ -1069,7 +1067,6 @@ void Battleground::AddPlayer(Player* player)
|
||||
|
||||
// score struct must be created in inherited class
|
||||
|
||||
uint64 guid = player->GetGUID();
|
||||
uint32 team = player->GetBGTeam();
|
||||
int32 primaryTree = player->GetPrimaryTalentTree(player->GetActiveSpec());
|
||||
|
||||
@@ -1079,7 +1076,7 @@ void Battleground::AddPlayer(Player* player)
|
||||
bp.PrimaryTree = primaryTree;
|
||||
|
||||
// Add to list/maps
|
||||
m_Players[guid] = bp;
|
||||
m_Players[player->GetGUID()] = bp;
|
||||
|
||||
UpdatePlayersCountByTeam(team, false); // +1 player
|
||||
|
||||
@@ -1144,7 +1141,7 @@ void Battleground::AddPlayer(Player* player)
|
||||
// this method adds player to his team's bg group, or sets his correct group if player is already in bg group
|
||||
void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team)
|
||||
{
|
||||
uint64 playerGuid = player->GetGUID();
|
||||
ObjectGuid playerGuid = player->GetGUID();
|
||||
Group* group = GetBgRaid(team);
|
||||
if (!group) // first player joined
|
||||
{
|
||||
@@ -1175,9 +1172,9 @@ void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team)
|
||||
// This method should be called when player logs into running battleground
|
||||
void Battleground::EventPlayerLoggedIn(Player* player)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
// player is correct pointer
|
||||
for (std::deque<uint64>::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
|
||||
for (GuidDeque::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
|
||||
{
|
||||
if (*itr == guid)
|
||||
{
|
||||
@@ -1194,7 +1191,7 @@ void Battleground::EventPlayerLoggedIn(Player* player)
|
||||
// This method should be called when player logs out from running battleground
|
||||
void Battleground::EventPlayerLoggedOut(Player* player)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
if (!IsPlayerInBattleground(guid)) // Check if this player really is in battleground (might be a GM who teleported inside)
|
||||
return;
|
||||
|
||||
@@ -1358,7 +1355,7 @@ bool Battleground::UpdatePlayerScore(Player* player, uint32 type, uint32 value,
|
||||
return true;
|
||||
}
|
||||
|
||||
void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid)
|
||||
void Battleground::AddPlayerToResurrectQueue(ObjectGuid npc_guid, ObjectGuid player_guid)
|
||||
{
|
||||
m_ReviveQueue[npc_guid].push_back(player_guid);
|
||||
|
||||
@@ -1369,15 +1366,15 @@ void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid
|
||||
player->CastSpell(player, SPELL_WAITING_FOR_RESURRECT, true);
|
||||
}
|
||||
|
||||
void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid)
|
||||
void Battleground::RemovePlayerFromResurrectQueue(ObjectGuid player_guid)
|
||||
{
|
||||
for (std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
for (std::map<ObjectGuid, GuidVector>::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
{
|
||||
for (std::vector<uint64>::iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
for (GuidVector::iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
|
||||
{
|
||||
if (*itr2 == player_guid)
|
||||
{
|
||||
(itr->second).erase(itr2);
|
||||
itr->second.erase(itr2);
|
||||
if (Player* player = ObjectAccessor::FindPlayer(player_guid))
|
||||
player->RemoveAurasDueToSpell(SPELL_WAITING_FOR_RESURRECT);
|
||||
return;
|
||||
@@ -1386,14 +1383,14 @@ void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid)
|
||||
}
|
||||
}
|
||||
|
||||
void Battleground::RelocateDeadPlayers(uint64 queueIndex)
|
||||
void Battleground::RelocateDeadPlayers(ObjectGuid guideGuid)
|
||||
{
|
||||
// Those who are waiting to resurrect at this node are taken to the closest own node's graveyard
|
||||
std::vector<uint64>& ghostList = m_ReviveQueue[queueIndex];
|
||||
GuidVector& ghostList = m_ReviveQueue[guideGuid];
|
||||
if (!ghostList.empty())
|
||||
{
|
||||
WorldSafeLocsEntry const* closestGrave = NULL;
|
||||
for (std::vector<uint64>::const_iterator itr = ghostList.begin(); itr != ghostList.end(); ++itr)
|
||||
for (GuidVector::const_iterator itr = ghostList.begin(); itr != ghostList.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
if (!player)
|
||||
@@ -1482,7 +1479,7 @@ void Battleground::DoorClose(uint32 type)
|
||||
}
|
||||
else
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::DoorClose: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
|
||||
type, BgObjects[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
}
|
||||
|
||||
void Battleground::DoorOpen(uint32 type)
|
||||
@@ -1494,7 +1491,7 @@ void Battleground::DoorOpen(uint32 type)
|
||||
}
|
||||
else
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
|
||||
type, BgObjects[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
}
|
||||
|
||||
GameObject* Battleground::GetBGObject(uint32 type, bool logError)
|
||||
@@ -1504,10 +1501,10 @@ GameObject* Battleground::GetBGObject(uint32 type, bool logError)
|
||||
{
|
||||
if (logError)
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
|
||||
type, BgObjects[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
else
|
||||
TC_LOG_INFO("bg.battleground", "Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
|
||||
type, BgObjects[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
@@ -1519,10 +1516,10 @@ Creature* Battleground::GetBGCreature(uint32 type, bool logError)
|
||||
{
|
||||
if (logError)
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgCreatures[type]), m_MapId, m_InstanceID);
|
||||
type, BgCreatures[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
else
|
||||
TC_LOG_INFO("bg.battleground", "Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgCreatures[type]), m_MapId, m_InstanceID);
|
||||
type, BgCreatures[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
}
|
||||
return creature;
|
||||
}
|
||||
@@ -1599,13 +1596,13 @@ bool Battleground::DelCreature(uint32 type)
|
||||
if (Creature* creature = GetBgMap()->GetCreature(BgCreatures[type]))
|
||||
{
|
||||
creature->AddObjectToRemoveList();
|
||||
BgCreatures[type] = 0;
|
||||
BgCreatures[type].Clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::DelCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgCreatures[type]), m_MapId, m_InstanceID);
|
||||
BgCreatures[type] = 0;
|
||||
type, BgCreatures[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
BgCreatures[type].Clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1618,12 +1615,12 @@ bool Battleground::DelObject(uint32 type)
|
||||
{
|
||||
obj->SetRespawnTime(0); // not save respawn time
|
||||
obj->Delete();
|
||||
BgObjects[type] = 0;
|
||||
BgObjects[type].Clear();
|
||||
return true;
|
||||
}
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::DelObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
|
||||
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
|
||||
BgObjects[type] = 0;
|
||||
type, BgObjects[type].GetCounter(), m_MapId, m_InstanceID);
|
||||
BgObjects[type].Clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1634,7 +1631,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
|
||||
if (Creature* creature = AddCreature(entry, type, x, y, z, o, teamId))
|
||||
{
|
||||
creature->setDeathState(DEAD);
|
||||
creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, creature->GetGUID());
|
||||
creature->SetChannelObjectGuid(creature->GetGUID());
|
||||
// aura
|
||||
/// @todo Fix display here
|
||||
// creature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL);
|
||||
@@ -1657,7 +1654,7 @@ bool Battleground::AddSpiritGuide(uint32 type, Position const& pos, TeamId teamI
|
||||
return AddSpiritGuide(type, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teamId);
|
||||
}
|
||||
|
||||
void Battleground::SendMessageToAll(int32 entry, ChatMsg type, Player const* source)
|
||||
void Battleground::SendMessageToAll(uint32 entry, ChatMsg type, Player const* source)
|
||||
{
|
||||
if (!entry)
|
||||
return;
|
||||
@@ -1667,7 +1664,7 @@ void Battleground::SendMessageToAll(int32 entry, ChatMsg type, Player const* sou
|
||||
BroadcastWorker(bg_do);
|
||||
}
|
||||
|
||||
void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ...)
|
||||
void Battleground::PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...)
|
||||
{
|
||||
if (!entry)
|
||||
return;
|
||||
@@ -1682,7 +1679,7 @@ void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* so
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void Battleground::SendWarningToAll(int32 entry, ...)
|
||||
void Battleground::SendWarningToAll(uint32 entry, ...)
|
||||
{
|
||||
if (!entry)
|
||||
return;
|
||||
@@ -1708,7 +1705,7 @@ void Battleground::SendWarningToAll(int32 entry, ...)
|
||||
}
|
||||
}
|
||||
|
||||
void Battleground::SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 arg1, int32 arg2)
|
||||
void Battleground::SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 arg1, uint32 arg2)
|
||||
{
|
||||
Trinity::Battleground2ChatBuilder bg_builder(type, entry, source, arg1, arg2);
|
||||
Trinity::LocalizedPacketDo<Trinity::Battleground2ChatBuilder> bg_do(bg_builder);
|
||||
@@ -1722,17 +1719,10 @@ void Battleground::EndNow()
|
||||
SetRemainingTime(0);
|
||||
}
|
||||
|
||||
// To be removed
|
||||
char const* Battleground::GetTrinityString(int32 entry)
|
||||
{
|
||||
// FIXME: now we have different DBC locales and need localized message for each target client
|
||||
return sObjectMgr->GetTrinityStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
// IMPORTANT NOTICE:
|
||||
// buffs aren't spawned/despawned when players captures anything
|
||||
// buffs are in their positions when battleground starts
|
||||
void Battleground::HandleTriggerBuff(uint64 go_guid)
|
||||
void Battleground::HandleTriggerBuff(ObjectGuid go_guid)
|
||||
{
|
||||
GameObject* obj = GetBgMap()->GetGameObject(go_guid);
|
||||
if (!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned())
|
||||
@@ -1745,7 +1735,7 @@ void Battleground::HandleTriggerBuff(uint64 go_guid)
|
||||
if (index < 0)
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::HandleTriggerBuff: cannot find buff gameobject (GUID: %u, entry: %u, type: %u) in internal data for BG (map: %u, instance id: %u)!",
|
||||
GUID_LOPART(go_guid), obj->GetEntry(), obj->GetGoType(), m_MapId, m_InstanceID);
|
||||
go_guid.GetCounter(), obj->GetEntry(), obj->GetGoType(), m_MapId, m_InstanceID);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1805,7 +1795,7 @@ void Battleground::HandleKillPlayer(Player* victim, Player* killer)
|
||||
|
||||
// Return the player's team based on battlegroundplayer info
|
||||
// Used in same faction arena matches mainly
|
||||
uint32 Battleground::GetPlayerTeam(uint64 guid) const
|
||||
uint32 Battleground::GetPlayerTeam(ObjectGuid guid) const
|
||||
{
|
||||
BattlegroundPlayerMap::const_iterator itr = m_Players.find(guid);
|
||||
if (itr != m_Players.end())
|
||||
@@ -1818,7 +1808,7 @@ uint32 Battleground::GetOtherTeam(uint32 teamId) const
|
||||
return teamId ? ((teamId == ALLIANCE) ? HORDE : ALLIANCE) : 0;
|
||||
}
|
||||
|
||||
bool Battleground::IsPlayerInBattleground(uint64 guid) const
|
||||
bool Battleground::IsPlayerInBattleground(ObjectGuid guid) const
|
||||
{
|
||||
BattlegroundPlayerMap::const_iterator itr = m_Players.find(guid);
|
||||
if (itr != m_Players.end())
|
||||
@@ -1863,13 +1853,13 @@ void Battleground::SetHoliday(bool is_holiday)
|
||||
m_HonorMode = is_holiday ? BG_HOLIDAY : BG_NORMAL;
|
||||
}
|
||||
|
||||
int32 Battleground::GetObjectType(uint64 guid)
|
||||
int32 Battleground::GetObjectType(ObjectGuid guid)
|
||||
{
|
||||
for (uint32 i = 0; i < BgObjects.size(); ++i)
|
||||
if (BgObjects[i] == guid)
|
||||
return i;
|
||||
TC_LOG_ERROR("bg.battleground", "Battleground::GetObjectType: player used gameobject (GUID: %u) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
|
||||
GUID_LOPART(guid), m_MapId, m_InstanceID);
|
||||
guid.GetCounter(), m_MapId, m_InstanceID);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ class Battleground
|
||||
/* Battleground */
|
||||
// Get methods:
|
||||
std::string const& GetName() const { return m_Name; }
|
||||
uint64 GetGUID() { return m_Guid; }
|
||||
ObjectGuid GetGUID() { return m_Guid; }
|
||||
BattlegroundTypeId GetTypeID(bool GetRandom = false) const { return GetRandom ? m_RandomTypeID : m_TypeID; }
|
||||
BattlegroundBracketId GetBracketId() const { return m_BracketId; }
|
||||
uint32 GetInstanceID() const { return m_InstanceID; }
|
||||
@@ -266,7 +266,7 @@ class Battleground
|
||||
bool IsRandom() const { return m_IsRandom; }
|
||||
|
||||
// Set methods:
|
||||
void SetGuid(uint64 newGuid) { m_Guid = newGuid; }
|
||||
void SetGuid(ObjectGuid newGuid) { m_Guid = newGuid; }
|
||||
void SetName(std::string const& name) { m_Name = name; }
|
||||
void SetTypeID(BattlegroundTypeId TypeID) { m_TypeID = TypeID; }
|
||||
void SetRandomTypeID(BattlegroundTypeId TypeID) { m_RandomTypeID = TypeID; }
|
||||
@@ -308,7 +308,7 @@ class Battleground
|
||||
bool isBattleground() const { return !m_IsArena; }
|
||||
bool isRated() const { return m_IsRated; }
|
||||
|
||||
typedef std::map<uint64, BattlegroundPlayer> BattlegroundPlayerMap;
|
||||
typedef std::map<ObjectGuid, BattlegroundPlayer> BattlegroundPlayerMap;
|
||||
BattlegroundPlayerMap const& GetPlayers() const { return m_Players; }
|
||||
uint32 GetPlayersSize() const { return m_Players.size(); }
|
||||
|
||||
@@ -317,11 +317,11 @@ class Battleground
|
||||
|
||||
uint32 GetReviveQueueSize() const { return m_ReviveQueue.size(); }
|
||||
|
||||
void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
|
||||
void RemovePlayerFromResurrectQueue(uint64 player_guid);
|
||||
void AddPlayerToResurrectQueue(ObjectGuid npc_guid, ObjectGuid player_guid);
|
||||
void RemovePlayerFromResurrectQueue(ObjectGuid player_guid);
|
||||
|
||||
/// Relocate all players in ReviveQueue to the closest graveyard
|
||||
void RelocateDeadPlayers(uint64 queueIndex);
|
||||
void RelocateDeadPlayers(ObjectGuid guideGuid);
|
||||
|
||||
void StartBattleground();
|
||||
|
||||
@@ -365,12 +365,12 @@ class Battleground
|
||||
virtual void EndBattleground(uint32 winner);
|
||||
void BlockMovement(Player* player);
|
||||
|
||||
void SendWarningToAll(int32 entry, ...);
|
||||
void SendMessageToAll(int32 entry, ChatMsg type, Player const* source = NULL);
|
||||
void PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ...);
|
||||
void SendWarningToAll(uint32 entry, ...);
|
||||
void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = NULL);
|
||||
void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...);
|
||||
|
||||
// specialized version with 2 string id args
|
||||
void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0);
|
||||
void SendMessage2ToAll(uint32 entry, ChatMsg type, Player const* source, uint32 strId1 = 0, uint32 strId2 = 0);
|
||||
|
||||
// Raid Group
|
||||
Group* GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; }
|
||||
@@ -414,7 +414,7 @@ class Battleground
|
||||
virtual void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/, WorldObject* /*invoker*/ = NULL) { }
|
||||
|
||||
// this function can be used by spell to interact with the BG map
|
||||
virtual void DoAction(uint32 /*action*/, uint64 /*var*/) { }
|
||||
virtual void DoAction(uint32 /*action*/, ObjectGuid /*var*/) { }
|
||||
|
||||
virtual void HandlePlayerResurrect(Player* /*player*/) { }
|
||||
|
||||
@@ -425,17 +425,15 @@ class Battleground
|
||||
|
||||
void AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team);
|
||||
|
||||
virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
|
||||
virtual void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket);
|
||||
// can be extended in in BG subclass
|
||||
|
||||
void HandleTriggerBuff(uint64 go_guid);
|
||||
void HandleTriggerBuff(ObjectGuid go_guid);
|
||||
void SetHoliday(bool is_holiday);
|
||||
|
||||
/// @todo make this protected:
|
||||
typedef std::vector<uint64> BGObjects;
|
||||
typedef std::vector<uint64> BGCreatures;
|
||||
BGObjects BgObjects;
|
||||
BGCreatures BgCreatures;
|
||||
GuidVector BgObjects;
|
||||
GuidVector BgCreatures;
|
||||
void SpawnBGObject(uint32 type, uint32 respawntime);
|
||||
virtual bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0);
|
||||
bool AddObject(uint32 type, uint32 entry, Position const& pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0);
|
||||
@@ -445,19 +443,17 @@ class Battleground
|
||||
bool DelObject(uint32 type);
|
||||
virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId = TEAM_NEUTRAL);
|
||||
bool AddSpiritGuide(uint32 type, Position const& pos, TeamId teamId = TEAM_NEUTRAL);
|
||||
int32 GetObjectType(uint64 guid);
|
||||
int32 GetObjectType(ObjectGuid guid);
|
||||
|
||||
void DoorOpen(uint32 type);
|
||||
void DoorClose(uint32 type);
|
||||
//to be removed
|
||||
const char* GetTrinityString(int32 entry);
|
||||
|
||||
virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; }
|
||||
|
||||
// since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
|
||||
uint32 GetPlayerTeam(uint64 guid) const;
|
||||
uint32 GetPlayerTeam(ObjectGuid guid) const;
|
||||
uint32 GetOtherTeam(uint32 teamId) const;
|
||||
bool IsPlayerInBattleground(uint64 guid) const;
|
||||
bool IsPlayerInBattleground(ObjectGuid guid) const;
|
||||
|
||||
bool ToBeDeleted() const { return m_SetDeleteThis; }
|
||||
void SetDeleteThis() { m_SetDeleteThis = true; }
|
||||
@@ -465,8 +461,8 @@ class Battleground
|
||||
void RewardXPAtKill(Player* killer, Player* victim);
|
||||
bool CanAwardArenaPoints() const { return m_LevelMin >= BG_AWARD_ARENA_POINTS_MIN_LEVEL; }
|
||||
|
||||
virtual uint64 GetFlagPickerGUID(int32 /*team*/ = -1) const { return 0; }
|
||||
virtual void SetDroppedFlagGUID(uint64 /*guid*/, int32 /*team*/ = -1) { }
|
||||
virtual ObjectGuid GetFlagPickerGUID(int32 /*team*/ = -1) const { return ObjectGuid::Empty; }
|
||||
virtual void SetDroppedFlagGUID(ObjectGuid /*guid*/, int32 /*team*/ = -1) { }
|
||||
virtual void HandleQuestComplete(uint32 /*questid*/, Player* /*player*/) { }
|
||||
virtual bool CanActivateGO(int32 /*entry*/, uint32 /*team*/) const { return true; }
|
||||
virtual bool IsSpellAllowed(uint32 /*spellId*/, Player const* /*player*/) const { return true; }
|
||||
@@ -482,7 +478,7 @@ class Battleground
|
||||
void EndNow();
|
||||
void PlayerAddedToBGCheckIfBGIsRunning(Player* player);
|
||||
|
||||
Player* _GetPlayer(uint64 guid, bool offlineRemove, const char* context) const;
|
||||
Player* _GetPlayer(ObjectGuid guid, bool offlineRemove, const char* context) const;
|
||||
Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, const char* context) { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
|
||||
Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, const char* context) const { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
|
||||
Player* _GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, const char* context) const;
|
||||
@@ -497,12 +493,12 @@ class Battleground
|
||||
// Scorekeeping
|
||||
BattlegroundScoreMap PlayerScores; // Player scores
|
||||
// must be implemented in BG subclass
|
||||
virtual void RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) { }
|
||||
virtual void RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/) { }
|
||||
|
||||
// Player lists, those need to be accessible by inherited classes
|
||||
BattlegroundPlayerMap m_Players;
|
||||
BattlegroundPlayerMap m_Players;
|
||||
// Spirit Guide guid + Player list GUIDS
|
||||
std::map<uint64, std::vector<uint64> > m_ReviveQueue;
|
||||
std::map<ObjectGuid, GuidVector> m_ReviveQueue;
|
||||
|
||||
// these are important variables used for starting messages
|
||||
uint8 m_Events;
|
||||
@@ -542,7 +538,7 @@ class Battleground
|
||||
bool m_PrematureCountDown;
|
||||
uint32 m_PrematureCountDownTimer;
|
||||
std::string m_Name;
|
||||
uint64 m_Guid;
|
||||
ObjectGuid m_Guid;
|
||||
|
||||
/* Pre- and post-update hooks */
|
||||
|
||||
@@ -575,8 +571,8 @@ class Battleground
|
||||
virtual void PostUpdateImpl(uint32 /* diff */) { }
|
||||
|
||||
// Player lists
|
||||
std::vector<uint64> m_ResurrectQueue; // Player GUID
|
||||
std::deque<uint64> m_OfflineQueue; // Player GUID
|
||||
GuidVector m_ResurrectQueue; // Player GUID
|
||||
GuidDeque m_OfflineQueue; // Player GUID
|
||||
|
||||
// Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction
|
||||
// Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG
|
||||
|
||||
@@ -359,7 +359,7 @@ void BattlegroundMgr::BuildStatusFailedPacket(WorldPacket* data, Battleground* b
|
||||
{
|
||||
ObjectGuid guidBytes1 = player->GetGUID(); // player who caused the error
|
||||
ObjectGuid guidBytes2 = bg->GetGUID();
|
||||
ObjectGuid unkGuid3 = 0;
|
||||
ObjectGuid unkGuid3;
|
||||
|
||||
data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED);
|
||||
|
||||
@@ -440,54 +440,50 @@ void BattlegroundMgr::BuildPlaySoundPacket(WorldPacket* data, uint32 soundid)
|
||||
*data << uint64(0);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid)
|
||||
void BattlegroundMgr::BuildPlayerLeftBattlegroundPacket(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
ObjectGuid guidBytes = guid;
|
||||
|
||||
data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8);
|
||||
|
||||
data->WriteBit(guidBytes[7]);
|
||||
data->WriteBit(guidBytes[6]);
|
||||
data->WriteBit(guidBytes[2]);
|
||||
data->WriteBit(guidBytes[4]);
|
||||
data->WriteBit(guidBytes[5]);
|
||||
data->WriteBit(guidBytes[1]);
|
||||
data->WriteBit(guidBytes[3]);
|
||||
data->WriteBit(guidBytes[0]);
|
||||
data->WriteBit(guid[7]);
|
||||
data->WriteBit(guid[6]);
|
||||
data->WriteBit(guid[2]);
|
||||
data->WriteBit(guid[4]);
|
||||
data->WriteBit(guid[5]);
|
||||
data->WriteBit(guid[1]);
|
||||
data->WriteBit(guid[3]);
|
||||
data->WriteBit(guid[0]);
|
||||
|
||||
data->WriteByteSeq(guidBytes[4]);
|
||||
data->WriteByteSeq(guidBytes[2]);
|
||||
data->WriteByteSeq(guidBytes[5]);
|
||||
data->WriteByteSeq(guidBytes[7]);
|
||||
data->WriteByteSeq(guidBytes[0]);
|
||||
data->WriteByteSeq(guidBytes[6]);
|
||||
data->WriteByteSeq(guidBytes[1]);
|
||||
data->WriteByteSeq(guidBytes[3]);
|
||||
data->WriteByteSeq(guid[4]);
|
||||
data->WriteByteSeq(guid[2]);
|
||||
data->WriteByteSeq(guid[5]);
|
||||
data->WriteByteSeq(guid[7]);
|
||||
data->WriteByteSeq(guid[0]);
|
||||
data->WriteByteSeq(guid[6]);
|
||||
data->WriteByteSeq(guid[1]);
|
||||
data->WriteByteSeq(guid[3]);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uint64 guid)
|
||||
void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
ObjectGuid guidBytes = guid;
|
||||
|
||||
data->Initialize(SMSG_BATTLEGROUND_PLAYER_JOINED, 8);
|
||||
|
||||
data->WriteBit(guidBytes[0]);
|
||||
data->WriteBit(guidBytes[4]);
|
||||
data->WriteBit(guidBytes[3]);
|
||||
data->WriteBit(guidBytes[5]);
|
||||
data->WriteBit(guidBytes[7]);
|
||||
data->WriteBit(guidBytes[6]);
|
||||
data->WriteBit(guidBytes[2]);
|
||||
data->WriteBit(guidBytes[1]);
|
||||
data->WriteBit(guid[0]);
|
||||
data->WriteBit(guid[4]);
|
||||
data->WriteBit(guid[3]);
|
||||
data->WriteBit(guid[5]);
|
||||
data->WriteBit(guid[7]);
|
||||
data->WriteBit(guid[6]);
|
||||
data->WriteBit(guid[2]);
|
||||
data->WriteBit(guid[1]);
|
||||
|
||||
data->WriteByteSeq(guidBytes[1]);
|
||||
data->WriteByteSeq(guidBytes[5]);
|
||||
data->WriteByteSeq(guidBytes[3]);
|
||||
data->WriteByteSeq(guidBytes[2]);
|
||||
data->WriteByteSeq(guidBytes[0]);
|
||||
data->WriteByteSeq(guidBytes[7]);
|
||||
data->WriteByteSeq(guidBytes[4]);
|
||||
data->WriteByteSeq(guidBytes[6]);
|
||||
data->WriteByteSeq(guid[1]);
|
||||
data->WriteByteSeq(guid[5]);
|
||||
data->WriteByteSeq(guid[3]);
|
||||
data->WriteByteSeq(guid[2]);
|
||||
data->WriteByteSeq(guid[0]);
|
||||
data->WriteByteSeq(guid[7]);
|
||||
data->WriteByteSeq(guid[4]);
|
||||
data->WriteByteSeq(guid[6]);
|
||||
}
|
||||
|
||||
Battleground* BattlegroundMgr::GetBattlegroundThroughClientInstance(uint32 instanceId, BattlegroundTypeId bgTypeId)
|
||||
@@ -656,7 +652,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
|
||||
bg->SetRandomTypeID(bgTypeId);
|
||||
bg->SetRated(isRated);
|
||||
bg->SetRandom(isRandom);
|
||||
bg->SetGuid(MAKE_NEW_GUID(bgTypeId, 0, HIGHGUID_BATTLEGROUND));
|
||||
bg->SetGuid(ObjectGuid(HIGHGUID_BATTLEGROUND, uint32(bgTypeId)));
|
||||
|
||||
// Set up correct min/max player counts for scoreboards
|
||||
if (bg->isArena())
|
||||
@@ -759,7 +755,7 @@ bool BattlegroundMgr::CreateBattleground(BattlegroundTemplate const* bgTemplate)
|
||||
bg->SetStartMaxDist(bgTemplate->MaxStartDistSq);
|
||||
bg->SetLevelRange(bgTemplate->MinLevel, bgTemplate->MaxLevel);
|
||||
bg->SetScriptId(bgTemplate->ScriptId);
|
||||
bg->SetGuid(MAKE_NEW_GUID(bgTemplate->Id, 0, HIGHGUID_BATTLEGROUND));
|
||||
bg->SetGuid(ObjectGuid(HIGHGUID_BATTLEGROUND, uint32(bgTemplate->Id)));
|
||||
|
||||
AddBattleground(bg);
|
||||
|
||||
@@ -866,7 +862,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId)
|
||||
void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, ObjectGuid guid, Player* player, BattlegroundTypeId bgTypeId)
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
@@ -879,8 +875,6 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid
|
||||
uint32 winnerHonor = (player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_HONOR_FIRST) : sWorld->getIntConfig(CONFIG_BG_REWARD_WINNER_HONOR_LAST)) / CURRENCY_PRECISION;
|
||||
uint32 loserHonor = (!player->GetRandomWinner() ? sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_FIRST) : sWorld->getIntConfig(CONFIG_BG_REWARD_LOSER_HONOR_LAST)) / CURRENCY_PRECISION;
|
||||
|
||||
ObjectGuid guidBytes = guid;
|
||||
|
||||
data->Initialize(SMSG_BATTLEFIELD_LIST);
|
||||
*data << uint32(winnerConquest) // Winner Conquest Reward or Random Winner Conquest Reward
|
||||
<< uint32(winnerConquest) // Winner Conquest Reward or Random Winner Conquest Reward
|
||||
@@ -892,29 +886,29 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid
|
||||
<< uint8(bgTemplate->MaxLevel) // max level
|
||||
<< uint8(bgTemplate->MinLevel); // min level
|
||||
|
||||
data->WriteBit(guidBytes[0]);
|
||||
data->WriteBit(guidBytes[1]);
|
||||
data->WriteBit(guidBytes[7]);
|
||||
data->WriteBit(guid[0]);
|
||||
data->WriteBit(guid[1]);
|
||||
data->WriteBit(guid[7]);
|
||||
data->WriteBit(0); // unk
|
||||
data->WriteBit(0); // unk
|
||||
|
||||
size_t count_pos = data->bitwpos();
|
||||
data->WriteBits(0, 24); // placeholder
|
||||
|
||||
data->WriteBit(guidBytes[6]);
|
||||
data->WriteBit(guidBytes[4]);
|
||||
data->WriteBit(guidBytes[2]);
|
||||
data->WriteBit(guidBytes[3]);
|
||||
data->WriteBit(guid[6]);
|
||||
data->WriteBit(guid[4]);
|
||||
data->WriteBit(guid[2]);
|
||||
data->WriteBit(guid[3]);
|
||||
data->WriteBit(0); // unk
|
||||
data->WriteBit(guidBytes[5]);
|
||||
data->WriteBit(guid[5]);
|
||||
data->WriteBit(0); // unk
|
||||
|
||||
data->FlushBits();
|
||||
|
||||
data->WriteByteSeq(guidBytes[6]);
|
||||
data->WriteByteSeq(guidBytes[1]);
|
||||
data->WriteByteSeq(guidBytes[7]);
|
||||
data->WriteByteSeq(guidBytes[5]);
|
||||
data->WriteByteSeq(guid[6]);
|
||||
data->WriteByteSeq(guid[1]);
|
||||
data->WriteByteSeq(guid[7]);
|
||||
data->WriteByteSeq(guid[5]);
|
||||
|
||||
BattlegroundDataContainer::iterator it = bgDataStore.find(bgTypeId);
|
||||
if (it != bgDataStore.end())
|
||||
@@ -932,10 +926,10 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid
|
||||
}
|
||||
}
|
||||
|
||||
data->WriteByteSeq(guidBytes[0]);
|
||||
data->WriteByteSeq(guidBytes[2]);
|
||||
data->WriteByteSeq(guidBytes[4]);
|
||||
data->WriteByteSeq(guidBytes[3]);
|
||||
data->WriteByteSeq(guid[0]);
|
||||
data->WriteByteSeq(guid[2]);
|
||||
data->WriteByteSeq(guid[4]);
|
||||
data->WriteByteSeq(guid[3]);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, BattlegroundTypeId bgTypeId)
|
||||
@@ -953,7 +947,7 @@ void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, Batt
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundMgr::SendToBattleground: Instance %u (bgType %u) not found while trying to teleport player %s", instanceId, bgTypeId, player->GetName().c_str());
|
||||
}
|
||||
|
||||
void BattlegroundMgr::SendAreaSpiritHealerQueryOpcode(Player* player, Battleground* bg, uint64 guid)
|
||||
void BattlegroundMgr::SendAreaSpiritHealerQueryOpcode(Player* player, Battleground* bg, ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 12);
|
||||
uint32 time_ = 30000 - bg->GetLastResurrectTime(); // resurrect every 30 seconds
|
||||
|
||||
@@ -70,14 +70,14 @@ class BattlegroundMgr
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* Packet Building */
|
||||
void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uint64 guid);
|
||||
void BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid);
|
||||
void BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId);
|
||||
void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, ObjectGuid guid);
|
||||
void BuildPlayerLeftBattlegroundPacket(WorldPacket* data, ObjectGuid guid);
|
||||
void BuildBattlegroundListPacket(WorldPacket* data, ObjectGuid guid, Player* player, BattlegroundTypeId bgTypeId);
|
||||
void BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, uint8 QueueSlot, GroupJoinBattlegroundResult result);
|
||||
void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value);
|
||||
void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 queueSlot, uint8 statusId, uint32 time1, uint32 time2, uint8 arenaType);
|
||||
void BuildPlaySoundPacket(WorldPacket* data, uint32 soundId);
|
||||
void SendAreaSpiritHealerQueryOpcode(Player* player, Battleground* bg, uint64 guid);
|
||||
void SendAreaSpiritHealerQueryOpcode(Player* player, Battleground* bg, ObjectGuid guid);
|
||||
|
||||
/* Battlegrounds */
|
||||
Battleground* GetBattlegroundThroughClientInstance(uint32 instanceId, BattlegroundTypeId bgTypeId);
|
||||
|
||||
@@ -281,7 +281,7 @@ uint32 BattlegroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, Battleg
|
||||
}
|
||||
|
||||
//remove player from queue and from group info, if group info is empty then remove it too
|
||||
void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
|
||||
void BattlegroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
|
||||
{
|
||||
int32 bracket_id = -1; // signed for proper for-loop finish
|
||||
QueuedPlayersMap::iterator itr;
|
||||
@@ -293,7 +293,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
|
||||
std::string playerName = "Unknown";
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
playerName = player->GetName();
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundQueue: couldn't find player %s (GUID: %u)", playerName.c_str(), GUID_LOPART(guid));
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundQueue: couldn't find player %s (GUID: %u)", playerName.c_str(), guid.GetCounter());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -328,10 +328,10 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
|
||||
//player can't be in queue without group, but just in case
|
||||
if (bracket_id == -1)
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", guid.GetCounter());
|
||||
return;
|
||||
}
|
||||
TC_LOG_DEBUG("bg.battleground", "BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id);
|
||||
TC_LOG_DEBUG("bg.battleground", "BattlegroundQueue: Removing player GUID %u, from bracket_id %u", guid.GetCounter(), (uint32)bracket_id);
|
||||
|
||||
// ALL variables are correctly set
|
||||
// We can ignore leveling up in queue - it should not cause crash
|
||||
@@ -339,7 +339,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
|
||||
// if only one player there, remove group
|
||||
|
||||
// remove player queue info from group queue info
|
||||
std::map<uint64, PlayerQueueInfo*>::iterator pitr = group->Players.find(guid);
|
||||
std::map<ObjectGuid, PlayerQueueInfo*>::iterator pitr = group->Players.find(guid);
|
||||
if (pitr != group->Players.end())
|
||||
group->Players.erase(pitr);
|
||||
|
||||
@@ -361,7 +361,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
|
||||
{
|
||||
if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(group->ArenaTeamId))
|
||||
{
|
||||
TC_LOG_DEBUG("bg.battleground", "UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
|
||||
TC_LOG_DEBUG("bg.battleground", "UPDATING memberLost's personal arena rating for %u by opponents rating: %u", guid.GetCounter(), group->OpponentsTeamRating);
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
at->MemberLost(player, group->OpponentsMatchmakerRating);
|
||||
else
|
||||
@@ -403,7 +403,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
|
||||
}
|
||||
|
||||
//returns true when player pl_guid is in queue and is invited to bgInstanceGuid
|
||||
bool BattlegroundQueue::IsPlayerInvited(uint64 pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime)
|
||||
bool BattlegroundQueue::IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime)
|
||||
{
|
||||
QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(pl_guid);
|
||||
return (qItr != m_QueuedPlayers.end()
|
||||
@@ -411,7 +411,7 @@ bool BattlegroundQueue::IsPlayerInvited(uint64 pl_guid, const uint32 bgInstanceG
|
||||
&& qItr->second.GroupInfo->RemoveInviteTime == removeTime);
|
||||
}
|
||||
|
||||
bool BattlegroundQueue::GetPlayerGroupInfoData(uint64 guid, GroupQueueInfo* ginfo)
|
||||
bool BattlegroundQueue::GetPlayerGroupInfoData(ObjectGuid guid, GroupQueueInfo* ginfo)
|
||||
{
|
||||
QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(guid);
|
||||
if (qItr == m_QueuedPlayers.end())
|
||||
@@ -447,7 +447,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg,
|
||||
ginfo->RemoveInviteTime = getMSTime() + INVITE_ACCEPT_WAIT_TIME;
|
||||
|
||||
// loop through the players
|
||||
for (std::map<uint64, PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
|
||||
for (std::map<ObjectGuid, PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
|
||||
{
|
||||
// get the player
|
||||
Player* player = ObjectAccessor::FindPlayer(itr->first);
|
||||
|
||||
@@ -40,7 +40,7 @@ struct PlayerQueueInfo // stores informatio
|
||||
|
||||
struct GroupQueueInfo // stores information about the group in queue (also used when joined as solo!)
|
||||
{
|
||||
std::map<uint64, PlayerQueueInfo*> Players; // player queue info map
|
||||
std::map<ObjectGuid, PlayerQueueInfo*> Players; // player queue info map
|
||||
uint32 Team; // Player team (ALLIANCE/HORDE)
|
||||
BattlegroundTypeId BgTypeId; // battleground type id
|
||||
bool IsRated; // rated
|
||||
@@ -79,13 +79,13 @@ class BattlegroundQueue
|
||||
bool CheckNormalMatch(Battleground* bg_template, BattlegroundBracketId bracket_id, uint32 minPlayers, uint32 maxPlayers);
|
||||
bool CheckSkirmishForSameFaction(BattlegroundBracketId bracket_id, uint32 minPlayersPerTeam);
|
||||
GroupQueueInfo* AddGroup(Player* leader, Group* group, BattlegroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 ArenaTeamId = 0);
|
||||
void RemovePlayer(uint64 guid, bool decreaseInvitedCount);
|
||||
bool IsPlayerInvited(uint64 pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime);
|
||||
bool GetPlayerGroupInfoData(uint64 guid, GroupQueueInfo* ginfo);
|
||||
void RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount);
|
||||
bool IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime);
|
||||
bool GetPlayerGroupInfoData(ObjectGuid guid, GroupQueueInfo* ginfo);
|
||||
void PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo, BattlegroundBracketId bracket_id);
|
||||
uint32 GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattlegroundBracketId bracket_id) const;
|
||||
|
||||
typedef std::map<uint64, PlayerQueueInfo> QueuedPlayersMap;
|
||||
typedef std::map<ObjectGuid, PlayerQueueInfo> QueuedPlayersMap;
|
||||
QueuedPlayersMap m_QueuedPlayers;
|
||||
|
||||
//do NOT use deque because deque.erase() invalidates ALL iterators
|
||||
@@ -138,7 +138,7 @@ class BattlegroundQueue
|
||||
class BGQueueInviteEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
BGQueueInviteEvent(uint64 pl_guid, uint32 BgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, uint32 removeTime) :
|
||||
BGQueueInviteEvent(ObjectGuid pl_guid, uint32 BgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, uint32 removeTime) :
|
||||
m_PlayerGuid(pl_guid), m_BgInstanceGUID(BgInstanceGUID), m_BgTypeId(BgTypeId), m_ArenaType(arenaType), m_RemoveTime(removeTime)
|
||||
{ }
|
||||
virtual ~BGQueueInviteEvent() { }
|
||||
@@ -146,7 +146,7 @@ class BGQueueInviteEvent : public BasicEvent
|
||||
virtual bool Execute(uint64 e_time, uint32 p_time) override;
|
||||
virtual void Abort(uint64 e_time) override;
|
||||
private:
|
||||
uint64 m_PlayerGuid;
|
||||
ObjectGuid m_PlayerGuid;
|
||||
uint32 m_BgInstanceGUID;
|
||||
BattlegroundTypeId m_BgTypeId;
|
||||
uint8 m_ArenaType;
|
||||
@@ -161,7 +161,7 @@ class BGQueueInviteEvent : public BasicEvent
|
||||
class BGQueueRemoveEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
BGQueueRemoveEvent(uint64 pl_guid, uint32 bgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, BattlegroundQueueTypeId bgQueueTypeId, uint32 removeTime)
|
||||
BGQueueRemoveEvent(ObjectGuid pl_guid, uint32 bgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, BattlegroundQueueTypeId bgQueueTypeId, uint32 removeTime)
|
||||
: m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_ArenaType(arenaType), m_RemoveTime(removeTime), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId)
|
||||
{ }
|
||||
|
||||
@@ -170,7 +170,7 @@ class BGQueueRemoveEvent : public BasicEvent
|
||||
virtual bool Execute(uint64 e_time, uint32 p_time) override;
|
||||
virtual void Abort(uint64 e_time) override;
|
||||
private:
|
||||
uint64 m_PlayerGuid;
|
||||
ObjectGuid m_PlayerGuid;
|
||||
uint32 m_BgInstanceGUID;
|
||||
uint8 m_ArenaType;
|
||||
uint32 m_RemoveTime;
|
||||
|
||||
@@ -57,7 +57,7 @@ struct BattlegroundScore
|
||||
friend class Battleground;
|
||||
|
||||
protected:
|
||||
BattlegroundScore(uint64 playerGuid, uint32 team) : PlayerGuid(playerGuid), TeamId(team == ALLIANCE ? 1 : 0),
|
||||
BattlegroundScore(ObjectGuid playerGuid, uint32 team) : PlayerGuid(playerGuid), TeamId(team == ALLIANCE ? 1 : 0),
|
||||
KillingBlows(0), Deaths(0), HonorableKills(0), BonusHonor(0), DamageDone(0), HealingDone(0) { }
|
||||
|
||||
virtual ~BattlegroundScore() { }
|
||||
|
||||
@@ -227,7 +227,7 @@ void BattlegroundAB::AddPlayer(Player* player)
|
||||
PlayerScores[player->GetGUIDLow()] = new BattlegroundABScore(player->GetGUID(), player->GetBGTeam());
|
||||
}
|
||||
|
||||
void BattlegroundAB::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/)
|
||||
void BattlegroundAB::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team)
|
||||
if (capturedNodes >= 4)
|
||||
CastSpellOnTeam(SPELL_AB_QUEST_REWARD_4_BASES, team);
|
||||
|
||||
Creature* trigger = BgCreatures[node+7] ? GetBGCreature(node+7) : NULL; // 0-6 spirit guides
|
||||
Creature* trigger = !BgCreatures[node + 7] ? GetBGCreature(node + 7) : NULL; // 0-6 spirit guides
|
||||
if (!trigger)
|
||||
trigger = AddCreature(WORLD_TRIGGER, node+7, BG_AB_NodePositions[node], GetTeamIndexByTeamId(team));
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ struct BattlegroundABScore final : public BattlegroundScore
|
||||
friend class BattlegroundAB;
|
||||
|
||||
protected:
|
||||
BattlegroundABScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), BasesAssaulted(0), BasesDefended(0) { }
|
||||
BattlegroundABScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), BasesAssaulted(0), BasesDefended(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
@@ -283,7 +283,7 @@ class BattlegroundAB : public Battleground
|
||||
void AddPlayer(Player* player) override;
|
||||
void StartingEventCloseDoors() override;
|
||||
void StartingEventOpenDoors() override;
|
||||
void RemovePlayer(Player* player, uint64 guid, uint32 team) override;
|
||||
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
|
||||
void HandleAreaTrigger(Player* Source, uint32 Trigger) override;
|
||||
bool SetupBattleground() override;
|
||||
void Reset() override;
|
||||
|
||||
@@ -119,7 +119,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
|
||||
DelCreature(AV_CPLACE_TRIGGER16);
|
||||
|
||||
if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
|
||||
herold->AI()->TalkToMap(TEXT_STORMPIKE_GENERAL_DEAD);
|
||||
herold->AI()->Talk(TEXT_STORMPIKE_GENERAL_DEAD);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN])
|
||||
{
|
||||
@@ -138,7 +138,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
|
||||
DelCreature(AV_CPLACE_TRIGGER18);
|
||||
|
||||
if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
|
||||
herold->AI()->TalkToMap(TEXT_FROSTWOLF_GENERAL_DEAD);
|
||||
herold->AI()->Talk(TEXT_FROSTWOLF_GENERAL_DEAD);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_N_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_A_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_H_4])
|
||||
ChangeMineOwner(AV_NORTH_MINE, killer->GetTeam());
|
||||
@@ -480,7 +480,7 @@ void BattlegroundAV::EndBattleground(uint32 winner)
|
||||
Battleground::EndBattleground(winner);
|
||||
}
|
||||
|
||||
void BattlegroundAV::RemovePlayer(Player* player, uint64 /*guid*/, uint32 /*team*/)
|
||||
void BattlegroundAV::RemovePlayer(Player* player, ObjectGuid /*guid*/, uint32 /*team*/)
|
||||
{
|
||||
if (!player)
|
||||
{
|
||||
@@ -603,7 +603,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
|
||||
if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node))
|
||||
if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
|
||||
herold->AI()->TalkToMap(owner == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture);
|
||||
herold->AI()->Talk(owner == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture);
|
||||
}
|
||||
|
||||
void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
@@ -679,9 +679,9 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
|
||||
{
|
||||
if (mine == AV_NORTH_MINE)
|
||||
herold->AI()->TalkToMap(team == ALLIANCE ? TEXT_IRONDEEP_MINE_ALLIANCE_TAKEN : TEXT_IRONDEEP_MINE_HORDE_TAKEN);
|
||||
herold->AI()->Talk(team == ALLIANCE ? TEXT_IRONDEEP_MINE_ALLIANCE_TAKEN : TEXT_IRONDEEP_MINE_HORDE_TAKEN);
|
||||
else if (mine == AV_SOUTH_MINE)
|
||||
herold->AI()->TalkToMap(team == ALLIANCE ? TEXT_COLDTOOTH_MINE_ALLIANCE_TAKEN : TEXT_COLDTOOTH_MINE_HORDE_TAKEN);
|
||||
herold->AI()->Talk(team == ALLIANCE ? TEXT_COLDTOOTH_MINE_ALLIANCE_TAKEN : TEXT_COLDTOOTH_MINE_HORDE_TAKEN);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -923,7 +923,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
|
||||
if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node))
|
||||
if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
|
||||
herold->AI()->TalkToMap(team == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture);
|
||||
herold->AI()->Talk(team == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture);
|
||||
|
||||
// update the statistic for the defending player
|
||||
UpdatePlayerScore(player, IsTower(node) ? SCORE_TOWERS_DEFENDED : SCORE_GRAVEYARDS_DEFENDED, 1);
|
||||
@@ -1014,7 +1014,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
|
||||
if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node))
|
||||
if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD))
|
||||
herold->AI()->TalkToMap(team == ALLIANCE ? nodeInfo->TextIds.AllianceAttack : nodeInfo->TextIds.HordeAttack);
|
||||
herold->AI()->Talk(team == ALLIANCE ? nodeInfo->TextIds.AllianceAttack : nodeInfo->TextIds.HordeAttack);
|
||||
|
||||
// update the statistic for the assaulting player
|
||||
UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_ASSAULTED : SCORE_GRAVEYARDS_ASSAULTED, 1);
|
||||
|
||||
@@ -1554,7 +1554,7 @@ struct BattlegroundAVScore final : public BattlegroundScore
|
||||
friend class BattlegroundAV;
|
||||
|
||||
protected:
|
||||
BattlegroundAVScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), GraveyardsAssaulted(0), GraveyardsDefended(0), TowersAssaulted(0), TowersDefended(0), MinesCaptured(0) { }
|
||||
BattlegroundAVScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), GraveyardsAssaulted(0), GraveyardsDefended(0), TowersAssaulted(0), TowersDefended(0), MinesCaptured(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
@@ -1615,7 +1615,7 @@ class BattlegroundAV : public Battleground
|
||||
void StartingEventCloseDoors() override;
|
||||
void StartingEventOpenDoors() override;
|
||||
|
||||
void RemovePlayer(Player* player, uint64 guid, uint32 team) override;
|
||||
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger) override;
|
||||
bool SetupBattleground() override;
|
||||
void ResetBGSubclass() override;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
class BattlegroundBFGScore final : public BattlegroundScore
|
||||
{
|
||||
protected:
|
||||
BattlegroundBFGScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), BasesAssaulted(0), BasesDefended(0) { }
|
||||
BattlegroundBFGScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), BasesAssaulted(0), BasesDefended(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
|
||||
@@ -46,8 +46,8 @@ BattlegroundEY::BattlegroundEY()
|
||||
m_HonorScoreTics[TEAM_HORDE] = 0;
|
||||
m_TeamPointsCount[TEAM_ALLIANCE] = 0;
|
||||
m_TeamPointsCount[TEAM_HORDE] = 0;
|
||||
m_FlagKeeper = 0;
|
||||
m_DroppedFlagGUID = 0;
|
||||
m_FlagKeeper.Clear();
|
||||
m_DroppedFlagGUID.Clear();
|
||||
m_FlagCapturedBgObjectType = 0;
|
||||
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
|
||||
m_FlagsTimer = 0;
|
||||
@@ -171,7 +171,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint()
|
||||
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
|
||||
if (!player)
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneJoinedPoint: Player (%s) not found!", m_PlayersNearPoint[EY_POINTS_MAX][j].ToString().c_str());
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
|
||||
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[i][j]);
|
||||
if (!player)
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY:CheckSomeoneLeftPoint Player (%s) not found!", m_PlayersNearPoint[i][j].ToString().c_str());
|
||||
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
|
||||
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
|
||||
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
||||
@@ -368,7 +368,7 @@ void BattlegroundEY::AddPlayer(Player* player)
|
||||
m_PlayersNearPoint[EY_POINTS_MAX].push_back(player->GetGUID());
|
||||
}
|
||||
|
||||
void BattlegroundEY::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
|
||||
void BattlegroundEY::RemovePlayer(Player* player, ObjectGuid guid, uint32 /*team*/)
|
||||
{
|
||||
// sometimes flag aura not removed :(
|
||||
for (int j = EY_POINTS_MAX; j >= 0; --j)
|
||||
@@ -385,7 +385,7 @@ void BattlegroundEY::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
|
||||
EventPlayerDroppedFlag(player);
|
||||
else
|
||||
{
|
||||
SetFlagPicker(0);
|
||||
SetFlagPicker(ObjectGuid::Empty);
|
||||
RespawnFlag(true);
|
||||
}
|
||||
}
|
||||
@@ -548,8 +548,8 @@ void BattlegroundEY::Reset()
|
||||
m_HonorScoreTics[TEAM_HORDE] = 0;
|
||||
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
|
||||
m_FlagCapturedBgObjectType = 0;
|
||||
m_FlagKeeper = 0;
|
||||
m_DroppedFlagGUID = 0;
|
||||
m_FlagKeeper.Clear();
|
||||
m_DroppedFlagGUID.Clear();
|
||||
m_PointAddingTimer = 0;
|
||||
m_TowerCapCheckTimer = 0;
|
||||
bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID());
|
||||
@@ -593,9 +593,9 @@ void BattlegroundEY::RespawnFlagAfterDrop()
|
||||
if (obj)
|
||||
obj->Delete();
|
||||
else
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown dropped flag guid: %u", GUID_LOPART(GetDroppedFlagGUID()));
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown dropped flag (%s)", GetDroppedFlagGUID().ToString().c_str());
|
||||
|
||||
SetDroppedFlagGUID(0);
|
||||
SetDroppedFlagGUID(ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
void BattlegroundEY::HandleKillPlayer(Player* player, Player* killer)
|
||||
@@ -615,7 +615,7 @@ void BattlegroundEY::EventPlayerDroppedFlag(Player* player)
|
||||
// just take off the aura
|
||||
if (IsFlagPickedup() && GetFlagPickerGUID() == player->GetGUID())
|
||||
{
|
||||
SetFlagPicker(0);
|
||||
SetFlagPicker(ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
||||
}
|
||||
return;
|
||||
@@ -627,7 +627,7 @@ void BattlegroundEY::EventPlayerDroppedFlag(Player* player)
|
||||
if (GetFlagPickerGUID() != player->GetGUID())
|
||||
return;
|
||||
|
||||
SetFlagPicker(0);
|
||||
SetFlagPicker(ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
||||
m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
|
||||
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
|
||||
@@ -795,7 +795,7 @@ void BattlegroundEY::EventPlayerCapturedFlag(Player* player, uint32 BgObjectType
|
||||
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != player->GetGUID())
|
||||
return;
|
||||
|
||||
SetFlagPicker(0);
|
||||
SetFlagPicker(ObjectGuid::Empty);
|
||||
m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN;
|
||||
player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ struct BattlegroundEYScore final : public BattlegroundScore
|
||||
friend class BattlegroundEY;
|
||||
|
||||
protected:
|
||||
BattlegroundEYScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0) { }
|
||||
BattlegroundEYScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
@@ -366,15 +366,14 @@ class BattlegroundEY : public Battleground
|
||||
void StartingEventOpenDoors() override;
|
||||
|
||||
/* BG Flags */
|
||||
uint64 GetFlagPickerGUID(int32 /*team*/ = -1) const override { return m_FlagKeeper; }
|
||||
void SetFlagPicker(uint64 guid) { m_FlagKeeper = guid; }
|
||||
bool IsFlagPickedup() const { return m_FlagKeeper != 0; }
|
||||
ObjectGuid GetFlagPickerGUID(int32 /*team*/ = -1) const override { return m_FlagKeeper; }
|
||||
void SetFlagPicker(ObjectGuid guid) { m_FlagKeeper = guid; }
|
||||
bool IsFlagPickedup() const { return !m_FlagKeeper.IsEmpty(); }
|
||||
uint8 GetFlagState() const { return m_FlagState; }
|
||||
void RespawnFlag(bool send_message);
|
||||
void RespawnFlagAfterDrop();
|
||||
|
||||
void RemovePlayer(Player* player, uint64 guid, uint32 team) override;
|
||||
void HandleBuffUse(uint64 buff_guid);
|
||||
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
|
||||
void HandleAreaTrigger(Player* Source, uint32 Trigger) override;
|
||||
void HandleKillPlayer(Player* player, Player* killer) override;
|
||||
WorldSafeLocsEntry const* GetClosestGraveYard(Player* player) override;
|
||||
@@ -384,8 +383,8 @@ class BattlegroundEY : public Battleground
|
||||
void EndBattleground(uint32 winner) override;
|
||||
bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override;
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
void SetDroppedFlagGUID(uint64 guid, int32 /*TeamID*/ = -1) override { m_DroppedFlagGUID = guid;}
|
||||
uint64 GetDroppedFlagGUID() const { return m_DroppedFlagGUID;}
|
||||
void SetDroppedFlagGUID(ObjectGuid guid, int32 /*TeamID*/ = -1) override { m_DroppedFlagGUID = guid; }
|
||||
ObjectGuid GetDroppedFlagGUID() const { return m_DroppedFlagGUID; }
|
||||
|
||||
/* Battleground Events */
|
||||
void EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj) override;
|
||||
@@ -420,8 +419,8 @@ class BattlegroundEY : public Battleground
|
||||
|
||||
uint32 m_Points_Trigger[EY_POINTS_MAX];
|
||||
|
||||
uint64 m_FlagKeeper; // keepers guid
|
||||
uint64 m_DroppedFlagGUID;
|
||||
ObjectGuid m_FlagKeeper; // keepers guid
|
||||
ObjectGuid m_DroppedFlagGUID;
|
||||
uint32 m_FlagCapturedBgObjectType; // type that should be despawned when flag is captured
|
||||
uint8 m_FlagState; // for checking flag state
|
||||
int32 m_FlagsTimer;
|
||||
@@ -430,8 +429,7 @@ class BattlegroundEY : public Battleground
|
||||
uint32 m_PointOwnedByTeam[EY_POINTS_MAX];
|
||||
uint8 m_PointState[EY_POINTS_MAX];
|
||||
int32 m_PointBarStatus[EY_POINTS_MAX];
|
||||
typedef std::vector<uint64> PlayersNearPointType;
|
||||
PlayersNearPointType m_PlayersNearPoint[EY_POINTS_MAX + 1];
|
||||
GuidVector m_PlayersNearPoint[EY_POINTS_MAX + 1];
|
||||
uint8 m_CurrentPointPlayersCount[2*EY_POINTS_MAX];
|
||||
|
||||
int32 m_PointAddingTimer;
|
||||
|
||||
@@ -68,7 +68,7 @@ void BattlegroundIC::HandlePlayerResurrect(Player* player)
|
||||
player->CastSpell(player, SPELL_OIL_REFINERY, true);
|
||||
}
|
||||
|
||||
void BattlegroundIC::DoAction(uint32 action, uint64 var)
|
||||
void BattlegroundIC::DoAction(uint32 action, ObjectGuid var)
|
||||
{
|
||||
if (action != ACTION_TELEPORT_PLAYER_TO_TRANSPORT)
|
||||
return;
|
||||
@@ -282,7 +282,7 @@ void BattlegroundIC::AddPlayer(Player* player)
|
||||
player->CastSpell(player, SPELL_OIL_REFINERY, true);
|
||||
}
|
||||
|
||||
void BattlegroundIC::RemovePlayer(Player* player, uint64 /*guid*/, uint32 /*team*/)
|
||||
void BattlegroundIC::RemovePlayer(Player* player, ObjectGuid /*guid*/, uint32 /*team*/)
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
@@ -865,7 +865,7 @@ bool BattlegroundIC::IsSpellAllowed(uint32 spellId, Player const* player) const
|
||||
case SPELL_QUARRY:
|
||||
{
|
||||
uint32 team = player->GetTeamId();
|
||||
uint8 nodeType = spellId = SPELL_OIL_REFINERY ? NODE_TYPE_REFINERY : NODE_TYPE_QUARRY;
|
||||
uint8 nodeType = spellId == SPELL_OIL_REFINERY ? NODE_TYPE_REFINERY : NODE_TYPE_QUARRY;
|
||||
uint8 nodeState = team == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H;
|
||||
return GetNodeState(nodeType) == nodeState;
|
||||
}
|
||||
|
||||
@@ -853,7 +853,7 @@ struct BattlegroundICScore final : public BattlegroundScore
|
||||
friend class BattlegroundIC;
|
||||
|
||||
protected:
|
||||
BattlegroundICScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), BasesAssaulted(0), BasesDefended(0) { }
|
||||
BattlegroundICScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), BasesAssaulted(0), BasesDefended(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
@@ -897,7 +897,7 @@ class BattlegroundIC : public Battleground
|
||||
void StartingEventOpenDoors() override;
|
||||
void PostUpdateImpl(uint32 diff) override;
|
||||
|
||||
void RemovePlayer(Player* player, uint64 guid, uint32 team) override;
|
||||
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger) override;
|
||||
bool SetupBattleground() override;
|
||||
void SpawnLeader(uint32 teamid);
|
||||
@@ -913,7 +913,7 @@ class BattlegroundIC : public Battleground
|
||||
/* Scorekeeping */
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
|
||||
void DoAction(uint32 action, uint64 var) override;
|
||||
void DoAction(uint32 action, ObjectGuid var) override;
|
||||
|
||||
void HandlePlayerResurrect(Player* player) override;
|
||||
|
||||
|
||||
@@ -506,7 +506,7 @@ void BattlegroundSA::AddPlayer(Player* player)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundSA::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) { }
|
||||
void BattlegroundSA::RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/) { }
|
||||
|
||||
void BattlegroundSA::HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
|
||||
@@ -513,7 +513,7 @@ struct BattlegroundSAScore final : public BattlegroundScore
|
||||
friend class BattlegroundSA;
|
||||
|
||||
protected:
|
||||
BattlegroundSAScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), DemolishersDestroyed(0), GatesDestroyed(0) { }
|
||||
BattlegroundSAScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), DemolishersDestroyed(0), GatesDestroyed(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
@@ -594,7 +594,7 @@ class BattlegroundSA : public Battleground
|
||||
void EndBattleground(uint32 winner) override;
|
||||
|
||||
/// Called when a player leave battleground
|
||||
void RemovePlayer(Player* player, uint64 guid, uint32 team) override;
|
||||
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
|
||||
void HandleAreaTrigger(Player* Source, uint32 Trigger) override;
|
||||
|
||||
/* Scorekeeping */
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
class BattlegroundTPScore final : public BattlegroundScore
|
||||
{
|
||||
protected:
|
||||
BattlegroundTPScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0), FlagReturns(0) { }
|
||||
BattlegroundTPScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0), FlagReturns(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
|
||||
@@ -54,10 +54,10 @@ BattlegroundWS::BattlegroundWS()
|
||||
_flagSpellForceTimer = 0;
|
||||
_bothFlagsKept = false;
|
||||
_flagDebuffState = 0;
|
||||
m_FlagKeepers[TEAM_ALLIANCE] = 0;
|
||||
m_FlagKeepers[TEAM_HORDE] = 0;
|
||||
m_DroppedFlagGUID[TEAM_ALLIANCE] = 0;
|
||||
m_DroppedFlagGUID[TEAM_HORDE] = 0;
|
||||
m_FlagKeepers[TEAM_ALLIANCE].Clear();
|
||||
m_FlagKeepers[TEAM_HORDE].Clear();
|
||||
m_DroppedFlagGUID[TEAM_ALLIANCE].Clear();
|
||||
m_DroppedFlagGUID[TEAM_HORDE].Clear();
|
||||
_flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
_flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
_flagsTimer[TEAM_ALLIANCE] = 0;
|
||||
@@ -278,9 +278,9 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
|
||||
if (GameObject* obj = GetBgMap()->GetGameObject(GetDroppedFlagGUID(team)))
|
||||
obj->Delete();
|
||||
else
|
||||
TC_LOG_ERROR("bg.battleground", "unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
|
||||
TC_LOG_ERROR("bg.battleground", "unknown dropped flag (%s)", GetDroppedFlagGUID(team).ToString().c_str());
|
||||
|
||||
SetDroppedFlagGUID(0, GetTeamIndexByTeamId(team));
|
||||
SetDroppedFlagGUID(ObjectGuid::Empty, GetTeamIndexByTeamId(team));
|
||||
_bothFlagsKept = false;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* player)
|
||||
{
|
||||
if (!IsHordeFlagPickedup())
|
||||
return;
|
||||
SetHordeFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
||||
SetHordeFlagPicker(ObjectGuid::Empty); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
||||
// horde flag in base (but not respawned yet)
|
||||
_flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
||||
// Drop Horde Flag from Player
|
||||
@@ -315,7 +315,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* player)
|
||||
{
|
||||
if (!IsAllianceFlagPickedup())
|
||||
return;
|
||||
SetAllianceFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
||||
SetAllianceFlagPicker(ObjectGuid::Empty); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
||||
// alliance flag in base (but not respawned yet)
|
||||
_flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
||||
// Drop Alliance Flag from Player
|
||||
@@ -385,7 +385,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* player)
|
||||
|
||||
if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
|
||||
{
|
||||
SetHordeFlagPicker(0);
|
||||
SetHordeFlagPicker(ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
||||
}
|
||||
}
|
||||
@@ -396,7 +396,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* player)
|
||||
|
||||
if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
|
||||
{
|
||||
SetAllianceFlagPicker(0);
|
||||
SetAllianceFlagPicker(ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
||||
}
|
||||
}
|
||||
@@ -411,7 +411,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* player)
|
||||
return;
|
||||
if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
|
||||
{
|
||||
SetHordeFlagPicker(0);
|
||||
SetHordeFlagPicker(ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
||||
if (_flagDebuffState == 1)
|
||||
player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
|
||||
@@ -428,7 +428,7 @@ void BattlegroundWS::EventPlayerDroppedFlag(Player* player)
|
||||
return;
|
||||
if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
|
||||
{
|
||||
SetAllianceFlagPicker(0);
|
||||
SetAllianceFlagPicker(ObjectGuid::Empty);
|
||||
player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
||||
if (_flagDebuffState == 1)
|
||||
player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
|
||||
@@ -583,7 +583,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* player, GameObject* target
|
||||
player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
}
|
||||
|
||||
void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
|
||||
void BattlegroundWS::RemovePlayer(Player* player, ObjectGuid guid, uint32 /*team*/)
|
||||
{
|
||||
// sometimes flag aura not removed :(
|
||||
if (IsAllianceFlagPickedup() && m_FlagKeepers[TEAM_ALLIANCE] == guid)
|
||||
@@ -591,7 +591,7 @@ void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
|
||||
if (!player)
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
SetAllianceFlagPicker(0);
|
||||
SetAllianceFlagPicker(ObjectGuid::Empty);
|
||||
RespawnFlag(ALLIANCE, false);
|
||||
}
|
||||
else
|
||||
@@ -602,7 +602,7 @@ void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
|
||||
if (!player)
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
SetHordeFlagPicker(0);
|
||||
SetHordeFlagPicker(ObjectGuid::Empty);
|
||||
RespawnFlag(HORDE, false);
|
||||
}
|
||||
else
|
||||
@@ -731,10 +731,10 @@ void BattlegroundWS::Reset()
|
||||
//call parent's class reset
|
||||
Battleground::Reset();
|
||||
|
||||
m_FlagKeepers[TEAM_ALLIANCE] = 0;
|
||||
m_FlagKeepers[TEAM_HORDE] = 0;
|
||||
m_DroppedFlagGUID[TEAM_ALLIANCE] = 0;
|
||||
m_DroppedFlagGUID[TEAM_HORDE] = 0;
|
||||
m_FlagKeepers[TEAM_ALLIANCE].Clear();
|
||||
m_FlagKeepers[TEAM_HORDE].Clear();
|
||||
m_DroppedFlagGUID[TEAM_ALLIANCE].Clear();
|
||||
m_DroppedFlagGUID[TEAM_HORDE].Clear();
|
||||
_flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
_flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
m_TeamScores[TEAM_ALLIANCE] = 0;
|
||||
|
||||
@@ -152,7 +152,7 @@ struct BattlegroundWGScore final : public BattlegroundScore
|
||||
friend class BattlegroundWS;
|
||||
|
||||
protected:
|
||||
BattlegroundWGScore(uint64 playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0), FlagReturns(0) { }
|
||||
BattlegroundWGScore(ObjectGuid playerGuid, uint32 team) : BattlegroundScore(playerGuid, team), FlagCaptures(0), FlagReturns(0) { }
|
||||
|
||||
void UpdateScore(uint32 type, uint32 value) override
|
||||
{
|
||||
@@ -197,16 +197,16 @@ class BattlegroundWS : public Battleground
|
||||
void StartingEventOpenDoors() override;
|
||||
|
||||
/* BG Flags */
|
||||
uint64 GetFlagPickerGUID(int32 team) const override
|
||||
ObjectGuid GetFlagPickerGUID(int32 team) const override
|
||||
{
|
||||
if (team == TEAM_ALLIANCE || team == TEAM_HORDE)
|
||||
return m_FlagKeepers[team];
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
void SetAllianceFlagPicker(uint64 guid) { m_FlagKeepers[TEAM_ALLIANCE] = guid; }
|
||||
void SetHordeFlagPicker(uint64 guid) { m_FlagKeepers[TEAM_HORDE] = guid; }
|
||||
bool IsAllianceFlagPickedup() const { return m_FlagKeepers[TEAM_ALLIANCE] != 0; }
|
||||
bool IsHordeFlagPickedup() const { return m_FlagKeepers[TEAM_HORDE] != 0; }
|
||||
void SetAllianceFlagPicker(ObjectGuid guid) { m_FlagKeepers[TEAM_ALLIANCE] = guid; }
|
||||
void SetHordeFlagPicker(ObjectGuid guid) { m_FlagKeepers[TEAM_HORDE] = guid; }
|
||||
bool IsAllianceFlagPickedup() const { return !m_FlagKeepers[TEAM_ALLIANCE].IsEmpty(); }
|
||||
bool IsHordeFlagPickedup() const { return !m_FlagKeepers[TEAM_HORDE].IsEmpty(); }
|
||||
void RespawnFlag(uint32 Team, bool captured);
|
||||
void RespawnFlagAfterDrop(uint32 Team);
|
||||
uint8 GetFlagState(uint32 team) { return _flagState[GetTeamIndexByTeamId(team)]; }
|
||||
@@ -216,7 +216,7 @@ class BattlegroundWS : public Battleground
|
||||
void EventPlayerClickedOnFlag(Player* player, GameObject* target_obj) override;
|
||||
void EventPlayerCapturedFlag(Player* player);
|
||||
|
||||
void RemovePlayer(Player* player, uint64 guid, uint32 team) override;
|
||||
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
|
||||
void HandleAreaTrigger(Player* player, uint32 trigger) override;
|
||||
void HandleKillPlayer(Player* player, Player* killer) override;
|
||||
bool SetupBattleground() override;
|
||||
@@ -228,13 +228,13 @@ class BattlegroundWS : public Battleground
|
||||
void SetLastFlagCapture(uint32 team) { _lastFlagCaptureTeam = team; }
|
||||
void UpdateTeamScore(uint32 team);
|
||||
bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true) override;
|
||||
void SetDroppedFlagGUID(uint64 guid, int32 team = -1) override
|
||||
void SetDroppedFlagGUID(ObjectGuid guid, int32 team = -1) override
|
||||
{
|
||||
if (team == TEAM_ALLIANCE || team == TEAM_HORDE)
|
||||
m_DroppedFlagGUID[team] = guid;
|
||||
}
|
||||
|
||||
uint64 GetDroppedFlagGUID(uint32 TeamID) { return m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)];}
|
||||
ObjectGuid GetDroppedFlagGUID(uint32 TeamID) { return m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)]; }
|
||||
void FillInitialWorldStates(WorldPacket& data) override;
|
||||
|
||||
/* Scorekeeping */
|
||||
@@ -248,8 +248,8 @@ class BattlegroundWS : public Battleground
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = nullptr, uint32 miscvalue1 = 0) override;
|
||||
|
||||
private:
|
||||
uint64 m_FlagKeepers[2]; // 0 - alliance, 1 - horde
|
||||
uint64 m_DroppedFlagGUID[2];
|
||||
ObjectGuid m_FlagKeepers[2]; // 0 - alliance, 1 - horde
|
||||
ObjectGuid m_DroppedFlagGUID[2];
|
||||
uint8 _flagState[2]; // for checking flag state
|
||||
int32 _flagsTimer[2];
|
||||
int32 _flagsDropTimer[2];
|
||||
|
||||
@@ -58,7 +58,7 @@ void CalendarMgr::LoadFromDB()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint64 eventId = fields[0].GetUInt64();
|
||||
uint64 creatorGUID = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid creatorGUID = ObjectGuid(HIGHGUID_PLAYER, fields[1].GetUInt32());
|
||||
std::string title = fields[2].GetString();
|
||||
std::string description = fields[3].GetString();
|
||||
CalendarEventType type = CalendarEventType(fields[4].GetUInt8());
|
||||
@@ -91,8 +91,8 @@ void CalendarMgr::LoadFromDB()
|
||||
|
||||
uint64 inviteId = fields[0].GetUInt64();
|
||||
uint64 eventId = fields[1].GetUInt64();
|
||||
uint64 invitee = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
uint64 senderGUID = MAKE_NEW_GUID(fields[3].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
ObjectGuid invitee = ObjectGuid(HIGHGUID_PLAYER, fields[2].GetUInt32());
|
||||
ObjectGuid senderGUID = ObjectGuid(HIGHGUID_PLAYER, fields[3].GetUInt32());
|
||||
CalendarInviteStatus status = CalendarInviteStatus(fields[4].GetUInt8());
|
||||
uint32 statusTime = fields[5].GetUInt32();
|
||||
CalendarModerationRank rank = CalendarModerationRank(fields[6].GetUInt8());
|
||||
@@ -146,7 +146,7 @@ void CalendarMgr::AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite
|
||||
}
|
||||
}
|
||||
|
||||
void CalendarMgr::RemoveEvent(uint64 eventId, uint64 remover)
|
||||
void CalendarMgr::RemoveEvent(uint64 eventId, ObjectGuid remover)
|
||||
{
|
||||
CalendarEvent* calendarEvent = GetEvent(eventId);
|
||||
|
||||
@@ -173,7 +173,7 @@ void CalendarMgr::RemoveEvent(uint64 eventId, uint64 remover)
|
||||
// guild events only? check invite status here?
|
||||
// When an event is deleted, all invited (accepted/declined? - verify) guildies are notified via in-game mail. (wowwiki)
|
||||
if (remover && invite->GetInviteeGUID() != remover)
|
||||
mail.SendMailTo(trans, MailReceiver(invite->GetInviteeGUID()), calendarEvent, MAIL_CHECK_MASK_COPIED);
|
||||
mail.SendMailTo(trans, MailReceiver(invite->GetInviteeGUID().GetCounter()), calendarEvent, MAIL_CHECK_MASK_COPIED);
|
||||
|
||||
delete invite;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ void CalendarMgr::RemoveEvent(uint64 eventId, uint64 remover)
|
||||
_events.erase(calendarEvent);
|
||||
}
|
||||
|
||||
void CalendarMgr::RemoveInvite(uint64 inviteId, uint64 eventId, uint64 /*remover*/)
|
||||
void CalendarMgr::RemoveInvite(uint64 inviteId, uint64 eventId, ObjectGuid /*remover*/)
|
||||
{
|
||||
CalendarEvent* calendarEvent = GetEvent(eventId);
|
||||
|
||||
@@ -228,7 +228,7 @@ void CalendarMgr::UpdateEvent(CalendarEvent* calendarEvent)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_EVENT);
|
||||
stmt->setUInt64(0, calendarEvent->GetEventId());
|
||||
stmt->setUInt32(1, GUID_LOPART(calendarEvent->GetCreatorGUID()));
|
||||
stmt->setUInt32(1, calendarEvent->GetCreatorGUID().GetCounter());
|
||||
stmt->setString(2, calendarEvent->GetTitle());
|
||||
stmt->setString(3, calendarEvent->GetDescription());
|
||||
stmt->setUInt8(4, calendarEvent->GetType());
|
||||
@@ -250,8 +250,8 @@ void CalendarMgr::UpdateInvite(CalendarInvite* invite, SQLTransaction& trans)
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_INVITE);
|
||||
stmt->setUInt64(0, invite->GetInviteId());
|
||||
stmt->setUInt64(1, invite->GetEventId());
|
||||
stmt->setUInt32(2, GUID_LOPART(invite->GetInviteeGUID()));
|
||||
stmt->setUInt32(3, GUID_LOPART(invite->GetSenderGUID()));
|
||||
stmt->setUInt32(2, invite->GetInviteeGUID().GetCounter());
|
||||
stmt->setUInt32(3, invite->GetSenderGUID().GetCounter());
|
||||
stmt->setUInt8(4, invite->GetStatus());
|
||||
stmt->setUInt32(5, uint32(invite->GetStatusTime()));
|
||||
stmt->setUInt8(6, invite->GetRank());
|
||||
@@ -259,18 +259,18 @@ void CalendarMgr::UpdateInvite(CalendarInvite* invite, SQLTransaction& trans)
|
||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||
}
|
||||
|
||||
void CalendarMgr::RemoveAllPlayerEventsAndInvites(uint64 guid)
|
||||
void CalendarMgr::RemoveAllPlayerEventsAndInvites(ObjectGuid guid)
|
||||
{
|
||||
for (CalendarEventStore::const_iterator itr = _events.begin(); itr != _events.end(); ++itr)
|
||||
if ((*itr)->GetCreatorGUID() == guid)
|
||||
RemoveEvent((*itr)->GetEventId(), 0); // don't send mail if removing a character
|
||||
RemoveEvent((*itr)->GetEventId(), ObjectGuid::Empty); // don't send mail if removing a character
|
||||
|
||||
CalendarInviteStore playerInvites = GetPlayerInvites(guid);
|
||||
for (CalendarInviteStore::const_iterator itr = playerInvites.begin(); itr != playerInvites.end(); ++itr)
|
||||
RemoveInvite((*itr)->GetInviteId(), (*itr)->GetEventId(), guid);
|
||||
}
|
||||
|
||||
void CalendarMgr::RemovePlayerGuildEventsAndSignups(uint64 guid, uint32 guildId)
|
||||
void CalendarMgr::RemovePlayerGuildEventsAndSignups(ObjectGuid guid, uint32 guildId)
|
||||
{
|
||||
for (CalendarEventStore::const_iterator itr = _events.begin(); itr != _events.end(); ++itr)
|
||||
if ((*itr)->GetCreatorGUID() == guid && ((*itr)->IsGuildEvent() || (*itr)->IsGuildAnnouncement()))
|
||||
@@ -340,7 +340,7 @@ uint64 CalendarMgr::GetFreeInviteId()
|
||||
return inviteId;
|
||||
}
|
||||
|
||||
CalendarEventStore CalendarMgr::GetPlayerEvents(uint64 guid)
|
||||
CalendarEventStore CalendarMgr::GetPlayerEvents(ObjectGuid guid)
|
||||
{
|
||||
CalendarEventStore events;
|
||||
|
||||
@@ -363,7 +363,7 @@ CalendarInviteStore const& CalendarMgr::GetEventInvites(uint64 eventId)
|
||||
return _invites[eventId];
|
||||
}
|
||||
|
||||
CalendarInviteStore CalendarMgr::GetPlayerInvites(uint64 guid)
|
||||
CalendarInviteStore CalendarMgr::GetPlayerInvites(ObjectGuid guid)
|
||||
{
|
||||
CalendarInviteStore invites;
|
||||
|
||||
@@ -375,7 +375,7 @@ CalendarInviteStore CalendarMgr::GetPlayerInvites(uint64 guid)
|
||||
return invites;
|
||||
}
|
||||
|
||||
uint32 CalendarMgr::GetPlayerNumPending(uint64 guid)
|
||||
uint32 CalendarMgr::GetPlayerNumPending(ObjectGuid guid)
|
||||
{
|
||||
CalendarInviteStore const& invites = GetPlayerInvites(guid);
|
||||
|
||||
@@ -397,10 +397,10 @@ uint32 CalendarMgr::GetPlayerNumPending(uint64 guid)
|
||||
return pendingNum;
|
||||
}
|
||||
|
||||
std::string CalendarEvent::BuildCalendarMailSubject(uint64 remover) const
|
||||
std::string CalendarEvent::BuildCalendarMailSubject(ObjectGuid remover) const
|
||||
{
|
||||
std::ostringstream strm;
|
||||
strm << remover << ':' << _title;
|
||||
strm << remover.GetRawValue() << ':' << _title;
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
@@ -423,13 +423,13 @@ void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite)
|
||||
time_t statusTime = invite.GetStatusTime();
|
||||
bool hasStatusTime = statusTime != 946684800; // 01/01/2000 00:00:00
|
||||
|
||||
uint64 invitee = invite.GetInviteeGUID();
|
||||
ObjectGuid invitee = invite.GetInviteeGUID();
|
||||
Player* player = ObjectAccessor::FindPlayer(invitee);
|
||||
|
||||
uint8 level = player ? player->getLevel() : Player::GetLevelFromDB(invitee);
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_EVENT_INVITE, 8 + 8 + 8 + 1 + 1 + 1 + (statusTime ? 4 : 0) + 1);
|
||||
data.appendPackGUID(invitee);
|
||||
data << invitee.WriteAsPacked();
|
||||
data << uint64(invite.GetEventId());
|
||||
data << uint64(invite.GetInviteId());
|
||||
data << uint8(level);
|
||||
@@ -474,7 +474,7 @@ void CalendarMgr::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEven
|
||||
void CalendarMgr::SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite)
|
||||
{
|
||||
WorldPacket data(SMSG_CALENDAR_EVENT_STATUS, 8 + 8 + 4 + 4 + 1 + 1 + 4);
|
||||
data.appendPackGUID(invite.GetInviteeGUID());
|
||||
data << invite.GetInviteeGUID().WriteAsPacked();
|
||||
data << uint64(calendarEvent.GetEventId());
|
||||
data.AppendPackedTime(calendarEvent.GetEventTime());
|
||||
data << uint32(calendarEvent.GetFlags());
|
||||
@@ -498,7 +498,7 @@ void CalendarMgr::SendCalendarEventRemovedAlert(CalendarEvent const& calendarEve
|
||||
void CalendarMgr::SendCalendarEventInviteRemove(CalendarEvent const& calendarEvent, CalendarInvite const& invite, uint32 flags)
|
||||
{
|
||||
WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_REMOVED, 8 + 4 + 4 + 1);
|
||||
data.appendPackGUID(invite.GetInviteeGUID());
|
||||
data << invite.GetInviteeGUID().WriteAsPacked();
|
||||
data << uint64(invite.GetEventId());
|
||||
data << uint32(flags);
|
||||
data << uint8(1); // FIXME
|
||||
@@ -509,7 +509,7 @@ void CalendarMgr::SendCalendarEventInviteRemove(CalendarEvent const& calendarEve
|
||||
void CalendarMgr::SendCalendarEventModeratorStatusAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite)
|
||||
{
|
||||
WorldPacket data(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, 8 + 8 + 1 + 1);
|
||||
data.appendPackGUID(invite.GetInviteeGUID());
|
||||
data << invite.GetInviteeGUID().WriteAsPacked();
|
||||
data << uint64(invite.GetEventId());
|
||||
data << uint8(invite.GetRank());
|
||||
data << uint8(1); // Unk boolean - Display to client?
|
||||
@@ -533,8 +533,8 @@ void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEven
|
||||
|
||||
data << uint8(invite.GetStatus());
|
||||
data << uint8(invite.GetRank());
|
||||
data.appendPackGUID(calendarEvent.GetCreatorGUID());
|
||||
data.appendPackGUID(invite.GetSenderGUID());
|
||||
data << calendarEvent.GetCreatorGUID().WriteAsPacked();
|
||||
data << invite.GetSenderGUID().WriteAsPacked();
|
||||
|
||||
if (calendarEvent.IsGuildEvent() || calendarEvent.IsGuildAnnouncement())
|
||||
{
|
||||
@@ -546,7 +546,7 @@ void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEven
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void CalendarMgr::SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType)
|
||||
void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player)
|
||||
@@ -556,7 +556,7 @@ void CalendarMgr::SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEv
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_SEND_EVENT, 60 + eventInviteeList.size() * 32);
|
||||
data << uint8(sendType);
|
||||
data.appendPackGUID(calendarEvent.GetCreatorGUID());
|
||||
data << calendarEvent.GetCreatorGUID().WriteAsPacked();
|
||||
data << uint64(calendarEvent.GetEventId());
|
||||
data << calendarEvent.GetTitle();
|
||||
data << calendarEvent.GetDescription();
|
||||
@@ -575,13 +575,13 @@ void CalendarMgr::SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEv
|
||||
for (CalendarInviteStore::const_iterator itr = eventInviteeList.begin(); itr != eventInviteeList.end(); ++itr)
|
||||
{
|
||||
CalendarInvite const* calendarInvite = (*itr);
|
||||
uint64 inviteeGuid = calendarInvite->GetInviteeGUID();
|
||||
ObjectGuid inviteeGuid = calendarInvite->GetInviteeGUID();
|
||||
Player* invitee = ObjectAccessor::FindPlayer(inviteeGuid);
|
||||
|
||||
uint8 inviteeLevel = invitee ? invitee->getLevel() : Player::GetLevelFromDB(inviteeGuid);
|
||||
uint32 inviteeGuildId = invitee ? invitee->GetGuildId() : Player::GetGuildIdFromDB(inviteeGuid);
|
||||
|
||||
data.appendPackGUID(inviteeGuid);
|
||||
data << inviteeGuid.WriteAsPacked();
|
||||
data << uint8(inviteeLevel);
|
||||
data << uint8(calendarInvite->GetStatus());
|
||||
data << uint8(calendarInvite->GetRank());
|
||||
@@ -594,7 +594,7 @@ void CalendarMgr::SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEv
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status)
|
||||
void CalendarMgr::SendCalendarEventInviteRemoveAlert(ObjectGuid guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
@@ -608,7 +608,7 @@ void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent
|
||||
}
|
||||
}
|
||||
|
||||
void CalendarMgr::SendCalendarClearPendingAction(uint64 guid)
|
||||
void CalendarMgr::SendCalendarClearPendingAction(ObjectGuid guid)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
@@ -617,7 +617,7 @@ void CalendarMgr::SendCalendarClearPendingAction(uint64 guid)
|
||||
}
|
||||
}
|
||||
|
||||
void CalendarMgr::SendCalendarCommandResult(uint64 guid, CalendarError err, char const* param /*= NULL*/)
|
||||
void CalendarMgr::SendCalendarCommandResult(ObjectGuid guid, CalendarError err, char const* param /*= NULL*/)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
enum CalendarMailAnswers
|
||||
{
|
||||
@@ -141,10 +142,10 @@ struct CalendarInvite
|
||||
_text = calendarInvite.GetText();
|
||||
}
|
||||
|
||||
CalendarInvite() : _inviteId(1), _eventId(0), _invitee(0), _senderGUID(0), _statusTime(time(NULL)),
|
||||
CalendarInvite() : _inviteId(1), _eventId(0), _invitee(), _senderGUID(), _statusTime(time(NULL)),
|
||||
_status(CALENDAR_STATUS_INVITED), _rank(CALENDAR_RANK_PLAYER), _text("") { }
|
||||
|
||||
CalendarInvite(uint64 inviteId, uint64 eventId, uint64 invitee, uint64 senderGUID, time_t statusTime,
|
||||
CalendarInvite(uint64 inviteId, uint64 eventId, ObjectGuid invitee, ObjectGuid senderGUID, time_t statusTime,
|
||||
CalendarInviteStatus status, CalendarModerationRank rank, std::string text) :
|
||||
_inviteId(inviteId), _eventId(eventId), _invitee(invitee), _senderGUID(senderGUID), _statusTime(statusTime),
|
||||
_status(status), _rank(rank), _text(text) { }
|
||||
@@ -157,11 +158,11 @@ struct CalendarInvite
|
||||
void SetEventId(uint64 eventId) { _eventId = eventId; }
|
||||
uint64 GetEventId() const { return _eventId; }
|
||||
|
||||
void SetSenderGUID(uint64 guid) { _senderGUID = guid; }
|
||||
uint64 GetSenderGUID() const { return _senderGUID; }
|
||||
void SetSenderGUID(ObjectGuid guid) { _senderGUID = guid; }
|
||||
ObjectGuid GetSenderGUID() const { return _senderGUID; }
|
||||
|
||||
void SetInvitee(uint64 guid) { _invitee = guid; }
|
||||
uint64 GetInviteeGUID() const { return _invitee; }
|
||||
void SetInvitee(ObjectGuid guid) { _invitee = guid; }
|
||||
ObjectGuid GetInviteeGUID() const { return _invitee; }
|
||||
|
||||
void SetStatusTime(time_t statusTime) { _statusTime = statusTime; }
|
||||
time_t GetStatusTime() const { return _statusTime; }
|
||||
@@ -178,8 +179,8 @@ struct CalendarInvite
|
||||
private:
|
||||
uint64 _inviteId;
|
||||
uint64 _eventId;
|
||||
uint64 _invitee;
|
||||
uint64 _senderGUID;
|
||||
ObjectGuid _invitee;
|
||||
ObjectGuid _senderGUID;
|
||||
time_t _statusTime;
|
||||
CalendarInviteStatus _status;
|
||||
CalendarModerationRank _rank;
|
||||
@@ -203,13 +204,13 @@ struct CalendarEvent
|
||||
_description = calendarEvent.GetDescription();
|
||||
}
|
||||
|
||||
CalendarEvent(uint64 eventId, uint64 creatorGUID, uint32 guildId, CalendarEventType type, int32 dungeonId,
|
||||
CalendarEvent(uint64 eventId, ObjectGuid creatorGUID, uint32 guildId, CalendarEventType type, int32 dungeonId,
|
||||
time_t eventTime, uint32 flags, time_t timezoneTime, std::string title, std::string description) :
|
||||
_eventId(eventId), _creatorGUID(creatorGUID), _guildId(guildId), _type(type), _dungeonId(dungeonId),
|
||||
_eventTime(eventTime), _flags(flags), _timezoneTime(timezoneTime), _title(title),
|
||||
_description(description) { }
|
||||
|
||||
CalendarEvent() : _eventId(1), _creatorGUID(0), _guildId(0), _type(CALENDAR_TYPE_OTHER), _dungeonId(-1), _eventTime(0),
|
||||
CalendarEvent() : _eventId(1), _creatorGUID(), _guildId(0), _type(CALENDAR_TYPE_OTHER), _dungeonId(-1), _eventTime(0),
|
||||
_flags(0), _timezoneTime(0), _title(""), _description("") { }
|
||||
|
||||
~CalendarEvent();
|
||||
@@ -217,8 +218,8 @@ struct CalendarEvent
|
||||
void SetEventId(uint64 eventId) { _eventId = eventId; }
|
||||
uint64 GetEventId() const { return _eventId; }
|
||||
|
||||
void SetCreatorGUID(uint64 guid) { _creatorGUID = guid; }
|
||||
uint64 GetCreatorGUID() const { return _creatorGUID; }
|
||||
void SetCreatorGUID(ObjectGuid guid) { _creatorGUID = guid; }
|
||||
ObjectGuid GetCreatorGUID() const { return _creatorGUID; }
|
||||
|
||||
void SetGuildId(uint32 guildId) { _guildId = guildId; }
|
||||
uint32 GetGuildId() const { return _guildId; }
|
||||
@@ -247,12 +248,12 @@ struct CalendarEvent
|
||||
bool IsGuildEvent() const { return (_flags & CALENDAR_FLAG_GUILD_EVENT) != 0; }
|
||||
bool IsGuildAnnouncement() const { return (_flags & CALENDAR_FLAG_WITHOUT_INVITES) != 0; }
|
||||
|
||||
std::string BuildCalendarMailSubject(uint64 remover) const;
|
||||
std::string BuildCalendarMailSubject(ObjectGuid remover) const;
|
||||
std::string BuildCalendarMailBody() const;
|
||||
|
||||
private:
|
||||
uint64 _eventId;
|
||||
uint64 _creatorGUID;
|
||||
ObjectGuid _creatorGUID;
|
||||
uint32 _guildId;
|
||||
CalendarEventType _type;
|
||||
int32 _dungeonId;
|
||||
@@ -291,44 +292,44 @@ class CalendarMgr
|
||||
|
||||
CalendarEvent* GetEvent(uint64 eventId) const;
|
||||
CalendarEventStore const& GetEvents() const { return _events; }
|
||||
CalendarEventStore GetPlayerEvents(uint64 guid);
|
||||
CalendarEventStore GetPlayerEvents(ObjectGuid guid);
|
||||
|
||||
CalendarInvite* GetInvite(uint64 inviteId) const;
|
||||
CalendarEventInviteStore const& GetInvites() const { return _invites; }
|
||||
CalendarInviteStore const& GetEventInvites(uint64 eventId);
|
||||
CalendarInviteStore GetPlayerInvites(uint64 guid);
|
||||
CalendarInviteStore GetPlayerInvites(ObjectGuid guid);
|
||||
|
||||
void FreeEventId(uint64 id);
|
||||
uint64 GetFreeEventId();
|
||||
void FreeInviteId(uint64 id);
|
||||
uint64 GetFreeInviteId();
|
||||
|
||||
uint32 GetPlayerNumPending(uint64 guid);
|
||||
uint32 GetPlayerNumPending(ObjectGuid guid);
|
||||
|
||||
void AddEvent(CalendarEvent* calendarEvent, CalendarSendEventType sendType);
|
||||
void RemoveEvent(uint64 eventId, uint64 remover);
|
||||
void RemoveEvent(uint64 eventId, ObjectGuid remover);
|
||||
void UpdateEvent(CalendarEvent* calendarEvent);
|
||||
|
||||
void AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite);
|
||||
void AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite, SQLTransaction& trans);
|
||||
void RemoveInvite(uint64 inviteId, uint64 eventId, uint64 remover);
|
||||
void RemoveInvite(uint64 inviteId, uint64 eventId, ObjectGuid remover);
|
||||
void UpdateInvite(CalendarInvite* invite);
|
||||
void UpdateInvite(CalendarInvite* invite, SQLTransaction& trans);
|
||||
|
||||
void RemoveAllPlayerEventsAndInvites(uint64 guid);
|
||||
void RemovePlayerGuildEventsAndSignups(uint64 guid, uint32 guildId);
|
||||
void RemoveAllPlayerEventsAndInvites(ObjectGuid guid);
|
||||
void RemovePlayerGuildEventsAndSignups(ObjectGuid guid, uint32 guildId);
|
||||
|
||||
void SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType);
|
||||
void SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType);
|
||||
void SendCalendarEventInvite(CalendarInvite const& invite);
|
||||
void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarEventInviteRemove(CalendarEvent const& calendarEvent, CalendarInvite const& invite, uint32 flags);
|
||||
void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status);
|
||||
void SendCalendarEventInviteRemoveAlert(ObjectGuid guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status);
|
||||
void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, time_t oldEventTime);
|
||||
void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent);
|
||||
void SendCalendarEventModeratorStatusAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarClearPendingAction(uint64 guid);
|
||||
void SendCalendarCommandResult(uint64 guid, CalendarError err, char const* param = NULL);
|
||||
void SendCalendarClearPendingAction(ObjectGuid guid);
|
||||
void SendCalendarCommandResult(ObjectGuid guid, CalendarError err, char const* param = NULL);
|
||||
|
||||
void SendPacketToAllEventRelatives(WorldPacket& packet, CalendarEvent const& calendarEvent);
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team):
|
||||
_flags(0),
|
||||
_channelId(channelId),
|
||||
_Team(team),
|
||||
_ownerGUID(0),
|
||||
_ownerGUID(),
|
||||
_name(name),
|
||||
_password("")
|
||||
{
|
||||
@@ -80,10 +80,10 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team):
|
||||
Tokenizer tokens(db_BannedList, ' ');
|
||||
for (Tokenizer::const_iterator i = tokens.begin(); i != tokens.end(); ++i)
|
||||
{
|
||||
uint64 banned_guid = atol(*i);
|
||||
ObjectGuid banned_guid(uint64(strtoull(*i, NULL, 10)));
|
||||
if (banned_guid)
|
||||
{
|
||||
TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore guid:" UI64FMTD "", name.c_str(), banned_guid);
|
||||
TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore %s", name.c_str(), banned_guid.ToString().c_str());
|
||||
bannedStore.insert(banned_guid);
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void Channel::UpdateChannelInDB() const
|
||||
std::ostringstream banlist;
|
||||
BannedContainer::const_iterator iter;
|
||||
for (iter = bannedStore.begin(); iter != bannedStore.end(); ++iter)
|
||||
banlist << (*iter) << ' ';
|
||||
banlist << iter->GetRawValue() << ' ';
|
||||
|
||||
std::string banListStr = banlist.str();
|
||||
|
||||
@@ -149,7 +149,7 @@ void Channel::CleanOldChannelsInDB()
|
||||
|
||||
void Channel::JoinChannel(Player* player, std::string const& pass)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
if (IsOn(guid))
|
||||
{
|
||||
// Do not send error message for built-in channels
|
||||
@@ -227,7 +227,7 @@ void Channel::JoinChannel(Player* player, std::string const& pass)
|
||||
|
||||
void Channel::LeaveChannel(Player* player, bool send)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
if (!IsOn(guid))
|
||||
{
|
||||
if (send)
|
||||
@@ -269,7 +269,7 @@ void Channel::LeaveChannel(Player* player, bool send)
|
||||
// If the channel owner left and there are still playersStore inside, pick a new owner
|
||||
if (changeowner && _ownership && !playersStore.empty())
|
||||
{
|
||||
uint64 newowner = playersStore.begin()->second.player;
|
||||
ObjectGuid newowner = playersStore.begin()->second.player;
|
||||
playersStore[newowner].SetModerator(true);
|
||||
SetOwner(newowner);
|
||||
}
|
||||
@@ -278,7 +278,7 @@ void Channel::LeaveChannel(Player* player, bool send)
|
||||
|
||||
void Channel::KickOrBan(Player const* player, std::string const& badname, bool ban)
|
||||
{
|
||||
uint64 good = player->GetGUID();
|
||||
ObjectGuid good = player->GetGUID();
|
||||
|
||||
if (!IsOn(good))
|
||||
{
|
||||
@@ -297,7 +297,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
|
||||
}
|
||||
|
||||
Player* bad = sObjectAccessor->FindPlayerByName(badname);
|
||||
uint64 victim = bad ? bad->GetGUID() : 0;
|
||||
ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty;
|
||||
if (!victim || !IsOn(victim))
|
||||
{
|
||||
WorldPacket data;
|
||||
@@ -340,7 +340,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
|
||||
|
||||
if (changeowner && _ownership && !playersStore.empty())
|
||||
{
|
||||
uint64 newowner = good;
|
||||
ObjectGuid newowner = good;
|
||||
playersStore[newowner].SetModerator(true);
|
||||
SetOwner(newowner);
|
||||
}
|
||||
@@ -348,7 +348,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
|
||||
|
||||
void Channel::UnBan(Player const* player, std::string const& badname)
|
||||
{
|
||||
uint64 good = player->GetGUID();
|
||||
ObjectGuid good = player->GetGUID();
|
||||
|
||||
if (!IsOn(good))
|
||||
{
|
||||
@@ -367,7 +367,7 @@ void Channel::UnBan(Player const* player, std::string const& badname)
|
||||
}
|
||||
|
||||
Player* bad = sObjectAccessor->FindPlayerByName(badname);
|
||||
uint64 victim = bad ? bad->GetGUID(): 0;
|
||||
ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty;
|
||||
|
||||
if (!victim || !IsBanned(victim))
|
||||
{
|
||||
@@ -388,7 +388,7 @@ void Channel::UnBan(Player const* player, std::string const& badname)
|
||||
|
||||
void Channel::Password(Player const* player, std::string const& pass)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
|
||||
ChatHandler chat(player->GetSession());
|
||||
if (!IsOn(guid))
|
||||
@@ -418,7 +418,7 @@ void Channel::Password(Player const* player, std::string const& pass)
|
||||
|
||||
void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bool set)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
|
||||
if (!IsOn(guid))
|
||||
{
|
||||
@@ -440,7 +440,7 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo
|
||||
return;
|
||||
|
||||
Player* newp = sObjectAccessor->FindPlayerByName(p2n);
|
||||
uint64 victim = newp ? newp->GetGUID() : 0;
|
||||
ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty;
|
||||
|
||||
if (!victim || !IsOn(victim) ||
|
||||
(player->GetTeam() != newp->GetTeam() &&
|
||||
@@ -469,7 +469,7 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo
|
||||
|
||||
void Channel::SetOwner(Player const* player, std::string const& newname)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
|
||||
if (!IsOn(guid))
|
||||
{
|
||||
@@ -488,7 +488,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
|
||||
}
|
||||
|
||||
Player* newp = sObjectAccessor->FindPlayerByName(newname);
|
||||
uint64 victim = newp ? newp->GetGUID() : 0;
|
||||
ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty;
|
||||
|
||||
if (!victim || !IsOn(victim) ||
|
||||
(player->GetTeam() != newp->GetTeam() &&
|
||||
@@ -505,7 +505,7 @@ void Channel::SetOwner(Player const* player, std::string const& newname)
|
||||
SetOwner(victim);
|
||||
}
|
||||
|
||||
void Channel::SendWhoOwner(uint64 guid)
|
||||
void Channel::SendWhoOwner(ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data;
|
||||
if (IsOn(guid))
|
||||
@@ -517,7 +517,7 @@ void Channel::SendWhoOwner(uint64 guid)
|
||||
|
||||
void Channel::List(Player const* player)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
|
||||
if (!IsOn(guid))
|
||||
{
|
||||
@@ -565,7 +565,7 @@ void Channel::List(Player const* player)
|
||||
|
||||
void Channel::Announce(Player const* player)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
|
||||
if (!IsOn(guid))
|
||||
{
|
||||
@@ -595,7 +595,7 @@ void Channel::Announce(Player const* player)
|
||||
UpdateChannelInDB();
|
||||
}
|
||||
|
||||
void Channel::Say(uint64 guid, std::string const& what, uint32 lang)
|
||||
void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang)
|
||||
{
|
||||
if (what.empty())
|
||||
return;
|
||||
@@ -626,12 +626,12 @@ void Channel::Say(uint64 guid, std::string const& what, uint32 lang)
|
||||
else
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _name);
|
||||
|
||||
SendToAll(&data, !playersStore[guid].IsModerator() ? guid : false);
|
||||
SendToAll(&data, !playersStore[guid].IsModerator() ? guid : ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
void Channel::Invite(Player const* player, std::string const& newname)
|
||||
{
|
||||
uint64 guid = player->GetGUID();
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
|
||||
if (!IsOn(guid))
|
||||
{
|
||||
@@ -676,7 +676,7 @@ void Channel::Invite(Player const* player, std::string const& newname)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!newp->GetSocial()->HasIgnore(GUID_LOPART(guid)))
|
||||
if (!newp->GetSocial()->HasIgnore(guid.GetCounter()))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakeInvite(&data, guid);
|
||||
@@ -689,7 +689,7 @@ void Channel::Invite(Player const* player, std::string const& newname)
|
||||
SendToOne(&data, guid);
|
||||
}
|
||||
|
||||
void Channel::SetOwner(uint64 guid, bool exclaim)
|
||||
void Channel::SetOwner(ObjectGuid guid, bool exclaim)
|
||||
{
|
||||
if (_ownerGUID)
|
||||
{
|
||||
@@ -720,15 +720,15 @@ void Channel::SetOwner(uint64 guid, bool exclaim)
|
||||
}
|
||||
}
|
||||
|
||||
void Channel::SendToAll(WorldPacket* data, uint64 guid)
|
||||
void Channel::SendToAll(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(i->first))
|
||||
if (!guid || !player->GetSocial()->HasIgnore(GUID_LOPART(guid)))
|
||||
if (!guid || !player->GetSocial()->HasIgnore(guid.GetCounter()))
|
||||
player->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
void Channel::SendToAllButOne(WorldPacket* data, uint64 who)
|
||||
void Channel::SendToAllButOne(WorldPacket* data, ObjectGuid who)
|
||||
{
|
||||
for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
|
||||
if (i->first != who)
|
||||
@@ -736,18 +736,18 @@ void Channel::SendToAllButOne(WorldPacket* data, uint64 who)
|
||||
player->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
void Channel::SendToOne(WorldPacket* data, uint64 who)
|
||||
void Channel::SendToOne(WorldPacket* data, ObjectGuid who)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(who))
|
||||
player->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
void Channel::Voice(uint64 /*guid1*/, uint64 /*guid2*/)
|
||||
void Channel::Voice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Channel::DeVoice(uint64 /*guid1*/, uint64 /*guid2*/)
|
||||
void Channel::DeVoice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -759,13 +759,13 @@ void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type)
|
||||
*data << _name;
|
||||
}
|
||||
|
||||
void Channel::MakeJoined(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeJoined(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_JOINED_NOTICE);
|
||||
*data << uint64(guid);
|
||||
}
|
||||
|
||||
void Channel::MakeLeft(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeLeft(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_LEFT_NOTICE);
|
||||
*data << uint64(guid);
|
||||
@@ -801,13 +801,13 @@ void Channel::MakeNotModerator(WorldPacket* data)
|
||||
MakeNotifyPacket(data, CHAT_NOT_MODERATOR_NOTICE);
|
||||
}
|
||||
|
||||
void Channel::MakePasswordChanged(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakePasswordChanged(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE);
|
||||
*data << uint64(guid);
|
||||
}
|
||||
|
||||
void Channel::MakeOwnerChanged(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeOwnerChanged(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE);
|
||||
*data << uint64(guid);
|
||||
@@ -835,7 +835,7 @@ void Channel::MakeChannelOwner(WorldPacket* data)
|
||||
*data << ((IsConstant() || !_ownerGUID) ? "Nobody" : name);
|
||||
}
|
||||
|
||||
void Channel::MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags)
|
||||
void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_MODE_CHANGE_NOTICE);
|
||||
*data << uint64(guid);
|
||||
@@ -843,13 +843,13 @@ void Channel::MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags)
|
||||
*data << uint8(GetPlayerFlags(guid));
|
||||
}
|
||||
|
||||
void Channel::MakeAnnouncementsOn(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE);
|
||||
*data << uint64(guid);
|
||||
}
|
||||
|
||||
void Channel::MakeAnnouncementsOff(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE);
|
||||
*data << uint64(guid);
|
||||
@@ -860,7 +860,7 @@ void Channel::MakeMuted(WorldPacket* data)
|
||||
MakeNotifyPacket(data, CHAT_MUTED_NOTICE);
|
||||
}
|
||||
|
||||
void Channel::MakePlayerKicked(WorldPacket* data, uint64 bad, uint64 good)
|
||||
void Channel::MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_KICKED_NOTICE);
|
||||
*data << uint64(bad);
|
||||
@@ -872,14 +872,14 @@ void Channel::MakeBanned(WorldPacket* data)
|
||||
MakeNotifyPacket(data, CHAT_BANNED_NOTICE);
|
||||
}
|
||||
|
||||
void Channel::MakePlayerBanned(WorldPacket* data, uint64 bad, uint64 good)
|
||||
void Channel::MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_BANNED_NOTICE);
|
||||
*data << uint64(bad);
|
||||
*data << uint64(good);
|
||||
}
|
||||
|
||||
void Channel::MakePlayerUnbanned(WorldPacket* data, uint64 bad, uint64 good)
|
||||
void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_UNBANNED_NOTICE);
|
||||
*data << uint64(bad);
|
||||
@@ -892,13 +892,13 @@ void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name)
|
||||
*data << name;
|
||||
}
|
||||
|
||||
void Channel::MakePlayerAlreadyMember(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE);
|
||||
*data << uint64(guid);
|
||||
}
|
||||
|
||||
void Channel::MakeInvite(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeInvite(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_INVITE_NOTICE);
|
||||
*data << uint64(guid);
|
||||
@@ -951,19 +951,19 @@ void Channel::MakeNotInLfg(WorldPacket* data)
|
||||
MakeNotifyPacket(data, CHAT_NOT_IN_LFG_NOTICE);
|
||||
}
|
||||
|
||||
void Channel::MakeVoiceOn(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeVoiceOn(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_VOICE_ON_NOTICE);
|
||||
*data << uint64(guid);
|
||||
}
|
||||
|
||||
void Channel::MakeVoiceOff(WorldPacket* data, uint64 guid)
|
||||
void Channel::MakeVoiceOff(WorldPacket* data, ObjectGuid guid)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_VOICE_OFF_NOTICE);
|
||||
*data << uint64(guid);
|
||||
}
|
||||
|
||||
void Channel::JoinNotify(uint64 guid)
|
||||
void Channel::JoinNotify(ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size());
|
||||
data << uint64(guid);
|
||||
@@ -978,7 +978,7 @@ void Channel::JoinNotify(uint64 guid)
|
||||
SendToAll(&data);
|
||||
}
|
||||
|
||||
void Channel::LeaveNotify(uint64 guid)
|
||||
void Channel::LeaveNotify(ObjectGuid guid)
|
||||
{
|
||||
WorldPacket data(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + GetName().size());
|
||||
data << uint64(guid);
|
||||
|
||||
@@ -122,7 +122,7 @@ class Channel
|
||||
{
|
||||
struct PlayerInfo
|
||||
{
|
||||
uint64 player;
|
||||
ObjectGuid player;
|
||||
uint8 flags;
|
||||
|
||||
bool HasFlag(uint8 flag) const { return (flags & flag) != 0; }
|
||||
@@ -169,21 +169,21 @@ class Channel
|
||||
void UnBan(Player const* player, std::string const& badname);
|
||||
void Password(Player const* player, std::string const& pass);
|
||||
void SetMode(Player const* player, std::string const& p2n, bool mod, bool set);
|
||||
void SetOwner(uint64 guid, bool exclaim = true);
|
||||
void SetOwner(ObjectGuid guid, bool exclaim = true);
|
||||
void SetOwner(Player const* player, std::string const& name);
|
||||
void SendWhoOwner(uint64 guid);
|
||||
void SendWhoOwner(ObjectGuid guid);
|
||||
void SetModerator(Player const* player, std::string const& newname) { SetMode(player, newname, true, true); }
|
||||
void UnsetModerator(Player const* player, std::string const& newname) { SetMode(player, newname, true, false); }
|
||||
void SetMute(Player const* player, std::string const& newname) { SetMode(player, newname, false, true); }
|
||||
void UnsetMute(Player const* player, std::string const& newname) { SetMode(player, newname, false, false); }
|
||||
void List(Player const* player);
|
||||
void Announce(Player const* player);
|
||||
void Say(uint64 guid, std::string const& what, uint32 lang);
|
||||
void Say(ObjectGuid guid, std::string const& what, uint32 lang);
|
||||
void Invite(Player const* player, std::string const& newp);
|
||||
void Voice(uint64 guid1, uint64 guid2);
|
||||
void DeVoice(uint64 guid1, uint64 guid2);
|
||||
void JoinNotify(uint64 guid); // invisible notify
|
||||
void LeaveNotify(uint64 guid); // invisible notify
|
||||
void Voice(ObjectGuid guid1, ObjectGuid guid2);
|
||||
void DeVoice(ObjectGuid guid1, ObjectGuid guid2);
|
||||
void JoinNotify(ObjectGuid guid); // invisible notify
|
||||
void LeaveNotify(ObjectGuid guid); // invisible notify
|
||||
void SetOwnership(bool ownership) { _ownership = ownership; };
|
||||
static void CleanOldChannelsInDB();
|
||||
|
||||
@@ -191,29 +191,29 @@ class Channel
|
||||
// initial packet data (notify type and channel name)
|
||||
void MakeNotifyPacket(WorldPacket* data, uint8 notify_type);
|
||||
// type specific packet data
|
||||
void MakeJoined(WorldPacket* data, uint64 guid); //+ 0x00
|
||||
void MakeLeft(WorldPacket* data, uint64 guid); //+ 0x01
|
||||
void MakeJoined(WorldPacket* data, ObjectGuid guid); //+ 0x00
|
||||
void MakeLeft(WorldPacket* data, ObjectGuid guid); //+ 0x01
|
||||
void MakeYouJoined(WorldPacket* data); //+ 0x02
|
||||
void MakeYouLeft(WorldPacket* data); //+ 0x03
|
||||
void MakeWrongPassword(WorldPacket* data); //? 0x04
|
||||
void MakeNotMember(WorldPacket* data); //? 0x05
|
||||
void MakeNotModerator(WorldPacket* data); //? 0x06
|
||||
void MakePasswordChanged(WorldPacket* data, uint64 guid); //+ 0x07
|
||||
void MakeOwnerChanged(WorldPacket* data, uint64 guid); //? 0x08
|
||||
void MakePlayerNotFound(WorldPacket* data, std::string const& name); //+ 0x09
|
||||
void MakePasswordChanged(WorldPacket* data, ObjectGuid guid); //+ 0x07
|
||||
void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid); //? 0x08
|
||||
void MakePlayerNotFound(WorldPacket* data, std::string const& name); //+ 0x09
|
||||
void MakeNotOwner(WorldPacket* data); //? 0x0A
|
||||
void MakeChannelOwner(WorldPacket* data); //? 0x0B
|
||||
void MakeModeChange(WorldPacket* data, uint64 guid, uint8 oldflags); //+ 0x0C
|
||||
void MakeAnnouncementsOn(WorldPacket* data, uint64 guid); //+ 0x0D
|
||||
void MakeAnnouncementsOff(WorldPacket* data, uint64 guid); //+ 0x0E
|
||||
void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags);//+ 0x0C
|
||||
void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid); //+ 0x0D
|
||||
void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid); //+ 0x0E
|
||||
void MakeMuted(WorldPacket* data); //? 0x11
|
||||
void MakePlayerKicked(WorldPacket* data, uint64 bad, uint64 good); //? 0x12
|
||||
void MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x12
|
||||
void MakeBanned(WorldPacket* data); //? 0x13
|
||||
void MakePlayerBanned(WorldPacket* data, uint64 bad, uint64 good); //? 0x14
|
||||
void MakePlayerUnbanned(WorldPacket* data, uint64 bad, uint64 good); //? 0x15
|
||||
void MakePlayerNotBanned(WorldPacket* data, std::string const& name); //? 0x16
|
||||
void MakePlayerAlreadyMember(WorldPacket* data, uint64 guid); //+ 0x17
|
||||
void MakeInvite(WorldPacket* data, uint64 guid); //? 0x18
|
||||
void MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x14
|
||||
void MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good);//? 0x15
|
||||
void MakePlayerNotBanned(WorldPacket* data, std::string const& name); //? 0x16
|
||||
void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid); //+ 0x17
|
||||
void MakeInvite(WorldPacket* data, ObjectGuid guid); //? 0x18
|
||||
void MakeInviteWrongFaction(WorldPacket* data); //? 0x19
|
||||
void MakeWrongFaction(WorldPacket* data); //? 0x1A
|
||||
void MakeInvalidName(WorldPacket* data); //? 0x1B
|
||||
@@ -223,26 +223,26 @@ class Channel
|
||||
void MakeThrottled(WorldPacket* data); //? 0x1F
|
||||
void MakeNotInArea(WorldPacket* data); //? 0x20
|
||||
void MakeNotInLfg(WorldPacket* data); //? 0x21
|
||||
void MakeVoiceOn(WorldPacket* data, uint64 guid); //+ 0x22
|
||||
void MakeVoiceOff(WorldPacket* data, uint64 guid); //+ 0x23
|
||||
void MakeVoiceOn(WorldPacket* data, ObjectGuid guid); //+ 0x22
|
||||
void MakeVoiceOff(WorldPacket* data, ObjectGuid guid); //+ 0x23
|
||||
|
||||
void SendToAll(WorldPacket* data, uint64 guid = 0);
|
||||
void SendToAllButOne(WorldPacket* data, uint64 who);
|
||||
void SendToOne(WorldPacket* data, uint64 who);
|
||||
void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid::Empty);
|
||||
void SendToAllButOne(WorldPacket* data, ObjectGuid who);
|
||||
void SendToOne(WorldPacket* data, ObjectGuid who);
|
||||
|
||||
bool IsOn(uint64 who) const { return playersStore.find(who) != playersStore.end(); }
|
||||
bool IsBanned(uint64 guid) const { return bannedStore.find(guid) != bannedStore.end(); }
|
||||
bool IsOn(ObjectGuid who) const { return playersStore.find(who) != playersStore.end(); }
|
||||
bool IsBanned(ObjectGuid guid) const { return bannedStore.find(guid) != bannedStore.end(); }
|
||||
|
||||
void UpdateChannelInDB() const;
|
||||
void UpdateChannelUseageInDB() const;
|
||||
|
||||
uint8 GetPlayerFlags(uint64 guid) const
|
||||
uint8 GetPlayerFlags(ObjectGuid guid) const
|
||||
{
|
||||
PlayerContainer::const_iterator itr = playersStore.find(guid);
|
||||
return itr != playersStore.end() ? itr->second.flags : 0;
|
||||
}
|
||||
|
||||
void SetModerator(uint64 guid, bool set)
|
||||
void SetModerator(ObjectGuid guid, bool set)
|
||||
{
|
||||
if (playersStore[guid].IsModerator() != set)
|
||||
{
|
||||
@@ -255,7 +255,7 @@ class Channel
|
||||
}
|
||||
}
|
||||
|
||||
void SetMute(uint64 guid, bool set)
|
||||
void SetMute(ObjectGuid guid, bool set)
|
||||
{
|
||||
if (playersStore[guid].IsMuted() != set)
|
||||
{
|
||||
@@ -268,8 +268,8 @@ class Channel
|
||||
}
|
||||
}
|
||||
|
||||
typedef std::map<uint64, PlayerInfo> PlayerContainer;
|
||||
typedef std::set<uint64> BannedContainer;
|
||||
typedef std::map<ObjectGuid, PlayerInfo> PlayerContainer;
|
||||
typedef GuidSet BannedContainer;
|
||||
|
||||
bool _announce;
|
||||
bool _ownership;
|
||||
@@ -277,7 +277,7 @@ class Channel
|
||||
uint8 _flags;
|
||||
uint32 _channelId;
|
||||
uint32 _Team;
|
||||
uint64 _ownerGUID;
|
||||
ObjectGuid _ownerGUID;
|
||||
std::string _name;
|
||||
std::string _password;
|
||||
PlayerContainer playersStore;
|
||||
|
||||
@@ -104,7 +104,7 @@ ChatCommand* ChatHandler::getCommandTable()
|
||||
return commandTableCache;
|
||||
}
|
||||
|
||||
std::string ChatHandler::PGetParseString(int32 entry, ...) const
|
||||
std::string ChatHandler::PGetParseString(uint32 entry, ...) const
|
||||
{
|
||||
const char *format = GetTrinityString(entry);
|
||||
char str[1024];
|
||||
@@ -115,7 +115,7 @@ std::string ChatHandler::PGetParseString(int32 entry, ...) const
|
||||
return std::string(str);
|
||||
}
|
||||
|
||||
const char *ChatHandler::GetTrinityString(int32 entry) const
|
||||
char const* ChatHandler::GetTrinityString(uint32 entry) const
|
||||
{
|
||||
return m_session->GetTrinityString(entry);
|
||||
}
|
||||
@@ -125,7 +125,7 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
|
||||
return HasPermission(cmd.Permission);
|
||||
}
|
||||
|
||||
bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
|
||||
bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong)
|
||||
{
|
||||
WorldSession* target_session = NULL;
|
||||
uint32 target_account = 0;
|
||||
@@ -253,12 +253,12 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void ChatHandler::SendSysMessage(int32 entry)
|
||||
void ChatHandler::SendSysMessage(uint32 entry)
|
||||
{
|
||||
SendSysMessage(GetTrinityString(entry));
|
||||
}
|
||||
|
||||
void ChatHandler::PSendSysMessage(int32 entry, ...)
|
||||
void ChatHandler::PSendSysMessage(uint32 entry, ...)
|
||||
{
|
||||
const char *format = GetTrinityString(entry);
|
||||
va_list ap;
|
||||
@@ -345,7 +345,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st
|
||||
Player* player = m_session->GetPlayer();
|
||||
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
|
||||
{
|
||||
uint64 guid = player->GetTarget();
|
||||
ObjectGuid guid = player->GetTarget();
|
||||
uint32 areaId = player->GetAreaId();
|
||||
std::string areaName = "Unknown";
|
||||
std::string zoneName = "Unknown";
|
||||
@@ -356,14 +356,14 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st
|
||||
zoneName = zone->area_name;
|
||||
}
|
||||
|
||||
sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (Guid: %u) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected %s: %s (GUID: %u)]",
|
||||
fullcmd.c_str(), player->GetName().c_str(), GUID_LOPART(player->GetGUID()),
|
||||
sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (%s) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected: %s (%s)]",
|
||||
fullcmd.c_str(), player->GetName().c_str(), player->GetGUID().ToString().c_str(),
|
||||
m_session->GetAccountId(), player->GetPositionX(), player->GetPositionY(),
|
||||
player->GetPositionZ(), player->GetMapId(),
|
||||
player->GetMap() ? player->GetMap()->GetMapName() : "Unknown",
|
||||
areaId, areaName.c_str(), zoneName.c_str(), GetLogNameForGuid(guid),
|
||||
areaId, areaName.c_str(), zoneName.c_str(),
|
||||
(player->GetSelectedUnit()) ? player->GetSelectedUnit()->GetName().c_str() : "",
|
||||
GUID_LOPART(guid));
|
||||
guid.ToString().c_str());
|
||||
}
|
||||
}
|
||||
// some commands have custom error messages. Don't send the default one in these cases.
|
||||
@@ -628,7 +628,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
|
||||
return ShowHelpForSubCommands(table, "", cmd);
|
||||
}
|
||||
|
||||
size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, uint64 senderGUID, uint64 receiverGUID, std::string const& message, uint8 chatTag,
|
||||
size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string const& message, uint8 chatTag,
|
||||
std::string const& senderName /*= ""*/, std::string const& receiverName /*= ""*/,
|
||||
uint32 achievementId /*= 0*/, bool gmMessage /*= false*/, std::string const& channelName /*= ""*/,
|
||||
std::string const& addonPrefix /*= ""*/)
|
||||
@@ -653,7 +653,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
data << senderName;
|
||||
receiverGUIDPos = data.wpos();
|
||||
data << uint64(receiverGUID);
|
||||
if (receiverGUID && !IS_PLAYER_GUID(receiverGUID) && !IS_PET_GUID(receiverGUID))
|
||||
if (receiverGUID && !receiverGUID.IsPlayer() && !receiverGUID.IsPet())
|
||||
{
|
||||
data << uint32(receiverName.length() + 1);
|
||||
data << receiverName;
|
||||
@@ -675,7 +675,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
case CHAT_MSG_BG_SYSTEM_HORDE:
|
||||
receiverGUIDPos = data.wpos();
|
||||
data << uint64(receiverGUID);
|
||||
if (receiverGUID && !IS_PLAYER_GUID(receiverGUID))
|
||||
if (receiverGUID && !receiverGUID.IsPlayer())
|
||||
{
|
||||
data << uint32(receiverName.length() + 1);
|
||||
data << receiverName;
|
||||
@@ -730,11 +730,11 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
||||
size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message,
|
||||
uint32 achievementId /*= 0*/, std::string const& channelName /*= ""*/, LocaleConstant locale /*= DEFAULT_LOCALE*/, std::string const& addonPrefix /*= ""*/)
|
||||
{
|
||||
uint64 senderGUID = 0;
|
||||
ObjectGuid senderGUID;
|
||||
std::string senderName = "";
|
||||
uint8 chatTag = 0;
|
||||
bool gmMessage = false;
|
||||
uint64 receiverGUID = 0;
|
||||
ObjectGuid receiverGUID;
|
||||
std::string receiverName = "";
|
||||
if (sender)
|
||||
{
|
||||
@@ -761,7 +761,7 @@ Player* ChatHandler::getSelectedPlayer()
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
|
||||
uint64 selected = m_session->GetPlayer()->GetTarget();
|
||||
ObjectGuid selected = m_session->GetPlayer()->GetTarget();
|
||||
if (!selected)
|
||||
return m_session->GetPlayer();
|
||||
|
||||
@@ -784,9 +784,9 @@ WorldObject* ChatHandler::getSelectedObject()
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
|
||||
uint64 guid = m_session->GetPlayer()->GetTarget();
|
||||
ObjectGuid guid = m_session->GetPlayer()->GetTarget();
|
||||
|
||||
if (guid == 0)
|
||||
if (!guid)
|
||||
return GetNearbyGameObject();
|
||||
|
||||
return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid);
|
||||
@@ -805,7 +805,7 @@ Player* ChatHandler::getSelectedPlayerOrSelf()
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
|
||||
uint64 selected = m_session->GetPlayer()->GetTarget();
|
||||
ObjectGuid selected = m_session->GetPlayer()->GetTarget();
|
||||
if (!selected)
|
||||
return m_session->GetPlayer();
|
||||
|
||||
@@ -950,7 +950,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
|
||||
GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT));
|
||||
GameObject* obj = pl->GetMap()->GetGameObject(ObjectGuid(HIGHGUID_GAMEOBJECT, entry, lowguid));
|
||||
|
||||
if (!obj && sObjectMgr->GetGOData(lowguid)) // guid is DB guid of object
|
||||
{
|
||||
@@ -1071,7 +1071,7 @@ static char const* const guidKeys[] =
|
||||
nullptr
|
||||
};
|
||||
|
||||
uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
ObjectGuid ChatHandler::extractGuidFromLink(char* text)
|
||||
{
|
||||
int type = 0;
|
||||
|
||||
@@ -1080,7 +1080,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
// |color|Hplayer:name|h[name]|h|r
|
||||
char* idS = extractKeyFromLink(text, guidKeys, &type);
|
||||
if (!idS)
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -1088,38 +1088,38 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
{
|
||||
std::string name = idS;
|
||||
if (!normalizePlayerName(name))
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
|
||||
if (Player* player = sObjectAccessor->FindPlayerByName(name))
|
||||
return player->GetGUID();
|
||||
|
||||
if (uint64 guid = sObjectMgr->GetPlayerGUIDByName(name))
|
||||
if (ObjectGuid guid = sObjectMgr->GetPlayerGUIDByName(name))
|
||||
return guid;
|
||||
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
case SPELL_LINK_CREATURE:
|
||||
{
|
||||
uint32 lowguid = (uint32)atol(idS);
|
||||
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid))
|
||||
return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT);
|
||||
return ObjectGuid(HIGHGUID_UNIT, data->id, lowguid);
|
||||
else
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
case SPELL_LINK_GAMEOBJECT:
|
||||
{
|
||||
uint32 lowguid = (uint32)atol(idS);
|
||||
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
|
||||
return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT);
|
||||
return ObjectGuid(HIGHGUID_GAMEOBJECT, data->id, lowguid);
|
||||
else
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
}
|
||||
|
||||
// unknown type?
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
std::string ChatHandler::extractPlayerNameFromLink(char* text)
|
||||
@@ -1136,7 +1136,7 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text)
|
||||
return name;
|
||||
}
|
||||
|
||||
bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/, std::string* player_name /*= NULL*/)
|
||||
bool ChatHandler::extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid /*=NULL*/, std::string* player_name /*= NULL*/)
|
||||
{
|
||||
if (args && *args)
|
||||
{
|
||||
@@ -1155,7 +1155,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe
|
||||
*player = pl;
|
||||
|
||||
// if need guid value from DB (in name case for check player existence)
|
||||
uint64 guid = !pl && (player_guid || player_name) ? sObjectMgr->GetPlayerGUIDByName(name) : 0;
|
||||
ObjectGuid guid = !pl && (player_guid || player_name) ? sObjectMgr->GetPlayerGUIDByName(name) : ObjectGuid::Empty;
|
||||
|
||||
// if allowed player guid (if no then only online players allowed)
|
||||
if (player_guid)
|
||||
@@ -1172,7 +1172,7 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe
|
||||
*player = pl;
|
||||
// if allowed player guid (if no then only online players allowed)
|
||||
if (player_guid)
|
||||
*player_guid = pl ? pl->GetGUID() : 0;
|
||||
*player_guid = pl ? pl->GetGUID() : ObjectGuid::Empty;
|
||||
|
||||
if (player_name)
|
||||
*player_name = pl ? pl->GetName() : "";
|
||||
@@ -1268,7 +1268,7 @@ std::string ChatHandler::GetNameLink(Player* chr) const
|
||||
return playerLink(chr->GetName());
|
||||
}
|
||||
|
||||
const char *CliHandler::GetTrinityString(int32 entry) const
|
||||
char const* CliHandler::GetTrinityString(uint32 entry) const
|
||||
{
|
||||
return sObjectMgr->GetTrinityStringForDBCLocale(entry);
|
||||
}
|
||||
@@ -1295,10 +1295,10 @@ bool CliHandler::needReportToTarget(Player* /*chr*/) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &player, Group* &group, uint64 &guid, bool offline)
|
||||
bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline)
|
||||
{
|
||||
player = NULL;
|
||||
guid = 0;
|
||||
player = NULL;
|
||||
guid.Clear();
|
||||
|
||||
if (cname)
|
||||
{
|
||||
|
||||
+12
-12
@@ -54,7 +54,7 @@ class ChatHandler
|
||||
virtual ~ChatHandler() { }
|
||||
|
||||
// Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders
|
||||
static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, uint64 senderGUID, uint64 receiverGUID, std::string const& message, uint8 chatTag,
|
||||
static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string const& message, uint8 chatTag,
|
||||
std::string const& senderName = "", std::string const& receiverName = "",
|
||||
uint32 achievementId = 0, bool gmMessage = false, std::string const& channelName = "",
|
||||
std::string const& addonPrefix = "");
|
||||
@@ -65,13 +65,13 @@ class ChatHandler
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual const char *GetTrinityString(int32 entry) const;
|
||||
virtual void SendSysMessage(const char *str);
|
||||
virtual char const* GetTrinityString(uint32 entry) const;
|
||||
virtual void SendSysMessage(char const* str);
|
||||
|
||||
void SendSysMessage(int32 entry);
|
||||
void PSendSysMessage(const char *format, ...) ATTR_PRINTF(2, 3);
|
||||
void PSendSysMessage(int32 entry, ...);
|
||||
std::string PGetParseString(int32 entry, ...) const;
|
||||
void SendSysMessage(uint32 entry);
|
||||
void PSendSysMessage(char const* format, ...) ATTR_PRINTF(2, 3);
|
||||
void PSendSysMessage(uint32 entry, ...);
|
||||
std::string PGetParseString(uint32 entry, ...) const;
|
||||
|
||||
bool ParseCommands(const char* text);
|
||||
|
||||
@@ -90,7 +90,7 @@ class ChatHandler
|
||||
virtual LocaleConstant GetSessionDbcLocale() const;
|
||||
virtual int GetSessionDbLocaleIndex() const;
|
||||
|
||||
bool HasLowerSecurity(Player* target, uint64 guid, bool strong = false);
|
||||
bool HasLowerSecurity(Player* target, ObjectGuid guid, bool strong = false);
|
||||
bool HasLowerSecurityAccount(WorldSession* target, uint32 account, bool strong = false);
|
||||
|
||||
void SendGlobalGMSysMessage(const char *str);
|
||||
@@ -109,12 +109,12 @@ class ChatHandler
|
||||
char* extractQuotedArg(char* args);
|
||||
|
||||
uint32 extractSpellIdFromLink(char* text);
|
||||
uint64 extractGuidFromLink(char* text);
|
||||
ObjectGuid extractGuidFromLink(char* text);
|
||||
GameTele const* extractGameTeleFromLink(char* text);
|
||||
bool GetPlayerGroupAndGUIDByName(const char* cname, Player* &player, Group* &group, uint64 &guid, bool offline = false);
|
||||
bool GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline = false);
|
||||
std::string extractPlayerNameFromLink(char* text);
|
||||
// select by arg (name/link) or in-game selection online/offline player or self if a creature is selected
|
||||
bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = NULL, std::string* player_name = NULL);
|
||||
bool extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid = NULL, std::string* player_name = NULL);
|
||||
|
||||
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; }
|
||||
std::string GetNameLink(Player* chr) const;
|
||||
@@ -148,7 +148,7 @@ class CliHandler : public ChatHandler
|
||||
explicit CliHandler(void* callbackArg, Print* zprint) : m_callbackArg(callbackArg), m_print(zprint) { }
|
||||
|
||||
// overwrite functions
|
||||
const char *GetTrinityString(int32 entry) const override;
|
||||
char const* GetTrinityString(uint32 entry) const override;
|
||||
bool isAvailable(ChatCommand const& cmd) const override;
|
||||
bool HasPermission(uint32 /*permission*/) const override { return true; }
|
||||
void SendSysMessage(const char *str) override;
|
||||
|
||||
@@ -269,7 +269,7 @@ HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const
|
||||
if (!victim)
|
||||
return NULL;
|
||||
|
||||
uint64 const guid = victim->GetGUID();
|
||||
ObjectGuid guid = victim->GetGUID();
|
||||
for (ThreatContainer::StorageType::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
{
|
||||
HostileReference* ref = (*i);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "SharedDefines.h"
|
||||
#include "LinkedReference/Reference.h"
|
||||
#include "UnitEvents.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
#include <list>
|
||||
|
||||
@@ -103,7 +104,7 @@ class HostileReference : public Reference<Unit, ThreatManager>
|
||||
|
||||
//=================================================
|
||||
|
||||
uint64 getUnitGuid() const { return iUnitGuid; }
|
||||
ObjectGuid getUnitGuid() const { return iUnitGuid; }
|
||||
|
||||
//=================================================
|
||||
// reference is not needed anymore. realy delete it !
|
||||
@@ -132,7 +133,7 @@ class HostileReference : public Reference<Unit, ThreatManager>
|
||||
private:
|
||||
float iThreat;
|
||||
float iTempThreatModifier; // used for taunt
|
||||
uint64 iUnitGuid;
|
||||
ObjectGuid iUnitGuid;
|
||||
bool iOnline;
|
||||
bool iAccessible;
|
||||
};
|
||||
|
||||
@@ -166,12 +166,15 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
case INSTANCE_INFO_DATA:
|
||||
condMeets = instance->GetData(ConditionValue1) == ConditionValue2;
|
||||
break;
|
||||
case INSTANCE_INFO_DATA64:
|
||||
condMeets = instance->GetData64(ConditionValue1) == ConditionValue2;
|
||||
case INSTANCE_INFO_GUID_DATA:
|
||||
condMeets = instance->GetGuidData(ConditionValue1) == ObjectGuid(uint64(ConditionValue2));
|
||||
break;
|
||||
case INSTANCE_INFO_BOSS_STATE:
|
||||
condMeets = instance->GetBossState(ConditionValue1) == EncounterState(ConditionValue2);
|
||||
break;
|
||||
case INSTANCE_INFO_DATA64:
|
||||
condMeets = instance->GetData64(ConditionValue1) == ConditionValue2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,8 +146,9 @@ enum RelationType
|
||||
enum InstanceInfo
|
||||
{
|
||||
INSTANCE_INFO_DATA = 0,
|
||||
INSTANCE_INFO_DATA64,
|
||||
INSTANCE_INFO_BOSS_STATE
|
||||
INSTANCE_INFO_GUID_DATA,
|
||||
INSTANCE_INFO_BOSS_STATE,
|
||||
INSTANCE_INFO_DATA64
|
||||
};
|
||||
|
||||
enum MaxConditionTargets
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define _LFG_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
namespace lfg
|
||||
{
|
||||
@@ -110,11 +111,9 @@ struct LfgLockInfoData
|
||||
|
||||
typedef std::set<uint32> LfgDungeonSet;
|
||||
typedef std::map<uint32, LfgLockInfoData> LfgLockMap;
|
||||
typedef std::map<uint64, LfgLockMap> LfgLockPartyMap;
|
||||
typedef std::set<uint64> LfgGuidSet;
|
||||
typedef std::list<uint64> LfgGuidList;
|
||||
typedef std::map<uint64, uint8> LfgRolesMap;
|
||||
typedef std::map<uint64, uint64> LfgGroupsMap;
|
||||
typedef std::map<ObjectGuid, LfgLockMap> LfgLockPartyMap;
|
||||
typedef std::map<ObjectGuid, uint8> LfgRolesMap;
|
||||
typedef std::map<ObjectGuid, ObjectGuid> LfgGroupsMap;
|
||||
|
||||
std::string ConcatenateDungeons(LfgDungeonSet const& dungeons);
|
||||
std::string GetRolesString(uint8 roles);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace lfg
|
||||
{
|
||||
|
||||
LfgGroupData::LfgGroupData(): m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NONE),
|
||||
m_Leader(0), m_Dungeon(0), m_KicksLeft(LFG_GROUP_MAX_KICKS)
|
||||
m_Leader(), m_Dungeon(0), m_KicksLeft(LFG_GROUP_MAX_KICKS)
|
||||
{ }
|
||||
|
||||
LfgGroupData::~LfgGroupData()
|
||||
@@ -54,14 +54,14 @@ void LfgGroupData::RestoreState()
|
||||
m_State = m_OldState;
|
||||
}
|
||||
|
||||
void LfgGroupData::AddPlayer(uint64 guid)
|
||||
void LfgGroupData::AddPlayer(ObjectGuid guid)
|
||||
{
|
||||
m_Players.insert(guid);
|
||||
}
|
||||
|
||||
uint8 LfgGroupData::RemovePlayer(uint64 guid)
|
||||
uint8 LfgGroupData::RemovePlayer(ObjectGuid guid)
|
||||
{
|
||||
LfgGuidSet::iterator it = m_Players.find(guid);
|
||||
GuidSet::iterator it = m_Players.find(guid);
|
||||
if (it != m_Players.end())
|
||||
m_Players.erase(it);
|
||||
return uint8(m_Players.size());
|
||||
@@ -72,7 +72,7 @@ void LfgGroupData::RemoveAllPlayers()
|
||||
m_Players.clear();
|
||||
}
|
||||
|
||||
void LfgGroupData::SetLeader(uint64 guid)
|
||||
void LfgGroupData::SetLeader(ObjectGuid guid)
|
||||
{
|
||||
m_Leader = guid;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ LfgState LfgGroupData::GetOldState() const
|
||||
return m_OldState;
|
||||
}
|
||||
|
||||
LfgGuidSet const& LfgGroupData::GetPlayers() const
|
||||
GuidSet const& LfgGroupData::GetPlayers() const
|
||||
{
|
||||
return m_Players;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ uint8 LfgGroupData::GetPlayerCount() const
|
||||
return m_Players.size();
|
||||
}
|
||||
|
||||
uint64 LfgGroupData::GetLeader() const
|
||||
ObjectGuid LfgGroupData::GetLeader() const
|
||||
{
|
||||
return m_Leader;
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ class LfgGroupData
|
||||
// General
|
||||
void SetState(LfgState state);
|
||||
void RestoreState();
|
||||
void AddPlayer(uint64 guid);
|
||||
uint8 RemovePlayer(uint64 guid);
|
||||
void AddPlayer(ObjectGuid guid);
|
||||
uint8 RemovePlayer(ObjectGuid guid);
|
||||
void RemoveAllPlayers();
|
||||
void SetLeader(uint64 guid);
|
||||
void SetLeader(ObjectGuid guid);
|
||||
|
||||
// Dungeon
|
||||
void SetDungeon(uint32 dungeon);
|
||||
@@ -56,9 +56,9 @@ class LfgGroupData
|
||||
// General
|
||||
LfgState GetState() const;
|
||||
LfgState GetOldState() const;
|
||||
LfgGuidSet const& GetPlayers() const;
|
||||
GuidSet const& GetPlayers() const;
|
||||
uint8 GetPlayerCount() const;
|
||||
uint64 GetLeader() const;
|
||||
ObjectGuid GetLeader() const;
|
||||
|
||||
// Dungeon
|
||||
uint32 GetDungeon(bool asId = true) const;
|
||||
@@ -70,8 +70,8 @@ class LfgGroupData
|
||||
// General
|
||||
LfgState m_State; ///< State if group in LFG
|
||||
LfgState m_OldState; ///< Old State
|
||||
uint64 m_Leader; ///< Leader GUID
|
||||
LfgGuidSet m_Players; ///< Players in group
|
||||
ObjectGuid m_Leader; ///< Leader GUID
|
||||
GuidSet m_Players; ///< Players in group
|
||||
// Dungeon
|
||||
uint32 m_Dungeon; ///< Dungeon entry
|
||||
// Vote Kick
|
||||
|
||||
@@ -50,15 +50,15 @@ LFGMgr::~LFGMgr()
|
||||
delete itr->second;
|
||||
}
|
||||
|
||||
void LFGMgr::_LoadFromDB(Field* fields, uint64 guid)
|
||||
void LFGMgr::_LoadFromDB(Field* fields, ObjectGuid guid)
|
||||
{
|
||||
if (!fields)
|
||||
return;
|
||||
|
||||
if (!IS_GROUP_GUID(guid))
|
||||
if (!guid.IsGroup())
|
||||
return;
|
||||
|
||||
SetLeader(guid, MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER));
|
||||
SetLeader(guid, ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32()));
|
||||
|
||||
uint32 dungeon = fields[17].GetUInt32();
|
||||
uint8 state = fields[18].GetUInt8();
|
||||
@@ -79,9 +79,9 @@ void LFGMgr::_LoadFromDB(Field* fields, uint64 guid)
|
||||
}
|
||||
}
|
||||
|
||||
void LFGMgr::_SaveToDB(uint64 guid, uint32 db_guid)
|
||||
void LFGMgr::_SaveToDB(ObjectGuid guid, uint32 db_guid)
|
||||
{
|
||||
if (!IS_GROUP_GUID(guid))
|
||||
if (!guid.IsGroup())
|
||||
return;
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
|
||||
@@ -276,7 +276,7 @@ void LFGMgr::Update(uint32 diff)
|
||||
|
||||
for (LfgRolesMap::const_iterator itRoles = roleCheck.roles.begin(); itRoles != roleCheck.roles.end(); ++itRoles)
|
||||
{
|
||||
uint64 guid = itRoles->first;
|
||||
ObjectGuid guid = itRoles->first;
|
||||
RestoreState(guid, "Remove Obsolete RoleCheck");
|
||||
SendLfgRoleCheckUpdate(guid, roleCheck);
|
||||
if (guid == roleCheck.leader)
|
||||
@@ -305,7 +305,7 @@ void LFGMgr::Update(uint32 diff)
|
||||
boot.inProgress = false;
|
||||
for (LfgAnswerContainer::const_iterator itVotes = boot.votes.begin(); itVotes != boot.votes.end(); ++itVotes)
|
||||
{
|
||||
uint64 pguid = itVotes->first;
|
||||
ObjectGuid pguid = itVotes->first;
|
||||
if (pguid != boot.victim)
|
||||
SendLfgBootProposalUpdate(pguid, boot);
|
||||
SetState(pguid, LFG_STATE_DUNGEON);
|
||||
@@ -329,12 +329,12 @@ void LFGMgr::Update(uint32 diff)
|
||||
uint32 proposalId = itProposal->first;
|
||||
LfgProposal& proposal = ProposalsStore[proposalId];
|
||||
|
||||
uint64 guid = 0;
|
||||
ObjectGuid guid;
|
||||
for (LfgProposalPlayerContainer::const_iterator itPlayers = proposal.players.begin(); itPlayers != proposal.players.end(); ++itPlayers)
|
||||
{
|
||||
guid = itPlayers->first;
|
||||
SetState(guid, LFG_STATE_PROPOSAL);
|
||||
if (uint64 gguid = GetGroup(guid))
|
||||
if (ObjectGuid gguid = GetGroup(guid))
|
||||
{
|
||||
SetState(gguid, LFG_STATE_PROPOSAL);
|
||||
SendLfgUpdateStatus(guid, LfgUpdateData(LFG_UPDATETYPE_PROPOSAL_BEGIN, GetSelectedDungeons(guid), GetComment(guid)), true);
|
||||
@@ -376,10 +376,10 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
return;
|
||||
|
||||
Group* grp = player->GetGroup();
|
||||
uint64 guid = player->GetGUID();
|
||||
uint64 gguid = grp ? grp->GetGUID() : guid;
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
ObjectGuid gguid = grp ? grp->GetGUID() : guid;
|
||||
LfgJoinResultData joinData;
|
||||
LfgGuidSet players;
|
||||
GuidSet players;
|
||||
uint32 rDungeonId = 0;
|
||||
bool isContinue = grp && grp->isLFGGroup() && GetState(gguid) != LFG_STATE_FINISHED_DUNGEON;
|
||||
|
||||
@@ -491,7 +491,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
if (joinData.result != LFG_JOIN_OK)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.join", "%u joining with %u members. Result: %u, Dungeons: %s",
|
||||
GUID_LOPART(guid), grp ? grp->GetMembersCount() : 1, joinData.result, ConcatenateDungeons(dungeons).c_str());
|
||||
guid.GetCounter(), grp ? grp->GetMembersCount() : 1, joinData.result, ConcatenateDungeons(dungeons).c_str());
|
||||
|
||||
if (!dungeons.empty()) // Only should show lockmap when have no dungeons available
|
||||
joinData.lockmap.clear();
|
||||
@@ -503,7 +503,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
|
||||
if (isRaid)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.join", "%u trying to join raid browser and it's disabled.", GUID_LOPART(guid));
|
||||
TC_LOG_DEBUG("lfg.join", "%u trying to join raid browser and it's disabled.", guid.GetCounter());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
{
|
||||
if (Player* plrg = itr->GetSource())
|
||||
{
|
||||
uint64 pguid = plrg->GetGUID();
|
||||
ObjectGuid pguid = plrg->GetGUID();
|
||||
plrg->GetSession()->SendLfgUpdateStatus(updateData, true);
|
||||
SetState(pguid, LFG_STATE_ROLECHECK);
|
||||
if (!isContinue)
|
||||
@@ -569,7 +569,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
debugNames.append(player->GetName());
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("lfg.join", "%u joined (%s), Members: %s. Dungeons (%u): %s", GUID_LOPART(guid),
|
||||
TC_LOG_DEBUG("lfg.join", "%u joined (%s), Members: %s. Dungeons (%u): %s", guid.GetCounter(),
|
||||
grp ? "group" : "player", debugNames.c_str(), uint32(dungeons.size()), ConcatenateDungeons(dungeons).c_str());
|
||||
}
|
||||
|
||||
@@ -579,11 +579,11 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
|
||||
@param[in] guid Player or group guid
|
||||
*/
|
||||
void LFGMgr::LeaveLfg(uint64 guid)
|
||||
void LFGMgr::LeaveLfg(ObjectGuid guid)
|
||||
{
|
||||
uint64 gguid = IS_GROUP_GUID(guid) ? guid : GetGroup(guid);
|
||||
ObjectGuid gguid = guid.IsGroup() ? guid : GetGroup(guid);
|
||||
|
||||
TC_LOG_DEBUG("lfg.leave", "%u left (%s)", GUID_LOPART(guid), guid == gguid ? "group" : "player");
|
||||
TC_LOG_DEBUG("lfg.leave", "%u left (%s)", guid.GetCounter(), guid == gguid ? "group" : "player");
|
||||
|
||||
LfgState state = GetState(guid);
|
||||
switch (state)
|
||||
@@ -594,8 +594,8 @@ void LFGMgr::LeaveLfg(uint64 guid)
|
||||
LFGQueue& queue = GetQueue(gguid);
|
||||
queue.RemoveFromQueue(gguid);
|
||||
SetState(gguid, LFG_STATE_NONE);
|
||||
const LfgGuidSet& players = GetPlayers(gguid);
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
GuidSet const& players = GetPlayers(gguid);
|
||||
for (GuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
SetState(*it, LFG_STATE_NONE);
|
||||
SendLfgUpdateStatus(*it, LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE), true);
|
||||
@@ -617,7 +617,7 @@ void LFGMgr::LeaveLfg(uint64 guid)
|
||||
{
|
||||
// Remove from Proposals
|
||||
LfgProposalContainer::iterator it = ProposalsStore.begin();
|
||||
uint64 pguid = gguid == guid ? GetLeader(gguid) : guid;
|
||||
ObjectGuid pguid = gguid == guid ? GetLeader(gguid) : guid;
|
||||
while (it != ProposalsStore.end())
|
||||
{
|
||||
LfgProposalPlayerContainer::iterator itPlayer = it->second.players.find(pguid);
|
||||
@@ -654,7 +654,7 @@ void LFGMgr::LeaveLfg(uint64 guid)
|
||||
@param[in] guid Player guid (0 = rolecheck failed)
|
||||
@param[in] roles Player selected roles
|
||||
*/
|
||||
void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* = PLAYER_ROLE_NONE */)
|
||||
void LFGMgr::UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid /* = ObjectGuid::Empty */, uint8 roles /* = PLAYER_ROLE_NONE */)
|
||||
{
|
||||
if (!gguid)
|
||||
return;
|
||||
@@ -701,7 +701,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
|
||||
LfgJoinResultData joinData = LfgJoinResultData(joinResult, roleCheck.state);
|
||||
for (LfgRolesMap::const_iterator it = roleCheck.roles.begin(); it != roleCheck.roles.end(); ++it)
|
||||
{
|
||||
uint64 pguid = it->first;
|
||||
ObjectGuid pguid = it->first;
|
||||
|
||||
if (sendRoleChosen)
|
||||
SendLfgRoleChosen(pguid, guid, roles);
|
||||
@@ -746,12 +746,12 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
|
||||
@param[in] players Set of players to check their dungeon restrictions
|
||||
@param[out] lockMap Map of players Lock status info of given dungeons (Empty if dungeons is not empty)
|
||||
*/
|
||||
void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, LfgGuidSet const& players, LfgLockPartyMap& lockMap)
|
||||
void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, GuidSet const& players, LfgLockPartyMap& lockMap)
|
||||
{
|
||||
lockMap.clear();
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it)
|
||||
for (GuidSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it)
|
||||
{
|
||||
uint64 guid = (*it);
|
||||
ObjectGuid guid = (*it);
|
||||
LfgLockMap const& cachedLockMap = GetLockedDungeons(guid);
|
||||
for (LfgLockMap::const_iterator it2 = cachedLockMap.begin(); it2 != cachedLockMap.end() && !dungeons.empty(); ++it2)
|
||||
{
|
||||
@@ -847,12 +847,12 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap& groles, bool removeLeaderFlag /*= true
|
||||
*/
|
||||
void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
|
||||
{
|
||||
LfgGuidList players;
|
||||
LfgGuidList playersToTeleport;
|
||||
GuidList players;
|
||||
GuidList playersToTeleport;
|
||||
|
||||
for (LfgProposalPlayerContainer::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it)
|
||||
{
|
||||
uint64 guid = it->first;
|
||||
ObjectGuid guid = it->first;
|
||||
if (guid == proposal.leader)
|
||||
players.push_front(guid);
|
||||
else
|
||||
@@ -866,10 +866,10 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
|
||||
LFGDungeonData const* dungeon = GetLFGDungeon(proposal.dungeonId);
|
||||
ASSERT(dungeon);
|
||||
|
||||
Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(GUID_LOPART(proposal.group)) : NULL;
|
||||
for (LfgGuidList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(proposal.group.GetCounter()) : NULL;
|
||||
for (GuidList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
uint64 pguid = (*it);
|
||||
ObjectGuid pguid = (*it);
|
||||
Player* player = ObjectAccessor::FindPlayer(pguid);
|
||||
if (!player)
|
||||
continue;
|
||||
@@ -883,7 +883,7 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
|
||||
grp = new Group();
|
||||
grp->ConvertToLFG();
|
||||
grp->Create(player);
|
||||
uint64 gguid = grp->GetGUID();
|
||||
ObjectGuid gguid = grp->GetGUID();
|
||||
SetState(gguid, LFG_STATE_PROPOSAL);
|
||||
sGroupMgr->AddGroup(grp);
|
||||
}
|
||||
@@ -899,14 +899,14 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
|
||||
|
||||
ASSERT(grp);
|
||||
grp->SetDungeonDifficulty(Difficulty(dungeon->difficulty));
|
||||
uint64 gguid = grp->GetGUID();
|
||||
ObjectGuid gguid = grp->GetGUID();
|
||||
SetDungeon(gguid, dungeon->Entry());
|
||||
SetState(gguid, LFG_STATE_DUNGEON);
|
||||
|
||||
_SaveToDB(gguid, grp->GetDbStoreId());
|
||||
|
||||
// Teleport Player
|
||||
for (LfgGuidList::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it)
|
||||
for (GuidList::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(*it))
|
||||
TeleportPlayer(player, false);
|
||||
|
||||
@@ -928,7 +928,7 @@ uint32 LFGMgr::AddProposal(LfgProposal& proposal)
|
||||
@param[in] guid Player guid to update answer
|
||||
@param[in] accept Player answer
|
||||
*/
|
||||
void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
||||
void LFGMgr::UpdateProposal(uint32 proposalId, ObjectGuid guid, bool accept)
|
||||
{
|
||||
// Check if the proposal exists
|
||||
LfgProposalContainer::iterator itProposal = ProposalsStore.find(proposalId);
|
||||
@@ -945,7 +945,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
||||
LfgProposalPlayer& player = itProposalPlayer->second;
|
||||
player.accept = LfgAnswer(accept);
|
||||
|
||||
TC_LOG_DEBUG("lfg.proposal.update", "Player %u, Proposal %u, Selection: %u", GUID_LOPART(guid), proposalId, accept);
|
||||
TC_LOG_DEBUG("lfg.proposal.update", "Player %u, Proposal %u, Selection: %u", guid.GetCounter(), proposalId, accept);
|
||||
if (!accept)
|
||||
{
|
||||
RemoveProposal(itProposal, LFG_UPDATETYPE_PROPOSAL_DECLINED);
|
||||
@@ -974,8 +974,8 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
||||
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND);
|
||||
for (LfgProposalPlayerContainer::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it)
|
||||
{
|
||||
uint64 pguid = it->first;
|
||||
uint64 gguid = it->second.group;
|
||||
ObjectGuid pguid = it->first;
|
||||
ObjectGuid gguid = it->second.group;
|
||||
uint32 dungeonId = (*GetSelectedDungeons(pguid).begin());
|
||||
int32 waitTime = -1;
|
||||
if (sendUpdate)
|
||||
@@ -1018,7 +1018,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
||||
}
|
||||
|
||||
// Remove players/groups from Queue
|
||||
for (LfgGuidList::const_iterator it = proposal.queues.begin(); it != proposal.queues.end(); ++it)
|
||||
for (GuidList::const_iterator it = proposal.queues.begin(); it != proposal.queues.end(); ++it)
|
||||
queue.RemoveFromQueue(*it);
|
||||
|
||||
MakeNewGroup(proposal);
|
||||
@@ -1044,13 +1044,13 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
it->second.accept = LFG_ANSWER_DENY;
|
||||
|
||||
// Mark players/groups to be removed
|
||||
LfgGuidSet toRemove;
|
||||
GuidSet toRemove;
|
||||
for (LfgProposalPlayerContainer::iterator it = proposal.players.begin(); it != proposal.players.end(); ++it)
|
||||
{
|
||||
if (it->second.accept == LFG_ANSWER_AGREE)
|
||||
continue;
|
||||
|
||||
uint64 guid = it->second.group ? it->second.group : it->first;
|
||||
ObjectGuid guid = it->second.group ? it->second.group : it->first;
|
||||
// Player didn't accept or still pending when no secs left
|
||||
if (it->second.accept == LFG_ANSWER_DENY || type == LFG_UPDATETYPE_PROPOSAL_FAILED)
|
||||
{
|
||||
@@ -1062,8 +1062,8 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
// Notify players
|
||||
for (LfgProposalPlayerContainer::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it)
|
||||
{
|
||||
uint64 guid = it->first;
|
||||
uint64 gguid = it->second.group ? it->second.group : guid;
|
||||
ObjectGuid guid = it->first;
|
||||
ObjectGuid gguid = it->second.group ? it->second.group : guid;
|
||||
|
||||
SendLfgUpdateProposal(guid, proposal);
|
||||
|
||||
@@ -1073,12 +1073,12 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
if (it->second.accept == LFG_ANSWER_DENY)
|
||||
{
|
||||
updateData.updateType = type;
|
||||
TC_LOG_DEBUG("lfg.proposal.remove", "%u didn't accept. Removing from queue and compatible cache", GUID_LOPART(guid));
|
||||
TC_LOG_DEBUG("lfg.proposal.remove", "%u didn't accept. Removing from queue and compatible cache", guid.GetCounter());
|
||||
}
|
||||
else
|
||||
{
|
||||
updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE;
|
||||
TC_LOG_DEBUG("lfg.proposal.remove", "%u in same group that someone that didn't accept. Removing from queue and compatible cache", GUID_LOPART(guid));
|
||||
TC_LOG_DEBUG("lfg.proposal.remove", "%u in same group that someone that didn't accept. Removing from queue and compatible cache", guid.GetCounter());
|
||||
}
|
||||
|
||||
RestoreState(guid, "Proposal Fail (didn't accepted or in group with someone that didn't accept");
|
||||
@@ -1092,7 +1092,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.proposal.remove", "Readding %u to queue.", GUID_LOPART(guid));
|
||||
TC_LOG_DEBUG("lfg.proposal.remove", "Readding %u to queue.", guid.GetCounter());
|
||||
SetState(guid, LFG_STATE_QUEUED);
|
||||
if (gguid != guid)
|
||||
{
|
||||
@@ -1106,17 +1106,17 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
|
||||
LFGQueue& queue = GetQueue(proposal.players.begin()->first);
|
||||
// Remove players/groups from queue
|
||||
for (LfgGuidSet::const_iterator it = toRemove.begin(); it != toRemove.end(); ++it)
|
||||
for (GuidSet::const_iterator it = toRemove.begin(); it != toRemove.end(); ++it)
|
||||
{
|
||||
uint64 guid = *it;
|
||||
ObjectGuid guid = *it;
|
||||
queue.RemoveFromQueue(guid);
|
||||
proposal.queues.remove(guid);
|
||||
}
|
||||
|
||||
// Readd to queue
|
||||
for (LfgGuidList::const_iterator it = proposal.queues.begin(); it != proposal.queues.end(); ++it)
|
||||
for (GuidList::const_iterator it = proposal.queues.begin(); it != proposal.queues.end(); ++it)
|
||||
{
|
||||
uint64 guid = *it;
|
||||
ObjectGuid guid = *it;
|
||||
queue.AddToQueue(guid);
|
||||
}
|
||||
|
||||
@@ -1131,7 +1131,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate
|
||||
@param[in] victim Victim guid
|
||||
@param[in] reason Kick reason
|
||||
*/
|
||||
void LFGMgr::InitBoot(uint64 gguid, uint64 kicker, uint64 victim, std::string const& reason)
|
||||
void LFGMgr::InitBoot(ObjectGuid gguid, ObjectGuid kicker, ObjectGuid victim, std::string const& reason)
|
||||
{
|
||||
SetState(gguid, LFG_STATE_BOOT);
|
||||
|
||||
@@ -1141,12 +1141,12 @@ void LFGMgr::InitBoot(uint64 gguid, uint64 kicker, uint64 victim, std::string co
|
||||
boot.reason = reason;
|
||||
boot.victim = victim;
|
||||
|
||||
LfgGuidSet const& players = GetPlayers(gguid);
|
||||
GuidSet const& players = GetPlayers(gguid);
|
||||
|
||||
// Set votes
|
||||
for (LfgGuidSet::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
for (GuidSet::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
uint64 guid = (*itr);
|
||||
ObjectGuid guid = (*itr);
|
||||
SetState(guid, LFG_STATE_BOOT);
|
||||
boot.votes[guid] = LFG_ANSWER_PENDING;
|
||||
}
|
||||
@@ -1155,7 +1155,7 @@ void LFGMgr::InitBoot(uint64 gguid, uint64 kicker, uint64 victim, std::string co
|
||||
boot.votes[kicker] = LFG_ANSWER_AGREE; // Kicker auto vote YES
|
||||
|
||||
// Notify players
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
for (GuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
SendLfgBootProposalUpdate(*it, boot);
|
||||
}
|
||||
|
||||
@@ -1165,9 +1165,9 @@ void LFGMgr::InitBoot(uint64 gguid, uint64 kicker, uint64 victim, std::string co
|
||||
@param[in] guid Player who has answered
|
||||
@param[in] player answer
|
||||
*/
|
||||
void LFGMgr::UpdateBoot(uint64 guid, bool accept)
|
||||
void LFGMgr::UpdateBoot(ObjectGuid guid, bool accept)
|
||||
{
|
||||
uint64 gguid = GetGroup(guid);
|
||||
ObjectGuid gguid = GetGroup(guid);
|
||||
if (!gguid)
|
||||
return;
|
||||
|
||||
@@ -1202,7 +1202,7 @@ void LFGMgr::UpdateBoot(uint64 guid, bool accept)
|
||||
boot.inProgress = false;
|
||||
for (LfgAnswerContainer::const_iterator itVotes = boot.votes.begin(); itVotes != boot.votes.end(); ++itVotes)
|
||||
{
|
||||
uint64 pguid = itVotes->first;
|
||||
ObjectGuid pguid = itVotes->first;
|
||||
if (pguid != boot.victim)
|
||||
{
|
||||
SetState(pguid, LFG_STATE_DUNGEON);
|
||||
@@ -1213,7 +1213,7 @@ void LFGMgr::UpdateBoot(uint64 guid, bool accept)
|
||||
SetState(gguid, LFG_STATE_DUNGEON);
|
||||
if (agreeNum == LFG_GROUP_KICK_VOTES_NEEDED) // Vote passed - Kick player
|
||||
{
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(GUID_LOPART(gguid)))
|
||||
if (Group* group = sGroupMgr->GetGroupByGUID(gguid.GetCounter()))
|
||||
Player::RemoveFromGroup(group, boot.victim, GROUP_REMOVEMETHOD_KICK_LFG);
|
||||
DecreaseKicksLeft(gguid);
|
||||
}
|
||||
@@ -1320,30 +1320,30 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
@param[in] guid Group guid
|
||||
@param[in] dungeonId Dungeonid
|
||||
*/
|
||||
void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
|
||||
void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId)
|
||||
{
|
||||
uint32 gDungeonId = GetDungeon(gguid);
|
||||
if (gDungeonId != dungeonId)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group %u finished dungeon %u but queued for %u", GUID_LOPART(gguid), dungeonId, gDungeonId);
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group %u finished dungeon %u but queued for %u", gguid.GetCounter(), dungeonId, gDungeonId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON) // Shouldn't happen. Do not reward multiple times
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u already rewarded", GUID_LOPART(gguid));
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u already rewarded", gguid.GetCounter());
|
||||
return;
|
||||
}
|
||||
|
||||
SetState(gguid, LFG_STATE_FINISHED_DUNGEON);
|
||||
|
||||
const LfgGuidSet& players = GetPlayers(gguid);
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
GuidSet const& players = GetPlayers(gguid);
|
||||
for (GuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
uint64 guid = (*it);
|
||||
ObjectGuid guid = (*it);
|
||||
if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u already rewarded", GUID_LOPART(gguid), GUID_LOPART(guid));
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u already rewarded", gguid.GetCounter(), guid.GetCounter());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1359,14 +1359,14 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
|
||||
|
||||
if (!dungeon || (dungeon->type != LFG_TYPE_RANDOM && !dungeon->seasonal))
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u dungeon %u is not random or seasonal", GUID_LOPART(gguid), GUID_LOPART(guid), rDungeonId);
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u dungeon %u is not random or seasonal", gguid.GetCounter(), guid.GetCounter(), rDungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player || !player->IsInWorld())
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u not found in world", GUID_LOPART(gguid), GUID_LOPART(guid));
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u not found in world", gguid.GetCounter(), guid.GetCounter());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1375,7 +1375,7 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
|
||||
|
||||
if (player->GetMapId() != mapId)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u is in map %u and should be in %u to get reward", GUID_LOPART(gguid), GUID_LOPART(guid), player->GetMapId(), mapId);
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u is in map %u and should be in %u to get reward", gguid.GetCounter(), guid.GetCounter(), player->GetMapId(), mapId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1406,7 +1406,7 @@ void LFGMgr::FinishDungeon(uint64 gguid, const uint32 dungeonId)
|
||||
}
|
||||
|
||||
// Give rewards
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u done dungeon %u, %s previously done.", GUID_LOPART(gguid), GUID_LOPART(guid), GetDungeon(gguid), done? " " : " not");
|
||||
TC_LOG_DEBUG("lfg.dungeon.finish", "Group: %u, Player: %u done dungeon %u, %s previously done.", gguid.GetCounter(), guid.GetCounter(), GetDungeon(gguid), done? " " : " not");
|
||||
LfgPlayerRewardData data = LfgPlayerRewardData(dungeon->Entry(), GetDungeon(gguid, false), done, quest);
|
||||
player->GetSession()->SendLfgPlayerReward(data);
|
||||
}
|
||||
@@ -1466,48 +1466,48 @@ LfgType LFGMgr::GetDungeonType(uint32 dungeonId)
|
||||
return LfgType(dungeon->type);
|
||||
}
|
||||
|
||||
LfgState LFGMgr::GetState(uint64 guid)
|
||||
LfgState LFGMgr::GetState(ObjectGuid guid)
|
||||
{
|
||||
LfgState state;
|
||||
if (IS_GROUP_GUID(guid))
|
||||
if (guid.IsGroup())
|
||||
{
|
||||
state = GroupsStore[guid].GetState();
|
||||
TC_LOG_TRACE("lfg.data.group.state.get", "Group: %u, State: %u", GUID_LOPART(guid), state);
|
||||
TC_LOG_TRACE("lfg.data.group.state.get", "Group: %u, State: %u", guid.GetCounter(), state);
|
||||
}
|
||||
else
|
||||
{
|
||||
state = PlayersStore[guid].GetState();
|
||||
TC_LOG_TRACE("lfg.data.player.state.get", "Player: %u, State: %u", GUID_LOPART(guid), state);
|
||||
TC_LOG_TRACE("lfg.data.player.state.get", "Player: %u, State: %u", guid.GetCounter(), state);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
LfgState LFGMgr::GetOldState(uint64 guid)
|
||||
LfgState LFGMgr::GetOldState(ObjectGuid guid)
|
||||
{
|
||||
LfgState state;
|
||||
if (IS_GROUP_GUID(guid))
|
||||
if (guid.IsGroup())
|
||||
{
|
||||
state = GroupsStore[guid].GetOldState();
|
||||
TC_LOG_TRACE("lfg.data.group.oldstate.get", "Group: %u, Old state: %u", GUID_LOPART(guid), state);
|
||||
TC_LOG_TRACE("lfg.data.group.oldstate.get", "Group: %u, Old state: %u", guid.GetCounter(), state);
|
||||
}
|
||||
else
|
||||
{
|
||||
state = PlayersStore[guid].GetOldState();
|
||||
TC_LOG_TRACE("lfg.data.player.oldstate.get", "Player: %u, Old state: %u", GUID_LOPART(guid), state);
|
||||
TC_LOG_TRACE("lfg.data.player.oldstate.get", "Player: %u, Old state: %u", guid.GetCounter(), state);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true */)
|
||||
uint32 LFGMgr::GetDungeon(ObjectGuid guid, bool asId /*= true */)
|
||||
{
|
||||
uint32 dungeon = GroupsStore[guid].GetDungeon(asId);
|
||||
TC_LOG_TRACE("lfg.data.group.dungeon.get", "Group: %u, asId: %u, Dungeon: %u", GUID_LOPART(guid), asId, dungeon);
|
||||
TC_LOG_TRACE("lfg.data.group.dungeon.get", "Group: %u, asId: %u, Dungeon: %u", guid.GetCounter(), asId, dungeon);
|
||||
return dungeon;
|
||||
}
|
||||
|
||||
uint32 LFGMgr::GetDungeonMapId(uint64 guid)
|
||||
uint32 LFGMgr::GetDungeonMapId(ObjectGuid guid)
|
||||
{
|
||||
uint32 dungeonId = GroupsStore[guid].GetDungeon(true);
|
||||
uint32 mapId = 0;
|
||||
@@ -1515,38 +1515,38 @@ uint32 LFGMgr::GetDungeonMapId(uint64 guid)
|
||||
if (LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId))
|
||||
mapId = dungeon->map;
|
||||
|
||||
TC_LOG_TRACE("lfg.data.group.dungeon.map", "Group: %u, MapId: %u (DungeonId: %u)", GUID_LOPART(guid), mapId, dungeonId);
|
||||
TC_LOG_TRACE("lfg.data.group.dungeon.map", "Group: %u, MapId: %u (DungeonId: %u)", guid.GetCounter(), mapId, dungeonId);
|
||||
|
||||
return mapId;
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetRoles(uint64 guid)
|
||||
uint8 LFGMgr::GetRoles(ObjectGuid guid)
|
||||
{
|
||||
uint8 roles = PlayersStore[guid].GetRoles();
|
||||
TC_LOG_TRACE("lfg.data.player.role.get", "Player: %u, Role: %u", GUID_LOPART(guid), roles);
|
||||
TC_LOG_TRACE("lfg.data.player.role.get", "Player: %u, Role: %u", guid.GetCounter(), roles);
|
||||
return roles;
|
||||
}
|
||||
|
||||
const std::string& LFGMgr::GetComment(uint64 guid)
|
||||
const std::string& LFGMgr::GetComment(ObjectGuid guid)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.comment.get", "Player: %u, Comment: %s", GUID_LOPART(guid), PlayersStore[guid].GetComment().c_str());
|
||||
TC_LOG_TRACE("lfg.data.player.comment.get", "Player: %u, Comment: %s", guid.GetCounter(), PlayersStore[guid].GetComment().c_str());
|
||||
return PlayersStore[guid].GetComment();
|
||||
}
|
||||
|
||||
LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid)
|
||||
LfgDungeonSet const& LFGMgr::GetSelectedDungeons(ObjectGuid guid)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.dungeons.selected.get", "Player: %u, Selected Dungeons: %s", GUID_LOPART(guid), ConcatenateDungeons(PlayersStore[guid].GetSelectedDungeons()).c_str());
|
||||
TC_LOG_TRACE("lfg.data.player.dungeons.selected.get", "Player: %u, Selected Dungeons: %s", guid.GetCounter(), ConcatenateDungeons(PlayersStore[guid].GetSelectedDungeons()).c_str());
|
||||
return PlayersStore[guid].GetSelectedDungeons();
|
||||
}
|
||||
|
||||
LfgLockMap const LFGMgr::GetLockedDungeons(uint64 guid)
|
||||
LfgLockMap const LFGMgr::GetLockedDungeons(ObjectGuid guid)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.dungeons.locked.get", "Player: %u, LockedDungeons.", GUID_LOPART(guid));
|
||||
TC_LOG_TRACE("lfg.data.player.dungeons.locked.get", "Player: %u, LockedDungeons.", guid.GetCounter());
|
||||
LfgLockMap lock;
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player)
|
||||
{
|
||||
TC_LOG_WARN("lfg.data.player.dungeons.locked.get", "Player: %u not ingame while retrieving his LockedDungeons.", GUID_LOPART(guid));
|
||||
TC_LOG_WARN("lfg.data.player.dungeons.locked.get", "Player: %u not ingame while retrieving his LockedDungeons.", guid.GetCounter());
|
||||
return lock;
|
||||
}
|
||||
|
||||
@@ -1609,20 +1609,20 @@ LfgLockMap const LFGMgr::GetLockedDungeons(uint64 guid)
|
||||
return lock;
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetKicksLeft(uint64 guid)
|
||||
uint8 LFGMgr::GetKicksLeft(ObjectGuid guid)
|
||||
{
|
||||
uint8 kicks = GroupsStore[guid].GetKicksLeft();
|
||||
TC_LOG_TRACE("lfg.data.group.kickleft.get", "Group: %u, Kicks left: %u", GUID_LOPART(guid), kicks);
|
||||
TC_LOG_TRACE("lfg.data.group.kickleft.get", "Group: %u, Kicks left: %u", guid.GetCounter(), kicks);
|
||||
return kicks;
|
||||
}
|
||||
|
||||
void LFGMgr::RestoreState(uint64 guid, char const* debugMsg)
|
||||
void LFGMgr::RestoreState(ObjectGuid guid, char const* debugMsg)
|
||||
{
|
||||
if (IS_GROUP_GUID(guid))
|
||||
if (guid.IsGroup())
|
||||
{
|
||||
LfgGroupData& data = GroupsStore[guid];
|
||||
TC_LOG_TRACE("lfg.data.group.state.restore", "Group: %u (%s), State: %s, Old state: %s",
|
||||
GUID_LOPART(guid), debugMsg, GetStateString(data.GetState()).c_str(),
|
||||
guid.GetCounter(), debugMsg, GetStateString(data.GetState()).c_str(),
|
||||
GetStateString(data.GetOldState()).c_str());
|
||||
|
||||
data.RestoreState();
|
||||
@@ -1631,20 +1631,20 @@ void LFGMgr::RestoreState(uint64 guid, char const* debugMsg)
|
||||
{
|
||||
LfgPlayerData& data = PlayersStore[guid];
|
||||
TC_LOG_TRACE("lfg.data.player.state.restore", "Player: %u (%s), State: %s, Old state: %s",
|
||||
GUID_LOPART(guid), debugMsg, GetStateString(data.GetState()).c_str(),
|
||||
guid.GetCounter(), debugMsg, GetStateString(data.GetState()).c_str(),
|
||||
GetStateString(data.GetOldState()).c_str());
|
||||
|
||||
data.RestoreState();
|
||||
}
|
||||
}
|
||||
|
||||
void LFGMgr::SetState(uint64 guid, LfgState state)
|
||||
void LFGMgr::SetState(ObjectGuid guid, LfgState state)
|
||||
{
|
||||
if (IS_GROUP_GUID(guid))
|
||||
if (guid.IsGroup())
|
||||
{
|
||||
LfgGroupData& data = GroupsStore[guid];
|
||||
TC_LOG_TRACE("lfg.data.group.state.set", "Group: %u, New state: %s, Previous: %s, Old state: %s",
|
||||
GUID_LOPART(guid), GetStateString(state).c_str(), GetStateString(data.GetState()).c_str(),
|
||||
guid.GetCounter(), GetStateString(state).c_str(), GetStateString(data.GetState()).c_str(),
|
||||
GetStateString(data.GetOldState()).c_str());
|
||||
|
||||
data.SetState(state);
|
||||
@@ -1653,64 +1653,64 @@ void LFGMgr::SetState(uint64 guid, LfgState state)
|
||||
{
|
||||
LfgPlayerData& data = PlayersStore[guid];
|
||||
TC_LOG_TRACE("lfg.data.player.state.set", "Player: %u, New state: %s, Previous: %s, OldState: %s",
|
||||
GUID_LOPART(guid), GetStateString(state).c_str(), GetStateString(data.GetState()).c_str(),
|
||||
guid.GetCounter(), GetStateString(state).c_str(), GetStateString(data.GetState()).c_str(),
|
||||
GetStateString(data.GetOldState()).c_str());
|
||||
|
||||
data.SetState(state);
|
||||
}
|
||||
}
|
||||
|
||||
void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon)
|
||||
void LFGMgr::SetDungeon(ObjectGuid guid, uint32 dungeon)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.group.dungeon.set", "Group: %u, Dungeon: %u", GUID_LOPART(guid), dungeon);
|
||||
TC_LOG_TRACE("lfg.data.group.dungeon.set", "Group: %u, Dungeon: %u", guid.GetCounter(), dungeon);
|
||||
GroupsStore[guid].SetDungeon(dungeon);
|
||||
}
|
||||
|
||||
void LFGMgr::SetRoles(uint64 guid, uint8 roles)
|
||||
void LFGMgr::SetRoles(ObjectGuid guid, uint8 roles)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.role.set", "Player: %u, Roles: %u", GUID_LOPART(guid), roles);
|
||||
TC_LOG_TRACE("lfg.data.player.role.set", "Player: %u, Roles: %u", guid.GetCounter(), roles);
|
||||
PlayersStore[guid].SetRoles(roles);
|
||||
}
|
||||
|
||||
void LFGMgr::SetComment(uint64 guid, std::string const& comment)
|
||||
void LFGMgr::SetComment(ObjectGuid guid, std::string const& comment)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.comment.set", "Player: %u, Comment: %s", GUID_LOPART(guid), comment.c_str());
|
||||
TC_LOG_TRACE("lfg.data.player.comment.set", "Player: %u, Comment: %s", guid.GetCounter(), comment.c_str());
|
||||
PlayersStore[guid].SetComment(comment);
|
||||
}
|
||||
|
||||
void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons)
|
||||
void LFGMgr::SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const& dungeons)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.dungeon.selected.set", "Player: %u, Dungeons: %s", GUID_LOPART(guid), ConcatenateDungeons(dungeons).c_str());
|
||||
TC_LOG_TRACE("lfg.data.player.dungeon.selected.set", "Player: %u, Dungeons: %s", guid.GetCounter(), ConcatenateDungeons(dungeons).c_str());
|
||||
PlayersStore[guid].SetSelectedDungeons(dungeons);
|
||||
}
|
||||
|
||||
void LFGMgr::DecreaseKicksLeft(uint64 guid)
|
||||
void LFGMgr::DecreaseKicksLeft(ObjectGuid guid)
|
||||
{
|
||||
GroupsStore[guid].DecreaseKicksLeft();
|
||||
TC_LOG_TRACE("lfg.data.group.kicksleft.decrease", "Group: %u, Kicks: %u", GUID_LOPART(guid), GroupsStore[guid].GetKicksLeft());
|
||||
TC_LOG_TRACE("lfg.data.group.kicksleft.decrease", "Group: %u, Kicks: %u", guid.GetCounter(), GroupsStore[guid].GetKicksLeft());
|
||||
}
|
||||
|
||||
void LFGMgr::RemovePlayerData(uint64 guid)
|
||||
void LFGMgr::RemovePlayerData(ObjectGuid guid)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.player.remove", "Player: %u", GUID_LOPART(guid));
|
||||
TC_LOG_TRACE("lfg.data.player.remove", "Player: %u", guid.GetCounter());
|
||||
LfgPlayerDataContainer::iterator it = PlayersStore.find(guid);
|
||||
if (it != PlayersStore.end())
|
||||
PlayersStore.erase(it);
|
||||
}
|
||||
|
||||
void LFGMgr::RemoveGroupData(uint64 guid)
|
||||
void LFGMgr::RemoveGroupData(ObjectGuid guid)
|
||||
{
|
||||
TC_LOG_TRACE("lfg.data.group.remove", "Group: %u", GUID_LOPART(guid));
|
||||
TC_LOG_TRACE("lfg.data.group.remove", "Group: %u", guid.GetCounter());
|
||||
LfgGroupDataContainer::iterator it = GroupsStore.find(guid);
|
||||
if (it == GroupsStore.end())
|
||||
return;
|
||||
|
||||
LfgState state = GetState(guid);
|
||||
// If group is being formed after proposal success do nothing more
|
||||
LfgGuidSet const& players = it->second.GetPlayers();
|
||||
for (uint64 playerGUID : players)
|
||||
GuidSet const& players = it->second.GetPlayers();
|
||||
for (ObjectGuid playerGUID : players)
|
||||
{
|
||||
SetGroup(playerGUID, 0);
|
||||
SetGroup(playerGUID, ObjectGuid::Empty);
|
||||
if (state != LFG_STATE_PROPOSAL)
|
||||
{
|
||||
SetState(playerGUID, LFG_STATE_NONE);
|
||||
@@ -1720,29 +1720,29 @@ void LFGMgr::RemoveGroupData(uint64 guid)
|
||||
GroupsStore.erase(it);
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetTeam(uint64 guid)
|
||||
uint8 LFGMgr::GetTeam(ObjectGuid guid)
|
||||
{
|
||||
uint8 team = PlayersStore[guid].GetTeam();
|
||||
TC_LOG_TRACE("lfg.data.player.team.get", "Player: %u, Team: %u", GUID_LOPART(guid), team);
|
||||
TC_LOG_TRACE("lfg.data.player.team.get", "Player: %u, Team: %u", guid.GetCounter(), team);
|
||||
return team;
|
||||
}
|
||||
|
||||
uint8 LFGMgr::RemovePlayerFromGroup(uint64 gguid, uint64 guid)
|
||||
uint8 LFGMgr::RemovePlayerFromGroup(ObjectGuid gguid, ObjectGuid guid)
|
||||
{
|
||||
return GroupsStore[gguid].RemovePlayer(guid);
|
||||
}
|
||||
|
||||
void LFGMgr::AddPlayerToGroup(uint64 gguid, uint64 guid)
|
||||
void LFGMgr::AddPlayerToGroup(ObjectGuid gguid, ObjectGuid guid)
|
||||
{
|
||||
GroupsStore[gguid].AddPlayer(guid);
|
||||
}
|
||||
|
||||
void LFGMgr::SetLeader(uint64 gguid, uint64 leader)
|
||||
void LFGMgr::SetLeader(ObjectGuid gguid, ObjectGuid leader)
|
||||
{
|
||||
GroupsStore[gguid].SetLeader(leader);
|
||||
}
|
||||
|
||||
void LFGMgr::SetTeam(uint64 guid, uint8 team)
|
||||
void LFGMgr::SetTeam(ObjectGuid guid, uint8 team)
|
||||
{
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
team = 0;
|
||||
@@ -1750,93 +1750,91 @@ void LFGMgr::SetTeam(uint64 guid, uint8 team)
|
||||
PlayersStore[guid].SetTeam(team);
|
||||
}
|
||||
|
||||
uint64 LFGMgr::GetGroup(uint64 guid)
|
||||
ObjectGuid LFGMgr::GetGroup(ObjectGuid guid)
|
||||
{
|
||||
return PlayersStore[guid].GetGroup();
|
||||
}
|
||||
|
||||
void LFGMgr::SetGroup(uint64 guid, uint64 group)
|
||||
void LFGMgr::SetGroup(ObjectGuid guid, ObjectGuid group)
|
||||
{
|
||||
PlayersStore[guid].SetGroup(group);
|
||||
}
|
||||
|
||||
LfgGuidSet const& LFGMgr::GetPlayers(uint64 guid)
|
||||
GuidSet const& LFGMgr::GetPlayers(ObjectGuid guid)
|
||||
{
|
||||
return GroupsStore[guid].GetPlayers();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetPlayerCount(uint64 guid)
|
||||
uint8 LFGMgr::GetPlayerCount(ObjectGuid guid)
|
||||
{
|
||||
return GroupsStore[guid].GetPlayerCount();
|
||||
}
|
||||
|
||||
uint64 LFGMgr::GetLeader(uint64 guid)
|
||||
ObjectGuid LFGMgr::GetLeader(ObjectGuid guid)
|
||||
{
|
||||
return GroupsStore[guid].GetLeader();
|
||||
}
|
||||
|
||||
bool LFGMgr::HasIgnore(uint64 guid1, uint64 guid2)
|
||||
bool LFGMgr::HasIgnore(ObjectGuid guid1, ObjectGuid guid2)
|
||||
{
|
||||
Player* plr1 = ObjectAccessor::FindPlayer(guid1);
|
||||
Player* plr2 = ObjectAccessor::FindPlayer(guid2);
|
||||
uint32 low1 = GUID_LOPART(guid1);
|
||||
uint32 low2 = GUID_LOPART(guid2);
|
||||
return plr1 && plr2 && (plr1->GetSocial()->HasIgnore(low2) || plr2->GetSocial()->HasIgnore(low1));
|
||||
return plr1 && plr2 && (plr1->GetSocial()->HasIgnore(guid2.GetCounter()) || plr2->GetSocial()->HasIgnore(guid1.GetCounter()));
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgRoleChosen(uint64 guid, uint64 pguid, uint8 roles)
|
||||
void LFGMgr::SendLfgRoleChosen(ObjectGuid guid, ObjectGuid pguid, uint8 roles)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->GetSession()->SendLfgRoleChosen(pguid, roles);
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgRoleCheckUpdate(uint64 guid, LfgRoleCheck const& roleCheck)
|
||||
void LFGMgr::SendLfgRoleCheckUpdate(ObjectGuid guid, LfgRoleCheck const& roleCheck)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->GetSession()->SendLfgRoleCheckUpdate(roleCheck);
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgUpdateStatus(uint64 guid, LfgUpdateData const& data, bool party)
|
||||
void LFGMgr::SendLfgUpdateStatus(ObjectGuid guid, LfgUpdateData const& data, bool party)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->GetSession()->SendLfgUpdateStatus(data, party);
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgJoinResult(uint64 guid, LfgJoinResultData const& data)
|
||||
void LFGMgr::SendLfgJoinResult(ObjectGuid guid, LfgJoinResultData const& data)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->GetSession()->SendLfgJoinResult(data);
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgBootProposalUpdate(uint64 guid, LfgPlayerBoot const& boot)
|
||||
void LFGMgr::SendLfgBootProposalUpdate(ObjectGuid guid, LfgPlayerBoot const& boot)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->GetSession()->SendLfgBootProposalUpdate(boot);
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgUpdateProposal(uint64 guid, LfgProposal const& proposal)
|
||||
void LFGMgr::SendLfgUpdateProposal(ObjectGuid guid, LfgProposal const& proposal)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->GetSession()->SendLfgUpdateProposal(proposal);
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgQueueStatus(uint64 guid, LfgQueueStatusData const& data)
|
||||
void LFGMgr::SendLfgQueueStatus(ObjectGuid guid, LfgQueueStatusData const& data)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
player->GetSession()->SendLfgQueueStatus(data);
|
||||
}
|
||||
|
||||
bool LFGMgr::IsLfgGroup(uint64 guid)
|
||||
bool LFGMgr::IsLfgGroup(ObjectGuid guid)
|
||||
{
|
||||
return guid && IS_GROUP_GUID(guid) && GroupsStore[guid].IsLfgGroup();
|
||||
return guid && guid.IsGroup() && GroupsStore[guid].IsLfgGroup();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetQueueId(uint64 guid)
|
||||
uint8 LFGMgr::GetQueueId(ObjectGuid guid)
|
||||
{
|
||||
if (IS_GROUP_GUID(guid))
|
||||
if (guid.IsGroup())
|
||||
{
|
||||
LfgGuidSet const& players = GetPlayers(guid);
|
||||
uint64 pguid = players.empty() ? 0 : (*players.begin());
|
||||
GuidSet const& players = GetPlayers(guid);
|
||||
ObjectGuid pguid = players.empty() ? ObjectGuid::Empty : (*players.begin());
|
||||
if (pguid)
|
||||
return GetTeam(pguid);
|
||||
}
|
||||
@@ -1844,24 +1842,24 @@ uint8 LFGMgr::GetQueueId(uint64 guid)
|
||||
return GetTeam(guid);
|
||||
}
|
||||
|
||||
LFGQueue& LFGMgr::GetQueue(uint64 guid)
|
||||
LFGQueue& LFGMgr::GetQueue(ObjectGuid guid)
|
||||
{
|
||||
uint8 queueId = GetQueueId(guid);
|
||||
return QueuesStore[queueId];
|
||||
}
|
||||
|
||||
bool LFGMgr::AllQueued(LfgGuidList const& check)
|
||||
bool LFGMgr::AllQueued(GuidList const& check)
|
||||
{
|
||||
if (check.empty())
|
||||
return false;
|
||||
|
||||
for (LfgGuidList::const_iterator it = check.begin(); it != check.end(); ++it)
|
||||
for (GuidList::const_iterator it = check.begin(); it != check.end(); ++it)
|
||||
if (GetState(*it) != LFG_STATE_QUEUED)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
time_t LFGMgr::GetQueueJoinTime(uint64 guid)
|
||||
time_t LFGMgr::GetQueueJoinTime(ObjectGuid guid)
|
||||
{
|
||||
uint8 queueId = GetQueueId(guid);
|
||||
LfgQueueContainer::const_iterator itr = QueuesStore.find(queueId);
|
||||
@@ -1892,7 +1890,7 @@ void LFGMgr::SetOptions(uint32 options)
|
||||
m_options = options;
|
||||
}
|
||||
|
||||
LfgUpdateData LFGMgr::GetLfgStatus(uint64 guid)
|
||||
LfgUpdateData LFGMgr::GetLfgStatus(ObjectGuid guid)
|
||||
{
|
||||
LfgPlayerData& playerData = PlayersStore[guid];
|
||||
return LfgUpdateData(LFG_UPDATETYPE_UPDATE_STATUS, playerData.GetState(), playerData.GetSelectedDungeons());
|
||||
@@ -1930,7 +1928,7 @@ std::string LFGMgr::DumpQueueInfo(bool full)
|
||||
return o.str();
|
||||
}
|
||||
|
||||
void LFGMgr::SetupGroupMember(uint64 guid, uint64 gguid)
|
||||
void LFGMgr::SetupGroupMember(ObjectGuid guid, ObjectGuid gguid)
|
||||
{
|
||||
LfgDungeonSet dungeons;
|
||||
dungeons.insert(GetDungeon(gguid));
|
||||
@@ -1940,7 +1938,7 @@ void LFGMgr::SetupGroupMember(uint64 guid, uint64 gguid)
|
||||
AddPlayerToGroup(gguid, guid);
|
||||
}
|
||||
|
||||
bool LFGMgr::selectedRandomLfgDungeon(uint64 guid)
|
||||
bool LFGMgr::selectedRandomLfgDungeon(ObjectGuid guid)
|
||||
{
|
||||
if (GetState(guid) != LFG_STATE_NONE)
|
||||
{
|
||||
@@ -1956,9 +1954,9 @@ bool LFGMgr::selectedRandomLfgDungeon(uint64 guid)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LFGMgr::inLfgDungeonMap(uint64 guid, uint32 map, Difficulty difficulty)
|
||||
bool LFGMgr::inLfgDungeonMap(ObjectGuid guid, uint32 map, Difficulty difficulty)
|
||||
{
|
||||
if (!IS_GROUP_GUID(guid))
|
||||
if (!guid.IsGroup())
|
||||
guid = GetGroup(guid);
|
||||
|
||||
if (uint32 dungeonId = GetDungeon(guid, true))
|
||||
|
||||
@@ -138,13 +138,13 @@ typedef std::map<uint8, LFGQueue> LfgQueueContainer;
|
||||
typedef std::multimap<uint32, LfgReward const*> LfgRewardContainer;
|
||||
typedef std::pair<LfgRewardContainer::const_iterator, LfgRewardContainer::const_iterator> LfgRewardContainerBounds;
|
||||
typedef std::map<uint8, LfgDungeonSet> LfgCachedDungeonContainer;
|
||||
typedef std::map<uint64, LfgAnswer> LfgAnswerContainer;
|
||||
typedef std::map<uint64, LfgRoleCheck> LfgRoleCheckContainer;
|
||||
typedef std::map<ObjectGuid, LfgAnswer> LfgAnswerContainer;
|
||||
typedef std::map<ObjectGuid, LfgRoleCheck> LfgRoleCheckContainer;
|
||||
typedef std::map<uint32, LfgProposal> LfgProposalContainer;
|
||||
typedef std::map<uint64, LfgProposalPlayer> LfgProposalPlayerContainer;
|
||||
typedef std::map<uint64, LfgPlayerBoot> LfgPlayerBootContainer;
|
||||
typedef std::map<uint64, LfgGroupData> LfgGroupDataContainer;
|
||||
typedef std::map<uint64, LfgPlayerData> LfgPlayerDataContainer;
|
||||
typedef std::map<ObjectGuid, LfgProposalPlayer> LfgProposalPlayerContainer;
|
||||
typedef std::map<ObjectGuid, LfgPlayerBoot> LfgPlayerBootContainer;
|
||||
typedef std::map<ObjectGuid, LfgGroupData> LfgGroupDataContainer;
|
||||
typedef std::map<ObjectGuid, LfgPlayerData> LfgPlayerDataContainer;
|
||||
typedef std::unordered_map<uint32, LFGDungeonData> LFGDungeonContainer;
|
||||
|
||||
// Data needed by SMSG_LFG_JOIN_RESULT
|
||||
@@ -218,29 +218,29 @@ struct LfgReward
|
||||
/// Stores player data related to proposal to join
|
||||
struct LfgProposalPlayer
|
||||
{
|
||||
LfgProposalPlayer(): role(0), accept(LFG_ANSWER_PENDING), group(0) { }
|
||||
LfgProposalPlayer(): role(0), accept(LFG_ANSWER_PENDING), group() { }
|
||||
uint8 role; ///< Proposed role
|
||||
LfgAnswer accept; ///< Accept status (-1 not answer | 0 Not agree | 1 agree)
|
||||
uint64 group; ///< Original group guid. 0 if no original group
|
||||
ObjectGuid group; ///< Original group guid. 0 if no original group
|
||||
};
|
||||
|
||||
/// Stores group data related to proposal to join
|
||||
struct LfgProposal
|
||||
{
|
||||
LfgProposal(uint32 dungeon = 0): id(0), dungeonId(dungeon), state(LFG_PROPOSAL_INITIATING),
|
||||
group(0), leader(0), cancelTime(0), encounters(0), isNew(true)
|
||||
group(), leader(), cancelTime(0), encounters(0), isNew(true)
|
||||
{ }
|
||||
|
||||
uint32 id; ///< Proposal Id
|
||||
uint32 dungeonId; ///< Dungeon to join
|
||||
LfgProposalState state; ///< State of the proposal
|
||||
uint64 group; ///< Proposal group (0 if new)
|
||||
uint64 leader; ///< Leader guid.
|
||||
ObjectGuid group; ///< Proposal group (0 if new)
|
||||
ObjectGuid leader; ///< Leader guid.
|
||||
time_t cancelTime; ///< Time when we will cancel this proposal
|
||||
uint32 encounters; ///< Dungeon Encounters
|
||||
bool isNew; ///< Determines if it's new group or not
|
||||
LfgGuidList queues; ///< Queue Ids to remove/readd
|
||||
LfgGuidList showorder; ///< Show order in update window
|
||||
GuidList queues; ///< Queue Ids to remove/readd
|
||||
GuidList showorder; ///< Show order in update window
|
||||
LfgProposalPlayerContainer players; ///< Players data
|
||||
};
|
||||
|
||||
@@ -252,7 +252,7 @@ struct LfgRoleCheck
|
||||
LfgRoleCheckState state; ///< State of the rolecheck
|
||||
LfgDungeonSet dungeons; ///< Dungeons group is applying for (expanded random dungeons)
|
||||
uint32 rDungeonId; ///< Random Dungeon Id.
|
||||
uint64 leader; ///< Leader of the group
|
||||
ObjectGuid leader; ///< Leader of the group
|
||||
};
|
||||
|
||||
/// Stores information of a current vote to kick someone from a group
|
||||
@@ -261,7 +261,7 @@ struct LfgPlayerBoot
|
||||
time_t cancelTime; ///< Time left to vote
|
||||
bool inProgress; ///< Vote in progress
|
||||
LfgAnswerContainer votes; ///< Player votes (-1 not answer | 0 Not agree | 1 agree)
|
||||
uint64 victim; ///< Player guid to be kicked (can't vote)
|
||||
ObjectGuid victim; ///< Player guid to be kicked (can't vote)
|
||||
std::string reason; ///< kick reason
|
||||
};
|
||||
|
||||
@@ -313,7 +313,7 @@ class LFGMgr
|
||||
|
||||
// World.cpp
|
||||
/// Finish the dungeon for the given group. All check are performed using internal lfg data
|
||||
void FinishDungeon(uint64 gguid, uint32 dungeonId);
|
||||
void FinishDungeon(ObjectGuid gguid, uint32 dungeonId);
|
||||
/// Loads rewards for random dungeons
|
||||
void LoadRewards();
|
||||
/// Loads dungeons from dbc and adds teleport coords
|
||||
@@ -321,31 +321,31 @@ class LFGMgr
|
||||
|
||||
// Multiple files
|
||||
/// Check if given guid applied for random dungeon
|
||||
bool selectedRandomLfgDungeon(uint64 guid);
|
||||
bool selectedRandomLfgDungeon(ObjectGuid guid);
|
||||
/// Check if given guid applied for given map and difficulty. Used to know
|
||||
bool inLfgDungeonMap(uint64 guid, uint32 map, Difficulty difficulty);
|
||||
bool inLfgDungeonMap(ObjectGuid guid, uint32 map, Difficulty difficulty);
|
||||
/// Get selected dungeons
|
||||
LfgDungeonSet const& GetSelectedDungeons(uint64 guid);
|
||||
LfgDungeonSet const& GetSelectedDungeons(ObjectGuid guid);
|
||||
/// Get current lfg state
|
||||
LfgState GetState(uint64 guid);
|
||||
LfgState GetState(ObjectGuid guid);
|
||||
/// Get current dungeon
|
||||
uint32 GetDungeon(uint64 guid, bool asId = true);
|
||||
uint32 GetDungeon(ObjectGuid guid, bool asId = true);
|
||||
/// Get the map id of the current dungeon
|
||||
uint32 GetDungeonMapId(uint64 guid);
|
||||
uint32 GetDungeonMapId(ObjectGuid guid);
|
||||
/// Get kicks left in current group
|
||||
uint8 GetKicksLeft(uint64 gguid);
|
||||
uint8 GetKicksLeft(ObjectGuid gguid);
|
||||
/// Load Lfg group info from DB
|
||||
void _LoadFromDB(Field* fields, uint64 guid);
|
||||
void _LoadFromDB(Field* fields, ObjectGuid guid);
|
||||
/// Initializes player data after loading group data from DB
|
||||
void SetupGroupMember(uint64 guid, uint64 gguid);
|
||||
void SetupGroupMember(ObjectGuid guid, ObjectGuid gguid);
|
||||
/// Return Lfg dungeon entry for given dungeon id
|
||||
uint32 GetLFGDungeonEntry(uint32 id);
|
||||
|
||||
// cs_lfg
|
||||
/// Get current player roles
|
||||
uint8 GetRoles(uint64 guid);
|
||||
uint8 GetRoles(ObjectGuid guid);
|
||||
/// Get current player comment (used for LFR)
|
||||
std::string const& GetComment(uint64 gguid);
|
||||
std::string const& GetComment(ObjectGuid gguid);
|
||||
/// Gets current lfg options
|
||||
uint32 GetOptions();
|
||||
/// Sets new lfg options
|
||||
@@ -359,27 +359,27 @@ class LFGMgr
|
||||
|
||||
// LFGScripts
|
||||
/// Get leader of the group (using internal data)
|
||||
uint64 GetLeader(uint64 guid);
|
||||
ObjectGuid GetLeader(ObjectGuid guid);
|
||||
/// Sets player team
|
||||
void SetTeam(uint64 guid, uint8 team);
|
||||
void SetTeam(ObjectGuid guid, uint8 team);
|
||||
/// Sets player group
|
||||
void SetGroup(uint64 guid, uint64 group);
|
||||
void SetGroup(ObjectGuid guid, ObjectGuid group);
|
||||
/// Gets player group
|
||||
uint64 GetGroup(uint64 guid);
|
||||
ObjectGuid GetGroup(ObjectGuid guid);
|
||||
/// Sets the leader of the group
|
||||
void SetLeader(uint64 gguid, uint64 leader);
|
||||
void SetLeader(ObjectGuid gguid, ObjectGuid leader);
|
||||
/// Removes saved group data
|
||||
void RemoveGroupData(uint64 guid);
|
||||
void RemoveGroupData(ObjectGuid guid);
|
||||
/// Removes a player from a group
|
||||
uint8 RemovePlayerFromGroup(uint64 gguid, uint64 guid);
|
||||
uint8 RemovePlayerFromGroup(ObjectGuid gguid, ObjectGuid guid);
|
||||
/// Adds player to group
|
||||
void AddPlayerToGroup(uint64 gguid, uint64 guid);
|
||||
void AddPlayerToGroup(ObjectGuid gguid, ObjectGuid guid);
|
||||
|
||||
// LFGHandler
|
||||
/// Get locked dungeons
|
||||
LfgLockMap const GetLockedDungeons(uint64 guid);
|
||||
LfgLockMap const GetLockedDungeons(ObjectGuid guid);
|
||||
/// Returns current lfg status
|
||||
LfgUpdateData GetLfgStatus(uint64 guid);
|
||||
LfgUpdateData GetLfgStatus(ObjectGuid guid);
|
||||
/// Checks if Seasonal dungeon is active
|
||||
bool IsSeasonActive(uint32 dungeonId);
|
||||
/// Gets the random dungeon reward corresponding to given dungeon and player level
|
||||
@@ -389,55 +389,55 @@ class LFGMgr
|
||||
/// Teleport a player to/from selected dungeon
|
||||
void TeleportPlayer(Player* player, bool out, bool fromOpcode = false);
|
||||
/// Inits new proposal to boot a player
|
||||
void InitBoot(uint64 gguid, uint64 kguid, uint64 vguid, std::string const& reason);
|
||||
void InitBoot(ObjectGuid gguid, ObjectGuid kguid, ObjectGuid vguid, std::string const& reason);
|
||||
/// Updates player boot proposal with new player answer
|
||||
void UpdateBoot(uint64 guid, bool accept);
|
||||
void UpdateBoot(ObjectGuid guid, bool accept);
|
||||
/// Updates proposal to join dungeon with player answer
|
||||
void UpdateProposal(uint32 proposalId, uint64 guid, bool accept);
|
||||
void UpdateProposal(uint32 proposalId, ObjectGuid guid, bool accept);
|
||||
/// Updates the role check with player answer
|
||||
void UpdateRoleCheck(uint64 gguid, uint64 guid = 0, uint8 roles = PLAYER_ROLE_NONE);
|
||||
void UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid = ObjectGuid::Empty, uint8 roles = PLAYER_ROLE_NONE);
|
||||
/// Sets player lfg roles
|
||||
void SetRoles(uint64 guid, uint8 roles);
|
||||
void SetRoles(ObjectGuid guid, uint8 roles);
|
||||
/// Sets player lfr comment
|
||||
void SetComment(uint64 guid, std::string const& comment);
|
||||
void SetComment(ObjectGuid guid, std::string const& comment);
|
||||
/// Join Lfg with selected roles, dungeons and comment
|
||||
void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, std::string const& comment);
|
||||
/// Leaves lfg
|
||||
void LeaveLfg(uint64 guid);
|
||||
void LeaveLfg(ObjectGuid guid);
|
||||
|
||||
// LfgQueue
|
||||
/// Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)
|
||||
LfgState GetOldState(uint64 guid);
|
||||
LfgState GetOldState(ObjectGuid guid);
|
||||
/// Check if given group guid is lfg
|
||||
bool IsLfgGroup(uint64 guid);
|
||||
bool IsLfgGroup(ObjectGuid guid);
|
||||
/// Gets the player count of given group
|
||||
uint8 GetPlayerCount(uint64 guid);
|
||||
uint8 GetPlayerCount(ObjectGuid guid);
|
||||
/// Add a new Proposal
|
||||
uint32 AddProposal(LfgProposal& proposal);
|
||||
/// Returns queue id
|
||||
uint8 GetQueueId(uint64 guid);
|
||||
uint8 GetQueueId(ObjectGuid guid);
|
||||
/// Checks if all players are queued
|
||||
bool AllQueued(LfgGuidList const& check);
|
||||
bool AllQueued(GuidList const& check);
|
||||
/// Gets queue join time
|
||||
time_t GetQueueJoinTime(uint64 guid);
|
||||
time_t GetQueueJoinTime(ObjectGuid guid);
|
||||
/// Checks if given roles match, modifies given roles map with new roles
|
||||
static bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true);
|
||||
/// Checks if given players are ignoring each other
|
||||
static bool HasIgnore(uint64 guid1, uint64 guid2);
|
||||
static bool HasIgnore(ObjectGuid guid1, ObjectGuid guid2);
|
||||
/// Sends queue status to player
|
||||
static void SendLfgQueueStatus(uint64 guid, LfgQueueStatusData const& data);
|
||||
static void SendLfgQueueStatus(ObjectGuid guid, LfgQueueStatusData const& data);
|
||||
|
||||
private:
|
||||
uint8 GetTeam(uint64 guid);
|
||||
void RestoreState(uint64 guid, char const* debugMsg);
|
||||
void ClearState(uint64 guid, char const* debugMsg);
|
||||
void SetDungeon(uint64 guid, uint32 dungeon);
|
||||
void SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons);
|
||||
void DecreaseKicksLeft(uint64 guid);
|
||||
void SetState(uint64 guid, LfgState state);
|
||||
void RemovePlayerData(uint64 guid);
|
||||
void GetCompatibleDungeons(LfgDungeonSet& dungeons, LfgGuidSet const& players, LfgLockPartyMap& lockMap);
|
||||
void _SaveToDB(uint64 guid, uint32 db_guid);
|
||||
uint8 GetTeam(ObjectGuid guid);
|
||||
void RestoreState(ObjectGuid guid, char const* debugMsg);
|
||||
void ClearState(ObjectGuid guid, char const* debugMsg);
|
||||
void SetDungeon(ObjectGuid guid, uint32 dungeon);
|
||||
void SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const& dungeons);
|
||||
void DecreaseKicksLeft(ObjectGuid guid);
|
||||
void SetState(ObjectGuid guid, LfgState state);
|
||||
void RemovePlayerData(ObjectGuid guid);
|
||||
void GetCompatibleDungeons(LfgDungeonSet& dungeons, GuidSet const& players, LfgLockPartyMap& lockMap);
|
||||
void _SaveToDB(ObjectGuid guid, uint32 db_guid);
|
||||
LFGDungeonData const* GetLFGDungeon(uint32 id);
|
||||
|
||||
// Proposals
|
||||
@@ -445,19 +445,19 @@ class LFGMgr
|
||||
void MakeNewGroup(LfgProposal const& proposal);
|
||||
|
||||
// Generic
|
||||
LFGQueue& GetQueue(uint64 guid);
|
||||
LFGQueue& GetQueue(ObjectGuid guid);
|
||||
|
||||
LfgDungeonSet const& GetDungeonsByRandom(uint32 randomdungeon);
|
||||
LfgType GetDungeonType(uint32 dungeon);
|
||||
|
||||
void SendLfgBootProposalUpdate(uint64 guid, LfgPlayerBoot const& boot);
|
||||
void SendLfgJoinResult(uint64 guid, LfgJoinResultData const& data);
|
||||
void SendLfgRoleChosen(uint64 guid, uint64 pguid, uint8 roles);
|
||||
void SendLfgRoleCheckUpdate(uint64 guid, LfgRoleCheck const& roleCheck);
|
||||
void SendLfgUpdateStatus(uint64 guid, LfgUpdateData const& data, bool party);
|
||||
void SendLfgUpdateProposal(uint64 guid, LfgProposal const& proposal);
|
||||
void SendLfgBootProposalUpdate(ObjectGuid guid, LfgPlayerBoot const& boot);
|
||||
void SendLfgJoinResult(ObjectGuid guid, LfgJoinResultData const& data);
|
||||
void SendLfgRoleChosen(ObjectGuid guid, ObjectGuid pguid, uint8 roles);
|
||||
void SendLfgRoleCheckUpdate(ObjectGuid guid, LfgRoleCheck const& roleCheck);
|
||||
void SendLfgUpdateStatus(ObjectGuid guid, LfgUpdateData const& data, bool party);
|
||||
void SendLfgUpdateProposal(ObjectGuid guid, LfgProposal const& proposal);
|
||||
|
||||
LfgGuidSet const& GetPlayers(uint64 guid);
|
||||
GuidSet const& GetPlayers(ObjectGuid guid);
|
||||
|
||||
// General variables
|
||||
uint32 m_QueueTimer; ///< used to check interval of update
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace lfg
|
||||
{
|
||||
|
||||
LfgPlayerData::LfgPlayerData(): m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NONE),
|
||||
m_Team(0), m_Group(0), m_Roles(0), m_Comment("")
|
||||
m_Team(0), m_Group(), m_Roles(0), m_Comment("")
|
||||
{ }
|
||||
|
||||
LfgPlayerData::~LfgPlayerData() { }
|
||||
@@ -34,7 +34,7 @@ void LfgPlayerData::SetState(LfgState state)
|
||||
case LFG_STATE_FINISHED_DUNGEON:
|
||||
m_Roles = 0;
|
||||
m_SelectedDungeons.clear();
|
||||
m_Comment = "";
|
||||
m_Comment.clear();
|
||||
// No break on purpose
|
||||
case LFG_STATE_DUNGEON:
|
||||
m_OldState = state;
|
||||
@@ -59,7 +59,7 @@ void LfgPlayerData::SetTeam(uint8 team)
|
||||
m_Team = team;
|
||||
}
|
||||
|
||||
void LfgPlayerData::SetGroup(uint64 group)
|
||||
void LfgPlayerData::SetGroup(ObjectGuid group)
|
||||
{
|
||||
m_Group = group;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ uint8 LfgPlayerData::GetTeam() const
|
||||
return m_Team;
|
||||
}
|
||||
|
||||
uint64 LfgPlayerData::GetGroup() const
|
||||
ObjectGuid LfgPlayerData::GetGroup() const
|
||||
{
|
||||
return m_Group;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class LfgPlayerData
|
||||
void SetState(LfgState state);
|
||||
void RestoreState();
|
||||
void SetTeam(uint8 team);
|
||||
void SetGroup(uint64 group);
|
||||
void SetGroup(ObjectGuid group);
|
||||
|
||||
// Queue
|
||||
void SetRoles(uint8 roles);
|
||||
@@ -47,7 +47,7 @@ class LfgPlayerData
|
||||
LfgState GetState() const;
|
||||
LfgState GetOldState() const;
|
||||
uint8 GetTeam() const;
|
||||
uint64 GetGroup() const;
|
||||
ObjectGuid GetGroup() const;
|
||||
|
||||
// Queue
|
||||
uint8 GetRoles() const;
|
||||
@@ -60,7 +60,7 @@ class LfgPlayerData
|
||||
LfgState m_OldState; ///< Old State - Used to restore state after failed Rolecheck/Proposal
|
||||
// Player
|
||||
uint8 m_Team; ///< Player team - determines the queue to join
|
||||
uint64 m_Group; ///< Original group of player when joined LFG
|
||||
ObjectGuid m_Group; ///< Original group of player when joined LFG
|
||||
|
||||
// Queue
|
||||
uint8 m_Roles; ///< Roles the player selected when joined LFG
|
||||
|
||||
@@ -36,20 +36,20 @@ namespace lfg
|
||||
@param[in] check list of guids
|
||||
@returns Concatenated string
|
||||
*/
|
||||
std::string ConcatenateGuids(LfgGuidList const& check)
|
||||
std::string ConcatenateGuids(GuidList const& check)
|
||||
{
|
||||
if (check.empty())
|
||||
return "";
|
||||
|
||||
// need the guids in order to avoid duplicates
|
||||
LfgGuidSet guids(check.begin(), check.end());
|
||||
GuidSet guids(check.begin(), check.end());
|
||||
|
||||
std::ostringstream o;
|
||||
|
||||
LfgGuidSet::const_iterator it = guids.begin();
|
||||
o << (*it);
|
||||
GuidSet::const_iterator it = guids.begin();
|
||||
o << it->GetRawValue();
|
||||
for (++it; it != guids.end(); ++it)
|
||||
o << '|' << (*it);
|
||||
o << '|' << it->GetRawValue();
|
||||
|
||||
return o.str();
|
||||
}
|
||||
@@ -83,26 +83,26 @@ char const* GetCompatibleString(LfgCompatibility compatibles)
|
||||
}
|
||||
}
|
||||
|
||||
void LFGQueue::AddToQueue(uint64 guid)
|
||||
void LFGQueue::AddToQueue(ObjectGuid guid)
|
||||
{
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
|
||||
if (itQueue == QueueDataStore.end())
|
||||
{
|
||||
TC_LOG_ERROR("lfg.queue.add", "Queue data not found for [" UI64FMTD "]", guid);
|
||||
TC_LOG_ERROR("lfg.queue.add", "Queue data not found for [%s]", guid.ToString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
AddToNewQueue(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveFromQueue(uint64 guid)
|
||||
void LFGQueue::RemoveFromQueue(ObjectGuid guid)
|
||||
{
|
||||
RemoveFromNewQueue(guid);
|
||||
RemoveFromCurrentQueue(guid);
|
||||
RemoveFromCompatibles(guid);
|
||||
|
||||
std::ostringstream o;
|
||||
o << guid;
|
||||
o << guid.GetRawValue();
|
||||
std::string sguid = o.str();
|
||||
|
||||
LfgQueueDataContainer::iterator itDelete = QueueDataStore.end();
|
||||
@@ -122,33 +122,33 @@ void LFGQueue::RemoveFromQueue(uint64 guid)
|
||||
QueueDataStore.erase(itDelete);
|
||||
}
|
||||
|
||||
void LFGQueue::AddToNewQueue(uint64 guid)
|
||||
void LFGQueue::AddToNewQueue(ObjectGuid guid)
|
||||
{
|
||||
newToQueueStore.push_back(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveFromNewQueue(uint64 guid)
|
||||
void LFGQueue::RemoveFromNewQueue(ObjectGuid guid)
|
||||
{
|
||||
newToQueueStore.remove(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::AddToCurrentQueue(uint64 guid)
|
||||
void LFGQueue::AddToCurrentQueue(ObjectGuid guid)
|
||||
{
|
||||
currentQueueStore.push_back(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveFromCurrentQueue(uint64 guid)
|
||||
void LFGQueue::RemoveFromCurrentQueue(ObjectGuid guid)
|
||||
{
|
||||
currentQueueStore.remove(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::AddQueueData(uint64 guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap)
|
||||
void LFGQueue::AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap)
|
||||
{
|
||||
QueueDataStore[guid] = LfgQueueData(joinTime, dungeons, rolesMap);
|
||||
AddToQueue(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveQueueData(uint64 guid)
|
||||
void LFGQueue::RemoveQueueData(ObjectGuid guid)
|
||||
{
|
||||
LfgQueueDataContainer::iterator it = QueueDataStore.find(guid);
|
||||
if (it != QueueDataStore.end())
|
||||
@@ -188,13 +188,13 @@ void LFGQueue::UpdateWaitTimeDps(int32 waitTime, uint32 dungeonId)
|
||||
|
||||
@param[in] guid Guid to remove from compatible cache
|
||||
*/
|
||||
void LFGQueue::RemoveFromCompatibles(uint64 guid)
|
||||
void LFGQueue::RemoveFromCompatibles(ObjectGuid guid)
|
||||
{
|
||||
std::stringstream out;
|
||||
out << guid;
|
||||
out << guid.GetRawValue();
|
||||
std::string strGuid = out.str();
|
||||
|
||||
TC_LOG_DEBUG("lfg.queue.data.compatibles.remove", "Removing [" UI64FMTD "]", guid);
|
||||
TC_LOG_DEBUG("lfg.queue.data.compatibles.remove", "Removing %s", guid.ToString().c_str());
|
||||
for (LfgCompatibleContainer::iterator itNext = CompatibleMapStore.begin(); itNext != CompatibleMapStore.end();)
|
||||
{
|
||||
LfgCompatibleContainer::iterator it = itNext++;
|
||||
@@ -247,16 +247,18 @@ LfgCompatibilityData* LFGQueue::GetCompatibilityData(std::string const& key)
|
||||
uint8 LFGQueue::FindGroups()
|
||||
{
|
||||
uint8 proposals = 0;
|
||||
LfgGuidList firstNew;
|
||||
GuidList firstNew;
|
||||
while (!newToQueueStore.empty())
|
||||
{
|
||||
uint64 frontguid = newToQueueStore.front();
|
||||
TC_LOG_DEBUG("lfg.queue.match.check.new", "Checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", frontguid, uint32(newToQueueStore.size()), uint32(currentQueueStore.size()));
|
||||
ObjectGuid frontguid = newToQueueStore.front();
|
||||
TC_LOG_DEBUG("lfg.queue.match.check.new", "Checking [%s] newToQueue(%u), currentQueue(%u)", frontguid.ToString().c_str(),
|
||||
uint32(newToQueueStore.size()), uint32(currentQueueStore.size()));
|
||||
|
||||
firstNew.clear();
|
||||
firstNew.push_back(frontguid);
|
||||
RemoveFromNewQueue(frontguid);
|
||||
|
||||
LfgGuidList temporalList = currentQueueStore;
|
||||
GuidList temporalList = currentQueueStore;
|
||||
LfgCompatibility compatibles = FindNewGroups(firstNew, temporalList);
|
||||
|
||||
if (compatibles == LFG_COMPATIBLES_MATCH)
|
||||
@@ -274,7 +276,7 @@ uint8 LFGQueue::FindGroups()
|
||||
@param[in] all List of all other guids in main queue to match against
|
||||
@return LfgCompatibility type of compatibility between groups
|
||||
*/
|
||||
LfgCompatibility LFGQueue::FindNewGroups(LfgGuidList& check, LfgGuidList& all)
|
||||
LfgCompatibility LFGQueue::FindNewGroups(GuidList& check, GuidList& all)
|
||||
{
|
||||
std::string strGuids = ConcatenateGuids(check);
|
||||
LfgCompatibility compatibles = GetCompatibles(strGuids);
|
||||
@@ -312,7 +314,7 @@ LfgCompatibility LFGQueue::FindNewGroups(LfgGuidList& check, LfgGuidList& all)
|
||||
@param[in] check List of guids to check compatibilities
|
||||
@return LfgCompatibility type of compatibility
|
||||
*/
|
||||
LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
|
||||
{
|
||||
std::string strGuids = ConcatenateGuids(check);
|
||||
LfgProposal proposal;
|
||||
@@ -330,7 +332,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
// Check all-but-new compatiblitity
|
||||
if (check.size() > 2)
|
||||
{
|
||||
uint64 frontGuid = check.front();
|
||||
ObjectGuid frontGuid = check.front();
|
||||
check.pop_front();
|
||||
|
||||
// Check all-but-new compatibilities (New, A, B, C, D) --> check(A, B, C, D)
|
||||
@@ -347,20 +349,20 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
// Check if more than one LFG group and number of players joining
|
||||
uint8 numPlayers = 0;
|
||||
uint8 numLfgGroups = 0;
|
||||
for (LfgGuidList::const_iterator it = check.begin(); it != check.end() && numLfgGroups < 2 && numPlayers <= MAXGROUPSIZE; ++it)
|
||||
for (GuidList::const_iterator it = check.begin(); it != check.end() && numLfgGroups < 2 && numPlayers <= MAXGROUPSIZE; ++it)
|
||||
{
|
||||
uint64 guid = (*it);
|
||||
ObjectGuid guid = *it;
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
|
||||
if (itQueue == QueueDataStore.end())
|
||||
{
|
||||
TC_LOG_ERROR("lfg.queue.match.compatibility.check", "Guid: [" UI64FMTD "] is not queued but listed as queued!", guid);
|
||||
TC_LOG_ERROR("lfg.queue.match.compatibility.check", "Guid: [%s] is not queued but listed as queued!", guid.ToString().c_str());
|
||||
RemoveFromQueue(guid);
|
||||
return LFG_COMPATIBILITY_PENDING;
|
||||
}
|
||||
|
||||
// Store group so we don't need to call Mgr to get it later (if it's player group will be 0 otherwise would have joined as group)
|
||||
for (LfgRolesMap::const_iterator it2 = itQueue->second.roles.begin(); it2 != itQueue->second.roles.end(); ++it2)
|
||||
proposalGroups[it2->first] = IS_GROUP_GUID(itQueue->first) ? itQueue->first : 0;
|
||||
proposalGroups[it2->first] = itQueue->first.IsGroup() ? itQueue->first : ObjectGuid::Empty;
|
||||
|
||||
numPlayers += itQueue->second.roles.size();
|
||||
|
||||
@@ -404,16 +406,16 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
// If it's single group no need to check for duplicate players, ignores, bad roles or bad dungeons as it's been checked before joining
|
||||
if (check.size() > 1)
|
||||
{
|
||||
for (LfgGuidList::const_iterator it = check.begin(); it != check.end(); ++it)
|
||||
for (GuidList::const_iterator it = check.begin(); it != check.end(); ++it)
|
||||
{
|
||||
const LfgRolesMap &roles = QueueDataStore[(*it)].roles;
|
||||
LfgRolesMap const& roles = QueueDataStore[(*it)].roles;
|
||||
for (LfgRolesMap::const_iterator itRoles = roles.begin(); itRoles != roles.end(); ++itRoles)
|
||||
{
|
||||
LfgRolesMap::const_iterator itPlayer;
|
||||
for (itPlayer = proposalRoles.begin(); itPlayer != proposalRoles.end(); ++itPlayer)
|
||||
{
|
||||
if (itRoles->first == itPlayer->first)
|
||||
TC_LOG_ERROR("lfg.queue.match.compatibility.check", "Guids: ERROR! Player multiple times in queue! [" UI64FMTD "]", itRoles->first);
|
||||
TC_LOG_ERROR("lfg.queue.match.compatibility.check", "Guids: ERROR! Player multiple times in queue! [%s]", itRoles->first.ToString().c_str());
|
||||
else if (sLFGMgr->HasIgnore(itRoles->first, itPlayer->first))
|
||||
break;
|
||||
}
|
||||
@@ -434,22 +436,22 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
{
|
||||
std::ostringstream o;
|
||||
for (LfgRolesMap::const_iterator it = debugRoles.begin(); it != debugRoles.end(); ++it)
|
||||
o << ", " << it->first << ": " << GetRolesString(it->second);
|
||||
o << ", " << it->first.GetRawValue() << ": " << GetRolesString(it->second);
|
||||
|
||||
TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Roles not compatible%s", strGuids.c_str(), o.str().c_str());
|
||||
SetCompatibles(strGuids, LFG_INCOMPATIBLES_NO_ROLES);
|
||||
return LFG_INCOMPATIBLES_NO_ROLES;
|
||||
}
|
||||
|
||||
LfgGuidList::iterator itguid = check.begin();
|
||||
GuidList::iterator itguid = check.begin();
|
||||
proposalDungeons = QueueDataStore[*itguid].dungeons;
|
||||
std::ostringstream o;
|
||||
o << ", " << *itguid << ": (" << ConcatenateDungeons(proposalDungeons) << ")";
|
||||
o << ", " << itguid->GetRawValue() << ": (" << ConcatenateDungeons(proposalDungeons) << ")";
|
||||
for (++itguid; itguid != check.end(); ++itguid)
|
||||
{
|
||||
LfgDungeonSet temporal;
|
||||
LfgDungeonSet &dungeons = QueueDataStore[*itguid].dungeons;
|
||||
o << ", " << *itguid << ": (" << ConcatenateDungeons(dungeons) << ")";
|
||||
LfgDungeonSet& dungeons = QueueDataStore[*itguid].dungeons;
|
||||
o << ", " << itguid->GetRawValue() << ": (" << ConcatenateDungeons(dungeons) << ")";
|
||||
std::set_intersection(proposalDungeons.begin(), proposalDungeons.end(), dungeons.begin(), dungeons.end(), std::inserter(temporal, temporal.begin()));
|
||||
proposalDungeons = temporal;
|
||||
}
|
||||
@@ -463,7 +465,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
}
|
||||
else
|
||||
{
|
||||
uint64 gguid = *check.begin();
|
||||
ObjectGuid gguid = *check.begin();
|
||||
const LfgQueueData &queue = QueueDataStore[gguid];
|
||||
proposalDungeons = queue.dungeons;
|
||||
proposalRoles = queue.roles;
|
||||
@@ -477,14 +479,14 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
LfgCompatibilityData data(LFG_COMPATIBLES_WITH_LESS_PLAYERS);
|
||||
data.roles = proposalRoles;
|
||||
|
||||
for (LfgGuidList::const_iterator itr = check.begin(); itr != check.end(); ++itr)
|
||||
for (GuidList::const_iterator itr = check.begin(); itr != check.end(); ++itr)
|
||||
UpdateBestCompatibleInQueue(QueueDataStore.find(*itr), strGuids, data.roles);
|
||||
|
||||
SetCompatibilityData(strGuids, data);
|
||||
return LFG_COMPATIBLES_WITH_LESS_PLAYERS;
|
||||
}
|
||||
|
||||
uint64 gguid = *check.begin();
|
||||
ObjectGuid gguid = *check.begin();
|
||||
proposal.queues = check;
|
||||
proposal.isNew = numLfgGroups != 1 || sLFGMgr->GetOldState(gguid) != LFG_STATE_DUNGEON;
|
||||
|
||||
@@ -498,7 +500,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
// Create a new proposal
|
||||
proposal.cancelTime = time(NULL) + LFG_TIME_PROPOSAL;
|
||||
proposal.state = LFG_PROPOSAL_INITIATING;
|
||||
proposal.leader = 0;
|
||||
proposal.leader.Clear();
|
||||
proposal.dungeonId = Trinity::Containers::SelectRandomContainerElement(proposalDungeons);
|
||||
|
||||
bool leader = false;
|
||||
@@ -523,9 +525,9 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
|
||||
}
|
||||
|
||||
// Mark proposal members as not queued (but not remove queue data)
|
||||
for (LfgGuidList::const_iterator itQueue = proposal.queues.begin(); itQueue != proposal.queues.end(); ++itQueue)
|
||||
for (GuidList::const_iterator itQueue = proposal.queues.begin(); itQueue != proposal.queues.end(); ++itQueue)
|
||||
{
|
||||
uint64 guid = (*itQueue);
|
||||
ObjectGuid guid = (*itQueue);
|
||||
RemoveFromNewQueue(guid);
|
||||
RemoveFromCurrentQueue(guid);
|
||||
}
|
||||
@@ -581,13 +583,13 @@ void LFGQueue::UpdateQueueTimers(uint8 queueId, time_t currTime)
|
||||
LfgQueueStatusData queueData(queueId, dungeonId, queueinfo.joinTime, waitTime, wtAvg, wtTank, wtHealer, wtDps, queuedTime, queueinfo.tanks, queueinfo.healers, queueinfo.dps);
|
||||
for (LfgRolesMap::const_iterator itPlayer = queueinfo.roles.begin(); itPlayer != queueinfo.roles.end(); ++itPlayer)
|
||||
{
|
||||
uint64 pguid = itPlayer->first;
|
||||
ObjectGuid pguid = itPlayer->first;
|
||||
LFGMgr::SendLfgQueueStatus(pguid, queueData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
time_t LFGQueue::GetJoinTime(uint64 guid) const
|
||||
time_t LFGQueue::GetJoinTime(ObjectGuid guid) const
|
||||
{
|
||||
LfgQueueDataContainer::const_iterator itr = QueueDataStore.find(guid);
|
||||
if (itr != QueueDataStore.end())
|
||||
@@ -604,11 +606,11 @@ std::string LFGQueue::DumpQueueInfo() const
|
||||
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
LfgGuidList const& queue = i ? newToQueueStore : currentQueueStore;
|
||||
for (LfgGuidList::const_iterator it = queue.begin(); it != queue.end(); ++it)
|
||||
GuidList const& queue = i ? newToQueueStore : currentQueueStore;
|
||||
for (GuidList::const_iterator it = queue.begin(); it != queue.end(); ++it)
|
||||
{
|
||||
uint64 guid = *it;
|
||||
if (IS_GROUP_GUID(guid))
|
||||
ObjectGuid guid = *it;
|
||||
if (guid.IsGroup())
|
||||
{
|
||||
groups++;
|
||||
playersInGroup += sLFGMgr->GetPlayerCount(guid);
|
||||
@@ -635,9 +637,9 @@ std::string LFGQueue::DumpCompatibleInfo(bool full /* = false */) const
|
||||
|
||||
void LFGQueue::FindBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg.queue.compatibles.find", "Guid: " UI64FMTD, itrQueue->first);
|
||||
TC_LOG_DEBUG("lfg.queue.compatibles.find", "%s", itrQueue->first.ToString().c_str());
|
||||
std::ostringstream o;
|
||||
o << itrQueue->first;
|
||||
o << itrQueue->first.GetRawValue();
|
||||
std::string sguid = o.str();
|
||||
|
||||
for (LfgCompatibleContainer::const_iterator itr = CompatibleMapStore.begin(); itr != CompatibleMapStore.end(); ++itr)
|
||||
@@ -660,8 +662,8 @@ void LFGQueue::UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQu
|
||||
if (size <= storedSize)
|
||||
return;
|
||||
|
||||
TC_LOG_DEBUG("lfg.queue.compatibles.update", "Changed (%s) to (%s) as best compatible group for " UI64FMTD,
|
||||
queueData.bestCompatible.c_str(), key.c_str(), itrQueue->first);
|
||||
TC_LOG_DEBUG("lfg.queue.compatibles.update", "Changed (%s) to (%s) as best compatible group for %s",
|
||||
queueData.bestCompatible.c_str(), key.c_str(), itrQueue->first.ToString().c_str());
|
||||
|
||||
queueData.bestCompatible = key;
|
||||
queueData.tanks = LFG_TANKS_NEEDED;
|
||||
|
||||
@@ -78,7 +78,7 @@ struct LfgWaitTime
|
||||
|
||||
typedef std::map<uint32, LfgWaitTime> LfgWaitTimesContainer;
|
||||
typedef std::map<std::string, LfgCompatibilityData> LfgCompatibleContainer;
|
||||
typedef std::map<uint64, LfgQueueData> LfgQueueDataContainer;
|
||||
typedef std::map<ObjectGuid, LfgQueueData> LfgQueueDataContainer;
|
||||
|
||||
/**
|
||||
Stores all data related to queue
|
||||
@@ -88,10 +88,10 @@ class LFGQueue
|
||||
public:
|
||||
|
||||
// Add/Remove from queue
|
||||
void AddToQueue(uint64 guid);
|
||||
void RemoveFromQueue(uint64 guid);
|
||||
void AddQueueData(uint64 guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap);
|
||||
void RemoveQueueData(uint64 guid);
|
||||
void AddToQueue(ObjectGuid guid);
|
||||
void RemoveFromQueue(ObjectGuid guid);
|
||||
void AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap);
|
||||
void RemoveQueueData(ObjectGuid guid);
|
||||
|
||||
// Update Timers (when proposal success)
|
||||
void UpdateWaitTimeAvg(int32 waitTime, uint32 dungeonId);
|
||||
@@ -101,7 +101,7 @@ class LFGQueue
|
||||
|
||||
// Update Queue timers
|
||||
void UpdateQueueTimers(uint8 queueId, time_t currTime);
|
||||
time_t GetJoinTime(uint64 guid) const;
|
||||
time_t GetJoinTime(ObjectGuid guid) const;
|
||||
|
||||
// Find new group
|
||||
uint8 FindGroups();
|
||||
@@ -112,24 +112,23 @@ class LFGQueue
|
||||
|
||||
private:
|
||||
void SetQueueUpdateData(std::string const& strGuids, LfgRolesMap const& proposalRoles);
|
||||
LfgRolesMap const& RemoveFromQueueUpdateData(uint64 guid);
|
||||
|
||||
void AddToNewQueue(uint64 guid);
|
||||
void AddToCurrentQueue(uint64 guid);
|
||||
void RemoveFromNewQueue(uint64 guid);
|
||||
void RemoveFromCurrentQueue(uint64 guid);
|
||||
void AddToNewQueue(ObjectGuid guid);
|
||||
void AddToCurrentQueue(ObjectGuid guid);
|
||||
void RemoveFromNewQueue(ObjectGuid guid);
|
||||
void RemoveFromCurrentQueue(ObjectGuid guid);
|
||||
|
||||
void SetCompatibles(std::string const& key, LfgCompatibility compatibles);
|
||||
LfgCompatibility GetCompatibles(std::string const& key);
|
||||
void RemoveFromCompatibles(uint64 guid);
|
||||
void RemoveFromCompatibles(ObjectGuid guid);
|
||||
|
||||
void SetCompatibilityData(std::string const& key, LfgCompatibilityData const& compatibles);
|
||||
LfgCompatibilityData* GetCompatibilityData(std::string const& key);
|
||||
void FindBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue);
|
||||
void UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue, std::string const& key, LfgRolesMap const& roles);
|
||||
|
||||
LfgCompatibility FindNewGroups(LfgGuidList& check, LfgGuidList& all);
|
||||
LfgCompatibility CheckCompatibility(LfgGuidList check);
|
||||
LfgCompatibility FindNewGroups(GuidList& check, GuidList& all);
|
||||
LfgCompatibility CheckCompatibility(GuidList check);
|
||||
|
||||
// Queue
|
||||
LfgQueueDataContainer QueueDataStore; ///< Queued groups
|
||||
@@ -139,8 +138,8 @@ class LFGQueue
|
||||
LfgWaitTimesContainer waitTimesTankStore; ///< Average wait time to find a group queuing as tank
|
||||
LfgWaitTimesContainer waitTimesHealerStore; ///< Average wait time to find a group queuing as healer
|
||||
LfgWaitTimesContainer waitTimesDpsStore; ///< Average wait time to find a group queuing as dps
|
||||
LfgGuidList currentQueueStore; ///< Ordered list. Used to find groups
|
||||
LfgGuidList newToQueueStore; ///< New groups to add to queue
|
||||
GuidList currentQueueStore; ///< Ordered list. Used to find groups
|
||||
GuidList newToQueueStore; ///< New groups to add to queue
|
||||
};
|
||||
|
||||
} // namespace lfg
|
||||
|
||||
@@ -52,16 +52,16 @@ void LFGPlayerScript::OnLogin(Player* player, bool /*loginFirst*/)
|
||||
return;
|
||||
|
||||
// Temporal: Trying to determine when group data and LFG data gets desynched
|
||||
uint64 guid = player->GetGUID();
|
||||
uint64 gguid = sLFGMgr->GetGroup(guid);
|
||||
ObjectGuid guid = player->GetGUID();
|
||||
ObjectGuid gguid = sLFGMgr->GetGroup(guid);
|
||||
|
||||
if (Group const* group = player->GetGroup())
|
||||
{
|
||||
uint64 gguid2 = group->GetGUID();
|
||||
ObjectGuid gguid2 = group->GetGUID();
|
||||
if (gguid != gguid2)
|
||||
{
|
||||
TC_LOG_ERROR("lfg", "%s on group %u but LFG has group %u saved... Fixing.",
|
||||
player->GetSession()->GetPlayerInfo().c_str(), GUID_LOPART(gguid2), GUID_LOPART(gguid));
|
||||
player->GetSession()->GetPlayerInfo().c_str(), gguid2.GetCounter(), gguid.GetCounter());
|
||||
sLFGMgr->SetupGroupMember(guid, group->GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -104,24 +104,24 @@ void LFGPlayerScript::OnMapChanged(Player* player)
|
||||
|
||||
LFGGroupScript::LFGGroupScript() : GroupScript("LFGGroupScript") { }
|
||||
|
||||
void LFGGroupScript::OnAddMember(Group* group, uint64 guid)
|
||||
void LFGGroupScript::OnAddMember(Group* group, ObjectGuid guid)
|
||||
{
|
||||
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
|
||||
return;
|
||||
|
||||
uint64 gguid = group->GetGUID();
|
||||
uint64 leader = group->GetLeaderGUID();
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
ObjectGuid leader = group->GetLeaderGUID();
|
||||
|
||||
if (leader == guid)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "]", gguid, guid, leader);
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnAddMember [%s]: added [%s] leader [%s]", gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str());
|
||||
sLFGMgr->SetLeader(gguid, guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LfgState gstate = sLFGMgr->GetState(gguid);
|
||||
LfgState state = sLFGMgr->GetState(guid);
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "] gstate: %u, state: %u", gguid, guid, leader, gstate, state);
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnAddMember [%s]: added [%s] leader [%s] gstate: %u, state: %u", gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str(), gstate, state);
|
||||
|
||||
if (state == LFG_STATE_QUEUED)
|
||||
sLFGMgr->LeaveLfg(guid);
|
||||
@@ -134,13 +134,14 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid)
|
||||
sLFGMgr->AddPlayerToGroup(gguid, guid);
|
||||
}
|
||||
|
||||
void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason)
|
||||
void LFGGroupScript::OnRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, char const* reason)
|
||||
{
|
||||
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
|
||||
return;
|
||||
|
||||
uint64 gguid = group->GetGUID();
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : ""));
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnRemoveMember [%s]: remove [%s] Method: %d Kicker: [%s] Reason: %s",
|
||||
gguid.ToString().c_str(), guid.ToString().c_str(), method, kicker.ToString().c_str(), (reason ? reason : ""));
|
||||
|
||||
bool isLFG = group->isLFGGroup();
|
||||
|
||||
@@ -160,13 +161,13 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth
|
||||
if (state == LFG_STATE_PROPOSAL && method == GROUP_REMOVEMETHOD_DEFAULT)
|
||||
{
|
||||
// LfgData: Remove player from group
|
||||
sLFGMgr->SetGroup(guid, 0);
|
||||
sLFGMgr->SetGroup(guid, ObjectGuid::Empty);
|
||||
sLFGMgr->RemovePlayerFromGroup(gguid, guid);
|
||||
return;
|
||||
}
|
||||
|
||||
sLFGMgr->LeaveLfg(guid);
|
||||
sLFGMgr->SetGroup(guid, 0);
|
||||
sLFGMgr->SetGroup(guid, ObjectGuid::Empty);
|
||||
uint8 players = sLFGMgr->RemovePlayerFromGroup(gguid, guid);
|
||||
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
@@ -192,31 +193,35 @@ void LFGGroupScript::OnDisband(Group* group)
|
||||
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
|
||||
return;
|
||||
|
||||
uint64 gguid = group->GetGUID();
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnDisband [" UI64FMTD "]", gguid);
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnDisband [%s]", gguid.ToString().c_str());
|
||||
|
||||
sLFGMgr->RemoveGroupData(gguid);
|
||||
}
|
||||
|
||||
void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid)
|
||||
void LFGGroupScript::OnChangeLeader(Group* group, ObjectGuid newLeaderGuid, ObjectGuid oldLeaderGuid)
|
||||
{
|
||||
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
|
||||
return;
|
||||
|
||||
uint64 gguid = group->GetGUID();
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnChangeLeader [%s]: old [%s] new [%s]",
|
||||
gguid.ToString().c_str(), newLeaderGuid.ToString().c_str(), oldLeaderGuid.ToString().c_str());
|
||||
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid);
|
||||
sLFGMgr->SetLeader(gguid, newLeaderGuid);
|
||||
}
|
||||
|
||||
void LFGGroupScript::OnInviteMember(Group* group, uint64 guid)
|
||||
void LFGGroupScript::OnInviteMember(Group* group, ObjectGuid guid)
|
||||
{
|
||||
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
|
||||
return;
|
||||
|
||||
uint64 gguid = group->GetGUID();
|
||||
uint64 leader = group->GetLeaderGUID();
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, leader);
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
ObjectGuid leader = group->GetLeaderGUID();
|
||||
TC_LOG_DEBUG("lfg", "LFGScripts::OnInviteMember [%s]: invite [%s] leader [%s]",
|
||||
gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str());
|
||||
|
||||
// No gguid == new group being formed
|
||||
// No leader == after group creation first invite is new leader
|
||||
// leader and no gguid == first invite after leader is added to new group (this is the real invite)
|
||||
|
||||
@@ -46,11 +46,11 @@ class LFGGroupScript : public GroupScript
|
||||
LFGGroupScript();
|
||||
|
||||
// Group Hooks
|
||||
void OnAddMember(Group* group, uint64 guid) override;
|
||||
void OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason) override;
|
||||
void OnAddMember(Group* group, ObjectGuid guid) override;
|
||||
void OnRemoveMember(Group* group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, char const* reason) override;
|
||||
void OnDisband(Group* group) override;
|
||||
void OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid) override;
|
||||
void OnInviteMember(Group* group, uint64 guid) override;
|
||||
void OnChangeLeader(Group* group, ObjectGuid newLeaderGuid, ObjectGuid oldLeaderGuid) override;
|
||||
void OnInviteMember(Group* group, ObjectGuid guid) override;
|
||||
};
|
||||
|
||||
} // namespace lfg
|
||||
|
||||
@@ -88,7 +88,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
|
||||
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
|
||||
|
||||
SetObjectScale(1);
|
||||
SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
SetGuidValue(CORPSE_FIELD_OWNER, owner->GetGUID());
|
||||
|
||||
_gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY());
|
||||
|
||||
@@ -104,7 +104,7 @@ void Corpse::SaveToDB()
|
||||
uint16 index = 0;
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);
|
||||
stmt->setUInt32(index++, GetGUIDLow()); // corpseGuid
|
||||
stmt->setUInt32(index++, GUID_LOPART(GetOwnerGUID())); // guid
|
||||
stmt->setUInt32(index++, GetOwnerGUID().GetCounter()); // guid
|
||||
stmt->setFloat (index++, GetPositionX()); // posX
|
||||
stmt->setFloat (index++, GetPositionY()); // posY
|
||||
stmt->setFloat (index++, GetPositionZ()); // posZ
|
||||
@@ -152,7 +152,7 @@ void Corpse::DeleteFromDB(SQLTransaction& trans)
|
||||
{
|
||||
// all corpses (not bones)
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_CORPSES);
|
||||
stmt->setUInt32(0, GUID_LOPART(GetOwnerGUID()));
|
||||
stmt->setUInt32(0, GetOwnerGUID().GetCounter());
|
||||
}
|
||||
trans->Append(stmt);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
|
||||
SetUInt32Value(CORPSE_FIELD_BYTES_2, fields[8].GetUInt32());
|
||||
SetUInt32Value(CORPSE_FIELD_FLAGS, fields[9].GetUInt8());
|
||||
SetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS, fields[10].GetUInt8());
|
||||
SetUInt64Value(CORPSE_FIELD_OWNER, MAKE_NEW_GUID(ownerGuid, 0, HIGHGUID_PLAYER));
|
||||
SetGuidValue(CORPSE_FIELD_OWNER, ObjectGuid(HIGHGUID_PLAYER, ownerGuid));
|
||||
|
||||
m_time = time_t(fields[11].GetUInt32());
|
||||
|
||||
@@ -191,8 +191,8 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
|
||||
|
||||
if (!IsPositionValid())
|
||||
{
|
||||
TC_LOG_ERROR("entities.player", "Corpse (guid: %u, owner: %u) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
|
||||
GetGUIDLow(), GUID_LOPART(GetOwnerGUID()), posX, posY, posZ);
|
||||
TC_LOG_ERROR("entities.player", "Corpse (%s, owner: %s) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
|
||||
GetGUID().ToString().c_str(), GetOwnerGUID().ToString().c_str(), posX, posY, posZ);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class Corpse : public WorldObject, public GridObject<Corpse>
|
||||
void DeleteBonesFromWorld();
|
||||
void DeleteFromDB(SQLTransaction& trans);
|
||||
|
||||
uint64 GetOwnerGUID() const { return GetUInt64Value(CORPSE_FIELD_OWNER); }
|
||||
ObjectGuid GetOwnerGUID() const { return GetGuidValue(CORPSE_FIELD_OWNER); }
|
||||
|
||||
time_t const& GetGhostTime() const { return m_time; }
|
||||
void ResetGhostTime() { m_time = time(NULL); }
|
||||
|
||||
@@ -143,7 +143,7 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
|
||||
Creature::Creature(bool isWorldObject): Unit(isWorldObject), MapObject(),
|
||||
m_groupLootTimer(0), lootingGroupLowGUID(0), m_PlayerDamageReq(0),
|
||||
m_lootRecipient(0), m_lootRecipientGroup(0), _skinner(0), _pickpocketLootRestore(0), m_corpseRemoveTime(0), m_respawnTime(0),
|
||||
m_lootRecipient(), m_lootRecipientGroup(0), _skinner(), _pickpocketLootRestore(0), m_corpseRemoveTime(0), m_respawnTime(0),
|
||||
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
|
||||
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
|
||||
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
|
||||
@@ -471,17 +471,17 @@ void Creature::Update(uint32 diff)
|
||||
if (!allowed) // Will be rechecked on next Update call
|
||||
break;
|
||||
|
||||
uint64 dbtableHighGuid = MAKE_NEW_GUID(m_DBTableGuid, GetEntry(), HIGHGUID_UNIT);
|
||||
ObjectGuid dbtableHighGuid(HIGHGUID_UNIT, GetEntry(), m_DBTableGuid);
|
||||
time_t linkedRespawntime = GetMap()->GetLinkedRespawnTime(dbtableHighGuid);
|
||||
if (!linkedRespawntime) // Can respawn
|
||||
Respawn();
|
||||
else // the master is dead
|
||||
{
|
||||
uint64 targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid);
|
||||
ObjectGuid targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid);
|
||||
if (targetGuid == dbtableHighGuid) // if linking self, never respawn (check delayed to next day)
|
||||
SetRespawnTime(DAY);
|
||||
else
|
||||
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little
|
||||
m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime) + urand(5, MINUTE); // else copy time from master and add a little
|
||||
SaveRespawnTime(); // also save to DB immediately
|
||||
}
|
||||
}
|
||||
@@ -532,7 +532,7 @@ void Creature::Update(uint32 diff)
|
||||
if (Unit* charmer = ObjectAccessor::GetUnit(*this, LastCharmerGUID))
|
||||
i_AI->AttackStart(charmer);
|
||||
|
||||
LastCharmerGUID = 0;
|
||||
LastCharmerGUID.Clear();
|
||||
}
|
||||
|
||||
if (!IsInEvadeMode() && IsAIEnabled)
|
||||
@@ -893,7 +893,7 @@ void Creature::SetLootRecipient(Unit* unit)
|
||||
|
||||
if (!unit)
|
||||
{
|
||||
m_lootRecipient = 0;
|
||||
m_lootRecipient.Clear();
|
||||
m_lootRecipientGroup = 0;
|
||||
RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE|UNIT_DYNFLAG_TAPPED);
|
||||
return;
|
||||
@@ -1224,7 +1224,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap)
|
||||
m_DBTableGuid = guid;
|
||||
if (map->GetInstanceId() == 0)
|
||||
{
|
||||
if (map->GetCreature(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT)))
|
||||
if (map->GetCreature(ObjectGuid(HIGHGUID_UNIT, data->id, guid)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1474,7 +1474,7 @@ void Creature::setDeathState(DeathState s)
|
||||
if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
|
||||
SaveRespawnTime();
|
||||
|
||||
SetTarget(0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
|
||||
SetTarget(ObjectGuid::Empty); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
|
||||
setActive(false);
|
||||
@@ -1533,8 +1533,8 @@ void Creature::Respawn(bool force)
|
||||
if (m_DBTableGuid)
|
||||
GetMap()->RemoveCreatureRespawnTime(m_DBTableGuid);
|
||||
|
||||
TC_LOG_DEBUG("entities.unit", "Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)",
|
||||
GetName().c_str(), GetGUIDLow(), GetGUID(), GetEntry());
|
||||
TC_LOG_DEBUG("entities.unit", "Respawning creature %s (%s)",
|
||||
GetName().c_str(), GetGUID().ToString().c_str());
|
||||
m_respawnTime = 0;
|
||||
ResetPickPocketRefillTimer();
|
||||
loot.clear();
|
||||
@@ -2572,10 +2572,10 @@ void Creature::SetDisplayId(uint32 modelId)
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::SetTarget(uint64 guid)
|
||||
void Creature::SetTarget(ObjectGuid guid)
|
||||
{
|
||||
if (!_focusSpell)
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, guid);
|
||||
SetGuidValue(UNIT_FIELD_TARGET, guid);
|
||||
}
|
||||
|
||||
void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
|
||||
@@ -2585,7 +2585,7 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
|
||||
return;
|
||||
|
||||
_focusSpell = focusSpell;
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID());
|
||||
SetGuidValue(UNIT_FIELD_TARGET, target->GetGUID());
|
||||
if (focusSpell->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_DONT_TURN_DURING_CAST)
|
||||
AddUnitState(UNIT_STATE_ROTATING);
|
||||
|
||||
@@ -2601,9 +2601,9 @@ void Creature::ReleaseFocus(Spell const* focusSpell)
|
||||
|
||||
_focusSpell = NULL;
|
||||
if (Unit* victim = GetVictim())
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
|
||||
SetGuidValue(UNIT_FIELD_TARGET, victim->GetGUID());
|
||||
else
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
SetGuidValue(UNIT_FIELD_TARGET, ObjectGuid::Empty);
|
||||
|
||||
if (focusSpell->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_DONT_TURN_DURING_CAST)
|
||||
ClearUnitState(UNIT_STATE_ROTATING);
|
||||
|
||||
@@ -552,11 +552,11 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
|
||||
void StartPickPocketRefillTimer();
|
||||
void ResetPickPocketRefillTimer() { _pickpocketLootRestore = 0; }
|
||||
bool CanGeneratePickPocketLoot() const { return _pickpocketLootRestore <= time(NULL); }
|
||||
void SetSkinner(uint64 guid) { _skinner = guid; }
|
||||
uint64 GetSkinner() const { return _skinner; } // Returns the player who skinned this creature
|
||||
void SetSkinner(ObjectGuid guid) { _skinner = guid; }
|
||||
ObjectGuid GetSkinner() const { return _skinner; } // Returns the player who skinned this creature
|
||||
Player* GetLootRecipient() const;
|
||||
Group* GetLootRecipientGroup() const;
|
||||
bool hasLootRecipient() const { return m_lootRecipient || m_lootRecipientGroup; }
|
||||
bool hasLootRecipient() const { return !m_lootRecipient.IsEmpty() || m_lootRecipientGroup; }
|
||||
bool isTappedBy(Player const* player) const; // return true if the creature is tapped by the player or a member of his party.
|
||||
|
||||
void SetLootRecipient (Unit* unit);
|
||||
@@ -674,7 +674,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
|
||||
bool m_isTempWorldObject; //true when possessed
|
||||
|
||||
// Handling caster facing during spellcast
|
||||
void SetTarget(uint64 guid) override;
|
||||
void SetTarget(ObjectGuid guid) override;
|
||||
void FocusTarget(Spell const* focusSpell, WorldObject const* target);
|
||||
void ReleaseFocus(Spell const* focusSpell);
|
||||
|
||||
@@ -687,9 +687,9 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
|
||||
|
||||
static float _GetHealthMod(int32 Rank);
|
||||
|
||||
uint64 m_lootRecipient;
|
||||
ObjectGuid m_lootRecipient;
|
||||
uint32 m_lootRecipientGroup;
|
||||
uint64 _skinner;
|
||||
ObjectGuid _skinner;
|
||||
|
||||
/// Timers
|
||||
time_t _pickpocketLootRestore;
|
||||
@@ -746,15 +746,15 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject
|
||||
class AssistDelayEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
AssistDelayEvent(uint64 victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { }
|
||||
AssistDelayEvent(ObjectGuid victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { }
|
||||
|
||||
bool Execute(uint64 e_time, uint32 p_time) override;
|
||||
void AddAssistant(uint64 guid) { m_assistants.push_back(guid); }
|
||||
void AddAssistant(ObjectGuid guid) { m_assistants.push_back(guid); }
|
||||
private:
|
||||
AssistDelayEvent();
|
||||
|
||||
uint64 m_victim;
|
||||
std::list<uint64> m_assistants;
|
||||
ObjectGuid m_victim;
|
||||
GuidList m_assistants;
|
||||
Unit& m_owner;
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ GossipMenu::GossipMenu()
|
||||
{
|
||||
_menuId = 0;
|
||||
_locale = DEFAULT_LOCALE;
|
||||
_senderGUID = 0;
|
||||
_senderGUID.Clear();
|
||||
}
|
||||
|
||||
GossipMenu::~GossipMenu()
|
||||
@@ -188,7 +188,7 @@ void PlayerMenu::ClearMenus()
|
||||
_questMenu.ClearMenu();
|
||||
}
|
||||
|
||||
void PlayerMenu::SendGossipMenu(uint32 titleTextId, uint64 objectGUID)
|
||||
void PlayerMenu::SendGossipMenu(uint32 titleTextId, ObjectGuid objectGUID)
|
||||
{
|
||||
_gossipMenu.SetSenderGUID(objectGUID);
|
||||
|
||||
@@ -248,7 +248,7 @@ void PlayerMenu::SendGossipMenu(uint32 titleTextId, uint64 objectGUID)
|
||||
|
||||
void PlayerMenu::SendCloseGossip()
|
||||
{
|
||||
_gossipMenu.SetSenderGUID(0);
|
||||
_gossipMenu.SetSenderGUID(ObjectGuid::Empty);
|
||||
|
||||
WorldPacket data(SMSG_GOSSIP_COMPLETE, 0);
|
||||
_session->SendPacket(&data);
|
||||
@@ -323,7 +323,7 @@ void QuestMenu::ClearMenu()
|
||||
_questMenuItems.clear();
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, uint64 npcGUID)
|
||||
void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, ObjectGuid npcGUID)
|
||||
{
|
||||
WorldPacket data(SMSG_QUESTGIVER_QUEST_LIST, 100); // guess size
|
||||
data << uint64(npcGUID);
|
||||
@@ -368,20 +368,20 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string
|
||||
|
||||
data.put<uint8>(count_pos, count);
|
||||
_session->SendPacket(&data);
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID));
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC=%s", npcGUID.ToString().c_str());
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverStatus(uint32 questStatus, uint64 npcGUID) const
|
||||
void PlayerMenu::SendQuestGiverStatus(uint32 questStatus, ObjectGuid npcGUID) const
|
||||
{
|
||||
WorldPacket data(SMSG_QUESTGIVER_STATUS, 8 + 4);
|
||||
data << uint64(npcGUID);
|
||||
data << uint32(questStatus);
|
||||
|
||||
_session->SendPacket(&data);
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus);
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC=%s, status=%u", npcGUID.ToString().c_str(), questStatus);
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const
|
||||
void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGUID, bool activateAccept) const
|
||||
{
|
||||
std::string questTitle = quest->GetTitle();
|
||||
std::string questDetails = quest->GetDetails();
|
||||
@@ -441,7 +441,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID,
|
||||
}
|
||||
_session->SendPacket(&data);
|
||||
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPC=%s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
@@ -615,7 +615,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId());
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const
|
||||
void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUID, bool enableNext) const
|
||||
{
|
||||
std::string questTitle = quest->GetTitle();
|
||||
std::string questOfferRewardText = quest->GetOfferRewardText();
|
||||
@@ -676,10 +676,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
|
||||
quest->BuildExtraQuestInfo(data, _session->GetPlayer());
|
||||
|
||||
_session->SendPacket(&data);
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPC=%s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());
|
||||
}
|
||||
|
||||
void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const
|
||||
void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, ObjectGuid npcGUID, bool canComplete, bool closeOnCancel) const
|
||||
{
|
||||
// We can always call to RequestItems, but this packet only goes out if there are actually
|
||||
// items. Otherwise, we'll skip straight to the OfferReward
|
||||
@@ -764,7 +764,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID,
|
||||
data << uint32(0x40);
|
||||
|
||||
_session->SendPacket(&data);
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());
|
||||
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPC=%s, questid=%u", npcGUID.ToString().c_str(), quest->GetQuestId());
|
||||
}
|
||||
|
||||
void PlayerMenu::AddQuestLevelToTitle(std::string &title, int32 level)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#define TRINITYCORE_GOSSIP_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "QuestDef.h"
|
||||
#include "NPCHandler.h"
|
||||
|
||||
@@ -167,8 +168,8 @@ class GossipMenu
|
||||
|
||||
void SetMenuId(uint32 menu_id) { _menuId = menu_id; }
|
||||
uint32 GetMenuId() const { return _menuId; }
|
||||
void SetSenderGUID(uint64 guid) { _senderGUID = guid; }
|
||||
uint64 GetSenderGUID() const { return _senderGUID; }
|
||||
void SetSenderGUID(ObjectGuid guid) { _senderGUID = guid; }
|
||||
ObjectGuid GetSenderGUID() const { return _senderGUID; }
|
||||
void SetLocale(LocaleConstant locale) { _locale = locale; }
|
||||
LocaleConstant GetLocale() const { return _locale; }
|
||||
|
||||
@@ -217,7 +218,7 @@ class GossipMenu
|
||||
GossipMenuItemContainer _menuItems;
|
||||
GossipMenuItemDataContainer _menuItemData;
|
||||
uint32 _menuId;
|
||||
uint64 _senderGUID;
|
||||
ObjectGuid _senderGUID;
|
||||
LocaleConstant _locale;
|
||||
};
|
||||
|
||||
@@ -267,22 +268,22 @@ class PlayerMenu
|
||||
uint32 GetGossipOptionAction(uint32 selection) const { return _gossipMenu.GetMenuItemAction(selection); }
|
||||
bool IsGossipOptionCoded(uint32 selection) const { return _gossipMenu.IsMenuItemCoded(selection); }
|
||||
|
||||
void SendGossipMenu(uint32 titleTextId, uint64 objectGUID);
|
||||
void SendGossipMenu(uint32 titleTextId, ObjectGuid objectGUID);
|
||||
void SendCloseGossip();
|
||||
void SendPointOfInterest(uint32 poiId) const;
|
||||
|
||||
/*********************************************************/
|
||||
/*** QUEST SYSTEM ***/
|
||||
/*********************************************************/
|
||||
void SendQuestGiverStatus(uint32 questStatus, uint64 npcGUID) const;
|
||||
void SendQuestGiverStatus(uint32 questStatus, ObjectGuid npcGUID) const;
|
||||
|
||||
void SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, uint64 npcGUID);
|
||||
void SendQuestGiverQuestList(QEmote const& eEmote, const std::string& Title, ObjectGuid npcGUID);
|
||||
|
||||
void SendQuestQueryResponse(Quest const* quest) const;
|
||||
void SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const;
|
||||
void SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGUID, bool activateAccept) const;
|
||||
|
||||
void SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const;
|
||||
void SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const;
|
||||
void SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUID, bool enableNext) const;
|
||||
void SendQuestGiverRequestItems(Quest const* quest, ObjectGuid npcGUID, bool canComplete, bool closeOnCancel) const;
|
||||
|
||||
static void AddQuestLevelToTitle(std::string &title, int32 level);
|
||||
|
||||
|
||||
@@ -28,7 +28,9 @@ TempSummon::TempSummon(SummonPropertiesEntry const* properties, Unit* owner, boo
|
||||
Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
|
||||
m_timer(0), m_lifetime(0)
|
||||
{
|
||||
m_summonerGUID = owner ? owner->GetGUID() : 0;
|
||||
if (owner)
|
||||
m_summonerGUID = owner->GetGUID();
|
||||
|
||||
m_unitTypeMask |= UNIT_MASK_SUMMON;
|
||||
}
|
||||
|
||||
@@ -274,7 +276,7 @@ void TempSummon::RemoveFromWorld()
|
||||
if (slot > 0)
|
||||
if (Unit* owner = GetSummoner())
|
||||
if (owner->m_SummonSlot[slot] == GetGUID())
|
||||
owner->m_SummonSlot[slot] = 0;
|
||||
owner->m_SummonSlot[slot].Clear();
|
||||
}
|
||||
|
||||
//if (GetOwnerGUID())
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user