public static void MutateLoot(int maxInt, MagicWand wand) { double dr = Utility.RandomDouble() * 100.0; if (dr < 2 && maxInt >= 80) { wand.SpellEffect = SpellEffect.ManaDrain; } else if (dr < 8 && maxInt >= 80) { wand.SpellEffect = SpellEffect.Lightning; } else if (dr < 13 && maxInt >= 60) { wand.SpellEffect = SpellEffect.Fireball; } else if (dr < 18 && maxInt >= 60) { wand.SpellEffect = SpellEffect.GHeal; } else if (dr < 28 && maxInt >= 40) { wand.SpellEffect = SpellEffect.Harm; } else if (dr < 38 && maxInt >= 40) { wand.SpellEffect = SpellEffect.MagicArrow; } else if (dr < 48 && maxInt >= 20) { wand.SpellEffect = SpellEffect.Feeblemind; } else if (dr < 58 && maxInt >= 20) { wand.SpellEffect = SpellEffect.Clumsy; } else if (dr < 68 && maxInt >= 20) { wand.SpellEffect = SpellEffect.MiniHeal; } else { wand.SpellEffect = SpellEffect.ItemID; } if (wand.SpellEffect != SpellEffect.None) { wand.SpellCharges = SpellCastEffect.GetChargesFor(wand.SpellEffect); } }
public MagePeacemaker() : base(AIType.AI_Mage, 5) { SetStr(40, 60); SetDex(40, 60); SetInt(220, 300); Item weapon; switch (Utility.Random(2)) { case 0: weapon = new Scepter(); break; default: weapon = new MagicWand(); break; } ((BaseWeapon)weapon).Attributes.SpellChanneling = 1; AddItem(weapon); SetDamageType(ResistanceType.Physical, 0); if (Utility.RandomBool()) SetDamageType(ResistanceType.Cold, 60); else SetDamageType(ResistanceType.Fire, 60); if (Utility.RandomBool()) SetDamageType(ResistanceType.Energy, 40); else SetDamageType(ResistanceType.Poison, 40); SetSkill(SkillName.EvalInt, 90.1, 100.0); SetSkill(SkillName.Magery, 90.1, 100.0); SetSkill(SkillName.Necromancy, 0, 110.0); SetSkill(SkillName.SpiritSpeak, 90.0, 110.0); SetSkill(SkillName.MagicResist, 150.5, 200.0); SetSkill(SkillName.Tactics, 50.1, 70.0); SetSkill(SkillName.Macing, 60.1, 80.0); }