Great job I will add you to credits![]()
|
|
I noticed recently that DangerZone's 508 DOES NOT have a npcdrops.cfg/xml to make drops from. So here is a little tutorial on how to add them.
Difficulty: 2
In this tutorial I will use a Chicken as the NPC (id 41) so replace the 41s with your NPC id.
1. navigate to palidino76.rs2.npcs in your source folder.
2. open up NPC.java with your editor of choice.
3. search this:
4. Then scroll down to this:Code:public void appendNpcDrops() {
5. Under the break type this:Code:case 5253: if (Misc.random(10) == 5) Server.engine.items.createGroundItem(10581, 1, absX, absY, heightLevel, p.username); break;
6. Now I'll explain this a little bit more.Code:case 41: Engine.items.createGroundItem(526, 1, absX, absY, heightLevel, p.username); Engine.items.createGroundItem(995, Misc.random(25), absX, absY, heightLevel, p.username); break;
- REMEMBER 41 is the id of a Chicken, so change this to your NPC's id.Code:case 41:
- Tells the system to create 1 pile of bones (id 526) at the height, and coordinates of the dead chicken.Code:Engine.items.createGroundItem(526, 1, absX, absY, heightLevel, p.username);
- Same as above except with gold (id 995). IMPORTANT The (25) means its drops UP TO 25 gold in random amounts.Code:Engine.items.createGroundItem(995, Misc.random(25), absX, absY, heightLevel, p.username);
- I shouldn't even have to explain.Code:break;
Just edit this code to your liking and you are done!
PLEASE DON'T LEAVE JERK COMMENTS I AM ONLY TRYING TO HELP PEOPLE!!!
CREDITS:
90% William'
10% Me
Great job I will add you to credits![]()
This isn't npcdrops.cfg/xml, this is just a very simple way of adding drops, but takes up a lot more space, isn't as efficient and such. Not the best way of doing it, here's how to implement the npcdrops.cfg file, from my older source, (xml is actually better), if you can find a tutorial for that. But here's what you need to do for npcdrops.cfg:
Go to Engine.java and find "getPlayerCount()" or "rebuildNPCs()", underneath add the following (may need some converting for your source), this works on any codeusa source.
Spoiler for Engine.java npcdrops:
EDIT: in NPC.java, find your appendNpcDrops() method, add at the bottom of the method:
Engine.dropNPCItems(npcType, this, p); // Drops items from the npcdrops.cfg file
Next add this file in build->data->npcs
npcdrops.cfg
That is your npcdrops.cfg file, add all your drops in there, i've added a line at the top of the file on how to format. DONT USE ANY SPACES, ONLY TABS
If you run into any problems, let me know, i might have left out some things not sure, just threw this together in a few mins.
Goodluck.
Great Job![]()
| « [637/639]Changing Npc health/stats/anims | [667/697+]Making polypore non-autocast[667/697+] » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |