Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-07-05 10:24:47 -06:00
committed by GitHub
28 changed files with 363 additions and 164 deletions

View File

@@ -0,0 +1,3 @@
-- DB update 2022_07_01_01 -> 2022_07_01_02
--
UPDATE `creature_template` SET `DamageModifier` = 26 WHERE `entry` = 15163;

View File

@@ -0,0 +1,7 @@
-- DB update 2022_07_01_02 -> 2022_07_01_03
--
DELETE FROM `creature_template_movement` WHERE `CreatureId` IN (15242, 18707, 22441, 8276);
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`) VALUES (15242, 1, 0, 1, 0, 0, 0),
(18707, 1, 0, 1, 0, 0, 0),
(22441, 1, 0, 1, 0, 0, 0),
(8276, 1, 0, 1, 0, 0, 0);

View File

@@ -0,0 +1,6 @@
-- DB update 2022_07_01_03 -> 2022_07_02_00
--
DELETE FROM `creature_formations` WHERE `memberGUID` IN (49313, 49314);
INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
(49310, 49313, 0, 0, 27, 0, 0),
(49310, 49314, 0, 0, 27, 0, 0);

View File

@@ -0,0 +1,4 @@
-- DB update 2022_07_02_00 -> 2022_07_02_01
--
UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x00200000 WHERE `entry` IN (29618,29619);
UPDATE `smart_scripts` SET `target_type`=23 WHERE `entryorguid`=29475 AND `source_type`=0 AND `id` IN (2,3);

View File

@@ -0,0 +1,4 @@
-- DB update 2022_07_02_01 -> 2022_07_02_02
DELETE FROM `spell_script_names` WHERE `spell_id` = 45644;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(45644, "spell_midsummer_torch_catch");

View File

@@ -0,0 +1,4 @@
-- DB update 2022_07_02_02 -> 2022_07_03_00
--
UPDATE `smart_scripts` SET `event_flags`=512 WHERE `entryorguid`=24823 AND `source_type`=0;
UPDATE `smart_scripts` SET `event_phase_mask`=0, `event_param3`=5000, `event_param4`=5000 WHERE `entryorguid`=24718 AND `source_type`=0 AND `id`=1;

View File

@@ -0,0 +1,5 @@
-- DB update 2022_07_03_00 -> 2022_07_03_01
--
DELETE FROM `smart_scripts` WHERE `entryorguid`=3177300 AND `source_type`=9 AND `id`=46;
INSERT INTO `smart_scripts` VALUES
(3177300,9,46,0,0,0,100,0,0,0,0,0,0,28,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Script9 - Remove all auras');

View File

@@ -0,0 +1,4 @@
-- DB update 2022_07_03_01 -> 2022_07_03_02
--
UPDATE `smart_scripts` SET `event_flags`=512 WHERE `entryorguid`=28750 AND `source_type`=0 AND `id`=5;
UPDATE `smart_scripts` SET `event_flags`=512 WHERE `entryorguid`=2875000 AND `source_type`=9;

View File

@@ -0,0 +1,3 @@
-- DB update 2022_07_03_02 -> 2022_07_03_03
--
UPDATE `smart_scripts` SET `action_param3`=1 WHERE `entryorguid`=26293 AND `source_type`=0 AND `id`=2;

View File

@@ -0,0 +1,14 @@
-- DB update 2022_07_03_03 -> 2022_07_03_04
-- delete wrong game_graveyard link to graveyard_zone
DELETE FROM `graveyard_zone` WHERE `ID`=469 AND `GhostZone`=141;
DELETE FROM `graveyard_zone` WHERE `ID`=469 AND `GhostZone`=1657;
-- originally was faction 469 alliance and should be 0 ID originally 469
DELETE FROM `graveyard_zone` WHERE `ID`=91 AND `GhostZone`=141;
INSERT INTO `graveyard_zone` (`ID`, `GhostZone`, `Faction`, `Comment`) VALUES
(91, 141, 0, 'Teldrassil, Dolanaar GY');
-- id originally 469
DELETE FROM `graveyard_zone` WHERE `ID`=91 AND `GhostZone`=1657;
INSERT INTO `graveyard_zone` (`ID`, `GhostZone`, `Faction`, `Comment`) VALUES
(91, 1657, 67, 'Teldrassil, Dolanaar GY');

View File

@@ -0,0 +1,81 @@
-- DB update 2022_07_03_04 -> 2022_07_03_05
--
SET @NPC_HEBJIN := 28636;
SET @NPC_BAT := 28639;
SET @GO_DRUM := 190695;
DELETE FROM `creature` WHERE `guid` IN (117079,117301);
UPDATE `creature_template` SET `speed_run`=0.857143, `unit_flags`=33024, `AIName`='SmartAI' WHERE `entry`=@NPC_HEBJIN;
UPDATE `creature_template` SET `speed_run`=2, `unit_flags`=256, `AIName`='SmartAI' WHERE `entry`=@NPC_BAT;
DELETE FROM `event_scripts` WHERE `id`=18773;
INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
(18773,0,10,@NPC_HEBJIN,180000,0,5988.715,-3878.036,417.1502,2.356194);
UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@GO_DRUM;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_HEBJIN,@NPC_BAT) AND `source_type`=0;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@GO_DRUM AND `source_type`=1;
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_HEBJIN*100,@NPC_BAT*100) AND `source_type`=9;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@NPC_HEBJIN,0,0,0,54,0,100,0,0,0,0,0,80,@NPC_HEBJIN*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin - Just summoned - Run script'),
(@NPC_HEBJIN,0,1,2,38,0,100,0,0,1,0,0,11,52354,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Heb''Jin - On data 0 1 set - Spellcast Script Effect - Creature Attack GUID from Dot Variable'),
(@NPC_HEBJIN,0,2,3,61,0,100,0,0,0,0,0,101,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin - On data 0 1 set - Set Home Pos'),
(@NPC_HEBJIN,0,3,4,61,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,5937.22,-3820.871,366.5563,0, 'Heb''Jin - On data 0 1 set - Move to position'),
(@NPC_HEBJIN,0,4,5,61,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin - On data 0 1 set - Say line'),
(@NPC_HEBJIN,0,5,6,61,0,100,0,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin - On data 0 1 set - Remove unit_flags IMMUNE_TO_PC'),
(@NPC_HEBJIN,0,6,0,61,0,100,0,0,0,0,0,49,0,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Heb''Jin - On data 0 1 set - Start attack'),
(@NPC_HEBJIN,0,7,0,0,0,100,0,1000,1000,7000,8000,11,12734,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin - On update IC - Spellcast Ground Smash'),
(@NPC_HEBJIN,0,8,0,0,0,100,0,5000,5000,10000,12000,11,15548,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin - On update IC - Spellcast Thunder Clap'),
(@NPC_HEBJIN,0,9,0,13,0,100,0,12000,15000,0,0,11,12555,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Heb''Jin - On target casting - Spellcast Pummel'),
(@NPC_BAT,0,0,1,11,0,100,0,0,0,0,0,91,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On spawn - Remove unit_field_bytes1 (dead)'),
(@NPC_BAT,0,1,2,61,0,100,0,0,0,0,0,11,52353,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Heb''Jin''s Bat - On spawn - Spellcast Script Effect - Creature Capture GUID to Dot Variable'),
(@NPC_BAT,0,2,0,61,0,100,0,0,0,0,0,4,10892,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On spawn - Play sound'),
(@NPC_BAT,0,3,0,27,0,100,1,0,0,0,0,53,1,@NPC_BAT,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On passenger boarded - Start WP movement'),
(@NPC_BAT,0,4,5,40,0,100,0,4,@NPC_BAT,0,0,28,43671,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On WP 4 reached - Remove aura Ride Vehicle'),
(@NPC_BAT,0,5,6,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,@NPC_HEBJIN,10,0,0,0,0,0, 'Heb''Jin''s Bat - On WP 4 reached - Set data 0 1 Heb''Jin'),
(@NPC_BAT,0,6,0,61,0,100,0,0,0,0,0,80,@NPC_BAT*100,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On WP 4 reached - Run script'),
(@NPC_BAT,0,7,8,8,0,100,0,52151,0,0,0,18,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On spellhit Bat Net - Set unit_flags IMMUNE_TO_PC'),
(@NPC_BAT,0,8,9,61,0,100,0,0,0,0,0,90,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On spellhit Bat Net - Set unit_field_bytes1 (dead)'),
(@NPC_BAT,0,9,0,61,0,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat - On spellhit Bat Net - Despawn after 5 seconds'),
(@GO_DRUM,1,0,1,70,0,100,0,2,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Heb''Jin''s Drum - On state changed - Store targetlist'),
(@GO_DRUM,1,1,0,61,0,100,0,0,0,0,0,100,1,0,0,0,0,0,19,@NPC_HEBJIN,100,0,0,0,0,0, 'Heb''Jin''s Drum - On state changed - Send targetlist to Heb''Jin'),
(@NPC_HEBJIN*100,9,0,0,0,0,100,0,0,0,0,0,11,52353,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Heb''Jin script - Spellcast Script Effect - Creature Capture GUID to Dot Variable'),
(@NPC_HEBJIN*100,9,1,0,0,0,100,0,3200,3200,0,0,11,52154,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin script - Spellcast Taunt'),
(@NPC_HEBJIN*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin script - Say line'),
(@NPC_HEBJIN*100,9,3,0,0,0,100,0,300,300,0,0,12,@NPC_BAT,8,0,0,0,0,8,0,0,0,5984.547,-3882.621,417.4379,1.919862, 'Heb''Jin script - Summon Heb''Jin''s Bat'),
(@NPC_HEBJIN*100,9,4,0,0,0,100,0,0,0,0,0,100,1,0,0,0,0,0,19,@NPC_BAT,10,0,0,0,0,0, 'Heb''Jin script - Send targetlist'),
(@NPC_HEBJIN*100,9,5,0,0,0,100,0,5700,5700,0,0,1,1,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Heb''Jin script - Say line'),
(@NPC_HEBJIN*100,9,6,0,0,0,100,0,2400,2400,0,0,11,43671,0,0,0,0,0,19,@NPC_BAT,10,0,0,0,0,0, 'Heb''Jin script - Spellcast Ride Vehicle'),
(@NPC_BAT*100,9,0,0,0,0,100,0,2000,2000,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Heb''Jin''s Bat script 1 - Remove unit_flags IMMUNE_TO_PC'),
(@NPC_BAT*100,9,1,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Heb''Jin''s Bat script 1 - Start attack');
DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=190695;
DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=19069500;
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
(190695, 1, 0, 1, 70, 0, 100, 0, 2, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Heb\'Jin\'s Drum - On state changed - Store targetlist'),
(190695, 1, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 19069500, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Heb\'Jin\'s Drum - Linked with Previous Event - Run Script'),
(19069500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 98562, 23837, 0, 0, 0,0,0, 'Heb\'Jin\'s Drum - Script - Set Data ELM General Purpose Bunny'),
(19069500, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 100, 1, 0, 0, 0, 0, 0, 19, 28636, 100, 0, 0, 0, 0, 0, 'Heb\'Jin\'s Drum - Script - Send Target list to heb jin');
UPDATE `smart_scripts` SET `action_param2`=2, `action_param3`=300000 WHERE `entryorguid`=2863600 AND `source_type`=9 AND `id`=3 AND `link`=0;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=28636 AND `id`=9;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=28639 AND `id`=10;
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
(28636, 0, 9, 0, 7, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Heb Jin - On Evade - Despawn'),
(28639, 0, 10, 0, 7, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Heb Jins Bat - On Evade - Despawn');
DELETE FROM `event_scripts` WHERE `id`=18773;
DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=-98562;
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
(-98562, 0, 0, 1, 38, 0, 100, 0, 1, 1, 0, 0, 45, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'ELM General Purpose Bunny - On Data Set - Set Data'),
(-98562, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 12, 28636, 2, 300000, 0, 0, 0, 8, 0, 0, 0, 5988.71, -3878.04, 417.15, 2.35619, 'ELM General Purpose Bunny - Linked with Previous Event - Spawn Heb Jin');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceId`=0 AND `SourceEntry`=-98562;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(22, 1, -98562, 0, 0, 29, 1, 28636, 200, 0, 1, 0, 0, '', 'Only run SAI if no heb jin nearby'),
(22, 1, -98562, 0, 0, 29, 1, 28639, 200, 0, 1, 0, 0, '', 'Only run SAI if no heb jins bat nearby');

