Nyght_Hex

Member
Hey everyone so I am tinkering around with this script that I pulled and I was wondering how to add "Treasure Chest" and then right underneath it give the level of difficulty. I figured I would use the level 1 thru 6 description to let players know the intensity of it.

Is there a way to write it up so that when treasure chests spawn on server that they carry these name changes?

Attached is the script that I was playing around with. Bare with me I am just doing a crash course into this scripting adventure we call life!
 

Attachments

  • Treasure Chest Rarities.txt
    27.4 KB · Views: 5
find the script TreasureChestMod.cs

In each instance, level 1 though 4, add

Name "Treasure Chest"; for your name change. THEN respawn the spawners that spawn your chests already in the world.

Example

This is the normal code

Code:
[Constructable]
        public TreasureLevel1() : base( Utility.RandomList( 0xE3C, 0xE3E, 0x9a9 ) )
        {
            RequiredSkill = 52;
            LockLevel = this.RequiredSkill - Utility.Random( 1, 10 );
            MaxLockLevel = this.RequiredSkill;
            TrapType = TrapType.MagicTrap;
            TrapPower = 1 * Utility.Random( 1, 25 );

            DropItem(new Gold(30, 100));
            DropItem(new Bolt(10));
            DropItem(Loot.RandomClothing());

            AddLoot(Loot.RandomWeapon());
            AddLoot(Loot.RandomArmorOrShield());
            AddLoot(Loot.RandomJewelry());

            for (int i = Utility.Random(3) + 1; i > 0; i--) // random 1 to 3
                DropItem( Loot.RandomGem() );
    }


Change it to

Code:
[Constructable]
        public TreasureLevel1() : base( Utility.RandomList( 0xE3C, 0xE3E, 0x9a9 ) )
        {
            RequiredSkill = 52;
            // ADD THIS
	    	Name = "Treasure Chest";

            LockLevel = this.RequiredSkill - Utility.Random( 1, 10 );
            MaxLockLevel = this.RequiredSkill;
            TrapType = TrapType.MagicTrap;
            TrapPower = 1 * Utility.Random( 1, 25 );

            DropItem(new Gold(30, 100));
            DropItem(new Bolt(10));
            DropItem(Loot.RandomClothing());

            AddLoot(Loot.RandomWeapon());
            AddLoot(Loot.RandomArmorOrShield());
            AddLoot(Loot.RandomJewelry());

            for (int i = Utility.Random(3) + 1; i > 0; i--) // random 1 to 3
                DropItem( Loot.RandomGem() );
    }
 
Tas,

Thank you for the help, I am going to play around with what you gave me and see if that does the trick!

Thanks again.
 
  • Like
Reactions: Dan

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back