As of now, It currently gives the player a torch if they have an empty ring slot. I did this because I had a problem with the server not being able to handle null items, too lazy to fix.Keep in note that this is ported over from a different file, so manual adjustment may be required. (In my original source I configured it to have the nexus be always uncovered in map, and some other booleans for worlds, some if/else/elseif's have been removed)
Original Thread and Example Here:http://www.mpgh.net/forum/showthread.php?t=814574First things first: Add the XML for "Torch":
Code:
Equipment lofiObj 0x2c 9 A torch. 0
Then add the boolean for "cave" to World.cs:
Code:
public bool Cave { get; protected set; }
Now to edit Player.Update.cs:Change the existing sightradius value (should be a const) to this:
Code:
public static int SightRadius;
Now to add the Cave bool handler:Add this in the SendUpdate method:
Code:
if (world.Cave) { if (Inventory[3] == null) //some reason I had to add this { Inventory[3] = XmlDatas.ItemDescs[0xa4f]; } if (Inventory[3].ObjectType == 0xfe4) { SightRadius = 8; }else { SightRadius = 3; } }else { SightRadius = 15; }
To make a world/Dungeon a cave, add this bool to any world class:
If you have any problems, don't bother asking me, just copy and paste my signature or go cry.