protected override void OnTick() { // cap the strike potential if (m_context.SlayerDamageHP > Context.SlayerDamageHPMax) { m_context.SlayerDamageHP = Context.SlayerDamageHPMax; } if (m_context.Owner == null || m_context.Owner.Deleted || m_context.Owner.NetState == null || m_context.Owner.Map == Map.Internal) { return; } // alert senior staff for analysis purposes SpiritSpeak.UsageReport(m_context.Owner, "Spirit Speak: SlayerDamage"); // apply the bonus Memory.ObjectMemory om = SpiritSpeak.SlayerDamageCache.Recall(Context.Owner as object); if (om != null) { // delete the old cached bonus SpiritSpeak.SlayerDamageCache.Forget(Context.Owner); } // you have 20 seconds to use this strike SpiritSpeak.SlayerDamageCache.Remember(Context.Owner, Context, new TimerStateCallback(Context.DoRelease), 20); Context.Owner.SendMessage("You have 20 seconds to utilize this slayer strike."); }
protected override void OnTick() { Corpse toChannel = null; foreach (Item item in Caster.GetItemsInRange(3)) { if (item is Corpse && !((Corpse)item).Channeled) { toChannel = (Corpse)item; break; } } int max, min, mana, number; if (toChannel != null) { min = 1 + (int)(Caster.Skills[SkillName.SpiritSpeak].Value * 0.25); max = min + 4; mana = 0; number = 1061287; // You channel energy from a nearby corpse to heal your wounds. } else { min = 1 + (int)(Caster.Skills[SkillName.SpiritSpeak].Value * 0.25); max = min + 4; mana = 10; number = 1061286; // You channel your own spiritual energy to heal your wounds. } if (Caster.Mana < mana) { Caster.SendLocalizedMessage(1061285); // You lack the mana required to use this skill. } else { Caster.CheckSkill(SkillName.SpiritSpeak, 0.0, 120.0); if (Utility.RandomDouble() > (Caster.Skills[SkillName.SpiritSpeak].Value / 100.0)) { Caster.SendLocalizedMessage(502443); // You fail your attempt at contacting the netherworld. } else { if (toChannel != null) { toChannel.Channeled = true; toChannel.Hue = 0x835; } Caster.Mana -= mana; Caster.SendLocalizedMessage(number); if (min > max) { min = max; } Caster.Hits += Utility.RandomMinMax(min, max); Caster.FixedParticles(0x375A, 1, 15, 9501, 2100, 4, EffectLayer.Waist); } } SpiritSpeak.Remove(Caster); Stop(); }
protected override void OnTick() { Corpse toChannel = null; IPooledEnumerable eable = Caster.GetObjectsInRange(3); foreach (object objs in eable) { if (objs is Corpse && !((Corpse)objs).Channeled && !((Corpse)objs).Animated) { toChannel = (Corpse)objs; break; } else if (objs is Server.Engines.Khaldun.SageHumbolt) { if (((Server.Engines.Khaldun.SageHumbolt)objs).OnSpiritSpeak(Caster)) { eable.Free(); SpiritSpeak.Remove(Caster); Stop(); return; } } } eable.Free(); int max, min, mana, number; if (toChannel != null) { min = 1 + (int)(Caster.Skills[SkillName.SpiritSpeak].Value * 0.25); max = min + 4; mana = 0; number = 1061287; // You channel energy from a nearby corpse to heal your wounds. } else { min = 1 + (int)(Caster.Skills[SkillName.SpiritSpeak].Value * 0.25); max = min + 4; mana = 10; number = 1061286; // You channel your own spiritual energy to heal your wounds. } if (Caster.Mana < mana) { Caster.SendLocalizedMessage(1061285); // You lack the mana required to use this skill. } else { Caster.CheckSkill(SkillName.SpiritSpeak, 0.0, 120.0); if (Utility.RandomDouble() > (Caster.Skills[SkillName.SpiritSpeak].Value / 100.0)) { Caster.SendLocalizedMessage(502443); // You fail your attempt at contacting the netherworld. } else { if (toChannel != null) { toChannel.Channeled = true; toChannel.Hue = 0x835; } Caster.Mana -= mana; Caster.SendLocalizedMessage(number); if (min > max) { min = max; } Caster.Hits += Utility.RandomMinMax(min, max); Caster.FixedParticles(0x375A, 1, 15, 9501, 2100, 4, EffectLayer.Waist); } } SpiritSpeak.Remove(Caster); Stop(); }
protected override void OnTick() { // cap the healing potential if (m_context.HealSummonsHP > m_context.HealSummonsHPMax) { m_context.HealSummonsHP = m_context.HealSummonsHPMax; } if (m_context.Owner == null || m_context.Owner.Deleted || m_context.Owner.NetState == null || m_context.Owner.Map == Map.Internal) { return; } // alert senior staff for analysis purposes SpiritSpeak.UsageReport(m_context.Owner, "Spirit Speak: HealSummons"); // apply the healing ArrayList pets = new ArrayList(); foreach (Mobile m in World.Mobiles.Values) { // it's a creature if (m is BaseCreature) { BaseCreature bc = (BaseCreature)m; // it's my creature if (bc.Summoned && bc.SummonMaster == m_context.Owner) { // it's close if (m_context.Owner.GetDistanceToSqrt(m) <= (m_context.Owner.Skills.SpiritSpeak.Value / 20.0)) { pets.Add(bc); } else if (m_context.Owner.GetDistanceToSqrt(m) <= (m_context.Owner.Skills.SpiritSpeak.Value / 10.0)) { m_context.Owner.SendMessage("You are too far away to heal your pet."); } } } } for (int ix = 0; ix < pets.Count; ix++) { BaseCreature pet = pets[ix] as BaseCreature; if (pet.Hits < pet.HitsMax) { int delta = pet.HitsMax - pet.Hits; if (delta < m_context.HealSummonsHP) { // heal this much pet.Heal(delta); m_context.HealSummonsHP -= delta; } else { // using the last of our heal potential pet.Heal((int)m_context.HealSummonsHP); m_context.HealSummonsHP = 0; } // heal pet.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist); m_context.Owner.PlaySound(0x1E9); if (m_context.HealSummonsHP == 0) { break; } } } }