Compare commits

...

7 Commits

Author SHA1 Message Date
sogladev
545ce4c267
Merge 8d1498cf3bca43e8e3caad83a60db1fc7f5971d7 into dab83dd19eeee975bb7e8bb70c29064eba3bf334 2025-11-08 09:20:20 +01:00
github-actions[bot]
dab83dd19e chore(DB): import pending files
Referenced commit(s): af779202e623986de4f00fb0f82f61c40dddcc43
2025-11-08 07:04:47 +00:00
Benjamin Jackson
af779202e6
fix(Core): Move and adjust experience modifiers for instanced elite creatures. (#23563) 2025-11-08 02:03:43 -05:00
Andrew
09e0343491
fix(Scripts/Ahnkahet): Clean up Herald Volazj insanity casting and ph… (#23549) 2025-11-07 19:37:42 -03:00
github-actions[bot]
433be02111 chore(DB): import pending files
Referenced commit(s): 494326656def0b998da319e109a51503d719dd22
2025-11-07 18:21:09 +00:00
Rocco Silipo
494326656d
fix(DB/Script): Add various corrections to Massacre At Light's Point event. (#23558) 2025-11-07 19:20:04 +01:00
Jelle Meeus
8d1498cf3b
fix(Core/SmartAI): unused params warnings 2025-11-06 16:59:29 +01:00
6 changed files with 2620 additions and 387 deletions

View File

@ -0,0 +1,108 @@
-- DB update 2025_11_07_01 -> 2025_11_07_02
-- Add Waypoints (Scarlet Miner)
DELETE FROM `waypoint_data` WHERE (`id` IN (2884100, 2884101));
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
(2884100, 1, 2376.9087, -5906.2495, 108.593, NULL, 0, 1, 0, 100, 0),
(2884100, 2, 2340.1587, -5903.4995, 102.593, NULL, 0, 1, 0, 100, 0),
(2884100, 3, 2306.4087, -5904.7495, 90.593, NULL, 0, 1, 0, 100, 0),
(2884100, 4, 2292.6587, -5917.4995, 82.343, NULL, 0, 1, 0, 100, 0),
(2884100, 5, 2285.6587, -5943.4995, 64.093, NULL, 0, 1, 0, 100, 0),
(2884100, 6, 2271.9087, -5968.4995, 49.843, NULL, 0, 1, 0, 100, 0),
(2884100, 7, 2248.1587, -5978.4995, 36.843, NULL, 0, 1, 0, 100, 0),
(2884100, 8, 2234.6587, -5996.9995, 25.842999, NULL, 0, 1, 0, 100, 0),
(2884100, 9, 2223.4087, -6014.9995, 11.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 10, 2216.1587, -6035.9995, 7.3429985, NULL, 0, 1, 0, 100, 0),
(2884100, 11, 2195.4087, -6061.2495, 6.3429985, NULL, 0, 1, 0, 100, 0),
(2884100, 12, 2184.4087, -6091.9995, 2.0929985, NULL, 0, 1, 0, 100, 0),
(2884100, 13, 2179.6587, -6120.2495, 1.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 14, 2175.4087, -6142.9995, 1.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 15, 2167.9087, -6159.4995, 1.8429985, NULL, 0, 1, 0, 100, 0),
(2884100, 16, 2149.4087, -6161.4995, 1.5929985, NULL, 0, 1, 0, 100, 0),
(2884100, 17, 2134.9087, -6166.2495, 0.8429985, NULL, 0, 1, 0, 100, 0),
(2884100, 18, 2130.9087, -6173.2495, 4.3429985, NULL, 0, 1, 0, 100, 0),
(2884100, 19, 2125.9087, -6180.7495, 10.0929985, NULL, 0, 1, 0, 100, 0),
(2884100, 20, 2123.4087, -6184.7495, 14.0929985, NULL, 0, 1, 0, 100, 0),
(2884100, 21, 2115.9087, -6196.2495, 13.8429985, NULL, 0, 1, 0, 100, 0),
(2884100, 22, 2119.1106, -6191.905, 13.275559, NULL, 0, 1, 0, 100, 0),
(2884101, 1, 2376.855, -5906.1553, 108.57493, NULL, 0, 1, 0, 100, 0),
(2884101, 2, 2340.105, -5903.4053, 102.57493, NULL, 0, 1, 0, 100, 0),
(2884101, 3, 2306.855, -5904.9053, 90.57493, NULL, 0, 1, 0, 100, 0),
(2884101, 4, 2292.855, -5917.6553, 82.32493, NULL, 0, 1, 0, 100, 0),
(2884101, 5, 2285.855, -5943.4053, 64.07493, NULL, 0, 1, 0, 100, 0),
(2884101, 6, 2272.105, -5968.4053, 49.82493, NULL, 0, 1, 0, 100, 0),
(2884101, 7, 2248.355, -5978.4053, 36.82493, NULL, 0, 1, 0, 100, 0),
(2884101, 8, 2234.605, -5996.9053, 25.824928, NULL, 0, 1, 0, 100, 0),
(2884101, 9, 2223.605, -6015.1553, 11.574928, NULL, 0, 1, 0, 100, 0),
(2884101, 10, 2216.105, -6035.9053, 7.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 11, 2195.105, -6059.4053, 6.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 12, 2184.855, -6087.1553, 3.0749283, NULL, 0, 1, 0, 100, 0),
(2884101, 13, 2180.605, -6119.4053, 1.5749283, NULL, 0, 1, 0, 100, 0),
(2884101, 14, 2177.605, -6149.4053, 1.8249283, NULL, 0, 1, 0, 100, 0),
(2884101, 15, 2188.855, -6170.4053, 1.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 16, 2213.105, -6165.4053, 1.0749283, NULL, 0, 1, 0, 100, 0),
(2884101, 17, 2241.855, -6160.4053, 2.0749283, NULL, 0, 1, 0, 100, 0),
(2884101, 18, 2269.105, -6163.4053, 2.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 19, 2269.605, -6168.9053, 2.3249283, NULL, 0, 1, 0, 100, 0),
(2884101, 20, 2270.105, -6174.6553, 5.8249283, NULL, 0, 1, 0, 100, 0),
(2884101, 21, 2270.605, -6180.9053, 9.824928, NULL, 0, 1, 0, 100, 0),
(2884101, 22, 2271.105, -6186.1553, 14.074928, NULL, 0, 1, 0, 100, 0),
(2884101, 23, 2273.855, -6196.4053, 13.824928, NULL, 0, 1, 0, 100, 0),
(2884101, 24, 2273.0032, -6191.717, 13.239414, NULL, 0, 1, 0, 100, 0);
-- Remove Script Names.
UPDATE `creature_template` SET `ScriptName` = '' WHERE (`entry` IN (28817, 28833, 28841));
UPDATE `gameobject_template` SET `ScriptName` = '' WHERE (`entry` = 190767);
-- Set spell target position for Mine Car spawn.
UPDATE `spell_target_position` SET `PositionX` = 2389.58, `PositionY` = -5901.18, `PositionZ` = 109.02134, `Orientation` = 0 WHERE `ID` = 52462;
-- Set Unit Flag for Mine Car (immune_to_npc)
UPDATE `creature_template` SET `unit_flags` = `unit_flags` |512 WHERE (`entry` = 28817);
-- Set SmartAI (Mine Car)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28817;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28817);
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28817, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 3, 0, 25703, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mine Car - On Just Summoned - Morph To Model 25703'),
(28817, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 12, 28841, 8, 0, 0, 0, 0, 8, 0, 0, 0, 0, 2382.171, -5899.672, 107.74545, 0, 'Mine Car - On Just Summoned - Summon Creature \'Scarlet Miner\''),
(28817, 0, 2, 0, 8, 0, 100, 0, 52465, 0, 0, 0, 0, 0, 29, 3, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Mine Car - On Spellhit \'Drag Mine Cart\' - Start Follow Invoker');
-- Set SmartAI (Scarlet Miner)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28841;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28841);
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28841, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2884100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - On Just Summoned - Run Script'),
(28841, 0, 1, 0, 109, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2884101, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - On Path 0 Finished - Run Script');
-- Set Scarlet Miner Action List
DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (2884100, 2884101));
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(2884100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Set Run Off'),
(2884100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 1, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Move To Owner Or Summoner'),
(2884100, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Say Line 0'),
(2884100, 9, 3, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 11, 52465, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Cast \'Drag Mine Cart\''),
(2884100, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Set Run On'),
(2884100, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 233, 2884100, 2884101, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Start Random Path 2884100-2884101'),
(2884101, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Set Orientation Owner Or Summoner'),
(2884101, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Say Line 1'),
(2884101, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 28, 52465, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Remove Aura \'Drag Mine Cart\''),
(2884101, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Despawn Instant'),
(2884101, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Miner - Actionlist - Despawn Instant');
-- Set SmartAI (Scarlet Fleet Defender)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28834;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28834);
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28834, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 3000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Fleet Defender - On Just Died - Despawn In 3000 ms'),
(28834, 0, 1, 0, 0, 0, 100, 0, 1000, 5000, 5000, 8000, 0, 0, 11, 52566, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Fleet Defender - In Combat - Cast \'Shoot\'');
-- Update SmartAI (Scarlet Cannon)
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28850;
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28850) AND (`source_type` = 0) AND (`id` IN (2));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28850, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 3000, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Land Cannon - On Just Died - Despawn In 3000 ms');

File diff suppressed because it is too large Load Diff

View File

@ -884,6 +884,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e)
case SMART_ACTION_MOVEMENT_RESUME: return sizeof(SmartAction::move); case SMART_ACTION_MOVEMENT_RESUME: return sizeof(SmartAction::move);
case SMART_ACTION_WORLD_SCRIPT: return sizeof(SmartAction::worldStateScript); case SMART_ACTION_WORLD_SCRIPT: return sizeof(SmartAction::worldStateScript);
case SMART_ACTION_DISABLE_REWARD: return sizeof(SmartAction::reward); case SMART_ACTION_DISABLE_REWARD: return sizeof(SmartAction::reward);
case SMART_ACTION_DISMOUNT: return NO_PARAMS;
default: default:
LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an action with no unused params specified in SmartAIMgr::CheckUnusedActionParams(), please report this.", LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an action with no unused params specified in SmartAIMgr::CheckUnusedActionParams(), please report this.",
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
@ -948,6 +949,9 @@ bool SmartAIMgr::CheckUnusedTargetParams(SmartScriptHolder const& e)
case SMART_TARGET_VEHICLE_PASSENGER: return sizeof(SmartTarget::vehicle); case SMART_TARGET_VEHICLE_PASSENGER: return sizeof(SmartTarget::vehicle);
// case SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT: return sizeof(SmartTarget::goClosest); // case SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT: return sizeof(SmartTarget::goClosest);
case SMART_TARGET_PLAYER_WITH_AURA: return sizeof(SmartTarget::playerWithAura); case SMART_TARGET_PLAYER_WITH_AURA: return sizeof(SmartTarget::playerWithAura);
case SMART_TARGET_RANDOM_POINT: return sizeof(SmartTarget::randomPoint);
case SMART_TARGET_SUMMONED_CREATURES: return sizeof(SmartTarget::summonedCreatures);
case SMART_TARGET_INSTANCE_STORAGE: return sizeof(SmartTarget::instanceStorage);
default: default:
LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using a target {} with no unused params specified in SmartAIMgr::CheckUnusedTargetParams(), please report this.", LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using a target {} with no unused params specified in SmartAIMgr::CheckUnusedTargetParams(), please report this.",
e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType()); e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType());

View File

@ -84,14 +84,9 @@ uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false
if (gain && creature) if (gain && creature)
{ {
if (creature->isElite()) if (creature->isElite())
{ xpMod *= 2.0f;
// Elites in instances have a 2.75x XP bonus instead of the regular 2x world bonus.
if (unit->GetMap() && unit->GetMap()->IsDungeon())
xpMod *= 2.75f;
else
xpMod *= 2.0f;
}
// Instanced mobs (particularly bosses) oftentimes have higher bonuses, especially in later content levels
xpMod *= creature->GetCreatureTemplate()->ModExperience; xpMod *= creature->GetCreatureTemplate()->ModExperience;
} }

View File

@ -502,49 +502,6 @@ public:
}; };
}; };
class npc_scarlet_cannon : public CreatureScript
{
public:
npc_scarlet_cannon() : CreatureScript("npc_scarlet_cannon") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_scarlet_cannonAI(creature);
}
struct npc_scarlet_cannonAI : public VehicleAI
{
npc_scarlet_cannonAI(Creature* creature) : VehicleAI(creature) { summonAttackers = 0; }
uint32 summonAttackers;
void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool apply) override
{
summonAttackers = apply ? 8000 : 0;
}
void UpdateAI(uint32 diff) override
{
VehicleAI::UpdateAI(diff);
if (summonAttackers)
{
summonAttackers += diff;
if (summonAttackers >= 15000)
{
for (uint8 i = 0; i < 15; ++i)
if (Creature* summon = me->SummonCreature(28834 /*NPC_SCARLET_FLEET_DEFENDER*/, 2192.56f + irand(-10, 10), -6147.90f + irand(-10, 10), 5.2f, 4.7f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 45000))
{
summon->SetHomePosition(me->GetHomePosition());
summon->AI()->AttackStart(me);
}
summonAttackers = 1;
}
}
}
};
};
/*###### /*######
##Quest 12848 ##Quest 12848
######*/ ######*/
@ -835,253 +792,6 @@ public:
} }
}; };
/*####
## npc_scarlet_miner_cart
####*/
enum Spells_SM
{
SPELL_CART_CHECK = 54173,
SPELL_CART_DRAG = 52465
};
class npc_scarlet_miner_cart : public CreatureScript
{
public:
npc_scarlet_miner_cart() : CreatureScript("npc_scarlet_miner_cart") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_scarlet_miner_cartAI(creature);
}
struct npc_scarlet_miner_cartAI : public PassiveAI
{
npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature)
{
me->SetImmuneToAll(true);
me->SetFaction(FACTION_FRIENDLY);
me->SetDisplayFromModel(0); // Modelid2 is a horse.
}
ObjectGuid minerGUID;
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
minerGUID = guid;
}
void DoAction(int32 /*param*/) override
{
if (Creature* miner = ObjectAccessor::GetCreature(*me, minerGUID))
{
me->SetWalk(false);
//Not 100% correct, but movement is smooth. Sometimes miner walks faster
//than normal, this speed is fast enough to keep up at those times.
me->SetSpeed(MOVE_RUN, 1.25f);
me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0);
me->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToAll(true);
me->SetFaction(FACTION_FRIENDLY);
}
}
void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
{
who->SetVisible(!apply);
if (!apply)
if (Creature* miner = ObjectAccessor::GetCreature(*me, minerGUID))
miner->DisappearAndDie();
}
};
};
/*####
## npc_scarlet_miner
####*/
enum Says_SM
{
SAY_SCARLET_MINER_0 = 0,
SAY_SCARLET_MINER_1 = 1
};
class npc_scarlet_miner : public CreatureScript
{
public:
npc_scarlet_miner() : CreatureScript("npc_scarlet_miner") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_scarlet_minerAI(creature);
}
struct npc_scarlet_minerAI : public npc_escortAI
{
npc_scarlet_minerAI(Creature* creature) : npc_escortAI(creature)
{
me->SetReactState(REACT_PASSIVE);
}
uint32 IntroTimer;
uint32 IntroPhase;
ObjectGuid carGUID;
void Reset() override
{
carGUID.Clear();
IntroTimer = 0;
IntroPhase = 0;
}
void InitWaypoint()
{
AddWaypoint(1, 2389.03f, -5902.74f, 109.014f, 5000);
AddWaypoint(2, 2341.812012f, -5900.484863f, 102.619743f);
AddWaypoint(3, 2308.34f, -5904.2f, 91.1099f);
AddWaypoint(4, 2300.69f, -5912.99f, 86.1572f);
AddWaypoint(5, 2294.142090f, -5927.274414f, 75.316849f);
AddWaypoint(6, 2286.984375f, -5944.955566f, 63.714966f);
AddWaypoint(7, 2280.001709f, -5961.186035f, 54.228283f);
AddWaypoint(8, 2259.389648f, -5974.197754f, 42.359348f);
AddWaypoint(9, 2242.882812f, -5984.642578f, 32.827850f);
AddWaypoint(10, 2239.79f, -5989.31f, 30.4453f);
AddWaypoint(11, 2236.52f, -5994.28f, 27.4829f);
AddWaypoint(12, 2232.61f, -6000.23f, 23.1281f);
AddWaypoint(13, 2228.69f, -6006.46f, 17.6638f);
AddWaypoint(14, 2225.2f, -6012.39f, 12.9487f);
AddWaypoint(15, 2217.265625f, -6028.959473f, 7.675705f);
AddWaypoint(16, 2202.595947f, -6061.325684f, 5.882018f);
AddWaypoint(17, 2188.974609f, -6080.866699f, 3.370027f);
if (urand(0, 1))
{
AddWaypoint(18, 2176.483887f, -6110.407227f, 1.855181f);
AddWaypoint(19, 2172.516602f, -6146.752441f, 1.074235f);
AddWaypoint(20, 2138.918457f, -6158.920898f, 1.342926f);
AddWaypoint(21, 2129.866699f, -6174.107910f, 4.380779f);
AddWaypoint(22, 2125.250001f, -6181.230001f, 9.91997f);
AddWaypoint(23, 2117.709473f, -6193.830078f, 13.3542f, 10000);
}
else
{
AddWaypoint(18, 2184.190186f, -6166.447266f, 0.968877f);
AddWaypoint(19, 2234.265625f, -6163.741211f, 0.916021f);
AddWaypoint(20, 2268.071777f, -6158.750977f, 1.822252f);
AddWaypoint(21, 2270.028320f, -6176.505859f, 6.340538f);
AddWaypoint(22, 2270.350001f, -6182.410001f, 10.42431f);
AddWaypoint(23, 2271.739014f, -6195.401855f, 13.3542f, 10000);
}
}
void InitCartQuest(Player* who)
{
carGUID = who->GetVehicleBase()->GetGUID();
InitWaypoint();
me->SetWalk(true);
Start(false, who->GetGUID());
SetDespawnAtFar(false);
}
void WaypointReached(uint32 waypointId) override
{
switch (waypointId)
{
case 1:
if (Unit* car = ObjectAccessor::GetCreature(*me, carGUID))
{
me->SetFacingToObject(car);
// xinef: add some flags
car->ReplaceAllUnitFlags(UNIT_FLAG_NON_ATTACKABLE);
car->SetImmuneToAll(true);
car->SetFaction(FACTION_FRIENDLY);
}
Talk(SAY_SCARLET_MINER_0);
me->SetWalk(false);
IntroTimer = 4000;
IntroPhase = 1;
break;
case 23:
if (Creature* car = ObjectAccessor::GetCreature(*me, carGUID))
{
car->SetPosition(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ() + 1, car->GetOrientation());
car->StopMovingOnCurrentPos();
me->SetFacingToObject(car);
car->RemoveAura(SPELL_CART_DRAG);
}
Talk(SAY_SCARLET_MINER_1);
break;
default:
break;
}
}
void UpdateAI(uint32 diff) override
{
if (IntroPhase)
{
if (IntroTimer <= diff)
{
if (IntroPhase == 1)
{
if (Creature* car = ObjectAccessor::GetCreature(*me, carGUID))
DoCast(car, SPELL_CART_DRAG);
IntroTimer = 800;
IntroPhase = 2;
}
else
{
if (Creature* car = ObjectAccessor::GetCreature(*me, carGUID))
car->AI()->DoAction(0);
IntroPhase = 0;
}
}
else IntroTimer -= diff;
}
npc_escortAI::UpdateAI(diff);
}
};
};
/*######
## go_inconspicuous_mine_car
######*/
enum Spells_Cart
{
SPELL_CART_SUMM = 52463
};
class go_inconspicuous_mine_car : public GameObjectScript
{
public:
go_inconspicuous_mine_car() : GameObjectScript("go_inconspicuous_mine_car") { }
bool OnGossipHello(Player* player, GameObject* /*go*/) override
{
if (player->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE)
{
// Hack Why Trinity Dont Support Custom Summon Location
if (Creature* miner = player->SummonCreature(28841, 2383.869629f, -5900.312500f, 107.996086f, player->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1))
{
player->CastSpell(player, SPELL_CART_SUMM, true);
if (Creature* car = player->GetVehicleCreatureBase())
{
if (car->GetEntry() == 28817)
{
car->AI()->SetGUID(miner->GetGUID());
CAST_AI(npc_scarlet_miner::npc_scarlet_minerAI, miner->AI())->InitCartQuest(player);
}
}
}
}
return true;
}
};
class spell_death_knight_initiate_visual : public SpellScript class spell_death_knight_initiate_visual : public SpellScript
{ {
PrepareSpellScript(spell_death_knight_initiate_visual); PrepareSpellScript(spell_death_knight_initiate_visual);
@ -1219,13 +929,9 @@ void AddSC_the_scarlet_enclave_c1()
RegisterSpellScript(spell_q12698_the_gift_that_keeps_on_giving); RegisterSpellScript(spell_q12698_the_gift_that_keeps_on_giving);
new npc_scarlet_ghoul(); new npc_scarlet_ghoul();
new npc_dkc1_gothik(); new npc_dkc1_gothik();
new npc_scarlet_cannon();
new npc_unworthy_initiate(); new npc_unworthy_initiate();
new npc_unworthy_initiate_anchor(); new npc_unworthy_initiate_anchor();
new go_acherus_soul_prison(); new go_acherus_soul_prison();
new npc_scarlet_miner();
new npc_scarlet_miner_cart();
new go_inconspicuous_mine_car();
RegisterSpellScript(spell_death_knight_initiate_visual); RegisterSpellScript(spell_death_knight_initiate_visual);
RegisterSpellScript(spell_lich_king_whisper); RegisterSpellScript(spell_lich_king_whisper);
RegisterSpellScript(spell_lich_king_vo_blocker); RegisterSpellScript(spell_lich_king_vo_blocker);

View File

@ -77,51 +77,52 @@ enum Misc
DATA_SET_INSANITY_PHASE = 1, DATA_SET_INSANITY_PHASE = 1,
}; };
enum Events
{
EVENT_HERALD_MIND_FLAY = 1,
EVENT_HERALD_SHADOW,
EVENT_HERALD_SHIVER,
};
const std::array<uint32, MAX_INSANITY_TARGETS> InsanitySpells = { SPELL_INSANITY_PHASING_1, SPELL_INSANITY_PHASING_2, SPELL_INSANITY_PHASING_3, SPELL_INSANITY_PHASING_4, SPELL_INSANITY_PHASING_5 }; const std::array<uint32, MAX_INSANITY_TARGETS> InsanitySpells = { SPELL_INSANITY_PHASING_1, SPELL_INSANITY_PHASING_2, SPELL_INSANITY_PHASING_3, SPELL_INSANITY_PHASING_4, SPELL_INSANITY_PHASING_5 };
struct boss_volazj : public BossAI struct boss_volazj : public BossAI
{ {
boss_volazj(Creature* pCreature) : BossAI(pCreature, DATA_HERALD_VOLAZJ), boss_volazj(Creature* pCreature) : BossAI(pCreature, DATA_HERALD_VOLAZJ),
insanityTimes(0),
insanityPhase(false) insanityPhase(false)
{ } { }
void InitializeAI() override
{
BossAI::InitializeAI();
// Visible for all players in insanity
me->SetPhaseMask((1 | 16 | 32 | 64 | 128 | 256), true);
}
void Reset() override void Reset() override
{ {
_Reset(); _Reset();
insanityTimes = 0;
insanityPhase = false; insanityPhase = false;
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_STUNNED); me->SetControlled(false, UNIT_STATE_STUNNED);
ResetPlayersPhaseMask(); ResetPlayersPhaseMask();
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT); instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
me->SetPhaseMask((1 | 16 | 32 | 64 | 128 | 256), true);
ScheduleHealthCheckEvent({ 66, 33 }, [&]{
scheduler.CancelAll();
DoCastSelf(SPELL_INSANITY);
}, false);
}
void ScheduleTasks() override
{
ScheduleTimedEvent(8s, [&] {
DoCastVictim(SPELL_MIND_FLAY);
}, 20s);
ScheduleTimedEvent(5s, [&] {
DoCastVictim(SPELL_SHADOW_BOLT_VOLLEY);
}, 5s);
ScheduleTimedEvent(15s, [&] {
DoCastRandomTarget(SPELL_SHIVER);
}, 15s);
} }
void JustEngagedWith(Unit* /*who*/) override void JustEngagedWith(Unit* /*who*/) override
{ {
_JustEngagedWith(); _JustEngagedWith();
events.ScheduleEvent(EVENT_HERALD_MIND_FLAY, 8s);
events.ScheduleEvent(EVENT_HERALD_SHADOW, 5s);
events.ScheduleEvent(EVENT_HERALD_SHIVER, 15s);
Talk(SAY_AGGRO); Talk(SAY_AGGRO);
DoCastSelf(SPELL_WHISPER_AGGRO); DoCastSelf(SPELL_WHISPER_AGGRO);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT); instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
me->SetInCombatWithZone();
} }
void JustDied(Unit* /*killer*/) override void JustDied(Unit* /*killer*/) override
@ -184,36 +185,13 @@ struct boss_volazj : public BossAI
} }
} }
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override
{
// Do not perform insanity recast if boss is casting Insanity already
if (me->FindCurrentSpellBySpellId(SPELL_INSANITY))
{
return;
}
// First insanity
if (insanityTimes == 0 && me->HealthBelowPctDamaged(66, damage))
{
DoCastSelf(SPELL_INSANITY, false);
++insanityTimes;
}
// Second insanity
else if (insanityTimes == 1 && me->HealthBelowPctDamaged(33, damage))
{
me->InterruptNonMeleeSpells(false);
DoCastSelf(SPELL_INSANITY, false);
++insanityTimes;
}
}
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
{ {
//Return since we have no target //Return since we have no target
if (!UpdateVictim()) if (!UpdateVictim())
{
return; return;
}
scheduler.Update(diff);
if (insanityPhase) if (insanityPhase)
{ {
@ -226,53 +204,13 @@ struct boss_volazj : public BossAI
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_STUNNED); me->SetControlled(false, UNIT_STATE_STUNNED);
me->RemoveAurasDueToSpell(INSANITY_VISUAL); me->RemoveAurasDueToSpell(INSANITY_VISUAL);
} ScheduleTasks();
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
while (uint32 const eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_HERALD_MIND_FLAY:
{
DoCastVictim(SPELL_MIND_FLAY, false);
events.Repeat(20s);
break;
}
case EVENT_HERALD_SHADOW:
{
DoCastVictim(SPELL_SHADOW_BOLT_VOLLEY, false);
events.Repeat(5s);
break;
}
case EVENT_HERALD_SHIVER:
{
if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
{
DoCast(pTarget, SPELL_SHIVER, false);
}
events.Repeat(15s);
break;
}
}
if (me->HasUnitState(UNIT_STATE_CASTING))
{
return;
}
} }
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
private: private:
uint8 insanityTimes;
bool insanityPhase; // Indicates if boss enter to insanity phase bool insanityPhase; // Indicates if boss enter to insanity phase
uint32 GetPlrInsanityAuraId(uint32 phaseMask) const uint32 GetPlrInsanityAuraId(uint32 phaseMask) const
@ -312,6 +250,7 @@ private:
bool CheckPhaseMinions() bool CheckPhaseMinions()
{ {
summons.RemoveNotExisting(); summons.RemoveNotExisting();
if (summons.empty()) if (summons.empty())
{ {
ResetPlayersPhaseMask(); ResetPlayersPhaseMask();