CODE |
public override Poison PoisonImmune{ get{ return Poison.Regular; } } public override Poison HitPoison{ get{ return Poison.Regular; } } |
CODE |
using System; using Server; using Server.Items; using Server.Network; using Server.Mobiles; namespace Server.Engines.XmlSpawner2 { public class XmlPoisoning : XmlAttachment { private int p_level = 0; // a serial constructor is REQUIRED public XmlPoisoning(ASerial serial) : base(serial) { } [Attachable] public XmlPoisoning(int level) { p_level = level; } // when attached to a mobile, it should gain poison immunity and a poison attack, but no poisoning skill public override Poison PoisonImmune { get{ if( p_level < 1 ) { return Poison.Lesser; } else if( p_level = 1 ) { return Poison.Regular; } else if( p_level = 2 ) { return Poison.Greater; } else if( p_level = 3 ) { return Poison.Deadly; } else if( p_level > 3 ) { return Poison.Lethal; } else { return Poison.Regular; } } } public override Poison HitPoison{ get{ if( p_level < 1 ) { return Poison.Lesser; } else if( p_level = 1 ) { return Poison.Regular; } else if( p_level = 2 ) { return Poison.Greater; } else if( p_level = 3 ) { return Poison.Deadly; } else if( p_level > 3 ) { return Poison.Lethal; } else { return Poison.Regular; } } } public override void Serialize( GenericWriter writer ) { base.Serialize(writer); writer.Write( (int) 0 ); // version 0 writer.Write(p_level); } public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch(version) { case 0: // version 0 p_level = reader.ReadInt(); break; } } public override string OnIdentify(Mobile from) { string msg = null; msg = String.Format("Poisoning {0}",p_level); return msg; } } } |
CODE |
public Poison PoisonImmune { get{ if( p_level < 1 ) { return Poison.Lesser; } else if( p_level = 1 ) { return Poison.Regular; } else if( p_level = 2 ) { return Poison.Greater; } else if( p_level = 3 ) { return Poison.Deadly; } else if( p_level > 3 ) { return Poison.Lethal; } else { return Poison.Regular; } } } public Poison HitPoison{ get{ if( p_level < 1 ) { return Poison.Lesser; } else if( p_level = 1 ) { return Poison.Regular; } else if( p_level = 2 ) { return Poison.Greater; } else if( p_level = 3 ) { return Poison.Deadly; } else if( p_level > 3 ) { return Poison.Lethal; } else { return Poison.Regular; } } } |
QUOTE |
public override bool CheckPoisonImmunity(Mobile from, Poison poison) { if (base.CheckPoisonImmunity(from, poison)) return true; Poison p = this.PoisonImmune; //ARTEGORDONMOD // check for custom poison immunity XmlPoisoning xp = (XmlPoisoning)XmlAttach.FindAttachment(this, typeof(XmlPoisoning)); if (xp != null) { p = xp.PoisonImmune; } return (p != null && p.Level >= poison.Level); } |
QUOTE |
public virtual void OnGaveMeleeAttack(Mobile defender) { Poison p = HitPoison; //ARTEGORDONMOD // check for custom hit poison XmlPoisoning xp = (XmlPoisoning)XmlAttach.FindAttachment(this, typeof(XmlPoisoning)); if (xp != null) { p = xp.HitPoison; } if (m_Paragon) p = PoisonImpl.IncreaseLevel(p); if (p != null && HitPoisonChance >= Utility.RandomDouble()) defender.ApplyPoison(this, p); if (AutoDispel && defender is BaseCreature && ((BaseCreature)defender).IsDispellable && AutoDispelChance > Utility.RandomDouble()) Dispel(defender); } |
CODE |
using System; using Server; using Server.Items; using Server.Network; using Server.Mobiles; namespace Server.Engines.XmlSpawner2 { public class XmlPoisoning : XmlAttachment { private int p_level = 0; // a serial constructor is REQUIRED public XmlPoisoning(ASerial serial) : base(serial) { } [Attachable] public XmlPoisoning(int level) { p_level = level; } // when attached to a mobile, it should gain poison immunity and a poison attack, but no poisoning skill public Poison PoisonImmune { get{ if( p_level < 1 ) { return Poison.Lesser; } else if( p_level == 1 ) { return Poison.Regular; } else if( p_level == 2 ) { return Poison.Greater; } else if( p_level == 3 ) { return Poison.Deadly; } else if( p_level > 3 ) { return Poison.Lethal; } else { return Poison.Regular; } } } public Poison HitPoison{ get{ if( p_level < 1 ) { return Poison.Lesser; } else if( p_level == 1 ) { return Poison.Regular; } else if( p_level == 2 ) { return Poison.Greater; } else if( p_level == 3 ) { return Poison.Deadly; } else if( p_level > 3 ) { return Poison.Lethal; } else { return Poison.Regular; } } } public override void Serialize( GenericWriter writer ) { base.Serialize(writer); writer.Write( (int) 0 ); // version 0 writer.Write(p_level); } public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch(version) { case 0: // version 0 p_level = reader.ReadInt(); break; } } public override string OnIdentify(Mobile from) { string msg = null; msg = String.Format("Poisoning {0}",p_level); return msg; } } } |