Thread: How to add [npc-drops] if the npc is to big, [PI/Riotscape]

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 How to add [npc-drops] if the npc is to big, [PI/Riotscape] 
    Registered Member

    Join Date
    Oct 2009
    Posts
    1,595
    Thanks given
    100
    Thanks received
    50
    Rep Power
    232
    much people get trubble of adding npcdrops when the npc is to big. like gwd npc..

    k let's start.

    Code:
    package server.model.npcs;
    
    import java.io.File;
    import java.util.HashMap;
    import java.util.StringTokenizer;
    import java.util.Scanner;
    
    /**
     * @author Sanity
     */
    
    public class NPCDrops {
    	
    	public NPCDrops() {
    		loadDrops();
    	}
    	
    
    	
    	public static HashMap<Integer, int[][]> normalDrops = new HashMap<Integer, int[][]>();
    	public static HashMap<Integer, int[][]> rareDrops = new HashMap<Integer, int[][]>();
    	public static HashMap<Integer, int[]> constantDrops = new HashMap<Integer, int[]>();
    	public static HashMap<Integer, Integer> dropRarity = new HashMap<Integer,Integer>();
    	
    	public void loadDrops() {
    		try {
    			int[][][] npcDrops = new int [62585][][];
    			int[][][] rareDrops2 = new int [62585][][];
    			int[] itemRarity = new int [62585];
    			File f = new File("./Data/cfg/NPCDrops.TSM");
    			Scanner s = new Scanner(f);
    			while (s.hasNextLine()) {
    				String line = s.nextLine();
    				if (line.startsWith("#"))
    					continue;
    				StringTokenizer normalTok = new StringTokenizer(line, "\t");
    				line = s.nextLine();
    				if (line.startsWith("#"))
    					continue;
    				StringTokenizer rareTok = new StringTokenizer(line, "\t");
    				String[] information = normalTok.nextToken().split(":");
    				int npcId = Integer.parseInt(information[0]);
    				itemRarity[npcId] = Integer.parseInt(information[1])-1;
    				npcDrops[npcId] = new int[normalTok.countTokens()][2];
    				rareDrops2[npcId] = new int[rareTok.countTokens()][2];
    				int count = 0;
    				while (normalTok.hasMoreTokens()) {
    					String[] temp = normalTok.nextToken().split(":");
    					npcDrops[npcId][count][0] = Integer.parseInt(temp[0]);
    					npcDrops[npcId][count][1] = Integer.parseInt(temp[1]);
    					count++;
    				}
    				count = 0;
    				while (rareTok.hasMoreTokens()) {
    					String[] temp = rareTok.nextToken().split(":");
    					rareDrops2[npcId][count][0] = Integer.parseInt(temp[0]);
    					System.out.println("Raredrop: " + count + " " + rareDrops2[npcId][count][0]);
    					rareDrops2[npcId][count][1] = Integer.parseInt(temp[1]);
    					System.out.println("Raredrop: " + count + " " + rareDrops2[npcId][count][1]);
    					count++;
    				}
    				normalDrops.put(npcId, npcDrops[npcId]);
    				rareDrops.put(npcId, rareDrops2[npcId]);
    				dropRarity.put(npcId, itemRarity[npcId]);
    			}
    			loadConstants();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}	
    	}
    	
    	public void loadConstants() {
    		try {
    			File f = new File("./Data/cfg/NpcConstants.TSM");
    			Scanner s = new Scanner(f);
    			while (s.hasNextLine()) {
    				String line = s.nextLine();
    				if (line.startsWith("#"))
    					continue;
    				StringTokenizer constantTok = new StringTokenizer(line, "\t");
    				int npcId = Integer.parseInt(constantTok.nextToken());
    				int count = 0;
    				int[] temp = new int[constantTok.countTokens()];
    				while (constantTok.hasMoreTokens()) {
    					temp[count] = Integer.parseInt(constantTok.nextToken());
    					count++;
    				}
    				constantDrops.put(npcId,temp);
    			}
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	
    	}
    	
    	
    }
    then reaplace ur npcdrops.tsm with this

    Code:
    #Man drops
    1:1	995:100	554:100
    #Guard drops
    9:1	995:200	555:100
    #general graardor
    6260:40	829:1	391:2	385:2	564:50	1249:1	3052:3	892:75	1303:1	808:100	1602:3	1917:1	1971:1	1514:16	1319:1	1275:1	3024:3	1606:3	454:150	560:100	563:50	561:75	1373:1	1127:1	5300:2	2440:3	1604:3	1452:1	995:100000	1149:1	830:5	1079:1	886:100	1608:3
    11712:1	11728:1	11714:1	11724:1	11704:1	11710:1
    #sergeant grimspike
    6265:100	995:50000	1303:1	385:2	3024:3	564:75	3052:3	561:75	1275:1	5300:1	2440:3	1971:1	1319:1	1127:1	886:100	1917:1	454:200	1373:1	1079:1	808:100
    11728:1	11710:1	11724:1	11712:1	11726:1	11714:1	11714:1	11710:1	11712:1
    #sergeant strongstack
    6261:100	995:50000	1303:1	385:2	3024:3	564:75	3052:3	561:75	1275:1	5300:1	2440:3	1971:1	1319:1	1127:1	886:100	1917:1	454:200	1373:1	1079:1	808:100
    11728:1	11710:1	11724:1	11712:1	11726:1	11714:1	11714:1	11710:1	11712:1
    #sergeant steelwill
    6263:100	995:50000	1303:1	385:2	3024:3	564:75	3052:3	561:75	1275:1	5300:1	2440:3	1971:1	1319:1	1127:1	886:100	1917:1	454:200	1373:1	1079:1	808:100
    11728:1	11724:1	11726:1	11714:1	11710:1	11712:1	11714:1	11710:1	11712:1
    #commander zilyana
    6247:40	1123:1	1602:6	3040:3	1373:1	1289:1	1616:2	811:100	6687:3	1608:3	995:100000	208:5	2434:3	1201:1	163:3	3026:3	563:120	5295:2	1093:1
    2366:1	11710:1	11706:1	11712:1	11714:1	11730:1	11710:1
    #growler
    6250:100	995:30000	886:120	207:2	808:100	563:50	385:3
    11730:1	11710:1	11712:1	11714:1	11710:1	11712:1	11714:1
    #starlight
    6248:100	995:30000	886:120	207:2	808:100	563:50	385:3
    11730:1	11710:1	11712:1	11714:1	11710:1	11712:1	11714:1
    #bree
    6257:100	995:30000	886:120	207:2	808:100	563:50	385:3
    11730:1	11710:1	11712:1	11714:1	11710:1	11712:1	11714:1
    #kree'arra
    6222:40	995:100000	829:16	1319:1	1373:1	9185:1	830:5	1247:1	1289:1	808:100	2503:1	1149:1	1113:1	1201:1	1127:1	1185:1	560:100	563:78	558:607	561:79	9243:20	9244:10	1606:3	1602:3	1608:3	1616:2	169:3	163:3	2364:4	3051:3	5300:1
    11718:1	11722:1	11720:1	11710:1	11712:1	11714:1
    #flockleader geerin
    6225:100	995:20000	808:129	886:127	391:2	207:2	3051:2	213:2
    11718:1	11720:1	11722:1	11710:1	11712:1	11714:1	11714:1	11710:1	11712:1
    #flight kilisa
    6227:100	995:20000	808:129	886:127	391:2	207:2	3051:2	213:2
    11718:1	11720:1	11722:1	11710:1	11712:1	11714:1	11714:1	11710:1	11712:1
    #wingman skree
    6223:100	995:20000	808:129	886:127	391:2	207:2	3051:2	213:2
    11718:1	11720:1	11722:1	11710:1	11712:1	11714:1	11714:1	11710:1	11712:1
    #dagannoth prime
    2882:12	995:10000	1397:1	1392:10	1399:1	6562:1	1319:1	1381:1	1385:1	1395:1	1149:1	3755:1	1201:1	1185:1	6141:1	6139:1	556:518	565:57	560:97	557:107	563:78	561:98	892:100	886:179	1439:59	1446:1	1441:58	207:2	2364:3	395:5	1602:2
    6739:1	6737:1
    #dagannoth rex
    2883:12	995:10000	1355:1	1315:1	1343:1	1357:1	829:20	1359:1	1373:1	1319:1	830:5	1247:5	3757:1	1149:1	6130:1	6129:1	1123:1	1193:1	1119:1	3748:1	3758:1	1185:1	1201:1	886:100	892:57	561:58	563:78	207:2	448:27	454:100	441:150	2364:3	2362:6	365:5	373:5	385:5	191:2	141:2	165:1	159:2	1616:1	1602:2	
    6739:1	6735:1	6737:1
    #Supreme
    2881:12	995:10000	810:10	6133:1	6135:1	6131:1	866:20	864:20	830:20	3749:1	2356:50	2363:1	2366:1	2489:1	865:20	805:10	1602:2	1604:2	1606:1	1608:2	443:20
    6739:1	6733:1
    #Banshee
    1612:100	1247:1	830:5	995:35	562:7	1203:1	1620:3	1624:3	1622:3	563:3
    1249:1
    #Infernal mage
    1643:10	560:150	656:1	995:500	1387:1	554:150	562:150	557:150	555:150	1379:1	1618:3	1620:3	1602:3				
    4675:1	4091:1	4093:1	2579:1
    #Nechryael
    1613:30	1079:1	1129:1	1073:1	1126:1	995:500	1365:1	1602:3	1604:3	1606:3	886:150	5296:1	4131:1	560:150
    1149:1	11732:1
    #Dust Devil
    1624:300	560:75	1093:1	1147:1	1127:1	1185:1	1275:1	1333:1	1373:1	562:75	805:10		
    3140:1	1249:1
    #Crawling Hand
    1648:20	995:1000	830:5	1618:2	1624:2	1622:2	1620:2
    4095:1
    #Bloodveld
    1618:90	211:3	201:3	1113:1	830:5	1602:2	995:5000	215:2	207:2	1606:3	565:50	445:3	119:2	1247:1	1604:2	209:2	1608:2		
    2366:1	1249:1
    #gargoyle
    1610:15	4131:1	995:5000	4091:1	1163:1	1604:2	554:200	830:5	1608:3	562:40	560:25	2358:3	1602:2	1606:3	4153:1
    2366:1	1249:1
    #abyssal demon
    1615:43	556:150	560:70	379:3	1373:1	1201:1	1618:2	562:50	1149:1	1319:1	1113:1	1147:1	1622:3	2364:3	1249:1	892:50	1247:1	1620:3	565:50	995:10000	1615:1	830:1	1185:1	563:50	1624:3
    2366:1	4151:1
    #black demon
    84:30		1163:1			1079:1		1093:1		1127:1	1618:3	1620:3	1622:3	1624:3	
    1149:1		1615:2			1305:1
    #Black Knights
    178:5		1333:1		1217:1		1233:1		1151:1		1179:1		1313:1		1341:1
    1015:1		1077:1		1089:1		1107:1		1125:1		1165:1		1195:1		1327:1		5700:1
    #Blue Dragon
    55:30		1751:1		995:3000	1247:1
    1249:1		2366:1		1149:1		1616:2
    #chaos druid
    181:3		249:3		251:3		253:2		255:2		257:1		259:1		261:1		263:1		267:1		265:1
    5291:3		5292:3		5293:3		5294:2		5294:1		5295:1		5296:1		5297:1		5298:1		5299:1		5300:1		5301:1		5302:1		5303:1	
    #chaos dwarf
    119:30		1157:1		1169:1		1083:1		1119:1		1193:1
    5698:1		4587:1		1434:1
    #ghost
    103:5		995:500		1355:1
    995:1000		563:10
    #bat
    78:5		1331:1		1327:1
    1333:1
    #Lesser Demon
    82:30		995:1300	
    445:15		1249:1
    #magic axe
    127:3		1363:1
    1366:1
    #RockCrab
    1265:50		1620:1		1622:1	1624:1		995:450
    1329:1	1615:1	1969:1	1602:1
    #skeleton
    90:12		526:1		995:65		884:50		1247:1		1199:1
    1618:2		1620:2		1622:2		888:100
    #Tzhaar
    2607:10	1602:2	1604:2	1608:2	379:3	6529:350	149:1	161:1	1127:1	1147:1	1213:1	1113:1	560:200
    6571:1	6568:1	6524:1	6522:10	6525:1	6526:1	11128:1
    #Green Dragons
    941:35	1161:1	554:100	209:2	1355:1	1462:1	1247:1	1608:2	450:2	995:1000	1197:1	1213:1	1602:1	555:100	365:2	217:2	201:2	563:10	1243:1	1163:1	1365:1	1606:3	119:2	207:2	561:10	830:5	1069:1	1604:2
    2366:1	1249:1
    #black dragons
    54:75	2362:4	2364:2	1123:1	11212:20	565:30	554:100	1373:1	1303:1	1618:3	556:75	995:5000	1319:1	1113:1	443:100	1622:3	810:16	1452:1	1355:1	561:70	892:73	868:5	1185:1	886:175	1620:3	829:30	560:50	563:47	1369:1	1462:1	1201:1	1247:1	1608:3	
    11286:1	2366:1	1149:1
    #Fire giants
    110:50	1147:1	560:150	562:150	554:500	561:100	995:1200	892:150	1079:1	1127:1	1163:1	1185:1	1303:1	1319:1	1373:1	1436:100	
    1249:1	2366:1	1149:1	4131:1	
    #Moss Giants
    112:30	1213:1	1247:1	995:500	560:150	555:150	892:150	805:10	1618:2	1620:2	1622:2	1624:2		
    2366:1	
    #Elf Warriors
    1183:50	555:150	868:30	1079:1	1185:1	1163:1	1229:1	1247:1	1359:1	6328:1	861:1	173:1	11212:10
    4214:1	4225:1
    #Hill Giant
    117:1	1163:1	1093:1	1247:1	995:1200	892:150
    995:2000
    #king black dragon
    50:15	555:150	565:150	805:20	830:20	1079:1	1303:1	1373:1	4131:1	1213:1	1147:1	1113:1	560:250	1359:1	892:150	1185:1	1249:1	1616:2
    1149:1	1187:1	4585:1	11286:1	2366:1
    #Dark Beast
    2783:40	555:200	560:200	1079:1	1093:1	1127:1	1185:1	1163:1	1213:1	1247:10	1303:1	1373:1	892:150	11212:20	1615:1
    11235:1
    #sara mage
    914:20	995:500
    3844:1
    #guthix
    913:20	995:500
    3840:1
    #zammy mage
    912:20	995:500
    3842:1
    fixed all gwd bosses drop for you happy?

    save and compile done..

    it wasn't that hard, lol. thanks

    comment please,

    rep would be greatfull!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Aug 2009
    Posts
    551
    Thanks given
    12
    Thanks received
    2
    Rep Power
    41
    idk if it works yet got dialogue handler problem
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2008
    Posts
    3,167
    Thanks given
    235
    Thanks received
    74
    Rep Power
    209
    what u mean npc is to big???
    and what u changed in it?
    Reply With Quote  
     

  4. #4  
    Fuckin PRO Derek's Avatar
    Join Date
    May 2008
    Posts
    1,259
    Thanks given
    38
    Thanks received
    86
    Rep Power
    67
    He changes these ints to higher values. Thanks. I was thinking about doing that but I never thought it would work.
    int[][][] npcDrops = new int [62585][][];
    int[][][] rareDrops2 = new int [62585][][];
    int[] itemRarity = new int [62585];
    Thank me if I helped you.





    [Only registered and activated users can see links. ]
    or
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2009
    Posts
    551
    Thanks given
    12
    Thanks received
    2
    Rep Power
    41
    thanks m8 worked even for new npcs=D love ya bro rep+ for this
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Oct 2009
    Posts
    1,595
    Thanks given
    100
    Thanks received
    50
    Rep Power
    232
    Quote Originally Posted by hell_ws_full View Post
    thanks m8 worked even for new npcs=D love ya bro rep+ for this
    thank you very much.


    Quote Originally Posted by Phych0k View Post
    He changes these ints to higher values. Thanks. I was thinking about doing that but I never thought it would work.
    yepp, i found that on java.sun.com on the forums, and i found it
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Oct 2009
    Posts
    1,595
    Thanks given
    100
    Thanks received
    50
    Rep Power
    232
    Thanks!
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Registered Member 2pro's Avatar
    Join Date
    Aug 2009
    Posts
    774
    Thanks given
    15
    Thanks received
    15
    Rep Power
    66
    doesn't fix it. Npc just doesnt drop now.
    Quote Originally Posted by Gator God View Post
    The use of small code like this is what makes a server great.
    Quote Originally Posted by Shoes View Post
    First of all, that's my code. Second of all it is more efficient in many ways, they may not be big but it's the little things that count.
    Quote Originally Posted by Luke132 View Post
    A thread's age doesn't mean anything if the information in the topic is still relevant.
    Why is gravedigging disallowed then?
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Jun 2010
    Posts
    632
    Thanks given
    61
    Thanks received
    22
    Rep Power
    49
    already had this but nice anyway


    [Only registered and activated users can see links. ]

    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Aug 2010
    Age
    31
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Err My Npcs no longer drop lol.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •