Core/Refactor: Part 3

This commit is contained in:
hondacrx
2018-05-16 19:57:48 -04:00
parent 225a5d27f7
commit 5dacd669b5
112 changed files with 564 additions and 561 deletions
+6 -8
View File
@@ -388,7 +388,7 @@ namespace Game.Spells
var app = m_applications.LookupByKey(target.GetGUID());
/// @todo Figure out why this happens
// @todo Figure out why this happens
if (app == null)
{
Log.outError(LogFilter.Spells, "Aura._UnapplyForTarget, target: {0}, caster: {1}, spell: {2} was not found in owners application map!",
@@ -537,7 +537,7 @@ namespace Game.Spells
// owner has to be in world, or effect has to be applied to self
if (!m_owner.IsSelfOrInSameMap(unit))
{
/// @todo There is a crash caused by shadowfiend load addon
// @todo There is a crash caused by shadowfiend load addon
Log.outFatal(LogFilter.Spells, "Aura {0}: Owner {1} (map {2}) is not in the same map as target {3} (map {4}).", GetSpellInfo().Id,
m_owner.GetName(), m_owner.IsInWorld ? (int)m_owner.GetMap().GetId() : -1,
unit.GetName(), unit.IsInWorld ? (int)unit.GetMap().GetId() : -1);
@@ -1706,7 +1706,7 @@ namespace Game.Spells
if (procEffectMask == 0)
return 0;
/// @todo
// @todo
// do allow additional requirements for procs
// this is needed because this is the last moment in which you can prevent aura charge drop on proc
// and possibly a way to prevent default checks (if there're going to be any)
@@ -1720,7 +1720,7 @@ namespace Game.Spells
// Check if current equipment meets aura requirements
// do that only for passive spells
/// @todo this needs to be unified for all kinds of auras
// @todo this needs to be unified for all kinds of auras
Unit target = aurApp.GetTarget();
if (IsPassive() && target.IsTypeId(TypeId.Player))
{
@@ -2039,9 +2039,7 @@ namespace Game.Spells
if (eff.IsEffectAffected(m_spellInfo, aurEff.GetEffIndex()))
eff.Call(aurEff, dmgInfo, ref absorbAmount);
if (!defaultPrevented)
defaultPrevented = auraScript._IsDefaultActionPrevented();
defaultPrevented = auraScript._IsDefaultActionPrevented();
auraScript._FinishScriptCall();
}
}
@@ -2060,7 +2058,7 @@ namespace Game.Spells
}
}
public void CallScriptEffectManaShieldHandlers(AuraEffect aurEff, AuraApplication aurApp, DamageInfo dmgInfo, ref uint absorbAmount, bool defaultPrevented)
public void CallScriptEffectManaShieldHandlers(AuraEffect aurEff, AuraApplication aurApp, DamageInfo dmgInfo, ref uint absorbAmount, ref bool defaultPrevented)
{
foreach (var auraScript in m_loadedScripts)
{
+3 -3
View File
@@ -1938,7 +1938,7 @@ namespace Game.Spells
Unit target = aurApp.GetTarget();
// Vengeance of the Blue Flight (@todo REMOVE THIS!)
/// @workaround
// @workaround
if (m_spellInfo.Id == 45839)
{
if (apply)
@@ -4985,7 +4985,7 @@ namespace Game.Spells
HealInfo healInfo = new HealInfo(caster, target, heal, auraSpellInfo, auraSpellInfo.GetSchoolMask());
caster.HealBySpell(healInfo);
/// @todo: should proc other auras?
// @todo: should proc other auras?
int mana = caster.GetMaxPower(PowerType.Mana);
if (mana != 0)
{
@@ -5044,7 +5044,7 @@ namespace Game.Spells
triggerSpellId = 30571;
break;
// Doom
/// @todo effect trigger spell may be independant on spell targets, and executed in spell finish phase
// @todo effect trigger spell may be independant on spell targets, and executed in spell finish phase
// so instakill will be naturally done before trigger spell
case 31347:
{
+5 -5
View File
@@ -778,7 +778,7 @@ namespace Game.Spells
SpellTargetPosition st = Global.SpellMgr.GetSpellTargetPosition(m_spellInfo.Id, effIndex);
if (st != null)
{
/// @todo fix this check
// @todo fix this check
if (m_spellInfo.HasEffect(SpellEffectName.TeleportUnits) || m_spellInfo.HasEffect(SpellEffectName.Bind))
dest = new SpellDestination(st.target_X, st.target_Y, st.target_Z, st.target_Orientation, st.target_mapId);
else if (st.target_mapId == m_caster.GetMapId())
@@ -1244,7 +1244,7 @@ namespace Game.Spells
void SelectEffectTypeImplicitTargets(uint effIndex)
{
// special case for SPELL_EFFECT_SUMMON_RAF_FRIEND and SPELL_EFFECT_SUMMON_PLAYER
/// @todo this is a workaround - target shouldn't be stored in target map for those spells
// @todo this is a workaround - target shouldn't be stored in target map for those spells
SpellEffectInfo effect = GetEffect(effIndex);
if (effect == null)
return;
@@ -1670,7 +1670,7 @@ namespace Game.Spells
if (m_spellInfo.Speed > 0.0f && m_caster != target)
{
// calculate spell incoming interval
/// @todo this is a hack
// @todo this is a hack
float dist = m_caster.GetDistance(target.GetPositionX(), target.GetPositionY(), target.GetPositionZ());
if (dist < 5.0f)
@@ -2132,7 +2132,7 @@ namespace Game.Spells
else if (m_caster.IsFriendlyTo(unit))
{
// for delayed spells ignore negative spells (after duel end) for friendly targets
/// @todo this cause soul transfer bugged
// @todo this cause soul transfer bugged
// 63881 - Malady of the Mind jump spell (Yogg-Saron)
if (m_spellInfo.Speed > 0.0f && unit.IsTypeId(TypeId.Player) && !m_spellInfo.IsPositive() && m_spellInfo.Id != 63881)
return SpellMissInfo.Evade;
@@ -4089,7 +4089,7 @@ namespace Game.Spells
resurrectRequest.SpellID = m_spellInfo.Id;
//packet.ReadBit("UseTimer"); /// @todo: 6.x Has to be implemented
//packet.ReadBit("UseTimer"); // @todo: 6.x Has to be implemented
resurrectRequest.Sickness = !m_caster.IsTypeId(TypeId.Player); // "you'll be afflicted with resurrection sickness"
resurrectRequest.Name = sentName;
-7
View File
@@ -972,12 +972,5 @@ namespace Game.Spells
public DateTime RechargeStart;
public DateTime RechargeEnd;
}
class CooldownDurations
{
public int Cooldown = -1;
public uint CategoryId = 0;
public int CategoryCooldown = -1;
}
}
}
+12 -3
View File
@@ -658,8 +658,8 @@ namespace Game.Entities
SpellInfo first = GetSpellInfo(pair.Key);
SpellInfo next = GetSpellInfo(pair.Value);
if (first == null || next != null)
continue;
if (!mSpellChains.ContainsKey(pair.Key))
mSpellChains[pair.Key] = new SpellChainNode();
mSpellChains[pair.Key].first = first;
mSpellChains[pair.Key].prev = null;
@@ -668,6 +668,9 @@ namespace Game.Entities
mSpellChains[pair.Key].rank = 1;
mSpellInfoMap[pair.Key].ChainEntry = mSpellChains[pair.Key];
if (!mSpellChains.ContainsKey(pair.Value))
mSpellChains[pair.Value] = new SpellChainNode();
mSpellChains[pair.Value].first = first;
mSpellChains[pair.Value].prev = first;
mSpellChains[pair.Value].next = null;
@@ -684,8 +687,14 @@ namespace Game.Entities
if (last == null)
break;
if (!mSpellChains.ContainsKey(nextPair.Key))
mSpellChains[nextPair.Key] = new SpellChainNode();
mSpellChains[nextPair.Key].next = last;
if (!mSpellChains.ContainsKey(nextPair.Value))
mSpellChains[nextPair.Value] = new SpellChainNode();
mSpellChains[nextPair.Value].first = first;
mSpellChains[nextPair.Value].prev = prev;
mSpellChains[nextPair.Value].next = null;
@@ -2433,7 +2442,7 @@ namespace Game.Entities
break;
case 56606: // Ride Jokkum
case 61791: // Ride Vehicle (Yogg-Saron)
/// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
spellInfo.GetEffect(0).BasePoints = 1;
break;
case 59630: // Black Magic