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
@@ -2288,6 +2288,31 @@ namespace Game.Entities
return false;
}
public void AddStoredAuraTeleportLocation(uint spellId)
{
StoredAuraTeleportLocation storedLocation = new();
storedLocation.Loc = new WorldLocation(this);
storedLocation.CurrentState = StoredAuraTeleportLocation.State.Changed;
m_storedAuraTeleportLocations[spellId] = storedLocation;
}
public void RemoveStoredAuraTeleportLocation(uint spellId)
{
StoredAuraTeleportLocation storedLocation = m_storedAuraTeleportLocations.LookupByKey(spellId);
if (storedLocation != null)
storedLocation.CurrentState = StoredAuraTeleportLocation.State.Deleted;
}
public WorldLocation GetStoredAuraTeleportLocation(uint spellId)
{
StoredAuraTeleportLocation auraLocation = m_storedAuraTeleportLocations.LookupByKey(spellId);
if (auraLocation != null)
return auraLocation.Loc;
return null;
}
bool AddSpell(uint spellId, bool active, bool learning, bool dependent, bool disabled, bool loading = false, uint fromSkill = 0)
{
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId, Difficulty.None);