Example #1
0
            protected override void OnTarget(Mobile from, object target)
            {
                PlayerMobile pm = (PlayerMobile)from;

                if (target is Corpse)
                {
                    Corpse corpse = target as Corpse;
                    Point3D loc = corpse.Location;
                    Map map = corpse.Map;

                    if (corpse.Owner.Player == true && m_Bury.CanBuryPlayers == false)
                        pm.SendMessage(" You cannot bury player corpses.");

                    else
                    #region map

                    {
                        Tile lt = map.Tiles.GetLandTile(from.X, from.Y);

                        if (IsDirt(lt.ID))
                        {
                            Grave grave = new Grave();
                            from.SendMessage("You bury the creature. Your deity rewards you with some karma.");
                            from.Karma += Utility.Random(1, 10); // customize what you want to give
                            from.Stam -= 2;

                            if (from.Luck >= 10)
                            {
                                switch (Utility.Random(100))
                                {
                                    case 1:
                                        {
                                            from.AddToBackpack(new Gold()); // customize what you want to give
                                            from.PlaySound(0x2E6); // drop gold sound
                                            from.SendMessage("You are lucky and find a coin in the ground.");
                                            break;
                                        }
                                    case 2:
                                        {
                                            from.AddToBackpack(new FertileDirt(Utility.Random(1, 2)));// customize what you want to give
                                            from.SendMessage("This is very fertile ground.You decide to take some of it.");
                                            break;
                                        }
                                    case 3:
                                        {
                                            from.AddToBackpack(new Spoon());// customize what you want to give
                                            from.SendMessage("You found an old spoon in the ground.");
                                            break;
                                        }
                                    default: break;
                                }
                            }

                            grave.MoveToWorld(loc, map);
                            corpse.Delete();

                            ItemRemovalTimer2 thisTimer = new ItemRemovalTimer2(grave);
                            thisTimer.Start();
                        }

                        if (IsSand(lt.ID))
                        {
                            //Grave grave = new Grave();
                            from.SendMessage("You bury the creature in the sand. Your deity rewards you with some karma.");
                            from.Karma += Utility.Random(1, 10); // customize what you want to give
                            from.Stam -= 2;

                            if (from.Luck >= 10)
                            {
                                switch (Utility.Random(100))
                                {
                                    case 1:
                                        {
                                            from.AddToBackpack(new Gold()); // customize what you want to give
                                            from.PlaySound(0x2E6); // drop gold sound
                                            from.SendMessage("You are lucky and find a coin in the sand.");
                                            break;
                                        }
                                    case 2:
                                        {
                                            from.AddToBackpack(new Diamond());// customize what you want to give
                                            from.SendMessage("You found a diamond in the sand!");
                                            break;
                                        }
                                    default: break;
                                }
                            }
                            corpse.Delete();
                        }
                    #endregion

                        #region static
                        // is it a static swamp?

                        Tile[] tiles = map.Tiles.GetStaticTiles(from.X, from.Y);

                        for (int i = 0; i < tiles.Length; ++i)
                        {
                            Tile t = tiles[i];
                            ItemData id = TileData.ItemTable[t.ID & 0x3FFF];

                            int tand = t.ID & 0x3FFF;

                            if (t.Z != from.Z)
                            {
                                continue;
                            }
                            else if (IsStaticDirt(tand))
                            {
                                Grave grave = new Grave();
                                from.SendMessage("You bury the creature. Your deity rewards you with some karma.");
                                from.Karma += Utility.Random(1, 10); // customize what you want to give
                                from.Stam -= 2;

                                if (from.Luck >= 10)
                                {
                                    switch (Utility.Random(100))
                                    {
                                        case 1:
                                            {
                                                from.AddToBackpack(new Gold()); // customize what you want to give
                                                from.PlaySound(0x2E6); // drop gold sound
                                                from.SendMessage("You are lucky and find a coin in the ground.");
                                                break;
                                            }
                                        case 2:
                                            {
                                                from.AddToBackpack(new FertileDirt(Utility.Random(1, 2)));// customize what you want to give
                                                from.SendMessage("This is very fertile ground.You decide to take some of it.");
                                                break;
                                            }
                                        case 3:
                                            {
                                                from.AddToBackpack(new Spoon());// customize what you want to give
                                                from.SendMessage("You found an old spoon in the ground.");
                                                break;
                                            }
                                        default: break;
                                    }
                                }

                                grave.MoveToWorld(loc, map);
                                corpse.Delete();

                                ItemRemovalTimer2 thisTimer = new ItemRemovalTimer2(grave);
                                thisTimer.Start();
                            }


                            else if (IsStaticSand(tand))
                            {
                                from.SendMessage("You bury the creature in the sand. Your deity rewards you with some karma.");
                                from.Karma += Utility.Random(1, 10); // customize what you want to give
                                from.Stam -= 2;

                                if (from.Luck >= 10)
                                {
                                    switch (Utility.Random(100))
                                    {
                                        case 1:
                                            {
                                                from.AddToBackpack(new Gold()); // customize what you want to give
                                                from.PlaySound(0x2E6); // drop gold sound
                                                from.SendMessage("You are lucky and find a coin in the sand.");
                                                break;
                                            }
                                        case 2:
                                            {
                                                from.AddToBackpack(new Diamond());// customize what you want to give
                                                from.SendMessage("You found a diamond in the sand!");
                                                break;
                                            }
                                        default: break;
                                    }
                                }
                            }
                            else
                                from.SendMessage("You can't bury this here.");
                        }
                    }
                        #endregion

                }

                else
                    from.SendMessage("You may only use this to bury corpses.");
                return;
            }