View File

@@ -0,0 +1,3 @@
-- DB update 2022_07_03_05 -> 2022_07_03_06
--
UPDATE `smart_scripts` SET `target_type`=12, `target_param1`=1 WHERE `entryorguid`=19720 AND `source_type`=0 AND `id`=22;

View File

@@ -0,0 +1,3 @@
-- DB update 2022_07_03_06 -> 2022_07_03_07
--
UPDATE `creature_template` SET `mingold` = 0, `maxgold` = 0 WHERE (`entry` = 4196);

View File

@@ -0,0 +1,23 @@
-- DB update 2022_07_03_07 -> 2022_07_05_00
--
DELETE FROM `waypoint_data` WHERE `id`=518940;
INSERT INTO `acore_world`.`waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`) VALUES
(518940, 1, 3866.84, -672.53, 328.888),
(518940, 2, 3866.84, -672.534, 328.888),
(518940, 3, 3818.17, -768.04, 314.71),
(518940, 4, 3881.4, -769.048, 311.51),
(518940, 5, 3892.74, -762.76, 312.98),
(518940, 6, 3863.57, -759.42, 312.95),
(518940, 7, 3844.86, -719.223, 324.47),
(518940, 8, 3894.64, -635.31, 336.71),
(518940, 9, 3932.94, -611.101, 340.266),
(518940, 10, 3981.27, -598.98, 338.19),
(518940, 11, 3932.94, -611.101, 340.266),
(518940, 12, 3894.64, -635.31, 336.71),
(518940, 13, 3844.86, -719.223, 324.47),
(518940, 14, 3863.57, -759.42, 312.95),
(518940, 15, 3892.74, -762.76, 312.98),
(518940, 16, 3881.4, -769.048, 311.51),
(518940, 17, 3818.17, -768.04, 314.71),
(518940, 18, 3866.84, -672.534, 328.888),
(518940, 19, 3866.84, -672.53, 328.888);

