public InternalTimer(Mobile from, Item target, BasePoisonPotion potion) : base(TimeSpan.FromSeconds(2.0)) { m_From = from; m_Target = target; m_Poison = potion.Poison; m_MinSkill = potion.MinPoisoningSkill; m_MaxSkill = potion.MaxPoisoningSkill; }
public InternalTimer(Mobile from, Item target, BasePoisonPotion potion) : base(TimeSpan.FromSeconds(2.0)) { this.m_From = from; this.m_Target = target; this.m_Poison = potion.Poison; this.m_MinSkill = potion.MinPoisoningSkill; this.m_MaxSkill = potion.MaxPoisoningSkill; this.Priority = TimerPriority.TwoFiftyMS; }
protected override void OnTarget(object o) { BaseWeapon weapon = GetWeapon(); BasePoisonPotion potion = GetLastPotion(Caster); if (o is BasePoisonPotion) { potion = o as BasePoisonPotion; if (!potion.IsChildOf(Caster.Backpack)) { Caster.SendLocalizedMessage(1080058); // This must be in your backpack to use it. } else if (CheckSequence()) { if (Caster.CheckTargetSkill(CastSkill, potion, potion.MinPoisoningSkill, potion.MaxPoisoningSkill)) { ApplyPoison(weapon, potion); return; } else { Caster.SendLocalizedMessage(1010518); // You fail to apply a sufficient dose of poison } } } else if (o is BaseWeapon && weapon != null && (BaseWeapon)o == weapon && potion != null) { if (CheckSequence()) { if (potion != null) { if (Caster.CheckTargetSkill(CastSkill, potion, potion.MinPoisoningSkill, potion.MaxPoisoningSkill)) { ApplyPoison(weapon, potion); return; } else { Caster.SendLocalizedMessage(1010518); // You fail to apply a sufficient dose of poison } } } } else if (potion == null) { Caster.SendLocalizedMessage(502143); // The poison vial not usable. } else { Caster.SendLocalizedMessage(1060179); //You must be wielding a weapon to use this ability! } }
public InternalTimer(Mobile from, Item target, BasePoisonPotion potion) : base(TimeSpan.FromSeconds(2.0)) { m_From = from; m_Target = target; m_Poison = potion.Poison; m_MinSkill = potion.MinPoisoningSkill; m_MaxSkill = potion.MaxPoisoningSkill; Priority = TimerPriority.TwoFiftyMS; if (from is PlayerMobile) { ((PlayerMobile)from).ResetPlayerAction(this); } }
private void ApplyPoison(BaseWeapon weapon, BasePoisonPotion potion) { if (potion == null || !Caster.InRange(potion.GetWorldLocation(), 2) || !Caster.InLOS(potion)) { Caster.SendLocalizedMessage(502138); // That is too far away for you to use. return; } weapon.Poison = potion.Poison; weapon.PoisonCharges = 18 - (potion.Poison.RealLevel * 2); Caster.SendLocalizedMessage(1010517); // You apply the poison Caster.PlaySound(0x246); potion.Consume(); Caster.Backpack.DropItem(new Bottle()); OnCast(); if (potion.Deleted) { if (_LastPotion != null && _LastPotion.ContainsKey(Caster) && _LastPotion[Caster] == potion) { _LastPotion.Remove(Caster); if (_LastPotion.Count == 0) { _LastPotion = null; } } } else { if (_LastPotion == null) { _LastPotion = new Dictionary <Mobile, BasePoisonPotion>(); } if (!_LastPotion.ContainsKey(Caster) || _LastPotion[Caster] != potion) { _LastPotion[Caster] = potion; } } }
public override void OnCast() { BaseWeapon weapon = GetWeapon(); if (CheckWeapon()) { if (weapon.Poison == null || weapon.PoisonCharges == 0) { BasePoisonPotion poison = GetLastPotion(Caster); Caster.SendLocalizedMessage(502137); // Select the poison you wish to use. Caster.Target = new MasteryTarget(this, autoEnd: false); return; } if (!HasSpell(Caster, GetType())) { if (CheckSequence()) { BeginTimer(); Caster.SendLocalizedMessage(1156138); // You ready your weapon to unleash an injected strike! int bonus = 30; // Your next successful attack will poison your target and reduce its poison resist by:<br>~1_VAL~% PvM<br>~2_VAL~% PvP BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.InjectedStrike, 1155927, 1156163, $"{bonus.ToString()}\t{(bonus / 2).ToString()}")); Caster.FixedParticles(0x3728, 0x1, 0xA, 0x251E, 0x4F7, 7, (EffectLayer)2, 0); weapon.InvalidateProperties(); } } else { Caster.SendLocalizedMessage(501775); // This spell is already in effect. } } else { Caster.SendLocalizedMessage(1060179); //You must be wielding a weapon to use this ability! } FinishSequence(); }
protected override void OnTarget(object o) { BaseWeapon weapon = GetWeapon(); BasePoisonPotion potion = GetLastPotion(Caster); if (o is BasePoisonPotion poisonPotion) { potion = poisonPotion; if (!potion.IsChildOf(Caster.Backpack)) { Caster.SendLocalizedMessage(1080058); // This must be in your backpack to use it. } else if (CheckSequence()) { if (Caster.CheckTargetSkill(CastSkill, potion, potion.MinPoisoningSkill, potion.MaxPoisoningSkill)) { ApplyPoison(weapon, potion); return; } Caster.SendLocalizedMessage(1010518); // You fail to apply a sufficient dose of poison } } else if (o is BaseWeapon baseWeapon && weapon != null && baseWeapon == weapon && potion != null) { if (CheckSequence()) { if (potion != null) { if (Caster.CheckTargetSkill(CastSkill, potion, potion.MinPoisoningSkill, potion.MaxPoisoningSkill)) { ApplyPoison(weapon, potion); return; } Caster.SendLocalizedMessage(1010518); // You fail to apply a sufficient dose of poison } } }
public InternalTarget(BasePoisonPotion potion) : base(2, false, TargetFlags.None) { m_Potion = potion; }
public ApplyPoisonTarget(BasePoisonPotion potion) : base(2, false, TargetFlags.None) { m_Potion = potion; }