Merge branch 'master' into 4.3.4

Conflicts:
	src/server/game/AI/CoreAI/GameObjectAI.h
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/Battlegrounds/Battleground.cpp
	src/server/game/Conditions/ConditionMgr.h
	src/server/game/Entities/Pet/Pet.h
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Entities/Unit/Unit.h
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/GroupHandler.cpp
	src/server/game/Handlers/LootHandler.cpp
	src/server/game/Miscellaneous/SharedDefines.h
	src/server/game/Spells/Auras/SpellAuraEffects.cpp
	src/server/game/Spells/SpellEffects.cpp
	src/server/scripts/Commands/cs_modify.cpp
	src/server/scripts/Commands/cs_reload.cpp
	src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
This commit is contained in:
Spp
2012-11-20 16:01:31 +01:00
305 changed files with 6605 additions and 969 deletions
@@ -0,0 +1,539 @@
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 856: NPC Jezelle Pruitt
-- Update AI in Creature_Template to Smart AI
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=5702;
-- Delete static spawns of Jezelles Imp,Voidwalker and Felhunter.
DELETE FROM `creature` WHERE `id` IN (5726,5729,5730);
-- Smart Script For Jezelle Pruitt
DELETE FROM `smart_scripts` WHERE `entryorguid`=5702;
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
(5702,0,0,0,1,0,100,0,0,0,235000,235000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 0"),
(5702,0,1,0,1,0,100,0,10000,10000,235000,235000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 1"),
(5702,0,2,0,1,0,100,0,13000,13000,235000,235000,11,8677,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Cast Summon Effect"),
(5702,0,3,0,1,0,100,0,18000,18000,235000,235000,12,5730,2,30000,0,0,0,8,0,0,0,1793.26,128.034,-63.8432,3.14159,"Jezelle Pruitt - OOC - Spawn Jezelle's Imp"),
(5702,0,4,0,1,0,100,0,20000,20000,235000,235000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 2"),
(5702,0,5,0,1,0,100,0,50000,50000,235000,235000,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 3"),
(5702,0,6,0,1,0,100,0,53000,53000,235000,235000,11,8677,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Cast Summon Effect"),
(5702,0,7,0,1,0,100,0,58000,58000,235000,235000,12,5729,2,30000,0,0,0,8,0,0,0,1793.26,128.034,-63.8432,3.14159,"Jezelle Pruitt - OOC - Spawn Jezelle's Voidwalker"),
(5702,0,8,0,1,0,100,0,60000,60000,235000,235000,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 4"),
(5702,0,9,0,1,0,100,0,90000,90000,235000,235000,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 5"),
(5702,0,10,0,1,0,100,0,93000,93000,235000,235000,11,8677,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Cast Summon Effect"),
(5702,0,11,0,1,0,100,0,98000,98000,235000,235000,12,5728,2,30000,0,0,0,8,0,0,0,1793.26,128.034,-63.8432,3.14159,"Jezelle Pruitt - OOC - Spawn Jezelle's Succubus"),
(5702,0,12,0,1,0,100,0,100000,100000,235000,235000,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 6"),
(5702,0,13,0,1,0,100,0,130000,130000,235000,235000,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 7"),
(5702,0,14,0,1,0,100,0,133000,133000,235000,235000,11,8677,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Cast Summon Effect"),
(5702,0,15,0,1,0,100,0,138000,138000,235000,235000,12,5726,2,30000,0,0,0,8,0,0,0,1793.26,128.034,-63.8432,3.14159,"Jezelle Pruitt - OOC - Spawn Jezelle's FelHunter"),
(5702,0,16,0,1,0,100,0,140000,140000,235000,235000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 8"),
(5702,0,17,0,1,0,100,0,170000,170000,235000,235000,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 9"),
(5702,0,18,0,1,0,100,0,173000,173000,235000,235000,11,8677,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Cast Summon Effect"),
(5702,0,19,0,1,0,100,0,178000,178000,235000,235000,12,5727,2,30000,0,0,0,8,0,0,0,1793.26,128.034,-63.8432,3.14159,"Jezelle Pruitt - OOC - Spawn Jezelle's Felsteed"),
(5702,0,20,0,1,0,100,0,180000,180000,235000,235000,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 10"),
(5702,0,21,0,1,0,100,0,210000,210000,235000,235000,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,"Jezelle Pruitt - OOC - Say Line 11");
-- Jezelle Pruitt Texts
DELETE FROM `creature_text` WHERE `entry`=5702;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(5702,0,0, 'If you''re here, then it means you are prepared to begin the study of summoning demonic cohorts to do your bidding. We will start with the lowliest creatures you will be able to call and continue from there. Let us begin.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,1,0, 'The easiest creature for you to summon is the imp. You should already be able to bring forth this minion but for completeness'' sake I will start with him.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,2,0, 'This foul little beast is the imp. It is small and weak, making it almost useless as a meatshield, and its damage output is mediocre at best. This creature is best used for support of a larger group.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,3,0, 'Now that you have had a chance to study imp, let us move on the next minion you will be able to summon, the voidwalker.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,4,0, 'This demonic entity is known as the Voidwalker. Its strength and endurance are significant, making it ideal for defence. Send it to attack your enemy, then use it as a shield while you use your spells and abilities to drain away your opponent''s life.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,5,0, 'If you''ve never seen one, it is a sight to behold. A very impressive creature both on and off the field of battle. Next let us take a look at what I am sure all you male students have been waiting for. The succubus.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,6,0, 'All right now. Asside from the obvious distractions a minion like this will provide against your more masculine foes, she is also capable of dealing out impressive amounts of damage. However, her fragile endurance makes her almost useless as a shield.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,7,0, 'Study hard and you might one day be able to summon one on your own, but for now it''s time to move on to the felhunter.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,8,0, 'What you see before you is a felhunter. This creature''s natural talents include spell lock and other abilities which make it unequalled when facing a magically attuned opponent.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,9,0, 'When facing a spellcaster of any kind, this feral beast will be your best friend. Now, let us take a look at something a bit different. This next creature will aid your travels and make your future journeys much easier. Let''s take a look at a felsteed.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,10,0, 'I doubt you have had much occasion to see such a creature. These demonic equines will make your travels much faster by acting as your mount as long as you control them. However, they are difficult to control, so be sure you are ready before attempting it.',12,33,100,0,0,0, 'Jezelle Pruitt'),
(5702,11,0, 'There you have it. Our lesson on summoning has come to an end. A new class will begin shortly, so if you wish to brush up, feel free to stay around.',12,33,100,0,0,0, 'Jezelle Pruitt');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 1539: Standards and Practices
SET @GUID := 371;
DELETE FROM `gameobject` WHERE `id`=182263;
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
(22718,182263,530,1,1,-2532.99,6306.90,14.0280,2.81871,0,0,0.986996,0.160743,181,100,1),-- already in TDB
(371,182263,530,1,1,-2474.44,6111.16,91.7629,3.66388,0,0,0.966096,-0.258184,181,100,1),
(379,182263,530,1,1,-2533.21,6168.56,59.9387,3.75028,0,0,0.954044,-0.299666,181,100,1);
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 1977: An Improper Burial
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=39189;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,39189,0,0,31,0,3,21846,0,0,0,'',"set Sha'tari Torch implicit target to Slain Auchenai Warrior"),
(13,1,39189,0,1,31,0,3,21859,0,0,0,'',"set Sha'tari Torch implicit target to Slain Sha'tar Vindicator");
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 2350: Postponing the Inevitable
-- Mark Quest Invisman - Buying Time (26105) as trigger
UPDATE `creature_template` SET `flags_extra` = 128 WHERE `entry` = 26105;
-- Add event_script for Activate Interdimensional Refabricator (46547) Effect #2 http://old.wowhead.com/spell=46547
-- Any idea how can this be made with SAI?
DELETE FROM `event_scripts` WHERE id = 17364;
INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
(17364,0,8,26105,0,0,0,0,0,0);
-- Increase GO Range to 25 (original=10)
UPDATE `gameobject_template` SET `data1`=25 WHERE `entry`=300183;
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 2782: Rune of Dawn
-- Seal of the Dawn (13209) & Rune of the Dawn (19812) scourgestones fix
UPDATE `item_template` SET `spellid_2`=17670, `spelltrigger_2`=1 WHERE `entry` IN (13209,19812);
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 4013: No Rest For The Wicked
-- Add support for quest "No Rest For the Wicked" - H {13367/13368 - daily}<>A {13367/13368 - daily}
-- Credits: based on Kiperr, Kandera and Jankic fixes
SET @SummonBunny := 32347;
SET @Alumeth := 32300;
SET @Trigger := 60831; -- Spell Alumeth's Remains that can hit only summoning bunny to trigger it
UPDATE `creature_template` SET `AIName`='SmartAI',`unit_flags`=4,`flags_extra`=128 WHERE `entry`=@SummonBunny;
UPDATE `creature_template` SET `AIName`='SmartAI',`faction_A`=21,`faction_H`=21 WHERE `entry`=@Alumeth; -- faction from sniffs
UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `guid`=122317; -- Summon Bunny should stay at spawn point
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@SummonBunny,@Alumeth) 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
(@SummonBunny,0,0,0,8,0,100,0,60834,0,0,0,12,32300,6,20000,0,0,8,0,0,0,8219.157,2187.093,499.8201,3.106686,0, 'Alumeth Summon Bunny - On Spellhit - Summon Alumeth the Ascended'), -- He should dissapear after death, not on timer after summon.
(@Alumeth,0,0,0,0,0,100,0,8000,9000 ,8000,9000 ,11,60472,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Alumeth - IC - Cast Mindflay'),
(@Alumeth,0,1,0,0,0,100,0,8000,10000,8000,10000,11,34322,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Alumeth - IC - Cast Psychicscream'),
(@Alumeth,0,2,0,0,0,100,0,9000,12000,9000,12000,11,37978,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alumeth - IC - Cast Renew'),
(@Alumeth,0,3,0,0,0,100,0,7000,10000,7000,10000,11,34942,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Alumeth - IC - Cast Shadow Word: Pain');
-- Fix Alumeth Soulstone GO spell focus data range
UPDATE `gameobject_template` SET `data1`=25 WHERE `entry`=300241; -- This GO isn't sniffed and is temp for that reason, value over 300k so it can be edited.
-- Add conditions for spell trigger to summon boss
DELETE FROM `conditions` WHERE `SourceEntry` IN (@Trigger,60834) AND `SourceTypeOrReferenceId`=13;
DELETE FROM `conditions` WHERE `SourceEntry`=@Trigger AND `SourceTypeOrReferenceId`=17;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(17,0,@Trigger,0,0,29,0,@Alumeth,40,0,1,0,'', 'Alumeth''s Remains can be used only, if he is not near caster in 40 yards'),
(13,1,@Trigger,0,0,31,0,3,@SummonBunny,0,0,0,'', 'Alumeth''s Remains can hit only summoning bunny'),
(13,1,60834,0,0,31,0,3,@SummonBunny,0,0,0,'','Ping Alumeth Summon Bunny can hit only SummonBunny');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 4350: Gregory Tabor
-- Spawn Gregory Tabor
SET @GUID := 43465;
DELETE FROM `creature` WHERE `id`=34675;
INSERT INTO `creature` (`guid`,`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
(@GUID,34675,0,1,1,0,0,-9130.26,351.84,93.85,2.0151,300,0,0,1524,0,0,0,0,0);
DELETE FROM `game_event_creature` WHERE `eventEntry`=26 AND `guid`=@GUID;
INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES
(26,@GUID);
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 4551: Anatoly Will Talk
DELETE FROM `npc_spellclick_spells` WHERE npc_entry = 27626;
INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type` ) VALUES
(27626,49138,1,0);
UPDATE creature_template SET faction_a = 16, faction_h = 16, `AIName` = 'SmartAI' WHERE `entry` = 27626;
DELETE FROM smart_scripts WHERE `entryorguid` in (27626,2762600);
INSERT INTO smart_scripts VALUES
(27626,0,1,0,8,0,100,0x1,49134,0,0,0,12,27626,1,300000,0,0,0,0,0,0,0,0,0,0,0, 'Tatjana''s horse - On Spell Hit - resumm'),
(27626,0,2,0,54,0,100,0,0,0,0,0,80,2762600,0,2,0,0,0,1,0,0,0,0,0,0,0,'On time - Run Script'),
(27626,0,3,0,40,0,100,1,18,0,0,0,15,12330,0,0,0,0,0,18,5,0,0,0,0,0,0,'WP 18 - KC'),
(27626,0,4,0,40,0,100,1,19,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'WP 19 - Despawn'),
(27626,0,5,0,40,0,100,1,1,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Set Run"),
(27626,0,6,0,8,0,100,0x1,49134,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Tatjana''s horse - On Spell Hit - Invisible'),
(27626,0,7,0,8,0,100,0x1,49134,0,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Tatjana''s horse - On Spell Hit - Despawn'),
(27626,0,8,0,54,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,'On time - faction'),
(2762600,9,0,0,0,0,100,1,4000,4000,0,0,53,0,27626,0,0,0,2,0,0,0,0,0,0,0,0,'On Script - WP Start');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=49134;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `Comment`) VALUES
(13,1,49134,31,3,27626, 'Tranquilizer Dart targets Tatjana''s Horse');
DELETE FROM `waypoints` WHERE `entry`= 27626;
INSERT INTO `waypoints`
(`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`)
VALUES
(27626,1,4042.49,-4378.298,261.47,''),
(27626,2,4052.839,-4381.89,260.577,''),
(27626,3,4061.94,-4374.57,260.44,''),
(27626,4,4078.97,-4375.19,260.93,''),
(27626,5,4090.33,-4361.82,261.34,''),
(27626,6,4091.73,-4341.6,261.34,''),
(27626,7,4094.09,-4325.83,260.91,''),
(27626,8,4108.3,-4300.63,252.85,''),
(27626,9,4124.35,-4281.08,251.25,''),
(27626,10,4126.15,-4258.29,251.3,''),
(27626,11,4126.1,-4243.9,248.35,''),
(27626,12,4100.1,-4224.51,237.86,''),
(27626,13,4087.17,-4208.72,230.58,''),
(27626,14,4082.93,-4172.83,218.13,''),
(27626,15,4077.66,-4151.22,211.94,''),
(27626,16,4083.57,-4138.46,212.4,''),
(27626,17,4079.16,-4127.81,212.26,''),
(27626,18,4067.57,-4127.6,211.13,''),
(27626,19,4068.35,-4128.44,211.3,'');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5025: Pilgrim's Bounty
-- Insert into proper DB table Piligrim's Bounty quest to prevent random showing it during the year
DELETE FROM `creature_involvedrelation` WHERE `quest`=14036;
DELETE FROM `game_event_creature_quest` WHERE `quest`=14036;
INSERT INTO `game_event_creature_quest` (`eventEntry`, `id`, `quest`) VALUES
(26,34677,14036);
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5419: The Fallen Sisters Bugged again
-- Quest - The Fallen Sisters
SET @ENTRY := 23678;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY*100 AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(@ENTRY,0,0,0,11,0,100,0,0,571,495,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - Respawn - reset faction'),
(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - Reset - set phase 1'),
(@ENTRY,0,2,3,2,0,100,1,0,30,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - On health 30% - Do text emote'),
(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - On health 30% - set phase 2'),
(@ENTRY,0,4,0,0,0,75,0,2000,3000,2000,2000,11,9739,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Chill Nymph - In Combat - Cast Wrath on victim'),
(@ENTRY,0,5,6,8,2,100,0,43340,0,30000,30000,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Chill Nymph - On Spell hit 43340 - Face invoker'),
(@ENTRY,0,6,7,61,0,100,0,0,0,0,0,33,24117,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Chill Nymph - On Spell hit 43340 - Give Quest credit'),
(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,80,2367800,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - On Spell hit 43340 - Load script'),
(@ENTRY,0,8,0,40,0,100,0,1,23678,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - On reach waypoint 1 - Despawn'),
(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - Script 2 - Evade'),
(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - Script 3 - Set faction 35'),
(@ENTRY*100,9,2,0,0,0,100,0,2000,2000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - Script 4 - Say text 1'),
(@ENTRY*100,9,3,0,0,0,100,0,1000,1000,0,0,53,1,23678,0,0,0,0,1,0,0,0,0,0,0,0, 'Chill Nymph - Script 5 - Start waypoint movement');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5647: The Lost Spirits
-- Update Event Type From On Summon(11) to Reset(25)
UPDATE `smart_scripts` SET `event_type`=25 WHERE `entryorguid`=25321 AND `source_type`=0 AND `id`=0;
UPDATE `smart_scripts` SET `event_type`=25 WHERE `entryorguid`=25322 AND `source_type`=0 AND `id`=0;
-- Update Core of Malice drop rate
UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=25355 AND `item`=34711;
-- Remove item Tuskarr Ritual Object from Beryl Hounds
DELETE FROM `creature_loot_template` WHERE `item`=34713;
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5679: Feedin' Da Goolz
SET @GHOUL := 28565;
SET @TRIGER := 28591;
SET @SOURCETYPE := 0;
UPDATE `creature_template` SET `AiName`='SmartAI',`flags_extra`=`flags_extra`|2|128 WHERE `entry`=@TRIGER;
UPDATE `creature_template` SET `AiName`='SmartAI' WHERE `entry`=@GHOUL;
DELETE FROM `creature_ai_scripts`WHERE `creature_id` IN (@GHOUL,@TRIGER);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@GHOUL,@TRIGER);
INSERT INTO `smart_scripts` VALUES
(@GHOUL,@SOURCETYPE,0,0,38,0,100,0,0,1,0,0,29,1,1,28591,0,0,0,19,@TRIGER,15,0,0,0,0,0, 'Ghoul - on data 1 set - start follow'),
(@GHOUL,@SOURCETYPE,1,2,65,0,100,0,0,0,0,0,33,28591,0,0,0,0,0,21,20,0,0,0,0,0,0, 'Ghoul - on follow completed - give kill credit'),
(@GHOUL,@SOURCETYPE,2,3,61,0,100,0,0,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul - on follow completed - despawn'),
(@GHOUL,@SOURCETYPE,3,0,61,0,100,0,0,0,0,0,51,0,0,0,0,0,0,11,@TRIGER,50,0,0,0,0,0, 'Ghoul - on follow completed - kill ghoul'),
(@TRIGER,@SOURCETYPE,0,0,25,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,@GHOUL,15,0,0,0,0,0, 'Ghoul Trigger - on just summoned - set data 1 on nearest Ghoul');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5764: The One That Got Away
-- Fix quest The One That Got Away /Alliance only/ ID: 11410
SET @Frostfin := 24500; -- The required npc to be summoned
SET @Bite := 48287; -- Npc special attack
SET @Event := 16103;
-- Makes the specific spell that already have the callevent defined summon Frostfin
DELETE FROM `event_scripts` WHERE `id`=@Event;
INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`x`,`y`,`z`,`o`) VALUES
(16103,0,10,@Frostfin,300000,2321.083740,-5260.119629,221.108795,0.248830);
-- Add SAI for Frostfin
UPDATE `creature_template` SET `InhabitType`=2,`AIName`= 'SmartAI' WHERE `entry`= @Frostfin;
DELETE FROM `creature_ai_scripts` WHERE creature_id = @Frostfin;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@Frostfin;
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
(@Frostfin,0,0,0,0,0,100,0,2000,3000,5000,8000,11,@Bite,0,0,0,0,0,2,0,0,0,0,0,0,0,'IC - Cast Powerful Bite');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5785: Find the Ancient Hero
SET @Mjordin := 30718;
SET @Iskalder := 30884; -- the hostile version
SET @FriendlyI := 30886; -- the friendly version
SET @Script1 := 3088400; -- spawn mjoldir on gossip
SET @Script2 := 3088401; -- spawn Iskalder on gossip
SET @Amulet := 3921; -- the spell casted on Iskalder
SET @Witch := 30232; -- Bonne witch
SET @Credit := 25729; -- quest credit
-- Add SAI for Slumbering Mjording
UPDATE `creature_template` SET AIName='SmartAI', unit_flags=0 WHERE `entry`=@Mjordin;
DELETE FROM `smart_scripts` WHERE entryorguid IN(@Mjordin,@Script1,@Script2);
INSERT INTO `smart_scripts` VALUES
(@Mjordin,0,0,0,62,0,100,0,10008,0,0,0,87,@Script1,@Script1,@Script1,@Script2,@Script1,@Script1,1,0,0,0,0,0,0,0,'Slumbering Mjordin - Gossip - Random Script'),
(@Script1,9,0,0,0,0,100,0,500,500,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Slumbering Mjordin - Script - Enemy'), -- Option 1
(@Script1,9,1,0,0,0,100,0,1000,1000,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Slumbering Mjordin - Script - Aggresive'),
(@Script2,9,0,0,0,0,100,0,1000,1000,0,0,12,@Iskalder,3,180000,0,0,0,1,0,0,0,0,0, 0,0,'Slumbering Mjordin - Script - Summon Iskalder '), -- Option 2
(@Script2,9,1,0,0,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0, 0,0,'Slumbering Mjordin - Script - Unseen'),
(@Script2,9,2,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0, 0,0,'Slumbering Mjordin - Script - Despawn');
-- Add SAI for Iskalder hostile - these values are not sniffed they are guessed by wowhead comments...
UPDATE `creature_template` SET `exp`=2,`faction_A`=14, `faction_H`=14, `minlevel`=80, `maxlevel`=80, `mindmg`=300, `maxdmg`=350, `AIName`='SmartAI' WHERE `entry`=@Iskalder;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@Iskalder;
INSERT INTO `smart_scripts` VALUES
(@Iskalder,0,0,0,54,0,100,0,0,0,0,0,1,1,100,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - On summon - Say text'),
(@Iskalder,0,1,0,8,0,100,0,@Amulet,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - On hit by spell from amulet - Despawn');
-- Add SAI for Iskalder Friendly
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@FriendlyI;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@FriendlyI;
INSERT INTO `smart_scripts` VALUES
(@FriendlyI,0,0,0,0,0,100,1,1,1,1,1,18,512,0,0,0,0,0,1,0,0,0,0,0,0,0,'Friendly Iskalder - On IC - Change field flag to immune to npc/prevents from not moving bug/'),
(@FriendlyI,0,1,0,1,0,100,0,2000,3000,2000,3000,29,0,0,@Witch,0,1,0,9,@Witch,1,10,0,0,0,0,'Friendly Iskalder - On OOC - Follow Bonnewitch if in range 10 yards'),
(@FriendlyI,0,2,0,65,0,100,0,0,0,0,0,11,@Credit,0,0,0,0,0,23,0,0,0,0,0,0,0,'Friendly Iskalder - On follow complete - Cast spell credit to player');
-- Makes amulet target only the required npc
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@Amulet;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(17,0,@Amulet,0,0,31,1,3,@Iskalder,0,0,0,'','Amulet can target only Iskalder');
-- The purple beam effect of amulet can target only Iskalder
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@Amulet;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,2,@Amulet,0,0,31,1,3,@Iskalder,0,0,0,'','The purple beam effect of amulet can target only Iskalder');
-- Cast amulet on Iskalder warning /text/
DELETE FROM `creature_text` WHERE `entry`=@Iskalder;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(@Iskalder,1,1,'You have found him! Now is the time to use the The Bone Witch"s Amulet!',41,0,100,0,100,0,'Originaly it as the Bonne witch guide');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5821: Shattrath Daily Quests missing ExclusiveGroup
-- Set ExclusiveGroup for Shattrath Daily Quests, you can have only one per questgiver
UPDATE `quest_template` SET `ExclusiveGroup`=11364 WHERE `Id` IN (11376, 11383, 11385, 11371, 11389, 11500, 11364, 11387);
UPDATE `quest_template` SET `ExclusiveGroup`=11354 WHERE `Id` IN (11382, 11368, 11378, 11374, 11499, 11370, 11372, 11369, 11388, 11362, 11363, 11375, 11354, 11386, 11373, 11384);
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 6284: Nether Drake Egg
UPDATE `gameobject_template` SET `data10`=36326,`data5`=1 WHERE `entry`=184867;
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 6627: Quest - 28056
-- Add condition for gossip option
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1282;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,1282,0,0,0,9,3566,0,0,0,0,'','Alter of Suntara - Show gossip option only if player has taken quest "Rise, Obsidion"');
-- Adding SmartAI Text for Lathoric the Black
DELETE FROM `creature_text` WHERE `entry`=8391;
INSERT INTO creature_text (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(8391,0,0, 'You are here to stop the Archduke?',14,0,100,0,0,0, 'Lathoric the Black'),
(8391,1,0, 'Fools. Obsidion! Rise, and destroy the interlopers!',14,0,100,0,0,0, 'Lathoric the Black');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 5760: Before the Gate of Horror
-- Fix {Qs} Before the Gate of Horror Id: 13335 /Alliance/ and Before the Gate of Horror Id: 13329 /Horde/
SET @SkeletalReaver := 32467; -- The main npcs that can be hit with spell Dissolve only in dead condition
SET @FreedRemnant := 32288; -- Kill credit from quest that has no spell to be used with, so requires action 33
SET @Dissolve := 60428; -- Spell used to trigger npc to cast kill credit on invoker
-- Add SAI for Skeletal Reaver
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@SkeletalReaver;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@SkeletalReaver;
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
(@SkeletalReaver,0,0,1,8,0,100,0,@Dissolve,0,0,0,33,@FreedRemnant,0,0,0,0,0,7,0,0,0,0,0,0,0,'Skeletal Reaver - On hit by spell Dissolve - Give kill credit to invoker'),
(@SkeletalReaver,0,1,2,61,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skeletal Reaver - Linked with previous event - Set unseen'),
(@SkeletalReaver,0,2,0,61,0,100,0,0,0,0,0,41,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Skeletal Reaver - Linked with previous event - Set despawn in 1 ms');
-- Add conditions for spell Dissolve to target only dead Skeletal Reavers
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@Dissolve;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition` ,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(17,0,@Dissolve,0,0,36,1,0,0,0,1,0,'','Dissolve can be casted only on creatures that are not alive'),
(17,0,@Dissolve,0,0,31,1,3,@SkeletalReaver,0,0,0,'','Dissolve can be casted only on Skeletal Reavers');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 6632: Quest Audio - 12593
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=25462;
DELETE FROM `smart_scripts` WHERE (`entryorguid`=25462 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
(25462,0,0,0,19,0,100,0,12593,0,0,0,4,14734,0,0,0,0,0,1,0,0,0,0,0,0,0, 'The Lich King - On Quest Accept - Play Sound');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 6724: Souls of the Decursed
DELETE FROM `conditions` WHERE `SourceEntry`=46485 AND `ConditionValue2`=26814; -- /slap to the guy that entered this query
UPDATE `conditions` SET `ConditionValue2`=25814,`ElseGroup`=0 WHERE `SourceEntry`=46485 AND `ConditionTypeOrReference`=31;
DELETE FROM `smart_scripts` WHERE `entryorguid`=25814 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
(25814,0,0,0,4,0,100,0,0,0,0,0,1,1,10000,0,0,0,0,0,0,0,0,0,0,0,0, 'Fizzcrank Mechagnome - On Aggro - Say Line'),
(25814,0,1,0,8,0,100,0,45980,0,0,0,33,25773,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fizzcrank Mechagnome - On Spellhit 45980 - Give Kill Credit (Re-Cursive)'),
(25814,0,2,3,8,0,100,0,46485,0,0,0,33,26096,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fizzcrank Mechagnome - On Spellhit 46485 - Give Kill Credit (Souls of the Decursed'),
(25814,0,3,0,61,0,100,0,0,0,0,0,41,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Mechagnome - On Spellhit 46485 - Despawn after 10 ms');
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 7837: Norgannon's Shell (12872,12928)
-- Loot
DELETE FROM `creature_loot_template` WHERE `entry`=29775 AND `item`=41258;
INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
(29775,41258,-100,1,0,1,1); -- Norgannon's Shell
-- Charged Disk event script for summoning Archivist Mechaton
DELETE FROM `creature` WHERE `id`=29775;
DELETE FROM `event_scripts` WHERE `id`=19410;
INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
(19410,2,10,29775,300000,0,7991.81,-827.674,968.263,2.89725);
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 7907: Windcaller Yessendra (15498),Warden Haro (15499),Keyl Swiftclaw (15500),Mokvar (16012) & Deliana (16013) quests
UPDATE `quest_template` SET `RequiredClasses`=1 WHERE `Id`=8556; -- Warrior
UPDATE `quest_template` SET `RequiredClasses`=2 WHERE `Id`=8703; -- Paladin
UPDATE `quest_template` SET `RequiredClasses`=4 WHERE `Id`=8704; -- Hunter
UPDATE `quest_template` SET `RequiredClasses`=8 WHERE `Id`=8701; -- Rogue
UPDATE `quest_template` SET `RequiredClasses`=16 WHERE `Id`=8697; -- Priest
UPDATE `quest_template` SET `RequiredClasses`=64 WHERE `Id`=8698; -- Shaman
UPDATE `quest_template` SET `RequiredClasses`=128 WHERE `Id`=8699; -- Mage
UPDATE `quest_template` SET `RequiredClasses`=256 WHERE `Id`=8702; -- Warlock
UPDATE `quest_template` SET `RequiredClasses`=1024 WHERE `Id`=8700; -- Druid
-- Warden Haro (15499) quests RequiredClasses fix by nelegalno
UPDATE `quest_template` SET `RequiredClasses`=1 WHERE `Id`=8558; -- Warrior
UPDATE `quest_template` SET `RequiredClasses`=2 WHERE `Id`=8711; -- Paladin
UPDATE `quest_template` SET `RequiredClasses`=4 WHERE `Id`=8712; -- Hunter
UPDATE `quest_template` SET `RequiredClasses`=8 WHERE `Id`=8709; -- Rogue
UPDATE `quest_template` SET `RequiredClasses`=16 WHERE `Id`=8705; -- Priest
UPDATE `quest_template` SET `RequiredClasses`=64 WHERE `Id`=8706; -- Shaman
UPDATE `quest_template` SET `RequiredClasses`=128 WHERE `Id`=8707; -- Mage
UPDATE `quest_template` SET `RequiredClasses`=256 WHERE `Id`=8710; -- Warlock
UPDATE `quest_template` SET `RequiredClasses`=1024 WHERE `Id`=8708; -- Druid
-- Keyl Swiftclaw (15500) quests RequiredClasses fix by nelegalno
UPDATE `quest_template` SET `RequiredClasses`=1 WHERE `Id`=8557; -- Warrior
UPDATE `quest_template` SET `RequiredClasses`=2 WHERE `Id`=8695; -- Paladin
UPDATE `quest_template` SET `RequiredClasses`=4 WHERE `Id`=8696; -- Hunter
UPDATE `quest_template` SET `RequiredClasses`=8 WHERE `Id`=8693; -- Rogue
UPDATE `quest_template` SET `RequiredClasses`=16 WHERE `Id`=8689; -- Priest
UPDATE `quest_template` SET `RequiredClasses`=64 WHERE `Id`=8690; -- Shaman
UPDATE `quest_template` SET `RequiredClasses`=128 WHERE `Id`=8691; -- Mage
UPDATE `quest_template` SET `RequiredClasses`=256 WHERE `Id`=8694; -- Warlock
UPDATE `quest_template` SET `RequiredClasses`=1024 WHERE `Id`=8692; -- Druid
-- Mokvar (16012) quests RequiredClasses fix by nelegalno
UPDATE `quest_template` SET `RequiredClasses`=1 WHERE `Id` IN (8920,8944,9013,9022); -- Warrior
UPDATE `quest_template` SET `RequiredClasses`=2 WHERE `Id` IN (10493,10495,10497,10499); -- Paladin
UPDATE `quest_template` SET `RequiredClasses`=4 WHERE `Id` IN (8914,8938,9008,9017); -- Hunter
UPDATE `quest_template` SET `RequiredClasses`=8 WHERE `Id` IN (8917,8941,9010,9020); -- Rogue
UPDATE `quest_template` SET `RequiredClasses`=16 WHERE `Id` IN (8916,8940,9009,9019); -- Priest
UPDATE `quest_template` SET `RequiredClasses`=64 WHERE `Id` IN (8918,8942,8957,9011); -- Shaman
UPDATE `quest_template` SET `RequiredClasses`=128 WHERE `Id` IN (8915,8939,9014,9018); -- Mage
UPDATE `quest_template` SET `RequiredClasses`=256 WHERE `Id` IN (8919,8943,9012,9021); -- Warlock
UPDATE `quest_template` SET `RequiredClasses`=1024 WHERE `Id` IN (8913,8927,9007,9016); -- Druid
-- Deliana (16013) quests RequiredClasses fix by nelegalno
UPDATE `quest_template` SET `RequiredClasses`=1 WHERE `Id` IN (8912,8959,8937,9006); -- Warrior
UPDATE `quest_template` SET `RequiredClasses`=2 WHERE `Id` IN (8908,8954,10494,9002); -- Paladin
UPDATE `quest_template` SET `RequiredClasses`=4 WHERE `Id` IN (8906,8952,8931,9000); -- Hunter
UPDATE `quest_template` SET `RequiredClasses`=8 WHERE `Id` IN (8910,8956,8935,9004); -- Rogue
UPDATE `quest_template` SET `RequiredClasses`=16 WHERE `Id` IN (8909,8955,8934,9003); -- Priest
UPDATE `quest_template` SET `RequiredClasses`=64 WHERE `Id` IN (10492,10496,10494,10498); -- Shaman
UPDATE `quest_template` SET `RequiredClasses`=128 WHERE `Id` IN (8907,8953,8932,9001); -- Mage
UPDATE `quest_template` SET `RequiredClasses`=256 WHERE `Id` IN (8911,8958,8936,9005); -- Warlock
UPDATE `quest_template` SET `RequiredClasses`=1024 WHERE `Id` IN (8905,8951,8926,8999); -- Druid
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 7908: Attunement to the Core (7487,7848)
-- Attunement to the Core (7848) quest RequiredRaces fix by nelegalno
-- UPDATE `quest_template` SET `RequiredRaces`=0 WHERE `Id`=7848;
-- Revert previous Attunement to the Core (7487,7848) quest fix
UPDATE `quest_template` SET `RequiredRaces`=1101 WHERE `Id`=7848; -- A
UPDATE `quest_template` SET `RequiredRaces`=690 WHERE `Id`=7487; -- H
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 8021: spawn location in OG near Rogg (37072)
SET @GUID := 387; -- set by TDB team
DELETE FROM `gameobject` WHERE `guid`=@GUID;
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
(@GUID,1685,1,1,1,1523.778,-4368.241,18.21412,6.07367,0,0,0,1,300,100,1);
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 8086: Missing Fires for Hallow End Q
-- This won't fix the quest until the rest of the event is scripted.
SET @CREATURE_GUID := 85701; -- set by TDB team
DELETE FROM `creature` WHERE `id` IN (23537,23686) AND `guid` BETWEEN @CREATURE_GUID+00 AND @CREATURE_GUID+12;
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
-- Spawn fire dummys for fire effigys
(@CREATURE_GUID+00,23537,530,1,1,0,0,-4192.38,-12268.1,2.53389,-1.72788,300,0,0,45780,0,0,0,0,0),
(@CREATURE_GUID+01,23537,530,1,1,0,0,-4207.84,-12276.7,4.82085,-0.069813,300,0,0,45780,0,0,0,0,0),
(@CREATURE_GUID+02,23537,0,1,1,0,0,-5753.24,-533.652,405.022,1.15192,300,0,0,45780,0,0,0,0,0),
(@CREATURE_GUID+03,23537,0,1,1,0,0,-5761.17,-528.193,404.855,1.16937,300,0,0,15260,0,0,0,0,0),
(@CREATURE_GUID+04,23537,0,1,1,0,0,-5747.52,-527.634,401.297,0.610865,300,0,0,15260,0,0,0,0,0),
(@CREATURE_GUID+05,23537,1,1,1,0,0,286.565,-4561.45,28.5742,2.42601,300,0,0,15260,0,0,0,0,0),
(@CREATURE_GUID+06,23537,530,1,1,0,0,9235.05,-6783.4,26.4426,1.5708,300,0,0,15260,0,0,0,0,0),
(@CREATURE_GUID+07,23537,0,1,1,0,0,2240.44,459.159,39.2838,0.820305,300,0,0,15260,0,0,0,0,0),
(@CREATURE_GUID+08,23537,0,1,1,0,0,2239.49,487.861,38.3446,-0.715585,300,0,0,15260,0,0,0,0,0),
(@CREATURE_GUID+09,23537,0,1,1,0,0,-9328.25,56.2778,63.2509,2.60054,300,0,0,15260,0,0,0,0,0),
(@CREATURE_GUID+10,23537,0,1,1,0,0,-9314.1,52.4562,77.7343,2.93215,300,0,0,15260,0,0,0,0,0),
-- Spawn Fire Handlers for villages
(@CREATURE_GUID+11,23686,1,1,1,0,0,305.144,-4724.5,9.83766,3.68348,300,0,0,7185,7196,0,0,0,0),
(@CREATURE_GUID+12,23686,0,1,1,0,0,-9465.54,63.2228,55.8587,6.25841,300,0,0,7185,7196,0,0,0,0);
DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CREATURE_GUID+00 AND @CREATURE_GUID+12;
INSERT INTO `game_event_creature` VALUES
(12,@CREATURE_GUID+00),
(12,@CREATURE_GUID+01),
(12,@CREATURE_GUID+02),
(12,@CREATURE_GUID+03),
(12,@CREATURE_GUID+04),
(12,@CREATURE_GUID+05),
(12,@CREATURE_GUID+06),
(12,@CREATURE_GUID+07),
(12,@CREATURE_GUID+08),
(12,@CREATURE_GUID+09),
(12,@CREATURE_GUID+10),
(12,@CREATURE_GUID+11),
(12,@CREATURE_GUID+12);
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 8133: Wickerman Festival NPC & GO's
-- Wickerman Festival
SET @GO_GUID := 17868; -- set by TDB team (14)
SET @CREATURE_GUID := 85632; -- set by TDB team (5)
UPDATE `gameobject_template` SET `flags` = 17 WHERE `entry` = 180433;
DELETE FROM `gameobject` WHERE id IN (180432,180433,180434,180437,180405,180406) AND `guid` BETWEEN @GO_GUID+00 AND @GO_GUID+13;
INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
-- Forsaken Banner
(@GO_GUID+00,180432,0,1,1,1749.28,507.611,39.2312,1.49635,0,0,0.680301,0.732933,300,0,1),
(@GO_GUID+01,180432,0,1,1,1712.63,507.05,38.2495,1.58824,0,0,0.713246,0.700914,300,0,1),
-- The Wickerman
(@GO_GUID+02,180433,0,1,1,1734.04,504.05,42.2861,1.4131,0,0,0.649213,0.760607,300,0,0),
-- Bonfire
(@GO_GUID+03,180434,0,1,1,1758.89,513.276,35.8655,1.28897,0,0,0.600788,0.799409,300,0,1),
(@GO_GUID+04,180434,0,1,1,1704.48,518.689,35.4045,1.30704,0,0,0.607984,0.793949,300,0,1),
(@GO_GUID+05,180434,0,1,1,1739.78,473.238,61.6565,1.59371,0,0,0.71516,0.698961,300,0,1),
(@GO_GUID+06,180434,0,1,1,1717.32,472.723,61.6566,1.59371,0,0,0.71516,0.698961,300,0,1),
-- Wickerman Ember
(@GO_GUID+07,180437,0,1,1,1744.62,504.954,40.8518,1.23403,0,0,0.578603,0.81561,300,0,1),
(@GO_GUID+08,180437,0,1,1,1729.13,510.378,40.8719,1.23403,0,0,0.578603,0.81561,300,0,1),
(@GO_GUID+09,180437,0,1,1,1721.77,503.938,41.1381,1.23403,0,0,0.578603,0.81561,300,0,1),
(@GO_GUID+10,180437,0,1,1,1744.96,496.25,41.44,1.24581,0,0,0.583397,0.812187,300,0,1),
-- G_Pumpkin_01
(@GO_GUID+11,180405,0,1,1,1746.07,517.066,38.936,2.83466,0,0,0.988247,0.152864,300,0,1),
(@GO_GUID+12,180405,0,1,1,1728,475.099,63.6779,3.08363,0,0,0.99958,0.0289791,300,0,1),
-- G_Pumpkin_02
(@GO_GUID+13,180406,0,1,1,1719.67,522.979,36.8828,2.93283,0,0,0.994557,0.10419,300,0,1);
DELETE FROM `creature` WHERE `id` IN (15195,15197,15199) AND `guid` BETWEEN @CREATURE_GUID+00 AND @CREATURE_GUID+04;
INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES
-- Wickerman Guardian
(@CREATURE_GUID+00,15195,0,1,1,0,0,1713.1,511.295,37.2005,1.48063,300,0,0,45780,0,0,0,0,0),
(@CREATURE_GUID+01,15195,0,1,1,0,0,1750.57,511.697,37.7587,1.25444,300,0,0,45780,0,0,0,0,0),
(@CREATURE_GUID+02,15195,0,1,1,0,0,1732.31,520.874,36.3326,1.30942,300,0,0,45780,0,0,0,0,0),
-- Darkcaller Yanka
(@CREATURE_GUID+03,15197,0,1,1,0,0,1734.6,508.803,41.2847,1.6173,300,0,0,15260,0,0,0,0,0),
-- Sergeant Hartman
(@CREATURE_GUID+04,15199,0,1,1,0,0,-813.614,-547.184,15.6377,1.69193,300,0,0,15260,0,0,0,0,0);
DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @GO_GUID+00 AND @GO_GUID+13;
INSERT INTO `game_event_gameobject` VALUES
(12,@GO_GUID+00),
(12,@GO_GUID+01),
(12,@GO_GUID+02),
(12,@GO_GUID+03),
(12,@GO_GUID+04),
(12,@GO_GUID+05),
(12,@GO_GUID+06),
(12,@GO_GUID+07),
(12,@GO_GUID+08),
(12,@GO_GUID+09),
(12,@GO_GUID+10),
(12,@GO_GUID+11),
(12,@GO_GUID+12),
(12,@GO_GUID+13);
DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CREATURE_GUID+00 AND @CREATURE_GUID+04;
INSERT INTO `game_event_creature` VALUES
(12,@CREATURE_GUID+00),
(12,@CREATURE_GUID+01),
(12,@CREATURE_GUID+02),
(12,@CREATURE_GUID+03),
(12,@CREATURE_GUID+04);
-- Wickerman Ashes
DELETE FROM `gossip_menu` WHERE `entry` = 6535;
INSERT INTO `gossip_menu` VALUES
(6535,7737),
(6535,7738);
DELETE FROM `gossip_menu_option` WHERE `menu_id`=6535 AND `id`=0;
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES
(6535,0,0, 'Smear the ash on my face like war paint!',1,1,0,0,0,0, ''); -- need text confirmation
-- gossip conditions
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=6535;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(14,6535,7738,0,0,1,0,24705,0,0,0,0, '', 'Wickerman Ember - Show different gossip if player is affected by aura 24705'),
(14,6535,7737,0,0,1,0,24705,0,0,1,0, '', 'Wickerman Ember - Show different gossip if player is affected by aura 24705'),
(15,6535,0,0,0,1,0,24705,0,0,1,0, '', 'Wickerman Ember - Show different gossip option if player is affected by aura 24705');
-- GO smart script
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=180437;
DELETE FROM `smart_scripts` WHERE `entryorguid`=180437 AND `source_type`=1;
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
(180437,1,0,1,62,0,100,0,6535,0,0,0,85,24705,34,0,0,0,0,7,0,0,0,0,0,0,0, 'Wickerman Ember - on Gossip Select - Cast Invocation of the Wickerman'),
(180437,1,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Wickerman Ember - on Link - Close gossip');
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 8244: Hallow's End Pumpkin Treat & Tricky Treat time fix
-- Hallow's End Pumpkin Treat time fix & Tricky Treat time fix
UPDATE `item_template` SET `flagsCustom`=1 WHERE `entry` IN(20557,33226);
-- ------------------------------------------------------------------------------------------------------------------------------------------------
-- Issue 8288: Exhausted Vrykul - not responding after using discipline stick on him
SET @ENTRY := 30146; -- Exhausted Vrykul
SET @SPELL := 56033; -- Disciplining Rod
DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100,@ENTRY*100+1) AND `source_type`=9;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,25,0,100,1,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - Reset - Switch to Phase 1'),
(@ENTRY,0,1,0,1,1,100,0,0,0,0,0,90,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - On phase 1 - Seat'),
(@ENTRY,0,2,3,8,1,100,0,@SPELL,0,0,0,33,29886,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Exhausted Vrykul - On Spell hit & phase 1 - Kill Credit'),
(@ENTRY,0,3,0,61,1,100,0,0,0,0,0,31,2,3,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - Link Spell hit - Switch to Phase 2 or 3'),
(@ENTRY,0,4,5,1,2,100,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - If phase 2 - Say random text 0'),
(@ENTRY,0,5,6,61,2,100,0,0,0,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - If phase 2 - Stand up'),
(@ENTRY,0,6,0,61,2,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Exhausted Vrykul - On phase 2 - Start Attack'),
(@ENTRY,0,7,8,1,4,100,1,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - On phase 3 - Say random text 1'),
(@ENTRY,0,8,9,61,4,100,0,0,0,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - If phase 3 - Stand up'),
(@ENTRY,0,9,10,61,4,100,0,0,0,0,0,46,6,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - If phase 3 - walk 6 yards'),
(@ENTRY,0,10,0,61,4,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - On phase 3 - Emote Work mining'),
(@ENTRY,0,11,0,1,4,100,1,60000,60000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Exhausted Vrykul - On phase 3 & 1 minute OOC - despawn'),
(@ENTRY,0,12,0,2,0,100,1,0,30,0,0,11,57395,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Exhausted Vrykul - At 30% Hp - Cast Desperate Blow');
-- ------------------------------------------------------------------------------------------------------------------------------------------------
DELETE FROM `creature_addon` WHERE `guid` IN (45214,45215,45146,85486);
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,6 @@
SET @Event = 26; -- game_event.entry - Set by TDB
DELETE FROM `game_event` WHERE `eventEntry`=@Event;
INSERT INTO `game_event` (`eventEntry`,`start_time`,`end_time`,`occurence`,`length`,`holiday`,`description`,`world_event`) VALUES
(@Event,'2012-11-18 01:00:00','2020-12-31 05:00:00',525600,10020,404, 'Pilgrim''s Bounty',0);
-- undo hack, reset to sniffed values
UPDATE `gameobject_template` SET `data10`=37639,`data5`=0 WHERE `entry`=184867;
@@ -0,0 +1,71 @@
-- Dragonblight (Emerald Dragonshrine)
-- Ysera should be laying down
DELETE FROM `creature_addon` WHERE `guid`=108844;
INSERT INTO `creature_addon` (`guid`,`bytes1`) VALUES
(108844,3);
-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Grizzly Hills (Bloodmoon Isle)
-- Adding teleport
DELETE FROM `game_tele` WHERE `id`=1422;
INSERT INTO `game_tele` (`id`,`position_x`,`position_y`,`position_z`,`orientation`,`map`,`name`) VALUES
(1422,4682.07,-5569.67,53.61,3.85,571,"BloodmoonIsle"); -- Teleport location (roughly): http://www.wowhead.com/maps?data=394:844258
-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Bloodmoon worgen
UPDATE `creature` SET `spawndist`=2.5,`movementType`=1 WHERE `guid` IN (108834,108799,108829);
UPDATE `creature` SET `spawndist`=5,`movementType`=1 WHERE `guid` IN (108830,108828,108784);
UPDATE `creature` SET `spawndist`=6,`movementType`=1 WHERE `guid`=108784;
-- Bloodmoon Cultists
UPDATE `creature` SET `position_x`=4599.94,`position_y`=-5706.74,`position_z`=184.50,`orientation`=3.72,`spawndist`=5 WHERE `guid`=109406;
DELETE FROM `creature_addon` WHERE `guid` IN (109406,109407,109383,109412,109334,109385,109168,109147,109239,109240,109410,109411,109146,109169,109403,113585,109405,109408,109404);
INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`) VALUES
(109406,0,8),(109407,0,8),(109383,0,8),
(109412,0,1),(109334,0,1),(109168,0,1),
(109147,0,1),(109240,0,1),(109239,0,1),
(109411,0,1),(109410,0,1),(109169,0,1),
(109146,0,1),(109403,0,8),(113585,0,8),
(109405,0,8),(109408,0,8),(109404,1094040,0),
(109385,1093850,0);
DELETE FROM `creature` WHERE `guid` IN (113585,109404,109385);
INSERT INTO `creature` (`guid`,`id`,`map`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`curhealth`,`curmana`,`MovementType`) VALUES
(109404,27024,571,4676.16,-5575.82,53.61,0.85,120,6,9940,0,2),
(109385,26935,571,4550.15,-5493.45,2.19,0.85,120,6,9940,0,2);
-- Pathing Bloodmoon Cultist 1/2
DELETE FROM `waypoint_data` WHERE `id` IN (1093850,1094040);
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`) VALUES
(1093850,1,4550.159180,-5493.454102,2.198123,0),
(1093850,2,4560.156250,-5505.391113,2.247392,0),
(1093850,3,4568.288574,-5540.102051,2.325547,0),
(1093850,4,4570.309570,-5555.015625,3.725862,0),
(1093850,5,4593.584473,-5583.147461,17.485140,0),
(1093850,6,4640.961426,-5587.870117,43.030090,0),
(1093850,7,4663.515625,-5596.525391,51.983559,0),
(1093850,8,4666.571777,-5585.750488,53.366554,0),
(1093850,9,4679.179199,-5572.404297,53.618946,0),
(1093850,10,4659.498047,-5593.301270,50.779484,0),
(1093850,11,4633.121582,-5588.121582,38.891140,0),
(1093850,12,4607.767090,-5586.987793,24.787226,0),
(1093850,13,4588.015625,-5577.846680,13.770270,0),
(1093850,14,4570.691895,-5554.702148,3.706614,0),
(1093850,15,4564.821289,-5511.260742,2.249003,0),
-- Pathing Bloodmoon Cultist 2/2
(1094040,1,4676.167969,-5575.823730,53.619122,3000),
(1094040,2,4665.977051,-5586.124512,53.232887,0),
(1094040,3,4668.571289,-5599.335938,53.233620,0),
(1094040,4,4678.922363,-5609.084961,58.034130,0),
(1094040,5,4691.944336,-5631.230469,74.489761,0),
(1094040,6,4692.178711,-5648.943359,79.715866,0),
(1094040,7,4675.570313,-5656.392090,85.288292,0),
(1094040,8,4643.766113,-5657.881836,105.69108,0),
(1094040,9,4630.772461,-5652.050293,110.18435,0),
(1094040,10,4647.054688,-5657.352539,103.57666,0),
(1094040,11,4674.222656,-5656.737793,85.933739,0),
(1094040,12,4692.171387,-5649.309082,79.797195,0),
(1094040,13,4692.635254,-5633.777832,75.973076,0),
(1094040,14,4677.485352,-5607.687500,57.116299,0),
(1094040,15,4665.121094,-5596.857910,52.347866,0),
(1094040,16,4666.613770,-5585.797363,53.372700,0);
-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Varlam
UPDATE `creature` SET `position_x`=4700.48,`position_y`=-5568.50,`position_z`=53.61,`orientation`=3.39 WHERE `guid`=113673;
-- Shade of Arugal
UPDATE `creature` SET `position_x`=4590.02,`position_y`=-5712.43,`position_z`=184.50,`orientation`=1.01 WHERE `guid`=108492;
@@ -28,6 +28,7 @@
#include "TemporarySummon.h"
#include "Object.h"
#include "DBCStores.h"
#include "World.h"
using G3D::Vector3;
using G3D::Ray;
+3 -3
View File
@@ -42,7 +42,7 @@ class GameObjectAI
// Pass parameters between AI
virtual void DoAction(const int32 /*param = 0 */) {}
virtual void SetGUID(uint64 /*guid*/, int32 /*id = 0 */) {}
virtual uint64 GetGUID(int32 /*id = 0 */) { return 0; }
virtual uint64 GetGUID(int32 /*id = 0 */) const { return 0; }
static int Permissible(GameObject const* go);
@@ -53,9 +53,9 @@ class GameObjectAI
virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; }
virtual uint32 GetDialogStatus(Player* /*player*/) { return 100; }
virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) {}
virtual uint32 GetData(uint32 /*id*/) { return 0; }
virtual uint32 GetData(uint32 /*id*/) const { return 0; }
virtual void SetData64(uint32 /*id*/, uint64 /*value*/) {}
virtual uint64 GetData64(uint32 /*id*/) { return 0; }
virtual uint64 GetData64(uint32 /*id*/) const { return 0; }
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {}
virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) {}
+4 -3
View File
@@ -24,8 +24,9 @@
#include "Containers.h"
#include <list>
class Unit;
class Player;
class Quest;
class Unit;
struct AISpellInfoType;
// Default script texts
@@ -146,10 +147,10 @@ class UnitAI
// Pass parameters between AI
virtual void DoAction(int32 const /*param*/) {}
virtual uint32 GetData(uint32 /*id = 0*/) { return 0; }
virtual uint32 GetData(uint32 /*id = 0*/) const { return 0; }
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
virtual void SetGUID(uint64 /*guid*/, int32 /*id*/ = 0) {}
virtual uint64 GetGUID(int32 /*id*/ = 0) { return 0; }
virtual uint64 GetGUID(int32 /*id*/ = 0) const { return 0; }
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
// Select the targets satifying the predicate.
@@ -77,17 +77,13 @@ void SummonList::RemoveNotExisting()
}
}
bool SummonList::HasEntry(uint32 entry)
bool SummonList::HasEntry(uint32 entry) const
{
for (iterator i = begin(); i != end();)
for (const_iterator i = begin(); i != end(); ++i)
{
Creature* summon = Unit::GetCreature(*me, *i);
if (!summon)
erase(i++);
else if (summon->GetEntry() == entry)
if (summon && summon->GetEntry() == entry)
return true;
else
++i;
}
return false;
@@ -54,7 +54,7 @@ class SummonList : public std::list<uint64>
void DoZoneInCombat(uint32 entry = 0);
void RemoveNotExisting();
bool HasEntry(uint32 entry);
bool HasEntry(uint32 entry) const;
private:
Creature* me;
};
+2 -2
View File
@@ -698,7 +698,7 @@ void SmartAI::DoAction(const int32 param)
GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, NULL, param);
}
uint32 SmartAI::GetData(uint32 /*id*/)
uint32 SmartAI::GetData(uint32 /*id*/) const
{
return 0;
}
@@ -712,7 +712,7 @@ void SmartAI::SetGUID(uint64 /*guid*/, int32 /*id*/)
{
}
uint64 SmartAI::GetGUID(int32 /*id*/)
uint64 SmartAI::GetGUID(int32 /*id*/) const
{
return 0;
}
+2 -3
View File
@@ -22,7 +22,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "Unit.h"
#include "ConditionMgr.h"
#include "Spell.h"
#include "SmartScript.h"
@@ -151,7 +150,7 @@ class SmartAI : public CreatureAI
void DoAction(const int32 param = 0);
// Used in scripts to share variables
uint32 GetData(uint32 id = 0);
uint32 GetData(uint32 id = 0) const;
// Used in scripts to share variables
void SetData(uint32 id, uint32 value);
@@ -160,7 +159,7 @@ class SmartAI : public CreatureAI
void SetGUID(uint64 guid, int32 id = 0);
// Used in scripts to share variables
uint64 GetGUID(int32 id = 0);
uint64 GetGUID(int32 id = 0) const;
//core related
static int Permissible(const Creature*);
+16 -16
View File
@@ -15,25 +15,25 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "DatabaseEnv.h"
#include "ObjectMgr.h"
#include "ObjectDefines.h"
#include "GridDefines.h"
#include "GridNotifiers.h"
#include "SpellMgr.h"
#include "GridNotifiersImpl.h"
#include "Cell.h"
#include "CellImpl.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "GossipDef.h"
#include "ScriptedCreature.h"
#include "SmartScript.h"
#include "SmartAI.h"
#include "Group.h"
#include "Vehicle.h"
#include "ScriptedGossip.h"
#include "CreatureTextMgr.h"
#include "DatabaseEnv.h"
#include "GossipDef.h"
#include "GridDefines.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "InstanceScript.h"
#include "Language.h"
#include "ObjectDefines.h"
#include "ObjectMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SmartAI.h"
#include "SmartScript.h"
#include "SpellMgr.h"
#include "Vehicle.h"
class TrinityStringTextBuilder
{
@@ -22,7 +22,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "Unit.h"
#include "ConditionMgr.h"
#include "Spell.h"
#include "GridNotifiers.h"
+1
View File
@@ -22,6 +22,7 @@
#include "Player.h"
#include "Util.h"
#include "SHA1.h"
#include "WorldSession.h"
namespace AccountMgr
{
+20 -18
View File
@@ -17,29 +17,31 @@
*/
#include "AchievementMgr.h"
#include "Common.h"
#include "DBCEnums.h"
#include "ObjectMgr.h"
#include "ArenaTeamMgr.h"
#include "GuildMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "DatabaseEnv.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "BattlegroundAB.h"
#include "Battleground.h"
#include "CellImpl.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "DBCEnums.h"
#include "DisableMgr.h"
#include "GameEventMgr.h"
#include "GridNotifiersImpl.h"
#include "Guild.h"
#include "Language.h"
#include "Player.h"
#include "SpellMgr.h"
#include "DisableMgr.h"
#include "ScriptMgr.h"
#include "MapManager.h"
#include "Battleground.h"
#include "Map.h"
#include "InstanceScript.h"
#include "Group.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "InstanceScript.h"
#include "Language.h"
#include "Map.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SpellMgr.h"
#include "World.h"
#include "WorldPacket.h"
namespace Trinity
{
+3 -3
View File
@@ -592,12 +592,12 @@ bool Battlefield::AddOrSetPlayerToCorrectBfGroup(Player* player)
//--------------------
//-Battlefield Method-
//--------------------
BfGraveyard* Battlefield::GetGraveyardById(uint32 id)
BfGraveyard* Battlefield::GetGraveyardById(uint32 id) const
{
if (id < m_GraveyardList.size())
{
if (m_GraveyardList[id])
return m_GraveyardList[id];
if (BfGraveyard* graveyard = m_GraveyardList.at(id))
return graveyard;
else
sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u not existed", id);
}
+5 -5
View File
@@ -148,7 +148,7 @@ class BfGraveyard
// Method to changing who controls the graveyard
void GiveControlTo(TeamId team);
TeamId GetControlTeamId() { return m_ControlTeam; }
TeamId GetControlTeamId() const { return m_ControlTeam; }
// Find the nearest graveyard to a player
float GetDistance(Player* player);
@@ -188,7 +188,7 @@ class BfGraveyard
bool HasPlayer(uint64 guid) { return m_ResurrectQueue.find(guid) != m_ResurrectQueue.end(); }
// Get the graveyard's ID.
uint32 GetGraveyardId() { return m_GraveyardId; }
uint32 GetGraveyardId() const { return m_GraveyardId; }
protected:
TeamId m_ControlTeam;
@@ -262,11 +262,11 @@ class Battlefield : public ZoneScript
void HandlePlayerLeaveZone(Player* player, uint32 zone);
// All-purpose data storage 64 bit
virtual uint64 GetData64(uint32 dataId) { return m_Data64[dataId]; }
virtual uint64 GetData64(uint32 dataId) const { return m_Data64[dataId]; }
virtual void SetData64(uint32 dataId, uint64 value) { m_Data64[dataId] = value; }
// All-purpose data storage 32 bit
virtual uint32 GetData(uint32 dataId) { return m_Data32[dataId]; }
virtual uint32 GetData(uint32 dataId) const { return m_Data32[dataId]; }
virtual void SetData(uint32 dataId, uint32 value) { m_Data32[dataId] = value; }
virtual void UpdateData(uint32 index, int32 pad) { m_Data32[index] += pad; }
@@ -294,7 +294,7 @@ class Battlefield : public ZoneScript
virtual void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
void RemovePlayerFromResurrectQueue(uint64 player_guid);
void SetGraveyardNumber(uint32 number) { m_GraveyardList.resize(number); }
BfGraveyard* GetGraveyardById(uint32 id);
BfGraveyard* GetGraveyardById(uint32 id) const;
// Misc methods
Creature* SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId team);
@@ -20,11 +20,15 @@
// TODO: Use spell victory/defeat in wg instead of RewardMarkOfHonor() && RewardHonor
// TODO: Add proper implement of achievement
#include "ObjectMgr.h"
#include "BattlefieldWG.h"
#include "SpellAuras.h"
#include "Vehicle.h"
#include "AchievementMgr.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "SpellAuras.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
#include "WorldSession.h"
enum WGVehicles
{
@@ -454,7 +458,7 @@ void BattlefieldWG::OnStartGrouping()
SendWarningToAllInZone(BATTLEFIELD_WG_TEXT_WILL_START);
}
uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId)
uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId) const
{
switch (areaId)
{
@@ -802,7 +806,7 @@ void BattlefieldWG::OnPlayerEnterZone(Player* player)
SendInitWorldStatesTo(player);
}
uint32 BattlefieldWG::GetData(uint32 data)
uint32 BattlefieldWG::GetData(uint32 data) const
{
switch (data)
{
@@ -813,8 +817,8 @@ uint32 BattlefieldWG::GetData(uint32 data)
case AREA_WESTPARK_WORKSHOP:
case AREA_EASTPARK_WORKSHOP:
// Graveyards and Workshops are controlled by the same team.
if (m_GraveyardList[GetSpiritGraveyardId(data)])
return m_GraveyardList[GetSpiritGraveyardId(data)]->GetControlTeamId();
if (BfGraveyard const* graveyard = GetGraveyardById(GetSpiritGraveyardId(data)))
return graveyard->GetControlTeamId();
}
return Battlefield::GetData(data);
@@ -22,6 +22,7 @@
#include "ObjectAccessor.h"
#include "WorldPacket.h"
#include "Battlefield.h"
#include "World.h"
class Group;
class BattlefieldWG;
@@ -410,9 +411,9 @@ class BattlefieldWG : public Battlefield
bool FindAndRemoveVehicleFromList(Unit* vehicle);
// returns the graveyardId in the specified area.
uint8 GetSpiritGraveyardId(uint32 areaId);
uint8 GetSpiritGraveyardId(uint32 areaId) const;
uint32 GetData(uint32 data);
uint32 GetData(uint32 data) const;
protected:
bool m_isRelicInteractible;
@@ -23,6 +23,8 @@
#include "Group.h"
#include "ArenaTeamMgr.h"
#include "Player.h"
#include "WorldSession.h"
#include "Opcodes.h"
ArenaTeam::ArenaTeam()
: TeamId(0), Type(0), TeamName(), CaptainGuid(0), BackgroundColor(0), EmblemStyle(0), EmblemColor(0),
+11 -11
View File
@@ -16,26 +16,26 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Player.h"
#include "ObjectMgr.h"
#include "ArenaTeamMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "Creature.h"
#include "Formulas.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "Language.h"
#include "MapManager.h"
#include "Object.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "Util.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "MapManager.h"
#include "Object.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "Util.h"
#include "World.h"
#include "WorldPacket.h"
namespace Trinity
{
@@ -46,6 +46,7 @@
#include "SharedDefines.h"
#include "Formulas.h"
#include "DisableMgr.h"
#include "Opcodes.h"
/*********************************************************/
/*** BATTLEGROUND MANAGER ***/
@@ -16,14 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "BattlegroundQueue.h"
#include "ArenaTeam.h"
#include "BattlegroundMgr.h"
#include "Chat.h"
#include "ObjectMgr.h"
#include "ArenaTeamMgr.h"
#include "Log.h"
#include "BattlegroundMgr.h"
#include "BattlegroundQueue.h"
#include "Chat.h"
#include "Group.h"
#include "Log.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
/*********************************************************/
@@ -26,6 +26,7 @@
#include "Object.h"
#include "Player.h"
#include "Util.h"
#include "WorldSession.h"
BattlegroundAB::BattlegroundAB()
{
@@ -21,11 +21,12 @@
#include "ObjectMgr.h"
#include "WorldPacket.h"
#include "Miscellaneous/Formulas.h"
#include "Formulas.h"
#include "GameObject.h"
#include "Miscellaneous/Language.h"
#include "Language.h"
#include "Player.h"
#include "SpellAuras.h"
#include "WorldSession.h"
BattlegroundAV::BattlegroundAV()
{
@@ -1707,4 +1708,4 @@ uint32 BattlegroundAV::GetPrematureWinner()
return HORDE;
return Battleground::GetPrematureWinner();
}
}
@@ -17,11 +17,12 @@
*/
#include "BattlegroundDS.h"
#include "ObjectAccessor.h"
#include "Creature.h"
#include "GameObject.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "WorldPacket.h"
#include "GameObject.h"
BattlegroundDS::BattlegroundDS()
{
@@ -25,6 +25,7 @@
#include "ObjectMgr.h"
#include "Vehicle.h"
#include "Transport.h"
#include "WorldSession.h"
BattlegroundIC::BattlegroundIC()
{
@@ -22,6 +22,7 @@
#include "GameObject.h"
#include "ObjectMgr.h"
#include "WorldPacket.h"
#include "WorldSession.h"
BattlegroundSA::BattlegroundSA()
{
+3 -2
View File
@@ -22,6 +22,7 @@
#include "Player.h"
#include "GuildMgr.h"
#include "ObjectAccessor.h"
#include "Opcodes.h"
CalendarInvite::~CalendarInvite()
{
@@ -44,8 +45,8 @@ CalendarMgr::~CalendarMgr()
void CalendarMgr::LoadFromDB()
{
uint32 count = 0;
_maxEventId = 1;
_maxInviteId = 1;
_maxEventId = 0;
_maxInviteId = 0;
// 0 1 2 3 4 5 6 7 8
if (QueryResult result = CharacterDatabase.Query("SELECT id, creator, title, description, type, dungeon, eventtime, flags, time2 FROM calendar_events"))
@@ -19,6 +19,7 @@
#include "ChannelMgr.h"
#include "Player.h"
#include "World.h"
#include "WorldSession.h"
ChannelMgr::~ChannelMgr()
{
+8 -6
View File
@@ -16,15 +16,17 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ConditionMgr.h"
#include "AchievementMgr.h"
#include "GameEventMgr.h"
#include "InstanceScript.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
#include "GameEventMgr.h"
#include "ObjectMgr.h"
#include "InstanceScript.h"
#include "ConditionMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Spell.h"
// Checks if object meets the condition
@@ -19,7 +19,11 @@
#ifndef TRINITY_CONDITIONMGR_H
#define TRINITY_CONDITIONMGR_H
#include "Define.h"
#include "Errors.h"
#include <ace/Singleton.h>
#include <list>
#include <map>
class Player;
class Unit;
@@ -17,6 +17,7 @@
*/
#include "DisableMgr.h"
#include "AchievementMgr.h"
#include "ObjectMgr.h"
#include "OutdoorPvP.h"
#include "SpellMgr.h"
@@ -21,6 +21,7 @@
#include "DisableMgr.h"
#include "ObjectMgr.h"
#include "SocialMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "LFGScripts.h"
#include "LFGGroupData.h"
@@ -30,6 +31,7 @@
#include "Player.h"
#include "GroupMgr.h"
#include "GameEventMgr.h"
#include "WorldSession.h"
LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1),
m_options(sWorld->getIntConfig(CONFIG_LFG_OPTIONSMASK))
@@ -27,6 +27,7 @@
#include "LFGMgr.h"
#include "ScriptMgr.h"
#include "ObjectAccessor.h"
#include "WorldSession.h"
LFGPlayerScript::LFGPlayerScript() : PlayerScript("LFGPlayerScript")
{
+29 -27
View File
@@ -16,40 +16,42 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "BattlegroundMgr.h"
#include "CellImpl.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "WorldPacket.h"
#include "World.h"
#include "ObjectMgr.h"
#include "GroupMgr.h"
#include "SpellMgr.h"
#include "CreatureAI.h"
#include "CreatureAISelector.h"
#include "CreatureGroups.h"
#include "Creature.h"
#include "QuestDef.h"
#include "DatabaseEnv.h"
#include "Formulas.h"
#include "GameEventMgr.h"
#include "GossipDef.h"
#include "Player.h"
#include "PoolMgr.h"
#include "Opcodes.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "GroupMgr.h"
#include "InstanceScript.h"
#include "Log.h"
#include "LootMgr.h"
#include "MapManager.h"
#include "CreatureAI.h"
#include "CreatureAISelector.h"
#include "Formulas.h"
#include "WaypointMovementGenerator.h"
#include "InstanceScript.h"
#include "BattlegroundMgr.h"
#include "Util.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "OutdoorPvPMgr.h"
#include "GameEventMgr.h"
#include "CreatureGroups.h"
#include "Vehicle.h"
#include "SpellAuraEffects.h"
#include "Group.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvPMgr.h"
#include "Player.h"
#include "PoolMgr.h"
#include "QuestDef.h"
#include "SpellAuraEffects.h"
#include "SpellMgr.h"
#include "TemporarySummon.h"
#include "Util.h"
#include "Vehicle.h"
#include "WaypointMovementGenerator.h"
#include "World.h"
#include "WorldPacket.h"
// apply implementation of the singletons
TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
+2
View File
@@ -27,6 +27,8 @@
#include "ScriptMgr.h"
#include "ConditionMgr.h"
#include "Player.h"
#include "Opcodes.h"
#include "WorldSession.h"
void AddItemsSetItem(Player* player, Item* item)
{
-113
View File
@@ -2512,119 +2512,6 @@ TempSummon* WorldObject::SummonCreature(uint32 entry, const Position &pos, TempS
return NULL;
}
Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 duration)
{
Pet* pet = new Pet(this, petType);
if (petType == SUMMON_PET && pet->LoadPetFromDB(this, entry))
{
// Remove Demonic Sacrifice auras (known pet)
Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
{
if ((*itr)->GetMiscValue() == 2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
}
else
++itr;
}
if (duration > 0)
pet->SetDuration(duration);
return NULL;
}
// petentry == 0 for hunter "call pet" (current pet summoned if any)
if (!entry)
{
delete pet;
return NULL;
}
pet->Relocate(x, y, z, ang);
if (!pet->IsPositionValid())
{
sLog->outError(LOG_FILTER_GENERAL, "Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
delete pet;
return NULL;
}
Map* map = GetMap();
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
sLog->outError(LOG_FILTER_GENERAL, "no such creature entry %u", entry);
delete pet;
return NULL;
}
pet->SetCreatorGUID(GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
pet->setPowerType(POWER_MANA);
pet->SetUInt32Value(UNIT_NPC_FLAGS, 0);
pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pet->InitStatsForLevel(getLevel());
SetMinion(pet, true);
switch (petType)
{
case SUMMON_PET:
// this enables pet details window (Shift+P)
pet->GetCharmInfo()->SetPetNumber(pet_number, true);
pet->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
pet->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
pet->SetFullHealth();
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
break;
default:
break;
}
map->AddToMap(pet->ToCreature());
switch (petType)
{
case SUMMON_PET:
pet->InitPetCreateSpells();
pet->InitTalentForLevel();
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
PetSpellInitialize();
break;
default:
break;
}
if (petType == SUMMON_PET)
{
// Remove Demonic Sacrifice auras (known pet)
Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
{
if ((*itr)->GetMiscValue() == 2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
}
else
++itr;
}
}
if (duration > 0)
pet->SetDuration(duration);
//ObjectAccessor::UpdateObjectVisibility(pet);
return pet;
}
GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
{
if (!IsInWorld())
+4 -2
View File
@@ -30,6 +30,8 @@
#include "Unit.h"
#include "Util.h"
#include "Group.h"
#include "Opcodes.h"
#include "WorldSession.h"
#define PET_XP_FACTOR 0.05f
@@ -1034,7 +1036,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const
return diet & FoodMask;
}
uint32 Pet::GetCurrentFoodBenefitLevel(uint32 itemlevel)
uint32 Pet::GetCurrentFoodBenefitLevel(uint32 itemlevel) const
{
// -5 or greater food level
if (getLevel() <= itemlevel + 5) //possible to feed level 60 pet with level 55 level food for full effect
@@ -1838,7 +1840,7 @@ void Pet::ToggleAutocast(SpellInfo const* spellInfo, bool apply)
}
}
bool Pet::IsPermanentPetFor(Player* owner)
bool Pet::IsPermanentPetFor(Player* owner) const
{
switch (getPetType())
{
+7 -59
View File
@@ -19,43 +19,11 @@
#ifndef TRINITYCORE_PET_H
#define TRINITYCORE_PET_H
#include "ObjectDefines.h"
#include "Unit.h"
#include "PetDefines.h"
#include "TemporarySummon.h"
enum PetType
{
SUMMON_PET = 0,
HUNTER_PET = 1,
MAX_PET_TYPE = 4
};
#define MAX_PET_STABLES 4
// stored in character_pet.slot
enum PetSaveMode
{
PET_SAVE_AS_DELETED = -1, // not saved in fact
PET_SAVE_AS_CURRENT = 0, // in current slot (with player)
PET_SAVE_FIRST_STABLE_SLOT = 1,
PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100
};
enum PetSpellState
{
PETSPELL_UNCHANGED = 0,
PETSPELL_CHANGED = 1,
PETSPELL_NEW = 2,
PETSPELL_REMOVED = 3
};
enum PetSpellType
{
PETSPELL_NORMAL = 0,
PETSPELL_FAMILY = 1,
PETSPELL_TALENT = 2
};
#define PET_FOCUS_REGEN_INTERVAL 4 * IN_MILLISECONDS
#define HAPPINESS_LEVEL_SIZE 333000
struct PetSpell
{
@@ -64,29 +32,9 @@ struct PetSpell
PetSpellType type;
};
enum ActionFeedback
{
FEEDBACK_NONE = 0,
FEEDBACK_PET_DEAD = 1,
FEEDBACK_NOTHING_TO_ATT = 2,
FEEDBACK_CANT_ATT_TARGET = 3
};
enum PetTalk
{
PET_TALK_SPECIAL_SPELL = 0,
PET_TALK_ATTACK = 1
};
typedef UNORDERED_MAP<uint32, PetSpell> PetSpellMap;
typedef std::vector<uint32> AutoSpellList;
#define ACTIVE_SPELLS_MAX 4
#define PET_FOLLOW_DIST 1.0f
#define PET_FOLLOW_ANGLE (M_PI/2)
#define PET_FOCUS_REGEN_INTERVAL 4 * IN_MILLISECONDS
class Player;
class Pet : public Guardian
@@ -103,9 +51,9 @@ class Pet : public Guardian
bool isControlled() const { return getPetType() == SUMMON_PET || getPetType() == HUNTER_PET; }
bool isTemporarySummoned() const { return m_duration > 0; }
bool IsPermanentPetFor(Player* owner); // pet have tab in character windows and set UNIT_FIELD_PETNUMBER
bool IsPermanentPetFor(Player* owner) const; // pet have tab in character windows and set UNIT_FIELD_PETNUMBER
bool Create (uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
bool CreateBaseAtCreature(Creature* creature);
bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner);
bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask);
@@ -131,9 +79,9 @@ class Pet : public Guardian
void GivePetLevel(uint8 level);
void SynchronizeLevelWithOwner();
bool HaveInDiet(ItemTemplate const* item) const;
uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel);
uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel) const;
void SetDuration(int32 dur) { m_duration = dur; }
int32 GetDuration() { return m_duration; }
int32 GetDuration() const { return m_duration; }
/*
bool UpdateStats(Stats stat);
+80
View File
@@ -0,0 +1,80 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYCORE_PET_DEFINES_H
#define TRINITYCORE_PET_DEFINES_H
enum PetType
{
SUMMON_PET = 0,
HUNTER_PET = 1,
MAX_PET_TYPE = 4
};
#define MAX_PET_STABLES 4
// stored in character_pet.slot
enum PetSaveMode
{
PET_SAVE_AS_DELETED = -1, // not saved in fact
PET_SAVE_AS_CURRENT = 0, // in current slot (with player)
PET_SAVE_FIRST_STABLE_SLOT = 1,
PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100
};
enum HappinessState
{
UNHAPPY = 1,
CONTENT = 2,
HAPPY = 3
};
enum PetSpellState
{
PETSPELL_UNCHANGED = 0,
PETSPELL_CHANGED = 1,
PETSPELL_NEW = 2,
PETSPELL_REMOVED = 3
};
enum PetSpellType
{
PETSPELL_NORMAL = 0,
PETSPELL_FAMILY = 1,
PETSPELL_TALENT = 2
};
enum ActionFeedback
{
FEEDBACK_NONE = 0,
FEEDBACK_PET_DEAD = 1,
FEEDBACK_NOTHING_TO_ATT = 2,
FEEDBACK_CANT_ATT_TARGET = 3
};
enum PetTalk
{
PET_TALK_SPECIAL_SPELL = 0,
PET_TALK_ATTACK = 1
};
#define PET_FOLLOW_DIST 1.0f
#define PET_FOLLOW_ANGLE (M_PI/2)
#endif
+207 -76
View File
@@ -16,69 +16,69 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Common.h"
#include "Language.h"
#include "DatabaseEnv.h"
#include "Log.h"
#include "Opcodes.h"
#include "SpellMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "UpdateMask.h"
#include "Player.h"
#include "Vehicle.h"
#include "SkillDiscovery.h"
#include "QuestDef.h"
#include "GossipDef.h"
#include "UpdateData.h"
#include "Channel.h"
#include "ChannelMgr.h"
#include "MapManager.h"
#include "MapInstanced.h"
#include "InstanceSaveMgr.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "ObjectMgr.h"
#include "ArenaTeamMgr.h"
#include "GuildMgr.h"
#include "GroupMgr.h"
#include "ObjectAccessor.h"
#include "CreatureAI.h"
#include "Formulas.h"
#include "Group.h"
#include "Guild.h"
#include "Pet.h"
#include "Util.h"
#include "Transport.h"
#include "Weather.h"
#include "Battleground.h"
#include "BattlegroundAV.h"
#include "BattlegroundMgr.h"
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
#include "ArenaTeam.h"
#include "Chat.h"
#include "Spell.h"
#include "SocialMgr.h"
#include "GameEventMgr.h"
#include "AchievementMgr.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "ConditionMgr.h"
#include "DisableMgr.h"
#include "WeatherMgr.h"
#include "LFGMgr.h"
#include "CharacterDatabaseCleaner.h"
#include "InstanceScript.h"
#include <cmath>
#include "AccountMgr.h"
#include "DB2Stores.h"
#include "DBCStores.h"
#include "AchievementMgr.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "BattlefieldWG.h"
#include "BattlegroundAV.h"
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "CellImpl.h"
#include "Channel.h"
#include "ChannelMgr.h"
#include "CharacterDatabaseCleaner.h"
#include "Chat.h"
#include <cmath>
#include "Common.h"
#include "ConditionMgr.h"
#include "CreatureAI.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "DisableMgr.h"
#include "Formulas.h"
#include "GameEventMgr.h"
#include "GossipDef.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "GroupMgr.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "InstanceSaveMgr.h"
#include "InstanceScript.h"
#include "Language.h"
#include "LFGMgr.h"
#include "Log.h"
#include "MapInstanced.h"
#include "MapManager.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
#include "ReputationMgr.h"
#include "Pet.h"
#include "QuestDef.h"
#include "SkillDiscovery.h"
#include "SocialMgr.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "Spell.h"
#include "SpellMgr.h"
#include "Transport.h"
#include "UpdateData.h"
#include "UpdateMask.h"
#include "Util.h"
#include "Vehicle.h"
#include "Weather.h"
#include "WeatherMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -647,7 +647,7 @@ void KillRewarder::Reward()
#ifdef _MSC_VER
#pragma warning(disable:4355)
#endif
Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_reputationMgr(this), phaseMgr(this)
Player::Player(WorldSession* session): Unit(true), phaseMgr(this)
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -861,6 +861,9 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
memset(_voidStorageItems, 0, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*));
memset(_CUFProfiles, 0, MAX_CUF_PROFILES * sizeof(CUFProfile*));
m_achievementMgr = new AchievementMgr<Player>(this);
m_reputationMgr = new ReputationMgr(this);
}
Player::~Player()
@@ -891,6 +894,8 @@ Player::~Player()
delete m_declinedname;
delete m_runes;
delete m_achievementMgr;
delete m_reputationMgr;
for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i)
delete _voidStorageItems[i];
@@ -1595,7 +1600,7 @@ void Player::Update(uint32 p_time)
}
}
m_achievementMgr.UpdateTimedAchievements(p_time);
m_achievementMgr->UpdateTimedAchievements(p_time);
if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING))
{
@@ -16608,6 +16613,11 @@ float Player::GetFloatValueFromArray(Tokenizer const& data, uint16 index)
return result;
}
bool Player::isBeingLoaded() const
{
return GetSession()->PlayerLoading();
}
bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
{
//// 0 1 2 3 4 5 6 7 8 9 10 11
@@ -16694,7 +16704,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
// load achievements before anything else to prevent multiple gains for the same achievement/criteria on every loading (as loading does call UpdateAchievementCriteria)
m_achievementMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS));
m_achievementMgr->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS));
uint64 money = fields[8].GetUInt64();
if (money > MAX_MONEY_AMOUNT)
@@ -17132,7 +17142,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
learnDefaultSpells();
// must be before inventory (some items required reputation check)
m_reputationMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADREPUTATION));
m_reputationMgr->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADREPUTATION));
_LoadInventory(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINVENTORY), time_diff);
@@ -17269,7 +17279,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
_LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES));
m_achievementMgr.CheckAllAchievementCriteria(this);
m_achievementMgr->CheckAllAchievementCriteria(this);
_LoadEquipmentSets(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS));
@@ -18586,6 +18596,14 @@ bool Player::CheckInstanceLoginValid()
return sMapMgr->CanPlayerEnter(GetMap()->GetId(), this, true);
}
bool Player::CheckInstanceCount(uint32 instanceId) const
{
if (_instanceResetTimes.size() < sWorld->getIntConfig(CONFIG_MAX_INSTANCES_PER_HOUR))
return true;
return _instanceResetTimes.find(instanceId) != _instanceResetTimes.end();
}
bool Player::_LoadHomeBind(PreparedQueryResult result)
{
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
@@ -18926,8 +18944,8 @@ void Player::SaveToDB(bool create /*=false*/)
_SaveActions(trans);
_SaveAuras(trans);
_SaveSkills(trans);
m_achievementMgr.SaveToDB(trans);
m_reputationMgr.SaveToDB(trans);
m_achievementMgr->SaveToDB(trans);
m_reputationMgr->SaveToDB(trans);
_SaveEquipmentSets(trans);
GetSession()->SaveTutorialsData(trans); // changed only while character in game
_SaveGlyphs(trans);
@@ -22375,8 +22393,8 @@ void Player::SendInitialPacketsBeforeAddToMap()
GetSession()->SendPacket(&data);
SendInitialActionButtons();
m_reputationMgr.SendInitialReputations();
m_achievementMgr.SendAllAchievementData(this);
m_reputationMgr->SendInitialReputations();
m_achievementMgr->SendAllAchievementData(this);
SendEquipmentSetList();
@@ -24488,42 +24506,42 @@ void Player::HandleFall(MovementInfo const& movementInfo)
void Player::ResetAchievements()
{
m_achievementMgr.Reset();
m_achievementMgr->Reset();
}
void Player::SendRespondInspectAchievements(Player* player) const
{
m_achievementMgr.SendAchievementInfo(player);
m_achievementMgr->SendAchievementInfo(player);
}
uint32 Player::GetAchievementPoints() const
{
return m_achievementMgr.GetAchievementPoints();
return m_achievementMgr->GetAchievementPoints();
}
bool Player::HasAchieved(uint32 achievementId) const
{
return m_achievementMgr.HasAchieved(achievementId);
return m_achievementMgr->HasAchieved(achievementId);
}
void Player::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost/* = 0*/)
{
m_achievementMgr.StartTimedAchievement(type, entry, timeLost);
m_achievementMgr->StartTimedAchievement(type, entry, timeLost);
}
void Player::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
{
m_achievementMgr.RemoveTimedAchievement(type, entry);
m_achievementMgr->RemoveTimedAchievement(type, entry);
}
void Player::ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 /*= 0*/, uint64 miscValue2 /*= 0*/, bool evenIfCriteriaComplete /* = false*/)
{
m_achievementMgr.ResetAchievementCriteria(type, miscValue1, miscValue2, evenIfCriteriaComplete);
m_achievementMgr->ResetAchievementCriteria(type, miscValue1, miscValue2, evenIfCriteriaComplete);
}
void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 /*= 0*/, uint64 miscValue2 /*= 0*/, uint64 miscValue3 /*= 0*/, Unit* unit /*= NULL*/)
{
m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, miscValue3, unit, this);
m_achievementMgr->UpdateAchievementCriteria(type, miscValue1, miscValue2, miscValue3, unit, this);
Guild* guild = sGuildMgr->GetGuildById(GetGuildId());
if (!guild)
return;
@@ -24538,7 +24556,7 @@ void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 mis
void Player::CompletedAchievement(AchievementEntry const* entry)
{
m_achievementMgr.CompletedAchievement(entry, this);
m_achievementMgr->CompletedAchievement(entry, this);
}
bool Player::LearnTalent(uint32 talentId, uint32 talentRank)
@@ -26322,3 +26340,116 @@ Guild* Player::GetGuild()
uint32 guildId = GetGuildId();
return guildId ? sGuildMgr->GetGuildById(guildId) : NULL;
}
Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 duration)
{
Pet* pet = new Pet(this, petType);
if (petType == SUMMON_PET && pet->LoadPetFromDB(this, entry))
{
// Remove Demonic Sacrifice auras (known pet)
Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
{
if ((*itr)->GetMiscValue() == 2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
}
else
++itr;
}
if (duration > 0)
pet->SetDuration(duration);
return NULL;
}
// petentry == 0 for hunter "call pet" (current pet summoned if any)
if (!entry)
{
delete pet;
return NULL;
}
pet->Relocate(x, y, z, ang);
if (!pet->IsPositionValid())
{
sLog->outError(LOG_FILTER_GENERAL, "Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
delete pet;
return NULL;
}
Map* map = GetMap();
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
sLog->outError(LOG_FILTER_GENERAL, "no such creature entry %u", entry);
delete pet;
return NULL;
}
pet->SetCreatorGUID(GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
pet->setPowerType(POWER_MANA);
pet->SetUInt32Value(UNIT_NPC_FLAGS, 0);
pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pet->InitStatsForLevel(getLevel());
SetMinion(pet, true);
switch (petType)
{
case SUMMON_PET:
// this enables pet details window (Shift+P)
pet->GetCharmInfo()->SetPetNumber(pet_number, true);
pet->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
pet->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
pet->SetFullHealth();
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
break;
default:
break;
}
map->AddToMap(pet->ToCreature());
switch (petType)
{
case SUMMON_PET:
pet->InitPetCreateSpells();
pet->InitTalentForLevel();
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
PetSpellInitialize();
break;
default:
break;
}
if (petType == SUMMON_PET)
{
// Remove Demonic Sacrifice auras (known pet)
Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
{
if ((*itr)->GetMiscValue() == 2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
}
else
++itr;
}
}
if (duration > 0)
pet->SetDuration(duration);
//ObjectAccessor::UpdateObjectVisibility(pet);
return pet;
}
+19 -24
View File
@@ -19,30 +19,30 @@
#ifndef _PLAYER_H
#define _PLAYER_H
#include <bitset>
#include "AchievementMgr.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "DBCEnums.h"
#include "DBCStores.h"
#include "GroupReference.h"
#include "Item.h"
#include "MapReference.h"
#include "Pet.h"
#include "QuestDef.h"
#include "ReputationMgr.h"
#include "Unit.h"
#include "WorldSession.h"
#include "PhaseMgr.h"
// for template
#include "Item.h"
#include "PetDefines.h"
#include "PhaseMgr.h"
#include "QuestDef.h"
#include "SpellMgr.h"
#include "Unit.h"
#include <string>
#include <vector>
struct CreatureTemplate;
struct Mail;
struct ItemExtendedCostEntry;
struct TrainerSpell;
struct VendorItem;
template<class T> class AchievementMgr;
class ReputationMgr;
class Channel;
class CharacterCreateInfo;
class Creature;
class DynamicObject;
class Group;
@@ -1703,7 +1703,7 @@ class Player : public Unit, public GridObject<Player>
/*********************************************************/
bool LoadFromDB(uint32 guid, SQLQueryHolder *holder);
bool isBeingLoaded() const { return GetSession()->PlayerLoading();}
bool isBeingLoaded() const;
void Initialize(uint32 guid);
static uint32 GetUInt32ValueFromArray(Tokenizer const& data, uint16 index);
@@ -2235,8 +2235,8 @@ class Player : public Unit, public GridObject<Player>
uint8 GetGrantableLevels() { return m_grantableLevels; }
void SetGrantableLevels(uint8 val) { m_grantableLevels = val; }
ReputationMgr& GetReputationMgr() { return m_reputationMgr; }
ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; }
ReputationMgr& GetReputationMgr() { return *m_reputationMgr; }
ReputationMgr const& GetReputationMgr() const { return *m_reputationMgr; }
ReputationRank GetReputationRank(uint32 faction_id) const;
void RewardReputation(Unit* victim, float rate);
void RewardReputation(Quest const* quest);
@@ -2600,12 +2600,7 @@ class Player : public Unit, public GridObject<Player>
static void ConvertInstancesToGroup(Player* player, Group* group, bool switchLeader);
bool Satisfy(AccessRequirement const* ar, uint32 target_map, bool report = false);
bool CheckInstanceLoginValid();
bool CheckInstanceCount(uint32 instanceId) const
{
if (_instanceResetTimes.size() < sWorld->getIntConfig(CONFIG_MAX_INSTANCES_PER_HOUR))
return true;
return _instanceResetTimes.find(instanceId) != _instanceResetTimes.end();
}
bool CheckInstanceCount(uint32 instanceId) const;
void AddInstanceEnterTime(uint32 instanceId, time_t enterTime)
{
@@ -3084,8 +3079,8 @@ class Player : public Unit, public GridObject<Player>
uint32 m_temporaryUnsummonedPetNumber;
uint32 m_oldpetspell;
AchievementMgr<Player> m_achievementMgr;
ReputationMgr m_reputationMgr;
AchievementMgr<Player>* m_achievementMgr;
ReputationMgr* m_reputationMgr;
SpellCooldowns m_spellCooldowns;
@@ -26,6 +26,7 @@
#include "World.h"
#include "Util.h"
#include "AccountMgr.h"
#include "WorldSession.h"
PlayerSocial::PlayerSocial()
{
+3 -2
View File
@@ -17,13 +17,14 @@
*/
#include "Totem.h"
#include "WorldPacket.h"
#include "Log.h"
#include "Group.h"
#include "Player.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
#include "WorldPacket.h"
Totem::Totem(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner, false)
{
+42 -41
View File
@@ -16,49 +16,50 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Common.h"
#include "CreatureAIImpl.h"
#include "Log.h"
#include "Opcodes.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "World.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "Unit.h"
#include "QuestDef.h"
#include "Player.h"
#include "Creature.h"
#include "Spell.h"
#include "Group.h"
#include "SpellAuras.h"
#include "SpellAuraEffects.h"
#include "MapManager.h"
#include "ObjectAccessor.h"
#include "CreatureAI.h"
#include "Formulas.h"
#include "Pet.h"
#include "Util.h"
#include "Totem.h"
#include "Battleground.h"
#include "OutdoorPvP.h"
#include "InstanceSaveMgr.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "CreatureGroups.h"
#include "PetAI.h"
#include "PassiveAI.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
#include "Transport.h"
#include "InstanceScript.h"
#include "SpellInfo.h"
#include "MoveSplineInit.h"
#include "MoveSpline.h"
#include "ConditionMgr.h"
#include "UpdateFieldFlags.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "Battleground.h"
#include "CellImpl.h"
#include "Common.h"
#include "ConditionMgr.h"
#include "CreatureAI.h"
#include "CreatureAIImpl.h"
#include "CreatureGroups.h"
#include "Creature.h"
#include "Formulas.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "InstanceSaveMgr.h"
#include "InstanceScript.h"
#include "Log.h"
#include "MapManager.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvP.h"
#include "PassiveAI.h"
#include "PetAI.h"
#include "Pet.h"
#include "Player.h"
#include "QuestDef.h"
#include "ReputationMgr.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "Spell.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "TemporarySummon.h"
#include "Totem.h"
#include "Transport.h"
#include "Unit.h"
#include "UpdateFieldFlags.h"
#include "Util.h"
#include "Vehicle.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include <math.h>
+6 -16
View File
@@ -19,25 +19,14 @@
#ifndef __UNIT_H
#define __UNIT_H
#include "Common.h"
#include "Object.h"
#include "Opcodes.h"
#include "SpellAuraDefines.h"
#include "UpdateFields.h"
#include "SharedDefines.h"
#include "ThreatManager.h"
#include "HostileRefManager.h"
#include "EventProcessor.h"
#include "FollowerReference.h"
#include "FollowerRefManager.h"
#include "EventProcessor.h"
#include "HostileRefManager.h"
#include "MotionMaster.h"
#include "DBCStructure.h"
#include "SpellInfo.h"
#include "Path.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Timer.h"
#include <list>
#include "Object.h"
#include "SpellAuraDefines.h"
#include "ThreatManager.h"
#define WORLD_TRIGGER 12999
@@ -343,6 +332,7 @@ class Totem;
class Transport;
class Vehicle;
class TransportBase;
class SpellCastTargets;
typedef std::list<Unit*> UnitList;
typedef std::list< std::pair<Aura*, uint8> > DispelChargesList;
+15 -15
View File
@@ -17,25 +17,25 @@
*/
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "Creature.h"
#include "GameObject.h"
#include "DynamicObject.h"
#include "Vehicle.h"
#include "WorldPacket.h"
#include "Item.h"
#include "Corpse.h"
#include "GridNotifiers.h"
#include "MapManager.h"
#include "Map.h"
#include "CellImpl.h"
#include "Corpse.h"
#include "Creature.h"
#include "DynamicObject.h"
#include "GameObject.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Opcodes.h"
#include "ObjectDefines.h"
#include "Item.h"
#include "Map.h"
#include "MapInstanced.h"
#include "MapManager.h"
#include "ObjectDefines.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Pet.h"
#include "Player.h"
#include "Vehicle.h"
#include "World.h"
#include "WorldPacket.h"
#include <cmath>
+32 -27
View File
@@ -16,38 +16,40 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "Chat.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "DB2Structure.h"
#include "DB2Stores.h"
#include "DisableMgr.h"
#include "GameEventMgr.h"
#include "GossipDef.h"
#include "GroupMgr.h"
#include "GuildMgr.h"
#include "InstanceSaveMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "Log.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "ArenaTeamMgr.h"
#include "GuildMgr.h"
#include "GroupMgr.h"
#include "SpellMgr.h"
#include "UpdateMask.h"
#include "World.h"
#include "ArenaTeam.h"
#include "Transport.h"
#include "Language.h"
#include "GameEventMgr.h"
#include "Spell.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "InstanceSaveMgr.h"
#include "SpellAuras.h"
#include "Util.h"
#include "WaypointManager.h"
#include "GossipDef.h"
#include "Vehicle.h"
#include "AchievementMgr.h"
#include "DisableMgr.h"
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "Pet.h"
#include "PoolMgr.h"
#include "DB2Structure.h"
#include "DB2Stores.h"
#include "LFGMgr.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "Spell.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "Transport.h"
#include "UpdateMask.h"
#include "Util.h"
#include "Vehicle.h"
#include "WaypointManager.h"
#include "World.h"
ScriptMapMap sQuestEndScripts;
ScriptMapMap sQuestStartScripts;
@@ -262,11 +264,14 @@ ObjectMgr::~ObjectMgr()
delete[] i->second;
for (int race = 0; race < MAX_RACES; ++race)
{
for (int class_ = 0; class_ < MAX_CLASSES; ++class_)
{
delete[] _playerInfo[race][class_]->levelInfo;
if (_playerInfo[race][class_])
delete[] _playerInfo[race][class_]->levelInfo;
delete _playerInfo[race][class_];
}
}
for (CacheVendorItemContainer::iterator itr = _cacheVendorItemStore.begin(); itr != _cacheVendorItemStore.end(); ++itr)
itr->second.Clear();
+35
View File
@@ -69,6 +69,41 @@ struct PageText
#pragma pack(pop)
#endif
// DB scripting commands
enum ScriptCommands
{
SCRIPT_COMMAND_TALK = 0, // source/target = Creature, target = any, datalong = talk type (0=say, 1=whisper, 2=yell, 3=emote text, 4=boss emote text), datalong2 & 1 = player talk (instead of creature), dataint = string_id
SCRIPT_COMMAND_EMOTE = 1, // source/target = Creature, datalong = emote id, datalong2 = 0: set emote state; > 0: play emote state
SCRIPT_COMMAND_FIELD_SET = 2, // source/target = Creature, datalong = field id, datalog2 = value
SCRIPT_COMMAND_MOVE_TO = 3, // source/target = Creature, datalong2 = time to reach, x/y/z = destination
SCRIPT_COMMAND_FLAG_SET = 4, // source/target = Creature, datalong = field id, datalog2 = bitmask
SCRIPT_COMMAND_FLAG_REMOVE = 5, // source/target = Creature, datalong = field id, datalog2 = bitmask
SCRIPT_COMMAND_TELEPORT_TO = 6, // source/target = Creature/Player (see datalong2), datalong = map_id, datalong2 = 0: Player; 1: Creature, x/y/z = destination, o = orientation
SCRIPT_COMMAND_QUEST_EXPLORED = 7, // target/source = Player, target/source = GO/Creature, datalong = quest id, datalong2 = distance or 0
SCRIPT_COMMAND_KILL_CREDIT = 8, // target/source = Player, datalong = creature entry, datalong2 = 0: personal credit, 1: group credit
SCRIPT_COMMAND_RESPAWN_GAMEOBJECT = 9, // source = WorldObject (summoner), datalong = GO guid, datalong2 = despawn delay
SCRIPT_COMMAND_TEMP_SUMMON_CREATURE = 10, // source = WorldObject (summoner), datalong = creature entry, datalong2 = despawn delay, x/y/z = summon position, o = orientation
SCRIPT_COMMAND_OPEN_DOOR = 11, // source = Unit, datalong = GO guid, datalong2 = reset delay (min 15)
SCRIPT_COMMAND_CLOSE_DOOR = 12, // source = Unit, datalong = GO guid, datalong2 = reset delay (min 15)
SCRIPT_COMMAND_ACTIVATE_OBJECT = 13, // source = Unit, target = GO
SCRIPT_COMMAND_REMOVE_AURA = 14, // source (datalong2 != 0) or target (datalong2 == 0) = Unit, datalong = spell id
SCRIPT_COMMAND_CAST_SPELL = 15, // source and/or target = Unit, datalong2 = cast direction (0: s->t 1: s->s 2: t->t 3: t->s 4: s->creature with dataint entry), dataint & 1 = triggered flag
SCRIPT_COMMAND_PLAY_SOUND = 16, // source = WorldObject, target = none/Player, datalong = sound id, datalong2 (bitmask: 0/1=anyone/player, 0/2=without/with distance dependency, so 1|2 = 3 is target with distance dependency)
SCRIPT_COMMAND_CREATE_ITEM = 17, // target/source = Player, datalong = item entry, datalong2 = amount
SCRIPT_COMMAND_DESPAWN_SELF = 18, // target/source = Creature, datalong = despawn delay
SCRIPT_COMMAND_LOAD_PATH = 20, // source = Unit, datalong = path id, datalong2 = is repeatable
SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT = 21, // source = WorldObject (if present used as a search center), datalong = script id, datalong2 = unit lowguid, dataint = script table to use (see ScriptsType)
SCRIPT_COMMAND_KILL = 22, // source/target = Creature, dataint = remove corpse attribute
// TrinityCore only
SCRIPT_COMMAND_ORIENTATION = 30, // source = Unit, target (datalong > 0) = Unit, datalong = > 0 turn source to face target, o = orientation
SCRIPT_COMMAND_EQUIP = 31, // soucre = Creature, datalong = equipment id
SCRIPT_COMMAND_MODEL = 32, // source = Creature, datalong = model id
SCRIPT_COMMAND_CLOSE_GOSSIP = 33, // source = Player
SCRIPT_COMMAND_PLAYMOVIE = 34 // source = Player, datalong = movie id
};
// Benchmarked: Faster than UNORDERED_MAP (insert/find)
typedef std::map<uint32, PageText> PageTextContainer;
@@ -31,6 +31,7 @@
#include "Unit.h"
#include "CreatureAI.h"
#include "Spell.h"
#include "WorldSession.h"
class Player;
//class Map;
@@ -26,6 +26,7 @@
#include "UpdateData.h"
#include "CreatureAI.h"
#include "SpellAuras.h"
#include "Opcodes.h"
template<class T>
inline void Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
+10 -9
View File
@@ -16,18 +16,19 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "DatabaseEnv.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "GuildFinderMgr.h"
#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "CalendarMgr.h"
#include "Chat.h"
#include "Config.h"
#include "SocialMgr.h"
#include "DatabaseEnv.h"
#include "Guild.h"
#include "GuildFinderMgr.h"
#include "GuildMgr.h"
#include "Language.h"
#include "Log.h"
#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "CalendarMgr.h"
#include "ScriptMgr.h"
#include "SocialMgr.h"
#include "Opcodes.h"
#define MAX_GUILD_BANK_TAB_TEXT_LEN 500
#define EMBLEM_PRICE 10 * GOLD
+1
View File
@@ -19,6 +19,7 @@
#ifndef TRINITYCORE_GUILD_H
#define TRINITYCORE_GUILD_H
#include "AchievementMgr.h"
#include "World.h"
#include "Item.h"
#include "WorldPacket.h"
@@ -27,6 +27,7 @@
#include "ObjectMgr.h"
#include "SocialMgr.h"
#include "ArenaTeamMgr.h"
#include "Opcodes.h"
void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recvData)
{
@@ -24,6 +24,7 @@
#include "AuctionHouseMgr.h"
#include "Log.h"
#include "Language.h"
#include "Opcodes.h"
#include "UpdateMask.h"
#include "Util.h"
@@ -19,6 +19,7 @@
#include "ObjectMgr.h" // for normalizePlayerName
#include "ChannelMgr.h"
#include "Player.h"
#include "WorldSession.h"
void WorldSession::HandleJoinChannel(WorldPacket& recvPacket)
{
+18 -17
View File
@@ -16,36 +16,37 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Common.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "ArenaTeamMgr.h"
#include "GuildMgr.h"
#include "SystemConfig.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "DatabaseEnv.h"
#include "AccountMgr.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "Battleground.h"
#include "CalendarMgr.h"
#include "Chat.h"
#include "Common.h"
#include "DatabaseEnv.h"
#include "Group.h"
#include "Guild.h"
#include "GuildFinderMgr.h"
#include "GuildMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "Pet.h"
#include "PlayerDump.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SharedDefines.h"
#include "SocialMgr.h"
#include "SystemConfig.h"
#include "UpdateMask.h"
#include "Util.h"
#include "ScriptMgr.h"
#include "Battleground.h"
#include "AccountMgr.h"
#include "DBCStores.h"
#include "LFGMgr.h"
#include "CalendarMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
class LoginQueryHolder : public SQLQueryHolder
{
@@ -26,6 +26,7 @@
#include "Vehicle.h"
#include "VehicleDefines.h"
#include "Player.h"
#include "Opcodes.h"
void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData)
{
+11 -13
View File
@@ -18,22 +18,20 @@
#include "Common.h"
#include "DatabaseEnv.h"
#include "Opcodes.h"
#include "Group.h"
#include "GroupMgr.h"
#include "Log.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Pet.h"
#include "Player.h"
#include "SocialMgr.h"
#include "SpellAuras.h"
#include "Util.h"
#include "Vehicle.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "World.h"
#include "ObjectMgr.h"
#include "GroupMgr.h"
#include "Player.h"
#include "Group.h"
#include "SocialMgr.h"
#include "Util.h"
#include "SpellAuras.h"
#include "Vehicle.h"
#include "DB2Structure.h"
#include "DB2Stores.h"
#include "SpellAuraEffects.h"
class Aura;
+1
View File
@@ -23,6 +23,7 @@
#include "LFGMgr.h"
#include "ObjectMgr.h"
#include "GroupMgr.h"
#include "Opcodes.h"
void BuildPlayerLockDungeonBlock(WorldPacket& data, const LfgLockMap& lock)
{
+9 -8
View File
@@ -17,19 +17,20 @@
*/
#include "Common.h"
#include "WorldPacket.h"
#include "Log.h"
#include "Corpse.h"
#include "Creature.h"
#include "GameObject.h"
#include "Player.h"
#include "ObjectAccessor.h"
#include "WorldSession.h"
#include "LootMgr.h"
#include "Object.h"
#include "Group.h"
#include "World.h"
#include "Util.h"
#include "GuildMgr.h"
#include "LootMgr.h"
#include "ObjectAccessor.h"
#include "Object.h"
#include "Opcodes.h"
#include "Player.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recvData)
{
+1
View File
@@ -31,6 +31,7 @@
#include "ObjectAccessor.h"
#include "Creature.h"
#include "Pet.h"
#include "ReputationMgr.h"
#include "BattlegroundMgr.h"
#include "Battleground.h"
#include "ScriptMgr.h"
+4 -3
View File
@@ -18,13 +18,14 @@
#include "Common.h"
#include "DatabaseEnv.h"
#include "Opcodes.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "Opcodes.h"
#include "Player.h"
#include "Pet.h"
#include "UpdateMask.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "ObjectAccessor.h"
#include "UpdateMask.h"
void WorldSession::HandleLearnTalentOpcode(WorldPacket & recvData)
{
+6 -5
View File
@@ -17,15 +17,16 @@
*/
#include "zlib.h"
#include "Language.h"
#include "WorldPacket.h"
#include "Common.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "TicketMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "World.h"
#include "WorldSession.h"
#include "TicketMgr.h"
#include "Util.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
{
+9 -6
View File
@@ -16,15 +16,18 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "InstanceScript.h"
#include "DatabaseEnv.h"
#include "Map.h"
#include "Player.h"
#include "GameObject.h"
#include "Creature.h"
#include "CreatureAI.h"
#include "Log.h"
#include "DatabaseEnv.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
#include "Log.h"
#include "Map.h"
#include "Player.h"
#include "Pet.h"
#include "WorldSession.h"
#include "Opcodes.h"
void InstanceScript::SaveToDB()
{
+12 -11
View File
@@ -17,23 +17,24 @@
*/
#include "Map.h"
#include "GridStates.h"
#include "ScriptMgr.h"
#include "VMapFactory.h"
#include "MapInstanced.h"
#include "Battleground.h"
#include "CellImpl.h"
#include "DynamicTree.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Transport.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "GridStates.h"
#include "Group.h"
#include "InstanceScript.h"
#include "LFGMgr.h"
#include "DynamicTree.h"
#include "MapInstanced.h"
#include "MapManager.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "ScriptMgr.h"
#include "Transport.h"
#include "Vehicle.h"
#include "Battleground.h"
#include "VMapFactory.h"
union u_map_magic
{
+2
View File
@@ -34,6 +34,8 @@
#include "WorldPacket.h"
#include "Group.h"
#include "Player.h"
#include "WorldSession.h"
#include "Opcodes.h"
extern GridState* si_GridStates[]; // debugging code, should be deleted some day
+1
View File
@@ -17,6 +17,7 @@
#include "PhaseMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
+8 -7
View File
@@ -32,19 +32,20 @@ class ZoneScript
virtual uint32 GetCreatureEntry(uint32 /*guidlow*/, CreatureData const* data) { return data->id; }
virtual uint32 GetGameObjectEntry(uint32 /*guidlow*/, uint32 entry) { return entry; }
virtual void OnCreatureCreate(Creature* /*creature*/) {}
virtual void OnCreatureRemove(Creature* /*creature*/) {}
virtual void OnGameObjectCreate(GameObject* /*go*/) {}
virtual void OnGameObjectRemove(GameObject* /*go*/) {}
virtual void OnCreatureCreate(Creature *) { }
virtual void OnCreatureRemove(Creature *) { }
virtual void OnUnitDeath(Unit* /*unit*/) {}
virtual void OnGameObjectCreate(GameObject *) { }
virtual void OnGameObjectRemove(GameObject *) { }
virtual void OnUnitDeath(Unit*) { }
//All-purpose data storage 64 bit
virtual uint64 GetData64(uint32 /*DataId*/) { return 0; }
virtual uint64 GetData64(uint32 /*DataId*/) const { return 0; }
virtual void SetData64(uint32 /*DataId*/, uint64 /*Value*/) {}
//All-purpose data storage 32 bit
virtual uint32 GetData(uint32 /*DataId*/) { return 0; }
virtual uint32 GetData(uint32 /*DataId*/) const { return 0; }
virtual void SetData(uint32 /*DataId*/, uint32 /*Value*/) {}
virtual void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/) {}
@@ -3830,4 +3830,37 @@ enum VoidTransferError
#define CURRENCY_PRECISION 100
enum PartyResult
{
ERR_PARTY_RESULT_OK = 0,
ERR_BAD_PLAYER_NAME_S = 1,
ERR_TARGET_NOT_IN_GROUP_S = 2,
ERR_TARGET_NOT_IN_INSTANCE_S = 3,
ERR_GROUP_FULL = 4,
ERR_ALREADY_IN_GROUP_S = 5,
ERR_NOT_IN_GROUP = 6,
ERR_NOT_LEADER = 7,
ERR_PLAYER_WRONG_FACTION = 8,
ERR_IGNORING_YOU_S = 9,
ERR_LFG_PENDING = 12,
ERR_INVITE_RESTRICTED = 13,
ERR_GROUP_SWAP_FAILED = 14, // if (PartyOperation == PARTY_OP_SWAP) ERR_GROUP_SWAP_FAILED else ERR_INVITE_IN_COMBAT
ERR_INVITE_UNKNOWN_REALM = 15,
ERR_INVITE_NO_PARTY_SERVER = 16,
ERR_INVITE_PARTY_BUSY = 17,
ERR_PARTY_TARGET_AMBIGUOUS = 18,
ERR_PARTY_LFG_INVITE_RAID_LOCKED = 19,
ERR_PARTY_LFG_BOOT_LIMIT = 20,
ERR_PARTY_LFG_BOOT_COOLDOWN_S = 21,
ERR_PARTY_LFG_BOOT_IN_PROGRESS = 22,
ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS = 23,
ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S = 24,
ERR_RAID_DISALLOWED_BY_LEVEL = 25,
ERR_PARTY_LFG_BOOT_IN_COMBAT = 26,
ERR_VOTE_KICK_REASON_NEEDED = 27,
ERR_PARTY_LFG_BOOT_DUNGEON_COMPLETE = 28,
ERR_PARTY_LFG_BOOT_LOOT_ROLLS = 29,
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 30
};
#endif
@@ -59,10 +59,29 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner)
}
else
{
if (i_target->IsWithinDistInMap(&owner, i_offset + 1.0f))
float dist;
float size;
// Pets need special handling.
// We need to subtract GetObjectSize() because it gets added back further down the chain
// and that makes pets too far away. Subtracting it allows pets to properly
// be (GetCombatReach() + i_offset) away.
if (owner.isPet())
{
dist = i_target->GetCombatReach();
size = i_target->GetCombatReach() - i_target->GetObjectSize();
}
else
{
dist = i_offset + 1.0f;
size = owner.GetObjectSize();
}
if (i_target->IsWithinDistInMap(&owner, dist))
return;
// to at i_offset distance from target and i_angle from target facing
i_target->GetClosePoint(x, y, z, owner.GetObjectSize(), i_offset, i_angle);
i_target->GetClosePoint(x, y, z, size, i_offset, i_angle);
}
/*
@@ -22,6 +22,8 @@
#include "Unit.h"
#include "Transport.h"
#include "Vehicle.h"
#include "WorldPacket.h"
#include "Opcodes.h"
namespace Movement
{
@@ -24,6 +24,8 @@
#include "World.h"
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "Opcodes.h"
#include "WorldSession.h"
const int32 ReputationMgr::PointsInRank[MAX_REPUTATION_RANK] = {36000, 3000, 3000, 3000, 6000, 12000, 21000, 1000};
+7 -6
View File
@@ -16,19 +16,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Map.h"
#include "World.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Transport.h"
#include "ScriptedCreature.h"
#include "WaypointManager.h"
#include "GossipDef.h"
#include "Map.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "MapRefManager.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "Transport.h"
#include "WaypointManager.h"
#include "World.h"
/// Put scripts in the execution queue
void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target)
+1
View File
@@ -31,6 +31,7 @@
#include "GossipDef.h"
#include "CreatureAI.h"
#include "Player.h"
#include "WorldPacket.h"
// This is the global static registry of scripts.
template<class TScript>
-34
View File
@@ -94,40 +94,6 @@ enum PartyOperation
PARTY_OP_SWAP = 4
};
enum PartyResult
{
ERR_PARTY_RESULT_OK = 0,
ERR_BAD_PLAYER_NAME_S = 1,
ERR_TARGET_NOT_IN_GROUP_S = 2,
ERR_TARGET_NOT_IN_INSTANCE_S = 3,
ERR_GROUP_FULL = 4,
ERR_ALREADY_IN_GROUP_S = 5,
ERR_NOT_IN_GROUP = 6,
ERR_NOT_LEADER = 7,
ERR_PLAYER_WRONG_FACTION = 8,
ERR_IGNORING_YOU_S = 9,
ERR_LFG_PENDING = 12,
ERR_INVITE_RESTRICTED = 13,
ERR_GROUP_SWAP_FAILED = 14, // if (PartyOperation == PARTY_OP_SWAP) ERR_GROUP_SWAP_FAILED else ERR_INVITE_IN_COMBAT
ERR_INVITE_UNKNOWN_REALM = 15,
ERR_INVITE_NO_PARTY_SERVER = 16,
ERR_INVITE_PARTY_BUSY = 17,
ERR_PARTY_TARGET_AMBIGUOUS = 18,
ERR_PARTY_LFG_INVITE_RAID_LOCKED = 19,
ERR_PARTY_LFG_BOOT_LIMIT = 20,
ERR_PARTY_LFG_BOOT_COOLDOWN_S = 21,
ERR_PARTY_LFG_BOOT_IN_PROGRESS = 22,
ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS = 23,
ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S = 24,
ERR_RAID_DISALLOWED_BY_LEVEL = 25,
ERR_PARTY_LFG_BOOT_IN_COMBAT = 26,
ERR_VOTE_KICK_REASON_NEEDED = 27,
ERR_PARTY_LFG_BOOT_DUNGEON_COMPLETE = 28,
ERR_PARTY_LFG_BOOT_LOOT_ROLLS = 29,
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 30
};
enum BFLeaveReason
{
BF_LEAVE_REASON_CLOSE = 0x00000001,
@@ -39,6 +39,8 @@
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "WeatherMgr.h"
#include "Pet.h"
#include "ReputationMgr.h"
class Aura;
//
+1
View File
@@ -65,6 +65,7 @@
#include "InstanceScript.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "ReputationMgr.h"
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
{
+1
View File
@@ -22,6 +22,7 @@
#include "GridNotifiers.h"
#include "ObjectAccessor.h"
#include "SharedDefines.h"
#include "Opcodes.h"
struct CreatureTextEntry
{
+2
View File
@@ -20,11 +20,13 @@
#include "TicketMgr.h"
#include "DatabaseEnv.h"
#include "Log.h"
#include "Language.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Chat.h"
#include "World.h"
#include "Player.h"
#include "Opcodes.h"
inline float GetAge(uint64 t) { return float(time(NULL) - t) / DAY; }
+1
View File
@@ -22,6 +22,7 @@
#include "UpdateFields.h"
#include "ObjectMgr.h"
#include "AccountMgr.h"
#include "World.h"
#define DUMP_TABLE_COUNT 29
struct DumpTable
+2
View File
@@ -28,6 +28,8 @@
#include "ObjectMgr.h"
#include "Util.h"
#include "ScriptMgr.h"
#include "Opcodes.h"
#include "WorldSession.h"
/// Create the Weather object
Weather::Weather(uint32 zone, WeatherData const* weatherChances)
+3
View File
@@ -26,6 +26,9 @@
#include "ObjectMgr.h"
#include "AutoPtr.h"
#include "Player.h"
#include "WorldPacket.h"
#include "Opcodes.h"
#include "WorldSession.h"
namespace WeatherMgr
{
-35
View File
@@ -491,41 +491,6 @@ enum WorldStates
WS_GUILD_WEEKLY_RESET_TIME = 20007, // Next guild week reset time
};
// DB scripting commands
enum ScriptCommands
{
SCRIPT_COMMAND_TALK = 0, // source/target = Creature, target = any, datalong = talk type (0=say, 1=whisper, 2=yell, 3=emote text, 4=boss emote text), datalong2 & 1 = player talk (instead of creature), dataint = string_id
SCRIPT_COMMAND_EMOTE = 1, // source/target = Creature, datalong = emote id, datalong2 = 0: set emote state; > 0: play emote state
SCRIPT_COMMAND_FIELD_SET = 2, // source/target = Creature, datalong = field id, datalog2 = value
SCRIPT_COMMAND_MOVE_TO = 3, // source/target = Creature, datalong2 = time to reach, x/y/z = destination
SCRIPT_COMMAND_FLAG_SET = 4, // source/target = Creature, datalong = field id, datalog2 = bitmask
SCRIPT_COMMAND_FLAG_REMOVE = 5, // source/target = Creature, datalong = field id, datalog2 = bitmask
SCRIPT_COMMAND_TELEPORT_TO = 6, // source/target = Creature/Player (see datalong2), datalong = map_id, datalong2 = 0: Player; 1: Creature, x/y/z = destination, o = orientation
SCRIPT_COMMAND_QUEST_EXPLORED = 7, // target/source = Player, target/source = GO/Creature, datalong = quest id, datalong2 = distance or 0
SCRIPT_COMMAND_KILL_CREDIT = 8, // target/source = Player, datalong = creature entry, datalong2 = 0: personal credit, 1: group credit
SCRIPT_COMMAND_RESPAWN_GAMEOBJECT = 9, // source = WorldObject (summoner), datalong = GO guid, datalong2 = despawn delay
SCRIPT_COMMAND_TEMP_SUMMON_CREATURE = 10, // source = WorldObject (summoner), datalong = creature entry, datalong2 = despawn delay, x/y/z = summon position, o = orientation
SCRIPT_COMMAND_OPEN_DOOR = 11, // source = Unit, datalong = GO guid, datalong2 = reset delay (min 15)
SCRIPT_COMMAND_CLOSE_DOOR = 12, // source = Unit, datalong = GO guid, datalong2 = reset delay (min 15)
SCRIPT_COMMAND_ACTIVATE_OBJECT = 13, // source = Unit, target = GO
SCRIPT_COMMAND_REMOVE_AURA = 14, // source (datalong2 != 0) or target (datalong2 == 0) = Unit, datalong = spell id
SCRIPT_COMMAND_CAST_SPELL = 15, // source and/or target = Unit, datalong2 = cast direction (0: s->t 1: s->s 2: t->t 3: t->s 4: s->creature with dataint entry), dataint & 1 = triggered flag
SCRIPT_COMMAND_PLAY_SOUND = 16, // source = WorldObject, target = none/Player, datalong = sound id, datalong2 (bitmask: 0/1=anyone/player, 0/2=without/with distance dependency, so 1|2 = 3 is target with distance dependency)
SCRIPT_COMMAND_CREATE_ITEM = 17, // target/source = Player, datalong = item entry, datalong2 = amount
SCRIPT_COMMAND_DESPAWN_SELF = 18, // target/source = Creature, datalong = despawn delay
SCRIPT_COMMAND_LOAD_PATH = 20, // source = Unit, datalong = path id, datalong2 = is repeatable
SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT = 21, // source = WorldObject (if present used as a search center), datalong = script id, datalong2 = unit lowguid, dataint = script table to use (see ScriptsType)
SCRIPT_COMMAND_KILL = 22, // source/target = Creature, dataint = remove corpse attribute
// TrinityCore only
SCRIPT_COMMAND_ORIENTATION = 30, // source = Unit, target (datalong > 0) = Unit, datalong = > 0 turn source to face target, o = orientation
SCRIPT_COMMAND_EQUIP = 31, // soucre = Creature, datalong = equipment id
SCRIPT_COMMAND_MODEL = 32, // source = Creature, datalong = model id
SCRIPT_COMMAND_CLOSE_GOSSIP = 33, // source = Player
SCRIPT_COMMAND_PLAYMOVIE = 34 // source = Player, datalong = movie id
};
/// Storage class for commands issued for delayed execution
struct CliCommandHolder
{
+2 -1
View File
@@ -22,10 +22,11 @@ Comment: All account related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "ScriptMgr.h"
class account_commandscript : public CommandScript
{
@@ -22,9 +22,11 @@ Comment: All achievement related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "AchievementMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "ScriptMgr.h"
class achievement_commandscript : public CommandScript
{
+3 -2
View File
@@ -22,12 +22,13 @@ Comment: All ban related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class ban_commandscript : public CommandScript
{
+2
View File
@@ -24,6 +24,8 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "Creature.h"
#include "Language.h"
#include "Player.h"
class cast_commandscript : public CommandScript
+3 -2
View File
@@ -22,12 +22,13 @@ Comment: All character related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "ObjectMgr.h"
#include "PlayerDump.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
class character_commandscript : public CommandScript
{
+3 -2
View File
@@ -22,10 +22,11 @@ Comment: All cheat related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class cheat_commandscript : public CommandScript
{
+1
View File
@@ -31,6 +31,7 @@ EndScriptData */
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "GossipDef.h"
#include "Language.h"
#include <fstream>
+5 -3
View File
@@ -22,13 +22,15 @@ Comment: All disable related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "AchievementMgr.h"
#include "Chat.h"
#include "DisableMgr.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "OutdoorPvP.h"
#include "SpellMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "SpellMgr.h"
class disable_commandscript : public CommandScript
{
+3 -2
View File
@@ -22,10 +22,11 @@ Comment: All event related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "GameEventMgr.h"
#include "Chat.h"
#include "GameEventMgr.h"
#include "Language.h"
#include "Player.h"
#include "ScriptMgr.h"
class event_commandscript : public CommandScript
{
+2
View File
@@ -26,8 +26,10 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Language.h"
#include "World.h"
#include "Player.h"
#include "Opcodes.h"
class gm_commandscript : public CommandScript
{
+1
View File
@@ -27,6 +27,7 @@ EndScriptData */
#include "MapManager.h"
#include "TicketMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
class go_commandscript : public CommandScript
@@ -28,7 +28,9 @@ EndScriptData */
#include "PoolMgr.h"
#include "MapManager.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "Opcodes.h"
class gobject_commandscript : public CommandScript
{
+3 -1
View File
@@ -22,11 +22,13 @@ Comment: All guild related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "AchievementMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "ObjectAccessor.h"
#include "ScriptMgr.h"
class guild_commandscript : public CommandScript
{
+3 -2
View File
@@ -22,10 +22,11 @@ Comment: All honor related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class honor_commandscript : public CommandScript
{
+2
View File
@@ -25,9 +25,11 @@ EndScriptData */
#include "Chat.h"
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Language.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
#include "Player.h"
#include "Pet.h"
class learn_commandscript : public CommandScript
{

Some files were not shown because too many files have changed in this diff Show More