Misc fixes

This commit is contained in:
hondacrx
2017-09-06 12:00:21 -04:00
parent 38b6c72499
commit 36a74cf873
18 changed files with 161 additions and 312 deletions
+3 -3
View File
@@ -1711,8 +1711,8 @@ namespace Game.Spells
if (!Global.SpellMgr.CanSpellTriggerProcOnEvent(procEntry, eventInfo))
return 0;
// check if aura can proc when spell is triggered
if (!procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc))
// check if aura can proc when spell is triggered (exception for hunter auto shot & wands)
if (!procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.AutoAttackMask))
{
Spell spell = eventInfo.GetProcSpell();
if (spell)
@@ -2665,7 +2665,7 @@ namespace Game.Spells
List<Unit> targetList = new List<Unit>();
if (effect.TargetB.GetTarget() == Targets.DestDynobjAlly || effect.TargetB.GetTarget() == Targets.UnitDestAreaAlly)
{
var u_check = new AnyFriendlyUnitInObjectRangeCheck(GetDynobjOwner(), dynObjOwnerCaster, radius);
var u_check = new AnyFriendlyUnitInObjectRangeCheck(GetDynobjOwner(), dynObjOwnerCaster, radius, GetSpellInfo().HasAttribute(SpellAttr3.OnlyTargetPlayers));
var searcher = new UnitListSearcher(GetDynobjOwner(), targetList, u_check);
Cell.VisitAllObjects(GetDynobjOwner(), searcher, radius);
}
+33 -25
View File
@@ -663,21 +663,44 @@ namespace Game.Spells
SpellInfo spellInfo = eventInfo.GetSpellInfo();
switch (GetAuraType())
{
case AuraType.ModConfuse:
case AuraType.ModFear:
case AuraType.ModStun:
case AuraType.ModRoot:
case AuraType.Transform:
{
DamageInfo damageInfo = eventInfo.GetDamageInfo();
if (damageInfo == null || damageInfo.GetDamage() == 0)
return false;
// Spell own damage at apply won't break CC
if (spellInfo != null)
{
if (spellInfo == GetSpellInfo())
{
Aura aura = GetBase();
// called from spellcast, should not have ticked yet
if (aura.GetDuration() == aura.GetMaxDuration())
return false;
}
}
break;
}
case AuraType.MechanicImmunity:
case AuraType.ModMechanicResistance:
// compare mechanic
if (spellInfo == null || !Convert.ToBoolean(spellInfo.GetAllEffectsMechanicMask() & (1 << GetMiscValue())))
result = false;
return false;
break;
case AuraType.ModCastingSpeedNotStack:
// skip melee hits and instant cast spells
if (!eventInfo.GetProcSpell() || eventInfo.GetProcSpell().GetCastTime() == 0)
result = false;
return false;
break;
case AuraType.ModSpellDamageFromCaster:
// Compare casters
if (GetCasterGUID() != eventInfo.GetActor().GetGUID())
result = false;
return false;
break;
case AuraType.ModPowerCostSchool:
case AuraType.ModPowerCostSchoolPct:
@@ -685,22 +708,19 @@ namespace Game.Spells
// Skip melee hits and spells with wrong school or zero cost
if (spellInfo == null || !Convert.ToBoolean((int)spellInfo.GetSchoolMask() & GetMiscValue()) // School Check
|| !eventInfo.GetProcSpell())
{
result = false;
break;
}
return false;
// Costs Check
var costs = eventInfo.GetProcSpell().GetPowerCost();
var m = costs.Find(cost => { return cost.Amount > 0; });
if (m == null)
result = false;
return false;
break;
}
case AuraType.ReflectSpellsSchool:
// Skip melee hits and spells with wrong school
if (spellInfo == null || !Convert.ToBoolean((int)spellInfo.GetSchoolMask() & GetMiscValue()))
result = false;
return false;
break;
case AuraType.ProcTriggerSpell:
case AuraType.ProcTriggerSpellWithValue:
@@ -710,7 +730,7 @@ namespace Game.Spells
SpellInfo triggeredSpellInfo = Global.SpellMgr.GetSpellInfo(triggerSpellId);
if (triggeredSpellInfo != null)
if (aurApp.GetTarget().m_extraAttacks != 0 && triggeredSpellInfo.HasEffect(SpellEffectName.AddExtraAttacks))
result = false;
return false;
break;
}
default:
@@ -6007,24 +6027,12 @@ namespace Game.Spells
void HandleBreakableCCAuraProc(AuraApplication aurApp, ProcEventInfo eventInfo)
{
DamageInfo damageInfo = eventInfo.GetDamageInfo();
if (damageInfo == null)
return;
int damageLeft = (int)(GetAmount() - eventInfo.GetDamageInfo().GetDamage());
// aura own damage at apply won't break CC
if (eventInfo.GetSpellPhaseMask().HasAnyFlag(ProcFlagsSpellPhase.Cast))
{
SpellInfo spellInfo = eventInfo.GetSpellInfo();
if (spellInfo != null)
if (spellInfo == GetSpellInfo())
return;
}
int damageLeft = GetAmount();
if (damageLeft < damageInfo.GetDamage())
if (damageLeft <= 0)
aurApp.GetTarget().RemoveAura(aurApp);
else
ChangeAmount((int)(damageLeft - damageInfo.GetDamage()));
ChangeAmount(damageLeft);
}
void HandleProcTriggerSpellAuraProc(AuraApplication aurApp, ProcEventInfo eventInfo)
+10 -3
View File
@@ -481,8 +481,8 @@ namespace Game.Entities
if ((eventInfo.GetTypeMask() & (ProcFlags.Killed | ProcFlags.Kill | ProcFlags.Death)) != 0)
return true;
// do triggered cast checks
if (!procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc))
// Do not consider autoattacks as triggered spells
if (!procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.AutoAttackMask))
{
Spell spell = eventInfo.GetProcSpell();
if (spell)
@@ -1686,12 +1686,15 @@ namespace Game.Entities
SpellProcEntry procEntry = new SpellProcEntry();
procEntry.SchoolMask = 0;
procEntry.SpellFamilyName = spellInfo.SpellFamilyName;
procEntry.ProcFlags = spellInfo.ProcFlags;
procEntry.SpellFamilyName = 0;
foreach (SpellEffectInfo effect in spellInfo.GetEffectsForDifficulty(Difficulty.None))
if (effect != null && effect.IsEffect() && isTriggerAura(effect.ApplyAuraName))
procEntry.SpellFamilyMask |= effect.SpellClassMask;
if (procEntry.SpellFamilyMask)
procEntry.SpellFamilyName = spellInfo.SpellFamilyName;
procEntry.SpellTypeMask = ProcFlagsSpellType.MaskAll;
procEntry.SpellPhaseMask = ProcFlagsSpellPhase.Hit;
procEntry.HitMask = ProcFlagsHit.None; // uses default proc @see SpellMgr::CanSpellTriggerProcOnEvent
@@ -2793,6 +2796,10 @@ namespace Game.Entities
case 42793: // Burn Body
spellInfo.GetEffect(2).MiscValue = 24008; // Fallen Combatant
break;
case 59544:// Gift of the Naaru (priest and monk variants)
case 121093:
spellInfo.SpellFamilyFlags[2] = 0x80000000;
break;
// VIOLET HOLD SPELLS
//
case 54258: // Water Globule (Ichoron)