Esempio n. 1
0
        public override bool Give(Mobile m, Item item, bool placeAtFeet)
        {
            if (item is RustyKatana || item is RustyHatchet || item is RustyDagger)
            {
                BaseCreature corp;

                if (0.25 > Utility.RandomDouble())
                {
                    corp = new WhippingVine();
                }
                else
                {
                    corp = new Corpser();
                }

                int x = m.X, y = m.Y;

                Map map = m.Map;

                for (int i = 0; map != null && i < 20; ++i)
                {
                    int tx = m.X - 10 + Utility.Random(21);
                    int ty = m.Y - 10 + Utility.Random(21);

                    LandTile t = map.Tiles.GetLandTile(tx, ty);

                    if (t.Z == -5 && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, -5), map))
                    {
                        x = tx;
                        y = ty;
                        break;
                    }
                }

                corp.MoveToWorld(new Point3D(x, y, -5), map);

                corp.Home      = corp.Location;
                corp.RangeHome = 10;

                corp.PackItem(Seed.RandomPeculiarSeed(1));

                m.SendMessage("You attempted to pull a rusty weapon out of a random vine, apparently it was attached to a plant");

                return(false);                // Yes Give the Weapon to Creature, Seed on corpse now.
            }
            return(base.Give(m, item, placeAtFeet));
        }
Esempio n. 2
0
        public override void Damage(Mobile m)
        {
            base.Damage(m);

            if (m.Alive)
            {
                Item item = m.FindItemOnLayer(Layer.OuterTorso);

                if (item is GMRobe)
                {
                    // Jungle noises
                    if (Utility.RandomDouble() < 0.08)
                    {
                        m.PlaySound(Utility.RandomList(0x003, 0x004, 0x005));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Bird chirps
                    if (Utility.RandomDouble() < 0.02)
                    {
                        m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Cricket noises
                    if (Utility.RandomDouble() < 0.03)
                    {
                        m.PlaySound(Utility.RandomList(0x00A, 0x00B));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // sfx noises
                    if (Utility.RandomDouble() < 0.02)
                    {
                        m.PlaySound(Utility.RandomList(0x0F5, 0x0F7, 0x0F8, 0x0FB));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }
                }
                else
                {
                    // Jungle noises
                    if (Utility.RandomDouble() < 0.08)
                    {
                        m.PlaySound(Utility.RandomList(0x003, 0x004, 0x005));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Bird chirps
                    if (Utility.RandomDouble() < 0.02)
                    {
                        m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Cricket noises
                    if (Utility.RandomDouble() < 0.03)
                    {
                        m.PlaySound(Utility.RandomList(0x00A, 0x00B));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // sfx noises
                    if (Utility.RandomDouble() < 0.02)
                    {
                        m.PlaySound(Utility.RandomList(0x0F5, 0x0F7, 0x0F8, 0x0FB));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Corpser Ambush 1
                    if (Utility.RandomDouble() < 0.012)
                    {
                        if (m.Map == Map.Tokuno)
                        {
                            int x1 = m.X + 3;
                            int y1 = m.Y + 3;
                            int z1 = Map.Tokuno.GetAverageZ(x1, y1);

                            if (Map.Tokuno.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature corpser = new Corpser();
                                corpser.MoveToWorld(new Point3D(x1, y1, z1), Map.Tokuno);
                                corpser.Combatant = m;
                                corpser.PlaySound(684);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(1.0), new TimerStateCallback(DeleteCorpser), corpser);
                            }
                        }
                    }

                    // Corpser Ambush 2
                    if (Utility.RandomDouble() < 0.012)
                    {
                        if (m.Map == Map.Tokuno)
                        {
                            int x2 = m.X - 3;
                            int y2 = m.Y - 3;
                            int z2 = Map.Tokuno.GetAverageZ(x2, y2);

                            if (Map.Tokuno.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature corpser = new Corpser();
                                corpser.MoveToWorld(new Point3D(x2, y2, z2), Map.Tokuno);
                                corpser.Combatant = m;
                                corpser.PlaySound(684);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(1.0), new TimerStateCallback(DeleteCorpser), corpser);
                            }
                        }
                    }

                    // Qiraji Ambush 1
                    if (Utility.RandomDouble() < 0.008)
                    {
                        if (m.Map == Map.Tokuno)
                        {
                            int x1 = m.X + 5;
                            int y1 = m.Y + 5;
                            int z1 = Map.Tokuno.GetAverageZ(x1, y1);

                            if (Map.Tokuno.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature qiraji = new Qiraji();
                                qiraji.MoveToWorld(new Point3D(x1, y1, z1), Map.Tokuno);
                                qiraji.Combatant = m;
                                qiraji.PlaySound(0x269);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteQiraji), qiraji);
                            }
                        }
                    }

                    // Qiraji Ambush 2
                    if (Utility.RandomDouble() < 0.008)
                    {
                        if (m.Map == Map.Tokuno)
                        {
                            int x2 = m.X - 5;
                            int y2 = m.Y - 5;
                            int z2 = Map.Tokuno.GetAverageZ(x2, y2);

                            if (Map.Tokuno.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature qiraji = new Qiraji();
                                qiraji.MoveToWorld(new Point3D(x2, y2, z2), Map.Tokuno);
                                qiraji.Combatant = m;
                                qiraji.PlaySound(0x269);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(2.0), new TimerStateCallback(DeleteQiraji), qiraji);
                            }
                        }
                    }
                }
            }
        }