Example #2
0
            protected override void OnTarget(Mobile from, object target)
            {
                PlayerMobile pm = (PlayerMobile)from;

                if (target is Corpse)
                {
                    Corpse  corpse = target as Corpse;
                    Point3D loc    = corpse.Location;
                    Map     map    = corpse.Map;

                    if (corpse.Owner.Player == true && m_Bury.CanBuryPlayers == false)
                    {
                        pm.SendMessage(" You cannot bury player corpses.");
                    }

                    else
                    #region map

                    {
                        Tile lt = map.Tiles.GetLandTile(from.X, from.Y);

                        if (IsDirt(lt.ID))
                        {
                            Grave grave = new Grave();
                            from.SendMessage("You bury the creature. Your deity rewards you with some karma.");
                            from.Karma += Utility.Random(1, 10); // customize what you want to give
                            from.Stam  -= 2;

                            if (from.Luck >= 10)
                            {
                                switch (Utility.Random(100))
                                {
                                case 1:
                                {
                                    from.AddToBackpack(new Gold()); // customize what you want to give
                                    from.PlaySound(0x2E6);          // drop gold sound
                                    from.SendMessage("You are lucky and find a coin in the ground.");
                                    break;
                                }

                                case 2:
                                {
                                    from.AddToBackpack(new FertileDirt(Utility.Random(1, 2)));        // customize what you want to give
                                    from.SendMessage("This is very fertile ground.You decide to take some of it.");
                                    break;
                                }

                                case 3:
                                {
                                    from.AddToBackpack(new Spoon());        // customize what you want to give
                                    from.SendMessage("You found an old spoon in the ground.");
                                    break;
                                }

                                default: break;
                                }
                            }

                            grave.MoveToWorld(loc, map);
                            corpse.Delete();

                            ItemRemovalTimer2 thisTimer = new ItemRemovalTimer2(grave);
                            thisTimer.Start();
                        }

                        if (IsSand(lt.ID))
                        {
                            //Grave grave = new Grave();
                            from.SendMessage("You bury the creature in the sand. Your deity rewards you with some karma.");
                            from.Karma += Utility.Random(1, 10); // customize what you want to give
                            from.Stam  -= 2;

                            if (from.Luck >= 10)
                            {
                                switch (Utility.Random(100))
                                {
                                case 1:
                                {
                                    from.AddToBackpack(new Gold()); // customize what you want to give
                                    from.PlaySound(0x2E6);          // drop gold sound
                                    from.SendMessage("You are lucky and find a coin in the sand.");
                                    break;
                                }

                                case 2:
                                {
                                    from.AddToBackpack(new Diamond());        // customize what you want to give
                                    from.SendMessage("You found a diamond in the sand!");
                                    break;
                                }

                                default: break;
                                }
                            }
                            corpse.Delete();
                        }
                        #endregion

                        #region static
                        // is it a static swamp?

                        Tile[] tiles = map.Tiles.GetStaticTiles(from.X, from.Y);

                        for (int i = 0; i < tiles.Length; ++i)
                        {
                            Tile     t  = tiles[i];
                            ItemData id = TileData.ItemTable[t.ID & 0x3FFF];

                            int tand = t.ID & 0x3FFF;

                            if (t.Z != from.Z)
                            {
                                continue;
                            }
                            else if (IsStaticDirt(tand))
                            {
                                Grave grave = new Grave();
                                from.SendMessage("You bury the creature. Your deity rewards you with some karma.");
                                from.Karma += Utility.Random(1, 10); // customize what you want to give
                                from.Stam  -= 2;

                                if (from.Luck >= 10)
                                {
                                    switch (Utility.Random(100))
                                    {
                                    case 1:
                                    {
                                        from.AddToBackpack(new Gold()); // customize what you want to give
                                        from.PlaySound(0x2E6);          // drop gold sound
                                        from.SendMessage("You are lucky and find a coin in the ground.");
                                        break;
                                    }

                                    case 2:
                                    {
                                        from.AddToBackpack(new FertileDirt(Utility.Random(1, 2)));        // customize what you want to give
                                        from.SendMessage("This is very fertile ground.You decide to take some of it.");
                                        break;
                                    }

                                    case 3:
                                    {
                                        from.AddToBackpack(new Spoon());        // customize what you want to give
                                        from.SendMessage("You found an old spoon in the ground.");
                                        break;
                                    }

                                    default: break;
                                    }
                                }

                                grave.MoveToWorld(loc, map);
                                corpse.Delete();

                                ItemRemovalTimer2 thisTimer = new ItemRemovalTimer2(grave);
                                thisTimer.Start();
                            }


                            else if (IsStaticSand(tand))
                            {
                                from.SendMessage("You bury the creature in the sand. Your deity rewards you with some karma.");
                                from.Karma += Utility.Random(1, 10); // customize what you want to give
                                from.Stam  -= 2;

                                if (from.Luck >= 10)
                                {
                                    switch (Utility.Random(100))
                                    {
                                    case 1:
                                    {
                                        from.AddToBackpack(new Gold()); // customize what you want to give
                                        from.PlaySound(0x2E6);          // drop gold sound
                                        from.SendMessage("You are lucky and find a coin in the sand.");
                                        break;
                                    }

                                    case 2:
                                    {
                                        from.AddToBackpack(new Diamond());        // customize what you want to give
                                        from.SendMessage("You found a diamond in the sand!");
                                        break;
                                    }

                                    default: break;
                                    }
                                }
                            }
                            else
                            {
                                from.SendMessage("You can't bury this here.");
                            }
                        }
                    }
                    #endregion
                }

                else
                {
                    from.SendMessage("You may only use this to bury corpses.");
                }
                return;
            }