Fixed appearance validation

Implemented proper facial hair validation
Implemented transmog Set
fix interaction of spells like Shadowmeld with Threat reducing effects
This commit is contained in:
hondacrx
2017-08-24 18:01:44 -04:00
parent 7934d51702
commit 0707f9b377
71 changed files with 2968 additions and 632 deletions
+7 -11
View File
@@ -688,19 +688,18 @@ namespace Game.Entities
}
public Unit GetMeleeHitRedirectTarget(Unit victim, SpellInfo spellInfo = null)
{
var hitTriggerAuras = victim.GetAuraEffectsByType(AuraType.AddCasterHitTrigger);
foreach (var i in hitTriggerAuras)
var interceptAuras = victim.GetAuraEffectsByType(AuraType.InterceptMeleeRangedAttacks);
foreach (var i in interceptAuras)
{
Unit magnet = i.GetCaster();
if (magnet != null)
if (_IsValidAttackTarget(magnet, spellInfo) && magnet.IsWithinLOSInMap(this)
&& (spellInfo == null || (spellInfo.CheckExplicitTarget(this, magnet) == SpellCastResult.SpellCastOk
&& spellInfo.CheckTarget(this, magnet, false) == SpellCastResult.SpellCastOk)))
if (RandomHelper.randChance(i.GetAmount()))
{
i.GetBase().DropCharge(AuraRemoveMode.Expire);
return magnet;
}
{
i.GetBase().DropCharge(AuraRemoveMode.Expire);
return magnet;
}
}
return victim;
}
@@ -2053,10 +2052,7 @@ namespace Game.Entities
// 6.CRIT
tmp = crit_chance;
if (tmp > 0 && roll < (sum += tmp))
{
if (GetTypeId() != TypeId.Unit || !(ToCreature().GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.NoCrit)))
return MeleeHitOutcome.Crit;
}
return MeleeHitOutcome.Crit;
// 7. CRUSHING
// mobs can score crushing blows if they're 4 or more levels above victim
-2
View File
@@ -182,7 +182,6 @@ namespace Game.Entities
public SpellInfo GetSpellInfo()
{
/// WORKAROUND: unfinished new proc system
if (_spell)
return _spell.GetSpellInfo();
if (_damageInfo != null)
@@ -194,7 +193,6 @@ namespace Game.Entities
}
public SpellSchoolMask GetSchoolMask()
{
/// WORKAROUND: unfinished new proc system
if (_spell)
return _spell.GetSpellInfo().GetSchoolMask();
if (_damageInfo != null)
+9 -2
View File
@@ -752,6 +752,13 @@ namespace Game.Entities
}
break;
}
// Spell crit suppression
if (victim.GetTypeId() == TypeId.Unit)
{
int levelDiff = (int)(victim.GetLevelForTarget(this) - getLevel());
crit_chance -= levelDiff * 1.0f;
}
}
break;
}
@@ -776,7 +783,7 @@ namespace Game.Entities
if (aurEff.GetCasterGUID() == GetGUID() && aurEff.IsAffectingSpell(spellProto))
crit_chance += aurEff.GetAmount();
return crit_chance > 0.0f ? crit_chance : 0.0f;
return Math.Max(crit_chance, 0.0f);
}
// Calculate spell hit result can be:
@@ -1813,7 +1820,7 @@ namespace Game.Entities
DateTime now = DateTime.Now;
// use provided list of auras which can proc
if (!procAuras.Empty())
if (procAuras != null)
{
foreach (AuraApplication aurApp in procAuras)
{