LightbulbCave System

Posts 1–5 of 5 · Page 1 of 1
Cave System
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:
Code:
Dungeon=true;
If you have any problems, don't bother asking me, just copy and paste my signature or go cry.
@Raple @Lovroman what happened to my beautiful formatting..... Some code was even removed by the shit MPGH servers
The system itself is nicely made but it does gives some odd results from time to time. Didn't look into the system too much other than tested it once or twice on a micro localhost server.
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?