View File

@@ -0,0 +1,3 @@
-- DB update 2022_07_05_00 -> 2022_07_05_01
-- fixed `Anatoly Will Talk` quest
UPDATE `smart_scripts` SET `event_flags`= 512 WHERE `entryorguid`= 2762600;

View File

@@ -5099,8 +5099,8 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry)
return;
}
// Do NOT allow to start a new actionlist if a previous one is already running. We need to always finish the current actionlist
if (!mTimedActionList.empty())
// Do NOT allow to start a new actionlist if a previous one is already running, unless explicitly allowed. We need to always finish the current actionlist
if (!e.action.timedActionList.allowOverride && !mTimedActionList.empty())
{
return;
}

View File

@@ -1774,9 +1774,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
AC_SAI_IS_BOOLEAN_VALID(e, e.action.setHealthRegen.regenHealth);
break;
}
case SMART_ACTION_CALL_TIMED_ACTIONLIST:
{
AC_SAI_IS_BOOLEAN_VALID(e, e.action.timedActionList.allowOverride);
break;
}
case SMART_ACTION_FLEE_FOR_ASSIST:
case SMART_ACTION_MOVE_TO_POS:
case SMART_ACTION_CALL_TIMED_ACTIONLIST:
case SMART_ACTION_EVADE:
case SMART_ACTION_SET_ACTIVE:
case SMART_ACTION_START_CLOSEST_WAYPOINT:

