Core/Spells: Implement SPELL_EFFECT_TELEPORT_TO_RETURN_POINT

Port From (https://github.com/TrinityCore/TrinityCore/commit/1c852af7f2c820e429eaf8389822e8c910f961a1)
This commit is contained in:
hondacrx
2021-03-29 16:36:05 -04:00
parent 369e36819d
commit 047a6babfc
11 changed files with 208 additions and 7 deletions
+21 -5
View File
@@ -139,7 +139,7 @@ namespace Game.Spells
return totalTicks;
}
void ResetPeriodic(bool resetPeriodicTimer = false)
{
_ticksDone = 0;
@@ -774,9 +774,9 @@ namespace Game.Spells
public void SetPeriodicTimer(int periodicTimer) { _periodicTimer = periodicTimer; }
void RecalculateAmount(AuraEffect triggeredBy = null)
{
{
if (!CanBeRecalculated())
return;
return;
ChangeAmount(CalculateAmount(GetCaster()), false, false, triggeredBy);
}
@@ -3099,7 +3099,7 @@ namespace Game.Spells
player.UpdateArmor();
}
[AuraEffectHandler(AuraType.ModStatBonusPct)]
void HandleModStatBonusPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
@@ -4640,7 +4640,7 @@ namespace Game.Spells
target.CastSpell(target, triggerSpell, true);
}
[AuraEffectHandler(AuraType.OpenStable)]
void HandleAuraOpenStable(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
@@ -5698,6 +5698,22 @@ namespace Game.Spells
else
bg.RemovePlayerPosition(target.GetGUID());
}
[AuraEffectHandler(AuraType.StoreTeleportReturnPoint)]
void HandleStoreTeleportReturnPoint(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
return;
Player playerTarget = aurApp.GetTarget().ToPlayer();
if (playerTarget == null)
return;
if (apply)
playerTarget.AddStoredAuraTeleportLocation(GetSpellInfo().Id);
else if (!playerTarget.GetSession().IsLogingOut())
playerTarget.RemoveStoredAuraTeleportLocation(GetSpellInfo().Id);
}
#endregion
}
+14
View File
@@ -5139,6 +5139,20 @@ namespace Game.Spells
player.SendPacket(packet);
}
void EffectTeleportToReturnPoint(uint effIndex)
{
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
return;
Player player = unitTarget.ToPlayer();
if (player != null)
{
WorldLocation dest = player.GetStoredAuraTeleportLocation((uint)effectInfo.MiscValue);
if (dest != null)
player.TeleportTo(dest, unitTarget == m_caster ? TeleportToOptions.Spell | TeleportToOptions.NotLeaveCombat : 0);
}
}
[SpellEffectHandler(SpellEffectName.SummonRafFriend)]
void EffectSummonRaFFriend(uint effIndex)
{