Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/AI/EventAI/CreatureEventAI.cpp src/server/game/Achievements/AchievementMgr.cpp src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Pet/Pet.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Transport/Transport.cpp src/server/game/Entities/Unit/StatSystem.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Entities/Unit/Unit.h src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Handlers/ChatHandler.cpp src/server/game/Handlers/ItemHandler.cpp src/server/game/Handlers/NPCHandler.cpp src/server/game/Handlers/PetHandler.cpp src/server/game/Handlers/SpellHandler.cpp src/server/game/Instances/InstanceScript.cpp src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/game/Spells/SpellEffects.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp src/server/scripts/EasternKingdoms/boss_kruul.cpp src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp src/server/scripts/EasternKingdoms/zone_ghostlands.cpp src/server/scripts/EasternKingdoms/zone_ironforge.cpp src/server/scripts/EasternKingdoms/zone_loch_modan.cpp src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp src/server/scripts/Kalimdor/zone_azshara.cpp src/server/scripts/Kalimdor/zone_darkshore.cpp src/server/scripts/Kalimdor/zone_durotar.cpp src/server/scripts/Kalimdor/zone_felwood.cpp src/server/scripts/Kalimdor/zone_feralas.cpp src/server/scripts/Kalimdor/zone_orgrimmar.cpp src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp src/server/scripts/Kalimdor/zone_tanaris.cpp src/server/scripts/Kalimdor/zone_thousand_needles.cpp src/server/scripts/Kalimdor/zone_thunder_bluff.cpp src/server/scripts/Kalimdor/zone_ungoro_crater.cpp src/server/scripts/Northrend/zone_dalaran.cpp src/server/scripts/Spells/spell_pet.cpp src/server/scripts/Spells/spell_shaman.cpp
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- Set Entry 18955 "Camera Shaker - 30-90 seconds" as trigger and remove random movement
|
||||
UPDATE `creature_template` SET `modelid1`=16925, `modelid2`=16480, `flags_extra`=`flags_extra`|128 WHERE `entry`=18955;
|
||||
UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `id`=18955;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Fix SAI for Sunseeker Harvester
|
||||
UPDATE `smart_scripts` SET `event_flags`=7 WHERE `entryorguid`=19509 AND `source_type`=0 AND `id`=2;
|
||||
@@ -0,0 +1,55 @@
|
||||
-- Fix quest: Adding Injury to Insult (12481)
|
||||
|
||||
UPDATE `creature` SET `position_z`=207.3961 WHERE `guid`=112513;
|
||||
|
||||
UPDATE `creature_template` SET `speed_run`=2.571428, `InhabitType`=7, `HoverHeight`=7.5 WHERE `entry`=24238;
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry`=24238;
|
||||
INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`) VALUES
|
||||
(24238,33554432,1);
|
||||
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (24458,24474);
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (24238,24458,24474) 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
|
||||
(24238,0,0,0,1,0,100,0,10000,15000,45000,60000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On update OOC - Say text 2'),
|
||||
(24238,0,1,2,8,0,100,1,43315,0,0,0,84,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On spellhit Vrykul Insult - Invoker say text 0'),
|
||||
(24238,0,2,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On spellhit Vrykul Insult - Say text 1'),
|
||||
(24238,0,3,4,9,0,100,1,0,10,0,0,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On target within 10y - Unmount'),
|
||||
(24238,0,4,5,61,0,100,0,0,0,0,0,60,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On target within 10y - Disable fly'),
|
||||
(24238,0,5,0,61,0,100,0,0,0,0,0,91,33554432,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On target within 10y - Remove unit_field_bytes1 (hovering)'),
|
||||
(24238,0,6,0,8,0,100,0,6660,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On spellhit Shoot - Attack'),
|
||||
(24238,0,7,0,8,0,100,0,11971,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On spellhit Sunder Armor - Attack'),
|
||||
(24238,0,8,0,8,0,100,0,18802,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On spellhit Frost Shot - Attack'),
|
||||
(24238,0,9,0,8,0,100,0,43895,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On spellhit Lydell''s Poison - Attack'),
|
||||
(24238,0,10,0,6,0,100,0,0,0,0,0,11,43371,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On death - Spellcast Bjorn Kill Credit'),
|
||||
(24238,0,11,0,0,0,100,0,5000,10000,10000,15000,11,32736,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On update IC - Spellcast Mortal Strike'),
|
||||
(24238,0,12,0,0,0,100,0,0,5000,10000,15000,11,33661,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On update IC - Spellcast Crush Armor'),
|
||||
(24238,0,13,0,11,0,100,0,0,0,0,0,43,0,22657,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On spawn - Mount'),
|
||||
(24238,0,14,15,7,0,100,0,0,0,0,0,43,0,22657,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On evade - Mount'),
|
||||
(24238,0,15,16,61,0,100,0,0,0,0,0,60,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On evade - Enable fly'),
|
||||
(24238,0,16,0,61,0,100,0,0,0,0,0,90,33554432,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Bjorn Halgurdsson - On evade - Set unit_field_bytes1 (hovering)'),
|
||||
|
||||
(24458,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Lydell - On aggro - Say line'),
|
||||
(24458,0,1,0,9,0,100,0,0,5,8000,15000,11,11971,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Lydell - On target within 5y - Spellcast Sunder Armor'),
|
||||
(24458,0,2,0,0,0,100,0,3000,5000,70000,75000,11,43895,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Lydell - On update IC - Spellcast Lydell''s Poison'),
|
||||
|
||||
(24474,0,0,0,9,0,100,0,5,30,8000,10000,11,18802,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Vengeance Landing Assassin - On target within 5-30y - Spellcast Frost Shot'),
|
||||
(24474,0,1,0,9,0,100,0,5,30,1500,2000,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Vengeance Landing Assassin - On target within 5-30y - Spellcast Shoot');
|
||||
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=43315;
|
||||
INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
|
||||
(43315,46348,2,'On aura Vrykul Insult apply Slow Creature');
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=43315;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorType`,`ScriptName`,`Comment`) VALUES
|
||||
(17,0,43315,0,31,1,3,24238,0,12,'','Spell Vrykul Insult is castable on Bjorn Halgurdsson only');
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry` IN (24238,24458);
|
||||
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
|
||||
(24238,0,0,'[Crude Vrykul] Bjorns mottar haelgond sygar!',14,0,100,0,0,0,'Bjorn Halgurdsson'),
|
||||
(24238,1,0,'No one speaks of my mother in that manner!',14,0,100,0,0,0,'Bjorn Halgurdsson'),
|
||||
(24238,2,0,'Drive the invaders out! For Queen Angerboda!',14,0,100,0,0,0,'Bjorn Halgurdsson'),
|
||||
(24238,2,1,'Fight without fear and the Val''kyr will reward you!',14,0,100,0,0,0,'Bjorn Halgurdsson'),
|
||||
(24238,2,2,'The Winterskorn tribe will prevail!',14,0,100,0,0,0,'Bjorn Halgurdsson'),
|
||||
|
||||
(24458,0,0,'I''ve been saving this just for you, big boy!',12,0,100,0,0,0,'Lydell');
|
||||
@@ -0,0 +1,13 @@
|
||||
-- Fix quest: Badlands Reagent Run II (2203)
|
||||
|
||||
UPDATE `item_loot_template` SET `mincountOrRef`=3, `maxcount`=3 WHERE `item`=7866;
|
||||
|
||||
DELETE FROM `item_loot_template` WHERE `item`=7866 AND `entry`=16883;
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=9712;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
|
||||
(13,1,9712,0,31,3,2726,0,0,'','Spell Thaumaturgy Channel targets Scorched Guardian');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=9712;
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(9712,'spell_q2203_thaumaturgy_channel');
|
||||
@@ -0,0 +1,15 @@
|
||||
-- Updates for Quest A Blade Fit For A Champion
|
||||
|
||||
UPDATE `creature_template` SET `ScriptName`= 'npc_lake_frog' WHERE `entry` IN (33211,33224);
|
||||
UPDATE `creature_template` SET `npcflag`=1 WHERE `entry` IN (33224);
|
||||
|
||||
-- Add option conditions for gossip
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (10316);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
|
||||
(15,10316,0,0,2,44981,1,1,1,0,'','Maiden of Ashwood Lake - Show gossip option if player does not have Ashwood Brand');
|
||||
|
||||
-- NPC talk text insert from sniff
|
||||
DELETE FROM `creature_text` WHERE `entry`=33220;
|
||||
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
|
||||
(33220,0,0, 'Can it really be? Free after all these years?',12,0,100,1,0,0, 'Maiden of Ashwood Lake'),
|
||||
(33220,1,0, 'And now, I must return to the waters of the lake.',12,0,100,2,0,0, 'Maiden of Ashwood Lake');
|
||||
@@ -0,0 +1,166 @@
|
||||
-- Fix quest: Convocation at Zol'Heb (12730)
|
||||
|
||||
SET @GUID := 45214;
|
||||
|
||||
SET @NPC_ELM_BUNNY_LARGE := 24021;
|
||||
SET @NPC_AKALI_PROPHET := 29028;
|
||||
SET @NPC_HARKOA := 29050;
|
||||
SET @GO_SKULL_PILE := 190594;
|
||||
SET @GO_CIRCLE := 191123;
|
||||
SET @GO_TORCH := 191365;
|
||||
SET @GO_SPELLFOCUS := 300221;
|
||||
|
||||
DELETE FROM `creature` WHERE `guid` IN (@GUID);
|
||||
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES
|
||||
(@GUID,@NPC_ELM_BUNNY_LARGE,571,1,1,21999,6448.935,-4475.177,451.3292,0.8028514,300,0,0);
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry` IN (@NPC_AKALI_PROPHET,@NPC_HARKOA);
|
||||
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
|
||||
(@NPC_AKALI_PROPHET,0,0,'What is this? I recognize you from when I killed Akali. You must be this $N that everyone is dreading.',14,0,100,25,0,12009,'Prophet of Akali'),
|
||||
(@NPC_AKALI_PROPHET,1,0,'You don''t worry me, $g boy : girl;. Just the opposite - I look forward to killing you. Nothing will stand between me and Zim''Torga now!',14,0,100,15,0,6200,'Prophet of Akali'),
|
||||
(@NPC_AKALI_PROPHET,2,0,'How sad that only now do you grasp the truth - I wield the power of a god. You are a mere mortal. You cannot hope to defeat me!',14,0,100,11,0,0,'Prophet of Akali'),
|
||||
(@NPC_AKALI_PROPHET,3,0,'You''ve meddled in affairs that were none of your business. You are nothing but a foreign invader. Prepare to die!',14,0,100,15,0,0,'Prophet of Akali'),
|
||||
(@NPC_AKALI_PROPHET,4,0,'The prophet begins to cast a ritual of annihilation.',16,0,100,0,0,0,'Prophet of Akali'),
|
||||
(@NPC_AKALI_PROPHET,5,0,'What? HAR''KOA?!',14,0,100,0,0,0,'Prophet of Akali'),
|
||||
(@NPC_AKALI_PROPHET,6,0,'Very well, kitten. I see no need to delay your inevitable demise. I look forward to dealing with you just as soon as I finish off this fool!',14,0,100,0,0,0,'Prophet of Akali'),
|
||||
(@NPC_AKALI_PROPHET,7,0,'NO! I will not be defeated!',14,0,100,0,0,0,'Prophet of Akali'),
|
||||
(@NPC_HARKOA,0,0,'PROPHET!',14,0,100,0,0,643,'Har''koa'),
|
||||
(@NPC_HARKOA,1,0,'YOU KEEP YOUR FILTHY DRAKKARI HANDS OFF OF THEM!',14,0,100,35,0,11887,'Har''koa'),
|
||||
(@NPC_HARKOA,2,0,'I THINK NOT. YOU WILL DROP YOUR IMMUNITY, CEASE YOUR RITUAL NOW AND RELEASE THEM!',14,0,100,0,0,11883,'Har''koa'),
|
||||
(@NPC_HARKOA,3,0,'Thank you. Once again you have saved us all. I will see you back at Zim''Torga.',14,0,100,0,0,0,'Har''koa');
|
||||
|
||||
UPDATE `creature_template` SET `speed_run`=3.5714286, `dmg_multiplier`=7.5 WHERE `entry`=@NPC_HARKOA;
|
||||
UPDATE `creature_model_info` SET `bounding_radius`=2.17, `combat_reach`=7 WHERE `modelid`=28009;
|
||||
|
||||
DELETE FROM `creature_equip_template` WHERE `entry`=@NPC_AKALI_PROPHET;
|
||||
INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES
|
||||
(@NPC_AKALI_PROPHET,1,39892,0,0);
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (52956,52989);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
|
||||
(13,1,52956,0,0,31,0,3,@NPC_ELM_BUNNY_LARGE,0,0,0,'','Spell Prophet of Akali Convocation targets ELM General Purpose Bunny Large'),
|
||||
(13,1,52989,0,0,31,0,4,0,0,0,0,'','Spell Akali''s Stun targets players');
|
||||
|
||||
DELETE FROM `spell_scripts` WHERE `id`=53010;
|
||||
INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
|
||||
(53010,0,0,14,52989,0,0,0,0,0,0);
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=53350;
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(53350,'spell_q12730_quenching_mist');
|
||||
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=52989;
|
||||
INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
|
||||
(52989,-53504,1,'On spellhit Akali''s Stun - Remove aura Flickering Flames');
|
||||
|
||||
DELETE FROM `waypoints` WHERE `entry` IN (@NPC_HARKOA,@NPC_HARKOA*10);
|
||||
INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
|
||||
(@NPC_HARKOA,1,6369.87,-4507.906,458.1296,'Har''koa'),
|
||||
(@NPC_HARKOA,2,6372.938,-4508.172,457.8796,'Har''koa'),
|
||||
(@NPC_HARKOA,3,6377.188,-4508.172,457.8796,'Har''koa'),
|
||||
(@NPC_HARKOA,4,6387.688,-4507.922,457.8796,'Har''koa'),
|
||||
(@NPC_HARKOA,5,6403.007,-4521.438,458.1296,'Har''koa'),
|
||||
|
||||
(@NPC_HARKOA*10,1,6404.547,-4486.095,451.1878,'Har''koa'),
|
||||
(@NPC_HARKOA*10,2,6395.547,-4486.345,451.1878,'Har''koa'),
|
||||
(@NPC_HARKOA*10,3,6391.547,-4486.345,451.1878,'Har''koa'),
|
||||
(@NPC_HARKOA*10,4,6390.047,-4486.595,451.1878,'Har''koa'),
|
||||
(@NPC_HARKOA*10,5,6388.047,-4486.595,451.4378,'Har''koa'),
|
||||
(@NPC_HARKOA*10,6,6367.047,-4487.345,455.9378,'Har''koa'),
|
||||
(@NPC_HARKOA*10,7,6364.297,-4487.595,457.9378,'Har''koa'),
|
||||
(@NPC_HARKOA*10,8,6348.413,-4488.189,458.1296,'Har''koa');
|
||||
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@NPC_AKALI_PROPHET,@NPC_HARKOA);
|
||||
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (@GO_SKULL_PILE,@GO_CIRCLE,@GO_TORCH,@GO_SPELLFOCUS);
|
||||
DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@NPC_AKALI_PROPHET,@NPC_HARKOA);
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_AKALI_PROPHET,@NPC_HARKOA) AND `source_type`=0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@GO_SKULL_PILE,@GO_CIRCLE,@GO_TORCH,@GO_SPELLFOCUS) AND `source_type`=1;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_AKALI_PROPHET*100+0,@NPC_AKALI_PROPHET*100+1,@NPC_AKALI_PROPHET*100+2,@NPC_HARKOA*100,@GO_CIRCLE*100,@GO_TORCH*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
|
||||
(@NPC_AKALI_PROPHET,0,0,1,54,0,100,0,0,0,0,0,18,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - Just summoned - Set unit_flags IMMUNE_TO_PC'),
|
||||
(@NPC_AKALI_PROPHET,0,1,2,61,0,100,0,0,0,0,0,11,34427,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - Just summoned - Spellcast Ethereal Teleport'),
|
||||
(@NPC_AKALI_PROPHET,0,2,3,61,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Prophet of Akali - Just summoned - Store targetlist'),
|
||||
(@NPC_AKALI_PROPHET,0,3,0,61,0,100,0,0,0,0,0,80,@NPC_AKALI_PROPHET*100+0,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - Just summoned - Run script 0'),
|
||||
(@NPC_AKALI_PROPHET,0,4,0,0,1,100,0,10000,12000,14000,16000,11,53496,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Prophet of Akali - On update IC (phase 1) - Spellcast Darting Flames'),
|
||||
(@NPC_AKALI_PROPHET,0,5,0,0,1,100,0,16000,18000,12000,15000,11,53493,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Prophet of Akali - On update IC (phase 1) - Spellcast Incinerate'),
|
||||
(@NPC_AKALI_PROPHET,0,6,7,2,0,100,1,0,70,0,0,11,52982,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - On health below 70% - Spellcast Akali''s Immunity'),
|
||||
(@NPC_AKALI_PROPHET,0,7,8,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - On health below 70% - Disable autoattack'),
|
||||
(@NPC_AKALI_PROPHET,0,8,9,61,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - On health below 70% - Set event phase 2'),
|
||||
(@NPC_AKALI_PROPHET,0,9,0,61,0,100,0,0,0,0,0,80,@NPC_AKALI_PROPHET*100+1,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - On health below 70% - Run script 1'),
|
||||
(@NPC_AKALI_PROPHET,0,10,11,34,4,100,0,0,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0.8028514, 'Prophet of Akali - On movement inform (phase 3) - Set orientation'),
|
||||
(@NPC_AKALI_PROPHET,0,11,12,61,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - On movement inform (phase 3) - Set event phase 0'),
|
||||
(@NPC_AKALI_PROPHET,0,12,0,61,0,100,0,0,0,0,0,80,@NPC_AKALI_PROPHET*100+2,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali - On movement inform (phase 3) - Run script 2'),
|
||||
|
||||
(@NPC_HARKOA,0,0,0,54,0,100,0,0,0,0,0,53,1,@NPC_HARKOA,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa - Just summoned - Start WP movement'),
|
||||
(@NPC_HARKOA,0,1,0,40,0,100,0,5,@NPC_HARKOA,0,0,45,0,1,0,0,0,0,19,@NPC_AKALI_PROPHET,50,0,0,0,0,0, 'Har''koa - On WP 5 reached - Set data 0 1 Akali Prophet'),
|
||||
(@NPC_HARKOA,0,2,0,38,0,100,0,0,1,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Har''koa - On data 0 1 set - Turn to'),
|
||||
(@NPC_HARKOA,0,3,0,38,0,100,0,0,2,0,0,80,@NPC_HARKOA*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa - On data 0 2 set - Run script'),
|
||||
(@NPC_HARKOA,0,4,5,7,0,100,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa - On Evade - Say line'),
|
||||
(@NPC_HARKOA,0,5,0,61,0,100,0,0,0,0,0,53,1,@NPC_HARKOA*10,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa - On Evade - Start WP movement'),
|
||||
(@NPC_HARKOA,0,6,0,0,0,100,0,15000,16000,9000,10000,11,53499,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Har''koa - On update IC - Spellcast Rake'),
|
||||
(@NPC_HARKOA,0,7,0,0,0,100,0,16000,17000,10000,10000,11,53498,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Har''koa - On update IC - Spellcast Swipe'),
|
||||
(@NPC_HARKOA,0,8,0,0,0,100,0,10000,12000,12000,15000,86,53350,0,19,@NPC_AKALI_PROPHET,30,0,1,0,0,0,0,0,0,0, 'Har''koa - On update IC - Spellcast Quenching Mist'),
|
||||
(@NPC_HARKOA,0,9,0,40,0,100,0,8,@NPC_HARKOA*10,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa - On WP 8 reached - Despawn'),
|
||||
|
||||
(@GO_SKULL_PILE,1,0,1,38,0,100,0,0,1,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zul''Drak Skull Pile 02 - On data 0 1 set - Set phasemask 2'),
|
||||
(@GO_SKULL_PILE,1,1,0,61,0,100,0,0,0,0,0,80,@GO_TORCH*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Zul''Drak Skull Pile 02 - On data 0 1 set - Run script'),
|
||||
|
||||
(@GO_CIRCLE,1,0,1,38,0,100,0,0,1,0,0,9,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Convocation Summoning Circle - On data 0 1 set - Activate gameobject'),
|
||||
(@GO_CIRCLE,1,1,0,61,0,100,0,0,0,0,0,80,@GO_CIRCLE*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Convocation Summoning Circle - On data 0 1 set - Run script'),
|
||||
|
||||
(@GO_TORCH,1,0,1,38,0,100,0,0,1,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Shadow Council Torch (x2.00) - On data 0 1 set - Set phasemask 2'),
|
||||
(@GO_TORCH,1,1,0,61,0,100,0,0,0,0,0,80,@GO_TORCH*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Shadow Council Torch (x2.00) - On data 0 1 set - Run script'),
|
||||
|
||||
(@GO_SPELLFOCUS,1,0,1,38,0,100,0,0,1,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'TEMP Convocation Summoning Circle - On data 0 1 set - Set phasemask 2'),
|
||||
(@GO_SPELLFOCUS,1,1,0,61,0,100,0,0,0,0,0,80,@GO_TORCH*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'TEMP Convocation Summoning Circle - On data 0 1 set - Run script'),
|
||||
|
||||
(@NPC_AKALI_PROPHET*100+0,9,0,0,0,0,100,0,0,0,0,0,45,0,1,0,0,0,0,13,@GO_SKULL_PILE,0,20,0,0,0,0, 'Prophet of Akali script 0 - Set data 0 1 Zul''Drak Skull Pile 02'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,1,0,0,0,100,0,0,0,0,0,45,0,1,0,0,0,0,20,@GO_CIRCLE,20,0,0,0,0,0, 'Prophet of Akali script 0 - Set data 0 1 Convocation Summoning Circle'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,2,0,0,0,100,0,0,0,0,0,45,0,1,0,0,0,0,13,@GO_TORCH,0,20,0,0,0,0, 'Prophet of Akali script 0 - Set data 0 1 Shadow Council Torch (x2.00)'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,3,0,0,0,100,0,0,0,0,0,45,0,1,0,0,0,0,20,@GO_SPELLFOCUS,20,0,0,0,0,0, 'Prophet of Akali script 0 - Set data 0 1 TEMP Convocation Summoning Circle'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,4,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Prophet of Akali script 0 - Turn to summoner'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,5,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Prophet of Akali script 0 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,6,0,0,0,100,0,6000,6000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Prophet of Akali script 0 - Turn to summoner'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,7,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Prophet of Akali script 0 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,8,0,0,0,100,0,3600,3600,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 0 - Remove unit_flags IMMUNE_TO_PC'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,9,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Prophet of Akali script 0 - Start attack'),
|
||||
(@NPC_AKALI_PROPHET*100+0,9,10,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 0 - Set event phase 1'),
|
||||
|
||||
(@NPC_AKALI_PROPHET*100+1,9,0,0,0,0,100,0,2400,2400,0,0,11,52989,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 1 - Spellcast Akali''s Stun'),
|
||||
(@NPC_AKALI_PROPHET*100+1,9,1,0,0,0,100,0,0,0,0,0,69,1,0,0,0,0,0,8,0,0,0,6448.36,-4475.49,451.0759,0, 'Prophet of Akali script 1 - Move to position'),
|
||||
(@NPC_AKALI_PROPHET*100+1,9,2,0,0,0,100,0,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 1 - Set event phase 3'),
|
||||
|
||||
(@NPC_AKALI_PROPHET*100+2,9,0,0,0,0,100,0,800,800,0,0,1,2,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,1,0,0,0,100,0,6000,6000,0,0,1,3,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,2,0,0,0,100,0,2400,2400,0,0,11,52993,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Spellcast Akali''s Ritual of Annihilation'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,3,0,0,0,100,0,0,0,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,4,0,0,0,100,0,2000,2000,0,0,12,@NPC_HARKOA,1,300000,0,0,0,8,0,0,0,6355.075,-4494.311,458.179,0, 'Prophet of Akali script 2 - Summon Har''koa'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,5,0,0,0,100,0,4000,4000,0,0,45,0,1,0,0,0,0,19,@NPC_HARKOA,100,0,0,0,0,0, 'Prophet of Akali script 2 - Set data 0 1 Har''koa'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,6,0,0,0,100,0,4600,4600,0,0,45,0,2,0,0,0,0,19,@NPC_HARKOA,100,0,0,0,0,0, 'Prophet of Akali script 2 - Set data 0 2 Har''koa'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,7,0,0,0,100,0,1500,1500,0,0,66,0,0,0,0,0,0,19,@NPC_HARKOA,100,0,0,0,0,0, 'Prophet of Akali script 2 - Turn to Har''koa'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,8,0,0,0,100,0,1300,1300,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,9,0,0,0,100,0,7100,7100,0,0,66,0,0,0,0,0,0,19,@NPC_HARKOA,100,0,0,0,0,0, 'Prophet of Akali script 2 - Turn to Har''koa'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,10,0,0,0,100,0,100,100,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,11,0,0,0,100,0,9500,9500,0,0,92,0,52993,1,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Interrupt spellcast'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,12,0,0,0,100,0,300,300,0,0,11,53010,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Spellcast Convocation at Zol''Heb: Removef Akali''s Stun'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,13,0,0,0,100,0,0,0,0,0,28,52982,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Remove aura Akali''s Immunity'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,14,0,0,0,100,0,100,100,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Say line'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,15,0,0,0,100,0,0,0,0,0,19,512,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Remove unit_flags IMMUNE_TO_NPC'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,16,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Set event phase 1'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,17,0,0,0,100,0,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Enable combat movement'),
|
||||
(@NPC_AKALI_PROPHET*100+2,9,18,0,0,0,100,0,0,0,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Prophet of Akali script 2 - Enable autoattack'),
|
||||
|
||||
(@NPC_HARKOA*100,9,0,0,0,0,100,0,1200,1200,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa script 0 - Say line'),
|
||||
(@NPC_HARKOA*100,9,1,0,0,0,100,0,5100,5100,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa script 0 - Say line'),
|
||||
(@NPC_HARKOA*100,9,2,0,0,0,100,0,11000,11000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa script 0 - Say line'),
|
||||
(@NPC_HARKOA*100,9,3,0,0,0,100,0,0,0,0,0,11,53004,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa script 0 - Spellcast Har''koa''s Compulsion'),
|
||||
(@NPC_HARKOA*100,9,4,0,0,0,100,0,400,400,0,0,19,512,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa script 0 - Remove unit_flags IMMUNE_TO_NPC'),
|
||||
(@NPC_HARKOA*100,9,5,0,0,0,100,0,2700,2700,0,0,97,108.6365,0,0,0,0,0,1,0,0,0,6439.68,-4484.5,451.246,0, 'Har''koa script 0 - Jump to position'),
|
||||
(@NPC_HARKOA*100,9,6,0,0,0,100,0,2000,2000,0,0,49,0,0,0,0,0,0,19,@NPC_AKALI_PROPHET,50,0,0,0,0,0, 'Har''koa script 0 - Start attack'),
|
||||
(@NPC_HARKOA*100,9,7,0,0,0,100,0,0,0,0,0,11,53029,0,0,0,0,0,19,@NPC_AKALI_PROPHET,50,0,0,0,0,0, 'Har''koa script 0 - Spellcast Har''koa''s Challenge'),
|
||||
(@NPC_HARKOA*100,9,8,0,0,0,100,0,0,0,0,0,101,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Har''koa script 0 - Set homeposition'),
|
||||
|
||||
(@GO_CIRCLE*100,9,0,0,0,0,100,0,1000,1000,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Convocation Summoning Circle script - Set phasemask 2'),
|
||||
(@GO_CIRCLE*100,9,1,0,0,0,100,0,299000,299000,0,0,44,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Convocation Summoning Circle script - Set phasemask 1'),
|
||||
|
||||
(@GO_TORCH*100,9,0,0,0,0,100,0,300000,300000,0,0,44,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Shadow Council Torch (x2.00) script - Set phasemask 1');
|
||||
@@ -0,0 +1,25 @@
|
||||
-- Add missing lake frog spawns
|
||||
SET @GUID := 72770;
|
||||
SET @POOL := 60003;
|
||||
|
||||
DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+5;
|
||||
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
|
||||
(@GUID+0,33224,571,1,1,0,0,3819.225,-4360.781,182.312,4.927386,120,5,0,1,0,1),
|
||||
(@GUID+1,33224,571,1,1,0,0,3822.34,-4362.166,182.5561,0.4575224,120,5,0,1,0,1),
|
||||
(@GUID+2,33224,571,1,1,0,0,3803.501,-4354.347,180.8061,4.409188,120,5,0,1,0,1),
|
||||
(@GUID+3,33224,571,1,1,0,0,3778.917,-4312.72,183.4503,0.9890772,120,5,0,1,0,1),
|
||||
(@GUID+4,33224,571,1,1,0,0,3805.652,-4352.625,181.4311,5.342484,120,5,0,1,0,1),
|
||||
(@GUID+5,33224,571,1,1,0,0,3803.122,-4347.75,180.8061,2.036006,120,5,0,1,0,1);
|
||||
|
||||
DELETE FROM `pool_template` WHERE `entry`=@POOL;
|
||||
INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES
|
||||
(@POOL, 1, 'Lake Frog (33224)');
|
||||
|
||||
DELETE FROM `pool_creature` WHERE `guid` BETWEEN @GUID AND @GUID+5;
|
||||
INSERT INTO `pool_creature` (`guid`, `pool_entry`, `chance`, `description`) VALUES
|
||||
(@GUID+0, @POOL, 0, 'Lake Frog (33224) - Spawn 1'),
|
||||
(@GUID+1, @POOL, 0, 'Lake Frog (33224) - Spawn 2'),
|
||||
(@GUID+2, @POOL, 0, 'Lake Frog (33224) - Spawn 3'),
|
||||
(@GUID+3, @POOL, 0, 'Lake Frog (33224) - Spawn 4'),
|
||||
(@GUID+4, @POOL, 0, 'Lake Frog (33224) - Spawn 5'),
|
||||
(@GUID+5, @POOL, 0, 'Lake Frog (33224) - Spawn 6');
|
||||
@@ -0,0 +1,31 @@
|
||||
-- Redo lake frog spawns
|
||||
SET @GUID := 116037;
|
||||
DELETE FROM `creature` WHERE `id`=33211;
|
||||
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
|
||||
(@GUID+0,33211,571,1,1,0,0,3714.71313,-4303.6416,182.597778,0.5710628,120,5,0,1,0,1),
|
||||
(@GUID+1,33211,571,1,1,0,0,3727.22876,-4303.32568,182.255157,0.8603498,120,5,0,1,0,1),
|
||||
(@GUID+2,33211,571,1,1,0,0,3728.51538,-4303.354,182.132217,0.182852328,120,5,0,1,0,1),
|
||||
(@GUID+3,33211,571,1,1,0,0,3743.80762,-4300.40234,181.845047,2.43378878,120,5,0,1,0,1),
|
||||
(@GUID+4,33211,571,1,1,0,0,3745.317,-4298.76855,182.1726,3.83392715,120,5,0,1,0,1),
|
||||
(@GUID+5,33211,571,1,1,0,0,3756.09375,-4303.11963,181.720047,4.65554,120,5,0,1,0,1),
|
||||
(@GUID+6,33211,571,1,1,0,0,3771.87622,-4306.225,184.171371,1.57087767,120,5,0,1,0,1),
|
||||
(@GUID+7,33211,571,1,1,0,0,3772.263,-4314.93066,180.231476,2.44895387,120,5,0,1,0,1),
|
||||
(@GUID+8,33211,571,1,1,0,0,3772.70654,-4317.774,179.991028,4.85300732,120,5,0,1,0,1),
|
||||
(@GUID+9,33211,571,1,1,0,0,3775.58887,-4305.576,185.450317,6.26560926,120,5,0,1,0,1),
|
||||
(@GUID+10,33211,571,1,1,0,0,3777.857,-4321.65234,180.575317,6.11946154,120,5,0,1,0,1),
|
||||
(@GUID+11,33211,571,1,1,0,0,3778.75439,-4320.91846,180.922287,5.89215,120,5,0,1,0,1),
|
||||
(@GUID+12,33211,571,1,1,0,0,3789.02856,-4324.987,182.870514,0.5579872,120,5,0,1,0,1),
|
||||
(@GUID+13,33211,571,1,1,0,0,3790.625,-4323.959,183.450317,2.364004,120,5,0,1,0,1),
|
||||
(@GUID+14,33211,571,1,1,0,0,3792.34375,-4335.88965,180.584076,1.4193728,120,5,0,1,0,1),
|
||||
(@GUID+15,33211,571,1,1,0,0,3792.57,-4335.01953,180.620331,4.567329,120,5,0,1,0,1),
|
||||
(@GUID+16,33211,571,1,1,0,0,3800.04688,-4336.84375,182.426788,0.0697878,120,5,0,1,0,1),
|
||||
(@GUID+17,33211,571,1,1,0,0,3801.10449,-4336.328,182.681076,2.52183533,120,5,0,1,0,1),
|
||||
(@GUID+18,33211,571,1,1,0,0,3805.919,-4356.706,181.306076,4.68659163,120,5,0,1,0,1),
|
||||
(@GUID+19,33211,571,1,1,0,0,3806.053,-4357.079,181.381226,2.51099515,120,5,0,1,0,1),
|
||||
(@GUID+20,33211,571,1,1,0,0,3807.35254,-4346.9873,181.609863,2.069034,120,5,0,1,0,1),
|
||||
(@GUID+21,33211,571,1,1,0,0,3810.154,-4348.294,182.556076,0.350148171,120,5,0,1,0,1),
|
||||
(@GUID+22,33211,571,1,1,0,0,3815.82153,-4356.93164,182.881485,2.11018085,120,5,0,1,0,1),
|
||||
(@GUID+23,33211,571,1,1,0,0,3816.023,-4362.761,181.806076,2.04126978,120,5,0,1,0,1),
|
||||
(@GUID+24,33211,571,1,1,0,0,3816.47925,-4363.564,181.7469,4.345304,120,5,0,1,0,1),
|
||||
(@GUID+25,33211,571,1,1,0,0,3816.487,-4356.44141,182.931076,0.0126206363,120,5,0,1,0,1),
|
||||
(@GUID+26,33224,571,1,1,0,0,3819.22485,-4360.78125,182.311951,4.927386,120,5,0,1,0,1);
|
||||
@@ -26,7 +26,7 @@
|
||||
int AggressorAI::Permissible(const Creature* creature)
|
||||
{
|
||||
// have some hostile factions, it will be selected by IsHostileTo check at MoveInLineOfSight
|
||||
if (!creature->isCivilian() && !creature->IsNeutralToAll())
|
||||
if (!creature->IsCivilian() && !creature->IsNeutralToAll())
|
||||
return PERMIT_BASE_PROACTIVE;
|
||||
|
||||
return PERMIT_BASE_NO;
|
||||
@@ -164,7 +164,7 @@ void CasterAI::UpdateAI(uint32 diff)
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me))
|
||||
if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
return;
|
||||
@@ -224,7 +224,7 @@ void ArcherAI::UpdateAI(uint32 /*diff*/)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!me->IsWithinCombatRange(me->getVictim(), m_minRange))
|
||||
if (!me->IsWithinCombatRange(me->GetVictim(), m_minRange))
|
||||
DoSpellAttackIfReady(me->m_spells[0]);
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -248,8 +248,8 @@ TurretAI::TurretAI(Creature* c) : CreatureAI(c)
|
||||
bool TurretAI::CanAIAttack(const Unit* /*who*/) const
|
||||
{
|
||||
/// @todo use one function to replace it
|
||||
if (!me->IsWithinCombatRange(me->getVictim(), me->m_CombatDistance)
|
||||
|| (m_minRange && me->IsWithinCombatRange(me->getVictim(), m_minRange)))
|
||||
if (!me->IsWithinCombatRange(me->GetVictim(), me->m_CombatDistance)
|
||||
|| (m_minRange && me->IsWithinCombatRange(me->GetVictim(), m_minRange)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
int GuardAI::Permissible(Creature const* creature)
|
||||
{
|
||||
if (creature->isGuard())
|
||||
if (creature->IsGuard())
|
||||
return PERMIT_BASE_SPECIAL;
|
||||
|
||||
return PERMIT_BASE_NO;
|
||||
@@ -50,7 +50,7 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj)
|
||||
|
||||
void GuardAI::EnterEvadeMode()
|
||||
{
|
||||
if (!me->isAlive())
|
||||
if (!me->IsAlive())
|
||||
{
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->CombatStop(true);
|
||||
|
||||
@@ -26,7 +26,7 @@ NullCreatureAI::NullCreatureAI(Creature* c) : CreatureAI(c) { me->SetReactState(
|
||||
|
||||
void PassiveAI::UpdateAI(uint32)
|
||||
{
|
||||
if (me->isInCombat() && me->getAttackers().empty())
|
||||
if (me->IsInCombat() && me->getAttackers().empty())
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ void PossessedAI::AttackStart(Unit* target)
|
||||
|
||||
void PossessedAI::UpdateAI(uint32 /*diff*/)
|
||||
{
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
{
|
||||
if (!me->IsValidAttackTarget(me->getVictim()))
|
||||
if (!me->IsValidAttackTarget(me->GetVictim()))
|
||||
me->AttackStop();
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
int PetAI::Permissible(const Creature* creature)
|
||||
{
|
||||
if (creature->isPet())
|
||||
if (creature->IsPet())
|
||||
return PERMIT_BASE_SPECIAL;
|
||||
|
||||
return PERMIT_BASE_NO;
|
||||
@@ -46,15 +46,15 @@ PetAI::PetAI(Creature* c) : CreatureAI(c), i_tracker(TIME_INTERVAL_LOOK)
|
||||
bool PetAI::_needToStop()
|
||||
{
|
||||
// This is needed for charmed creatures, as once their target was reset other effects can trigger threat
|
||||
if (me->isCharmed() && me->getVictim() == me->GetCharmer())
|
||||
if (me->IsCharmed() && me->GetVictim() == me->GetCharmer())
|
||||
return true;
|
||||
|
||||
return !me->IsValidAttackTarget(me->getVictim());
|
||||
return !me->IsValidAttackTarget(me->GetVictim());
|
||||
}
|
||||
|
||||
void PetAI::_stopAttack()
|
||||
{
|
||||
if (!me->isAlive())
|
||||
if (!me->IsAlive())
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_GENERAL, "Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
|
||||
me->GetMotionMaster()->Clear();
|
||||
@@ -75,7 +75,7 @@ void PetAI::_stopAttack()
|
||||
|
||||
void PetAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!me->isAlive() || !me->GetCharmInfo())
|
||||
if (!me->IsAlive() || !me->GetCharmInfo())
|
||||
return;
|
||||
|
||||
Unit* owner = me->GetCharmerOrOwner();
|
||||
@@ -86,10 +86,10 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
else
|
||||
m_updateAlliesTimer -= diff;
|
||||
|
||||
if (me->getVictim() && me->getVictim()->isAlive())
|
||||
if (me->GetVictim() && me->GetVictim()->IsAlive())
|
||||
{
|
||||
// is only necessary to stop casting, the pet must not exit combat
|
||||
if (me->getVictim()->HasBreakableByDamageCrowdControlAura(me))
|
||||
if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
return;
|
||||
@@ -105,7 +105,7 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
// Check before attacking to prevent pets from leaving stay position
|
||||
if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY))
|
||||
{
|
||||
if (me->GetCharmInfo()->IsCommandAttack() || (me->GetCharmInfo()->IsAtStay() && me->IsWithinMeleeRange(me->getVictim())))
|
||||
if (me->GetCharmInfo()->IsCommandAttack() || (me->GetCharmInfo()->IsAtStay() && me->IsWithinMeleeRange(me->GetVictim())))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
@@ -159,7 +159,7 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
continue;
|
||||
|
||||
// Check if we're in combat or commanded to attack
|
||||
if (!me->isInCombat() && !me->GetCharmInfo()->IsCommandAttack())
|
||||
if (!me->IsInCombat() && !me->GetCharmInfo()->IsCommandAttack())
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -208,11 +208,11 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
if (!spellUsed)
|
||||
delete spell;
|
||||
}
|
||||
else if (me->getVictim() && CanAttack(me->getVictim()) && spellInfo->CanBeUsedInCombat())
|
||||
else if (me->GetVictim() && CanAttack(me->GetVictim()) && spellInfo->CanBeUsedInCombat())
|
||||
{
|
||||
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0);
|
||||
if (spell->CanAutoCast(me->getVictim()))
|
||||
targetSpellStore.push_back(std::make_pair(me->getVictim(), spell));
|
||||
if (spell->CanAutoCast(me->GetVictim()))
|
||||
targetSpellStore.push_back(std::make_pair(me->GetVictim(), spell));
|
||||
else
|
||||
delete spell;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ void PetAI::UpdateAllies()
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->getSource();
|
||||
Player* Target = itr->GetSource();
|
||||
if (!Target || !group->SameSubGroup((Player*)owner, Target))
|
||||
continue;
|
||||
|
||||
@@ -302,7 +302,7 @@ void PetAI::KilledUnit(Unit* victim)
|
||||
{
|
||||
// Called from Unit::Kill() in case where pet or owner kills something
|
||||
// if owner killed this victim, pet may still be attacking something else
|
||||
if (me->getVictim() && me->getVictim() != victim)
|
||||
if (me->GetVictim() && me->GetVictim() != victim)
|
||||
return;
|
||||
|
||||
// Clear target just in case. May help problem where health / focus / mana
|
||||
@@ -345,7 +345,7 @@ void PetAI::OwnerAttackedBy(Unit* attacker)
|
||||
return;
|
||||
|
||||
// Prevent pet from disengaging from current target
|
||||
if (me->getVictim() && me->getVictim()->isAlive())
|
||||
if (me->GetVictim() && me->GetVictim()->IsAlive())
|
||||
return;
|
||||
|
||||
// Continue to evaluate and attack if necessary
|
||||
@@ -366,7 +366,7 @@ void PetAI::OwnerAttacked(Unit* target)
|
||||
return;
|
||||
|
||||
// Prevent pet from disengaging from current target
|
||||
if (me->getVictim() && me->getVictim()->isAlive())
|
||||
if (me->GetVictim() && me->GetVictim()->IsAlive())
|
||||
return;
|
||||
|
||||
// Continue to evaluate and attack if necessary
|
||||
@@ -400,7 +400,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
||||
|
||||
// Check owner victim
|
||||
// 3.0.2 - Pets now start attacking their owners victim in defensive mode as soon as the hunter does
|
||||
if (Unit* ownerVictim = me->GetCharmerOrOwner()->getVictim())
|
||||
if (Unit* ownerVictim = me->GetCharmerOrOwner()->GetVictim())
|
||||
return ownerVictim;
|
||||
|
||||
// Neither pet or owner had a target and aggressive pets can pick any target
|
||||
@@ -423,7 +423,7 @@ void PetAI::HandleReturnMovement()
|
||||
|
||||
// Prevent activating movement when under control of spells
|
||||
// such as "Eyes of the Beast"
|
||||
if (me->isCharmed())
|
||||
if (me->IsCharmed())
|
||||
return;
|
||||
|
||||
if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY))
|
||||
@@ -527,7 +527,7 @@ bool PetAI::CanAttack(Unit* target)
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (!target->isAlive())
|
||||
if (!target->IsAlive())
|
||||
{
|
||||
// Clear target to prevent getting stuck on dead targets
|
||||
me->AttackStop();
|
||||
@@ -553,14 +553,14 @@ bool PetAI::CanAttack(Unit* target)
|
||||
return (me->IsWithinMeleeRange(target) || me->GetCharmInfo()->IsCommandAttack());
|
||||
|
||||
// Pets attacking something (or chasing) should only switch targets if owner tells them to
|
||||
if (me->getVictim() && me->getVictim() != target)
|
||||
if (me->GetVictim() && me->GetVictim() != target)
|
||||
{
|
||||
// Check if our owner selected this target and clicked "attack"
|
||||
Unit* ownerTarget = NULL;
|
||||
if (Player* owner = me->GetCharmerOrOwner()->ToPlayer())
|
||||
ownerTarget = owner->GetSelectedUnit();
|
||||
else
|
||||
ownerTarget = me->GetCharmerOrOwner()->getVictim();
|
||||
ownerTarget = me->GetCharmerOrOwner()->GetVictim();
|
||||
|
||||
if (ownerTarget && me->GetCharmInfo()->IsCommandAttack())
|
||||
return (target->GetGUID() == ownerTarget->GetGUID());
|
||||
@@ -580,19 +580,19 @@ void PetAI::ReceiveEmote(Player* player, uint32 emote)
|
||||
switch (emote)
|
||||
{
|
||||
case TEXT_EMOTE_COWER:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(/*EMOTE_ONESHOT_ROAR*/EMOTE_ONESHOT_OMNICAST_GHOUL);
|
||||
break;
|
||||
case TEXT_EMOTE_ANGRY:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(/*EMOTE_ONESHOT_COWER*/EMOTE_STATE_STUN);
|
||||
break;
|
||||
case TEXT_EMOTE_GLARE:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(EMOTE_STATE_STUN);
|
||||
break;
|
||||
case TEXT_EMOTE_SOOTHE:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_OMNICAST_GHOUL);
|
||||
break;
|
||||
}
|
||||
@@ -627,7 +627,7 @@ void PetAI::AttackedBy(Unit* attacker)
|
||||
return;
|
||||
|
||||
// Prevent pet from disengaging from current target
|
||||
if (me->getVictim() && me->getVictim()->isAlive())
|
||||
if (me->GetVictim() && me->GetVictim()->IsAlive())
|
||||
return;
|
||||
|
||||
// Continue to evaluate and attack if necessary
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
int ReactorAI::Permissible(const Creature* creature)
|
||||
{
|
||||
if (creature->isCivilian() || creature->IsNeutralToAll())
|
||||
if (creature->IsCivilian() || creature->IsNeutralToAll())
|
||||
return PERMIT_BASE_REACTIVE;
|
||||
|
||||
return PERMIT_BASE_NO;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
int TotemAI::Permissible(Creature const* creature)
|
||||
{
|
||||
if (creature->isTotem())
|
||||
if (creature->IsTotem())
|
||||
return PERMIT_BASE_PROACTIVE;
|
||||
|
||||
return PERMIT_BASE_NO;
|
||||
@@ -37,7 +37,7 @@ int TotemAI::Permissible(Creature const* creature)
|
||||
|
||||
TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid(0)
|
||||
{
|
||||
ASSERT(c->isTotem());
|
||||
ASSERT(c->IsTotem());
|
||||
}
|
||||
|
||||
void TotemAI::MoveInLineOfSight(Unit* /*who*/)
|
||||
@@ -54,7 +54,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
||||
if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
|
||||
return;
|
||||
|
||||
if (!me->isAlive() || me->IsNonMeleeSpellCasted(false))
|
||||
if (!me->IsAlive() || me->IsNonMeleeSpellCasted(false))
|
||||
return;
|
||||
|
||||
// Search spell
|
||||
@@ -73,7 +73,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
||||
// Search victim if no, not attackable, or out of range, or friendly (possible in case duel end)
|
||||
if (!victim ||
|
||||
!victim->isTargetableForAttack() || !me->IsWithinDistInMap(victim, max_range) ||
|
||||
me->IsFriendlyTo(victim) || !me->canSeeOrDetect(victim))
|
||||
me->IsFriendlyTo(victim) || !me->CanSeeOrDetect(victim))
|
||||
{
|
||||
victim = NULL;
|
||||
Trinity::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
|
||||
|
||||
@@ -43,7 +43,7 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
Unit* victim = me->getVictim();
|
||||
Unit* victim = me->GetVictim();
|
||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||
if (me->isAttackReady() && me->IsWithinMeleeRange(victim))
|
||||
{
|
||||
@@ -65,9 +65,9 @@ bool UnitAI::DoSpellAttackIfReady(uint32 spell)
|
||||
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell))
|
||||
{
|
||||
if (me->IsWithinCombatRange(me->getVictim(), spellInfo->GetMaxRange(false)))
|
||||
if (me->IsWithinCombatRange(me->GetVictim(), spellInfo->GetMaxRange(false)))
|
||||
{
|
||||
me->CastSpell(me->getVictim(), spell, false);
|
||||
me->CastSpell(me->GetVictim(), spell, false);
|
||||
me->resetAttackTimer();
|
||||
return true;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ float UnitAI::DoGetSpellMaxRange(uint32 spellId, bool positive)
|
||||
|
||||
void UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid)
|
||||
{
|
||||
if (me->isInCombat())
|
||||
if (me->IsInCombat())
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
@@ -108,7 +108,7 @@ void UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid)
|
||||
|
||||
void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
|
||||
{
|
||||
if (me->isInCombat())
|
||||
if (me->IsInCombat())
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
@@ -131,7 +131,7 @@ void UnitAI::DoCast(uint32 spellId)
|
||||
target = me;
|
||||
break;
|
||||
case AITARGET_VICTIM:
|
||||
target = me->getVictim();
|
||||
target = me->GetVictim();
|
||||
break;
|
||||
case AITARGET_ENEMY:
|
||||
{
|
||||
@@ -157,8 +157,8 @@ void UnitAI::DoCast(uint32 spellId)
|
||||
|
||||
DefaultTargetSelector targetSelector(me, range, playerOnly, -(int32)spellId);
|
||||
if (!(spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_VICTIM)
|
||||
&& targetSelector(me->getVictim()))
|
||||
target = me->getVictim();
|
||||
&& targetSelector(me->GetVictim()))
|
||||
target = me->GetVictim();
|
||||
else
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0, targetSelector);
|
||||
}
|
||||
@@ -180,10 +180,10 @@ void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
|
||||
|
||||
void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
|
||||
{
|
||||
if (!me->getVictim() || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
|
||||
if (!me->GetVictim() || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
|
||||
return;
|
||||
|
||||
me->CastSpell(me->getVictim(), spellId, triggered);
|
||||
me->CastSpell(me->GetVictim(), spellId, triggered);
|
||||
}
|
||||
|
||||
void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
|
||||
@@ -269,10 +269,10 @@ void SimpleCharmedAI::UpdateAI(const uint32 /*diff*/)
|
||||
}
|
||||
}
|
||||
|
||||
if (!charmer->isInCombat())
|
||||
if (!charmer->IsInCombat())
|
||||
me->GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, me->GetFollowAngle());
|
||||
|
||||
Unit* target = me->getVictim();
|
||||
Unit* target = me->GetVictim();
|
||||
if (!target || !charmer->IsValidAttackTarget(target))
|
||||
AttackStart(charmer->SelectNearestTargetInAttackDistance());
|
||||
}
|
||||
@@ -328,5 +328,5 @@ bool NonTankTargetSelector::operator()(Unit const* target) const
|
||||
if (_playerOnly && target->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
|
||||
return target != _source->getVictim();
|
||||
return target != _source->GetVictim();
|
||||
}
|
||||
|
||||
@@ -58,11 +58,11 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
|
||||
return;
|
||||
}
|
||||
|
||||
if (!creature->HasReactState(REACT_PASSIVE) && !creature->getVictim())
|
||||
if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim())
|
||||
{
|
||||
if (Unit* nearTarget = creature->SelectNearestTarget(maxRangeToNearestTarget))
|
||||
creature->AI()->AttackStart(nearTarget);
|
||||
else if (creature->isSummon())
|
||||
else if (creature->IsSummon())
|
||||
{
|
||||
if (Unit* summoner = creature->ToTempSummon()->GetSummoner())
|
||||
{
|
||||
@@ -75,7 +75,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
|
||||
}
|
||||
}
|
||||
|
||||
if (!creature->HasReactState(REACT_PASSIVE) && !creature->getVictim())
|
||||
if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim())
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
|
||||
return;
|
||||
@@ -88,12 +88,12 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
|
||||
|
||||
for (Map::PlayerList::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
|
||||
{
|
||||
if (Player* player = itr->getSource())
|
||||
if (Player* player = itr->GetSource())
|
||||
{
|
||||
if (player->isGameMaster())
|
||||
if (player->IsGameMaster())
|
||||
continue;
|
||||
|
||||
if (player->isAlive())
|
||||
if (player->IsAlive())
|
||||
{
|
||||
creature->SetInCombatWith(player);
|
||||
player->SetInCombatWith(creature);
|
||||
@@ -124,18 +124,18 @@ void CreatureAI::MoveInLineOfSight_Safe(Unit* who)
|
||||
|
||||
void CreatureAI::MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
return;
|
||||
|
||||
if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) // non-combat pets should just stand there and look good;)
|
||||
return;
|
||||
|
||||
if (me->canStartAttack(who, false))
|
||||
if (me->CanStartAttack(who, false))
|
||||
AttackStart(who);
|
||||
//else if (who->getVictim() && me->IsFriendlyTo(who)
|
||||
//else if (who->GetVictim() && me->IsFriendlyTo(who)
|
||||
// && me->IsWithinDistInMap(who, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
|
||||
// && me->canStartAttack(who->getVictim(), true)) /// @todo if we use true, it will not attack it when it arrives
|
||||
// me->GetMotionMaster()->MoveChase(who->getVictim());
|
||||
// && me->CanStartAttack(who->GetVictim(), true)) /// @todo if we use true, it will not attack it when it arrives
|
||||
// me->GetMotionMaster()->MoveChase(who->GetVictim());
|
||||
}
|
||||
|
||||
void CreatureAI::EnterEvadeMode()
|
||||
@@ -171,7 +171,7 @@ void CreatureAI::EnterEvadeMode()
|
||||
|
||||
/*void CreatureAI::AttackedBy(Unit* attacker)
|
||||
{
|
||||
if (!me->getVictim())
|
||||
if (!me->GetVictim())
|
||||
AttackStart(attacker);
|
||||
}*/
|
||||
|
||||
@@ -186,12 +186,12 @@ void CreatureAI::SetGazeOn(Unit* target)
|
||||
|
||||
bool CreatureAI::UpdateVictimWithGaze()
|
||||
{
|
||||
if (!me->isInCombat())
|
||||
if (!me->IsInCombat())
|
||||
return false;
|
||||
|
||||
if (me->HasReactState(REACT_PASSIVE))
|
||||
{
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
return true;
|
||||
else
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -199,19 +199,19 @@ bool CreatureAI::UpdateVictimWithGaze()
|
||||
|
||||
if (Unit* victim = me->SelectVictim())
|
||||
AttackStart(victim);
|
||||
return me->getVictim();
|
||||
return me->GetVictim();
|
||||
}
|
||||
|
||||
bool CreatureAI::UpdateVictim()
|
||||
{
|
||||
if (!me->isInCombat())
|
||||
if (!me->IsInCombat())
|
||||
return false;
|
||||
|
||||
if (!me->HasReactState(REACT_PASSIVE))
|
||||
{
|
||||
if (Unit* victim = me->SelectVictim())
|
||||
AttackStart(victim);
|
||||
return me->getVictim();
|
||||
return me->GetVictim();
|
||||
}
|
||||
else if (me->getThreatManager().isThreatListEmpty())
|
||||
{
|
||||
@@ -224,7 +224,7 @@ bool CreatureAI::UpdateVictim()
|
||||
|
||||
bool CreatureAI::_EnterEvadeMode()
|
||||
{
|
||||
if (!me->isAlive())
|
||||
if (!me->IsAlive())
|
||||
return false;
|
||||
|
||||
// dont remove vehicle auras, passengers arent supposed to drop off the vehicle
|
||||
|
||||
@@ -160,7 +160,7 @@ class CreatureAI : public UnitAI
|
||||
virtual void CorpseRemoved(uint32& /*respawnDelay*/) {}
|
||||
|
||||
// Called when victim entered water and creature can not enter water
|
||||
//virtual bool canReachByRangeAttack(Unit*) { return false; }
|
||||
//virtual bool CanReachByRangeAttack(Unit*) { return false; }
|
||||
|
||||
/// == Fields =======================================
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace FactorySelector
|
||||
const CreatureAICreator* ai_factory = NULL;
|
||||
CreatureAIRegistry& ai_registry(*CreatureAIRepository::instance());
|
||||
|
||||
if (creature->isPet())
|
||||
if (creature->IsPet())
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
|
||||
//scriptname in db
|
||||
@@ -55,13 +55,13 @@ namespace FactorySelector
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
else if (creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
|
||||
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
|
||||
else if (creature->isGuard())
|
||||
else if (creature->IsGuard())
|
||||
ai_factory = ai_registry.GetRegistryItem("GuardAI");
|
||||
else if (creature->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
else if (creature->isTotem())
|
||||
else if (creature->IsTotem())
|
||||
ai_factory = ai_registry.GetRegistryItem("TotemAI");
|
||||
else if (creature->isTrigger())
|
||||
else if (creature->IsTrigger())
|
||||
{
|
||||
if (creature->m_spells[0])
|
||||
ai_factory = ai_registry.GetRegistryItem("TriggerAI");
|
||||
|
||||
@@ -139,7 +139,7 @@ void ScriptedAI::DoStartNoMovement(Unit* victim)
|
||||
|
||||
void ScriptedAI::DoStopAttack()
|
||||
{
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
me->AttackStop();
|
||||
}
|
||||
|
||||
@@ -312,8 +312,8 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
||||
|
||||
Map::PlayerList const& PlayerList = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
|
||||
if (Player* player = itr->getSource())
|
||||
if (player->isAlive())
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->IsAlive())
|
||||
player->TeleportTo(me->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(uint32 const diff)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (me->IsInEvadeMode() || !me->getVictim())
|
||||
if (me->IsInEvadeMode() || !me->GetVictim())
|
||||
return false;
|
||||
|
||||
float x = me->GetPositionX();
|
||||
@@ -454,7 +454,7 @@ BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature),
|
||||
|
||||
void BossAI::_Reset()
|
||||
{
|
||||
if (!me->isAlive())
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
me->ResetLootMode();
|
||||
@@ -555,7 +555,7 @@ bool BossAI::CheckBoundary(Unit* who)
|
||||
void BossAI::JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (me->isInCombat())
|
||||
if (me->IsInCombat())
|
||||
DoZoneInCombat(summon);
|
||||
}
|
||||
|
||||
@@ -604,7 +604,7 @@ WorldBossAI::WorldBossAI(Creature* creature) :
|
||||
|
||||
void WorldBossAI::_Reset()
|
||||
{
|
||||
if (!me->isAlive())
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
events.Reset();
|
||||
|
||||
@@ -55,7 +55,7 @@ void npc_escortAI::AttackStart(Unit* who)
|
||||
//see followerAI
|
||||
bool npc_escortAI::AssistPlayerInCombat(Unit* who)
|
||||
{
|
||||
if (!who || !who->getVictim())
|
||||
if (!who || !who->GetVictim())
|
||||
return false;
|
||||
|
||||
//experimental (unknown) flag not present
|
||||
@@ -63,7 +63,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
|
||||
return false;
|
||||
|
||||
//not a player
|
||||
if (!who->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (!who->GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
return false;
|
||||
|
||||
//never attack friendly
|
||||
@@ -74,7 +74,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
|
||||
if (me->IsWithinDistInMap(who, GetMaxPlayerDistance()) && me->IsWithinLOSInMap(who))
|
||||
{
|
||||
//already fighting someone?
|
||||
if (!me->getVictim())
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
AttackStart(who);
|
||||
return true;
|
||||
@@ -105,7 +105,7 @@ void npc_escortAI::MoveInLineOfSight(Unit* who)
|
||||
float fAttackRadius = me->GetAttackDistance(who);
|
||||
if (me->IsWithinDistInMap(who, fAttackRadius) && me->IsWithinLOSInMap(who))
|
||||
{
|
||||
if (!me->getVictim())
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
|
||||
AttackStart(who);
|
||||
@@ -130,7 +130,7 @@ void npc_escortAI::JustDied(Unit* /*killer*/)
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->getSource())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
if (member->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
|
||||
member->FailQuest(m_pQuestForEscort->GetQuestId());
|
||||
}
|
||||
@@ -194,7 +194,7 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->getSource())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
if (me->IsWithinDistInMap(member, GetMaxPlayerDistance()))
|
||||
return true;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
|
||||
void npc_escortAI::UpdateAI(uint32 diff)
|
||||
{
|
||||
//Waypoint Updating
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && !me->getVictim() && m_uiWPWaitTimer && !HasEscortState(STATE_ESCORT_RETURNING))
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && !me->GetVictim() && m_uiWPWaitTimer && !HasEscortState(STATE_ESCORT_RETURNING))
|
||||
{
|
||||
if (m_uiWPWaitTimer <= diff)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ void npc_escortAI::UpdateAI(uint32 diff)
|
||||
}
|
||||
|
||||
//Check if player or any member of his group is within range
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !me->getVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !me->GetVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
|
||||
{
|
||||
if (m_uiPlayerCheckTimer <= diff)
|
||||
{
|
||||
@@ -418,7 +418,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 */)
|
||||
{
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry());
|
||||
return;
|
||||
|
||||
@@ -52,7 +52,7 @@ void FollowerAI::AttackStart(Unit* who)
|
||||
//The flag (type_flag) is unconfirmed, but used here for further research and is a good candidate.
|
||||
bool FollowerAI::AssistPlayerInCombat(Unit* who)
|
||||
{
|
||||
if (!who || !who->getVictim())
|
||||
if (!who || !who->GetVictim())
|
||||
return false;
|
||||
|
||||
//experimental (unknown) flag not present
|
||||
@@ -60,7 +60,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
|
||||
return false;
|
||||
|
||||
//not a player
|
||||
if (!who->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (!who->GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
return false;
|
||||
|
||||
//never attack friendly
|
||||
@@ -71,7 +71,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
|
||||
if (me->IsWithinDistInMap(who, MAX_PLAYER_DISTANCE) && me->IsWithinLOSInMap(who))
|
||||
{
|
||||
//already fighting someone?
|
||||
if (!me->getVictim())
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
AttackStart(who);
|
||||
return true;
|
||||
@@ -102,7 +102,7 @@ void FollowerAI::MoveInLineOfSight(Unit* who)
|
||||
float fAttackRadius = me->GetAttackDistance(who);
|
||||
if (me->IsWithinDistInMap(who, fAttackRadius) && me->IsWithinLOSInMap(who))
|
||||
{
|
||||
if (!me->getVictim())
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
|
||||
AttackStart(who);
|
||||
@@ -129,7 +129,7 @@ void FollowerAI::JustDied(Unit* /*killer*/)
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
{
|
||||
if (Player* member = groupRef->getSource())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
{
|
||||
if (member->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
|
||||
member->FailQuest(m_pQuestForFollow->GetQuestId());
|
||||
@@ -186,7 +186,7 @@ void FollowerAI::EnterEvadeMode()
|
||||
|
||||
void FollowerAI::UpdateAI(uint32 uiDiff)
|
||||
{
|
||||
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !me->getVictim())
|
||||
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !me->GetVictim())
|
||||
{
|
||||
if (m_uiUpdateFollowTimer <= uiDiff)
|
||||
{
|
||||
@@ -214,7 +214,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
{
|
||||
Player* member = groupRef->getSource();
|
||||
Player* member = groupRef->GetSource();
|
||||
|
||||
if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE))
|
||||
{
|
||||
@@ -273,7 +273,7 @@ void FollowerAI::MovementInform(uint32 motionType, uint32 pointId)
|
||||
|
||||
void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Quest* quest)
|
||||
{
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_TSCR, "FollowerAI attempt to StartFollow while in combat.");
|
||||
return;
|
||||
@@ -313,7 +313,7 @@ Player* FollowerAI::GetLeaderForFollower()
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(*me, m_uiLeaderGUID))
|
||||
{
|
||||
if (player->isAlive())
|
||||
if (player->IsAlive())
|
||||
return player;
|
||||
else
|
||||
{
|
||||
@@ -321,9 +321,9 @@ Player* FollowerAI::GetLeaderForFollower()
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
{
|
||||
Player* member = groupRef->getSource();
|
||||
Player* member = groupRef->GetSource();
|
||||
|
||||
if (member && member->isAlive() && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE))
|
||||
if (member && member->IsAlive() && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE))
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_TSCR, "FollowerAI GetLeader changed and returned new leader.");
|
||||
m_uiLeaderGUID = member->GetGUID();
|
||||
|
||||
@@ -116,7 +116,7 @@ WayPoint* SmartAI::GetNextWayPoint()
|
||||
|
||||
void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/)
|
||||
{
|
||||
if (me->isInCombat())// no wp movement in combat
|
||||
if (me->IsInCombat())// no wp movement in combat
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_GENERAL, "SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
|
||||
return;
|
||||
@@ -226,7 +226,7 @@ void SmartAI::EndPath(bool fail)
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
{
|
||||
Player* groupGuy = groupRef->getSource();
|
||||
Player* groupGuy = groupRef->GetSource();
|
||||
|
||||
if (!fail && groupGuy->IsAtGroupRewardDistance(me) && !groupGuy->GetCorpse())
|
||||
groupGuy->AreaExploredOrEventHappens(mEscortQuestID);
|
||||
@@ -284,7 +284,7 @@ void SmartAI::UpdatePath(const uint32 diff)
|
||||
{
|
||||
if (mWPPauseTimer < diff)
|
||||
{
|
||||
if (!me->isInCombat() && !HasEscortState(SMART_ESCORT_RETURNING) && (mWPReached || mLastWPIDReached == SMART_ESCORT_LAST_OOC_POINT || mForcedPaused))
|
||||
if (!me->IsInCombat() && !HasEscortState(SMART_ESCORT_RETURNING) && (mWPReached || mLastWPIDReached == SMART_ESCORT_LAST_OOC_POINT || mForcedPaused))
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_RESUMED, NULL, mLastWP->id, GetScript()->GetPathId());
|
||||
RemoveEscortState(SMART_ESCORT_PAUSED);
|
||||
@@ -312,7 +312,7 @@ void SmartAI::UpdatePath(const uint32 diff)
|
||||
mWPReached = false;
|
||||
}
|
||||
}
|
||||
if (me->isInCombat() || HasEscortState(SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING))
|
||||
if (me->IsInCombat() || HasEscortState(SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING))
|
||||
return;
|
||||
// handle next wp
|
||||
if (mWPReached)//reached WP
|
||||
@@ -390,7 +390,7 @@ bool SmartAI::IsEscortInvokerInRange()
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
{
|
||||
Player* groupGuy = groupRef->getSource();
|
||||
Player* groupGuy = groupRef->GetSource();
|
||||
|
||||
if (me->GetDistance(groupGuy) <= SMART_ESCORT_MAX_PLAYER_DIST)
|
||||
return true;
|
||||
@@ -446,7 +446,7 @@ void SmartAI::RemoveAuras()
|
||||
|
||||
void SmartAI::EnterEvadeMode()
|
||||
{
|
||||
if (!me->isAlive() || me->IsInEvadeMode())
|
||||
if (!me->IsAlive() || me->IsInEvadeMode())
|
||||
return;
|
||||
|
||||
RemoveAuras();
|
||||
@@ -490,7 +490,7 @@ void SmartAI::MoveInLineOfSight(Unit* who)
|
||||
if (!CanAIAttack(who))
|
||||
return;
|
||||
|
||||
if (!me->canStartAttack(who, false))
|
||||
if (!me->CanStartAttack(who, false))
|
||||
return;
|
||||
|
||||
if (me->IsHostileTo(who))
|
||||
@@ -498,7 +498,7 @@ void SmartAI::MoveInLineOfSight(Unit* who)
|
||||
float fAttackRadius = me->GetAttackDistance(who);
|
||||
if (me->IsWithinDistInMap(who, fAttackRadius) && me->IsWithinLOSInMap(who))
|
||||
{
|
||||
if (!me->getVictim())
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
who->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
|
||||
AttackStart(who);
|
||||
@@ -521,7 +521,7 @@ bool SmartAI::CanAIAttack(const Unit* /*who*/) const
|
||||
|
||||
bool SmartAI::AssistPlayerInCombat(Unit* who)
|
||||
{
|
||||
if (!who || !who->getVictim())
|
||||
if (!who || !who->GetVictim())
|
||||
return false;
|
||||
|
||||
//experimental (unknown) flag not present
|
||||
@@ -529,7 +529,7 @@ bool SmartAI::AssistPlayerInCombat(Unit* who)
|
||||
return false;
|
||||
|
||||
//not a player
|
||||
if (!who->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (!who->GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
return false;
|
||||
|
||||
//never attack friendly
|
||||
@@ -540,7 +540,7 @@ bool SmartAI::AssistPlayerInCombat(Unit* who)
|
||||
if (me->IsWithinDistInMap(who, SMART_MAX_AID_DIST) && me->IsWithinLOSInMap(who))
|
||||
{
|
||||
//already fighting someone?
|
||||
if (!me->getVictim())
|
||||
if (!me->GetVictim())
|
||||
{
|
||||
AttackStart(who);
|
||||
return true;
|
||||
@@ -784,12 +784,12 @@ void SmartAI::SetCombatMove(bool on)
|
||||
mCanCombatMove = on;
|
||||
if (!HasEscortState(SMART_ESCORT_ESCORTING))
|
||||
{
|
||||
if (on && me->getVictim())
|
||||
if (on && me->GetVictim())
|
||||
{
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
|
||||
{
|
||||
SetRun(mRun);
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim());
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
me->CastStop();
|
||||
}
|
||||
}
|
||||
@@ -939,7 +939,7 @@ class SmartTrigger : public AreaTriggerScript
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
{
|
||||
if (!player->isAlive())
|
||||
if (!player->IsAlive())
|
||||
return false;
|
||||
|
||||
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "AreaTrigger %u is using SmartTrigger script", trigger->id);
|
||||
|
||||
@@ -166,7 +166,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if (IsCreature((*itr)))
|
||||
if (IsCreature((*itr)) && !(*itr)->ToCreature()->IsPet()) // Prevented sending text to pets.
|
||||
{
|
||||
talker = (*itr)->ToCreature();
|
||||
break;
|
||||
@@ -1042,7 +1042,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
|
||||
// The AI is only updated if the creature is alive
|
||||
if (me->isAlive())
|
||||
if (me->IsAlive())
|
||||
{
|
||||
CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1); // Next tick
|
||||
CAST_AI(SmartAI, me->AI())->StartDespawn();
|
||||
@@ -1602,9 +1602,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (Creature* target = (*itr)->ToCreature())
|
||||
if (IsSmart(target) && target->getVictim())
|
||||
if (IsSmart(target) && target->GetVictim())
|
||||
if (CAST_AI(SmartAI, target->AI())->CanCombatMove())
|
||||
target->GetMotionMaster()->MoveChase(target->getVictim(), attackDistance, attackAngle);
|
||||
target->GetMotionMaster()->MoveChase(target->GetVictim(), attackDistance, attackAngle);
|
||||
|
||||
delete targets;
|
||||
}
|
||||
@@ -2257,8 +2257,8 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
l->push_back(baseObject);
|
||||
break;
|
||||
case SMART_TARGET_VICTIM:
|
||||
if (me && me->getVictim())
|
||||
l->push_back(me->getVictim());
|
||||
if (me && me->GetVictim())
|
||||
l->push_back(me->GetVictim());
|
||||
break;
|
||||
case SMART_TARGET_HOSTILE_SECOND_AGGRO:
|
||||
if (me)
|
||||
@@ -2297,7 +2297,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->getSource())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
l->push_back(member);
|
||||
}
|
||||
// We still add the player to the list if there is no group. If we do
|
||||
@@ -2532,18 +2532,18 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
break;
|
||||
case SMART_EVENT_UPDATE_OOC:
|
||||
if (me && me->isInCombat())
|
||||
if (me && me->IsInCombat())
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
break;
|
||||
case SMART_EVENT_UPDATE_IC:
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
break;
|
||||
case SMART_EVENT_HEALT_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->GetMaxHealth())
|
||||
if (!me || !me->IsInCombat() || !me->GetMaxHealth())
|
||||
return;
|
||||
uint32 perc = (uint32)me->GetHealthPct();
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
@@ -2553,17 +2553,17 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_TARGET_HEALTH_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxHealth())
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxHealth())
|
||||
return;
|
||||
uint32 perc = (uint32)me->getVictim()->GetHealthPct();
|
||||
uint32 perc = (uint32)me->GetVictim()->GetHealthPct();
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_MANA_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->GetMaxPower(POWER_MANA))
|
||||
if (!me || !me->IsInCombat() || !me->GetMaxPower(POWER_MANA))
|
||||
return;
|
||||
uint32 perc = uint32(100.0f * me->GetPower(POWER_MANA) / me->GetMaxPower(POWER_MANA));
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
@@ -2573,34 +2573,34 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_TARGET_MANA_PCT:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxPower(POWER_MANA))
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxPower(POWER_MANA))
|
||||
return;
|
||||
uint32 perc = uint32(100.0f * me->getVictim()->GetPower(POWER_MANA) / me->getVictim()->GetMaxPower(POWER_MANA));
|
||||
uint32 perc = uint32(100.0f * me->GetVictim()->GetPower(POWER_MANA) / me->GetVictim()->GetMaxPower(POWER_MANA));
|
||||
if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min)
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_RANGE:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim())
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim())
|
||||
return;
|
||||
|
||||
if (me->IsInRange(me->getVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max))
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
if (me->IsInRange(me->GetVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max))
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_TARGET_CASTING:
|
||||
{
|
||||
if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->IsNonMeleeSpellCasted(false, false, true))
|
||||
if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->IsNonMeleeSpellCasted(false, false, true))
|
||||
return;
|
||||
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->getVictim());
|
||||
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_FRIENDLY_HEALTH:
|
||||
{
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
|
||||
Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealt.radius, e.event.friendlyHealt.hpDeficit);
|
||||
@@ -2611,7 +2611,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_FRIENDLY_IS_CC:
|
||||
{
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
|
||||
std::list<Creature*> pList;
|
||||
@@ -2643,9 +2643,9 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_TARGET_BUFFED:
|
||||
{
|
||||
if (!me || !me->getVictim())
|
||||
if (!me || !me->GetVictim())
|
||||
return;
|
||||
uint32 count = me->getVictim()->GetAuraCount(e.event.aura.spell);
|
||||
uint32 count = me->GetVictim()->GetAuraCount(e.event.aura.spell);
|
||||
if (count < e.event.aura.count)
|
||||
return;
|
||||
ProcessTimedAction(e, e.event.aura.repeatMin, e.event.aura.repeatMax);
|
||||
@@ -2680,7 +2680,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
if (!me)
|
||||
return;
|
||||
|
||||
if (Unit* victim = me->getVictim())
|
||||
if (Unit* victim = me->GetVictim())
|
||||
{
|
||||
if (!victim->HasInArc(static_cast<float>(M_PI), me))
|
||||
ProcessTimedAction(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax, victim);
|
||||
@@ -2721,7 +2721,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_OOC_LOS:
|
||||
{
|
||||
if (!me || me->isInCombat())
|
||||
if (!me || me->IsInCombat())
|
||||
return;
|
||||
//can trigger if closer than fMaxAllowedRange
|
||||
float range = (float)e.event.los.maxDist;
|
||||
@@ -2741,7 +2741,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
}
|
||||
case SMART_EVENT_IC_LOS:
|
||||
{
|
||||
if (!me || !me->isInCombat())
|
||||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
//can trigger if closer than fMaxAllowedRange
|
||||
float range = (float)e.event.los.maxDist;
|
||||
@@ -2961,10 +2961,10 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
|
||||
if (e.event.event_phase_mask && !IsInPhase(e.event.event_phase_mask))
|
||||
return;
|
||||
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->isInCombat()))
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsInCombat()))
|
||||
return;
|
||||
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->isInCombat()))//can be used with me=NULL (go script)
|
||||
if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat()))//can be used with me=NULL (go script)
|
||||
return;
|
||||
|
||||
if (e.timer < diff)
|
||||
@@ -3199,7 +3199,7 @@ void SmartScript::OnMoveInLineOfSight(Unit* who)
|
||||
if (!me)
|
||||
return;
|
||||
|
||||
if (me->getVictim())
|
||||
if (me->GetVictim())
|
||||
return;
|
||||
|
||||
ProcessEventsFor(SMART_EVENT_IC_LOS, who);
|
||||
|
||||
@@ -465,7 +465,7 @@ void AchievementMgr<T>::ResetAchievementCriteria(AchievementCriteriaTypes type,
|
||||
TC_LOG_DEBUG(LOG_FILTER_ACHIEVEMENTSYS, "ResetAchievementCriteria(%u, " UI64FMTD ", " UI64FMTD ")", type, miscValue1, miscValue2);
|
||||
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (GetOwner()->isGameMaster())
|
||||
if (GetOwner()->IsGameMaster())
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type);
|
||||
@@ -1099,7 +1099,7 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type,
|
||||
}
|
||||
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (referencePlayer->isGameMaster())
|
||||
if (referencePlayer->IsGameMaster())
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_ACHIEVEMENTSYS, "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);
|
||||
@@ -1855,7 +1855,7 @@ template<>
|
||||
void AchievementMgr<Player>::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer)
|
||||
{
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (GetOwner()->isGameMaster())
|
||||
if (GetOwner()->IsGameMaster())
|
||||
return;
|
||||
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID))
|
||||
@@ -1961,7 +1961,7 @@ void AchievementMgr<Guild>::CompletedAchievement(AchievementEntry const* achieve
|
||||
|
||||
if (Group const* group = referencePlayer->GetGroup())
|
||||
for (GroupReference const* ref = group->GetFirstMember(); ref != NULL; ref = ref->next())
|
||||
if (Player const* groupMember = ref->getSource())
|
||||
if (Player const* groupMember = ref->GetSource())
|
||||
if (groupMember->GetGuildId() == GetOwner()->GetId())
|
||||
ca.guids.insert(groupMember->GetGUID());
|
||||
}
|
||||
@@ -2723,7 +2723,7 @@ bool AchievementMgr<T>::AdditionalRequirementsSatisfied(AchievementCriteriaEntry
|
||||
return false;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD: // 6
|
||||
if (!unit || unit->isAlive())
|
||||
if (!unit || unit->IsAlive())
|
||||
return false;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY: // 7
|
||||
|
||||
@@ -256,7 +256,7 @@ void Battlefield::InvitePlayerToWar(Player* player)
|
||||
return;
|
||||
|
||||
/// @todo needed ?
|
||||
if (player->isInFlight())
|
||||
if (player->IsInFlight())
|
||||
return;
|
||||
|
||||
if (player->InArena() || player->GetBattleground())
|
||||
@@ -521,7 +521,7 @@ void Battlefield::ShowNpc(Creature* creature, bool aggressive)
|
||||
creature->SetPhaseMask(1, true);
|
||||
creature->SetVisible(true);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (!creature->isAlive())
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn(true);
|
||||
if (aggressive)
|
||||
creature->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
@@ -559,7 +559,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
||||
|
||||
player->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
|
||||
player->ResetAllPowers();
|
||||
if (!player->isGameMaster())
|
||||
if (!player->IsGameMaster())
|
||||
{
|
||||
// remove auras with duration lower than 30s
|
||||
Unit::AuraApplicationMap & auraMap = player->GetAppliedAuras();
|
||||
@@ -886,10 +886,10 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
||||
// Last standing - Rated 5v5 arena & be solely alive player
|
||||
if (team == winner && isArena() && isRated() && GetArenaType() == ARENA_TYPE_5v5 && aliveWinners == 1 && player->isAlive())
|
||||
if (team == winner && isArena() && isRated() && GetArenaType() == ARENA_TYPE_5v5 && aliveWinners == 1 && player->IsAlive())
|
||||
player->CastSpell(player, SPELL_THE_LAST_STANDING, true);
|
||||
|
||||
if (!player->isAlive())
|
||||
if (!player->IsAlive())
|
||||
{
|
||||
player->ResurrectPlayer(1.0f);
|
||||
player->SpawnCorpseBones();
|
||||
@@ -1037,7 +1037,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
||||
if (!player->isAlive()) // resurrect on exit
|
||||
if (!player->IsAlive()) // resurrect on exit
|
||||
{
|
||||
player->ResurrectPlayer(1.0f);
|
||||
player->SpawnCorpseBones();
|
||||
@@ -1927,7 +1927,7 @@ uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const
|
||||
if (itr->second.Team == Team)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (player && player->isAlive() && !player->HasByteFlag(UNIT_FIELD_BYTES_2, 3, FORM_SPIRITOFREDEMPTION))
|
||||
if (player && player->IsAlive() && !player->HasByteFlag(UNIT_FIELD_BYTES_2, 3, FORM_SPIRITOFREDEMPTION))
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
|
||||
{
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
continue; // this should never happen
|
||||
PlayerQueueInfo& pl_info = m_QueuedPlayers[member->GetGUID()];
|
||||
|
||||
@@ -381,7 +381,7 @@ void BattlegroundEY::HandleAreaTrigger(Player* player, uint32 trigger)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
if (!player->isAlive()) //hack code, must be removed later
|
||||
if (!player->IsAlive()) //hack code, must be removed later
|
||||
return;
|
||||
|
||||
switch (trigger)
|
||||
|
||||
@@ -151,7 +151,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
||||
{
|
||||
if (Creature* catapult = GetBGCreature(u))
|
||||
{
|
||||
if (!catapult->isAlive())
|
||||
if (!catapult->IsAlive())
|
||||
catapult->Respawn(true);
|
||||
}
|
||||
}
|
||||
@@ -161,7 +161,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
||||
{
|
||||
if (Creature* glaiveThrower = GetBGCreature(u))
|
||||
{
|
||||
if (!glaiveThrower->isAlive())
|
||||
if (!glaiveThrower->IsAlive())
|
||||
glaiveThrower->Respawn(true);
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
||||
|
||||
if (Creature* siege = GetBGCreature(siegeType)) // this always should be true
|
||||
{
|
||||
if (siege->isAlive())
|
||||
if (siege->IsAlive())
|
||||
{
|
||||
if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC))
|
||||
// following sniffs the vehicle always has UNIT_FLAG_UNK_14
|
||||
@@ -199,7 +199,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
||||
{
|
||||
if (Creature* demolisher = GetBGCreature(u))
|
||||
{
|
||||
if (!demolisher->isAlive())
|
||||
if (!demolisher->IsAlive())
|
||||
demolisher->Respawn(true);
|
||||
}
|
||||
}
|
||||
@@ -718,7 +718,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
|
||||
{
|
||||
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_A : BG_IC_NPC_GLAIVE_THROWER_1_H)+i;
|
||||
|
||||
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
|
||||
if (GetBGCreature(type) && GetBGCreature(type)->IsAlive())
|
||||
continue;
|
||||
|
||||
if (AddCreature(nodePoint->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H, type, nodePoint->faction,
|
||||
@@ -733,7 +733,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
|
||||
{
|
||||
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_CATAPULT_1_A : BG_IC_NPC_CATAPULT_1_H)+i;
|
||||
|
||||
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
|
||||
if (GetBGCreature(type) && GetBGCreature(type)->IsAlive())
|
||||
continue;
|
||||
|
||||
if (AddCreature(NPC_CATAPULT, type, nodePoint->faction,
|
||||
@@ -768,7 +768,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
|
||||
{
|
||||
uint8 type = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_DEMOLISHER_1_A : BG_IC_NPC_DEMOLISHER_1_H)+i;
|
||||
|
||||
if (GetBGCreature(type) && GetBGCreature(type)->isAlive())
|
||||
if (GetBGCreature(type) && GetBGCreature(type)->IsAlive())
|
||||
continue;
|
||||
|
||||
if (AddCreature(NPC_DEMOLISHER, type, nodePoint->faction,
|
||||
@@ -792,7 +792,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
|
||||
}
|
||||
|
||||
uint8 siegeType = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_A : BG_IC_NPC_SIEGE_ENGINE_H);
|
||||
if (!GetBGCreature(siegeType) || !GetBGCreature(siegeType)->isAlive())
|
||||
if (!GetBGCreature(siegeType) || !GetBGCreature(siegeType)->IsAlive())
|
||||
{
|
||||
AddCreature((nodePoint->faction == TEAM_ALLIANCE ? NPC_SIEGE_ENGINE_A : NPC_SIEGE_ENGINE_H), siegeType, nodePoint->faction,
|
||||
BG_IC_WorkshopVehicles[4].GetPositionX(), BG_IC_WorkshopVehicles[4].GetPositionY(),
|
||||
|
||||
@@ -507,7 +507,7 @@ void BattlegroundSA::TeleportPlayers()
|
||||
if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
||||
if (!player->isAlive())
|
||||
if (!player->IsAlive())
|
||||
{
|
||||
player->ResurrectPlayer(1.0f);
|
||||
player->SpawnCorpseBones();
|
||||
|
||||
@@ -40,8 +40,8 @@ void HostileRefManager::threatAssist(Unit* victim, float baseThreat, SpellInfo c
|
||||
threat /= getSize();
|
||||
while (ref)
|
||||
{
|
||||
if (ThreatCalcHelper::isValidProcess(victim, ref->getSource()->getOwner(), threatSpell))
|
||||
ref->getSource()->doAddThreat(victim, threat);
|
||||
if (ThreatCalcHelper::isValidProcess(victim, ref->GetSource()->GetOwner(), threatSpell))
|
||||
ref->GetSource()->doAddThreat(victim, threat);
|
||||
|
||||
ref = ref->next();
|
||||
}
|
||||
@@ -130,7 +130,7 @@ void HostileRefManager::deleteReferencesForFaction(uint32 faction)
|
||||
while (ref)
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
if (ref->getSource()->getOwner()->getFactionTemplateEntry()->faction == faction)
|
||||
if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->faction == faction)
|
||||
{
|
||||
ref->removeReference();
|
||||
delete ref;
|
||||
@@ -148,7 +148,7 @@ void HostileRefManager::deleteReference(Unit* creature)
|
||||
while (ref)
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
if (ref->getSource()->getOwner() == creature)
|
||||
if (ref->GetSource()->GetOwner() == creature)
|
||||
{
|
||||
ref->removeReference();
|
||||
delete ref;
|
||||
@@ -167,7 +167,7 @@ void HostileRefManager::setOnlineOfflineState(Unit* creature, bool isOnline)
|
||||
while (ref)
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
if (ref->getSource()->getOwner() == creature)
|
||||
if (ref->GetSource()->GetOwner() == creature)
|
||||
{
|
||||
ref->setOnlineOfflineState(isOnline);
|
||||
break;
|
||||
@@ -184,7 +184,7 @@ void HostileRefManager::UpdateVisibility()
|
||||
while (ref)
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
if (!ref->getSource()->getOwner()->canSeeOrDetect(getOwner()))
|
||||
if (!ref->GetSource()->GetOwner()->CanSeeOrDetect(GetOwner()))
|
||||
{
|
||||
nextRef = ref->next();
|
||||
ref->removeReference();
|
||||
|
||||
@@ -37,7 +37,7 @@ class HostileRefManager : public RefManager<Unit, ThreatManager>
|
||||
explicit HostileRefManager(Unit* owner) { iOwner = owner; }
|
||||
~HostileRefManager();
|
||||
|
||||
Unit* getOwner() { return iOwner; }
|
||||
Unit* GetOwner() { return iOwner; }
|
||||
|
||||
// send threat to all my hateres for the victim
|
||||
// The victim is hated than by them as well
|
||||
|
||||
@@ -67,11 +67,11 @@ bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellIn
|
||||
return false;
|
||||
|
||||
// not to GM
|
||||
if (hatedUnit->GetTypeId() == TYPEID_PLAYER && hatedUnit->ToPlayer()->isGameMaster())
|
||||
if (hatedUnit->GetTypeId() == TYPEID_PLAYER && hatedUnit->ToPlayer()->IsGameMaster())
|
||||
return false;
|
||||
|
||||
// not to dead and not for dead
|
||||
if (!hatedUnit->isAlive() || !hatingUnit->isAlive())
|
||||
if (!hatedUnit->IsAlive() || !hatingUnit->IsAlive())
|
||||
return false;
|
||||
|
||||
// not in same map or phase
|
||||
@@ -128,8 +128,8 @@ void HostileReference::sourceObjectDestroyLink()
|
||||
|
||||
void HostileReference::fireStatusChanged(ThreatRefStatusChangeEvent& threatRefStatusChangeEvent)
|
||||
{
|
||||
if (getSource())
|
||||
getSource()->processThreatEvent(&threatRefStatusChangeEvent);
|
||||
if (GetSource())
|
||||
GetSource()->processThreatEvent(&threatRefStatusChangeEvent);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
@@ -150,8 +150,8 @@ void HostileReference::addThreat(float modThreat)
|
||||
if (isValid() && modThreat >= 0.0f)
|
||||
{
|
||||
Unit* victimOwner = getTarget()->GetCharmerOrOwner();
|
||||
if (victimOwner && victimOwner->isAlive())
|
||||
getSource()->addThreat(victimOwner, 0.0f); // create a threat to the owner of a pet, if the pet attacks
|
||||
if (victimOwner && victimOwner->IsAlive())
|
||||
GetSource()->addThreat(victimOwner, 0.0f); // create a threat to the owner of a pet, if the pet attacks
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,21 +171,21 @@ void HostileReference::updateOnlineStatus()
|
||||
bool accessible = false;
|
||||
|
||||
if (!isValid())
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid()))
|
||||
link(target, getSource());
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*GetSourceUnit(), getUnitGuid()))
|
||||
link(target, GetSource());
|
||||
|
||||
// only check for online status if
|
||||
// ref is valid
|
||||
// target is no player or not gamemaster
|
||||
// target is not in flight
|
||||
if (isValid()
|
||||
&& (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster())
|
||||
&& (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->IsGameMaster())
|
||||
&& !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT)
|
||||
&& getTarget()->IsInMap(getSourceUnit())
|
||||
&& getTarget()->InSamePhase(getSourceUnit())
|
||||
&& getTarget()->IsInMap(GetSourceUnit())
|
||||
&& getTarget()->InSamePhase(GetSourceUnit())
|
||||
)
|
||||
{
|
||||
Creature* creature = getSourceUnit()->ToCreature();
|
||||
Creature* creature = GetSourceUnit()->ToCreature();
|
||||
online = getTarget()->isInAccessiblePlaceFor(creature);
|
||||
if (!online)
|
||||
{
|
||||
@@ -242,9 +242,9 @@ void HostileReference::removeReference()
|
||||
|
||||
//============================================================
|
||||
|
||||
Unit* HostileReference::getSourceUnit()
|
||||
Unit* HostileReference::GetSourceUnit()
|
||||
{
|
||||
return (getSource()->getOwner());
|
||||
return (GetSource()->GetOwner());
|
||||
}
|
||||
|
||||
//============================================================
|
||||
@@ -350,14 +350,14 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
||||
}
|
||||
}
|
||||
|
||||
if (attacker->canCreatureAttack(target)) // skip non attackable currently targets
|
||||
if (attacker->CanCreatureAttack(target)) // skip non attackable currently targets
|
||||
{
|
||||
if (currentVictim) // select 1.3/1.1 better target in comparison current target
|
||||
{
|
||||
// list sorted and and we check current target, then this is best case
|
||||
if (currentVictim == currentRef || currentRef->getThreat() <= 1.1f * currentVictim->getThreat())
|
||||
{
|
||||
if (currentVictim != currentRef && attacker->canCreatureAttack(currentVictim->getTarget()))
|
||||
if (currentVictim != currentRef && attacker->CanCreatureAttack(currentVictim->getTarget()))
|
||||
currentRef = currentVictim; // for second case, if currentvictim is attackable
|
||||
|
||||
found = true;
|
||||
@@ -408,7 +408,7 @@ void ThreatManager::clearReferences()
|
||||
|
||||
void ThreatManager::addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell)
|
||||
{
|
||||
if (!ThreatCalcHelper::isValidProcess(victim, getOwner(), threatSpell))
|
||||
if (!ThreatCalcHelper::isValidProcess(victim, GetOwner(), threatSpell))
|
||||
return;
|
||||
|
||||
doAddThreat(victim, ThreatCalcHelper::calcThreat(victim, iOwner, threat, schoolMask, threatSpell));
|
||||
@@ -445,7 +445,7 @@ void ThreatManager::_addThreat(Unit* victim, float threat)
|
||||
HostileReference* hostileRef = new HostileReference(victim, this, 0);
|
||||
iThreatContainer.addReference(hostileRef);
|
||||
hostileRef->addThreat(threat); // now we add the real threat
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && victim->ToPlayer()->isGameMaster())
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && victim->ToPlayer()->IsGameMaster())
|
||||
hostileRef->setOnlineOfflineState(false); // GM is always offline
|
||||
}
|
||||
}
|
||||
@@ -462,7 +462,7 @@ void ThreatManager::modifyThreatPercent(Unit* victim, int32 percent)
|
||||
Unit* ThreatManager::getHostilTarget()
|
||||
{
|
||||
iThreatContainer.update();
|
||||
HostileReference* nextVictim = iThreatContainer.selectNextVictim(getOwner()->ToCreature(), getCurrentVictim());
|
||||
HostileReference* nextVictim = iThreatContainer.selectNextVictim(GetOwner()->ToCreature(), getCurrentVictim());
|
||||
setCurrentVictim(nextVictim);
|
||||
return getCurrentVictim() != NULL ? getCurrentVictim()->getTarget() : NULL;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ class HostileReference : public Reference<Unit, ThreatManager>
|
||||
// Inform the source, that the status of that reference was changed
|
||||
void fireStatusChanged(ThreatRefStatusChangeEvent& threatRefStatusChangeEvent);
|
||||
|
||||
Unit* getSourceUnit();
|
||||
Unit* GetSourceUnit();
|
||||
private:
|
||||
float iThreat;
|
||||
float iTempThreatModifier; // used for taunt
|
||||
@@ -224,7 +224,7 @@ class ThreatManager
|
||||
|
||||
HostileReference* getCurrentVictim() const { return iCurrentVictim; }
|
||||
|
||||
Unit* getOwner() const { return iOwner; }
|
||||
Unit* GetOwner() const { return iOwner; }
|
||||
|
||||
Unit* getHostilTarget();
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
case CONDITION_ALIVE:
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
condMeets = unit->isAlive();
|
||||
condMeets = unit->IsAlive();
|
||||
break;
|
||||
}
|
||||
case CONDITION_HP_VAL:
|
||||
|
||||
@@ -309,7 +309,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
|
||||
if (unit)
|
||||
{
|
||||
if ((spellFlags & SPELL_DISABLE_PLAYER && unit->GetTypeId() == TYPEID_PLAYER) ||
|
||||
(unit->GetTypeId() == TYPEID_UNIT && ((unit->ToCreature()->isPet() && spellFlags & SPELL_DISABLE_PET) || spellFlags & SPELL_DISABLE_CREATURE)))
|
||||
(unit->GetTypeId() == TYPEID_UNIT && ((unit->ToCreature()->IsPet() && spellFlags & SPELL_DISABLE_PET) || spellFlags & SPELL_DISABLE_CREATURE)))
|
||||
{
|
||||
if (spellFlags & SPELL_DISABLE_MAP)
|
||||
{
|
||||
@@ -372,7 +372,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
|
||||
if (!unit)
|
||||
return true;
|
||||
if (Player const* player = unit->ToPlayer())
|
||||
if (player->isGameMaster())
|
||||
if (player->IsGameMaster())
|
||||
return false;
|
||||
return true;
|
||||
case DISABLE_TYPE_BATTLEGROUND:
|
||||
|
||||
@@ -492,7 +492,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
uint8 memberCount = 0;
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL && joinData.result == LFG_JOIN_OK; itr = itr->next())
|
||||
{
|
||||
if (Player* plrg = itr->getSource())
|
||||
if (Player* plrg = itr->GetSource())
|
||||
{
|
||||
if (!plrg->GetSession()->HasPermission(RBAC_PERM_JOIN_DUNGEON_FINDER))
|
||||
joinData.result = LFG_JOIN_PARTY_NOT_MEET_REQS;
|
||||
@@ -602,7 +602,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons, comment);
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
if (Player* plrg = itr->getSource())
|
||||
if (Player* plrg = itr->GetSource())
|
||||
{
|
||||
uint64 pguid = plrg->GetGUID();
|
||||
plrg->GetSession()->SendLfgUpdateParty(updateData);
|
||||
@@ -1327,7 +1327,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
|
||||
LfgTeleportError error = LFG_TELEPORTERROR_OK;
|
||||
|
||||
if (!player->isAlive())
|
||||
if (!player->IsAlive())
|
||||
error = LFG_TELEPORTERROR_PLAYER_DEAD;
|
||||
else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING))
|
||||
error = LFG_TELEPORTERROR_FALLING;
|
||||
@@ -1350,7 +1350,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
// Select a player inside to be teleported to
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL && !mapid; itr = itr->next())
|
||||
{
|
||||
Player* plrg = itr->getSource();
|
||||
Player* plrg = itr->GetSource();
|
||||
if (plrg && plrg != player && plrg->GetMapId() == uint32(dungeon->map))
|
||||
{
|
||||
mapid = plrg->GetMapId();
|
||||
@@ -1366,7 +1366,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
||||
if (!player->GetMap()->IsDungeon())
|
||||
player->SetBattlegroundEntryPoint();
|
||||
|
||||
if (player->isInFlight())
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
|
||||
@@ -110,7 +110,7 @@ void LFGPlayerScript::OnMapChanged(Player* player)
|
||||
}
|
||||
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (Player* member = itr->getSource())
|
||||
if (Player* member = itr->GetSource())
|
||||
player->GetSession()->SendNameQueryOpcode(member->GetGUID());
|
||||
|
||||
if (sLFGMgr->selectedRandomLfgDungeon(player->GetGUID()))
|
||||
|
||||
@@ -210,14 +210,14 @@ void Creature::DisappearAndDie()
|
||||
DestroyForNearbyPlayers();
|
||||
//SetVisibility(VISIBILITY_OFF);
|
||||
//ObjectAccessor::UpdateObjectVisibility(this);
|
||||
if (isAlive())
|
||||
if (IsAlive())
|
||||
setDeathState(JUST_DIED);
|
||||
RemoveCorpse(false);
|
||||
}
|
||||
|
||||
void Creature::SearchFormation()
|
||||
{
|
||||
if (isSummon())
|
||||
if (IsSummon())
|
||||
return;
|
||||
|
||||
uint32 lowguid = GetDBTableGUIDLow();
|
||||
@@ -426,7 +426,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
|
||||
}
|
||||
|
||||
// trigger creature is always not selectable and can not be attacked
|
||||
if (isTrigger())
|
||||
if (IsTrigger())
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
InitializeReactState();
|
||||
@@ -520,7 +520,7 @@ void Creature::Update(uint32 diff)
|
||||
|
||||
// creature can be dead after Unit::Update call
|
||||
// CORPSE/DEAD state will processed at next tick (in other case death timer will be updated unexpectedly)
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
break;
|
||||
|
||||
// if creature is charmed, switch to charmed AI
|
||||
@@ -541,7 +541,7 @@ void Creature::Update(uint32 diff)
|
||||
|
||||
// creature can be dead after UpdateAI call
|
||||
// CORPSE/DEAD state will processed at next tick (in other case death timer will be updated unexpectedly)
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
break;
|
||||
|
||||
if (m_regenTimer > 0)
|
||||
@@ -555,9 +555,9 @@ void Creature::Update(uint32 diff)
|
||||
if (m_regenTimer != 0)
|
||||
break;
|
||||
|
||||
bool bInCombat = isInCombat() && (!getVictim() || // if isInCombat() is true and this has no victim
|
||||
!getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player
|
||||
!getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->isGameMaster()); // or the victim/owner/charmer is not a GameMaster
|
||||
bool bInCombat = IsInCombat() && (!GetVictim() || // if IsInCombat() is true and this has no victim
|
||||
!GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player
|
||||
!GetVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->IsGameMaster()); // or the victim/owner/charmer is not a GameMaster
|
||||
|
||||
/*if (m_regenTimer <= diff)
|
||||
{*/
|
||||
@@ -599,7 +599,7 @@ void Creature::RegenerateMana()
|
||||
uint32 addvalue = 0;
|
||||
|
||||
// Combat and any controlled creature
|
||||
if (isInCombat() || GetCharmerOrOwnerGUID())
|
||||
if (IsInCombat() || GetCharmerOrOwnerGUID())
|
||||
{
|
||||
float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA);
|
||||
float Spirit = GetStat(STAT_SPIRIT);
|
||||
@@ -659,7 +659,7 @@ void Creature::RegenerateHealth()
|
||||
|
||||
void Creature::DoFleeToGetAssistance()
|
||||
{
|
||||
if (!getVictim())
|
||||
if (!GetVictim())
|
||||
return;
|
||||
|
||||
if (HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
|
||||
@@ -673,7 +673,7 @@ void Creature::DoFleeToGetAssistance()
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this, getVictim(), radius);
|
||||
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
@@ -684,7 +684,7 @@ void Creature::DoFleeToGetAssistance()
|
||||
UpdateSpeed(MOVE_RUN, false);
|
||||
|
||||
if (!creature)
|
||||
//SetFeared(true, getVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
|
||||
//SetFeared(true, GetVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
|
||||
/// @todo use 31365
|
||||
SetControlled(true, UNIT_STATE_FLEEING);
|
||||
else
|
||||
@@ -789,7 +789,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
|
||||
|
||||
uint32 displayID = GetNativeDisplayId();
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
if (minfo && !isTotem()) // Cancel load if no model defined or if totem
|
||||
if (minfo && !IsTotem()) // Cancel load if no model defined or if totem
|
||||
{
|
||||
SetDisplayId(displayID);
|
||||
SetNativeDisplayId(displayID);
|
||||
@@ -799,7 +799,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
|
||||
LastUsedScriptID = GetCreatureTemplate()->ScriptID;
|
||||
|
||||
/// @todo Replace with spell, handle from DB
|
||||
if (isSpiritHealer() || isSpiritGuide())
|
||||
if (IsSpiritHealer() || IsSpiritGuide())
|
||||
{
|
||||
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
@@ -813,17 +813,17 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
|
||||
|
||||
void Creature::InitializeReactState()
|
||||
{
|
||||
if (isTotem() || isTrigger() || GetCreatureType() == CREATURE_TYPE_CRITTER || isSpiritService())
|
||||
if (IsTotem() || IsTrigger() || GetCreatureType() == CREATURE_TYPE_CRITTER || IsSpiritService())
|
||||
SetReactState(REACT_PASSIVE);
|
||||
else
|
||||
SetReactState(REACT_AGGRESSIVE);
|
||||
/*else if (isCivilian())
|
||||
/*else if (IsCivilian())
|
||||
SetReactState(REACT_DEFENSIVE);*/;
|
||||
}
|
||||
|
||||
bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const
|
||||
{
|
||||
if (!isBattleMaster())
|
||||
if (!IsBattleMaster())
|
||||
return false;
|
||||
|
||||
BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(GetEntry());
|
||||
@@ -1020,7 +1020,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
|
||||
void Creature::SelectLevel(const CreatureTemplate* cinfo)
|
||||
{
|
||||
uint32 rank = isPet()? 0 : cinfo->rank;
|
||||
uint32 rank = IsPet()? 0 : cinfo->rank;
|
||||
|
||||
// level
|
||||
uint8 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel);
|
||||
@@ -1326,7 +1326,7 @@ bool Creature::IsInvisibleDueToDespawn() const
|
||||
if (Unit::IsInvisibleDueToDespawn())
|
||||
return true;
|
||||
|
||||
if (isAlive() || m_corpseRemoveTime > time(NULL))
|
||||
if (IsAlive() || m_corpseRemoveTime > time(NULL))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -1340,9 +1340,9 @@ bool Creature::CanAlwaysSee(WorldObject const* obj) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Creature::canStartAttack(Unit const* who, bool force) const
|
||||
bool Creature::CanStartAttack(Unit const* who, bool force) const
|
||||
{
|
||||
if (isCivilian())
|
||||
if (IsCivilian())
|
||||
return false;
|
||||
|
||||
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
|
||||
@@ -1363,7 +1363,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
|
||||
if (!_IsTargetAcceptable(who))
|
||||
return false;
|
||||
|
||||
if (who->isInCombat() && IsWithinDist(who, ATTACK_DISTANCE))
|
||||
if (who->IsInCombat() && IsWithinDist(who, ATTACK_DISTANCE))
|
||||
if (Unit* victim = who->getAttackerForHelper())
|
||||
if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
|
||||
force = true;
|
||||
@@ -1372,7 +1372,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!canCreatureAttack(who, force))
|
||||
if (!CanCreatureAttack(who, force))
|
||||
return false;
|
||||
|
||||
return IsWithinLOSInMap(who);
|
||||
@@ -1434,7 +1434,7 @@ void Creature::setDeathState(DeathState s)
|
||||
|
||||
setActive(false);
|
||||
|
||||
if (!isPet() && GetCreatureTemplate()->SkinLootId)
|
||||
if (!IsPet() && GetCreatureTemplate()->SkinLootId)
|
||||
if (LootTemplates_Skinning.HaveLootFor(GetCreatureTemplate()->SkinLootId))
|
||||
if (hasLootRecipient())
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
@@ -1456,7 +1456,7 @@ void Creature::setDeathState(DeathState s)
|
||||
}
|
||||
else if (s == JUST_RESPAWNED)
|
||||
{
|
||||
//if (isPet())
|
||||
//if (IsPet())
|
||||
// setActive(true);
|
||||
SetFullHealth();
|
||||
SetLootRecipient(NULL);
|
||||
@@ -1482,7 +1482,7 @@ void Creature::Respawn(bool force)
|
||||
|
||||
if (force)
|
||||
{
|
||||
if (isAlive())
|
||||
if (IsAlive())
|
||||
setDeathState(JUST_DIED);
|
||||
else if (getDeathState() != CORPSE)
|
||||
setDeathState(CORPSE);
|
||||
@@ -1545,7 +1545,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn)
|
||||
return;
|
||||
}
|
||||
|
||||
if (isAlive())
|
||||
if (IsAlive())
|
||||
setDeathState(JUST_DIED);
|
||||
|
||||
RemoveCorpse(false);
|
||||
@@ -1600,7 +1600,7 @@ bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index)
|
||||
|
||||
bool Creature::isElite() const
|
||||
{
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
return false;
|
||||
|
||||
uint32 rank = GetCreatureTemplate()->rank;
|
||||
@@ -1609,7 +1609,7 @@ bool Creature::isElite() const
|
||||
|
||||
bool Creature::isWorldBoss() const
|
||||
{
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
return false;
|
||||
|
||||
return GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_BOSS;
|
||||
@@ -1790,7 +1790,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
|
||||
|
||||
void Creature::CallAssistance()
|
||||
{
|
||||
if (!m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed())
|
||||
if (!m_AlreadyCallAssistance && GetVictim() && !IsPet() && !IsCharmed())
|
||||
{
|
||||
SetNoCallAssistance(true);
|
||||
|
||||
@@ -1805,7 +1805,7 @@ void Creature::CallAssistance()
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
|
||||
Trinity::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
||||
Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
@@ -1815,7 +1815,7 @@ void Creature::CallAssistance()
|
||||
|
||||
if (!assistList.empty())
|
||||
{
|
||||
AssistDelayEvent* e = new AssistDelayEvent(getVictim()->GetGUID(), *this);
|
||||
AssistDelayEvent* e = new AssistDelayEvent(GetVictim()->GetGUID(), *this);
|
||||
while (!assistList.empty())
|
||||
{
|
||||
// Pushing guids because in delay can happen some creature gets despawned => invalid pointer
|
||||
@@ -1830,14 +1830,14 @@ void Creature::CallAssistance()
|
||||
|
||||
void Creature::CallForHelp(float radius)
|
||||
{
|
||||
if (radius <= 0.0f || !getVictim() || isPet() || isCharmed())
|
||||
if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed())
|
||||
return;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::CallOfHelpCreatureInRangeDo u_do(this, getVictim(), radius);
|
||||
Trinity::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius);
|
||||
Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
@@ -1852,18 +1852,18 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
|
||||
return false;
|
||||
|
||||
// we don't need help from zombies :)
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
return false;
|
||||
|
||||
// we don't need help from non-combatant ;)
|
||||
if (isCivilian())
|
||||
if (IsCivilian())
|
||||
return false;
|
||||
|
||||
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC))
|
||||
return false;
|
||||
|
||||
// skip fighting creature
|
||||
if (isInCombat())
|
||||
if (IsInCombat())
|
||||
return false;
|
||||
|
||||
// only free creature
|
||||
@@ -1904,7 +1904,7 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const
|
||||
if (target->HasUnitState(UNIT_STATE_DIED))
|
||||
{
|
||||
// guards can detect fake death
|
||||
if (isGuard() && target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH))
|
||||
if (IsGuard() && target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -1927,14 +1927,14 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const
|
||||
|
||||
void Creature::SaveRespawnTime()
|
||||
{
|
||||
if (isSummon() || !m_DBTableGuid || (m_creatureData && !m_creatureData->dbData))
|
||||
if (IsSummon() || !m_DBTableGuid || (m_creatureData && !m_creatureData->dbData))
|
||||
return;
|
||||
|
||||
GetMap()->SaveCreatureRespawnTime(m_DBTableGuid, m_respawnTime);
|
||||
}
|
||||
|
||||
// this should not be called by petAI or
|
||||
bool Creature::canCreatureAttack(Unit const* victim, bool /*force*/) const
|
||||
bool Creature::CanCreatureAttack(Unit const* victim, bool /*force*/) const
|
||||
{
|
||||
if (!victim->IsInMap(this))
|
||||
return false;
|
||||
@@ -2087,12 +2087,12 @@ void Creature::SetInCombatWithZone()
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
{
|
||||
if (Player* player = i->getSource())
|
||||
if (Player* player = i->GetSource())
|
||||
{
|
||||
if (player->isGameMaster())
|
||||
if (player->IsGameMaster())
|
||||
continue;
|
||||
|
||||
if (player->isAlive())
|
||||
if (player->IsAlive())
|
||||
{
|
||||
this->SetInCombatWith(player);
|
||||
player->SetInCombatWith(this);
|
||||
@@ -2468,7 +2468,7 @@ float Creature::GetAggroRange(Unit const* target) const
|
||||
// Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection.
|
||||
// Based on data from wowwiki due to lack of 3.3.5a data
|
||||
|
||||
if (target && this->isPet())
|
||||
if (target && this->IsPet())
|
||||
{
|
||||
uint32 targetLevel = 0;
|
||||
|
||||
|
||||
@@ -157,18 +157,18 @@ struct CreatureTemplate
|
||||
return SKILL_SKINNING; // normal case
|
||||
}
|
||||
|
||||
bool isExotic() const
|
||||
bool IsExotic() const
|
||||
{
|
||||
return (type_flags & CREATURE_TYPEFLAGS_EXOTIC) != 0;
|
||||
}
|
||||
|
||||
bool isTameable(bool canTameExotic) const
|
||||
bool IsTameable(bool canTameExotic) const
|
||||
{
|
||||
if (type != CREATURE_TYPE_BEAST || family == 0 || (type_flags & CREATURE_TYPEFLAGS_TAMEABLE) == 0)
|
||||
return false;
|
||||
|
||||
// if can tame exotic then can tame any tameable
|
||||
return canTameExotic || !isExotic();
|
||||
return canTameExotic || !IsExotic();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -470,12 +470,12 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
|
||||
|
||||
void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; }
|
||||
uint32 GetCorpseDelay() const { return m_corpseDelay; }
|
||||
bool isRacialLeader() const { return GetCreatureTemplate()->RacialLeader; }
|
||||
bool isCivilian() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; }
|
||||
bool isTrigger() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; }
|
||||
bool isGuard() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; }
|
||||
bool canWalk() const { return GetCreatureTemplate()->InhabitType & INHABIT_GROUND; }
|
||||
bool canSwim() const { return GetCreatureTemplate()->InhabitType & INHABIT_WATER; }
|
||||
bool IsRacialLeader() const { return GetCreatureTemplate()->RacialLeader; }
|
||||
bool IsCivilian() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; }
|
||||
bool IsTrigger() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; }
|
||||
bool IsGuard() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; }
|
||||
bool CanWalk() const { return GetCreatureTemplate()->InhabitType & INHABIT_GROUND; }
|
||||
bool CanSwim() const { return GetCreatureTemplate()->InhabitType & INHABIT_WATER; }
|
||||
bool CanFly() const { return GetCreatureTemplate()->InhabitType & INHABIT_AIR; }
|
||||
|
||||
void SetReactState(ReactStates st) { m_reactState = st; }
|
||||
@@ -486,7 +486,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
|
||||
/// @todo Rename these properly
|
||||
bool isCanInteractWithBattleMaster(Player* player, bool msg) const;
|
||||
bool isCanTrainingAndResetTalentsOf(Player* player) const;
|
||||
bool canCreatureAttack(Unit const* victim, bool force = true) const;
|
||||
bool CanCreatureAttack(Unit const* victim, bool force = true) const;
|
||||
bool IsImmunedToSpell(SpellInfo const* spellInfo) const; // override Unit::IsImmunedToSpell
|
||||
bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // override Unit::IsImmunedToSpellEffect
|
||||
bool isElite() const;
|
||||
@@ -596,7 +596,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
|
||||
CreatureSpellCooldowns m_CreatureSpellCooldowns;
|
||||
CreatureSpellCooldowns m_CreatureCategoryCooldowns;
|
||||
|
||||
bool canStartAttack(Unit const* u, bool force) const;
|
||||
bool CanStartAttack(Unit const* u, bool force) const;
|
||||
float GetAttackDistance(Unit const* player) const;
|
||||
float GetAggroRange(Unit const* target) const;
|
||||
|
||||
|
||||
@@ -180,10 +180,10 @@ void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
|
||||
if (itr->first == member)
|
||||
continue;
|
||||
|
||||
if (!itr->first->isAlive())
|
||||
if (!itr->first->IsAlive())
|
||||
continue;
|
||||
|
||||
if (itr->first->getVictim())
|
||||
if (itr->first->GetVictim())
|
||||
continue;
|
||||
|
||||
if (itr->first->IsValidAttackTarget(target) && itr->first->AI())
|
||||
@@ -195,7 +195,7 @@ void CreatureGroup::FormationReset(bool dismiss)
|
||||
{
|
||||
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
if (itr->first != m_leader && itr->first->isAlive())
|
||||
if (itr->first != m_leader && itr->first->IsAlive())
|
||||
{
|
||||
if (dismiss)
|
||||
itr->first->GetMotionMaster()->Initialize();
|
||||
@@ -219,7 +219,7 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z)
|
||||
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
Creature* member = itr->first;
|
||||
if (member == m_leader || !member->isAlive() || member->getVictim())
|
||||
if (member == m_leader || !member->IsAlive() || member->GetVictim())
|
||||
continue;
|
||||
|
||||
float angle = itr->second->follow_angle;
|
||||
|
||||
@@ -68,7 +68,7 @@ void TempSummon::Update(uint32 diff)
|
||||
}
|
||||
case TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT:
|
||||
{
|
||||
if (!isInCombat())
|
||||
if (!IsInCombat())
|
||||
{
|
||||
if (m_timer <= diff)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ void TempSummon::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isInCombat())
|
||||
if (!IsInCombat())
|
||||
{
|
||||
if (m_timer <= diff)
|
||||
{
|
||||
@@ -150,7 +150,7 @@ void TempSummon::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isInCombat() && isAlive())
|
||||
if (!IsInCombat() && IsAlive())
|
||||
{
|
||||
if (m_timer <= diff)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ void TempSummon::Update(uint32 diff)
|
||||
|
||||
void TempSummon::InitStats(uint32 duration)
|
||||
{
|
||||
ASSERT(!isPet());
|
||||
ASSERT(!IsPet());
|
||||
|
||||
m_timer = duration;
|
||||
m_lifetime = duration;
|
||||
@@ -183,7 +183,7 @@ void TempSummon::InitStats(uint32 duration)
|
||||
|
||||
Unit* owner = GetSummoner();
|
||||
|
||||
if (owner && isTrigger() && m_spells[0])
|
||||
if (owner && IsTrigger() && m_spells[0])
|
||||
{
|
||||
setFaction(owner->getFaction());
|
||||
SetLevel(owner->getLevel());
|
||||
@@ -202,7 +202,7 @@ void TempSummon::InitStats(uint32 duration)
|
||||
if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
|
||||
{
|
||||
Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
|
||||
if (oldSummon && oldSummon->isSummon())
|
||||
if (oldSummon && oldSummon->IsSummon())
|
||||
oldSummon->ToTempSummon()->UnSummon();
|
||||
}
|
||||
owner->m_SummonSlot[slot] = GetGUID();
|
||||
@@ -242,8 +242,8 @@ void TempSummon::UnSummon(uint32 msTime)
|
||||
return;
|
||||
}
|
||||
|
||||
//ASSERT(!isPet());
|
||||
if (isPet())
|
||||
//ASSERT(!IsPet());
|
||||
if (IsPet())
|
||||
{
|
||||
((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
|
||||
ASSERT(!IsInWorld());
|
||||
@@ -314,7 +314,7 @@ void Minion::RemoveFromWorld()
|
||||
|
||||
bool Minion::IsGuardianPet() const
|
||||
{
|
||||
return isPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
|
||||
return IsPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
|
||||
}
|
||||
|
||||
Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject) : Minion(properties, owner, isWorldObject)
|
||||
@@ -380,7 +380,7 @@ void Puppet::Update(uint32 time)
|
||||
//check if caster is channelling?
|
||||
if (IsInWorld())
|
||||
{
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
{
|
||||
UnSummon();
|
||||
/// @todo why long distance .die does not remove it
|
||||
|
||||
@@ -303,7 +303,7 @@ void GameObject::Update(uint32 diff)
|
||||
m_cooldownTime = time(NULL) + 10; // Hardcoded tooltip value
|
||||
else if (Unit* owner = GetOwner())
|
||||
{
|
||||
if (owner->isInCombat())
|
||||
if (owner->IsInCombat())
|
||||
m_cooldownTime = time(NULL) + goInfo->trap.startDelay;
|
||||
}
|
||||
m_lootState = GO_READY;
|
||||
|
||||
@@ -243,7 +243,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
}
|
||||
|
||||
if (Unit const* unit = ToUnit())
|
||||
if (unit->getVictim())
|
||||
if (unit->GetVictim())
|
||||
flags |= UPDATEFLAG_HAS_TARGET;
|
||||
|
||||
ByteBuffer buf(500);
|
||||
@@ -488,7 +488,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
|
||||
if (flags & UPDATEFLAG_HAS_TARGET)
|
||||
{
|
||||
ObjectGuid victimGuid = self->getVictim()->GetGUID(); // checked in BuildCreateUpdateBlockForPlayer
|
||||
ObjectGuid victimGuid = self->GetVictim()->GetGUID(); // checked in BuildCreateUpdateBlockForPlayer
|
||||
data->WriteBit(victimGuid[2]);
|
||||
data->WriteBit(victimGuid[7]);
|
||||
data->WriteBit(victimGuid[0]);
|
||||
@@ -663,7 +663,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
|
||||
if (flags & UPDATEFLAG_HAS_TARGET)
|
||||
{
|
||||
ObjectGuid victimGuid = self->getVictim()->GetGUID(); // checked in BuildCreateUpdateBlockForPlayer
|
||||
ObjectGuid victimGuid = self->GetVictim()->GetGUID(); // checked in BuildCreateUpdateBlockForPlayer
|
||||
data->WriteByteSeq(victimGuid[4]);
|
||||
data->WriteByteSeq(victimGuid[0]);
|
||||
data->WriteByteSeq(victimGuid[3]);
|
||||
@@ -710,7 +710,7 @@ void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask*
|
||||
{
|
||||
if (!go->IsDynTransport())
|
||||
{
|
||||
if (go->ActivateToQuest(target) || target->isGameMaster())
|
||||
if (go->ActivateToQuest(target) || target->IsGameMaster())
|
||||
IsActivateToQuest = true;
|
||||
|
||||
if (go->GetGoArtKit())
|
||||
@@ -721,7 +721,7 @@ void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask*
|
||||
{
|
||||
if (!go->IsTransport())
|
||||
{
|
||||
if (go->ActivateToQuest(target) || target->isGameMaster())
|
||||
if (go->ActivateToQuest(target) || target->IsGameMaster())
|
||||
IsActivateToQuest = true;
|
||||
|
||||
updateMask->SetBit(GAMEOBJECT_BYTES_1);
|
||||
@@ -759,7 +759,7 @@ void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask*
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (!target->canSeeSpellClickOn(this->ToCreature()))
|
||||
if (!target->CanSeeSpellClickOn(this->ToCreature()))
|
||||
appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask*
|
||||
// Gamemasters should be always able to select units - remove not selectable flag
|
||||
else if (index == UNIT_FIELD_FLAGS)
|
||||
{
|
||||
if (target->isGameMaster())
|
||||
if (target->IsGameMaster())
|
||||
*data << (m_uint32Values[index] & ~UNIT_FLAG_NOT_SELECTABLE);
|
||||
else
|
||||
*data << m_uint32Values[index];
|
||||
@@ -811,7 +811,7 @@ void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask*
|
||||
|
||||
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
|
||||
{
|
||||
if (target->isGameMaster())
|
||||
if (target->IsGameMaster())
|
||||
{
|
||||
if (cinfo->Modelid1)
|
||||
*data << cinfo->Modelid1;//Modelid1 is a visible model for gms
|
||||
@@ -872,8 +872,8 @@ void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask*
|
||||
{
|
||||
if (unit->IsControlledByPlayer() && target != this && sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && unit->IsInRaidWith(target))
|
||||
{
|
||||
FactionTemplateEntry const* ft1 = unit->getFactionTemplateEntry();
|
||||
FactionTemplateEntry const* ft2 = target->getFactionTemplateEntry();
|
||||
FactionTemplateEntry const* ft1 = unit->GetFactionTemplateEntry();
|
||||
FactionTemplateEntry const* ft2 = target->GetFactionTemplateEntry();
|
||||
if (ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
|
||||
{
|
||||
if (index == UNIT_FIELD_BYTES_2)
|
||||
@@ -916,19 +916,19 @@ void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask*
|
||||
switch (go->GetGoType())
|
||||
{
|
||||
case GAMEOBJECT_TYPE_CHEST:
|
||||
if (target->isGameMaster())
|
||||
if (target->IsGameMaster())
|
||||
*data << uint16(GO_DYNFLAG_LO_ACTIVATE);
|
||||
else
|
||||
*data << uint16(GO_DYNFLAG_LO_ACTIVATE | GO_DYNFLAG_LO_SPARKLE);
|
||||
break;
|
||||
case GAMEOBJECT_TYPE_GENERIC:
|
||||
if (target->isGameMaster())
|
||||
if (target->IsGameMaster())
|
||||
*data << uint16(0);
|
||||
else
|
||||
*data << uint16(GO_DYNFLAG_LO_SPARKLE);
|
||||
break;
|
||||
case GAMEOBJECT_TYPE_GOOBER:
|
||||
if (target->isGameMaster())
|
||||
if (target->IsGameMaster())
|
||||
*data << uint16(GO_DYNFLAG_LO_ACTIVATE);
|
||||
else
|
||||
*data << uint16(GO_DYNFLAG_LO_ACTIVATE | GO_DYNFLAG_LO_SPARKLE);
|
||||
@@ -2054,7 +2054,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
|
||||
// non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast
|
||||
if (!ToCreature()->CanFly())
|
||||
{
|
||||
bool canSwim = ToCreature()->canSwim();
|
||||
bool canSwim = ToCreature()->CanSwim();
|
||||
float ground_z = z;
|
||||
float max_z = canSwim
|
||||
? GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK))
|
||||
@@ -2151,7 +2151,7 @@ float WorldObject::GetSightRange(const WorldObject* target) const
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, bool distanceCheck) const
|
||||
bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, bool distanceCheck) const
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
@@ -2468,8 +2468,8 @@ void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 Target
|
||||
|
||||
Map::PlayerList const& pList = GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
if (itr->getSource()->GetZoneId() == zoneid)
|
||||
say_do(itr->getSource());
|
||||
if (itr->GetSource()->GetZoneId() == zoneid)
|
||||
say_do(itr->GetSource());
|
||||
}
|
||||
|
||||
void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote)
|
||||
@@ -2924,7 +2924,7 @@ namespace Trinity
|
||||
|
||||
float x, y, z;
|
||||
|
||||
if (!c->isAlive() || c->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) ||
|
||||
if (!c->IsAlive() || c->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) ||
|
||||
!c->GetMotionMaster()->GetDestination(x, y, z))
|
||||
{
|
||||
x = c->GetPositionX();
|
||||
@@ -3341,7 +3341,7 @@ struct WorldObjectChangeAccumulator
|
||||
Player* source = NULL;
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->getSource();
|
||||
source = iter->GetSource();
|
||||
|
||||
BuildPacket(source);
|
||||
|
||||
@@ -3359,7 +3359,7 @@ struct WorldObjectChangeAccumulator
|
||||
Creature* source = NULL;
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->getSource();
|
||||
source = iter->GetSource();
|
||||
if (!source->GetSharedVisionList().empty())
|
||||
{
|
||||
SharedVisionList::const_iterator it = source->GetSharedVisionList().begin();
|
||||
@@ -3374,7 +3374,7 @@ struct WorldObjectChangeAccumulator
|
||||
DynamicObject* source = NULL;
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->getSource();
|
||||
source = iter->GetSource();
|
||||
uint64 guid = source->GetCasterGUID();
|
||||
|
||||
if (IS_PLAYER_GUID(guid))
|
||||
|
||||
@@ -685,7 +685,7 @@ class WorldObject : public Object, public WorldLocation
|
||||
float GetGridActivationRange() const;
|
||||
float GetVisibilityRange() const;
|
||||
float GetSightRange(WorldObject const* target = NULL) const;
|
||||
bool canSeeOrDetect(WorldObject const* obj, bool ignoreStealth = false, bool distanceCheck = false) const;
|
||||
bool CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth = false, bool distanceCheck = false) const;
|
||||
|
||||
FlaggedValuesArray32<int32, uint32, StealthType, TOTAL_STEALTH_TYPES> m_stealth;
|
||||
FlaggedValuesArray32<int32, uint32, StealthType, TOTAL_STEALTH_TYPES> m_stealthDetect;
|
||||
|
||||
@@ -162,7 +162,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
if (petType == HUNTER_PET)
|
||||
{
|
||||
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(petEntry);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets()))
|
||||
if (!creatureInfo || !creatureInfo->IsTameable(owner->CanTameExoticPets()))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ void Creature::Regenerate(Powers power)
|
||||
if (Powers((*i)->GetMiscValue()) == power)
|
||||
AddPct(addvalue, (*i)->GetAmount());
|
||||
|
||||
addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * (isHunterPet()? PET_FOCUS_REGEN_INTERVAL : CREATURE_REGEN_INTERVAL) / (5 * IN_MILLISECONDS);
|
||||
addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * (IsHunterPet()? PET_FOCUS_REGEN_INTERVAL : CREATURE_REGEN_INTERVAL) / (5 * IN_MILLISECONDS);
|
||||
|
||||
ModifyPower(power, int32(addvalue));
|
||||
}
|
||||
@@ -664,7 +664,7 @@ void Pet::GivePetXP(uint32 xp)
|
||||
if (xp < 1)
|
||||
return;
|
||||
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
return;
|
||||
|
||||
uint8 maxlevel = std::min((uint8)sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->getLevel());
|
||||
@@ -789,7 +789,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
|
||||
//Determine pet type
|
||||
PetType petType = MAX_PET_TYPE;
|
||||
if (isPet() && GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
if (IsPet() && GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (GetOwner()->getClass() == CLASS_WARLOCK
|
||||
|| GetOwner()->getClass() == CLASS_SHAMAN // Fire Elemental
|
||||
|
||||
@@ -463,8 +463,8 @@ inline void KillRewarder::_InitGroupData()
|
||||
{
|
||||
// 2. In case when player is in group, initialize variables necessary for group calculations:
|
||||
for (GroupReference* itr = _group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (Player* member = itr->getSource())
|
||||
if (member->isAlive() && member->IsAtGroupRewardDistance(_victim))
|
||||
if (Player* member = itr->GetSource())
|
||||
if (member->IsAlive() && member->IsAtGroupRewardDistance(_victim))
|
||||
{
|
||||
const uint8 lvl = member->getLevel();
|
||||
// 2.1. _count - number of alive group members within reward distance;
|
||||
@@ -502,7 +502,7 @@ inline void KillRewarder::_InitXP(Player* player)
|
||||
inline void KillRewarder::_RewardHonor(Player* player)
|
||||
{
|
||||
// Rewarded player must be alive.
|
||||
if (player->isAlive())
|
||||
if (player->IsAlive())
|
||||
player->RewardHonor(_victim, _count, -1, true);
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ inline void KillRewarder::_RewardXP(Player* player, float rate)
|
||||
// 4.2.1. If player is in group, adjust XP:
|
||||
// * set to 0 if player's level is more than maximum level of not gray member;
|
||||
// * cut XP in half if _isFullXP is false.
|
||||
if (_maxNotGrayMember && player->isAlive() &&
|
||||
if (_maxNotGrayMember && player->IsAlive() &&
|
||||
_maxNotGrayMember->getLevel() >= player->getLevel())
|
||||
xp = _isFullXP ?
|
||||
uint32(xp * rate) : // Reward FULL XP if all group members are not gray.
|
||||
@@ -551,7 +551,7 @@ inline void KillRewarder::_RewardReputation(Player* player, float rate)
|
||||
inline void KillRewarder::_RewardKillCredit(Player* player)
|
||||
{
|
||||
// 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse).
|
||||
if (!_group || player->isAlive() || !player->GetCorpse())
|
||||
if (!_group || player->IsAlive() || !player->GetCorpse())
|
||||
if (_victim->GetTypeId() == TYPEID_UNIT)
|
||||
player->KilledMonster(_victim->ToCreature()->GetCreatureTemplate(), _victim->GetGUID());
|
||||
}
|
||||
@@ -610,7 +610,7 @@ void KillRewarder::_RewardGroup()
|
||||
// 3.1.3. Reward each group member (even dead or corpse) within reward distance.
|
||||
for (GroupReference* itr = _group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
if (Player* member = itr->getSource())
|
||||
if (Player* member = itr->GetSource())
|
||||
{
|
||||
if (member->IsAtGroupRewardDistance(_victim))
|
||||
{
|
||||
@@ -1298,7 +1298,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
||||
|
||||
uint32 final_damage = DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
{
|
||||
if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
|
||||
{
|
||||
@@ -1322,7 +1322,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
||||
return MINUTE * IN_MILLISECONDS;
|
||||
case BREATH_TIMER:
|
||||
{
|
||||
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_DISABLE_BREATHING)))
|
||||
if (!IsAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_DISABLE_BREATHING)))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
int32 UnderWaterTime = 3 * MINUTE * IN_MILLISECONDS;
|
||||
AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING);
|
||||
@@ -1332,7 +1332,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
||||
}
|
||||
case FIRE_TIMER:
|
||||
{
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
return 1 * IN_MILLISECONDS;
|
||||
}
|
||||
@@ -1395,7 +1395,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
int32 UnderWaterTime = getMaxTimer(BREATH_TIMER);
|
||||
// Need breath regen
|
||||
m_MirrorTimer[BREATH_TIMER]+=10*time_diff;
|
||||
if (m_MirrorTimer[BREATH_TIMER] >= UnderWaterTime || !isAlive())
|
||||
if (m_MirrorTimer[BREATH_TIMER] >= UnderWaterTime || !IsAlive())
|
||||
StopMirrorTimer(BREATH_TIMER);
|
||||
else if (m_MirrorTimerFlagsLast & UNDERWATER_INWATER)
|
||||
SendMirrorTimer(BREATH_TIMER, UnderWaterTime, m_MirrorTimer[BREATH_TIMER], 10);
|
||||
@@ -1417,7 +1417,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
if (m_MirrorTimer[FATIGUE_TIMER] < 0)
|
||||
{
|
||||
m_MirrorTimer[FATIGUE_TIMER]+= 1*IN_MILLISECONDS;
|
||||
if (isAlive()) // Calculate and deal damage
|
||||
if (IsAlive()) // Calculate and deal damage
|
||||
{
|
||||
uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel()-1);
|
||||
EnvironmentalDamage(DAMAGE_EXHAUSTED, damage);
|
||||
@@ -1433,7 +1433,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
{
|
||||
int32 DarkWaterTime = getMaxTimer(FATIGUE_TIMER);
|
||||
m_MirrorTimer[FATIGUE_TIMER]+=10*time_diff;
|
||||
if (m_MirrorTimer[FATIGUE_TIMER] >= DarkWaterTime || !isAlive())
|
||||
if (m_MirrorTimer[FATIGUE_TIMER] >= DarkWaterTime || !IsAlive())
|
||||
StopMirrorTimer(FATIGUE_TIMER);
|
||||
else if (m_MirrorTimerFlagsLast & UNDERWARER_INDARKWATER)
|
||||
SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10);
|
||||
@@ -1574,9 +1574,9 @@ void Player::Update(uint32 p_time)
|
||||
|
||||
UpdateAfkReport(now);
|
||||
|
||||
if (isCharmed())
|
||||
if (IsCharmed())
|
||||
if (Unit* charmer = GetCharmer())
|
||||
if (charmer->GetTypeId() == TYPEID_UNIT && charmer->isAlive())
|
||||
if (charmer->GetTypeId() == TYPEID_UNIT && charmer->IsAlive())
|
||||
UpdateCharmedAI();
|
||||
|
||||
// Update items that have just a limited lifetime
|
||||
@@ -1624,7 +1624,7 @@ void Player::Update(uint32 p_time)
|
||||
|
||||
if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
if (Unit* victim = getVictim())
|
||||
if (Unit* victim = GetVictim())
|
||||
{
|
||||
// default combat reach 10
|
||||
/// @todo add weapon, skill check
|
||||
@@ -1747,7 +1747,7 @@ void Player::Update(uint32 p_time)
|
||||
m_timeSyncTimer -= p_time;
|
||||
}
|
||||
|
||||
if (isAlive())
|
||||
if (IsAlive())
|
||||
{
|
||||
m_regenTimer += p_time;
|
||||
RegenerateAll();
|
||||
@@ -1838,7 +1838,7 @@ void Player::Update(uint32 p_time)
|
||||
|
||||
//we should execute delayed teleports only for alive(!) players
|
||||
//because we don't want player's ghost teleported from graveyard
|
||||
if (IsHasDelayedTeleport() && isAlive())
|
||||
if (IsHasDelayedTeleport() && IsAlive())
|
||||
TeleportTo(m_teleport_dest, m_teleport_options);
|
||||
}
|
||||
|
||||
@@ -1846,7 +1846,7 @@ void Player::setDeathState(DeathState s)
|
||||
{
|
||||
uint32 ressSpellId = 0;
|
||||
|
||||
bool cur = isAlive();
|
||||
bool cur = IsAlive();
|
||||
|
||||
if (s == JUST_DIED)
|
||||
{
|
||||
@@ -1886,7 +1886,7 @@ void Player::setDeathState(DeathState s)
|
||||
if (s == JUST_DIED && cur && ressSpellId)
|
||||
SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId);
|
||||
|
||||
if (isAlive() && !cur)
|
||||
if (IsAlive() && !cur)
|
||||
//clear aura case after resurrection by another way (spells will be applied before next death)
|
||||
SetUInt32Value(PLAYER_SELF_RES_SPELL, 0);
|
||||
}
|
||||
@@ -2214,7 +2214,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getClass() == CLASS_DEATH_KNIGHT && GetMapId() == 609 && !isGameMaster() && !HasSpell(50977))
|
||||
if (getClass() == CLASS_DEATH_KNIGHT && GetMapId() == 609 && !IsGameMaster() && !HasSpell(50977))
|
||||
return false;
|
||||
|
||||
// far teleport to another map
|
||||
@@ -2528,7 +2528,7 @@ void Player::RegenerateAll()
|
||||
if (m_regenTimerCount >= 2000)
|
||||
{
|
||||
// Not in combat or they have regeneration
|
||||
if (!isInCombat() || IsPolymorphed() || m_baseHealthRegen ||
|
||||
if (!IsInCombat() || IsPolymorphed() || m_baseHealthRegen ||
|
||||
HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT) ||
|
||||
HasAuraType(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT))
|
||||
{
|
||||
@@ -2581,7 +2581,7 @@ void Player::Regenerate(Powers power)
|
||||
{
|
||||
float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA);
|
||||
|
||||
if (isInCombat()) // Trinity Updates Mana in intervals of 2s, which is correct
|
||||
if (IsInCombat()) // Trinity Updates Mana in intervals of 2s, which is correct
|
||||
addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * ((0.001f * m_regenTimer) + CalculatePct(0.001f, spellHaste));
|
||||
else
|
||||
addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER) * ManaIncreaseRate * ((0.001f * m_regenTimer) + CalculatePct(0.001f, spellHaste));
|
||||
@@ -2589,7 +2589,7 @@ void Player::Regenerate(Powers power)
|
||||
break;
|
||||
case POWER_RAGE: // Regenerate rage
|
||||
{
|
||||
if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN))
|
||||
if (!IsInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN))
|
||||
{
|
||||
float RageDecreaseRate = sWorld->getRate(RATE_POWER_RAGE_LOSS);
|
||||
addvalue += -25 * RageDecreaseRate / meleeHaste; // 2.5 rage by tick (= 2 seconds => 1.25 rage/sec)
|
||||
@@ -2604,7 +2604,7 @@ void Player::Regenerate(Powers power)
|
||||
break;
|
||||
case POWER_RUNIC_POWER:
|
||||
{
|
||||
if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN))
|
||||
if (!IsInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN))
|
||||
{
|
||||
float RunicPowerDecreaseRate = sWorld->getRate(RATE_POWER_RUNICPOWER_LOSS);
|
||||
addvalue += -30 * RunicPowerDecreaseRate; // 3 RunicPower by tick
|
||||
@@ -2613,7 +2613,7 @@ void Player::Regenerate(Powers power)
|
||||
break;
|
||||
case POWER_HOLY_POWER: // Regenerate holy power
|
||||
{
|
||||
if (!isInCombat())
|
||||
if (!IsInCombat())
|
||||
addvalue += -1.0f; // remove 1 each 10 sec
|
||||
}
|
||||
break;
|
||||
@@ -2634,7 +2634,7 @@ void Player::Regenerate(Powers power)
|
||||
AddPct(addvalue, (*i)->GetAmount());
|
||||
|
||||
// Butchery requires combat for this effect
|
||||
if (power != POWER_RUNIC_POWER || isInCombat())
|
||||
if (power != POWER_RUNIC_POWER || IsInCombat())
|
||||
addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * ((power != POWER_ENERGY) ? m_regenTimerCount : m_regenTimer) / (5 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
@@ -2701,10 +2701,10 @@ void Player::RegenerateHealth()
|
||||
if (IsPolymorphed())
|
||||
addvalue = (float)GetMaxHealth()/3;
|
||||
// normal regen case (maybe partly in combat case)
|
||||
else if (!isInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
|
||||
else if (!IsInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
|
||||
{
|
||||
addvalue = HealthIncreaseRate;
|
||||
if (!isInCombat())
|
||||
if (!IsInCombat())
|
||||
{
|
||||
if (getLevel() < 15)
|
||||
addvalue = (0.20f*((float)GetMaxHealth())/getLevel()*HealthIncreaseRate);
|
||||
@@ -2768,9 +2768,9 @@ bool Player::CanInteractWithQuestGiver(Object* questGiver)
|
||||
case TYPEID_GAMEOBJECT:
|
||||
return GetGameObjectIfCanInteractWith(questGiver->GetGUID(), GAMEOBJECT_TYPE_QUESTGIVER) != NULL;
|
||||
case TYPEID_PLAYER:
|
||||
return isAlive() && questGiver->ToPlayer()->isAlive();
|
||||
return IsAlive() && questGiver->ToPlayer()->IsAlive();
|
||||
case TYPEID_ITEM:
|
||||
return isAlive();
|
||||
return IsAlive();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2786,7 +2786,7 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
|
||||
if (!IsInWorld())
|
||||
return NULL;
|
||||
|
||||
if (isInFlight())
|
||||
if (IsInFlight())
|
||||
return NULL;
|
||||
|
||||
// exist (we need look pets also for some interaction (quest/etc)
|
||||
@@ -2795,11 +2795,11 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
|
||||
return NULL;
|
||||
|
||||
// Deathstate checks
|
||||
if (!isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_GHOST))
|
||||
if (!IsAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_GHOST))
|
||||
return NULL;
|
||||
|
||||
// alive or spirit healer
|
||||
if (!creature->isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT))
|
||||
if (!creature->IsAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT))
|
||||
return NULL;
|
||||
|
||||
// appropriate npc type
|
||||
@@ -3036,7 +3036,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate)
|
||||
if (xp < 1)
|
||||
return;
|
||||
|
||||
if (!isAlive() && !GetBattlegroundId())
|
||||
if (!IsAlive() && !GetBattlegroundId())
|
||||
return;
|
||||
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN))
|
||||
@@ -4563,7 +4563,7 @@ bool Player::ResetTalents(bool no_cost)
|
||||
/* when prev line will dropped use next line
|
||||
if (Pet* pet = GetPet())
|
||||
{
|
||||
if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureTemplate()->isTameable(CanTameExoticPets()))
|
||||
if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureTemplate()->IsTameable(CanTameExoticPets()))
|
||||
RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
*/
|
||||
@@ -5546,7 +5546,7 @@ void Player::RepopAtGraveyard()
|
||||
AreaTableEntry const* zone = GetAreaEntryByAreaID(GetAreaId());
|
||||
|
||||
// Such zones are considered unreachable as a ghost and the player must be automatically revived
|
||||
if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < (zone ? zone->MaxDepth : -500.0f))
|
||||
if ((!IsAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < (zone ? zone->MaxDepth : -500.0f))
|
||||
{
|
||||
ResurrectPlayer(0.5f);
|
||||
SpawnCorpseBones();
|
||||
@@ -6795,10 +6795,10 @@ void Player::SendMovieStart(uint32 MovieId)
|
||||
|
||||
void Player::CheckAreaExploreAndOutdoor()
|
||||
{
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
return;
|
||||
|
||||
if (isInFlight())
|
||||
if (IsInFlight())
|
||||
return;
|
||||
|
||||
bool isOutdoor;
|
||||
@@ -7187,7 +7187,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!victim->ToCreature()->isRacialLeader())
|
||||
if (!victim->ToCreature()->IsRacialLeader())
|
||||
return false;
|
||||
|
||||
honor_f = 100.0f; // ??? need more info
|
||||
@@ -7903,7 +7903,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
|
||||
// remove items with area/map limitations (delete only for alive player to allow back in ghost mode)
|
||||
// if player resurrected at teleport this will be applied in resurrect code
|
||||
if (isAlive())
|
||||
if (IsAlive())
|
||||
DestroyZoneLimitedItem(true, newZone);
|
||||
|
||||
// check some item equip limitations (in result lost CanTitanGrip at talent reset, for example)
|
||||
@@ -7954,7 +7954,7 @@ void Player::CheckDuelDistance(time_t currTime)
|
||||
|
||||
bool Player::IsOutdoorPvPActive()
|
||||
{
|
||||
return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && IsPvP() && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight();
|
||||
return IsAlive() && !HasInvisibilityAura() && !HasStealthAura() && IsPvP() && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !IsInFlight();
|
||||
}
|
||||
|
||||
void Player::DuelComplete(DuelCompleteType type)
|
||||
@@ -8591,7 +8591,7 @@ void Player::UpdateEquipSpellsAtFormChange()
|
||||
}
|
||||
void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx)
|
||||
{
|
||||
if (!target || !target->isAlive() || target == this)
|
||||
if (!target || !target->IsAlive() || target == this)
|
||||
return;
|
||||
|
||||
for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
|
||||
@@ -9162,7 +9162,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
||||
Creature* creature = GetMap()->GetCreature(guid);
|
||||
|
||||
// must be in range and creature must be alive for pickpocket and must be dead for another loot
|
||||
if (!creature || creature->isAlive() != (loot_type == LOOT_PICKPOCKETING) || !creature->IsWithinDistInMap(this, INTERACTION_DISTANCE))
|
||||
if (!creature || creature->IsAlive() != (loot_type == LOOT_PICKPOCKETING) || !creature->IsWithinDistInMap(this, INTERACTION_DISTANCE))
|
||||
{
|
||||
SendLootRelease(guid);
|
||||
return;
|
||||
@@ -11428,7 +11428,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
// - in-progress arenas
|
||||
if (!pProto->CanChangeEquipStateInCombat())
|
||||
{
|
||||
if (isInCombat())
|
||||
if (IsInCombat())
|
||||
return EQUIP_ERR_NOT_IN_COMBAT;
|
||||
|
||||
if (Battleground* bg = GetBattleground())
|
||||
@@ -11436,7 +11436,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
return EQUIP_ERR_NOT_DURING_ARENA_MATCH;
|
||||
}
|
||||
|
||||
if (isInCombat()&& (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer != 0)
|
||||
if (IsInCombat()&& (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer != 0)
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT; // maybe exist better err
|
||||
|
||||
if (IsNonMeleeSpellCasted(false))
|
||||
@@ -11583,7 +11583,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
|
||||
// - in-progress arenas
|
||||
if (!pProto->CanChangeEquipStateInCombat())
|
||||
{
|
||||
if (isInCombat())
|
||||
if (IsInCombat())
|
||||
return EQUIP_ERR_NOT_IN_COMBAT;
|
||||
|
||||
if (Battleground* bg = GetBattleground())
|
||||
@@ -11789,7 +11789,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry());
|
||||
|
||||
if (!isAlive() && not_loading)
|
||||
if (!IsAlive() && not_loading)
|
||||
return EQUIP_ERR_PLAYER_DEAD;
|
||||
|
||||
//if (isStunned())
|
||||
@@ -12155,7 +12155,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
|
||||
{
|
||||
VisualizeItem(slot, pItem);
|
||||
|
||||
if (isAlive())
|
||||
if (IsAlive())
|
||||
{
|
||||
ItemTemplate const* pProto = pItem->GetTemplate();
|
||||
|
||||
@@ -12165,7 +12165,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
|
||||
|
||||
_ApplyItemMods(pItem, slot, true);
|
||||
|
||||
if (pProto && isInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer == 0)
|
||||
if (pProto && IsInCombat() && (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer == 0)
|
||||
{
|
||||
uint32 cooldownSpell = getClass() == CLASS_ROGUE ? 6123 : 6119;
|
||||
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cooldownSpell);
|
||||
@@ -12932,7 +12932,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
|
||||
|
||||
TC_LOG_DEBUG(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry());
|
||||
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_PLAYER_DEAD, pSrcItem, pDstItem);
|
||||
return;
|
||||
@@ -14439,6 +14439,10 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
canTalk = false;
|
||||
break;
|
||||
case GOSSIP_OPTION_TRAINER:
|
||||
if (getClass() != creature->GetCreatureTemplate()->trainer_class && creature->GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS)
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "GOSSIP_OPTION_TRAINER:: Player %s (GUID: %u) request wrong gossip menu: %u with wrong class: %u at Creature: %s (Entry: %u, Trainer Class: %u)",
|
||||
GetName().c_str(), GetGUIDLow(), menu->GetGossipMenu().GetMenuId(), getClass(), creature->GetName().c_str(), creature->GetEntry(), creature->GetCreatureTemplate()->trainer_class);
|
||||
// no break;
|
||||
case GOSSIP_OPTION_GOSSIP:
|
||||
case GOSSIP_OPTION_SPIRITGUIDE:
|
||||
case GOSSIP_OPTION_INNKEEPER:
|
||||
@@ -16152,7 +16156,7 @@ void Player::GroupEventHappens(uint32 questId, WorldObject const* pEventObject)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
|
||||
// for any leave or dead (with not released body) group member at appropriate distance
|
||||
if (player && player->IsAtGroupRewardDistance(pEventObject) && !player->GetCorpse())
|
||||
@@ -17566,7 +17570,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
|
||||
// Spell code allow apply any auras to dead character in load time in aura/spell/item loading
|
||||
// Do now before stats re-calculation cleanup for ghost state unexpected auras
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
RemoveAllAurasOnDeath();
|
||||
else
|
||||
RemoveAllAurasRequiringDeadTarget();
|
||||
@@ -17893,7 +17897,7 @@ void Player::_LoadGlyphAuras()
|
||||
|
||||
void Player::LoadCorpse()
|
||||
{
|
||||
if (isAlive())
|
||||
if (IsAlive())
|
||||
sObjectAccessor->ConvertCorpseForPlayer(GetGUID());
|
||||
else
|
||||
{
|
||||
@@ -18032,7 +18036,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
|
||||
}
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
//if (isAlive())
|
||||
//if (IsAlive())
|
||||
_ApplyAllItemMods();
|
||||
}
|
||||
|
||||
@@ -18097,7 +18101,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
PreparedStatement* stmt = NULL;
|
||||
|
||||
// Do not allow to have item limited to another map/zone in alive state
|
||||
if (isAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId))
|
||||
if (IsAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId))
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', map: %u) has item (GUID: %u, entry: %u) limited to another map (%u). Deleting item.",
|
||||
GetGUIDLow(), GetName().c_str(), GetMapId(), item->GetGUIDLow(), item->GetEntry(), zoneId);
|
||||
@@ -18931,7 +18935,7 @@ void Player::ConvertInstancesToGroup(Player* player, Group* group, bool switchLe
|
||||
|
||||
bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report)
|
||||
{
|
||||
if (!isGameMaster() && ar)
|
||||
if (!IsGameMaster() && ar)
|
||||
{
|
||||
uint8 LevelMin = 0;
|
||||
uint8 LevelMax = 0;
|
||||
@@ -19006,7 +19010,7 @@ bool Player::CheckInstanceLoginValid()
|
||||
if (!GetMap())
|
||||
return false;
|
||||
|
||||
if (!GetMap()->IsDungeon() || isGameMaster())
|
||||
if (!GetMap()->IsDungeon() || IsGameMaster())
|
||||
return true;
|
||||
|
||||
if (GetMap()->IsRaid())
|
||||
@@ -20376,7 +20380,7 @@ void Player::UpdateAfkReport(time_t currTime)
|
||||
|
||||
void Player::UpdateContestedPvP(uint32 diff)
|
||||
{
|
||||
if (!m_contestedPvPTimer||isInCombat())
|
||||
if (!m_contestedPvPTimer||IsInCombat())
|
||||
return;
|
||||
if (m_contestedPvPTimer <= diff)
|
||||
{
|
||||
@@ -20631,7 +20635,7 @@ void Player::Whisper(const std::string& text, uint32 language, uint64 receiver)
|
||||
rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language);
|
||||
GetSession()->SendPacket(&data);
|
||||
|
||||
if (!isAcceptWhispers() && !isGameMaster() && !rPlayer->isGameMaster())
|
||||
if (!isAcceptWhispers() && !IsGameMaster() && !rPlayer->IsGameMaster())
|
||||
{
|
||||
SetAcceptWhispers(true);
|
||||
ChatHandler(GetSession()).SendSysMessage(LANG_COMMAND_WHISPERON);
|
||||
@@ -20789,7 +20793,7 @@ void Player::VehicleSpellInitialize()
|
||||
WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + cooldownCount * (4 + 2 + 4 + 4));
|
||||
data << uint64(vehicle->GetGUID()); // Guid
|
||||
data << uint16(0); // Pet Family (0 for all vehicles)
|
||||
data << uint32(vehicle->isSummon() ? vehicle->ToTempSummon()->GetTimer() : 0); // Duration
|
||||
data << uint32(vehicle->IsSummon() ? vehicle->ToTempSummon()->GetTimer() : 0); // Duration
|
||||
// The following three segments are read by the client as one uint32
|
||||
data << uint8(vehicle->GetReactState()); // React State
|
||||
data << uint8(0); // Command State
|
||||
@@ -21243,7 +21247,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
|
||||
return false;
|
||||
|
||||
// not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root
|
||||
if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STATE_STUNNED) || HasUnitState(UNIT_STATE_ROOT))
|
||||
if (GetSession()->isLogingOut() || IsInCombat() || HasUnitState(UNIT_STATE_STUNNED) || HasUnitState(UNIT_STATE_ROOT))
|
||||
{
|
||||
GetSession()->SendActivateTaxiReply(ERR_TAXIPLAYERBUSY);
|
||||
return false;
|
||||
@@ -21678,7 +21682,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin
|
||||
// cheating attempt
|
||||
if (count < 1) count = 1;
|
||||
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
return false;
|
||||
|
||||
CurrencyTypesEntry const* proto = sCurrencyTypesStore.LookupEntry(currency);
|
||||
@@ -21809,7 +21813,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
if (slot > MAX_BAG_SIZE && slot != NULL_SLOT)
|
||||
return false;
|
||||
|
||||
if (!isAlive())
|
||||
if (!IsAlive())
|
||||
return false;
|
||||
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
|
||||
@@ -21997,7 +22001,7 @@ uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const
|
||||
void Player::UpdateHomebindTime(uint32 time)
|
||||
{
|
||||
// GMs never get homebind timer online
|
||||
if (m_InstanceValid || isGameMaster())
|
||||
if (m_InstanceValid || IsGameMaster())
|
||||
{
|
||||
if (m_HomebindTimer) // instance valid, but timer not reset
|
||||
{
|
||||
@@ -22037,7 +22041,7 @@ void Player::UpdatePvPState(bool onlyFFA)
|
||||
{
|
||||
/// @todo should we always synchronize UNIT_FIELD_BYTES_2, 1 of controller and controlled?
|
||||
// no, we shouldn't, those are checked for affecting player by client
|
||||
if (!pvpInfo.IsInNoPvPArea && !isGameMaster()
|
||||
if (!pvpInfo.IsInNoPvPArea && !IsGameMaster()
|
||||
&& (pvpInfo.IsInFFAPvPArea || sWorld->IsFFAPvPRealm()))
|
||||
{
|
||||
if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
|
||||
@@ -22240,7 +22244,7 @@ void Player::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId /*= 0*/
|
||||
void Player::UpdatePotionCooldown(Spell* spell)
|
||||
{
|
||||
// no potion used i combat or still in combat
|
||||
if (!m_lastPotionId || isInCombat())
|
||||
if (!m_lastPotionId || IsInCombat())
|
||||
return;
|
||||
|
||||
// Call not from spell cast, send cooldown event for item spells if no in combat
|
||||
@@ -22491,7 +22495,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
|
||||
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
|
||||
|
||||
// call after remove to be sure that player resurrected for correct cast
|
||||
if (bg->isBattleground() && !isGameMaster() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
||||
if (bg->isBattleground() && !IsGameMaster() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
||||
{
|
||||
if (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)
|
||||
{
|
||||
@@ -22668,7 +22672,7 @@ inline void BeforeVisibilityDestroy(T* /*t*/, Player* /*p*/)
|
||||
template<>
|
||||
inline void BeforeVisibilityDestroy<Creature>(Creature* t, Player* p)
|
||||
{
|
||||
if (p->GetPetGUID() == t->GetGUID() && t->ToCreature()->isPet())
|
||||
if (p->GetPetGUID() == t->GetGUID() && t->ToCreature()->IsPet())
|
||||
((Pet*)t)->Remove(PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
|
||||
@@ -22676,7 +22680,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
{
|
||||
if (HaveAtClient(target))
|
||||
{
|
||||
if (!canSeeOrDetect(target, false, true))
|
||||
if (!CanSeeOrDetect(target, false, true))
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
BeforeVisibilityDestroy<Creature>(target->ToCreature(), this);
|
||||
@@ -22691,7 +22695,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (canSeeOrDetect(target, false, true))
|
||||
if (CanSeeOrDetect(target, false, true))
|
||||
{
|
||||
//if (target->isType(TYPEMASK_UNIT) && ((Unit*)target)->m_Vehicle)
|
||||
// UpdateVisibilityOf(((Unit*)target)->m_Vehicle);
|
||||
@@ -22726,7 +22730,7 @@ void Player::UpdateTriggerVisibility()
|
||||
if (IS_CREATURE_GUID(*itr))
|
||||
{
|
||||
Creature* obj = GetMap()->GetCreature(*itr);
|
||||
if (!obj || !(obj->isTrigger() || obj->HasAuraType(SPELL_AURA_TRANSFORM))) // can transform into triggers
|
||||
if (!obj || !(obj->IsTrigger() || obj->HasAuraType(SPELL_AURA_TRANSFORM))) // can transform into triggers
|
||||
continue;
|
||||
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
@@ -22740,10 +22744,10 @@ void Player::UpdateTriggerVisibility()
|
||||
void Player::SendInitialVisiblePackets(Unit* target)
|
||||
{
|
||||
SendAurasForTarget(target);
|
||||
if (target->isAlive())
|
||||
if (target->IsAlive())
|
||||
{
|
||||
if (target->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && target->getVictim())
|
||||
target->SendMeleeAttackStart(target->getVictim());
|
||||
if (target->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && target->GetVictim())
|
||||
target->SendMeleeAttackStart(target->GetVictim());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22752,7 +22756,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& vi
|
||||
{
|
||||
if (HaveAtClient(target))
|
||||
{
|
||||
if (!canSeeOrDetect(target, false, true))
|
||||
if (!CanSeeOrDetect(target, false, true))
|
||||
{
|
||||
BeforeVisibilityDestroy<T>(target, this);
|
||||
|
||||
@@ -22766,7 +22770,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& vi
|
||||
}
|
||||
else //if (visibleNow.size() < 30 || target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->IsVehicle())
|
||||
{
|
||||
if (canSeeOrDetect(target, false, true))
|
||||
if (CanSeeOrDetect(target, false, true))
|
||||
{
|
||||
//if (target->isType(TYPEMASK_UNIT) && ((Unit*)target)->m_Vehicle)
|
||||
// UpdateVisibilityOf(((Unit*)target)->m_Vehicle, data, visibleNow);
|
||||
@@ -23590,7 +23594,7 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
|
||||
|
||||
float Player::GetReputationPriceDiscount(Creature const* creature) const
|
||||
{
|
||||
FactionTemplateEntry const* vendor_faction = creature->getFactionTemplateEntry();
|
||||
FactionTemplateEntry const* vendor_faction = creature->GetFactionTemplateEntry();
|
||||
if (!vendor_faction || !vendor_faction->faction)
|
||||
return 1.0f;
|
||||
|
||||
@@ -23731,7 +23735,7 @@ void Player::SummonIfPossible(bool agree)
|
||||
return;
|
||||
|
||||
// stop taxi flight at summon
|
||||
if (isInFlight())
|
||||
if (IsInFlight())
|
||||
{
|
||||
GetMotionMaster()->MovementExpired();
|
||||
CleanupAfterTaxiFlight();
|
||||
@@ -23959,8 +23963,8 @@ bool Player::isHonorOrXPTarget(Unit const* victim)
|
||||
|
||||
if (Creature const* const creature = victim->ToCreature())
|
||||
{
|
||||
if (creature->isTotem() ||
|
||||
creature->isPet() ||
|
||||
if (creature->IsTotem() ||
|
||||
creature->IsPet() ||
|
||||
creature->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
|
||||
return false;
|
||||
}
|
||||
@@ -23976,7 +23980,7 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
@@ -24024,7 +24028,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
@@ -24032,7 +24036,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
|
||||
continue; // member (alive or dead) or his corpse at req. distance
|
||||
|
||||
// quest objectives updated only for alive group member or dead but with not released body
|
||||
if (player->isAlive()|| !player->GetCorpse())
|
||||
if (player->IsAlive()|| !player->GetCorpse())
|
||||
player->KilledMonsterCredit(creature_id, creature_guid);
|
||||
}
|
||||
}
|
||||
@@ -24045,7 +24049,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
|
||||
if (!pRewardSource)
|
||||
return false;
|
||||
const WorldObject* player = GetCorpse();
|
||||
if (!player || isAlive())
|
||||
if (!player || IsAlive())
|
||||
player = this;
|
||||
|
||||
if (player->GetMapId() != pRewardSource->GetMapId() || player->GetInstanceId() != pRewardSource->GetInstanceId())
|
||||
@@ -24059,7 +24063,7 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
|
||||
if (!pOther)
|
||||
return false;
|
||||
const WorldObject* player = GetCorpse();
|
||||
if (!player || isAlive())
|
||||
if (!player || IsAlive())
|
||||
player = this;
|
||||
|
||||
if (player->GetMapId() != pOther->GetMapId() || player->GetInstanceId() != pOther->GetInstanceId())
|
||||
@@ -24285,7 +24289,7 @@ Player* Player::GetNextRandomRaidMember(float radius)
|
||||
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->getSource();
|
||||
Player* Target = itr->GetSource();
|
||||
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
if (Target && Target != this && IsWithinDistInMap(Target, radius) &&
|
||||
@@ -24327,7 +24331,7 @@ PartyResult Player::CanUninviteFromGroup() const
|
||||
|
||||
/// @todo Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer.
|
||||
for (GroupReference const* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (itr->getSource() && itr->getSource()->isInCombat())
|
||||
if (itr->GetSource() && itr->GetSource()->IsInCombat())
|
||||
return ERR_PARTY_LFG_BOOT_IN_COMBAT;
|
||||
|
||||
/* Missing support for these types
|
||||
@@ -24448,7 +24452,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
|
||||
}
|
||||
|
||||
// Allow travel in dark water on taxi or transport
|
||||
if ((liquid_status.type_flags & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport())
|
||||
if ((liquid_status.type_flags & MAP_LIQUID_TYPE_DARK_WATER) && !IsInFlight() && !GetTransport())
|
||||
m_MirrorTimerFlags |= UNDERWARER_INDARKWATER;
|
||||
else
|
||||
m_MirrorTimerFlags &= ~UNDERWARER_INDARKWATER;
|
||||
@@ -24561,7 +24565,7 @@ bool Player::CanUseBattlegroundObject(GameObject* gameobject)
|
||||
// It is possible to call this method with a null pointer, only skipping faction check.
|
||||
if (gameobject)
|
||||
{
|
||||
FactionTemplateEntry const* playerFaction = getFactionTemplateEntry();
|
||||
FactionTemplateEntry const* playerFaction = GetFactionTemplateEntry();
|
||||
FactionTemplateEntry const* faction = sFactionTemplateStore.LookupEntry(gameobject->GetUInt32Value(GAMEOBJECT_FACTION));
|
||||
|
||||
if (playerFaction && faction && !playerFaction->IsFriendlyTo(*faction))
|
||||
@@ -24572,14 +24576,14 @@ bool Player::CanUseBattlegroundObject(GameObject* gameobject)
|
||||
// Note: Mount, stealth and invisibility will be removed when used
|
||||
return (!isTotalImmune() && // Damage immune
|
||||
!HasAura(SPELL_RECENTLY_DROPPED_FLAG) && // Still has recently held flag debuff
|
||||
isAlive()); // Alive
|
||||
IsAlive()); // Alive
|
||||
}
|
||||
|
||||
bool Player::CanCaptureTowerPoint()
|
||||
{
|
||||
return (!HasStealthAura() && // not stealthed
|
||||
!HasInvisibilityAura() && // not invisible
|
||||
isAlive()); // live player
|
||||
IsAlive()); // live player
|
||||
}
|
||||
|
||||
uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin)
|
||||
@@ -24736,10 +24740,10 @@ void Player::UpdateCharmedAI()
|
||||
}
|
||||
}
|
||||
|
||||
if (!charmer->isInCombat())
|
||||
if (!charmer->IsInCombat())
|
||||
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||
|
||||
Unit* target = getVictim();
|
||||
Unit* target = GetVictim();
|
||||
if (!target || !charmer->IsValidAttackTarget(target))
|
||||
{
|
||||
target = charmer->SelectNearestTarget();
|
||||
@@ -25249,7 +25253,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
|
||||
//Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
|
||||
// 14.57 can be calculated by resolving damageperc formula below to 0
|
||||
if (z_diff >= 14.57f && !isDead() && !isGameMaster() &&
|
||||
if (z_diff >= 14.57f && !isDead() && !IsGameMaster() &&
|
||||
!HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) &&
|
||||
!HasAuraType(SPELL_AURA_FLY) && !IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL))
|
||||
{
|
||||
@@ -25279,7 +25283,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
uint32 final_damage = EnvironmentalDamage(DAMAGE_FALL, damage);
|
||||
|
||||
// recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case
|
||||
if (isAlive() && final_damage < original_health)
|
||||
if (IsAlive() && final_damage < original_health)
|
||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
|
||||
}
|
||||
|
||||
@@ -25664,10 +25668,10 @@ void Player::ResummonPetTemporaryUnSummonedIfAny()
|
||||
|
||||
bool Player::IsPetNeedBeTemporaryUnsummoned() const
|
||||
{
|
||||
return !IsInWorld() || !isAlive() || IsMounted() /*+in flight*/;
|
||||
return !IsInWorld() || !IsAlive() || IsMounted() /*+in flight*/;
|
||||
}
|
||||
|
||||
bool Player::canSeeSpellClickOn(Creature const* c) const
|
||||
bool Player::CanSeeSpellClickOn(Creature const* c) const
|
||||
{
|
||||
if (!c->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
|
||||
return false;
|
||||
|
||||
@@ -1277,7 +1277,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
// mount_id can be used in scripting calls
|
||||
bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||
void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||
bool isGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; }
|
||||
bool IsGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; }
|
||||
void SetGameMaster(bool on);
|
||||
bool isGMChat() const { return m_ExtraFlags & PLAYER_EXTRA_GM_CHAT; }
|
||||
void SetGMChat(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; }
|
||||
@@ -2150,7 +2150,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetCanBlock(bool value);
|
||||
bool CanTitanGrip() const { return m_canTitanGrip; }
|
||||
void SetCanTitanGrip(bool value) { m_canTitanGrip = value; }
|
||||
bool CanTameExoticPets() const { return isGameMaster() || HasAuraType(SPELL_AURA_ALLOW_TAME_PET_TYPE); }
|
||||
bool CanTameExoticPets() const { return IsGameMaster() || HasAuraType(SPELL_AURA_ALLOW_TAME_PET_TYPE); }
|
||||
|
||||
void SetRegularAttackTime();
|
||||
void SetBaseModValue(BaseModGroup modGroup, BaseModType modType, float value) { m_auraBaseMod[modGroup][modType] = value; }
|
||||
@@ -2483,7 +2483,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SetTitle(CharTitlesEntry const* title, bool lost = false);
|
||||
|
||||
//bool isActiveObject() const { return true; }
|
||||
bool canSeeSpellClickOn(Creature const* creature) const;
|
||||
bool CanSeeSpellClickOn(Creature const* creature) const;
|
||||
|
||||
uint32 GetChampioningFaction() const { return m_ChampioningFaction; }
|
||||
void SetChampioningFaction(uint32 faction) { m_ChampioningFaction = faction; }
|
||||
|
||||
@@ -35,7 +35,7 @@ Totem::Totem(SummonPropertiesEntry const* properties, Unit* owner) : Minion(prop
|
||||
|
||||
void Totem::Update(uint32 time)
|
||||
{
|
||||
if (!GetOwner()->isAlive() || !isAlive())
|
||||
if (!GetOwner()->IsAlive() || !IsAlive())
|
||||
{
|
||||
UnSummon(); // remove self
|
||||
return;
|
||||
@@ -136,7 +136,7 @@ void Totem::UnSummon(uint32 msTime)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* target = itr->getSource();
|
||||
Player* target = itr->GetSource();
|
||||
if (target && group->SameSubGroup(owner, target))
|
||||
target->RemoveAurasDueToSpell(GetSpell(), GetGUID());
|
||||
}
|
||||
|
||||
@@ -574,13 +574,13 @@ void Transport::UpdateForMap(Map const* targetMap)
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = player.begin(); itr != player.end(); ++itr)
|
||||
{
|
||||
if (this != itr->getSource()->GetTransport())
|
||||
if (this != itr->GetSource()->GetTransport())
|
||||
{
|
||||
UpdateData transData(GetMapId());
|
||||
BuildCreateUpdateBlockForPlayer(&transData, itr->getSource());
|
||||
BuildCreateUpdateBlockForPlayer(&transData, itr->GetSource());
|
||||
WorldPacket packet;
|
||||
transData.BuildPacket(&packet);
|
||||
itr->getSource()->SendDirectMessage(&packet);
|
||||
itr->GetSource()->SendDirectMessage(&packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -592,8 +592,8 @@ void Transport::UpdateForMap(Map const* targetMap)
|
||||
transData.BuildPacket(&out_packet);
|
||||
|
||||
for (Map::PlayerList::const_iterator itr = player.begin(); itr != player.end(); ++itr)
|
||||
if (this != itr->getSource()->GetTransport())
|
||||
itr->getSource()->SendDirectMessage(&out_packet);
|
||||
if (this != itr->GetSource()->GetTransport())
|
||||
itr->GetSource()->SendDirectMessage(&out_packet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
if (ranged)
|
||||
{
|
||||
UpdateDamagePhysical(RANGED_ATTACK);
|
||||
if (pet && pet->isHunterPet()) // At ranged attack change for hunter pet
|
||||
if (pet && pet->IsHunterPet()) // At ranged attack change for hunter pet
|
||||
pet->UpdateAttackPowerAndDamage();
|
||||
}
|
||||
else
|
||||
@@ -1049,7 +1049,7 @@ void Guardian::UpdateResistances(uint32 school)
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
|
||||
// hunter and warlock pets gain 40% of owner's resistance
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
value += float(CalculatePct(m_owner->GetResistance(SpellSchools(school)), 40));
|
||||
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
@@ -1065,9 +1065,9 @@ void Guardian::UpdateArmor()
|
||||
UnitMods unitMod = UNIT_MOD_ARMOR;
|
||||
|
||||
// hunter pets gain 35% of owner's armor value, warlock pets gain 100% of owner's armor
|
||||
if (isHunterPet())
|
||||
if (IsHunterPet())
|
||||
bonus_armor = float(CalculatePct(m_owner->GetArmor(), 70));
|
||||
else if (isPet())
|
||||
else if (IsPet())
|
||||
bonus_armor = m_owner->GetArmor();
|
||||
|
||||
value = GetModifierValue(unitMod, BASE_VALUE);
|
||||
@@ -1145,7 +1145,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
Unit* owner = GetOwner();
|
||||
if (owner && owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (isHunterPet()) //hunter pets benefit from owner's attack power
|
||||
if (IsHunterPet()) //hunter pets benefit from owner's attack power
|
||||
{
|
||||
float mod = 1.0f; //Hunter contribution modifier
|
||||
bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod;
|
||||
@@ -1165,7 +1165,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
SetBonusDamage(int32(owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier));
|
||||
}
|
||||
//demons benefit from warlocks shadow or fire damage
|
||||
else if (isPet())
|
||||
else if (IsPet())
|
||||
{
|
||||
int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1325,7 +1325,7 @@ class Unit : public WorldObject
|
||||
void RemoveAllAttackers();
|
||||
AttackerSet const& getAttackers() const { return m_attackers; }
|
||||
bool isAttackingPlayer() const;
|
||||
Unit* getVictim() const { return m_attacking; }
|
||||
Unit* GetVictim() const { return m_attacking; }
|
||||
|
||||
void CombatStop(bool includingCast = false);
|
||||
void CombatStopWithPets(bool includingCast = false);
|
||||
@@ -1341,11 +1341,11 @@ class Unit : public WorldObject
|
||||
|
||||
uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
|
||||
void AddUnitTypeMask(uint32 mask) { m_unitTypeMask |= mask; }
|
||||
bool isSummon() const { return m_unitTypeMask & UNIT_MASK_SUMMON; }
|
||||
bool isGuardian() const { return m_unitTypeMask & UNIT_MASK_GUARDIAN; }
|
||||
bool isPet() const { return m_unitTypeMask & UNIT_MASK_PET; }
|
||||
bool isHunterPet() const{ return m_unitTypeMask & UNIT_MASK_HUNTER_PET; }
|
||||
bool isTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
|
||||
bool IsSummon() const { return m_unitTypeMask & UNIT_MASK_SUMMON; }
|
||||
bool IsGuardian() const { return m_unitTypeMask & UNIT_MASK_GUARDIAN; }
|
||||
bool IsPet() const { return m_unitTypeMask & UNIT_MASK_PET; }
|
||||
bool IsHunterPet() const{ return m_unitTypeMask & UNIT_MASK_HUNTER_PET; }
|
||||
bool IsTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
|
||||
bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
|
||||
|
||||
uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
|
||||
@@ -1406,7 +1406,7 @@ class Unit : public WorldObject
|
||||
// faction template id
|
||||
uint32 getFaction() const { return GetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE); }
|
||||
void setFaction(uint32 faction) { SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction); }
|
||||
FactionTemplateEntry const* getFactionTemplateEntry() const;
|
||||
FactionTemplateEntry const* GetFactionTemplateEntry() const;
|
||||
|
||||
ReputationRank GetReactionTo(Unit const* target) const;
|
||||
ReputationRank static GetFactionReactionTo(FactionTemplateEntry const* factionTemplateEntry, Unit const* target);
|
||||
@@ -1497,26 +1497,26 @@ class Unit : public WorldObject
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType) const;
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
|
||||
|
||||
bool isVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); }
|
||||
bool isTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); }
|
||||
bool isQuestGiver() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); }
|
||||
bool isGossip() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }
|
||||
bool isTaxi() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_FLIGHTMASTER); }
|
||||
bool isGuildMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PETITIONER); }
|
||||
bool isBattleMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BATTLEMASTER); }
|
||||
bool isBanker() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); }
|
||||
bool isInnkeeper() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_INNKEEPER); }
|
||||
bool isSpiritHealer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER); }
|
||||
bool isSpiritGuide() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
bool isTabardDesigner()const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TABARDDESIGNER); }
|
||||
bool isAuctioner() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_AUCTIONEER); }
|
||||
bool isArmorer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_REPAIR); }
|
||||
bool isServiceProvider() const;
|
||||
bool isSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
bool IsVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); }
|
||||
bool IsTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); }
|
||||
bool IsQuestGiver() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); }
|
||||
bool IsGossip() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }
|
||||
bool IsTaxi() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_FLIGHTMASTER); }
|
||||
bool IsGuildMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PETITIONER); }
|
||||
bool IsBattleMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BATTLEMASTER); }
|
||||
bool IsBanker() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); }
|
||||
bool IsInnkeeper() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_INNKEEPER); }
|
||||
bool IsSpiritHealer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER); }
|
||||
bool IsSpiritGuide() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
bool IsTabardDesigner()const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TABARDDESIGNER); }
|
||||
bool IsAuctioner() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_AUCTIONEER); }
|
||||
bool IsArmorer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_REPAIR); }
|
||||
bool IsServiceProvider() const;
|
||||
bool IsSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
|
||||
bool isInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); }
|
||||
bool IsInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); }
|
||||
|
||||
bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
|
||||
bool IsInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); }
|
||||
void CombatStart(Unit* target, bool initialAggro = true);
|
||||
void SetInCombatState(bool PvP, Unit* enemy = NULL);
|
||||
void SetInCombatWith(Unit* enemy);
|
||||
@@ -1630,7 +1630,7 @@ class Unit : public WorldObject
|
||||
|
||||
void SendClearTarget();
|
||||
|
||||
bool isAlive() const { return (m_deathState == ALIVE); }
|
||||
bool IsAlive() const { return (m_deathState == ALIVE); }
|
||||
bool isDying() const { return (m_deathState == JUST_DIED); }
|
||||
bool isDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); }
|
||||
DeathState getDeathState() const { return m_deathState; }
|
||||
@@ -1653,7 +1653,7 @@ class Unit : public WorldObject
|
||||
bool IsControlledByPlayer() const { return m_ControlledByPlayer; }
|
||||
uint64 GetCharmerOrOwnerGUID() const;
|
||||
uint64 GetCharmerOrOwnerOrOwnGUID() const;
|
||||
bool isCharmedOwnedByPlayerOrPlayer() const { return IS_PLAYER_GUID(GetCharmerOrOwnerOrOwnGUID()); }
|
||||
bool IsCharmedOwnedByPlayerOrPlayer() const { return IS_PLAYER_GUID(GetCharmerOrOwnerOrOwnGUID()); }
|
||||
|
||||
Player* GetSpellModOwner() const;
|
||||
|
||||
@@ -1680,7 +1680,7 @@ class Unit : public WorldObject
|
||||
Unit* GetFirstControlled() const;
|
||||
void RemoveAllControlled();
|
||||
|
||||
bool isCharmed() const { return GetCharmerGUID() != 0; }
|
||||
bool IsCharmed() const { return GetCharmerGUID() != 0; }
|
||||
bool isPossessed() const { return HasUnitState(UNIT_STATE_POSSESSED); }
|
||||
bool isPossessedByPlayer() const;
|
||||
bool isPossessing() const;
|
||||
@@ -2132,14 +2132,14 @@ class Unit : public WorldObject
|
||||
virtual bool isBeingLoaded() const { return false;}
|
||||
bool IsDuringRemoveFromWorld() const {return m_duringRemoveFromWorld;}
|
||||
|
||||
Pet* ToPet() { if (isPet()) return reinterpret_cast<Pet*>(this); else return NULL; }
|
||||
Pet const* ToPet() const { if (isPet()) return reinterpret_cast<Pet const*>(this); else return NULL; }
|
||||
Pet* ToPet() { if (IsPet()) return reinterpret_cast<Pet*>(this); else return NULL; }
|
||||
Pet const* ToPet() const { if (IsPet()) return reinterpret_cast<Pet const*>(this); else return NULL; }
|
||||
|
||||
Totem* ToTotem() { if (isTotem()) return reinterpret_cast<Totem*>(this); else return NULL; }
|
||||
Totem const* ToTotem() const { if (isTotem()) return reinterpret_cast<Totem const*>(this); else return NULL; }
|
||||
Totem* ToTotem() { if (IsTotem()) return reinterpret_cast<Totem*>(this); else return NULL; }
|
||||
Totem const* ToTotem() const { if (IsTotem()) return reinterpret_cast<Totem const*>(this); else return NULL; }
|
||||
|
||||
TempSummon* ToTempSummon() { if (isSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL; }
|
||||
TempSummon const* ToTempSummon() const { if (isSummon()) return reinterpret_cast<TempSummon const*>(this); else return NULL; }
|
||||
TempSummon* ToTempSummon() { if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL; }
|
||||
TempSummon const* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<TempSummon const*>(this); else return NULL; }
|
||||
|
||||
void SetTarget(uint64 guid);
|
||||
|
||||
|
||||
@@ -1330,25 +1330,21 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
itr->second.equipement_id_prev = creature->GetCurrentEquipmentId();
|
||||
itr->second.modelid_prev = creature->GetDisplayId();
|
||||
creature->LoadEquipment(itr->second.equipment_id, true);
|
||||
if (itr->second.modelid > 0 && itr->second.modelid_prev != itr->second.modelid)
|
||||
if (itr->second.modelid > 0 && itr->second.modelid_prev != itr->second.modelid &&
|
||||
sObjectMgr->GetCreatureModelInfo(itr->second.modelid))
|
||||
{
|
||||
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid))
|
||||
{
|
||||
creature->SetDisplayId(itr->second.modelid);
|
||||
creature->SetNativeDisplayId(itr->second.modelid);
|
||||
}
|
||||
creature->SetDisplayId(itr->second.modelid);
|
||||
creature->SetNativeDisplayId(itr->second.modelid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
creature->LoadEquipment(itr->second.equipement_id_prev, true);
|
||||
if (itr->second.modelid_prev > 0 && itr->second.modelid_prev != itr->second.modelid)
|
||||
if (itr->second.modelid_prev > 0 && itr->second.modelid_prev != itr->second.modelid &&
|
||||
sObjectMgr->GetCreatureModelInfo(itr->second.modelid_prev))
|
||||
{
|
||||
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid_prev))
|
||||
{
|
||||
creature->SetDisplayId(itr->second.modelid_prev);
|
||||
creature->SetNativeDisplayId(itr->second.modelid_prev);
|
||||
}
|
||||
creature->SetDisplayId(itr->second.modelid_prev);
|
||||
creature->SetNativeDisplayId(itr->second.modelid_prev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke
|
||||
|
||||
Unit const* summoner = NULL;
|
||||
// Check summoners for party
|
||||
if (clickee->isSummon())
|
||||
if (clickee->IsSummon())
|
||||
summoner = clickee->ToTempSummon()->GetSummoner();
|
||||
if (!summoner)
|
||||
summoner = clickee;
|
||||
|
||||
@@ -76,17 +76,17 @@ void VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if (iter->getSource() == &i_object)
|
||||
if (iter->GetSource() == &i_object)
|
||||
continue;
|
||||
|
||||
iter->getSource()->UpdateVisibilityOf(&i_object);
|
||||
iter->GetSource()->UpdateVisibilityOf(&i_object);
|
||||
|
||||
if (iter->getSource()->HasSharedVision())
|
||||
if (iter->GetSource()->HasSharedVision())
|
||||
{
|
||||
for (SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
|
||||
i != iter->getSource()->GetSharedVisionList().end(); ++i)
|
||||
for (SharedVisionList::const_iterator i = iter->GetSource()->GetSharedVisionList().begin();
|
||||
i != iter->GetSource()->GetSharedVisionList().end(); ++i)
|
||||
{
|
||||
if ((*i)->m_seer == iter->getSource())
|
||||
if ((*i)->m_seer == iter->GetSource())
|
||||
(*i)->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
}
|
||||
@@ -96,29 +96,29 @@ void VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
void VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->getSource()->HasSharedVision())
|
||||
for (SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
|
||||
i != iter->getSource()->GetSharedVisionList().end(); ++i)
|
||||
if ((*i)->m_seer == iter->getSource())
|
||||
if (iter->GetSource()->HasSharedVision())
|
||||
for (SharedVisionList::const_iterator i = iter->GetSource()->GetSharedVisionList().begin();
|
||||
i != iter->GetSource()->GetSharedVisionList().end(); ++i)
|
||||
if ((*i)->m_seer == iter->GetSource())
|
||||
(*i)->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
|
||||
void VisibleChangesNotifier::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
|
||||
if (Player* caster = (Player*)iter->getSource()->GetCaster())
|
||||
if (caster->m_seer == iter->getSource())
|
||||
if (IS_PLAYER_GUID(iter->GetSource()->GetCasterGUID()))
|
||||
if (Player* caster = (Player*)iter->GetSource()->GetCaster())
|
||||
if (caster->m_seer == iter->GetSource())
|
||||
caster->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
|
||||
inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
|
||||
{
|
||||
if (!u->isAlive() || !c->isAlive() || c == u || u->isInFlight())
|
||||
if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
|
||||
return;
|
||||
|
||||
if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS))
|
||||
if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true))
|
||||
if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
|
||||
c->AI()->MoveInLineOfSight_Safe(u);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* player = iter->getSource();
|
||||
Player* player = iter->GetSource();
|
||||
|
||||
vis_guids.erase(player->GetGUID());
|
||||
|
||||
@@ -145,7 +145,7 @@ void PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
||||
|
||||
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* c = iter->getSource();
|
||||
Creature* c = iter->GetSource();
|
||||
|
||||
vis_guids.erase(c->GetGUID());
|
||||
|
||||
@@ -160,7 +160,7 @@ void CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* player = iter->getSource();
|
||||
Player* player = iter->GetSource();
|
||||
|
||||
if (!player->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
|
||||
player->UpdateVisibilityOf(&i_creature);
|
||||
@@ -171,12 +171,12 @@ void CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
|
||||
void CreatureRelocationNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
if (!i_creature.isAlive())
|
||||
if (!i_creature.IsAlive())
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* c = iter->getSource();
|
||||
Creature* c = iter->GetSource();
|
||||
CreatureUnitRelocationWorker(&i_creature, c);
|
||||
|
||||
if (!c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
|
||||
@@ -188,7 +188,7 @@ void DelayedUnitRelocation::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* unit = iter->getSource();
|
||||
Creature* unit = iter->GetSource();
|
||||
if (!unit->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
|
||||
continue;
|
||||
|
||||
@@ -206,7 +206,7 @@ void DelayedUnitRelocation::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* player = iter->getSource();
|
||||
Player* player = iter->GetSource();
|
||||
WorldObject const* viewPoint = player->m_seer;
|
||||
|
||||
if (!viewPoint->isNeedNotify(NOTIFY_VISIBILITY_CHANGED))
|
||||
@@ -234,7 +234,7 @@ void AIRelocationNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* c = iter->getSource();
|
||||
Creature* c = iter->GetSource();
|
||||
CreatureUnitRelocationWorker(c, &i_unit);
|
||||
if (isCreature)
|
||||
CreatureUnitRelocationWorker((Creature*)&i_unit, c);
|
||||
@@ -245,7 +245,7 @@ void MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* target = iter->getSource();
|
||||
Player* target = iter->GetSource();
|
||||
if (!target->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
@@ -270,7 +270,7 @@ void MessageDistDeliverer::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* target = iter->getSource();
|
||||
Creature* target = iter->GetSource();
|
||||
if (!target->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
@@ -292,7 +292,7 @@ void MessageDistDeliverer::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
DynamicObject* target = iter->getSource();
|
||||
DynamicObject* target = iter->GetSource();
|
||||
if (!target->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
@@ -325,14 +325,14 @@ void ObjectUpdater::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if (iter->getSource()->IsInWorld())
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
if (iter->GetSource()->IsInWorld())
|
||||
iter->GetSource()->Update(i_timeDiff);
|
||||
}
|
||||
}
|
||||
|
||||
bool AnyDeadUnitObjectInRangeCheck::operator()(Player* u)
|
||||
{
|
||||
return !u->isAlive() && !u->HasAuraType(SPELL_AURA_GHOST) && i_searchObj->IsWithinDistInMap(u, i_range);
|
||||
return !u->IsAlive() && !u->HasAuraType(SPELL_AURA_GHOST) && i_searchObj->IsWithinDistInMap(u, i_range);
|
||||
}
|
||||
|
||||
bool AnyDeadUnitObjectInRangeCheck::operator()(Corpse* u)
|
||||
@@ -342,7 +342,7 @@ bool AnyDeadUnitObjectInRangeCheck::operator()(Corpse* u)
|
||||
|
||||
bool AnyDeadUnitObjectInRangeCheck::operator()(Creature* u)
|
||||
{
|
||||
return !u->isAlive() && i_searchObj->IsWithinDistInMap(u, i_range);
|
||||
return !u->IsAlive() && i_searchObj->IsWithinDistInMap(u, i_range);
|
||||
}
|
||||
|
||||
bool AnyDeadUnitSpellTargetInRangeCheck::operator()(Player* u)
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace Trinity
|
||||
template<class T> void updateObjects(GridRefManager<T> &m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
iter->GetSource()->Update(i_timeDiff);
|
||||
}
|
||||
|
||||
void Visit(PlayerMapType &m) { updateObjects<Player>(m); }
|
||||
@@ -247,8 +247,8 @@ namespace Trinity
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
|
||||
return;
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
void Visit(PlayerMapType &m)
|
||||
@@ -256,16 +256,16 @@ namespace Trinity
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
|
||||
return;
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
void Visit(CreatureMapType &m)
|
||||
{
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CREATURE))
|
||||
return;
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
void Visit(CorpseMapType &m)
|
||||
@@ -273,8 +273,8 @@ namespace Trinity
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CORPSE))
|
||||
return;
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
void Visit(DynamicObjectMapType &m)
|
||||
@@ -282,8 +282,8 @@ namespace Trinity
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_DYNAMICOBJECT))
|
||||
return;
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
void Visit(AreaTriggerMapType &m)
|
||||
@@ -291,8 +291,8 @@ namespace Trinity
|
||||
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_AREATRIGGER))
|
||||
return;
|
||||
for (AreaTriggerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||
@@ -355,8 +355,8 @@ namespace Trinity
|
||||
void Visit(GameObjectMapType& m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(_phaseMask))
|
||||
_func(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(_phaseMask))
|
||||
_func(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||
@@ -479,8 +479,8 @@ namespace Trinity
|
||||
void Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||
@@ -546,8 +546,8 @@ namespace Trinity
|
||||
void Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||
@@ -566,8 +566,8 @@ namespace Trinity
|
||||
void Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_searcher) && itr->getSource()->IsWithinDist(i_searcher, i_dist))
|
||||
i_do(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_searcher) && itr->GetSource()->IsWithinDist(i_searcher, i_dist))
|
||||
i_do(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||
@@ -754,7 +754,7 @@ namespace Trinity
|
||||
MostHPMissingInRange(Unit const* obj, float range, uint32 hp) : i_obj(obj), i_range(range), i_hp(hp) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
|
||||
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
|
||||
{
|
||||
i_hp = u->GetMaxHealth() - u->GetHealth();
|
||||
return true;
|
||||
@@ -773,8 +773,8 @@ namespace Trinity
|
||||
FriendlyCCedInRange(Unit const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
(u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
|
||||
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
(u->isFeared() || u->IsCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -791,7 +791,7 @@ namespace Trinity
|
||||
FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
!(u->HasAura(i_spell)))
|
||||
{
|
||||
return true;
|
||||
@@ -810,7 +810,7 @@ namespace Trinity
|
||||
AnyUnfriendlyUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u))
|
||||
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -827,13 +827,13 @@ namespace Trinity
|
||||
AnyUnfriendlyNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (!u->isAlive())
|
||||
if (!u->IsAlive())
|
||||
return false;
|
||||
|
||||
if (u->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
|
||||
return false;
|
||||
|
||||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem())
|
||||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
|
||||
return false;
|
||||
|
||||
if (!u->isTargetableForAttack(false))
|
||||
@@ -855,12 +855,12 @@ namespace Trinity
|
||||
|
||||
bool operator()(const Unit* u)
|
||||
{
|
||||
return u->isAlive()
|
||||
return u->IsAlive()
|
||||
&& i_funit->IsWithinDistInMap(u, i_range)
|
||||
&& !i_funit->IsFriendlyTo(u)
|
||||
&& i_funit->IsValidAttackTarget(u)
|
||||
&& u->GetCreatureType() != CREATURE_TYPE_CRITTER
|
||||
&& i_funit->canSeeOrDetect(u);
|
||||
&& i_funit->CanSeeOrDetect(u);
|
||||
}
|
||||
private:
|
||||
Unit const* i_funit;
|
||||
@@ -886,7 +886,7 @@ namespace Trinity
|
||||
AnyFriendlyUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_funit->IsFriendlyTo(u))
|
||||
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_funit->IsFriendlyTo(u))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -911,7 +911,7 @@ namespace Trinity
|
||||
else if (!_refUnit->IsInPartyWith(u))
|
||||
return false;
|
||||
|
||||
return !_refUnit->IsHostileTo(u) && u->isAlive() && _source->IsWithinDistInMap(u, _range);
|
||||
return !_refUnit->IsHostileTo(u) && u->IsAlive() && _source->IsWithinDistInMap(u, _range);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -927,7 +927,7 @@ namespace Trinity
|
||||
AnyUnitInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isAlive() && i_obj->IsWithinDistInMap(u, i_range))
|
||||
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -945,7 +945,7 @@ namespace Trinity
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->isTargetableForAttack() && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
!i_funit->IsFriendlyTo(u) && i_funit->canSeeOrDetect(u))
|
||||
!i_funit->IsFriendlyTo(u) && i_funit->CanSeeOrDetect(u))
|
||||
{
|
||||
i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
|
||||
return true;
|
||||
@@ -979,7 +979,7 @@ namespace Trinity
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
// Check contains checks for: live, non-selectable, non-attackable flags, flight check and GM check, ignore totems
|
||||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem())
|
||||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
|
||||
return false;
|
||||
|
||||
if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range))
|
||||
@@ -1029,7 +1029,7 @@ namespace Trinity
|
||||
|
||||
struct AnyDeadUnitCheck
|
||||
{
|
||||
bool operator()(Unit* u) { return !u->isAlive(); }
|
||||
bool operator()(Unit* u) { return !u->IsAlive(); }
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1079,7 +1079,7 @@ namespace Trinity
|
||||
if (!me->IsWithinDistInMap(u, m_range))
|
||||
return false;
|
||||
|
||||
if (!me->canSeeOrDetect(u))
|
||||
if (!me->CanSeeOrDetect(u))
|
||||
return false;
|
||||
|
||||
if (m_force)
|
||||
@@ -1087,7 +1087,7 @@ namespace Trinity
|
||||
if (!me->IsValidAttackTarget(u))
|
||||
return false;
|
||||
}
|
||||
else if (!me->canStartAttack(u, false))
|
||||
else if (!me->CanStartAttack(u, false))
|
||||
return false;
|
||||
|
||||
m_range = me->GetDistance(u); // use found unit range as new range limit for next check
|
||||
@@ -1202,7 +1202,7 @@ namespace Trinity
|
||||
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if (u->GetEntry() == i_entry && u->isAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range))
|
||||
if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range))
|
||||
{
|
||||
i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
|
||||
return true;
|
||||
@@ -1226,7 +1226,7 @@ namespace Trinity
|
||||
AnyPlayerInObjectRangeCheck(WorldObject const* obj, float range, bool reqAlive = true) : _obj(obj), _range(range), _reqAlive(reqAlive) {}
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if (_reqAlive && !u->isAlive())
|
||||
if (_reqAlive && !u->IsAlive())
|
||||
return false;
|
||||
|
||||
if (!_obj->IsWithinDistInMap(u, _range))
|
||||
@@ -1250,7 +1250,7 @@ namespace Trinity
|
||||
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if (u->isAlive() && i_obj->IsWithinDistInMap(u, i_range))
|
||||
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range))
|
||||
{
|
||||
i_range = i_obj->GetDistance(u);
|
||||
return true;
|
||||
@@ -1271,7 +1271,7 @@ namespace Trinity
|
||||
AllFriendlyCreaturesInGrid(Unit const* obj) : unit(obj) {}
|
||||
bool operator() (Unit* u)
|
||||
{
|
||||
if (u->isAlive() && u->IsVisible() && u->IsFriendlyTo(unit))
|
||||
if (u->IsAlive() && u->IsVisible() && u->IsFriendlyTo(unit))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1322,7 +1322,7 @@ namespace Trinity
|
||||
bool operator() (Player* player)
|
||||
{
|
||||
//No threat list check, must be done explicit if expected to be in combat with creature
|
||||
if (!player->isGameMaster() && player->isAlive() && !unit->IsWithinDist(player, fRange, false))
|
||||
if (!player->IsGameMaster() && player->IsAlive() && !unit->IsWithinDist(player, fRange, false))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -33,16 +33,16 @@ inline void Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
vis_guids.erase(iter->getSource()->GetGUID());
|
||||
i_player.UpdateVisibilityOf(iter->getSource(), i_data, i_visibleNow);
|
||||
vis_guids.erase(iter->GetSource()->GetGUID());
|
||||
i_player.UpdateVisibilityOf(iter->GetSource(), i_data, i_visibleNow);
|
||||
}
|
||||
}
|
||||
|
||||
inline void Trinity::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->getSource()->IsInWorld())
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
if (iter->GetSource()->IsInWorld())
|
||||
iter->GetSource()->Update(i_timeDiff);
|
||||
}
|
||||
|
||||
// SEARCHERS & LIST SEARCHERS & WORKERS
|
||||
@@ -61,12 +61,12 @@ void Trinity::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -84,12 +84,12 @@ void Trinity::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -107,12 +107,12 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -130,12 +130,12 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
|
||||
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -153,12 +153,12 @@ void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -176,12 +176,12 @@ void Trinity::WorldObjectSearcher<Check>::Visit(AreaTriggerMapType &m)
|
||||
|
||||
for (AreaTriggerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -195,11 +195,11 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,11 +211,11 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,11 +227,11 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,11 +243,11 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(CorpseMapType &m)
|
||||
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,11 +259,11 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,11 +275,11 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(AreaTriggerMapType &m)
|
||||
|
||||
for (AreaTriggerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,8 +290,8 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
return;
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
@@ -301,8 +301,8 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
@@ -312,8 +312,8 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
|
||||
return;
|
||||
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
@@ -323,8 +323,8 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
return;
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
@@ -334,8 +334,8 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
return;
|
||||
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
@@ -345,8 +345,8 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(AreaTriggerMapType &m)
|
||||
return;
|
||||
|
||||
for (AreaTriggerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
// Gameobject searchers
|
||||
@@ -360,12 +360,12 @@ void Trinity::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -376,11 +376,11 @@ void Trinity::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,9 +388,9 @@ template<class Check>
|
||||
void Trinity::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
{
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
// Unit searchers
|
||||
@@ -404,12 +404,12 @@ void Trinity::UnitSearcher<Check>::Visit(CreatureMapType &m)
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -424,12 +424,12 @@ void Trinity::UnitSearcher<Check>::Visit(PlayerMapType &m)
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -440,11 +440,11 @@ void Trinity::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,11 +453,11 @@ void Trinity::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,18 +465,18 @@ template<class Check>
|
||||
void Trinity::UnitListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void Trinity::UnitListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
// Creature searchers
|
||||
@@ -490,12 +490,12 @@ void Trinity::CreatureSearcher<Check>::Visit(CreatureMapType &m)
|
||||
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -506,11 +506,11 @@ void Trinity::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,18 +518,18 @@ template<class Check>
|
||||
void Trinity::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
void Trinity::PlayerListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
if (itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
if (i_check(itr->GetSource()))
|
||||
i_objects.push_back(itr->GetSource());
|
||||
}
|
||||
|
||||
template<class Check>
|
||||
@@ -541,12 +541,12 @@ void Trinity::PlayerSearcher<Check>::Visit(PlayerMapType &m)
|
||||
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
if (i_check(itr->GetSource()))
|
||||
{
|
||||
i_object = itr->getSource();
|
||||
i_object = itr->GetSource();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -557,11 +557,11 @@ void Trinity::PlayerLastSearcher<Check>::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if (!itr->GetSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
|
||||
if (i_check(itr->getSource()))
|
||||
i_object = itr->getSource();
|
||||
if (i_check(itr->GetSource()))
|
||||
i_object = itr->GetSource();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ void ObjectGridEvacuator::Visit(CreatureMapType &m)
|
||||
// move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end();)
|
||||
{
|
||||
Creature* c = iter->getSource();
|
||||
Creature* c = iter->GetSource();
|
||||
++iter;
|
||||
|
||||
ASSERT(!c->isPet() && "ObjectGridRespawnMover must not be called for pets");
|
||||
ASSERT(!c->IsPet() && "ObjectGridRespawnMover must not be called for pets");
|
||||
c->GetMap()->CreatureRespawnRelocation(c, true);
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void ObjectGridUnloader::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
while (!m.isEmpty())
|
||||
{
|
||||
T *obj = m.getFirst()->getSource();
|
||||
T *obj = m.getFirst()->GetSource();
|
||||
// if option set then object already saved at this moment
|
||||
if (!sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||
obj->SaveRespawnTime();
|
||||
@@ -213,13 +213,13 @@ void ObjectGridStoper::Visit(CreatureMapType &m)
|
||||
// stop any fights at grid de-activation and remove dynobjects created at cast by creatures
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
iter->getSource()->RemoveAllDynObjects();
|
||||
if (iter->getSource()->isInCombat())
|
||||
iter->GetSource()->RemoveAllDynObjects();
|
||||
if (iter->GetSource()->IsInCombat())
|
||||
{
|
||||
iter->getSource()->CombatStop();
|
||||
iter->getSource()->DeleteThreatList();
|
||||
if (iter->getSource()->IsAIEnabled)
|
||||
iter->getSource()->AI()->EnterEvadeMode();
|
||||
iter->GetSource()->CombatStop();
|
||||
iter->GetSource()->DeleteThreatList();
|
||||
if (iter->GetSource()->IsAIEnabled)
|
||||
iter->GetSource()->AI()->EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,7 @@ template<class T>
|
||||
void ObjectGridCleaner::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->CleanupsBeforeDelete();
|
||||
iter->GetSource()->CleanupsBeforeDelete();
|
||||
}
|
||||
|
||||
template void ObjectGridUnloader::Visit(CreatureMapType &);
|
||||
|
||||
@@ -474,10 +474,10 @@ bool Group::AddMember(Player* player)
|
||||
// Broadcast group members' fields to player
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
if (itr->getSource() == player)
|
||||
if (itr->GetSource() == player)
|
||||
continue;
|
||||
|
||||
if (Player* member = itr->getSource())
|
||||
if (Player* member = itr->GetSource())
|
||||
{
|
||||
if (player->HaveAtClient(member))
|
||||
{
|
||||
@@ -626,7 +626,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod& method /*= GROUP_REMOV
|
||||
{
|
||||
Player* leader = ObjectAccessor::FindPlayer(GetLeaderGUID());
|
||||
uint32 mapId = sLFGMgr->GetDungeonMapId(GetGUID());
|
||||
if (!mapId || !leader || (leader->isAlive() && leader->GetMapId() != mapId))
|
||||
if (!mapId || !leader || (leader->IsAlive() && leader->GetMapId() != mapId))
|
||||
{
|
||||
Disband();
|
||||
return false;
|
||||
@@ -959,7 +959,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
//a vector is filled with only near party members
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
Player* member = itr->GetSource();
|
||||
if (!member || !member->GetSession())
|
||||
continue;
|
||||
if (i->AllowedForPlayer(member))
|
||||
@@ -1043,7 +1043,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
//a vector is filled with only near party members
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
Player* member = itr->GetSource();
|
||||
if (!member || !member->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -1103,7 +1103,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* playerToRoll = itr->getSource();
|
||||
Player* playerToRoll = itr->GetSource();
|
||||
if (!playerToRoll || !playerToRoll->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -1178,7 +1178,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* playerToRoll = itr->getSource();
|
||||
Player* playerToRoll = itr->GetSource();
|
||||
if (!playerToRoll || !playerToRoll->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -1239,7 +1239,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* looter = itr->getSource();
|
||||
Player* looter = itr->GetSource();
|
||||
if (!looter->IsInWorld())
|
||||
continue;
|
||||
|
||||
@@ -1254,7 +1254,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* looter = itr->getSource();
|
||||
Player* looter = itr->GetSource();
|
||||
if (looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
|
||||
looter->GetSession()->SendPacket(&data);
|
||||
}
|
||||
@@ -1574,7 +1574,7 @@ void Group::UpdatePlayerOutOfRange(Player* player)
|
||||
Player* member;
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
member = itr->getSource();
|
||||
member = itr->GetSource();
|
||||
if (member && !member->IsWithinDist(player, member->GetSightRange(), false))
|
||||
member->GetSession()->SendPacket(&data);
|
||||
}
|
||||
@@ -1584,7 +1584,7 @@ void Group::BroadcastAddonMessagePacket(WorldPacket* packet, const std::string&
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (!player || (ignore != 0 && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this))
|
||||
continue;
|
||||
|
||||
@@ -1599,7 +1599,7 @@ void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (!player || (ignore != 0 && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this))
|
||||
continue;
|
||||
|
||||
@@ -1612,7 +1612,7 @@ void Group::BroadcastReadyCheck(WorldPacket* packet)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (player && player->GetSession())
|
||||
if (IsLeader(player->GetGUID()) || IsAssistant(player->GetGUID()))
|
||||
player->GetSession()->SendPacket(packet);
|
||||
@@ -1818,7 +1818,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side
|
||||
|
||||
// get a player as reference, to compare other players' stats to (arena team id, queue id based on level, etc.)
|
||||
Player* reference = GetFirstMember()->getSource();
|
||||
Player* reference = GetFirstMember()->GetSource();
|
||||
// no reference found, can't join this way
|
||||
if (!reference)
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
@@ -1836,7 +1836,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
memberscount = 0;
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next(), ++memberscount)
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
Player* member = itr->GetSource();
|
||||
// offline member? don't let join
|
||||
if (!member)
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
@@ -1902,7 +1902,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty)
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (!player->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -1926,7 +1926,7 @@ void Group::SetRaidDifficulty(Difficulty difficulty)
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (!player->GetSession())
|
||||
continue;
|
||||
|
||||
@@ -1939,7 +1939,7 @@ bool Group::InCombatToInstance(uint32 instanceId)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (player && !player->getAttackers().empty() && player->GetInstanceId() == instanceId && (player->GetMap()->IsRaidOrHeroicDungeon()))
|
||||
for (std::set<Unit*>::const_iterator i = player->getAttackers().begin(); i != player->getAttackers().end(); ++i)
|
||||
if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||
@@ -2114,7 +2114,7 @@ void Group::UnbindInstance(uint32 mapid, uint8 difficulty, bool unload)
|
||||
|
||||
void Group::_homebindIfInstance(Player* player)
|
||||
{
|
||||
if (player && !player->isGameMaster() && sMapStore.LookupEntry(player->GetMapId())->IsDungeon())
|
||||
if (player && !player->IsGameMaster() && sMapStore.LookupEntry(player->GetMapId())->IsDungeon())
|
||||
player->m_InstanceValid = false;
|
||||
}
|
||||
|
||||
@@ -2382,7 +2382,7 @@ void Group::DelinkMember(uint64 guid)
|
||||
while (ref)
|
||||
{
|
||||
GroupReference* nextRef = ref->next();
|
||||
if (ref->getSource()->GetGUID() == guid)
|
||||
if (ref->GetSource()->GetGUID() == guid)
|
||||
{
|
||||
ref->unlink();
|
||||
break;
|
||||
|
||||
@@ -45,7 +45,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recvData)
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->isBattleMaster()) // it's not battlemaster
|
||||
if (!unit->IsBattleMaster()) // it's not battlemaster
|
||||
return;
|
||||
|
||||
// Stop the npc if moving
|
||||
@@ -236,7 +236,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
continue; // this should never happen
|
||||
|
||||
@@ -526,13 +526,13 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
_player->SetBattlegroundEntryPoint();
|
||||
|
||||
// resurrect the player
|
||||
if (!_player->isAlive())
|
||||
if (!_player->IsAlive())
|
||||
{
|
||||
_player->ResurrectPlayer(1.0f);
|
||||
_player->SpawnCorpseBones();
|
||||
}
|
||||
// stop taxi flight at port
|
||||
if (_player->isInFlight())
|
||||
if (_player->IsInFlight())
|
||||
{
|
||||
_player->GetMotionMaster()->MovementExpired();
|
||||
_player->CleanupAfterTaxiFlight();
|
||||
@@ -590,7 +590,7 @@ void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& /*recvData*/)
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LEAVE Message");
|
||||
|
||||
// not allow leave battleground in combat
|
||||
if (_player->isInCombat())
|
||||
if (_player->IsInCombat())
|
||||
if (Battleground* bg = _player->GetBattleground())
|
||||
if (bg->GetStatus() != STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
@@ -742,7 +742,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -1067,7 +1067,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
pCurrChar->LoadPet();
|
||||
|
||||
// Set FFA PvP for non GM in non-rest mode
|
||||
if (sWorld->IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
|
||||
if (sWorld->IsFFAPvPRealm() && !pCurrChar->IsGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
|
||||
pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
|
||||
|
||||
if (pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
@@ -1120,7 +1120,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
if (sWorld->getBoolConfig(CONFIG_ALL_TAXI_PATHS))
|
||||
pCurrChar->SetTaxiCheater(true);
|
||||
|
||||
if (pCurrChar->isGameMaster())
|
||||
if (pCurrChar->IsGameMaster())
|
||||
SendNotification(LANG_GM_ON);
|
||||
|
||||
std::string IP_str = GetRemoteAddress();
|
||||
@@ -1690,7 +1690,7 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData)
|
||||
|
||||
void WorldSession::HandleEquipmentSetUse(WorldPacket& recvData)
|
||||
{
|
||||
if (_player->isInCombat())
|
||||
if (_player->IsInCombat())
|
||||
return;
|
||||
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_USE");
|
||||
|
||||
@@ -174,7 +174,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
else
|
||||
{
|
||||
// send in universal language if player in .gm on mode (ignore spell effects)
|
||||
if (sender->isGameMaster())
|
||||
if (sender->IsGameMaster())
|
||||
lang = LANG_UNIVERSAL;
|
||||
else
|
||||
{
|
||||
@@ -326,7 +326,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
SendPlayerNotFoundNotice(to);
|
||||
return;
|
||||
}
|
||||
if (!sender->isGameMaster() && sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && !receiver->IsInWhisperWhiteList(sender->GetGUID()))
|
||||
if (!sender->IsGameMaster() && sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && !receiver->IsInWhisperWhiteList(sender->GetGUID()))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||
return;
|
||||
@@ -338,7 +338,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->HasAura(1852) && !receiver->isGameMaster())
|
||||
if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
|
||||
return;
|
||||
@@ -470,7 +470,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
} break;
|
||||
case CHAT_MSG_AFK:
|
||||
{
|
||||
if (!_player->isInCombat())
|
||||
if (!_player->IsInCombat())
|
||||
{
|
||||
if (_player->isAFK()) // Already AFK
|
||||
{
|
||||
@@ -661,7 +661,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::HandleEmoteOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
if (!GetPlayer()->IsAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
return;
|
||||
|
||||
uint32 emote;
|
||||
@@ -704,7 +704,7 @@ namespace Trinity
|
||||
|
||||
void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (!GetPlayer()->isAlive())
|
||||
if (!GetPlayer()->IsAlive())
|
||||
return;
|
||||
|
||||
if (!GetPlayer()->CanSpeak())
|
||||
|
||||
@@ -115,14 +115,14 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
// restrict invite to GMs
|
||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster())
|
||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->IsGameMaster() && player->IsGameMaster())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, memberName, ERR_BAD_PLAYER_NAME_S);
|
||||
return;
|
||||
}
|
||||
|
||||
// can't group with
|
||||
if (!GetPlayer()->isGameMaster() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||
if (!GetPlayer()->IsGameMaster() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PLAYER_WRONG_FACTION);
|
||||
return;
|
||||
@@ -946,7 +946,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
|
||||
if (player->IsPvP())
|
||||
playerStatus |= MEMBER_STATUS_PVP;
|
||||
|
||||
if (!player->isAlive())
|
||||
if (!player->IsAlive())
|
||||
{
|
||||
if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
playerStatus |= MEMBER_STATUS_GHOST;
|
||||
@@ -1206,7 +1206,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData)
|
||||
if (player->IsPvP())
|
||||
playerStatus |= MEMBER_STATUS_PVP;
|
||||
|
||||
if (!player->isAlive())
|
||||
if (!player->IsAlive())
|
||||
{
|
||||
if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
playerStatus |= MEMBER_STATUS_GHOST;
|
||||
|
||||
@@ -542,7 +542,7 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket& recvData)
|
||||
|
||||
recvData >> guid;
|
||||
|
||||
if (!GetPlayer()->isAlive())
|
||||
if (!GetPlayer()->IsAlive())
|
||||
return;
|
||||
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LIST_INVENTORY");
|
||||
@@ -594,7 +594,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
|
||||
continue;
|
||||
|
||||
uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem);
|
||||
if (!_player->isGameMaster()) // ignore conditions if GM on
|
||||
if (!_player->IsGameMaster()) // ignore conditions if GM on
|
||||
{
|
||||
// Respect allowed class
|
||||
if (!(itemTemplate->AllowableClass & _player->getClassMask()) && itemTemplate->Bonding == BIND_WHEN_PICKED_UP)
|
||||
|
||||
@@ -246,7 +246,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*
|
||||
lfg::LfgLockPartyMap lockMap;
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* plrg = itr->getSource();
|
||||
Player* plrg = itr->GetSource();
|
||||
if (!plrg)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
|
||||
{
|
||||
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
|
||||
if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
|
||||
{
|
||||
@@ -149,11 +149,11 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
||||
case HIGHGUID_VEHICLE:
|
||||
{
|
||||
Creature* creature = player->GetMap()->GetCreature(guid);
|
||||
bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
if (lootAllowed && creature->IsWithinDistInMap(player, INTERACTION_DISTANCE))
|
||||
{
|
||||
loot = &creature->loot;
|
||||
if (creature->isAlive())
|
||||
if (creature->IsAlive())
|
||||
shareMoney = false;
|
||||
}
|
||||
break;
|
||||
@@ -172,7 +172,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
|
||||
std::vector<Player*> playersNear;
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
continue;
|
||||
|
||||
@@ -232,7 +232,7 @@ void WorldSession::HandleLootOpcode(WorldPacket& recvData)
|
||||
recvData >> guid;
|
||||
|
||||
// Check possible cheat
|
||||
if (!_player->isAlive())
|
||||
if (!_player->IsAlive())
|
||||
return;
|
||||
|
||||
GetPlayer()->SendLoot(guid, LOOT_CORPSE);
|
||||
@@ -366,7 +366,7 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
{
|
||||
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
|
||||
return;
|
||||
|
||||
@@ -374,7 +374,7 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
if (loot->isLooted())
|
||||
{
|
||||
// skip pickpocketing loot for speed, skinning timer reduction is no-op in fact
|
||||
if (!creature->isAlive())
|
||||
if (!creature->IsAlive())
|
||||
creature->AllLootRemovedFromCorpse();
|
||||
|
||||
creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
|
||||
@@ -153,7 +153,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
uint64 reqmoney = cost + money;
|
||||
|
||||
if (!player->HasEnoughMoney(reqmoney) && !player->isGameMaster())
|
||||
if (!player->HasEnoughMoney(reqmoney) && !player->IsGameMaster())
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_ENOUGH_MONEY);
|
||||
return;
|
||||
|
||||
@@ -63,7 +63,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recvData)
|
||||
|
||||
recvData.read_skip<uint8>();
|
||||
|
||||
if (GetPlayer()->isAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
if (GetPlayer()->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
@@ -373,14 +373,14 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/)
|
||||
if (uint64 lguid = GetPlayer()->GetLootGUID())
|
||||
DoLootRelease(lguid);
|
||||
|
||||
bool instantLogout = (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->isInCombat()) ||
|
||||
GetPlayer()->isInFlight() || HasPermission(RBAC_PERM_INSTANT_LOGOUT);
|
||||
bool instantLogout = (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat()) ||
|
||||
GetPlayer()->IsInFlight() || HasPermission(RBAC_PERM_INSTANT_LOGOUT);
|
||||
|
||||
/// TODO: Possibly add RBAC permission to log out in combat
|
||||
bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
|
||||
uint32 reason = 0;
|
||||
if (GetPlayer()->isInCombat() && !canLogoutInCombat)
|
||||
if (GetPlayer()->IsInCombat() && !canLogoutInCombat)
|
||||
reason = 1;
|
||||
else if (GetPlayer()->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR))
|
||||
reason = 3; // is jumping or falling
|
||||
@@ -497,7 +497,7 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::HandleReturnToGraveyard(WorldPacket& /*recvPacket*/)
|
||||
{
|
||||
if (GetPlayer()->isAlive() || !GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (GetPlayer()->IsAlive() || !GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
GetPlayer()->RepopAtGraveyard();
|
||||
}
|
||||
@@ -736,7 +736,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recvData)
|
||||
uint64 guid;
|
||||
recvData >> guid;
|
||||
|
||||
if (GetPlayer()->isAlive())
|
||||
if (GetPlayer()->IsAlive())
|
||||
return;
|
||||
|
||||
// do not allow corpse reclaim in arena
|
||||
@@ -775,7 +775,7 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recvData)
|
||||
recvData >> guid;
|
||||
recvData >> status;
|
||||
|
||||
if (GetPlayer()->isAlive())
|
||||
if (GetPlayer()->IsAlive())
|
||||
return;
|
||||
|
||||
if (status == 0)
|
||||
@@ -815,7 +815,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "CMSG_AREATRIGGER. Trigger ID: %u", triggerId);
|
||||
|
||||
Player* player = GetPlayer();
|
||||
if (player->isInFlight())
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",
|
||||
player->GetName().c_str(), player->GetGUIDLow(), triggerId);
|
||||
@@ -889,7 +889,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
|
||||
if (sScriptMgr->OnAreaTrigger(player, atEntry))
|
||||
return;
|
||||
|
||||
if (player->isAlive())
|
||||
if (player->IsAlive())
|
||||
if (uint32 questId = sObjectMgr->GetQuestForAreaTrigger(triggerId))
|
||||
if (player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
@@ -1209,7 +1209,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recvData)
|
||||
WorldPacket data(SMSG_INSPECT_TALENT, 8 + 4 + 1 + 1 + talent_points + 8 + 4 + 8 + 4);
|
||||
data << player->GetGUID();
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster())
|
||||
if (sWorld->getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->IsGameMaster())
|
||||
player->BuildPlayerTalentsInfoData(&data);
|
||||
else
|
||||
{
|
||||
@@ -1300,7 +1300,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recvData)
|
||||
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_WORLD_TELEPORT");
|
||||
|
||||
if (GetPlayer()->isInFlight())
|
||||
if (GetPlayer()->IsInFlight())
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.",
|
||||
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow());
|
||||
@@ -1546,7 +1546,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recvData)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* groupGuy = itr->getSource();
|
||||
Player* groupGuy = itr->GetSource();
|
||||
if (!groupGuy)
|
||||
continue;
|
||||
|
||||
@@ -1604,7 +1604,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recvData)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* groupGuy = itr->getSource();
|
||||
Player* groupGuy = itr->GetSource();
|
||||
if (!groupGuy)
|
||||
continue;
|
||||
|
||||
@@ -1641,7 +1641,7 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket& /*recvData*/)
|
||||
return;
|
||||
}
|
||||
|
||||
if (_player->isInFlight()) // not blizz like; no any messages on blizz
|
||||
if (_player->IsInFlight()) // not blizz like; no any messages on blizz
|
||||
{
|
||||
ChatHandler(this).SendSysMessage(LANG_YOU_IN_FLIGHT);
|
||||
return;
|
||||
@@ -1787,7 +1787,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket& recvData)
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
if (!unit->IsSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
if (bg)
|
||||
@@ -1810,7 +1810,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recvData)
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->isSpiritService()) // it's not spirit service
|
||||
if (!unit->IsSpiritService()) // it's not spirit service
|
||||
return;
|
||||
|
||||
if (bg)
|
||||
@@ -1822,7 +1822,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recvData*/)
|
||||
{
|
||||
if (_player->isInFlight())
|
||||
if (_player->IsInFlight())
|
||||
return;
|
||||
|
||||
if (/*Battlefield* bf = */sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
|
||||
|
||||
@@ -365,7 +365,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
|
||||
}
|
||||
|
||||
// fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
|
||||
if (opcode == MSG_MOVE_FALL_LAND && plrMover && !plrMover->isInFlight())
|
||||
if (opcode == MSG_MOVE_FALL_LAND && plrMover && !plrMover->IsInFlight())
|
||||
plrMover->HandleFall(movementInfo);
|
||||
|
||||
if (plrMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plrMover->IsInWater())
|
||||
@@ -406,13 +406,13 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
|
||||
// NOTE: this is actually called many times while falling
|
||||
// even after the player has been teleported away
|
||||
/// @todo discard movement packets after the player is rooted
|
||||
if (plrMover->isAlive())
|
||||
if (plrMover->IsAlive())
|
||||
{
|
||||
plrMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth());
|
||||
// player can be alive if GM/etc
|
||||
// change the death state to CORPSE to prevent the death timer from
|
||||
// starting in the next player update
|
||||
if (!plrMover->isAlive())
|
||||
if (!plrMover->IsAlive())
|
||||
plrMover->KillPlayer();
|
||||
}
|
||||
}
|
||||
@@ -596,7 +596,7 @@ void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (!_player->isAlive() || _player->isInCombat())
|
||||
if (!_player->IsAlive() || _player->IsInCombat())
|
||||
return;
|
||||
|
||||
uint64 summonerGuid;
|
||||
|
||||
@@ -335,11 +335,11 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
|
||||
//if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
// GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider() || unit->isGuard())
|
||||
if (unit->IsArmorer() || unit->IsCivilian() || unit->IsQuestGiver() || unit->IsServiceProvider() || unit->IsGuard())
|
||||
unit->StopMoving();
|
||||
|
||||
// If spiritguide, no need for gossip menu, just put player into resurrect queue
|
||||
if (unit->isSpiritGuide())
|
||||
if (unit->IsSpiritGuide())
|
||||
{
|
||||
Battleground* bg = _player->GetBattleground();
|
||||
if (bg)
|
||||
@@ -460,7 +460,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket& recvData)
|
||||
uint64 npcGUID;
|
||||
recvData >> npcGUID;
|
||||
|
||||
if (!GetPlayer()->IsInWorld() || !GetPlayer()->isAlive())
|
||||
if (!GetPlayer()->IsInWorld() || !GetPlayer()->IsAlive())
|
||||
return;
|
||||
|
||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_INNKEEPER);
|
||||
@@ -550,7 +550,7 @@ void WorldSession::SendStablePetCallback(PreparedQueryResult result, uint64 guid
|
||||
uint8 num = 0; // counter for place holder
|
||||
|
||||
// not let move dead pet in slot
|
||||
if (pet && pet->isAlive() && pet->getPetType() == HUNTER_PET)
|
||||
if (pet && pet->IsAlive() && pet->getPetType() == HUNTER_PET)
|
||||
{
|
||||
data << uint32(0); // 4.x unknown, some kind of order?
|
||||
data << uint32(pet->GetCharmInfo()->GetPetNumber());
|
||||
@@ -597,7 +597,7 @@ void WorldSession::HandleStablePet(WorldPacket& recvData)
|
||||
|
||||
recvData >> npcGUID;
|
||||
|
||||
if (!GetPlayer()->isAlive())
|
||||
if (!GetPlayer()->IsAlive())
|
||||
{
|
||||
SendStableResult(STABLE_ERR_STABLE);
|
||||
return;
|
||||
@@ -616,7 +616,7 @@ void WorldSession::HandleStablePet(WorldPacket& recvData)
|
||||
Pet* pet = _player->GetPet();
|
||||
|
||||
// can't place in stable dead pet
|
||||
if (!pet || !pet->isAlive() || pet->getPetType() != HUNTER_PET)
|
||||
if (!pet || !pet->IsAlive() || pet->getPetType() != HUNTER_PET)
|
||||
{
|
||||
SendStableResult(STABLE_ERR_STABLE);
|
||||
return;
|
||||
@@ -713,10 +713,10 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32
|
||||
}
|
||||
|
||||
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(petEntry);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
|
||||
if (!creatureInfo || !creatureInfo->IsTameable(_player->CanTameExoticPets()))
|
||||
{
|
||||
// if problem in exotic pet
|
||||
if (creatureInfo && creatureInfo->isTameable(true))
|
||||
if (creatureInfo && creatureInfo->IsTameable(true))
|
||||
SendStableResult(STABLE_ERR_EXOTIC);
|
||||
else
|
||||
SendStableResult(STABLE_ERR_STABLE);
|
||||
@@ -724,7 +724,7 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32
|
||||
}
|
||||
|
||||
Pet* pet = _player->GetPet();
|
||||
if (pet && pet->isAlive())
|
||||
if (pet && pet->IsAlive())
|
||||
{
|
||||
SendStableResult(STABLE_ERR_STABLE);
|
||||
return;
|
||||
@@ -844,10 +844,10 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3
|
||||
}
|
||||
|
||||
CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(petEntry);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(_player->CanTameExoticPets()))
|
||||
if (!creatureInfo || !creatureInfo->IsTameable(_player->CanTameExoticPets()))
|
||||
{
|
||||
// if problem in exotic pet
|
||||
if (creatureInfo && creatureInfo->isTameable(true))
|
||||
if (creatureInfo && creatureInfo->IsTameable(true))
|
||||
SendStableResult(STABLE_ERR_EXOTIC);
|
||||
else
|
||||
SendStableResult(STABLE_ERR_STABLE);
|
||||
@@ -863,7 +863,7 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3
|
||||
}
|
||||
|
||||
// move alive pet to slot or delete dead pet
|
||||
_player->RemovePet(pet, pet->isAlive() ? PetSaveMode(slot) : PET_SAVE_AS_DELETED);
|
||||
_player->RemovePet(pet, pet->IsAlive() ? PetSaveMode(slot) : PET_SAVE_AS_DELETED);
|
||||
|
||||
// summon unstabled pet
|
||||
Pet* newPet = new Pet(_player);
|
||||
|
||||
@@ -51,7 +51,7 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData)
|
||||
|
||||
if (_player->GetCritterGUID() == pet->GetGUID())
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->isSummon())
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->IsSummon())
|
||||
pet->ToTempSummon()->UnSummon();
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ void WorldSession::HandlePetAction(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pet->isAlive())
|
||||
if (!pet->IsAlive())
|
||||
{
|
||||
SpellInfo const* spell = (flag == ACT_ENABLED || flag == ACT_PASSIVE) ? sSpellMgr->GetSpellInfo(spellid) : NULL;
|
||||
if (!spell)
|
||||
@@ -109,7 +109,7 @@ void WorldSession::HandlePetAction(WorldPacket& recvData)
|
||||
//If a pet is dismissed, m_Controlled will change
|
||||
std::vector<Unit*> controlled;
|
||||
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
if ((*itr)->GetEntry() == pet->GetEntry() && (*itr)->isAlive())
|
||||
if ((*itr)->GetEntry() == pet->GetEntry() && (*itr)->IsAlive())
|
||||
controlled.push_back(*itr);
|
||||
for (std::vector<Unit*>::iterator itr = controlled.begin(); itr != controlled.end(); ++itr)
|
||||
HandlePetActionHelper(*itr, guid1, spellid, flag, guid2, x, y, z);
|
||||
@@ -138,7 +138,7 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pet->isAlive())
|
||||
if (!pet->IsAlive())
|
||||
return;
|
||||
|
||||
pet->AttackStop();
|
||||
@@ -205,9 +205,9 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
|
||||
pet->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
// This is true if pet has no target or has target but targets differs.
|
||||
if (pet->getVictim() != TargetUnit || (pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack()))
|
||||
if (pet->GetVictim() != TargetUnit || (pet->GetVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack()))
|
||||
{
|
||||
if (pet->getVictim())
|
||||
if (pet->GetVictim())
|
||||
pet->AttackStop();
|
||||
|
||||
if (pet->GetTypeId() != TYPEID_PLAYER && pet->ToCreature()->IsAIEnabled)
|
||||
@@ -221,7 +221,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
pet->ToCreature()->AI()->AttackStart(TargetUnit);
|
||||
|
||||
//10% chance to play special pet attack talk, else growl
|
||||
if (pet->ToCreature()->isPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10)
|
||||
if (pet->ToCreature()->IsPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10)
|
||||
pet->SendPetTalk((uint32)PET_TALK_ATTACK);
|
||||
else
|
||||
{
|
||||
@@ -231,7 +231,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
}
|
||||
else // charmed player
|
||||
{
|
||||
if (pet->getVictim() && pet->getVictim() != TargetUnit)
|
||||
if (pet->GetVictim() && pet->GetVictim() != TargetUnit)
|
||||
pet->AttackStop();
|
||||
|
||||
charmInfo->SetIsCommandAttack(true);
|
||||
@@ -252,7 +252,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
else if (pet->GetOwnerGUID() == GetPlayer()->GetGUID())
|
||||
{
|
||||
ASSERT(pet->GetTypeId() == TYPEID_UNIT);
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
if (((Pet*)pet)->getPetType() == HUNTER_PET)
|
||||
GetPlayer()->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
|
||||
@@ -371,7 +371,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
|
||||
//10% chance to play special pet attack talk, else growl
|
||||
//actually this only seems to happen on special spells, fire shield for imp, torment for voidwalker, but it's stupid to check every spell
|
||||
if (pet->ToCreature()->isPet() && (((Pet*)pet)->getPetType() == SUMMON_PET) && (pet != unit_target) && (urand(0, 100) < 10))
|
||||
if (pet->ToCreature()->IsPet() && (((Pet*)pet)->getPetType() == SUMMON_PET) && (pet != unit_target) && (urand(0, 100) < 10))
|
||||
pet->SendPetTalk((uint32)PET_TALK_SPECIAL_SPELL);
|
||||
else
|
||||
{
|
||||
@@ -381,9 +381,9 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
if (unit_target && !GetPlayer()->IsFriendlyTo(unit_target) && !pet->isPossessed() && !pet->IsVehicle())
|
||||
{
|
||||
// This is true if pet has no target or has target but targets differs.
|
||||
if (pet->getVictim() != unit_target)
|
||||
if (pet->GetVictim() != unit_target)
|
||||
{
|
||||
if (pet->getVictim())
|
||||
if (pet->GetVictim())
|
||||
pet->AttackStop();
|
||||
pet->GetMotionMaster()->Clear();
|
||||
if (pet->ToCreature()->IsAIEnabled)
|
||||
@@ -449,7 +449,7 @@ void WorldSession::SendPetNameQuery(uint64 petguid, uint32 petnumber)
|
||||
data << pet->GetName();
|
||||
data << uint32(pet->GetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP));
|
||||
|
||||
if (pet->isPet() && ((Pet*)pet)->GetDeclinedNames())
|
||||
if (pet->IsPet() && ((Pet*)pet)->GetDeclinedNames())
|
||||
{
|
||||
data << uint8(1);
|
||||
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
@@ -466,7 +466,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
|
||||
// spell case or GM
|
||||
if (guid == GetPlayer()->GetGUID())
|
||||
{
|
||||
if (!GetPlayer()->isGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
|
||||
if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
|
||||
return false;
|
||||
@@ -577,7 +577,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
|
||||
//sign for autocast
|
||||
if (act_state == ACT_ENABLED)
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->isPet())
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->IsPet())
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, true);
|
||||
else
|
||||
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
@@ -587,7 +587,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
|
||||
//sign for no/turn off autocast
|
||||
else if (act_state == ACT_DISABLED)
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->isPet())
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->IsPet())
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, false);
|
||||
else
|
||||
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
@@ -617,7 +617,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
|
||||
|
||||
Pet* pet = ObjectAccessor::FindPet(petguid);
|
||||
// check it!
|
||||
if (!pet || !pet->isPet() || ((Pet*)pet)->getPetType()!= HUNTER_PET ||
|
||||
if (!pet || !pet->IsPet() || ((Pet*)pet)->getPetType()!= HUNTER_PET ||
|
||||
!pet->HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ||
|
||||
pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo())
|
||||
return;
|
||||
@@ -699,7 +699,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData)
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
|
||||
if (pet)
|
||||
{
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
_player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
|
||||
else if (pet->GetGUID() == _player->GetCharmGUID())
|
||||
_player->StopCastingCharm();
|
||||
@@ -740,7 +740,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, state);
|
||||
else
|
||||
pet->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, state);
|
||||
@@ -813,7 +813,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
Creature* pet = caster->ToCreature();
|
||||
pet->AddCreatureSpellCooldown(spellId);
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
Pet* p = (Pet*)pet;
|
||||
// 10% chance to play special pet attack talk, else growl
|
||||
|
||||
@@ -98,7 +98,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
|
||||
uint32 charterid = 0;
|
||||
uint32 cost = 0;
|
||||
uint32 type = 0;
|
||||
if (creature->isTabardDesigner())
|
||||
if (creature->IsTabardDesigner())
|
||||
{
|
||||
// if tabard designer, then trying to buy a guild charter.
|
||||
// do not let if already in guild.
|
||||
@@ -937,7 +937,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
|
||||
WorldPacket data(SMSG_PETITION_SHOWLIST, 8+1+4*6);
|
||||
data << guid; // npc guid
|
||||
|
||||
if (creature->isTabardDesigner())
|
||||
if (creature->IsTabardDesigner())
|
||||
{
|
||||
data << uint8(1); // count
|
||||
data << uint32(1); // index
|
||||
|
||||
@@ -163,7 +163,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
|
||||
if (!player || player == _player) // not self
|
||||
continue;
|
||||
@@ -569,7 +569,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
|
||||
if (!player || player == _player) // skip self
|
||||
continue;
|
||||
|
||||
@@ -149,7 +149,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pUser->isInCombat())
|
||||
if (pUser->IsInCombat())
|
||||
{
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
{
|
||||
@@ -510,7 +510,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pet->isAlive())
|
||||
if (!pet->IsAlive())
|
||||
{
|
||||
pet->SendPetActionFeedback(FEEDBACK_PET_DEAD);
|
||||
return;
|
||||
@@ -563,7 +563,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
|
||||
return;
|
||||
|
||||
Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]);
|
||||
if (totem && totem->isTotem() && totem->GetGUID() == guid)
|
||||
if (totem && totem->IsTotem() && totem->GetGUID() == guid)
|
||||
totem->ToTotem()->UnSummon();
|
||||
}
|
||||
|
||||
|
||||
@@ -646,7 +646,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
if (GetPlayer()->m_trade)
|
||||
return;
|
||||
|
||||
if (!GetPlayer()->isAlive())
|
||||
if (!GetPlayer()->IsAlive())
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_YOU_DEAD);
|
||||
return;
|
||||
@@ -664,7 +664,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->isInFlight())
|
||||
if (GetPlayer()->IsInFlight())
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR);
|
||||
return;
|
||||
@@ -690,13 +690,13 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pOther->isAlive())
|
||||
if (!pOther->IsAlive())
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_TARGET_DEAD);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther->isInFlight())
|
||||
if (pOther->IsInFlight())
|
||||
{
|
||||
SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR);
|
||||
return;
|
||||
|
||||
@@ -91,15 +91,15 @@ void InstanceScript::UpdateMinionState(Creature* minion, EncounterState state)
|
||||
switch (state)
|
||||
{
|
||||
case NOT_STARTED:
|
||||
if (!minion->isAlive())
|
||||
if (!minion->IsAlive())
|
||||
minion->Respawn();
|
||||
else if (minion->isInCombat())
|
||||
else if (minion->IsInCombat())
|
||||
minion->AI()->EnterEvadeMode();
|
||||
break;
|
||||
case IN_PROGRESS:
|
||||
if (!minion->isAlive())
|
||||
if (!minion->IsAlive())
|
||||
minion->Respawn();
|
||||
else if (!minion->getVictim())
|
||||
else if (!minion->GetVictim())
|
||||
minion->AI()->DoZoneInCombat();
|
||||
break;
|
||||
default:
|
||||
@@ -210,7 +210,7 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state)
|
||||
|
||||
if (state == DONE)
|
||||
for (MinionSet::iterator i = bossInfo->minion.begin(); i != bossInfo->minion.end(); ++i)
|
||||
if ((*i)->isWorldBoss() && (*i)->isAlive())
|
||||
if ((*i)->isWorldBoss() && (*i)->IsAlive())
|
||||
return false;
|
||||
|
||||
bossInfo->state = state;
|
||||
@@ -297,7 +297,7 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
if (!lPlayers.isEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
|
||||
if (Player* player = itr->getSource())
|
||||
if (Player* player = itr->GetSource())
|
||||
player->SendUpdateWorldState(uiStateId, uiStateData);
|
||||
}
|
||||
else
|
||||
@@ -317,7 +317,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
|
||||
vsnprintf(buff, 1024, format, ap);
|
||||
va_end(ap);
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
if (Player* player = i->getSource())
|
||||
if (Player* player = i->GetSource())
|
||||
if (WorldSession* session = player->GetSession())
|
||||
session->SendNotification("%s", buff);
|
||||
}
|
||||
@@ -330,7 +330,7 @@ void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type,
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->getSource())
|
||||
if (Player* player = i->GetSource())
|
||||
player->UpdateAchievementCriteria(type, miscValue1, miscValue2, 0, unit);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ void InstanceScript::DoStartTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->getSource())
|
||||
if (Player* player = i->GetSource())
|
||||
player->StartTimedAchievement(type, entry);
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->getSource())
|
||||
if (Player* player = i->GetSource())
|
||||
player->RemoveTimedAchievement(type, entry);
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
|
||||
{
|
||||
if (Player* player = itr->getSource())
|
||||
if (Player* player = itr->GetSource())
|
||||
{
|
||||
player->RemoveAurasDueToSpell(spell);
|
||||
if (Pet* pet = player->GetPet())
|
||||
@@ -381,7 +381,7 @@ void InstanceScript::DoCastSpellOnPlayers(uint32 spell)
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->getSource())
|
||||
if (Player* player = i->GetSource())
|
||||
player->CastSpell(player, spell, true);
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
if (Player* player = i->getSource())
|
||||
if (Player* player = i->GetSource())
|
||||
if (Group* grp = player->GetGroup())
|
||||
if (grp->isLFGGroup())
|
||||
{
|
||||
@@ -474,6 +474,6 @@ void InstanceScript::UpdatePhasing()
|
||||
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->getSource())
|
||||
if (Player* player = itr->GetSource())
|
||||
player->GetPhaseMgr().NotifyConditionChanged(phaseUdateData);
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo
|
||||
roundRobinPlayer = lootOwner->GetGUID();
|
||||
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if (Player* player = itr->getSource()) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter
|
||||
if (Player* player = itr->GetSource()) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter
|
||||
FillNotNormalLootFor(player, player->IsAtGroupRewardDistance(lootOwner));
|
||||
|
||||
for (uint8 i = 0; i < items.size(); ++i)
|
||||
|
||||
@@ -69,7 +69,7 @@ MailSender::MailSender(AuctionEntry* sender)
|
||||
MailSender::MailSender(Player* sender)
|
||||
{
|
||||
m_messageType = MAIL_NORMAL;
|
||||
m_stationery = sender->isGameMaster() ? MAIL_STATIONERY_GM : MAIL_STATIONERY_DEFAULT;
|
||||
m_stationery = sender->IsGameMaster() ? MAIL_STATIONERY_GM : MAIL_STATIONERY_DEFAULT;
|
||||
m_senderId = sender->GetGUIDLow();
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver,
|
||||
if (m_COD)
|
||||
expire_delay = 3 * DAY;
|
||||
else
|
||||
expire_delay = pSender && pSender->isGameMaster() ? 90 * DAY : 30 * DAY;
|
||||
expire_delay = pSender && pSender->IsGameMaster() ? 90 * DAY : 30 * DAY;
|
||||
|
||||
time_t expire_time = deliver_time + expire_delay;
|
||||
|
||||
|
||||
@@ -520,7 +520,7 @@ void Map::Update(const uint32 t_diff)
|
||||
/// update worldsessions for existing players
|
||||
for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* player = m_mapRefIter->getSource();
|
||||
Player* player = m_mapRefIter->GetSource();
|
||||
if (player && player->IsInWorld())
|
||||
{
|
||||
//player->Update(t_diff);
|
||||
@@ -542,7 +542,7 @@ void Map::Update(const uint32 t_diff)
|
||||
// to make sure calls to Map::Remove don't invalidate it
|
||||
for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* player = m_mapRefIter->getSource();
|
||||
Player* player = m_mapRefIter->GetSource();
|
||||
|
||||
if (!player || !player->IsInWorld())
|
||||
continue;
|
||||
@@ -586,7 +586,7 @@ struct ResetNotifier
|
||||
template<class T>inline void resetNotify(GridRefManager<T> &m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->ResetAllNotifies();
|
||||
iter->GetSource()->ResetAllNotifies();
|
||||
}
|
||||
template<class T> void Visit(GridRefManager<T> &) {}
|
||||
void Visit(CreatureMapType &m) { resetNotify<Creature>(m);}
|
||||
@@ -597,7 +597,7 @@ void Map::ProcessRelocationNotifies(const uint32 diff)
|
||||
{
|
||||
for (GridRefManager<NGridType>::iterator i = GridRefManager<NGridType>::begin(); i != GridRefManager<NGridType>::end(); ++i)
|
||||
{
|
||||
NGridType *grid = i->getSource();
|
||||
NGridType *grid = i->GetSource();
|
||||
|
||||
if (grid->GetGridState() != GRID_STATE_ACTIVE)
|
||||
continue;
|
||||
@@ -637,7 +637,7 @@ void Map::ProcessRelocationNotifies(const uint32 diff)
|
||||
TypeContainerVisitor<ResetNotifier, WorldTypeMapContainer > world_notifier(reset);
|
||||
for (GridRefManager<NGridType>::iterator i = GridRefManager<NGridType>::begin(); i != GridRefManager<NGridType>::end(); ++i)
|
||||
{
|
||||
NGridType *grid = i->getSource();
|
||||
NGridType *grid = i->GetSource();
|
||||
|
||||
if (grid->GetGridState() != GRID_STATE_ACTIVE)
|
||||
continue;
|
||||
@@ -839,7 +839,7 @@ void Map::MoveAllCreaturesInMoveList()
|
||||
//But this check is always needed to ensure safety
|
||||
/// @todo pets will disappear if this is outside CreatureRespawnRelocation
|
||||
//need to check why pet is frequently relocated to an unloaded cell
|
||||
if (c->isPet())
|
||||
if (c->IsPet())
|
||||
((Pet*)c)->Remove(PET_SAVE_NOT_IN_SLOT, true);
|
||||
else
|
||||
AddObjectToRemoveList(c);
|
||||
@@ -1024,7 +1024,7 @@ void Map::RemoveAllPlayers()
|
||||
{
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
if (!player->IsBeingTeleportedFar())
|
||||
{
|
||||
// this is happening for bg
|
||||
@@ -1042,7 +1042,7 @@ void Map::UnloadAll()
|
||||
|
||||
for (GridRefManager<NGridType>::iterator i = GridRefManager<NGridType>::begin(); i != GridRefManager<NGridType>::end();)
|
||||
{
|
||||
NGridType &grid(*i->getSource());
|
||||
NGridType &grid(*i->GetSource());
|
||||
++i;
|
||||
UnloadGrid(grid, true); // deletes the grid and removes it from the GridRefManager
|
||||
}
|
||||
@@ -2090,8 +2090,8 @@ void Map::DelayedUpdate(const uint32 t_diff)
|
||||
{
|
||||
for (GridRefManager<NGridType>::iterator i = GridRefManager<NGridType>::begin(); i != GridRefManager<NGridType>::end();)
|
||||
{
|
||||
NGridType *grid = i->getSource();
|
||||
GridInfo* info = i->getSource()->getGridInfoRef();
|
||||
NGridType *grid = i->GetSource();
|
||||
GridInfo* info = i->GetSource()->getGridInfoRef();
|
||||
++i; // The update might delete the map and we need the next map before the iterator gets invalid
|
||||
ASSERT(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE);
|
||||
si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, t_diff);
|
||||
@@ -2182,7 +2182,7 @@ uint32 Map::GetPlayersCountExceptGMs() const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
if (!itr->getSource()->isGameMaster())
|
||||
if (!itr->GetSource()->IsGameMaster())
|
||||
++count;
|
||||
return count;
|
||||
}
|
||||
@@ -2190,7 +2190,7 @@ uint32 Map::GetPlayersCountExceptGMs() const
|
||||
void Map::SendToPlayers(WorldPacket const* data) const
|
||||
{
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->GetSession()->SendPacket(data);
|
||||
itr->GetSource()->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
bool Map::ActiveObjectsNearGrid(NGridType const& ngrid) const
|
||||
@@ -2209,7 +2209,7 @@ bool Map::ActiveObjectsNearGrid(NGridType const& ngrid) const
|
||||
|
||||
for (MapRefManager::const_iterator iter = m_mapRefManager.begin(); iter != m_mapRefManager.end(); ++iter)
|
||||
{
|
||||
Player* player = iter->getSource();
|
||||
Player* player = iter->GetSource();
|
||||
|
||||
CellCoord p = Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY());
|
||||
if ((cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) &&
|
||||
@@ -2235,7 +2235,7 @@ void Map::AddToActive(Creature* c)
|
||||
AddToActiveHelper(c);
|
||||
|
||||
// also not allow unloading spawn grid to prevent creating creature clone at load
|
||||
if (!c->isPet() && c->GetDBTableGUIDLow())
|
||||
if (!c->IsPet() && c->GetDBTableGUIDLow())
|
||||
{
|
||||
float x, y, z;
|
||||
c->GetRespawnPosition(x, y, z);
|
||||
@@ -2256,7 +2256,7 @@ void Map::RemoveFromActive(Creature* c)
|
||||
RemoveFromActiveHelper(c);
|
||||
|
||||
// also allow unloading spawn grid
|
||||
if (!c->isPet() && c->GetDBTableGUIDLow())
|
||||
if (!c->IsPet() && c->GetDBTableGUIDLow())
|
||||
{
|
||||
float x, y, z;
|
||||
c->GetRespawnPosition(x, y, z);
|
||||
@@ -2325,7 +2325,7 @@ bool InstanceMap::CanEnter(Player* player)
|
||||
}
|
||||
|
||||
// allow GM's to enter
|
||||
if (player->isGameMaster())
|
||||
if (player->IsGameMaster())
|
||||
return Map::CanEnter(player);
|
||||
|
||||
// cannot enter if the instance is full (player cap), GMs don't count
|
||||
@@ -2339,7 +2339,7 @@ bool InstanceMap::CanEnter(Player* player)
|
||||
|
||||
// cannot enter while an encounter is in progress on raids
|
||||
/*Group* group = player->GetGroup();
|
||||
if (!player->isGameMaster() && group && group->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
|
||||
if (!player->IsGameMaster() && group && group->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
|
||||
if (IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
|
||||
{
|
||||
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
|
||||
@@ -2353,9 +2353,9 @@ bool InstanceMap::CanEnter(Player* player)
|
||||
|
||||
if (!playerList.isEmpty())
|
||||
for (PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
|
||||
if (Player* iPlayer = i->getSource())
|
||||
if (Player* iPlayer = i->GetSource())
|
||||
{
|
||||
if (iPlayer->isGameMaster()) // bypass GMs
|
||||
if (iPlayer->IsGameMaster()) // bypass GMs
|
||||
continue;
|
||||
if (!player->GetGroup()) // player has not group and there is someone inside, deny entry
|
||||
{
|
||||
@@ -2568,14 +2568,14 @@ bool InstanceMap::Reset(uint8 method)
|
||||
{
|
||||
// notify the players to leave the instance so it can be reset
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->SendResetFailedNotify(GetId());
|
||||
itr->GetSource()->SendResetFailedNotify(GetId());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (method == INSTANCE_RESET_GLOBAL)
|
||||
// set the homebind timer for players inside (1 minute)
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->m_InstanceValid = false;
|
||||
itr->GetSource()->m_InstanceValid = false;
|
||||
|
||||
// the unload timer is not started
|
||||
// instead the map will unload immediately after the players have left
|
||||
@@ -2609,7 +2609,7 @@ void InstanceMap::PermBindAllPlayers(Player* source)
|
||||
// group members outside the instance group don't get bound
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
{
|
||||
Player* player = itr->getSource();
|
||||
Player* player = itr->GetSource();
|
||||
// players inside an instance cannot be bound to other instances
|
||||
// some players may already be permanently bound, in this case nothing happens
|
||||
InstancePlayerBind* bind = player->GetBoundInstance(save->GetMapId(), save->GetDifficulty());
|
||||
@@ -2642,7 +2642,7 @@ void InstanceMap::UnloadAll()
|
||||
void InstanceMap::SendResetWarnings(uint32 timeLeft) const
|
||||
{
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->SendInstanceResetWarning(GetId(), itr->getSource()->GetDifficulty(IsRaid()), timeLeft);
|
||||
itr->GetSource()->SendInstanceResetWarning(GetId(), itr->GetSource()->GetDifficulty(IsRaid()), timeLeft);
|
||||
}
|
||||
|
||||
void InstanceMap::SetResetSchedule(bool on)
|
||||
@@ -2758,7 +2758,7 @@ void BattlegroundMap::RemoveAllPlayers()
|
||||
{
|
||||
if (HavePlayers())
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
if (Player* player = itr->getSource())
|
||||
if (Player* player = itr->GetSource())
|
||||
if (!player->IsBeingTeleportedFar())
|
||||
player->TeleportTo(player->GetBattlegroundEntryPoint());
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
// FIXME: mapDiff is never used
|
||||
|
||||
//Bypass checks for GMs
|
||||
if (player->isGameMaster())
|
||||
if (player->IsGameMaster())
|
||||
return true;
|
||||
|
||||
char const* mapName = entry->name;
|
||||
@@ -202,7 +202,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
||||
}
|
||||
}
|
||||
|
||||
if (!player->isAlive())
|
||||
if (!player->IsAlive())
|
||||
{
|
||||
if (Corpse* corpse = player->GetCorpse())
|
||||
{
|
||||
|
||||
@@ -225,7 +225,7 @@ void PhaseMgr::SetCustomPhase(uint32 phaseMask)
|
||||
|
||||
uint32 PhaseData::GetCurrentPhasemask() const
|
||||
{
|
||||
if (player->isGameMaster())
|
||||
if (player->IsGameMaster())
|
||||
return uint32(PHASEMASK_ANYWHERE);
|
||||
|
||||
if (_CustomPhasemask)
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Trinity
|
||||
uint32 gain;
|
||||
|
||||
if (u->GetTypeId() == TYPEID_UNIT &&
|
||||
(((Creature*)u)->isTotem() || ((Creature*)u)->isPet() ||
|
||||
(((Creature*)u)->IsTotem() || ((Creature*)u)->IsPet() ||
|
||||
(((Creature*)u)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ||
|
||||
((Creature*)u)->GetCreatureTemplate()->type == CREATURE_TYPE_CRITTER))
|
||||
gain = 0;
|
||||
|
||||
@@ -32,5 +32,5 @@ void FollowerReference::targetObjectDestroyLink()
|
||||
|
||||
void FollowerReference::sourceObjectDestroyLink()
|
||||
{
|
||||
getSource()->stopFollowing();
|
||||
GetSource()->stopFollowing();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ void ConfusedMovementGenerator<T>::DoInitialize(T* unit)
|
||||
unit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit->GetPosition(i_x, i_y, i_z);
|
||||
|
||||
if (!unit->isAlive() || unit->IsStopped())
|
||||
if (!unit->IsAlive() || unit->IsStopped())
|
||||
return;
|
||||
|
||||
unit->StopMoving();
|
||||
@@ -49,7 +49,7 @@ void ConfusedMovementGenerator<T>::DoReset(T* unit)
|
||||
{
|
||||
i_nextMoveTime.Reset(0);
|
||||
|
||||
if (!unit->isAlive() || unit->IsStopped())
|
||||
if (!unit->IsAlive() || unit->IsStopped())
|
||||
return;
|
||||
|
||||
unit->StopMoving();
|
||||
@@ -117,8 +117,8 @@ void ConfusedMovementGenerator<Creature>::DoFinalize(Creature* unit)
|
||||
{
|
||||
unit->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
unit->ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE);
|
||||
if (unit->getVictim())
|
||||
unit->SetTarget(unit->getVictim()->GetGUID());
|
||||
if (unit->GetVictim())
|
||||
unit->SetTarget(unit->GetVictim()->GetGUID());
|
||||
}
|
||||
|
||||
template void ConfusedMovementGenerator<Player>::DoInitialize(Player*);
|
||||
|
||||
@@ -125,8 +125,8 @@ void FleeingMovementGenerator<Creature>::DoFinalize(Creature* owner)
|
||||
{
|
||||
owner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner->ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
if (owner->getVictim())
|
||||
owner->SetTarget(owner->getVictim()->GetGUID());
|
||||
if (owner->GetVictim())
|
||||
owner->SetTarget(owner->GetVictim()->GetGUID());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -138,7 +138,7 @@ void FleeingMovementGenerator<T>::DoReset(T* owner)
|
||||
template<class T>
|
||||
bool FleeingMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
||||
{
|
||||
if (!owner || !owner->isAlive())
|
||||
if (!owner || !owner->IsAlive())
|
||||
return false;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
@@ -169,9 +169,9 @@ void TimedFleeingMovementGenerator::Finalize(Unit* owner)
|
||||
{
|
||||
owner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
|
||||
owner->ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
|
||||
if (Unit* victim = owner->getVictim())
|
||||
if (Unit* victim = owner->GetVictim())
|
||||
{
|
||||
if (owner->isAlive())
|
||||
if (owner->IsAlive())
|
||||
{
|
||||
owner->AttackStop();
|
||||
owner->ToCreature()->AI()->AttackStart(victim);
|
||||
@@ -181,7 +181,7 @@ void TimedFleeingMovementGenerator::Finalize(Unit* owner)
|
||||
|
||||
bool TimedFleeingMovementGenerator::Update(Unit* owner, uint32 time_diff)
|
||||
{
|
||||
if (!owner->isAlive())
|
||||
if (!owner->IsAlive())
|
||||
return false;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
|
||||
@@ -41,8 +41,8 @@ void RotateMovementGenerator::Initialize(Unit* owner)
|
||||
if (!owner->IsStopped())
|
||||
owner->StopMoving();
|
||||
|
||||
if (owner->getVictim())
|
||||
owner->SetInFront(owner->getVictim());
|
||||
if (owner->GetVictim())
|
||||
owner->SetInFront(owner->GetVictim());
|
||||
|
||||
owner->AddUnitState(UNIT_STATE_ROTATING);
|
||||
owner->AttackStop();
|
||||
|
||||
@@ -125,7 +125,7 @@ void AssistanceMovementGenerator::Finalize(Unit* unit)
|
||||
{
|
||||
unit->ToCreature()->SetNoCallAssistance(false);
|
||||
unit->ToCreature()->CallAssistance();
|
||||
if (unit->isAlive())
|
||||
if (unit->IsAlive())
|
||||
unit->GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY));
|
||||
}
|
||||
|
||||
@@ -140,9 +140,9 @@ void EffectMovementGenerator::Finalize(Unit* unit)
|
||||
return;
|
||||
|
||||
// Need restore previous movement since we have no proper states system
|
||||
if (unit->isAlive() && !unit->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING))
|
||||
if (unit->IsAlive() && !unit->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING))
|
||||
{
|
||||
if (Unit* victim = unit->getVictim())
|
||||
if (Unit* victim = unit->GetVictim())
|
||||
unit->GetMotionMaster()->MoveChase(victim);
|
||||
else
|
||||
unit->GetMotionMaster()->Initialize();
|
||||
|
||||
@@ -116,7 +116,7 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
|
||||
template<>
|
||||
void RandomMovementGenerator<Creature>::DoInitialize(Creature* creature)
|
||||
{
|
||||
if (!creature->isAlive())
|
||||
if (!creature->IsAlive())
|
||||
return;
|
||||
|
||||
if (!wander_distance)
|
||||
|
||||
@@ -58,7 +58,7 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
|
||||
// be (GetCombatReach() + i_offset) away.
|
||||
// Only applies when i_target is pet's owner otherwise pets and mobs end up
|
||||
// doing a "dance" while fighting
|
||||
if (owner->isPet() && i_target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (owner->IsPet() && i_target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
dist = i_target->GetCombatReach();
|
||||
size = i_target->GetCombatReach() - i_target->GetObjectSize();
|
||||
@@ -89,7 +89,7 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
|
||||
i_path = new PathGenerator(owner);
|
||||
|
||||
// allow pets to use shortcut if no path found when following their master
|
||||
bool forceDest = (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->isPet()
|
||||
bool forceDest = (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsPet()
|
||||
&& owner->HasUnitState(UNIT_STATE_FOLLOW));
|
||||
|
||||
bool result = i_path->CalculatePath(x, y, z, forceDest);
|
||||
@@ -122,7 +122,7 @@ bool TargetedMovementGeneratorMedium<T, D>::DoUpdate(T* owner, uint32 time_diff)
|
||||
if (!i_target.isValid() || !i_target->IsInWorld())
|
||||
return false;
|
||||
|
||||
if (!owner || !owner->isAlive())
|
||||
if (!owner || !owner->IsAlive())
|
||||
return false;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_NOT_MOVE))
|
||||
@@ -252,7 +252,7 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature* owner)
|
||||
{
|
||||
// pet only sync speed with owner
|
||||
/// Make sure we are not in the process of a map change (IsInWorld)
|
||||
if (!owner->isPet() || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
|
||||
if (!owner->IsPet() || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
|
||||
return;
|
||||
|
||||
owner->UpdateSpeed(MOVE_RUN, true);
|
||||
|
||||
@@ -83,7 +83,7 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo
|
||||
static void _clearUnitStateMove(T* u) { u->ClearUnitState(UNIT_STATE_CHASE_MOVE); }
|
||||
static void _addUnitStateMove(T* u) { u->AddUnitState(UNIT_STATE_CHASE_MOVE); }
|
||||
bool EnableWalking() const { return false;}
|
||||
bool _lostTarget(T* u) const { return u->getVictim() != this->GetTarget(); }
|
||||
bool _lostTarget(T* u) const { return u->GetVictim() != this->GetTarget(); }
|
||||
void _reachTarget(T*);
|
||||
};
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
BuildShortcut();
|
||||
bool path = _sourceUnit->GetTypeId() == TYPEID_UNIT && _sourceUnit->ToCreature()->CanFly();
|
||||
|
||||
bool waterPath = _sourceUnit->GetTypeId() == TYPEID_UNIT && _sourceUnit->ToCreature()->canSwim();
|
||||
bool waterPath = _sourceUnit->GetTypeId() == TYPEID_UNIT && _sourceUnit->ToCreature()->CanSwim();
|
||||
if (waterPath)
|
||||
{
|
||||
// Check both start and end points, if they're both in water, then we can *safely* let the creature move
|
||||
@@ -207,7 +207,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
if (_sourceUnit->GetBaseMap()->IsUnderWater(p.x, p.y, p.z))
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_MAPS, "++ BuildPolyPath :: underWater case\n");
|
||||
if (owner->canSwim())
|
||||
if (owner->CanSwim())
|
||||
buildShotrcut = true;
|
||||
}
|
||||
else
|
||||
@@ -511,11 +511,11 @@ void PathGenerator::CreateFilter()
|
||||
if (_sourceUnit->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Creature* creature = (Creature*)_sourceUnit;
|
||||
if (creature->canWalk())
|
||||
if (creature->CanWalk())
|
||||
includeFlags |= NAV_GROUND; // walk
|
||||
|
||||
// creatures don't take environmental damage
|
||||
if (creature->canSwim())
|
||||
if (creature->CanSwim())
|
||||
includeFlags |= (NAV_WATER | NAV_MAGMA | NAV_SLIME); // swim
|
||||
}
|
||||
else // assume Player
|
||||
|
||||
@@ -441,7 +441,7 @@ void OutdoorPvP::HandleKill(Player* killer, Unit* killed)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* groupGuy = itr->getSource();
|
||||
Player* groupGuy = itr->GetSource();
|
||||
|
||||
if (!groupGuy)
|
||||
continue;
|
||||
|
||||
@@ -579,7 +579,7 @@ void Map::ScriptsProcess()
|
||||
}
|
||||
|
||||
// quest id and flags checked at script loading
|
||||
if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
|
||||
if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->IsAlive()) &&
|
||||
(step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(player, float(step.script->QuestExplored.Distance))))
|
||||
player->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID);
|
||||
else
|
||||
|
||||
@@ -489,7 +489,7 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
bg->EventPlayerLoggedOut(_player);
|
||||
|
||||
///- Teleport to home if the player is in an invalid instance
|
||||
if (!_player->m_InstanceValid && !_player->isGameMaster())
|
||||
if (!_player->m_InstanceValid && !_player->IsGameMaster())
|
||||
_player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation());
|
||||
|
||||
sOutdoorPvPMgr->HandlePlayerLeaveZone(_player, _player->GetZoneId());
|
||||
|
||||
@@ -112,7 +112,7 @@ void LoadSkillExtraItemTable()
|
||||
TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax)
|
||||
bool CanCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax)
|
||||
{
|
||||
// get the info for the specified spell
|
||||
SkillExtraItemMap::const_iterator ret = SkillExtraItemStore.find(spellId);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// predef classes used in functions
|
||||
class Player;
|
||||
// returns true and sets the appropriate info if the player can create extra items with the given spellId
|
||||
bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax);
|
||||
bool CanCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax);
|
||||
// function to load the extra item creation info from DB
|
||||
void LoadSkillExtraItemTable();
|
||||
#endif
|
||||
|
||||
@@ -1588,7 +1588,7 @@ void AuraEffect::HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 m
|
||||
target->SetHealth(1);
|
||||
}
|
||||
// die at aura end
|
||||
else if (target->isAlive())
|
||||
else if (target->IsAlive())
|
||||
// call functions which may have additional effects after chainging state of unit
|
||||
target->setDeathState(JUST_DIED);
|
||||
}
|
||||
@@ -2787,11 +2787,11 @@ void AuraEffect::HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 m
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (!target->isAlive() || target->GetTypeId() != TYPEID_PLAYER)
|
||||
if (!target->IsAlive() || target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
if (caster && caster->isAlive())
|
||||
if (caster && caster->IsAlive())
|
||||
target->getHostileRefManager().addTempThreat((float)GetAmount(), apply);
|
||||
}
|
||||
|
||||
@@ -2802,11 +2802,11 @@ void AuraEffect::HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (!target->isAlive() || !target->CanHaveThreatList())
|
||||
if (!target->IsAlive() || !target->CanHaveThreatList())
|
||||
return;
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster || !caster->isAlive())
|
||||
if (!caster || !caster->IsAlive())
|
||||
return;
|
||||
|
||||
if (apply)
|
||||
@@ -2915,7 +2915,7 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode,
|
||||
// return;
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
if (target->GetTypeId() != TYPEID_UNIT || !target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() != TYPEID_UNIT || !target->ToCreature()->IsPet())
|
||||
return;
|
||||
|
||||
Pet* pet = target->ToPet();
|
||||
@@ -2944,7 +2944,7 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode,
|
||||
// Follow owner only if not fighting or owner didn't click "stay" at new location
|
||||
// This may be confusing because pet bar shows "stay" when under the spell but it retains
|
||||
// the "follow" flag. Player MUST click "stay" while under the spell.
|
||||
if (!pet->getVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY))
|
||||
if (!pet->GetVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY))
|
||||
{
|
||||
pet->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, pet->GetFollowAngle());
|
||||
}
|
||||
@@ -3589,7 +3589,7 @@ void AuraEffect::HandleAuraModResistance(AuraApplication const* aurApp, uint8 mo
|
||||
if (GetMiscValue() & int32(1<<x))
|
||||
{
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
target->ApplyResistanceBuffModsMod(SpellSchools(x), GetAmount() > 0, (float)GetAmount(), apply);
|
||||
}
|
||||
}
|
||||
@@ -3606,7 +3606,7 @@ void AuraEffect::HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, u
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
//pets only have base armor
|
||||
if (target->ToCreature()->isPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
if (target->ToCreature()->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(GetAmount()), apply);
|
||||
}
|
||||
else
|
||||
@@ -3631,7 +3631,7 @@ void AuraEffect::HandleModResistancePercent(AuraApplication const* aurApp, uint8
|
||||
if (GetMiscValue() & int32(1<<i))
|
||||
{
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
{
|
||||
target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, (float)GetAmount(), apply);
|
||||
target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, (float)GetAmount(), apply);
|
||||
@@ -3651,7 +3651,7 @@ void AuraEffect::HandleModBaseResistance(AuraApplication const* aurApp, uint8 mo
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
//only pets have base stats
|
||||
if (target->ToCreature()->isPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
if (target->ToCreature()->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
target->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(GetAmount()), apply);
|
||||
}
|
||||
else
|
||||
@@ -3704,7 +3704,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bo
|
||||
{
|
||||
//target->ApplyStatMod(Stats(i), m_amount, apply);
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
target->ApplyStatBuffMod(Stats(i), (float)GetAmount(), apply);
|
||||
}
|
||||
}
|
||||
@@ -3817,14 +3817,14 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8
|
||||
|
||||
// save current health state
|
||||
float healthPct = target->GetHealthPct();
|
||||
bool alive = target->isAlive();
|
||||
bool alive = target->IsAlive();
|
||||
|
||||
for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
|
||||
{
|
||||
if (GetMiscValueB() & 1 << i || !GetMiscValueB()) // 0 is also used for all stats
|
||||
{
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
target->ApplyStatPercentBuffMod(Stats(i), float(GetAmount()), apply);
|
||||
}
|
||||
}
|
||||
@@ -4016,7 +4016,7 @@ void AuraEffect::HandleAuraModIncreaseHealthPercent(AuraApplication const* aurAp
|
||||
// Unit will keep hp% after MaxHealth being modified if unit is alive.
|
||||
float percent = target->GetHealthPct();
|
||||
target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(GetAmount()), apply);
|
||||
if (target->isAlive())
|
||||
if (target->IsAlive())
|
||||
target->SetHealth(target->CountPctFromMaxHealth(int32(percent)));
|
||||
}
|
||||
|
||||
@@ -4732,7 +4732,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
// AT REMOVE
|
||||
else
|
||||
{
|
||||
if ((GetSpellInfo()->IsQuestTame()) && caster && caster->isAlive() && target->isAlive())
|
||||
if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive())
|
||||
{
|
||||
uint32 finalSpelId = 0;
|
||||
switch (GetId())
|
||||
@@ -5486,12 +5486,12 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
// Feeding Frenzy Rank 1
|
||||
case 53511:
|
||||
if (target->getVictim() && target->getVictim()->HealthBelowPct(35))
|
||||
if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
|
||||
target->CastSpell(target, 60096, true, 0, this);
|
||||
return;
|
||||
// Feeding Frenzy Rank 2
|
||||
case 53512:
|
||||
if (target->getVictim() && target->getVictim()->HealthBelowPct(35))
|
||||
if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
|
||||
target->CastSpell(target, 60097, true, 0, this);
|
||||
return;
|
||||
default:
|
||||
@@ -5560,10 +5560,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
{
|
||||
switch (auraId)
|
||||
{
|
||||
// Thaumaturgy Channel
|
||||
case 9712:
|
||||
triggerSpellId = 21029;
|
||||
break;
|
||||
// Brood Affliction: Bronze
|
||||
case 23170:
|
||||
triggerSpellId = 23171;
|
||||
@@ -5856,7 +5852,7 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit*
|
||||
|
||||
void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
if (!caster || !target->isAlive())
|
||||
if (!caster || !target->IsAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
@@ -5992,7 +5988,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
|
||||
|
||||
void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
if (!caster || !target->isAlive())
|
||||
if (!caster || !target->IsAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
@@ -6047,10 +6043,10 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
|
||||
damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist);
|
||||
if (damage)
|
||||
procVictim |= PROC_FLAG_TAKEN_DAMAGE;
|
||||
if (caster->isAlive())
|
||||
if (caster->IsAlive())
|
||||
caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo());
|
||||
int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
|
||||
if (caster->isAlive())
|
||||
if (caster->IsAlive())
|
||||
{
|
||||
float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
|
||||
|
||||
@@ -6064,7 +6060,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
|
||||
|
||||
void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
if (!caster || !caster->isAlive() || !target->isAlive())
|
||||
if (!caster || !caster->IsAlive() || !target->IsAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
@@ -6092,7 +6088,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster)
|
||||
|
||||
void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
if (!caster || !target->isAlive())
|
||||
if (!caster || !target->IsAlive())
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
@@ -6102,7 +6098,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
}
|
||||
|
||||
// heal for caster damage (must be alive)
|
||||
if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL && !caster->isAlive())
|
||||
if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL && !caster->IsAlive())
|
||||
return;
|
||||
|
||||
// don't regen when permanent aura target has full power
|
||||
@@ -6200,7 +6196,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
|
||||
{
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
|
||||
if (!caster || !caster->isAlive() || !target->isAlive() || target->getPowerType() != powerType)
|
||||
if (!caster || !caster->IsAlive() || !target->IsAlive() || target->getPowerType() != powerType)
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
@@ -6269,7 +6265,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
||||
else
|
||||
powerType = Powers(GetMiscValue());
|
||||
|
||||
if (!target->isAlive() || !target->GetMaxPower(powerType))
|
||||
if (!target->IsAlive() || !target->GetMaxPower(powerType))
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
@@ -6300,7 +6296,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
||||
{
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
|
||||
if (!target->isAlive() || !target->GetMaxPower(powerType))
|
||||
if (!target->IsAlive() || !target->GetMaxPower(powerType))
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
@@ -6332,7 +6328,7 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con
|
||||
{
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
|
||||
if (!caster || !target->isAlive() || target->getPowerType() != powerType)
|
||||
if (!caster || !target->IsAlive() || target->getPowerType() != powerType)
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo()))
|
||||
|
||||
@@ -544,7 +544,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
// persistent area aura does not hit flying targets
|
||||
if (GetType() == DYNOBJ_AURA_TYPE)
|
||||
{
|
||||
if (itr->first->isInFlight())
|
||||
if (itr->first->IsInFlight())
|
||||
addUnit = false;
|
||||
}
|
||||
// unit auras can not stack with each other
|
||||
|
||||
@@ -650,7 +650,7 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
||||
}
|
||||
// try to use attacked unit as a target
|
||||
else if ((m_caster->GetTypeId() == TYPEID_UNIT) && neededTargets & (TARGET_FLAG_UNIT_ENEMY | TARGET_FLAG_UNIT))
|
||||
unit = m_caster->getVictim();
|
||||
unit = m_caster->GetVictim();
|
||||
|
||||
// didn't find anything - let's use self as target
|
||||
if (!unit && neededTargets & (TARGET_FLAG_UNIT_RAID | TARGET_FLAG_UNIT_PARTY | TARGET_FLAG_UNIT_ALLY))
|
||||
@@ -1166,7 +1166,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
||||
case TYPEID_PLAYER:
|
||||
{
|
||||
Unit* unitTarget = (*itr)->ToUnit();
|
||||
if (unitTarget->isAlive() || !playerCaster->isHonorOrXPTarget(unitTarget)
|
||||
if (unitTarget->IsAlive() || !playerCaster->isHonorOrXPTarget(unitTarget)
|
||||
|| ((unitTarget->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0)
|
||||
|| (unitTarget->GetDisplayId() != unitTarget->GetNativeDisplayId()))
|
||||
break;
|
||||
@@ -1523,7 +1523,7 @@ void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImpli
|
||||
target = m_caster->GetGuardianPet();
|
||||
break;
|
||||
case TARGET_UNIT_SUMMONER:
|
||||
if (m_caster->isSummon())
|
||||
if (m_caster->IsSummon())
|
||||
target = m_caster->ToTempSummon()->GetSummoner();
|
||||
break;
|
||||
case TARGET_UNIT_VEHICLE:
|
||||
@@ -2098,7 +2098,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const* /*triggeredByAura*/)
|
||||
m_procEx |= PROC_EX_INTERNAL_TRIGGERED;
|
||||
}
|
||||
// Totem casts require spellfamilymask defined in spell_proc_event to proc
|
||||
if (m_originalCaster && m_caster != m_originalCaster && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isTotem() && m_caster->IsControlledByPlayer())
|
||||
if (m_originalCaster && m_caster != m_originalCaster && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsTotem() && m_caster->IsControlledByPlayer())
|
||||
m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY;
|
||||
}
|
||||
|
||||
@@ -2155,7 +2155,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
|
||||
targetInfo.targetGUID = targetGUID; // Store target GUID
|
||||
targetInfo.effectMask = effectMask; // Store all effects not immune
|
||||
targetInfo.processed = false; // Effects not apply on target
|
||||
targetInfo.alive = target->isAlive();
|
||||
targetInfo.alive = target->IsAlive();
|
||||
targetInfo.damage = 0;
|
||||
targetInfo.crit = false;
|
||||
targetInfo.scaleAura = false;
|
||||
@@ -2354,7 +2354,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
return;
|
||||
}
|
||||
|
||||
if (unit->isAlive() != target->alive)
|
||||
if (unit->IsAlive() != target->alive)
|
||||
return;
|
||||
|
||||
if (getState() == SPELL_STATE_DELAYED && !m_spellInfo->IsPositive() && (getMSTime() - target->timeDelay) <= unit->m_lastSanctuaryTime)
|
||||
@@ -2561,7 +2561,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
|
||||
// cast at creature (or GO) quest objectives update at successful cast finished (+channel finished)
|
||||
// ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm...)
|
||||
if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !spellHitTarget->ToCreature()->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive())
|
||||
if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !spellHitTarget->ToCreature()->IsPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive())
|
||||
if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id);
|
||||
}
|
||||
@@ -2643,7 +2643,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
m_caster->ToPlayer()->UpdatePvP(true);
|
||||
}
|
||||
if (unit->isInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO))
|
||||
if (unit->IsInCombat() && !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO))
|
||||
{
|
||||
m_caster->SetInCombatState(unit->GetCombatTimer() > 0, unit);
|
||||
unit->getHostileRefManager().threatAssist(m_caster, 0.0f);
|
||||
@@ -3185,7 +3185,7 @@ void Spell::cast(bool skipCheck)
|
||||
// This prevents spells such as Hunter's Mark from triggering pet attack
|
||||
if (this->GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE)
|
||||
if (Pet* playerPet = playerCaster->GetPet())
|
||||
if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT))
|
||||
if (playerPet->IsAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT))
|
||||
playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit());
|
||||
}
|
||||
|
||||
@@ -3541,7 +3541,7 @@ void Spell::_handle_finish_phase()
|
||||
}
|
||||
|
||||
if (m_caster->m_extraAttacks && GetSpellInfo()->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
m_caster->HandleProcExtraAttackFor(m_caster->getVictim());
|
||||
m_caster->HandleProcExtraAttackFor(m_caster->GetVictim());
|
||||
|
||||
/// @todo trigger proc phase finish here
|
||||
}
|
||||
@@ -3707,7 +3707,7 @@ void Spell::finish(bool ok)
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isSummon())
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsSummon())
|
||||
{
|
||||
// Unsummon statue
|
||||
uint32 spell = m_caster->GetUInt32Value(UNIT_CREATED_BY_SPELL);
|
||||
@@ -3906,7 +3906,7 @@ void Spell::SendSpellStart()
|
||||
castFlags |= CAST_FLAG_PENDING;
|
||||
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsPet()))
|
||||
&& m_spellInfo->PowerType != POWER_HEALTH)
|
||||
castFlags |= CAST_FLAG_POWER_LEFT_SELF;
|
||||
|
||||
@@ -3993,7 +3993,7 @@ void Spell::SendSpellGo()
|
||||
castFlags |= CAST_FLAG_PENDING;
|
||||
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsPet()))
|
||||
&& m_spellInfo->PowerType != POWER_HEALTH)
|
||||
castFlags |= CAST_FLAG_POWER_LEFT_SELF; // should only be sent to self, but the current messaging doesn't make that possible
|
||||
|
||||
@@ -4766,7 +4766,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT
|
||||
SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
// check death state
|
||||
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE) && !((m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD) || (IsTriggered() && !m_triggeredByAuraSpell)))
|
||||
if (!m_caster->IsAlive() && !(m_spellInfo->Attributes & SPELL_ATTR0_PASSIVE) && !((m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_DEAD) || (IsTriggered() && !m_triggeredByAuraSpell)))
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
// check cooldowns to prevent cheating
|
||||
@@ -4873,7 +4873,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_spellInfo->ExcludeCasterAuraSpell && m_caster->HasAura(sSpellMgr->GetSpellIdForDifficulty(m_spellInfo->ExcludeCasterAuraSpell, m_caster)))
|
||||
return SPELL_FAILED_CASTER_AURASTATE;
|
||||
|
||||
if (reqCombat && m_caster->isInCombat() && !m_spellInfo->CanBeUsedInCombat())
|
||||
if (reqCombat && m_caster->IsInCombat() && !m_spellInfo->CanBeUsedInCombat())
|
||||
return SPELL_FAILED_AFFECTING_COMBAT;
|
||||
}
|
||||
|
||||
@@ -4991,7 +4991,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
}
|
||||
|
||||
// zone check
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT || !m_caster->ToPlayer()->isGameMaster())
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT || !m_caster->ToPlayer()->IsGameMaster())
|
||||
{
|
||||
uint32 zone, area;
|
||||
m_caster->GetZoneAndAreaId(zone, area);
|
||||
@@ -5006,7 +5006,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_caster->IsMounted() && m_caster->GetTypeId() == TYPEID_PLAYER && !(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE) &&
|
||||
!m_spellInfo->IsPassive() && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED))
|
||||
{
|
||||
if (m_caster->isInFlight())
|
||||
if (m_caster->IsInFlight())
|
||||
return SPELL_FAILED_NOT_ON_TAXI;
|
||||
else
|
||||
return SPELL_FAILED_NOT_MOUNTED;
|
||||
@@ -5167,7 +5167,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (!pet->GetCurrentFoodBenefitLevel(foodItem->GetTemplate()->ItemLevel))
|
||||
return SPELL_FAILED_FOOD_LOWLEVEL;
|
||||
|
||||
if (m_caster->isInCombat() || pet->isInCombat())
|
||||
if (m_caster->IsInCombat() || pet->IsInCombat())
|
||||
return SPELL_FAILED_AFFECTING_COMBAT;
|
||||
|
||||
break;
|
||||
@@ -5309,7 +5309,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
Creature* pet = m_caster->GetGuardianPet();
|
||||
|
||||
if (pet && pet->isAlive())
|
||||
if (pet && pet->IsAlive())
|
||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
||||
|
||||
break;
|
||||
@@ -5539,7 +5539,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
// not allow cast fly spells if not have req. skills (all spells is self target)
|
||||
// allow always ghost flight spells
|
||||
if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->isAlive())
|
||||
if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->IsAlive())
|
||||
{
|
||||
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId());
|
||||
if (AreaTableEntry const* area = GetAreaEntryByAreaID(m_originalCaster->GetAreaId()))
|
||||
@@ -5609,7 +5609,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
||||
|
||||
// dead owner (pets still alive when owners ressed?)
|
||||
if (Unit* owner = m_caster->GetCharmerOrOwner())
|
||||
if (!owner->isAlive())
|
||||
if (!owner->IsAlive())
|
||||
return SPELL_FAILED_CASTER_DEAD;
|
||||
|
||||
if (!target && m_targets.GetUnitTarget())
|
||||
@@ -6736,7 +6736,7 @@ bool SpellEvent::IsDeletable() const
|
||||
|
||||
bool Spell::IsValidDeadOrAliveTarget(Unit const* target) const
|
||||
{
|
||||
if (target->isAlive())
|
||||
if (target->IsAlive())
|
||||
return !m_spellInfo->IsRequiringDeadTarget();
|
||||
if (m_spellInfo->IsAllowingDeadTarget())
|
||||
return true;
|
||||
@@ -7359,19 +7359,19 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target)
|
||||
switch (_targetSelectionType)
|
||||
{
|
||||
case TARGET_CHECK_ENEMY:
|
||||
if (unitTarget->isTotem())
|
||||
if (unitTarget->IsTotem())
|
||||
return false;
|
||||
if (!_caster->_IsValidAttackTarget(unitTarget, _spellInfo))
|
||||
return false;
|
||||
break;
|
||||
case TARGET_CHECK_ALLY:
|
||||
if (unitTarget->isTotem())
|
||||
if (unitTarget->IsTotem())
|
||||
return false;
|
||||
if (!_caster->_IsValidAssistTarget(unitTarget, _spellInfo))
|
||||
return false;
|
||||
break;
|
||||
case TARGET_CHECK_PARTY:
|
||||
if (unitTarget->isTotem())
|
||||
if (unitTarget->IsTotem())
|
||||
return false;
|
||||
if (!_caster->_IsValidAssistTarget(unitTarget, _spellInfo))
|
||||
return false;
|
||||
@@ -7383,7 +7383,7 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target)
|
||||
return false;
|
||||
// nobreak;
|
||||
case TARGET_CHECK_RAID:
|
||||
if (unitTarget->isTotem())
|
||||
if (unitTarget->IsTotem())
|
||||
return false;
|
||||
if (!_caster->_IsValidAssistTarget(unitTarget, _spellInfo))
|
||||
return false;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user