Beispiel #1
0
            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();
            }
Beispiel #2
0
            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();
            }