Hi Shawn,
I appreciate the effort but I think you duplicated bad code and I'm going to rant.
- Code: Select all
+ if (target.EffectList.GetOfType(typeof(VoiceOfSkaldiEffect)) != null)
+ {
+
+ int basechance = base.CalculateSpellResistChance(target);
+ GameSpellEffect Nearsight = SpellHandler.FindEffectOnTarget(target, "Nearsight");
+ if (Nearsight == null)
+ {
+ basechance += (int)Nearsight.Spell.Value;
+ }
+ GameSpellEffect Mesmerize = SpellHandler.FindEffectOnTarget(target, "Mesmerize");
+ if (Mesmerize == null)
+ {
+ basechance += (int)Mesmerize.Spell.Value;
+ }
+ GameSpellEffect Stun = SpellHandler.FindEffectOnTarget(target, "Stun");
+ if (Stun == null)
+ {
+ basechance += (int)Stun.Spell.Value;
+ }
+
+ GameSpellEffect SpeedDecrease = SpellHandler.FindEffectOnTarget(target, "SpeedDecrease");
+ if (SpeedDecrease == null)
+ {
+ basechance += (int)SpeedDecrease.Spell.Value;
+ }
+ return Math.Min(100, basechance);
+
+ }
AllureOfDeath is what this code is based on and, frankly, it's complete crap. AllureOfDeath is supposed to grant 75% cc immunity, so the method CalculateSpellResistChance(GameLiving target) should simply return 75% chance of resist if active. It couldn't be more simpler. There's no fancy math manipulating basechance using spell value. whatever the heck that does.
VoiceOfTheSkald is supposed to grant 100% immunity for 30 seconds, so if active what should CalculateSpellResistChance(GameLiving target) return? 100? Egads, that's some difficult math.
Oh, and I see more.
- Code: Select all
if (Nearsight == null)
+ {
+ basechance += (int)Nearsight.Spell.Value;
+ }
If null then do something with it? That should be != null.
This kind of crap is all over the place and it is driving me crazy.
Is nearsight considered a CC spell? Why is nearsight here?