aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2022_07_16_05_world.sql27
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp40
2 files changed, 67 insertions, 0 deletions
diff --git a/sql/updates/world/master/2022_07_16_05_world.sql b/sql/updates/world/master/2022_07_16_05_world.sql
new file mode 100644
index 00000000000..cf75b952126
--- /dev/null
+++ b/sql/updates/world/master/2022_07_16_05_world.sql
@@ -0,0 +1,27 @@
+-- Serverside Spell
+DELETE FROM `serverside_spell` WHERE `ID` = 147066;
+INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `Stances`, `StancesNot`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `StartRecoveryCategory`, `StartRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags1`, `AuraInterruptFlags2`, `ChannelInterruptFlags1`, `ChannelInterruptFlags2`, `ProcFlags`, `ProcFlags2`, `ProcChance`, `ProcCharges`, `ProcCooldown`, `ProcBasePPM`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `Speed`, `LaunchDelay`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `ContentTuningId`, `SpellName`, `ConeAngle`, `ConeWidth`, `MaxTargetLevel`, `MaxAffectedTargets`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `SpellFamilyFlags4`, `DmgClass`, `PreventionType`, `AreaGroupId`, `SchoolMask`, `ChargeCategoryId`) VALUES
+(147066, 0, 0, 0, 0, 0x9000080, 0x20, 0x4000, 0x10000000, 0x80, 0x1000008, 0x1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 1, 0, 0, 0, -1, 0, 0, 0, '(Serverside/Non-DB2) Generic - Mount Check Aura', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+DELETE FROM `serverside_spell_effect` WHERE `SpellID` = 147066;
+INSERT INTO `serverside_spell_effect` (`SpellID`, `EffectIndex`, `DifficultyID`, `Effect`, `EffectAura`, `EffectAmplitude`, `EffectAttributes`, `EffectAuraPeriod`, `EffectBonusCoefficient`, `EffectChainAmplitude`, `EffectChainTargets`, `EffectItemType`, `EffectMechanic`, `EffectPointsPerResource`, `EffectPosFacing`, `EffectRealPointsPerLevel`, `EffectTriggerSpell`, `BonusCoefficientFromAP`, `PvpMultiplier`, `Coefficient`, `Variance`, `ResourceCoefficient`, `GroupSizeBasePointsCoefficient`, `EffectBasePoints`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectSpellClassMask1`, `EffectSpellClassMask2`, `EffectSpellClassMask3`, `EffectSpellClassMask4`, `ImplicitTarget1`, `ImplicitTarget2`) VALUES
+(147066, 0, 0, 6, 226, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+
+-- Spell Script
+DELETE FROM `spell_script_names` WHERE `spell_id`= 147066;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(147066, 'spell_gen_mount_check_aura');
+
+-- Creature Summoned
+DELETE FROM `creature_summoned_data` WHERE `CreatureID` IN (182084, 182088);
+INSERT INTO `creature_summoned_data` (`CreatureID`, `CreatureIDVisibleToSummoner`, `GroundMountDisplayID`, `FlyingMountDisplayID`) VALUES
+(182084, 182085, 103104, 103104),
+(182088, 182089, 103104, 103104);
+
+-- Creature Addon
+DELETE FROM `creature_template_addon` WHERE `entry` IN (90382, 91911, 182084, 182088);
+INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
+(90382, 0, 0, 0, 1, 0, 0, 0, 0, 0, '147066'),
+(91911, 0, 0, 0, 1, 0, 0, 0, 0, 0, '147066'),
+(182084, 0, 0, 0, 1, 0, 0, 0, 0, 0, '147066'),
+(182088, 0, 0, 0, 1, 0, 0, 0, 0, 0, '147066');
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 68c6b6a7c1d..1aa75e40d48 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -4993,6 +4993,45 @@ class spell_gen_anchor_here : public SpellScript
}
};
+// 147066 - (Serverside/Non-DB2) Generic - Mount Check Aura
+class spell_gen_mount_check_aura : public AuraScript
+{
+ PrepareAuraScript(spell_gen_mount_check_aura);
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ Unit* target = GetTarget();
+ uint32 mountDisplayId = 0;
+
+ TempSummon* tempSummon = target->ToTempSummon();
+ if (!tempSummon)
+ return;
+
+ Player const* summoner = Object::ToPlayer(tempSummon->GetSummoner());
+ if (!summoner)
+ return;
+
+ if (summoner->IsMounted() && (!summoner->IsInCombat() || summoner->IsFlying()))
+ {
+ if (CreatureSummonedData const* summonedData = sObjectMgr->GetCreatureSummonedData(tempSummon->GetEntry()))
+ {
+ if (summoner->IsFlying() && summonedData->FlyingMountDisplayID)
+ mountDisplayId = *summonedData->FlyingMountDisplayID;
+ else if (summonedData->GroundMountDisplayID)
+ mountDisplayId = *summonedData->GroundMountDisplayID;
+ }
+ }
+
+ if (mountDisplayId != target->GetMountDisplayId())
+ target->SetMountDisplayId(mountDisplayId);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_mount_check_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
void AddSC_generic_spell_scripts()
{
RegisterSpellScript(spell_gen_absorb0_hitlimit1);
@@ -5147,4 +5186,5 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_defender_of_azeroth_speak_with_mograine);
RegisterSpellScript(spell_summon_battle_pet);
RegisterSpellScript(spell_gen_anchor_here);
+ RegisterSpellScript(spell_gen_mount_check_aura);
}