public static void BeginGuardOff(Mobile m, Mobile caster) { if (m_Table.ContainsKey(m.Serial)) { Timer timer = m_Table[m.Serial]; timer.Stop(); m_Table.Remove(m.Serial); } List <ResistanceMod> mods = new List <ResistanceMod>(); mods.Add(new ResistanceMod(ResistanceType.Physical, -(m.PhysicalResistance / 2))); mods.Add(new ResistanceMod(ResistanceType.Fire, -(m.FireResistance / 2))); mods.Add(new ResistanceMod(ResistanceType.Cold, -(m.ColdResistance / 2))); mods.Add(new ResistanceMod(ResistanceType.Poison, -(m.PoisonResistance / 2))); mods.Add(new ResistanceMod(ResistanceType.Energy, -(m.EnergyResistance / 2))); Double duration = (BlueSpell.ScaleBySkill(caster, SkillName.Forensics) * 3.0); InternalTimer timertostart = new InternalTimer(m, mods, duration); timertostart.Start(); m_Table.Add(m.Serial, timertostart); for (int i = 0; i < mods.Count; ++i) { m.AddResistanceMod(mods[i]); } m.SendMessage("Your guard has been lowered"); }
public bool AddMods() { if (Owner == null) { return(false); } BonusNumber++; if (BonusNumber > 5) { return(false); } // @100.0 Forensics bonus's value is 10. double bonus = (BlueSpell.ScaleBySkill(Owner, SkillName.Forensics) / 2.0); StatMod stat = null; DefaultSkillMod skill = null; ResistanceMod resist = null; int intdiff = 0; double doublediff = 0.0; // Str (+10 @ GM) intdiff = (int)(m_StrCap - (Owner.RawStr + bonus)); if (intdiff > 0) { stat = new StatMod(StatType.Str, ("DragonForceStr" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours(24)); Owner.AddStatMod(stat); StatMods.Add(stat); } // Dex (+10 @ GM) intdiff = (int)(m_DexCap - (Owner.RawDex + bonus)); if (intdiff > 0) { stat = new StatMod(StatType.Dex, ("DragonForceDex" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours(24)); Owner.AddStatMod(stat); StatMods.Add(stat); } // Tactics (+5.0 @ GM) doublediff = m_TacticsCap - (Owner.Skills[SkillName.Tactics].Value + bonus); if (doublediff > 0.0) { skill = new DefaultSkillMod(SkillName.Tactics, true, (bonus / 2)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Wrestling (+5.0 @ GM) doublediff = m_WrestlingCap - (Owner.Skills[SkillName.Tactics].Value + bonus); if (doublediff > 0.0) { skill = new DefaultSkillMod(SkillName.Wrestling, true, bonus); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Lose all Magic Resist in preparation of negative resistances. if (Owner.Skills[SkillName.MagicResist].Value > 0) { skill = new DefaultSkillMod(SkillName.MagicResist, true, -Owner.Skills[SkillName.MagicResist].Value); Owner.AddSkillMod(skill); SkillMods.Add(skill); } if (!Status.Enabled) { // Lower Magery (-30 @ GM) if (Owner.Skills[SkillName.Magery].Value > 0) { skill = new DefaultSkillMod(SkillName.Magery, true, -(bonus * 3)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Lower Necromancy (-30 @ GM) if (Owner.Skills[SkillName.Necromancy].Value > 0) { skill = new DefaultSkillMod(SkillName.Necromancy, true, -(bonus * 3)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Lower Chivalry (-30 @ GM) if (Owner.Skills[SkillName.Chivalry].Value > 0) { skill = new DefaultSkillMod(SkillName.Chivalry, true, -(bonus * 3)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Lower Bushido (-30 @ GM) if (Owner.Skills[SkillName.Bushido].Value > 0) { skill = new DefaultSkillMod(SkillName.Bushido, true, -(bonus * 3)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Lower Ninjitsu (-30 @ GM) if (Owner.Skills[SkillName.Ninjitsu].Value > 0) { skill = new DefaultSkillMod(SkillName.Ninjitsu, true, -(bonus * 3)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Lower Spellweaving (-30 @ GM) if (Owner.Skills[SkillName.Spellweaving].Value > 0) { skill = new DefaultSkillMod(SkillName.Spellweaving, true, -(bonus * 3)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } // Lower Mysticism (-30 @ GM) if (Owner.Skills[SkillName.Mysticism].Value > 0) { skill = new DefaultSkillMod(SkillName.Mysticism, true, -(bonus * 3)); Owner.AddSkillMod(skill); SkillMods.Add(skill); } } // Physical (+5 @ GM) intdiff = m_PhysicalResistCap - (int)(Owner.PhysicalResistance + (bonus / 2)); if (intdiff > 0) { resist = new ResistanceMod(ResistanceType.Physical, intdiff); Owner.AddResistanceMod(resist); ResistMods.Add(resist); } // Fire (+10 @ GM) intdiff = m_FireResistCap - (int)(Owner.FireResistance + bonus); if (intdiff > 0) { resist = new ResistanceMod(ResistanceType.Fire, (int)(bonus)); Owner.AddResistanceMod(resist); ResistMods.Add(resist); } // Cold (-20 @ GM) resist = new ResistanceMod(ResistanceType.Cold, (int)(-(bonus * 2))); Owner.AddResistanceMod(resist); ResistMods.Add(resist); // Energy (-10 @ GM) resist = new ResistanceMod(ResistanceType.Energy, (int)(-bonus)); Owner.AddResistanceMod(resist); ResistMods.Add(resist); return(true); }