Exemple #1
0
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            name = from.Name;

            if (from != null)
            {
                if (0.15 > Utility.RandomDouble())//transformation
                {
                    if (from is BaseCreature)
                    {
                        from.Hits -= Utility.RandomMinMax(50, 150);
                        from.PlaySound(0x19C);
                    }
                    else if (from is PlayerMobile)
                    {
                        if (from != null)
                        {
                            if (from.BodyValue == 400)
                            {
                                originalbody = 400;
                            }
                            else if (from.BodyValue == 401)
                            {
                                originalbody = 401;
                            }
                            else
                            {
                            }

                            if (from != null)
                            {
                                from.BodyValue = Utility.RandomList(31, 24, 26, 50, 56, 147, 3);
                                from.SendMessage("{0}, you have been transformed into a undead!", name);
                                BodyReturnTimer m_timer = new BodyReturnTimer(from, originalbody);
                                m_timer.Start();
                                from.PlaySound(0x19C);


                                if (from.Mounted == true)
                                {
                                    IMount mount = from.Mount;

                                    if (mount != null)
                                    {
                                        mount.Rider = null;

                                        from.SendLocalizedMessage(1040023);

                                        BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));

                                        BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                    }
                                }
                                else if (from.Mounted == false)
                                {
                                    from.SendMessage("You are dazed by a critical hit!");
                                    BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                }
                                else
                                {
                                    from.SendMessage("You are dazed by a critical hit!");
                                    BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                }
                            }
                        }
                    }
                    else
                    {
                        from.Hits -= Utility.RandomMinMax(50, 150);
                        from.PlaySound(0x19C);
                    }
                }

                if (0.10 > Utility.RandomDouble())//spawn
                {
                    spawn    = new UndeadSpawn();
                    spawnmap = this.Map;
                    spawnloc = new Point3D(this.X + Utility.RandomMinMax(0, 4), this.Y + Utility.RandomMinMax(0, 4), this.Z);
                    spawn.MoveToWorld(spawnloc, spawnmap);
                    Effects.PlaySound(spawnloc, spawnmap, 0x1FB);
                    Effects.SendLocationParticles(EffectItem.Create(spawnloc, spawnmap, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);
                    spawn.Combatant = from;
                }

                if (0.10 > Utility.RandomDouble())//wither
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        if (m is UndeadSpawn)
                        {
                        }
                        else
                        {
                            targets.Add(m);
                        }
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= amount;

                        this.Mana -= 5;
                    }
                }
                else if (0.8 > Utility.RandomDouble())
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        targets.Add(m);
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= amount;

                        this.Mana -= 5;
                    }
                }
                else
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        targets.Add(m);
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= Utility.RandomMinMax(10, 20);

                        this.Mana -= 5;
                    }
                }

                if (0.2 > Utility.RandomDouble())//animate dead
                {
                    ArrayList corpses = new ArrayList();

                    foreach (Item item in this.GetItemsInRange(4))
                    {
                        if (item is Corpse)
                        {
                            corpses.Add(item);
                        }
                    }

                    for (int i = 0; i < corpses.Count; ++i)
                    {
                        Item corpse = (Item)corpses[i];

                        mobloc      = new Point3D(corpse.X, corpse.Y, corpse.Z);
                        mobmap      = corpse.Map;
                        spawn       = new UndeadSpawn();
                        spawn.Name  = corpse.Name;
                        spawn.Title = "wrongly resurected";
                        spawn.MoveToWorld(mobloc, mobmap);
                        spawn.Combatant = from;

                        Effects.PlaySound(mobloc, mobmap, 0x1FB);
                        Effects.SendLocationParticles(EffectItem.Create(mobloc, mobmap, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);

                        Corpse corpseb = (Corpse)corpse;

                        owner = corpseb.m_Owner;

                        if (owner is PlayerMobile)
                        {
                        }
                        else
                        {
                            corpseb.Delete();
                        }
                    }
                }
            }
        }
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            name = from.Name;

            if (from != null)
            {
                if (0.15 > Utility.RandomDouble())//transformation
                {
                    if (from is BaseCreature)
                    {
                        from.Hits -= Utility.RandomMinMax(50, 150);
                        from.PlaySound(0x19C);
                    }
                    else if (from is PlayerMobile)
                    {

                        if (from != null)
                        {
                            if (from.BodyValue == 400)
                            {
                                originalbody = 400;
                            }
                            else if (from.BodyValue == 401)
                            {
                                originalbody = 401;
                            }
                            else
                            {
                            }

                            if (from != null)
                            {
                                from.BodyValue = Utility.RandomList(31, 24, 26, 50, 56, 147, 3);
                                from.SendMessage("{0}, you have been transformed into a undead!", name);
                                BodyReturnTimer m_timer = new BodyReturnTimer(from, originalbody);
                                m_timer.Start();
                                from.PlaySound(0x19C);


                                if (from.Mounted == true)
                                {

                                        IMount mount = from.Mount;

                                        if (mount != null)
                                        {
                                            mount.Rider = null;

                                            from.SendLocalizedMessage(1040023); 

                                            BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0));

                                            BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                        }
                                    
                                }
                                else if (from.Mounted == false)
                                {
                                    from.SendMessage("You are dazed by a critical hit!");
                                    BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                }
                                else
                                {
                                    from.SendMessage("You are dazed by a critical hit!");
                                    BaseMount.SetMountPrevention(from, BlockMountType.Dazed, TimeSpan.FromSeconds(20.0));
                                }
                            }

                        }
                    }
                    else
                    {
                        from.Hits -= Utility.RandomMinMax(50, 150);
                        from.PlaySound(0x19C);
                    }
                }

                if (0.10 > Utility.RandomDouble())//spawn
                {
                    spawn = new UndeadSpawn();
                    spawnmap = this.Map;
                    spawnloc = new Point3D(this.X + Utility.RandomMinMax(0, 4), this.Y + Utility.RandomMinMax(0, 4), this.Z);
                    spawn.MoveToWorld(spawnloc, spawnmap);
                    Effects.PlaySound(spawnloc, spawnmap, 0x1FB);
                    Effects.SendLocationParticles(EffectItem.Create(spawnloc, spawnmap, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);
                    spawn.Combatant = from;
                }

                if (0.10 > Utility.RandomDouble())//wither
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        if (m is UndeadSpawn)
                        {
                        }
                        else
                        {
                            targets.Add(m);
                        }
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= amount;

                        this.Mana -= 5;
                    }
                }
                else if (0.8 > Utility.RandomDouble())
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        targets.Add(m);
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= amount;

                        this.Mana -= 5;
                    }
                }
                else
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(4))
                    {
                        targets.Add(m);
                    }

                    thisloc = new Point3D(this.X, this.Y, this.Z);
                    thismap = this.Map;

                    Effects.PlaySound(thisloc, thismap, 0x1FB);
                    Effects.PlaySound(thisloc, thismap, 0x10B);
                    Effects.SendLocationParticles(EffectItem.Create(thisloc, thismap, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        m.Hits -= Utility.RandomMinMax(10, 20);

                        this.Mana -= 5;
                    }
                }

                if(0.2 > Utility.RandomDouble())//animate dead
                {
                    ArrayList corpses = new ArrayList();

                    foreach (Item item in this.GetItemsInRange(4))
                    {

                        if (item is Corpse)
                        {
                                corpses.Add(item);
                        }

                    }

                    for (int i = 0; i < corpses.Count; ++i)
                    {
                        Item corpse = (Item)corpses[i];

                        mobloc = new Point3D(corpse.X, corpse.Y, corpse.Z);
                        mobmap = corpse.Map;
                        spawn = new UndeadSpawn();
                        spawn.Name = corpse.Name;
                        spawn.Title = "wrongly resurected";
                        spawn.MoveToWorld(mobloc, mobmap);
                        spawn.Combatant = from;

                        Effects.PlaySound(mobloc, mobmap, 0x1FB);
                        Effects.SendLocationParticles(EffectItem.Create(mobloc, mobmap, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);

                        Corpse corpseb = (Corpse)corpse;

                        owner = corpseb.m_Owner;

                        if (owner is PlayerMobile)
                        {
                        }
                        else
                        {
                            corpseb.Delete();
                        }
                    }

                }

            }
        }