Core/Spells: Implemented setting spell to cast on arrival from SPELL_EFFECT_JUMP_CHARGE in database (#30210)

This commit is contained in:
Traesh
2025-09-06 23:05:02 +02:00
committed by GitHub
parent 31beaf0ba1
commit b6b0eced74
4 changed files with 39 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
ALTER TABLE `jump_charge_params` ADD COLUMN `triggerSpellId` INT(11) NULL AFTER `parabolicCurveId`;
DELETE FROM `jump_charge_params` WHERE `id` IN (529,530,531,592,574,566,661,557,707,658,719,660,700,693,649,720,648,647,709,702);
INSERT INTO `jump_charge_params` (`id`,`speed`,`treatSpeedAsMoveTimeSeconds`,`jumpGravity`,`spellVisualId`,`progressCurveId`,`parabolicCurveId`,`triggerSpellId`) VALUES
(529, 0.5, 1, 47.8086, NULL, NULL, NULL, NULL),
(530, 0.5, 1, 47.8086, NULL, NULL, NULL, NULL),
(531, 0.15, 1, 526.293, NULL, NULL, NULL, NULL),
(592, 0.3, 1, 266.666, 109373, NULL, NULL, NULL),
(574, 0.04, 1, 5234.23, 108414, NULL, NULL, NULL),
(566, 1, 1, 39.3676, 108168, NULL, NULL, NULL),
(557, 1.25, 1, 19.2911, 109373, NULL, NULL, NULL),
(661, 0.75, 1, 70.9219, NULL, 392, NULL, NULL),
(707, 2, 1, 19.2911, NULL, NULL, NULL, NULL),
(658, 2, 1, 19.2911, 116541, NULL, NULL, 374075),
(719, 2, 1, 23.976, NULL, NULL, NULL, NULL),
(660, 1, 1, 23.9521, NULL, NULL, NULL, NULL),
(700, 0.75, 1, 73.6797, 119220, NULL, NULL, NULL),
(693, 1, 1, 6.96146, 93595, NULL, NULL, 382441),
(649, 0.75, 1, 42.5531, NULL, NULL, NULL, 369696),
(720, 5, 1, 3.19871, NULL, NULL, NULL, NULL),
(648, 0.35, 1, 189.37, NULL, NULL, NULL, 369602),
(647, 0.5, 1, 84.7985, NULL, NULL, NULL, 369424),
(709, 0.233, 1, 19.2911, NULL, NULL, NULL, NULL),
(702, 0.5, 1, 19.2911, NULL, NULL, NULL, NULL);

View File

@@ -12027,8 +12027,8 @@ void ObjectMgr::LoadJumpChargeParams()
// need for reload case
_jumpChargeParams.clear();
// 0 1 2 3 4 5 6
QueryResult result = WorldDatabase.Query("SELECT id, speed, treatSpeedAsMoveTimeSeconds, jumpGravity, spellVisualId, progressCurveId, parabolicCurveId FROM jump_charge_params");
// 0 1 2 3 4 5 6 7
QueryResult result = WorldDatabase.Query("SELECT id, speed, treatSpeedAsMoveTimeSeconds, jumpGravity, spellVisualId, progressCurveId, parabolicCurveId, triggerSpellId FROM jump_charge_params");
if (!result)
{
return;
@@ -12045,6 +12045,7 @@ void ObjectMgr::LoadJumpChargeParams()
Optional<int32> spellVisualId = fields[4].GetInt32OrNull();
Optional<int32> progressCurveId = fields[5].GetInt32OrNull();
Optional<int32> parabolicCurveId = fields[6].GetInt32OrNull();
Optional<int32> triggerSpellId = fields[7].GetInt32OrNull();
if (speed <= 0.0f)
{
@@ -12081,6 +12082,13 @@ void ObjectMgr::LoadJumpChargeParams()
parabolicCurveId.reset();
}
if (triggerSpellId && !sSpellMgr->GetSpellInfo(*triggerSpellId, DIFFICULTY_NONE))
{
TC_LOG_DEBUG("sql.sql", "Table `jump_charge_params` references non-existing trigger spell id: {} for id {}, ignored.",
*triggerSpellId, id);
triggerSpellId.reset();
}
JumpChargeParams& params = _jumpChargeParams[id];
params.Speed = speed;
params.TreatSpeedAsMoveTimeSeconds = treatSpeedAsMoveTimeSeconds;
@@ -12088,6 +12096,7 @@ void ObjectMgr::LoadJumpChargeParams()
params.SpellVisualId = spellVisualId;
params.ProgressCurveId = progressCurveId;
params.ParabolicCurveId = parabolicCurveId;
params.TriggerSpellId = triggerSpellId;
} while (result->NextRow());

View File

@@ -153,6 +153,7 @@ struct JumpChargeParams
Optional<uint32> SpellVisualId;
Optional<uint32> ProgressCurveId;
Optional<uint32> ParabolicCurveId;
Optional<uint32> TriggerSpellId;
};
using MovementFacingTarget = std::variant<std::monostate, Position, Unit const*, float>;

View File

@@ -5865,10 +5865,11 @@ void Spell::EffectJumpCharge()
}
Optional<JumpArrivalCastArgs> arrivalCast;
if (effectInfo->TriggerSpell)
if (effectInfo->TriggerSpell || params->TriggerSpellId)
{
arrivalCast.emplace();
arrivalCast->SpellId = effectInfo->TriggerSpell;
arrivalCast->SpellId = params->TriggerSpellId ? *params->TriggerSpellId : effectInfo->TriggerSpell;
arrivalCast->Target = unitTarget ? unitTarget->GetGUID() : ObjectGuid::Empty;
}
Optional<Movement::SpellEffectExtraData> effectExtra;