View File

@@ -1081,6 +1081,7 @@ struct SmartAction
{
uint32 id;
uint32 timerType;
SAIBool allowOverride;
} timedActionList;
struct

View File

@@ -383,8 +383,6 @@ public:
void ModifyThreatPercentTemp(Unit* victim, int32 percent, Milliseconds duration);
void ResetFaction() { SetFaction(GetCreatureTemplate()->faction); }
protected:
bool CreateFromProto(ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, const CreatureData* data = nullptr);
bool InitEntry(uint32 entry, const CreatureData* data = nullptr);

View File

@@ -13181,7 +13181,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy, uint32 duration)
// xinef: if we somehow engage in combat (scripts, dunno) with player, remove this flag so he can fight back
if (GetTypeId() == TYPEID_UNIT && enemy && IsImmuneToPC() && enemy->GetCharmerOrOwnerPlayerOrPlayerItself())
SetImmuneToPC(true); // unit has engaged in combat, remove immunity so players can fight back
SetImmuneToPC(false); // unit has engaged in combat, remove immunity so players can fight back
if (IsInCombat())
return;

View File

@@ -4295,6 +4295,24 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Dispel = DISPEL_NONE;
});
// Summon Nightmare Illusions
ApplySpellFix({ 24681, 24728, 24729 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].MiscValueB = 64;
});
// Place Fake Fur
ApplySpellFix({ 46085 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].MiscValue = 8;
});
// Smash Mammoth Trap
ApplySpellFix({ 46201 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].MiscValue = 8;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo* spellInfo = mSpellInfoMap[i];

View File

@@ -15,13 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Hazzarah
SD%Complete: 100
SDComment:
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
@@ -45,100 +38,98 @@ enum Events
EVENT_ILLUSIONS = 4
};
class boss_hazzarah : public CreatureScript
struct boss_hazzarah : public BossAI
{
public:
boss_hazzarah() : CreatureScript("boss_hazzarah") { }
boss_hazzarah(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { }
struct boss_hazzarahAI : public BossAI
void JustSummoned(Creature* summon) override
{
boss_hazzarahAI(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { }
summons.Summon(summon);
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
summon->SetCorpseDelay(10);
summon->SetReactState(REACT_PASSIVE);
summon->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE);
summon->SetVisible(false);
summon->m_Events.AddEventAtOffset([summon]()
summon->SetCorpseDelay(10);
summon->SetReactState(REACT_PASSIVE);
summon->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE);
summon->SetVisible(false);
summon->m_Events.AddEventAtOffset([summon]()
{
summon->SetVisible(true);
}, 2s);
summon->m_Events.AddEventAtOffset([summon]()
summon->m_Events.AddEventAtOffset([summon]()
{
summon->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE);
summon->SetReactState(REACT_AGGRESSIVE);
summon->SetInCombatWithZone();
}, 3500ms);
}
}, 5s);
}
void EnterCombat(Unit* /*who*/) override
void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
{
summons.Despawn(summon);
summon->DespawnOrUnsummon();
}
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
events.ScheduleEvent(EVENT_SLEEP, 12s, 15s);
events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s);
events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s);
events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s);
}
bool CanAIAttack(Unit const* target) const override
{
if (me->GetThreatMgr().getThreatList().size() > 1 && me->GetThreatMgr().getOnlineContainer().getMostHated()->getTarget() == target)
return !target->HasAura(SPELL_SLEEP);
return true;
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
_EnterCombat();
events.ScheduleEvent(EVENT_SLEEP, 12s, 15s);
events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s);
events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s);
events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s);
}
bool CanAIAttack(Unit const* target) const override
{
if (me->GetThreatMgr().getThreatList().size() > 1 && me->GetThreatMgr().getOnlineContainer().getMostHated()->getTarget() == target)
return !target->HasAura(SPELL_SLEEP);
return true;
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
switch (eventId)
{
switch (eventId)
{
case EVENT_SLEEP:
DoCastVictim(SPELL_SLEEP, true);
events.ScheduleEvent(EVENT_SLEEP, 24s, 32s);
return;
case EVENT_EARTH_SHOCK:
DoCastVictim(SPELL_EARTH_SHOCK);
events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s);
break;
case EVENT_CHAIN_BURN:
case EVENT_SLEEP:
DoCastVictim(SPELL_SLEEP, true);
events.ScheduleEvent(EVENT_SLEEP, 24s, 32s);
return;
case EVENT_EARTH_SHOCK:
DoCastVictim(SPELL_EARTH_SHOCK);
events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s);
break;
case EVENT_CHAIN_BURN:
if (me->GetPowerPct(POWER_MANA) > 5.f) // totally guessed
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA; }))
{
DoCast(target, SPELL_CHAIN_BURN, false);
DoCast(target, SPELL_CHAIN_BURN);
}
events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s);
break;
case EVENT_ILLUSIONS:
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_LEFT, true);
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_BACK, true);
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_RIGHT, true);
events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s);
break;
default:
break;
}
}
events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s);
break;
case EVENT_ILLUSIONS:
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_LEFT, true);
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_BACK, true);
DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_RIGHT, true);
events.ScheduleEvent(EVENT_ILLUSIONS, 15s, 25s);
break;
default:
break;
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetZulGurubAI<boss_hazzarahAI>(creature);
DoMeleeAttackIfReady();
}
};
@@ -164,6 +155,6 @@ class spell_chain_burn : public SpellScript
void AddSC_boss_hazzarah()
{
new boss_hazzarah();
RegisterZulGurubCreatureAI(boss_hazzarah);
RegisterSpellScript(spell_chain_burn);
}

