public virtual double GetSlayerDamageScalar(Mobile defender) { Spellbook atkBook = Spellbook.FindEquippedSpellbook(m_Caster); double scalar = 1.0; if (atkBook != null) { SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(atkBook.Slayer); SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2); if (atkSlayer != null && atkSlayer.Slays(defender) || atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); //TODO: Confirm this displays on OSIs scalar = 2.0; } TransformContext context = TransformationSpellHelper.GetContext(defender); if ((atkBook.Slayer == SlayerName.Silver || atkBook.Slayer2 == SlayerName.Silver) && context != null && context.Type != typeof(HorrificBeastSpell)) { scalar += .25; // Every necromancer transformation other than horrific beast take an additional 25% damage } if (scalar != 1.0) { return(scalar); } } ISlayer defISlayer = Spellbook.FindEquippedSpellbook(defender); if (defISlayer == null) { defISlayer = defender.Weapon as ISlayer; } if (defISlayer != null) { SlayerEntry defSlayer = SlayerGroup.GetEntryByName(defISlayer.Slayer); SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName(defISlayer.Slayer2); if (defSlayer != null && defSlayer.Group.OppositionSuperSlays(m_Caster) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays(m_Caster)) { scalar = 2.0; } } return(scalar); }
public virtual double GetSlayerDamageScalar(Mobile defender) { var atkBook = Spellbook.FindEquippedSpellbook(Caster); var scalar = 1.0; if (atkBook != null) { var atkSlayer = SlayerGroup.GetEntryByName(atkBook.OldSlayer); var atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.OldSlayer2); if (atkSlayer != null && atkSlayer.Slays(defender) || atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); //TODO: Confirm this displays on OSIs scalar = 2.0; } if (scalar != 1.0) { return(scalar); } } ISlayer defISlayer = Spellbook.FindEquippedSpellbook(defender); if (defISlayer == null) { defISlayer = defender.Weapon as ISlayer; } if (defISlayer != null) { var defSlayer = SlayerGroup.GetEntryByName(defISlayer.OldSlayer); var defSlayer2 = SlayerGroup.GetEntryByName(defISlayer.OldSlayer2); if (defSlayer != null && defSlayer.Group.OppositionSuperSlays(Caster) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays(Caster)) { scalar = 2.0; } } return(scalar); }
public virtual double GetSlayerDamageScalar(Mobile defender) { Spellbook atkBook = Spellbook.FindEquippedSpellbook(Caster); double scalar = 1.0; if (atkBook != null) { SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(atkBook.Slayer); SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2); if (atkSlayer != null && atkSlayer.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); scalar = Math.Max(scalar, SlayerGroup.IsSuperSlayer(atkSlayer.Name) ? 2.0 : 3.0); } if (atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); scalar = Math.Max(scalar, SlayerGroup.IsSuperSlayer(atkSlayer2.Name) ? 2.0 : 3.0); } TransformContext context = TransformationSpell.GetContext(defender); if ((atkBook.Slayer == SlayerName.Undead || atkBook.Slayer2 == SlayerName.Undead) && context != null && context.Type != typeof(HorrificBeastSpell)) { scalar += .25; // Every necromancer transformation other than horrific beast take an additional 25% damage } if (scalar != 1.0) { return(scalar); } } #region Opposite Slayer if (defender.GetSlayerEntries().Any(e => e.Group.OppositionSuperSlays(Caster))) { scalar = 2.0; } #endregion return(scalar); }
public virtual double GetSlayerDamageScalar(Mobile defender) { // ==== Alan Mod ===== if (defender is PlayerMobile || defender is HumanMob) // there are no slayers that should slay them { return(1.0); } // first check for XmlSlayer attachments List <XmlSlayer> slayerattachments = XmlAttach.GetSlayerAttachments(m_Caster); if (slayerattachments != null) { foreach (XmlSlayer slayerattachment in slayerattachments) { if (slayerattachment.Slayer == SlayerName.None) { continue; } if (slayerattachment.Slayer == SlayerName.All) { return(SpellDamageController._SlayerMultiplier); } SlayerEntry attachmentSlayer = SlayerGroup.GetEntryByName(slayerattachment.Slayer); if (attachmentSlayer != null && attachmentSlayer.Slays(defender)) { return(SpellDamageController._SlayerMultiplier); } } } // ==== End Alan Mod ==== Spellbook atkBook = Spellbook.FindEquippedSpellbook(m_Caster); if (atkBook != null) { if (atkBook.Slayer == SlayerName.All) { return(SpellDamageController._SlayerMultiplier); } if (atkBook.Slayer2 == SlayerName.All) { return(SpellDamageController._SlayerMultiplier); } SlayerEntry atkSlayer = SlayerGroup.GetEntryByName(atkBook.Slayer); SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName(atkBook.Slayer2); if (atkSlayer != null && atkSlayer.Slays(defender) || atkSlayer2 != null && atkSlayer2.Slays(defender)) { defender.FixedEffect(0x37B9, 10, 5); //TODO: Confirm this displays on OSIs return(SpellDamageController._SlayerMultiplier); } } /* * ISlayer defISlayer = Spellbook.FindEquippedSpellbook( defender ); * * if( defISlayer == null ) * defISlayer = defender.Weapon as ISlayer; * * if( defISlayer != null ) * { * SlayerEntry defSlayer = SlayerGroup.GetEntryByName( defISlayer.Slayer ); * SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName( defISlayer.Slayer2 ); * * if( defSlayer != null && defSlayer.Group.OppositionSuperSlays( m_Caster ) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays( m_Caster ) ) * scalar = 1.1; * } */ return(1.0); }