View File

@@ -71,9 +71,6 @@ public:
Initialize();
}
bool Enraged;
bool WasDead;
void Initialize()
{
Enraged = false;
@@ -90,17 +87,16 @@ public:
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetReactState(REACT_AGGRESSIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->LoadEquipment(1, true);
if (Creature* zealot = instance->GetCreature(DATA_LORKHAN))
{
zealot->AI()->Reset();
zealot->ResetFaction();
}
if (Creature* zealot = instance->GetCreature(DATA_ZATH))
{
zealot->AI()->Reset();
zealot->ResetFaction();
}
_scheduler.SetValidator([this]
@@ -157,16 +153,21 @@ public:
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (!WasDead && damage >= me->GetHealth())
if (me->GetEntry() == NPC_HIGH_PRIEST_THEKAL && damage >= me->GetHealth())
{
damage = me->GetHealth() - 1;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->AttackStop();
WasDead = true;
CheckPhaseTransition();
Talk(EMOTE_THEKAL_DIES);
if (!WasDead)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->AttackStop();
DoResetThreat();
WasDead = true;
CheckPhaseTransition();
Talk(EMOTE_THEKAL_DIES);
}
}
if (!Enraged && me->HealthBelowPctDamaged(20, damage) && me->GetEntry() != NPC_HIGH_PRIEST_THEKAL)
@@ -182,7 +183,7 @@ public:
{
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->ResetFaction();
me->RestoreFaction();
me->SetReactState(REACT_AGGRESSIVE);
me->SetFullHealth();
WasDead = false;
@@ -202,11 +203,7 @@ public:
{
if (Creature* zealot = instance->GetCreature(zealotData))
{
zealot->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
zealot->ResetFaction();
zealot->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
zealot->SetReactState(REACT_AGGRESSIVE);
zealot->SetFullHealth();
zealot->Respawn(true);
UpdateZealotStatus(zealotData, false);
}
}
@@ -231,10 +228,10 @@ public:
Talk(SAY_AGGRO);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
DoResetThreat();
_scheduler.Schedule(6s, [this](TaskContext /*context*/) {
DoCastSelf(SPELL_TIGER_FORM);
me->LoadEquipment(0, true);
me->SetReactState(REACT_AGGRESSIVE);
_scheduler.Schedule(30s, [this](TaskContext context) {
@@ -261,7 +258,10 @@ public:
else
{
_scheduler.Schedule(10s, [this](TaskContext /*context*/) {
DoAction(ACTION_RESSURRECT);
if (!(WasDead && _lorkhanDied && _zathDied))
{
DoAction(ACTION_RESSURRECT);
}
});
}
}
@@ -271,6 +271,8 @@ public:
GuidVector _catGuids;
bool _lorkhanDied;
bool _zathDied;
bool Enraged;
bool WasDead;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -295,10 +297,6 @@ public:
void Reset() override
{
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
_scheduler.CancelAll();
_scheduler.SetValidator([this]
@@ -339,24 +337,13 @@ public:
});
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override
void JustDied(Unit* /*killer*/) override
{
if (damage >= me->GetHealth() && me->HasReactState(REACT_AGGRESSIVE))
Talk(EMOTE_ZEALOT_DIES);
if (Creature* thekal = instance->GetCreature(DATA_THEKAL))
{
Talk(EMOTE_ZEALOT_DIES);
me->RemoveAllAuras();
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->SetReactState(REACT_PASSIVE);
me->InterruptNonMeleeSpells(false);
me->AttackStop();
damage = 0;
if (Creature* thekal = instance->GetCreature(DATA_THEKAL))
{
thekal->AI()->SetData(ACTION_RESSURRECT, DATA_LORKHAN);
}
thekal->AI()->SetData(ACTION_RESSURRECT, DATA_LORKHAN);
}
}
@@ -395,10 +382,6 @@ public:
void Reset() override
{
me->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
_scheduler.CancelAll();
_scheduler.SetValidator([this]
@@ -436,23 +419,13 @@ public:
});
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override
void JustDied(Unit* /*killer*/) override
{
if (damage >= me->GetHealth() && me->HasReactState(REACT_AGGRESSIVE))
Talk(EMOTE_ZEALOT_DIES);
if (Creature* thekal = instance->GetCreature(DATA_THEKAL))
{
Talk(EMOTE_ZEALOT_DIES);
me->RemoveAllAuras();
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
damage = 0;
if (Creature* thekal = instance->GetCreature(DATA_THEKAL))
{
thekal->AI()->SetData(ACTION_RESSURRECT, DATA_ZATH);
}
thekal->AI()->SetData(ACTION_RESSURRECT, DATA_ZATH);
}
}

View File

@@ -51,7 +51,6 @@ public:
instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetBossNumber(EncounterCount);
LoadObjectData(creatureData, nullptr);
LoadDoorData(doorData);
LoadObjectData(creatureData, nullptr);
}

View File

@@ -453,7 +453,8 @@ enum eJuggle
SPELL_TORCH_CHECK = 45644,
SPELL_GIVE_TORCH = 45280,
QUEST_CHECK = 11937,
QUEST_TORCH_CATCHING_A = 11657,
QUEST_TORCH_CATCHING_H = 11923
};
class spell_midsummer_juggling_torch : public SpellScript
@@ -507,6 +508,36 @@ class spell_midsummer_juggling_torch : public SpellScript
}
};
// 45644 - Juggle Torch (Catch)
class spell_midsummer_torch_catch : public SpellScript
{
PrepareSpellScript(spell_midsummer_torch_catch);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_GIVE_TORCH });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* player = GetHitPlayer();
if (!player)
{
return;
}
if (player->GetQuestStatus(QUEST_TORCH_CATCHING_A) == QUEST_STATUS_REWARDED || player->GetQuestStatus(QUEST_TORCH_CATCHING_H) == QUEST_STATUS_REWARDED)
{
player->CastSpell(player, SPELL_GIVE_TORCH);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_midsummer_torch_catch::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_event_midsummer_scripts()
{
// NPCs
@@ -520,4 +551,5 @@ void AddSC_event_midsummer_scripts()
RegisterSpellScript(spell_midsummer_torch_quest);
RegisterSpellScript(spell_midsummer_fling_torch);
RegisterSpellScript(spell_midsummer_juggling_torch);
RegisterSpellScript(spell_midsummer_torch_catch);
}

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaBoundary.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "azjol_nerub.h"
@@ -34,6 +35,13 @@ ObjectData const creatureData[] =
{ NPC_HADRONOX, DATA_HADRONOX_EVENT }
};
BossBoundaryData const boundaries =
{
{ DATA_KRIKTHIR_THE_GATEWATCHER_EVENT, new RectangleBoundary(400.0f, 580.0f, 623.5f, 810.0f) },
{ DATA_HADRONOX_EVENT, new ZRangeBoundary(666.0f, 776.0f) },
{ DATA_ANUBARAK_EVENT, new CircleBoundary(Position(550.6178f, 253.5917f), 26.0f) }
};
class instance_azjol_nerub : public InstanceMapScript
{
public:
@@ -44,6 +52,7 @@ public:
instance_azjol_nerub_InstanceScript(Map* map) : InstanceScript(map)
{
SetBossNumber(MAX_ENCOUNTERS);
LoadBossBoundaries(boundaries);
LoadDoorData(doorData);
LoadObjectData(creatureData, nullptr);
};

View File

@@ -125,20 +125,27 @@ public:
{
if (HealthBelowPct(50) && !health50)
{
WorldObject* summoner = nullptr;
if (TempSummon const* tempSummon = me->ToTempSummon())
{
summoner = tempSummon->GetSummonerUnit();
if (WorldObject* summoner = tempSummon->GetSummonerUnit())
{
Talk(SAY_TURMOIL_HALF_HP, summoner);
}
}
Talk(SAY_TURMOIL_HALF_HP, summoner);
health50 = true;
}
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_TURMOIL_DEATH, me->ToTempSummon()->GetSummonerUnit()->ToPlayer());
if (TempSummon const* tempSummon = me->ToTempSummon())
{
if (WorldObject* summoner = tempSummon->GetSummonerUnit())
{
Talk(SAY_TURMOIL_DEATH, summoner);
}
}
}
void setphase(short newPhase)

View File

@@ -821,19 +821,19 @@ public:
if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL))
break;
Map::PlayerList const& players = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
std::list<Player*> targets;
Acore::AnyPlayerInObjectRangeCheck check(me, me->GetVisibilityRange(), false);
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck> searcher(me, targets, check);
Cell::VisitWorldObjects(me, searcher, me->GetVisibilityRange());
for (Player* player : targets)
{
if (Player* player = itr->GetSource())
if (player->GetTeamId() == TEAM_HORDE)
{
if (player->GetTeamId() == TEAM_HORDE)
{
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player);
}
else
{
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
}
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player);
}
else
{
me->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
}
}