mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
[FEATURE] Data will now use json (#417)
* [FEATURE] Item data is now loaded from json * [TASK] Renamed the old method into it's new use * [TASK] Removed unused code * [FEATURE] Added some more json's * [CLEANUP] Code cleanup * [FEATURE] NPC drops are now in json * [CLEANUP] Removed testing class
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,321 +0,0 @@
|
||||
#id - amount - x - y - h - timer
|
||||
952:1:3125:3355
|
||||
590:1:2431:3072
|
||||
590:1:2368:3135
|
||||
1925:1:2371:3128
|
||||
1925:1:2371:3127
|
||||
1925:1:2428:3079
|
||||
1925:1:2428:3080
|
||||
558:1:3206:3208
|
||||
946:1:3205:3212
|
||||
1935:1:3211:3212
|
||||
88:1:2654:9767
|
||||
1931:1:3209:3214
|
||||
542:1:3059:3488:1
|
||||
544:1:3059:3487:1
|
||||
1923:1:3208:3214
|
||||
882:1:3205:3228
|
||||
2313:1:3033:9849
|
||||
946:1:3224:3202
|
||||
1203:1:3248:3245
|
||||
1944:1:3233:3297
|
||||
1944:1:3233:3295
|
||||
1944:1:3226:3301
|
||||
1944:1:3227:3299
|
||||
1944:1:3229:3295
|
||||
1944:1:3231:3294
|
||||
556:1:3150:3247
|
||||
1265:1:2963:3216
|
||||
882:1:2957:3208
|
||||
1511:1:2958:3205
|
||||
1511:1:2959:3205
|
||||
1925:1:3026:3289
|
||||
1944:1:3017:3295
|
||||
1944:1:3016:3295
|
||||
1925:1:3020:3291
|
||||
1963:1:3009:3207
|
||||
1005:1:3009:3204
|
||||
526:1:3093:9884
|
||||
526:1:3098:9886
|
||||
995:1:3091:9899
|
||||
995:4:3089:9898
|
||||
995:1:3090:9898
|
||||
526:1:3097:9899
|
||||
526:1:3094:9906
|
||||
882:3:3130:9903
|
||||
882:1:3135:9916
|
||||
223:1:3129:9954
|
||||
223:1:3126:9958
|
||||
223:1:3118:9948
|
||||
223:1:3119:9949
|
||||
223:1:3117:9951
|
||||
526:1:3127:9957
|
||||
526:1:3111:9959
|
||||
526:1:3111:9956
|
||||
526:1:3108:9950
|
||||
526:1:3104:9949
|
||||
526:1:3103:9953
|
||||
1931:1:3232:3398
|
||||
1129:1:3244:3398
|
||||
1511:1:3243:3397
|
||||
1511:1:3243:3395
|
||||
995:3:3194:9834
|
||||
995:3:3195:9820
|
||||
229:1:3195:3847
|
||||
995:4:3191:9821
|
||||
995:3:3190:9819
|
||||
995:3:3189:9819
|
||||
995:4:3188:9819
|
||||
995:3:3188:9820
|
||||
1009:1:3191:9820
|
||||
1654:1:3192:9821
|
||||
1641:1:3196:9822
|
||||
444:1:3195:9821
|
||||
2357:1:3192:9822
|
||||
995:1:3228:3503
|
||||
995:1:3232:3501
|
||||
1171:1:3204:3515
|
||||
557:1:3202:3518
|
||||
1734:1:3286:3491
|
||||
1511:1:3304:3501
|
||||
1511:1:3302:3507
|
||||
1511:1:3301:3507
|
||||
1511:1:3302:3510
|
||||
1511:1:3299:3510
|
||||
1511:1:3310:3504
|
||||
1511:1:3311:3503
|
||||
995:1:3274:9870
|
||||
559:1:3227:9910
|
||||
558:1:3225:9910
|
||||
946:1:3218:9887
|
||||
557:7:3182:9887
|
||||
223:1:3179:9881
|
||||
223:1:3177:9880
|
||||
995:5:3169:9880
|
||||
995:7:3172:9882
|
||||
1349:1:3162:9889
|
||||
995:8:3166:9897
|
||||
995:1:3173:9896
|
||||
952:1:3217:3412
|
||||
946:1:3217:3418
|
||||
2313:1:3222:3494
|
||||
1935:1:3272:3414
|
||||
1573:1:3150:3400
|
||||
1573:1:3149:3400
|
||||
1573:1:3158:3400
|
||||
1573:1:3157:3401
|
||||
1265:1:3081:3429
|
||||
1931:1:3075:3431
|
||||
1917:1:3077:3439
|
||||
1917:1:3080:3441
|
||||
1917:1:3077:3443
|
||||
2142:1:3077:3441
|
||||
2142:1:3080:3443
|
||||
557:5:3033:3637
|
||||
555:5:3031:3637
|
||||
555:5:3029:3637
|
||||
554:5:3027:3637
|
||||
562:5:3023:3639
|
||||
558:5:3021:3639
|
||||
559:5:3021:3637
|
||||
960:1:2967:3682
|
||||
966:1:2976:3686
|
||||
1925:1:2978:3692
|
||||
1539:1:2978:3688
|
||||
526:1:2970:3689
|
||||
526:1:2962:3697
|
||||
960:1:2957:3699
|
||||
966:1:2957:3697
|
||||
966:1:2960:9697
|
||||
966:1:2955:3700
|
||||
960:1:2956:3706
|
||||
2347:1:2957:3708
|
||||
960:1:2952:3704
|
||||
960:1:2961:3703
|
||||
966:1:2963:3706
|
||||
960:1:2964:3702
|
||||
1925:1:2970:3704
|
||||
960:1:2973:3707
|
||||
960:1:3149:3668
|
||||
966:1:3150:3672
|
||||
960:1:3154:3669
|
||||
960:1:3153:3659
|
||||
966:1:3163:3660
|
||||
1207:1:3159:3670
|
||||
1203:1:3157:3683
|
||||
960:1:3166:3682
|
||||
966:1:3174:3688
|
||||
1137:1:3179:3682
|
||||
966:1:3183:3670
|
||||
960:1:3183:3667
|
||||
526:1:3179:3713
|
||||
526:1:3171:3723
|
||||
444:1:3165:3739
|
||||
526:1:3170:3736
|
||||
952:1:3182:3731
|
||||
1069:1:3184:3735
|
||||
526:1:3183:3737
|
||||
526:1:3183:3747
|
||||
526:1:3171:3745
|
||||
526:1:3161:3747
|
||||
526:1:3216:3759
|
||||
526:1:3210:3735
|
||||
526:1:3213:3738
|
||||
526:1:3220:3741
|
||||
526:1:3258:3736
|
||||
526:1:3265:3728
|
||||
526:1:3276:3726
|
||||
526:1:3279:3727
|
||||
526:1:3283:3725
|
||||
526:1:3280:3723
|
||||
526:1:3245:3739
|
||||
532:1:3216:3739
|
||||
532:1:3222:3738
|
||||
532:1:3254:3740
|
||||
532:1:3271:3727
|
||||
526:1:3237:3611
|
||||
526:1:3241:3607
|
||||
526:1:3238:3606
|
||||
526:1:3243:3612
|
||||
526:1:3239:3616
|
||||
526:1:3232:3614
|
||||
526:1:3236:3620
|
||||
526:1:3200:3810
|
||||
995:5:3210:3823
|
||||
528:1:3211:3822
|
||||
528:1:3213:3819
|
||||
239:1:3215:3808
|
||||
562:1:3140:3821
|
||||
562:1:3143:3824
|
||||
562:1:3135:3802
|
||||
562:1:3136:3794
|
||||
1153:1:3067:3834
|
||||
995:4:3077:3842
|
||||
995:1:3108:3859
|
||||
1385:1:3100:3860
|
||||
559:1:3091:3865
|
||||
1119:1:3083:3860
|
||||
1654:1:3068:3864
|
||||
555:5:2960:3898
|
||||
564:3:2947:3900
|
||||
526:1:2995:3923
|
||||
526:1:2992:3920
|
||||
526:1:2994:3918
|
||||
526:1:3003:3920
|
||||
526:1:3003:3924
|
||||
2333:1:3042:3952
|
||||
526:1:3231:3948
|
||||
526:1:3236:3937
|
||||
526:1:3249:3952
|
||||
53:3:3241:3940
|
||||
53:2:3235:3950
|
||||
53:3:3234:3950
|
||||
444:1:3276:3931
|
||||
444:1:3279:3936
|
||||
444:1:3285:3939
|
||||
528:1:3287:3887
|
||||
528:1:3288:3891
|
||||
528:1:3290:3890
|
||||
528:1:3291:3888
|
||||
528:1:3292:3887
|
||||
528:1:3298:3890
|
||||
995:1:3103:3534
|
||||
995:1:3105:3547
|
||||
995:2:3099:3558
|
||||
995:2:3098:3566
|
||||
995:3:3098:3571
|
||||
995:4:3095:3576
|
||||
882:2:3098:3591
|
||||
882:2:3101:3593
|
||||
882:2:3097:3598
|
||||
882:2:3103:3597
|
||||
882:2:3104:3608
|
||||
882:2:3100:3607
|
||||
882:2:3112:3609
|
||||
952:1:2981:3370
|
||||
1351:1:2970:3376
|
||||
2140:1:2971:3382
|
||||
2347:1:2978:3368
|
||||
995:1:3002:9801
|
||||
995:1:3001:9798
|
||||
2313:1:2993:9847
|
||||
1103:1:2985:9817
|
||||
2347:1:2934:3286
|
||||
1755:1:2935:3286
|
||||
1595:1:2928:3289
|
||||
1935:1:2936:3292
|
||||
231:1:2906:3298
|
||||
231:1:2907:3297
|
||||
231:1:2916:3274
|
||||
231:1:2914:3274
|
||||
231:1:2913:3276
|
||||
1917:1:3049:3257
|
||||
1985:1:3083:3260
|
||||
1982:1:3085:3261
|
||||
1511:1:3089:3266
|
||||
1511:1:3094:3266
|
||||
952:1:3120:3359
|
||||
1925:1:3124:3360
|
||||
1511:1:3105:3159
|
||||
1511:1:3106:3160
|
||||
1511:1:3106:3159
|
||||
1061:1:3111:3159
|
||||
1061:1:3112:3155
|
||||
1939:1:3194:3167
|
||||
1939:1:3185:3161
|
||||
1939:1:3181:3165
|
||||
1939:1:3168:3168
|
||||
1939:1:3164:3170
|
||||
1939:1:3165:3178
|
||||
1939:1:3171:3171
|
||||
1939:1:3173:3172
|
||||
1939:1:3168:3189
|
||||
1939:1:3177:3190
|
||||
1939:1:3179:3192
|
||||
1217:1:3179:3822
|
||||
1939:1:3185:3181
|
||||
229:1:3185:3836
|
||||
1061:1:3210:9615
|
||||
946:1:3215:9625
|
||||
1925:1:3216:9625
|
||||
1965:1:3217:9622
|
||||
1422:1:3320:3137
|
||||
1925:1:3307:3195
|
||||
1061:1:3302:3192
|
||||
983:1:3132:9862
|
||||
2150:1:2429:3511
|
||||
2150:1:2429:3508
|
||||
2150:1:2427:3507
|
||||
2150:1:2424:3506
|
||||
2150:1:2421:3507
|
||||
2150:1:2419:3509
|
||||
2150:1:2417:3512
|
||||
2150:1:2422:3518
|
||||
2150:1:2416:3415
|
||||
2150:1:2414:3518
|
||||
2150:1:2410:3519
|
||||
2150:1:2408:3515
|
||||
2150:1:2411:3512
|
||||
2150:1:2414:3511
|
||||
2150:1:2426:3514
|
||||
1985:1:3039:3707
|
||||
1982:1:3039:3706
|
||||
1895:1:2691:3218
|
||||
1895:1:2691:3203
|
||||
245:1:2930:3515
|
||||
243:1:2905:9799
|
||||
243:1:2904:9803
|
||||
243:1:2908:9807
|
||||
243:1:2911:9811
|
||||
243:1:2912:9804
|
||||
243:1:2910:9800
|
||||
243:1:2905:9808
|
||||
3138:1:3461:9485:2
|
||||
3138:1:3460:9482:2
|
||||
3138:1:3460:9480:2
|
||||
1059:1:3093:3487
|
||||
954:1:2907:3146
|
||||
1963:1:2903:3146
|
||||
1935:1:2903:3150
|
||||
753:1:3275:3374
|
||||
753:1:3277:3372
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,350 +0,0 @@
|
||||
//-----ShopID---ShopName----------------------------------------Sell----Buy-----Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount--Item----Amount
|
||||
shop = 2 Amulet_Store 2 2 1718 0 1727 0 1729 0 1725 0 1731 0
|
||||
shop = 3 Lowe's Archery Emporium 2 2 882 100 884 100 886 100 888 100 890 30 841 10 839 10 843 10 845 10 849 10 847 10 853 10 851 10
|
||||
shop = 4 Hickton's Archery Emperium 2 2 882 1000 884 100 886 0 888 0 890 0 4773 0 4778 0 4783 0 4788 0 4793 0 4798 0 4803 0 39 0 40 0 41 0 42 0 43 0 44 0 841 10 843 10 1133 10 1097 10
|
||||
shop = 5 Lletya's_Archery_Shop 2 2 884 1000 886 1000 888 1000 890 500 892 300 843 10 845 10 837 10 849 10 847 10
|
||||
shop = 6 Void Knight Archery Suplies 2 2 825 300 826 300 827 100 828 100 829 250 830 10 39 100 40 100 41 100 42 30 43 30 44 10
|
||||
shop = 7 Brians's_Archery_Shop 2 2 886 100 888 50 890 30 843 10 845 10 849 10 847 10 853 10 851 10
|
||||
shop = 8 Bob's Brilliant Axes 2 2 1265 10 1351 10 1349 10 1353 6
|
||||
shop = 9 Brian's Battleaxe Bazaar 2 2 1375 10 1363 10 1365 8 1367 6 1369 5 1371 4
|
||||
shop = 10 Candle_Shop 2 2 36 10 38 10
|
||||
shop = 11 Wayne's Chains 2 2 1103 10 1101 10 1105 10 1107 10 1109 8 1111 5
|
||||
shop = 12 Clothes_Store 2 2 1005 10 1129 10 1059 10 1061 10 1757 10 1013 10 1015 10 577 10 1007 10 950 10 426 10 428 10
|
||||
shop = 13 Clothes_Store 2 2 1005 10 1129 10 1059 10 1061 10 1757 10 1013 10 1015 10 577 10 1007 10 950 10 426 10 428 10
|
||||
shop = 14 Rometti's_Fine_Fashions 2 2 656 10 658 10 660 10 662 10 664 10 636 10 638 10 640 10 642 10 644 10 646 10 648 10 650 10 652 10 654 10 626 10 628 10 630 10 632 10 634 10
|
||||
shop = 15 Yrsa's_Accoutrements 2 2 3791 10 3793 10 3795 10 3797 10 3777 10 3779 10 3781 10 3783 10 3785 10 3787 10 3789 10 3759 10 3761 10 3763 10 3765 10 3767 10 3769 10 3771 10 3773 10 3775 10
|
||||
shop = 16 Barker's Haberdashery 2 2 2894 10 2896 10 2898 10 2900 10 2902 10 2904 10 2906 10 2908 10 2910 10 2912 10 2914 10 2916 10 2918 10 2920 10 2922 10 2924 10 2926 10 2928 10 2930 10 2932 10 2934 10 2936 10 2938 10 2940 10 2942 10 1007 10 1019 10 1021 10 1023 10 1027 10
|
||||
shop = 17 Lletya_Seamstress 2 2 1734 100 1733 10 1759 100 1763 10 1765 10 1767 1 1769 10 1771 10 1773 10
|
||||
shop = 18 Dodgy_Mike's_Second-hand_Clothing 2 2 7114 10 7110 10 7112 10 7116 10 7122 10 7124 10 7126 10 7128 10 7130 10 7132 10 7134 10 7136 10 7138 10
|
||||
shop = 19 Agmundi_Quality_Clothes 2 2 5050 10 5052 10 5038 10 5040 10 5044 10 5046 10 5026 10 5028 10 5032 10 5034 10
|
||||
shop = 20 Vermundi's Clothes Stall 2 2 950 10
|
||||
shop = 21 Grand_Tree_Groceries 2 2 2171 10 2128 10 1933 10 2169 10 1957 10 1942 10 1965 10 1982 10 1985 10 2120 10 2108 10 2102 10 2114 10 2126 10 2025 10 1973 10 2130 10 1927 10 946 10 2167 10 2164 10 2165 10 2166 10
|
||||
shop = 22 Funch's_Fine_Groceries 2 2 2021 10 2019 10 2015 10 2017 10 2114 10 2128 10 2108 10 2102 10 2120 10 2126 10 2025 10 1973 10 1975 10 2130 10 1927 10 946 10 2026 10
|
||||
shop = 23 Frenita's_Cookery_Shop 2 2 2313 10 1955 0 1887 10 1923 10 1942 10 590 10 1935 10 1931 30 1973 10 1933 500 1980 10
|
||||
shop = 24 Dommik's Crafting Shop 2 2 1755 10 1733 10 1734 1000 5523 10 1592 10 1595 10 1597 10 1599 10 2976 1
|
||||
shop = 25 Rommik's Crafting shop 2 2 1755 10 1733 10 1734 1000 5523 10 1592 10 1595 10 1597 10 1599 10 2976 10
|
||||
shop = 26 Farming_Shop 2 2 5376 10 6032 10 5418 10 6036 10 5350 10 5341 10 5329 10 5343 10 952 10 5325 10 1925 10 5331 10 5996 0 6006 0 1965 0 5994 0 5931 0 6000 0 1957 0 1942 0 5504 0 5986 0 1982 0 5982 0 6002 0 5998 0
|
||||
shop = 27 Farming_Shop 2 2 5376 10 6032 10 5418 10 6036 10 5350 10 5341 10 5329 10 5343 10 952 10 5325 10 1925 10 5331 10 5996 0 6006 0 1965 0 5994 0 5931 0 6000 0 1957 0 1942 0 5504 0 5986 0 1982 0 5982 0 6002 0 5998 0
|
||||
shop = 28 Farming_Shop 2 2 5376 10 6032 10 5418 10 6036 10 5350 10 5341 10 5329 10 5343 10 952 10 5325 10 1925 10 5331 10 5996 0 6006 0 1965 0 5994 0 5931 0 6000 0 1957 0 1942 0 5504 0 5986 0 1982 0 5982 0 6002 0 5998 0
|
||||
shop = 29 Farming_Shop 2 2 5376 10 6032 10 5418 10 6036 10 5350 10 5341 10 5329 10 5343 10 952 10 5325 10 1925 10 5331 10 5996 0 6006 0 1965 0 5994 0 5931 0 6000 0 1957 0 1942 0 5504 0 5986 0 1982 0 5982 0 6002 0 5998 0
|
||||
shop = 30 Shilo_Fishing_Store 2 2 305 10 309 10 307 10 311 10 301 10 313 1000 314 1000 317 0 327 0 335 0 321 0 331 0 359 0 377 0 371 0 7944 0
|
||||
shop = 31 Gerrant's Fishy Business 2 2 314 1000 313 1000 303 100 307 100 309 100 301 100 311 100 317 0 327 10 345 0 321 0 335 0 349 0 331 0 359 0 377 0 371 0
|
||||
shop = 32 Harry's Fishing Shop 2 2 303 10 307 10 311 1000 301 10 313 1000 305 10 317 0 327 0 345 0 353 0 341 0 321 0 359 0 377 0 371 0 383 0
|
||||
shop = 33 Fishmonger 2 2 305 10 309 10 307 10 311 10 301 10 313 1000 314 1000 305 10 317 0 327 10
|
||||
shop = 34 Wydins_Food_Store 2 2 1933 500 2132 10 2138 10 1965 10 1963 0 1951 10 2309 10 1973 10 1985 10 1982 10 1942 10 1550 10
|
||||
shop = 35 Rufus's Meat Emperium 2 2 4287 100 4289 30 2134 30 331 0 335 0 383 0
|
||||
shop = 36 Solib's_Store 2 2 4012 10 1963 10 4016 10 4014 10
|
||||
shop = 37 Herquin's Gems 2 2 1623 0 1621 0 1619 0 1617 0 1607 0 1605 0 1603 0 1601 0
|
||||
shop = 38 Al_Kharid_Gems 2 2 1623 0 1621 0 1619 0 1617 0 1607 0 1605 0 1603 0 1601 0
|
||||
shop = 39 Greenstone_Gems 2 2 1607 0 1605 0 1603 0 1601 0
|
||||
shop = 40 Peksa's_Helmet_Shop 2 2 1139 10 1137 10 1141 10 1143 10 1145 10 1155 10 1153 10 1157 10 1159 10 1161 10
|
||||
shop = 41 Skulgrimens_Battle_Gear 2 2 1337 10 1335 10 1339 10 1341 10 1343 10 1345 10 1347 0 3749 10 3751 10 3753 10 3755 10
|
||||
shop = 42 Frincos_Fabulous_Herb_Store 2 2 229 10 233 10 221 10
|
||||
shop = 43 Jatix's_Herblore_Shop 2 2 229 10 233 10 221 10
|
||||
shop = 44 Gardener_Gunhild 2 2 3899 100 5341 100
|
||||
shop = 45 Grum's_Gold_Exchange 2 2 1635 0 1637 0 1639 0 1641 0 1643 0 1654 0 1656 0 1658 0 1660 0 1662 0 1673 0 1675 0 1677 0 1679 0 1681 0
|
||||
shop = 46 Ali_the_Kebab_seller 2 2 1971 1000
|
||||
shop = 47 Karim's_Kebabs 2 2 1971 1000
|
||||
shop = 48 Kjut's_Kebabs 2 2 1971 1000
|
||||
shop = 49 Flynn's Mace Shop 2 2 1422 10 1420 10 1424 8 1428 6 1430 4
|
||||
shop = 50 Ali's_Discount_Wares 2 2 1931 30 1935 10 1823 30 1833 10 1837 10 1925 10 4593 10 4591 10 970 10 946 10 590 10 1265 10 2138 10
|
||||
shop = 51 Betty's_Magic_emporium 2 2 554 300 555 300 556 300 557 100 558 100 562 30 560 10 221 100 579 10 1017 10
|
||||
shop = 52 Aubury_Magic_Shop 2 2 554 5000 555 5000 556 5000 557 5000 558 5000 559 5000 562 250 560 250
|
||||
shop = 53 Wizards_Guild_Shop 2 2 554 5000 555 5000 556 5000 557 5000 558 5000 559 5000 562 250 561 250 560 250 563 250 565 250 1387 2 1383 2 1381 2 1385 2
|
||||
shop = 54 Lundails_Rune_Shop 2 2 554 200 555 200 556 200 557 200 558 140 559 140 561 250 562 250 563 250 564 20 565 250 560 250
|
||||
shop = 55 Battle_Runes 2 2 554 100 555 100 556 100 557 100 559 100 558 100 562 30 560 30
|
||||
shop = 56 Tutab's_Magic_Market 2 2 554 1000 555 1000 556 1000 557 1000 563 100 221 10 4006 10 4023 10
|
||||
shop = 57 Void_Knight_Magic_Store 2 2 554 1000 555 1000 556 1000 557 1000 558 1000 559 1000 562 300 560 300
|
||||
shop = 58 TzHaar_Mej_Roh's_Rune_Store 2 2 554 5000 555 5000 556 5000 557 5000 558 5000 559 5000 560 2500 562 2500
|
||||
shop = 59 Nurmof's_Pickaxe_Shop 2 2 1265 10 1267 10 1269 10 1273 10 1271 10 1275 10
|
||||
shop = 60 Drogo's_Mining_Emporium 2 2 2347 10 1265 10 436 0 438 0 440 0 453 0 2349 0 2351 0 2357 0
|
||||
shop = 61 Pickaxe_is_Mine 2 2 1265 10 1269 10 1273 10 1271 10 1275 10
|
||||
shop = 62 Zenesha's_Platebody_Shop 2 2 1117 10 1115 10 1119 10 1125 10 1121 10
|
||||
shop = 63 Horviks_Platebody_Shop 2 2 1103 10 1101 10 1139 10 1137 10 1115 10 1117 10 1173 10 1175 10 1075 10 1067 10 1087 10 1081 10 1119 10 1125 10 1121 10 1097 10 1133 10
|
||||
shop = 64 Louie_Legs 2 2 1075 10 1067 10 1069 10 1071 10 1073 10
|
||||
shop = 65 Seddu's_Adventurer_Store 2 2 1093 10 1079 10 1113 10 1099 10 1065 10 1193 10 1151 10
|
||||
shop = 66 Ranael's Super Skirt Store 2 2 1087 10 1081 10 1083 10 1089 10 1085 10 1091 10
|
||||
shop = 67 Zeke's Superior Scimitars 2 2 1321 10 1323 10 1325 10 1329 10
|
||||
shop = 68 Daga's Scimitar Smithy 2 2 1321 10 1323 10 1325 10 1329 10 4587 10
|
||||
shop = 69 Cassie's_Shield_Shop 2 2 1171 10 1173 10 1189 10 1175 10 1191 10 1177 10 1193 10 1181 10
|
||||
shop = 70 Silk_Trader 2 2 950 100
|
||||
shop = 71 The_Spice_is_Right 2 2 1931 30 2169 10 5970 0 175 10
|
||||
shop = 72 Zaff's_Superior_Staves 2 2 1379 10 1389 10 1381 10 1383 10 1385 10 1387 10
|
||||
shop = 73 Dwarven_Shopping_Store 2 2 1931 30 1935 10 1735 10 1925 10 590 10 1755 10 2347 10
|
||||
shop = 74 Aurel's_Supplies 2 2 1351 10 590 10 3363 10 353 10 952 10
|
||||
shop = 75 Al_Kharid_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 590 10 1755 10 2347 10 550 10
|
||||
shop = 76 Ifaba's_General_Store 1 1 1931 30 1935 10 954 10 1925 30 590 10 2347 10
|
||||
shop = 77 Aemad's Adventuring Supplies 1 1 227 10 1265 10 1349 10 2142 10 590 10 1759 100 882 1000 954 10 970 10 946 10 1935 10
|
||||
shop = 78 West_Ardougne_General_Store1 1 1931 10 954 10 1265 10 1925 30 590 10 1415 10 1061 10 841 10 882 100 329 10 2327 10 2309 10 2142 10
|
||||
shop = 79 Bandit_Bargains 1 1 1831 30 1823 30 1937 10 1921 10 1935 10 1923 10 1925 30 1837 10 1833 10 1835 10 946 10
|
||||
shop = 80 Canifis_General_Store 1 1 1733 10 1734 1000 1931 30 1925 30 1935 10 590 10 1755 10 2347 10 3377 10 946 10
|
||||
shop = 81 Arhein's_Store 1 1 1925 30 1265 10 1923 10 1887 10 590 10 1755 10 2347 10 954 10 1931 30 946 10
|
||||
shop = 82 Edgeville_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 1887 10 590 10 1755 10 2347 10 550 10
|
||||
shop = 83 Falador_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 1887 10 590 10 1755 10 2347 10 550 10
|
||||
shop = 84 Karamja_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 1887 10 590 10 1755 10 2347 10
|
||||
shop = 85 Gunslik's_Assorted_Items 1 1 1935 10 1925 30 590 10 1755 10 2347 10 36 10 973 10 1059 10 229 300 233 10 954 10
|
||||
shop = 86 The_Lighthouse_Store 1 1 954 10 2347 10 1755 10 946 10 952 10 590 10 36 10 273 10 233 10 1931 30 1925 30 1929 10 1935 10 1937 300 229 10 227 10 2019 10 2021 10 2015 10 1915 10 2017 10 1909 10 1913 10 1907 10
|
||||
shop = 87 Lletya_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 1887 10 590 10 1755 10 2347 10
|
||||
shop = 88 Lumbridge_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 1887 10 590 10 1755 10 2347 10 550 10
|
||||
shop = 89 Razmire's_General_Store 1 1 1931 30 1935 10 1735 10 1925 10 590 10 1755 10 2347 10 3424 500 227 300 1933 10 3678 10
|
||||
shop = 90 Nardah_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 1887 10 590 10 1755 10 2347 10
|
||||
shop = 91 Arnold's_Ecletic_Supplies 1 1 303 10 311 1 2309 10 1925 30 1927 10 1733 10 1734 1000 1917 10 1785 10 946 10
|
||||
shop = 92 Pollniveach_General_Store 1 1 1931 30 1935 10 1825 10 1833 10 1837 10 1925 10 4593 10 4591 10 1985 10 2120 10 1982 10 1937 10 1921 10 1929 10
|
||||
shop = 93 Port_Phasmatys_General_Store 1 1 1931 300 1925 300 1735 10 1935 10 590 10 1735 10 2347 10
|
||||
shop = 94 Sigmund_the_Merchant 1 1 590 10 954 1 1931 30 2142 10 2309 10 952 10 36 10 1755 10 229 10 227 10 1925 10 1944 10 1942 10 233 10 2347 10 1929 10
|
||||
shop = 95 Rimmington_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 1887 10 590 10 1755 10 2347 10 550 10
|
||||
shop = 96 Obli's_General_Store 1 1 590 10 229 10 233 10 1931 30 1351 10 1265 10 1349 10 1129 10 1059 10 2142 10 2309 10 952 10 36 10 1755 10 2347 10 970 10 973 10 227 10 975 10 954 10
|
||||
shop = 97 Jiminua's_Jungle_Store 1 1 590 10 36 10 1931 30 954 10 1129 10 1059 10 1061 10 2142 10 2309 10 229 300 227 300 233 10 175 10 970 10 973 10 946 10 2347 10 975 10 1755 10 952 10 1351 10 1265 10 1349 10
|
||||
shop = 98 Bolkoy's_Village_Shop 1 1 1931 30 1265 10 1935 10 1735 10 1925 30 590 10 1755 10 2347 10 882 1000 2142 10
|
||||
shop = 99 Quartermaster's_Store 1 1 1931 30 1935 10 1735 10 590 10 2309 10 3190 10 3192 10 3194 10 3196 10 3198 10 3200 10 3202 10 3204 10
|
||||
shop = 100 Varrock_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 590 10 1755 10 2347 10 550 10 946 10
|
||||
shop = 101 Void_Knight_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 590 10 1755 10 2347 10 1351 10 7934 10
|
||||
shop = 102 Zanaris_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 590 10 1755 10 2347 10 550 10
|
||||
shop = 103 Shantay_Store 2 2 1823 30 1831 30 1937 10 1921 10 1929 10 946 10 1833 10 1835 10 1837 10 2349 0 314 1000 2347 10 1925 30 1923 10 1935 10 954 100 1854 100
|
||||
shop = 104 Varrock_Sword_Shop 2 2 1277 10 1279 10 1281 10 1283 10 1285 10 1287 10 1291 10 1293 10 1295 10 1297 10 1299 10 1301 10 1205 10 1203 10 1207 10 1209 10 1211 10
|
||||
shop = 105 Taverly_Sword_Shop 2 2 1307 10 1309 10 1311 10 1313 10 1315 10 1317 10
|
||||
shop = 106 Jukats_Sword_Shop 2 2 1305 2 1215 2
|
||||
shop = 107 Oziachs_Armour 2 2 1127 10 1135 10
|
||||
shop = 108 Fur_Trader 2 2 948 10 958 10
|
||||
shop = 109 Slayer_Shop 2 2 4155 10 4166 10 4161 20 6696 20 7051 10 4551 10 7159 10 6720 10 4168 10 4164 10 4158 10 4172 50000 4170 10 7432 10 7421 1000 4162 10 4156 10
|
||||
shop = 110 Sams_Cape_Shop 2 2 4333 10 4353 10 4373 10 4393 10 4413 10
|
||||
shop = 111 Range_Guild_Exchange_Store 2 2 47 30 1133 10 1135 1 829 20 1169 1 892 50
|
||||
shop = 112 Castle_Wars_Ticket_Exchange 2 2 4071 10 4069 10 4070 10 4072 10 4068 10 4506 10 4504 10 4505 10 4507 10 4503 10 4511 10 4509 10 4510 10 4512 10 4508 10 4513 10 4514 10 4515 10 4516 10
|
||||
shop = 113 Karamja_Wines_Spirts_Beers 2 2 1917 10 431 10 1993 10
|
||||
shop = 114 Burthorpe_Supplies 2 2 1931 30 1935 10 1735 10 1925 30 590 10 1755 10 2347 10 946 10 1980 10
|
||||
shop = 115 Dead_Man's_Chest 2 2 1915 10 3164 10
|
||||
shop = 116 Shrimp_and_Parrot 2 2 347 10 339 10 361 10 379 10 373 10 3144 10
|
||||
shop = 117 Pick_and_Lute 2 2 1905 10 1907 10 1913 10
|
||||
shop = 118 Martin_Thwait_Lost_and_Found 2 2 954 10 1523 10 1755 10 946 10 5560 10 864 10 863 10 865 10 3095 10 3096 10 3097 10
|
||||
shop = 119 Aarons_Archery_Appendages 2 2 1129 10 1131 10 1133 10 1095 10 1097 10 1169 10 1063 10
|
||||
shop = 120 Dargaud's_Bows_and_Arrows 2 2 52 1000 39 300 40 300 41 100 42 100 43 100 44 30 882 1000 884 300 886 300 888 100 890 100 892 100 4773 0 4778 0 4783 0 4788 0 4793 0 4798 0 4803 0 841 10 843 10 849 10
|
||||
shop = 121 Authentic_Throwing_Weapons 2 2 825 1000 826 1000 827 1000 828 300 829 100 830 100 800 1000 801 1000 802 300 803 300 804 100 805 100
|
||||
shop = 122 Magic_Guild_Store_Mystic_Robes 2 2 4089 10 4091 10 4093 10 4095 10 4097 10
|
||||
shop = 123 Magic_Guild_Store_Runes_and_Staves 2 2 556 1000 555 1000 557 1000 554 1000 558 1000 559 1000 562 300 561 300 560 1000 563 100 565 100 566 100 1387 10 1383 10 1381 10 1385 10
|
||||
shop = 124 Scavvo's_Rune_Store 2 2 1093 10 1079 10 1432 10 1113 10 1303 10 1289 10 1099 10 1065 10 1169 10
|
||||
shop = 125 Valaine's_Shop_of_Champions 2 2 1019 10 1165 10 1077 10 1123 10
|
||||
shop = 126 Mage_Arena_Staves 2 2 2415 10 2416 10 2417 10
|
||||
shop = 127 Quality_Weapons_Store 2 2 1365 10 1369 10 1285 10 1287 10 1325 10 1297 10 853 10 851 10 888 100 890 100
|
||||
shop = 128 Quality_Armour_Shop 2 2 1105 10 1107 10 1109 10 1111 10 1141 10 1143 10 1145 10 1177 10 1195 10
|
||||
shop = 129 Vigr's Warhammers 2 2 1337 10 1335 10 1339 10 1341 10 1343 10 1345 10
|
||||
shop = 130 Carefree_Crafting_Stall 2 2 1755 10 1592 10 1597 10 1733 10 1734 1000 1759 100
|
||||
shop = 131 Keldagrim's_Best_Bread 2 2 2309 10 1891 10 1901 10
|
||||
shop = 132 Silver_Cog_Silver_Stall 2 2 1718 10 442 0 2355 0
|
||||
shop = 133 Gianne's_Restraunt 2 2 2223 10 2225 10 2221 10 2219 10 2227 10 2233 10 2231 10 2235 10 2229 10 2241 10 2243 10 2239 10 2237 10
|
||||
shop = 134 Gulluck_and_Sons 2 2 882 1000 841 10 39 100 40 100 41 100 42 100 1349 10 1353 10 1369 10 1307 10 1309 10 1311 10 1313 10 1315 10 1317 10
|
||||
shop = 135 Tony's_Pizza_Bases 2 2 2283 10
|
||||
shop = 136 Wilderness_General_Store 1 1 1931 30 1935 10 1735 10 1925 30 1923 10 590 10 1755 10 2347 10 550 10 946 10
|
||||
shop = 137 Neil's_Wilderness_Cape_Shop 2 2 4327 10 4347 10 4367 10 4387 10 4407 10
|
||||
shop = 138 Tzhaar_Hur_Tel's_Equipment_Store 2 2 6522 10 6523 10 6524 10 6525 10 6526 10 6527 10 6528 10 6568 10
|
||||
shop = 139 Tzhaar_Hur_Lek's_Ore_and_Gem_Store 2 2 438 5 436 5 453 2 1623 1 1621 1 6571 1
|
||||
shop = 140 William's_Wilderness_Cape_Shop 2 2 4315 10 4335 10 4355 10 4375 10 4395 10
|
||||
shop = 141 Edward's_Wilderness_Cape_Shop 2 2 4323 10 4343 10 4363 10 4383 10 4403 10
|
||||
shop = 142 Blurberry's_Bar 2 2 2028 10 2030 10 2032 10 2034 10 2036 10 2038 10 2040 10
|
||||
shop = 143 Shop_of_Distaste 2 2 2518 100
|
||||
shop = 144 Nulodion's_Multicannon_Parts 2 2 6 100 8 100 10 100 12 100
|
||||
shop = 145 Legends_Guild_Shop_of_Useful_Items 2 2 299 6 1590 5 1542 3 2368 1 1052 3
|
||||
shop = 192 Legends'_Guild_General_Store 1 1 373 20 2323 5 121 3 886 500
|
||||
// Npc not added yet, Shop may not be 317
|
||||
shop = 146 Martin_Thwait's_Lost_and_Found 2 2 954 50 1523 25 1755 30 946 20 5560 25 864 15 863 10 865 5 3095 3 3096 2 3097 1
|
||||
shop = 147 Grace's_Graceful_Clothing 2 2
|
||||
shop = 148 Toad_and_Chicken 2 2 1905 12 1907 12 1913 12
|
||||
shop = 149 Crossbow_Shop 2 2
|
||||
shop = 150 Multicannon_parts_for_sale 2 2 8 5 6 5 12 5 10 5 4 5 5 5
|
||||
shop = 151 Frincos's_Fabulous_Herb_Store 2 2 229 50 233 3 221 50
|
||||
shop = 152 Garden_Centre 2 2
|
||||
shop = 153 Flynn's_Mace_Market 2 2 1422 5 1420 4 1424 4 1428 3 1430 2
|
||||
shop = 154 Herquin's_Gems 2 2 1623 1 1621 0 1619 0 1617 0 1607 1 1605 0 1603 0 1601 0
|
||||
shop = 155 Wayne's_Chains!_-_Chainmail_Specialist 2 2 1103 3 1101 2 1105 1 1107 1 1109 1 1111 1
|
||||
shop = 156 Prospector_Percy's_Nugget_Shop 2 2
|
||||
shop = 157 Brian's_Battleaxe_Bazaar 2 2 1375 4 1363 3 1365 2 1367 1 1369 1 1371 1
|
||||
shop = 158 Gerrant's_Fishy_Business 2 2 303 5 307 5 309 5 311 2 301 2 313 1500 314 1000 317 0 327 200 345 0 321 0 335 0 349 0 331 0 359 0 377 0 371 0
|
||||
shop = 159 Brian's_Archery_Supplies 2 2 886 1500 888 1000 890 800 843 4 845 4 849 3 847 3 853 2 851 2
|
||||
shop = 160 Rommik's_Crafty_Supplies 2 2 1755 2 1592 4 1597 2 1595 2 1733 3 1734 100 1599 3 2976 6 5523 10
|
||||
shop = 161 Gaius'_Two_Handed_Shop 2 2 1307 4 1309 3 1311 2 1313 1 1315 1 1317 1
|
||||
shop = 162 Sarah's_Farming_Shop 2 2 5341 500 5343 500 5329 500 952 500 5325 500 5331 500 5356 500 6032 500 5418 500 5376 500 1942 0 1957 0 1965 0 1982 0 5986 0 5504 0 5982 0 5994 0 5996 0 5998 0 6000 0 6002 0 5931 0 6006 0 6036 100
|
||||
shop = 163 Dal's_General_Ogre_Supplies 2 2 1931 30 1935 10 946 10 1925 30 590 10 1755 10 2347 10
|
||||
shop = 164 Grud's_Herblore_Stall 2 2 229 50 233 3 221 50
|
||||
shop = 165 Uglug's_Stuffsies 2 2 4844 100 2862 100 1777 10 2876 0 2878 10 4850 0 946 5 4773 0 4778 0 4783 0 4788 0 4793 0 4798 0 4803 0 4827 0
|
||||
shop = 166 Mythical_Cape_Store 2 2 1052 50
|
||||
shop = 167 Myths'_Guild_Herbalist 2 2 233 5 229 50 221 50
|
||||
shop = 168 Myths'_Guild_Armoury 2 2 2368 1 2368 1
|
||||
shop = 169 Myths'_Guild_Weaponry 2 2 1215 2 1305 2 1434 2 1377 2
|
||||
shop = 170 Etceteria_Fish 2 2 303 5 307 5 309 5 311 2 301 2 313 1500 314 1000 305 5 317 0 327 200 345 0 353 0 341 0 321 0 335 0 349 0 331 0 359 0 377 0 363 0 371 0 383 0
|
||||
shop = 171 Island_Greengrocer 2 2 1965 10 1942 10 1957 10 1982 10 1550 2
|
||||
shop = 172 Armour_Shop 2 2 1109 4 1143 4 1159 4 1181 4 1197 4 1071 4 1085 4 1121 4
|
||||
shop = 173 Contraband_Yak_Produce 2 2
|
||||
shop = 174 Flosi's_Fishmongers 2 2 377 5 359 20 331 20 341 20 383 0
|
||||
shop = 175 Keepa_Kettilon's_Store 2 2 361 20 329 20 339 20 379 10 373 0 385 0
|
||||
shop = 176 Ore_Store 2 2 436 20 438 10 440 10 442 5 453 10 444 5 447 0 449 0
|
||||
shop = 177 Weapons_Galore 2 2 1299 4 1343 4 1369 4 3099 4 1315 4
|
||||
shop = 178 Moon_Clan_General_Store 2 2 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 3 1755 2 2347 5
|
||||
shop = 179 Baba_Yaga's_Magic_Shop 2 2 556 5000 555 5000 557 5000 554 5000 558 5000 559 5000 562 250 561 250 560 250 563 250 565 250 566 250 1391 5 1387 2 1383 2 1381 2 1385 2
|
||||
shop = 180 Moon_Clan_Fine_Clothes 2 2
|
||||
shop = 181 Miscellanian_General_Store 2 2 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 3 1755 2 2347 5
|
||||
shop = 182 Greengrocer_of_Miscellania 2 2 1965 10 1942 10 1957 10 1982 10 1550 2
|
||||
shop = 183 Island_Fishmonger 2 2 303 5 307 5 309 5 311 2 301 2 313 1500 314 1000 305 5 317 0 327 200 345 0 353 0 341 0 321 0 335 0 349 0 331 0 359 0 377 0 363 0 371 0 383 0
|
||||
shop = 184 Miscellanian_Clothes_Shop 2 2 3767 5 3769 5 3771 5 3773 5 3775 5 3793 5 3795 5 5032 3 5034 3 5026 3 5028 3 5050 3 5052 3 5038 3 5040 3 5044 3 5046 3
|
||||
shop = 185 Miscellanian_Food_Shop 2 2 2309 5 1985 5 1965 5 1942 5 1957 5 1933 5 1973 2 1927 5
|
||||
shop = 186 Neitiznot_Supplies 2 2 946 10 2347 10 1734 10 1733 10 1351 10 1759 100
|
||||
shop = 187 Fremennik_Fish_Monger 2 2 303 5 307 5 309 5 311 2 301 2 313 1500 314 1000 305 5 317 0 327 200 345 0 353 0 341 0 321 0 335 0 349 0 331 0 359 0 377 0 363 0 371 0 383 0
|
||||
shop = 188 Fremennik_Fur_Trader 2 2 948 3 958 3
|
||||
shop = 189 Pie_Shop 2 2 7162 50 2325 5 2327 4 7170 0 2323 3 7178 2 7188 1 7198 0 7208 0 7218 0
|
||||
shop = 190 Fishing_Guild_Shop 2 2 313 2000 314 1500 341 0 353 0 363 0 359 0 377 0 371 0 339 0 355 0 365 0 361 0 379 0 373 0
|
||||
shop = 191 Happy_Heroes'_H'emporium 2 2 1377 1 1434 1
|
||||
shop = 193 Yarsul's_Prodigious_Pickaxes 2 2 1265 6 1267 5 1269 4 1273 3 1271 2 1275 1
|
||||
shop = 194 Hendor's_Awesome_Ores 2 2 436 0 438 0 440 0 447 0 449 0 451 0 453 0
|
||||
shop = 195 Mining_Guild_Mineral_Exchange 2 2
|
||||
shop = 196 Mythical_Cape_Store 2 2 1052 50
|
||||
shop = 197 Myths'_Guild_Armoury 2 2 2368 1 2368 1
|
||||
shop = 198 Myths'_Guild_Herbalist 2 2 233 5 229 50 221 50
|
||||
shop = 199 Myths'_Guild_Weaponry 2 2 1215 2 1305 2 1434 2 1377 2
|
||||
shop = 200 Authentic_Trowing_Weapons 2 2 825 900 826 800 827 700 828 600 829 500 830 400 800 900 801 800 802 700 803 600 804 500 805 400
|
||||
shop = 201 Warrior_Guild_Armoury 2 2 1363 5 1365 2 1369 1 1277 5 1279 4 1281 4 1283 3 1285 3 1287 2 1291 4 1293 3 1295 3 1297 2 1299 2 1301 1 1205 10 1203 6 1207 5 1217 4 1209 3 1211 2 1422 5 1420 4 1424 4 1428 3 1430 2 1307 4 1309 3 1311 2 1313 1 1315 1 1317 1 1103 5 1101 3 1105 3 1139 5 1137 3 1141 3
|
||||
shop = 202 Warrior_Guild_Food_Shop 2 2 333 10 365 10 2289 5 6705 10 2003 10
|
||||
shop = 203 Warrior_Guild_Potion_Shop 2 2 115 10 121 10 133 10
|
||||
shop = 204 Magic_Guild_Store_-_Mystic_Robes 2 2 4089 1000 4091 1000 4093 1000 4095 1000 4097 1000
|
||||
shop = 205 Magic_Guild_Store_-_Runes_and_Staves 2 2 4089 1000 4091 1000 4093 1000 4095 1000 4097 1000
|
||||
shop = 206 Magic_Guild_Store_-_Runes_and_Staves 2 2 556 5000 555 5000 557 5000 554 5000 558 5000 559 5000 562 250 561 250 560 250 563 250 565 250 566 250 1391 5 1387 2 1383 2 1381 2 1385 2
|
||||
shop = 207 Harry's_Fishing_Shop 2 2 303 5 307 5 311 2 301 2 313 1200 305 5 317 0 327 0 345 0 353 0 341 0 321 0 359 0 377 0 363 0 371 0 383 0
|
||||
shop = 208 Hickton's_Archery_Emporium 2 2 877 200 882 1000 884 800 886 0 888 0 890 0 892 0 4773 0 4778 0 4783 0 4788 0 4793 0 4798 0 4803 0 39 1000 40 800 41 600 42 400 43 200 44 100 841 4 839 2 837 2 843 4 845 4 4827 0 1133 2 1097 2
|
||||
shop = 209 Vanessa's_Farming_Shop 2 2 5341 500 5343 500 5329 500 952 500 5325 500 5331 500 5354 500 6032 500 5418 500 5376 500 1942 0 1957 0 1965 0 1982 0 5986 0 5504 0 5982 0 5994 0 5996 0 5998 0 6000 0 6002 0 5931 0 6006 0 6036 100
|
||||
shop = 210 Aemad's_Adventuring_Supplies 2 2 227 500 1265 2 1349 2 2142 2 590 2 1759 30 882 500 954 20 970 50 946 2
|
||||
shop = 211 Ardougne_Baker's_Stall 2 2 2309 10 1891 3 1901 6 1973 9
|
||||
shop = 212 Ardougne_Fur_Stall 2 2 948 3 958 3
|
||||
shop = 213 Ardougne_Gem_Stall 2 2 1607 2 1605 1 1603 1 1601 0
|
||||
shop = 214 Ardougne_Silver_Stall 2 2 1714 2 442 1 2355 1
|
||||
shop = 215 Ardougne_Spice_Stall 2 2 2007 1 946 1 1550 2
|
||||
shop = 216 Zenesha's_Plate_Mail_Body_Shop 2 2 1117 3 1115 1 1119 1 1125 1 1121 1
|
||||
shop = 217 Richard's_Farming_Shop 2 2 5341 500 5343 500 5329 500 952 500 5325 500 5331 500 5356 500 6032 500 5418 500 5376 500 1942 0 1957 0 1965 0 1982 0 5986 0 5504 0 5982 0 5994 0 5996 0 5998 0 6000 0 6002 0 5931 0 6006 0 6036 100
|
||||
shop = 218 Armoury 2 2 882 200 877 200 841 4 839 2 837 2 39 800 40 800 41 800 42 800 1349 5 1353 3 1363 5 1365 2 1369 1 1307 4 1309 3 1311 2 1313 1 1315 1 1317 1
|
||||
shop = 219 Arnold's_Eclectic_Supplies 2 2 303 2 311 2 7944 1 7946 0 2309 1 1931 4 1927 1 1733 3 1734 15 1917 10 1785 2 946 1
|
||||
shop = 220 Khazard_General_Store 2 2 1265 5 1931 3 1935 2 1735 2 1925 2 590 2 1755 2 2347 5 954 30 1933 30 583 30 1941 500 946 10
|
||||
shop = 221 Gianne's_Restaurant 2 2 2227 3 2219 3 2221 3 2225 3 2223 3 2233 3 2231 3 2235 3 2229 3 2237 3 2243 3 2239 3 2241 3
|
||||
shop = 222 Blurberry_Bar 2 2 2064 10 2074 10 2092 10 2084 10 2048 10 2080 10 2054 10
|
||||
shop = 223 West_Ardougne_General_Store 2 2 1931 3 954 3 1265 2 1925 2 590 2 2347 3 1061 2 839 2 882 20 329 10 2327 10 2309 5 2142 10
|
||||
shop = 224 Lovecraft's_Tackle 2 2 303 5 307 5 309 5 311 2 301 2 313 1500 314 1000 317 0 327 200 345 0 321 0 335 0 349 0 331 0 359 0 377 0 371 0
|
||||
shop = 225 Aleck's_Hunter_Emporium 2 2 596 20
|
||||
shop = 226 Rasolo_the_Wandering_Merchant 2 2 1969 1 2023 1 660 1 1215 1 550 1 583 1 1941 1 273 1 970 1 975 1 1599 1 2976 1 1823 1 1837 1 1854 1 2524 1 3377 1 2894 1 1909 1 3787 1 3711 1 3678 1 3424 1 3420 1 5 1
|
||||
shop = 227 Davon's_Amulet_Store 2 2 1718 0 1727 0 1729 0 1725 0 1731 0
|
||||
shop = 228 The_Shrimp_and_Parrot 2 2 347 5 339 5 361 5 379 3 373 2 3144 3
|
||||
shop = 229 Karamja_Wines,_Spirits,_and_Beers 2 2 1917 3 431 3 1993 1
|
||||
shop = 230 Fernahei's_Fishing_Hut 2 2 307 5 309 5 313 200 314 800 335 0 349 0 331 0
|
||||
shop = 231 Gabooty's_Tai_Bwo_Wannai_Cooperative 2 2 6341 50 6343 50 6345 50 6347 50 6349 50 6313 50 6315 50 6317 50 6351 50 6353 50 6355 50 6357 50 6359 50 1625 0 1627 0 1629 0 6361 50 6363 50 6365 50 6367 50 6369 50 1609 0 1611 0 1613 0 6371 50 6373 50 6375 50 6377 50 6379 50 6311 0
|
||||
shop = 232 Gabooty's_Tai_Bwo_Wannai_Drinky_Store 2 2 2084 0 2092 0 2048 0 2054 0 2064 0 2074 0
|
||||
shop = 233 Tamayu's_Spear_Stall 2 2 3170 10 3171 10 3172 5 3173 2 3174 0 3175 0 3188 10
|
||||
shop = 234 Tiadeche's_Karambwan_Stall 2 2 3142 10 3150 50 3157 2
|
||||
shop = 235 TzHaar-Hur-Lek's_Ore_and_Gem_Store 2 2
|
||||
shop = 236 TzHaar-Hur-Tel's_Equipment_Store 2 2
|
||||
shop = 237 TzHaar-Mej-Roh's_Rune_Store 2 2
|
||||
shop = 238 TzHaar-Hur-Rin's_Ore_and_Gem_Store 2 2 438 25 436 25 440 15 442 12 453 20 444 12 447 4 449 2 451 1 1623 16 1621 12 1619 8 1617 6 1631 0 6571 1
|
||||
shop = 239 TzHaar-Hur-Zal's_Equipment_Store 2 2
|
||||
shop = 240 Al-Kharid_General_Store 2 2 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 3 1755 2 2347 5 550 5
|
||||
shop = 241 Dommik's_Crafting_Store 2 2 1755 2 1592 10 1597 2 1595 10 1733 3 1734 100 1599 3 2976 10 5523 10
|
||||
shop = 242 Gem_Trader 2 2 1623 1 1621 1 1619 0 1617 0 1607 1 1605 1 1603 0 1601 0
|
||||
shop = 243 Louie's_Armoured_Legs_Bazaar 2 2 1075 5 1067 3 1069 2 1077 1 1071 1 1073 1
|
||||
shop = 244 Ranael's_Super_Skirt_Store 2 2 1087 5 1081 3 1083 2 1089 1 1085 1 1091 1
|
||||
shop = 245 Shantay_Pass_Shop 2 2 1823 100 1831 100 1937 10 1921 10 1929 10 946 10 1833 10 1835 10 1837 10 2349 10 314 500 2347 10 1925 0 1923 0 1935 0 1854 500 954 20
|
||||
shop = 246 Zeke's_Superior_Scimitars 2 2 1321 5 1323 3 1325 2 1329 1
|
||||
shop = 247 The_Big_Heist_Lodge 2 2 4627 10
|
||||
shop = 248 Bedabin_Village_Bartering 2 2 1823 5 1831 5 1937 5 1921 5 1929 5 946 5 2347 5
|
||||
shop = 249 Nardah_Hunter_Shop 2 2 596 20
|
||||
shop = 250 Rok's_Chocs_Box 2 2 6794 30 1973 25
|
||||
shop = 251 Seddu's_Adventurer's_Store 2 2 1093 1 1079 1 1113 1 1099 1 1065 1 1193 1 1151 1
|
||||
shop = 252 Pollnivneach_General_Store 2 2 1931 3 1935 2 1825 20 1833 3 1837 2 1925 12 4593 11 4591 12 1985 5 2120 5 1982 5 1937 5 1921 7 1929 8
|
||||
shop = 253 The_Asp_&_Snake_Bar 2 2 1917 83 2017 10 1993 13 2015 5 2021 4 1915 12
|
||||
shop = 254 Blades_by_Urbi 2 2 1205 1 1203 1 1207 1 1217 0 1209 1 1211 1 1213 1 1215 0 1321 1 1323 1 1325 1
|
||||
shop = 255 Jamila's_Craft_Stall 2 2 1755 2 1592 4 1597 2 1595 2 1733 3 1734 100 1599 3 2976 6 5523 10
|
||||
shop = 256 Nathifa's_Bake_Stall 2 2 2309 10 1891 3 1901 8 1823 50
|
||||
shop = 257 Raetul_and_Co's_Cloth_Store 2 2 4684 20 1833 20 1835 20 1837 20 950 10 1734 50 1733 20
|
||||
shop = 258 Dorgesh-Kaan_General_Supplies 2 2 596 5 590 2 1931 5 1935 2 1923 2 1887 2 954 3 1785 1
|
||||
shop = 259 Nardok's_Bone_Weapons 2 2 5018 10 5016 10
|
||||
shop = 260 Miltog's_Lamps 2 2 596 15 4525 4 4525 2 4546 1 5013 1 590 10 4522 0 4537 0 4548 0
|
||||
shop = 261 Reldak's_Leather_Armour 2 2
|
||||
shop = 262 Ava's_Odds_and_Ends 2 2 314 1000 884 40 886 10 40 30 41 20
|
||||
shop = 263 Diango's_Toy_Store 2 2 2520 10 2522 10 2524 10 2526 10 4613 250
|
||||
shop = 264 Draynor_Seed_Market 2 2 5318 20 5319 10 5324 5 5322 0 5320 0 5323 0 5321 0 5305 20 5306 5 5097 20 5096 20 5307 20 5308 10 5309 5 5310 0 5311 0
|
||||
shop = 265 Fortunato's_Fine_Wine 2 2 1993 5 1935 3 7919 2 7810 500
|
||||
shop = 266 Bounty_Hunter_Store 2 2
|
||||
shop = 267 Helmet_Shop 2 2 1139 5 1137 3 1141 3 1143 1 1145 1 1155 4 1153 3 1157 2 1159 1 1161 1
|
||||
shop = 268 Bob's_Brilliant_Axes 2 2 1265 5 1351 10 1349 5 1353 3 1363 5 1365 2 1369 1
|
||||
shop = 269 Aubury's_Rune_Shop 2 2 556 5000 558 5000 554 5000 555 5000 557 5000 559 5000 562 250 560 250
|
||||
shop = 270 Construction_Supplies 2 2 4819 95 4820 95 1539 95
|
||||
shop = 271 Fancy_Clothes_Store 2 2 1949 0 579 3 1023 1 958 3 948 3 1733 3 1734 100 1059 10 1061 10 426 3 428 3 1757 10 1013 10 1015 3 1011 2 1007 10 1025 10
|
||||
shop = 272 Horvik's_Armour_Shop 2 2 1103 5 1101 3 1105 3 1109 1 1117 3 1115 1 1119 1 1125 1 1121 1 1067 1 1133 1 1097 1
|
||||
shop = 273 Lowe's_Archery_Emporium 2 2 882 2000 884 1500 886 1000 888 800 890 600 877 1500 841 4 839 4 843 3 845 3 849 2 847 2 853 1 851 1 837 2
|
||||
shop = 274 Thessalia's_Fine_Clothes 2 2 1005 3 1129 12 1059 10 1061 10 1757 1 1013 5 1015 3 1011 2 1007 4 950 5 426 3 428 3
|
||||
shop = 275 Varrock_Swordshop 2 2 1277 5 1279 4 1281 4 1283 3 1285 3 1287 2 1291 4 1293 3 1295 3 1297 2 1299 2 1301 1 1205 10 1203 6 1207 5 1217 4 1209 3 1211 2
|
||||
shop = 276 Zaff's_Superior_Staffs! 2 2 1391 5 1379 5 1389 5 1381 2 1383 2 1385 2 1387 2
|
||||
shop = 277 Ye_Olde_Tea_Shoppe 2 2 712 20
|
||||
shop = 278 General_Store 2 2 1733 10 1734 50 1931 5 1925 3 1935 2 590 3 1755 2 2347 5 3377 10 946 2
|
||||
shop = 279 Barker's_Haberdashery 2 2 2894 5 2896 5 2898 5 2900 5 2902 5 2904 5 2906 5 2908 5 2910 5 2912 5 2914 5 2916 5 2918 5 2920 5 2922 5 2924 5 2926 5 2928 5 2930 5 2932 5 2934 5 2936 5 2938 5 2940 5 2942 5 1007 5 1019 5 1021 5 1023 5 1027 5
|
||||
shop = 280 Rufus'_Meat_Emporium 2 2 2132 10 2138 10 2134 10 2136 10 335 5 349 5 331 5 383 1
|
||||
shop = 281 Trader_Sven's_Black_Market_Goods 2 2
|
||||
shop = 282 Razmire_General_Store 2 2 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 3 1755 2 2347 5 3422 150 227 100 1933 100 3678 3
|
||||
shop = 283 Razmire_Builders'_Merchants 2 2 3211 1000 3420 1000 1941 1000 960 10
|
||||
shop = 284 Ak-Haranu's_Exotic_Shop 2 2 4740 500
|
||||
shop = 285 Alice's_Farming_Shop 2 2 5341 500 5343 500 5329 500 952 500 5325 500 5331 500 5356 500 6032 500 5418 500 5376 500 1942 0 1957 0 1965 0 1982 0 5986 0 5504 0 5982 0 5994 0 5996 0 5998 0 6000 0 6002 0 5931 0 6006 0 6036 100
|
||||
shop = 286 Lletya_Archery_Shop 2 2 884 2000 886 500 888 500 890 450 892 400 877 1500 843 5 845 5 837 5 849 5 847 5
|
||||
shop = 287 Lletya_Food_Store 2 2 2309 10 379 15 1993 3 1985 10 1891 5
|
||||
shop = 288 Quartermaster's_Stores 2 2 1931 5 1935 2 1735 3 590 3 2309 10 3190 10 3192 10 3194 10 3196 10 3198 7 3200 7 3202 7 3204 5
|
||||
shop = 289 Armour_Store 2 2 1147 0 1163 0 1127 0 1093 0 1185 0 1201 0 1113 0 1079 0 1145 0 1161 0 1123 0 1091 0 1183 0 1199 0 1111 0 1073 0 1143 0 1159 0 1121 0 1085 0 1181 0 1197 0 1109 0 1071 0
|
||||
shop = 290 Crossbow_Shop 2 2
|
||||
shop = 291 Green_Gemstone_Gems 2 2 1607 3 1605 1 1603 1 1601 0
|
||||
shop = 292 Ore_Seller 2 2 436 100 438 100 440 100 447 100 442 100 444 100 453 100
|
||||
shop = 293 Pickaxe-Is-Mine 2 2 1265 6 1269 4 1273 3 1271 2 1275 1
|
||||
shop = 294 Vermundi's_Clothes_Stall 2 2 5036 3 5024 3 5030 3 5048 3 5042 3 950 5
|
||||
shop = 295 Keldagrim_Stonemason 2 2 3420 1000 4692 20 4703 10
|
||||
shop = 296 Quality_Weapons_Shop 2 2 1365 10 1369 10 1285 10 1287 10 1325 10 1297 10 1303 10 853 10 851 10 888 100 890 100
|
||||
shop = 297 Vigr's_Warhammers 2 2 1337 5 1335 4 1339 3 1341 3 1343 2 1345 1
|
||||
shop = 298 Leprechaun_Larry's_Farming_Supplies 2 2 5341 6 5343 4 5329 1 952 3 5325 2 5331 2 1925 2 6036 5 2026 10 1480 3
|
||||
shop = 299 Filamina's_Wares 2 2 1379 5 1389 5 1381 2 1383 2 1385 2 1387 2
|
||||
shop = 300 Regath's_Wares 2 2 227 30 954 10 554 500 555 500 556 500 557 500 558 300 559 300 565 50 566 50 579 1 1017 1 221 300
|
||||
shop = 301 Thyria's_Wares 2 2 554 5000 555 5000 556 5000 557 5000 558 5000 559 5000 562 250 560 150
|
||||
shop = 302 The_Golden_Field 2 2 1917 10 5763 10 1993 5 712 5
|
||||
shop = 303 The_Haymaker's_Arms 2 2 1917 10 5763 10 1993 5 712 5
|
||||
shop = 304 Little_Shop_of_Horace 2 2 227 60 1931 30 1935 5 1925 5 1923 5 975 1 1735 2 954 30 590 2 952 5 1759 30 1755 2 2347 5 1733 2 1734 40
|
||||
shop = 305 Logava_Gricoller's_Cooking_Supplies 2 2 2313 5 1887 2 1923 2 590 3 1935 3 1931 12 1980 3 946 3 1759 30 1942 5 1955 2 2309 2 1973 1 1985 3 1933 8
|
||||
shop = 306 Perry's_Chop-chop_Shop 2 2 1351 4 1349 3 1353 2 1355 1 1357 1 1359 1 590 2
|
||||
shop = 307 Vannah's_Farm_Store 2 2 5341 5 5343 5 5329 5 952 5 5325 5 5331 5 5354 100 6032 100 1925 100 5418 100 5376 100 6036 40
|
||||
shop = 308 The_Deeper_Lode 2 2 1917 10 1913 1 1911 3 1971 2 1919 0
|
||||
shop = 309 Little_Munty's_Little_Shop 2 2 1265 20 1931 50000 1935 5 1925 5 1923 5 590 2 1759 30 1755 2 2347 5
|
||||
shop = 310 Toothy's_Pickaxes 2 2 1265 5 1267 3 1269 3 1273 2 1271 1 1275 1 1931 50000
|
||||
shop = 311 Thirus_Urkar's_Fine_Dynamite_Store 2 2 590 2
|
||||
shop = 312 Frankie's_Fishing_Emporium 2 2 317 50 327 50 345 25 353 25 341 0 321 0 359 0 377 0 363 0 371 0 383 0
|
||||
shop = 313 Kenelme's_Wares 2 2 1933 3 2132 1 1965 3 1963 3 1951 1 2309 0 1973 1 1985 3 1982 3 1942 1
|
||||
shop = 314 Leenz's_General_Supplies 2 2 1931 50000 1935 5 1925 5 1923 5 590 2 2347 5 4819 500 4820 500
|
||||
shop = 315 Tynan's_Fishing_Supplies 2 2 1925 1000 303 5 305 5 307 5 311 2 301 2 313 1200
|
||||
shop = 316 Warrens_Fish_Monger 2 2 303 5 307 5 309 5 311 2 301 2 313 1500 314 1000 317 0 327 200 345 0 321 0 335 0 349 0 331 0 359 0 377 0 371 0
|
||||
shop = 317 Warrens_General_Store 2 2 1931 3 1935 2 1735 2 1925 2 1923 2 590 2 1755 2 2347 5 952 5 946 4
|
||||
shop = 318 Briget's_Weapons 2 2 1363 5 1365 2 1369 1 1277 5 1279 4 1281 4 1283 3 1285 3 1287 2 1291 4 1293 3 1295 3 1297 2 1299 2 1301 1 1205 10 1203 6 1207 5 1217 4 1209 3 1211 2 1422 5 1420 4 1424 4 1428 3 1430 2 1307 4 1309 3 1311 2 1313 1 1315 1 1317 1 1321 5 1323 4 1325 4 1327 3 1329 3
|
||||
shop = 319 Briget's_Armour 2 2 1103 5 1101 3 1105 3 1075 3 1067 2 1069 2 1087 3 1081 2 1083 2 1139 5 1137 3 1141 3
|
||||
shop = 320 Jennifer's_General_Field_Supplies 2 2 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 2 1755 2 1351 10 7934 25
|
||||
shop = 321 Daga's_Scimitar_Smithy 2 2 1321 10 1323 10 1325 8 1329 6 4587 4
|
||||
shop = 322 Hamab's_Crafting_Emporium 2 2 1755 10 1592 10 1597 10 4020 10 1733 10 1734 100 1759 100
|
||||
shop = 323 Oobapohk's_Javelin_Store 2 2 825 500 826 500 827 500 828 500 829 500 830 500
|
||||
shop = 324 Solihib's_Food_Stall 2 2 4012 200 1963 1000 4016 10 4014 20
|
||||
shop = 325 Magic_Stall 2 2 554 1000 555 1000 556 1000 557 1000 563 250 4008 10 4006 10 4023 10
|
||||
shop = 326 Fossil_Island_General_Store 2 2 1931 5 1935 2 1925 3 1923 2 1887 2 590 2 1755 2 2347 5 954 5
|
||||
shop = 327 Petrified_Pete's_Ore_Shop 2 2
|
||||
shop = 328 Mairin's_Market 2 2
|
||||
shop = 329 Smithing_Smith's_Shop 2 2 1321 5 1323 3 1325 2 1329 1 2347 5
|
||||
shop = 330 Two_Feet_Charley's_Fish_Shop 2 2 317 10 327 10 345 7 353 7 341 6 321 5 359 4 377 2 363 2 371 1
|
||||
shop = 331 The_Other_Inn 2 2 1917 3 7157 3 1993 1 2003 5
|
||||
shop = 332 Harpoon_Joe's_House_of_'Rum' 2 2 1917 3 7157 3 1993 1 2003 5
|
||||
shop = 333 Void_Knight_Archery_Store 2 2 825 10 826 10 827 10 828 5 829 5 830 5 39 10 40 10 41 10 42 5 43 5 44 5
|
||||
shop = 334 Bandit_Duty_Free 2 2 1931 5 1935 2 590 2 1755 2 2347 5 1265 5 1351 10
|
||||
shop = 335 Darren's_Wilderness_Cape_Shop 2 2 4321 100 4341 100 4361 100 4381 100 4401 100
|
||||
shop = 336 Edmond's_Wilderness_Cape_Shop 2 2 4329 100 4349 100 4369 100 4389 100 4409 100
|
||||
shop = 337 Ian's_Wilderness_Cape_Shop 2 2 4317 100 4337 100 4357 100 4377 100 4397 100
|
||||
shop = 338 Larry's_Wilderness_Cape_Shop 2 2 4319 100 4339 100 4359 100 4379 100 4399 100
|
||||
shop = 339 Lundail's_Arena-side_Rune_Shop 2 2 554 200 555 200 556 200 557 200 558 140 559 140 561 250 562 250 563 250 564 20 560 250
|
||||
shop = 340 Mage_Arena_Staffs 2 2 2415 5 2416 5 2417 5
|
||||
shop = 341 Richard's_Wilderness_Cape_Shop 2 2 4325 100 4345 100 4365 100 4385 100 4405 100
|
||||
shop = 342 Sam's_Wilderness_Cape_Shop 2 2 4333 100 4353 100 4373 100 4393 100 4413 100
|
||||
shop = 343 Simon's_Wilderness_Cape_Shop 2 2 4331 100 4351 100 4371 100 4391 100 4411 100
|
||||
shop = 344 Irksol 2 2 1641 5
|
||||
shop = 345 Jukat 2 2 1305 2 1215 2
|
||||
shop = 346 Fairy_Fixit's_Fairy_Enchantment 2 2
|
||||
shop = 347 Crossbow_Shop_(White_Wolf_Mountain) 2 2
|
||||
shop = 348 Trader_Stan's_Trading_Post 2 2 1931 5 1935 2 1735 2 1925 3 1923 2 1887 2 590 3 1755 2 2347 5 550 5 954 2 946 2 2114 15 1963 15 2108 10 4286 10 1785 10 1783 10 401 20 1781 10 301 20 307 20 1941 30 3226 20 1025 5
|
||||
[ENDOFSHOPLIST]
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
0
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,258 +0,0 @@
|
||||
1516 2009 4747 1 0
|
||||
2548 2576 3298 2 0
|
||||
2546 2576 3298 2 0
|
||||
1519 2010 4747 1 0
|
||||
1516 2069 4447 0 0
|
||||
1516 2085 4447 0 0
|
||||
1519 2070 4447 2 0
|
||||
1519 2086 4447 2 0
|
||||
1557 2383 4445 0 0
|
||||
1558 2383 4446 0 0
|
||||
1512 2444 3099 3 0
|
||||
1516 2445 3089 0 0
|
||||
1519 2445 3090 0 0
|
||||
1516 2456 3308 2 0
|
||||
1519 2456 3307 2 0
|
||||
1512 2536 3083 2 0
|
||||
1512 2536 3100 2 0
|
||||
1512 2537 3089 1 0
|
||||
1512 2537 3094 3 0
|
||||
1516 2532 3092 2 0
|
||||
1516 2539 3091 0 0
|
||||
1519 2532 3091 2 0
|
||||
1519 2539 3092 0 0
|
||||
1551 2513 3494 0 0
|
||||
1551 2528 3495 0 0
|
||||
1553 2513 3495 0 0
|
||||
1553 2528 3496 0 0
|
||||
1557 2555 3466 0 0
|
||||
1558 2555 3467 0 0
|
||||
1512 2500 3849 3 0
|
||||
1512 2500 3871 1 0
|
||||
1512 2504 3853 2 0
|
||||
1512 2504 3867 2 0
|
||||
1512 2505 3860 0 0
|
||||
1512 2506 3851 1 0
|
||||
1512 2506 3869 3 0
|
||||
1512 2510 3860 2 0
|
||||
1512 2500 3849 3 1
|
||||
1512 2500 3871 1 1
|
||||
1512 2504 3853 2 1
|
||||
1512 2504 3867 2 1
|
||||
1512 2506 3851 1 1
|
||||
1512 2506 3869 3 1
|
||||
1517 2561 3099 1 0
|
||||
1517 2572 3098 3 0
|
||||
1520 2561 3098 3 0
|
||||
1520 2572 3099 1 0
|
||||
1516 2594 3180 1 0
|
||||
1519 2595 3180 1 0
|
||||
1516 2613 3481 3 0
|
||||
1519 2612 3481 3 0
|
||||
1557 2568 3458 3 0
|
||||
1558 2567 3458 3 0
|
||||
1512 2608 3875 0 0
|
||||
1512 2609 3875 2 0
|
||||
1512 2611 3866 2 0
|
||||
1512 2611 3883 2 0
|
||||
1512 2613 3864 1 0
|
||||
1512 2613 3886 3 0
|
||||
1512 2615 3870 1 0
|
||||
1512 2615 3880 3 0
|
||||
1512 2609 3875 2 1
|
||||
1512 2611 3866 2 1
|
||||
1512 2611 3883 2 1
|
||||
1512 2613 3865 3 1
|
||||
1512 2613 3885 1 1
|
||||
1512 2615 3870 1 1
|
||||
1512 2615 3880 3 1
|
||||
1516 2564 9881 1 0
|
||||
1516 2576 9882 1 0
|
||||
1516 2576 9884 1 0
|
||||
1516 2582 9875 0 0
|
||||
1519 2565 9881 1 0
|
||||
1519 2577 9882 1 0
|
||||
1519 2577 9884 1 0
|
||||
1519 2582 9876 0 0
|
||||
1512 2665 3241 2 0
|
||||
1516 2678 3325 2 0
|
||||
1519 2678 3324 2 0
|
||||
1557 2635 3307 1 0
|
||||
1558 2636 3307 1 0
|
||||
1551 2634 3361 2 0
|
||||
1551 2675 3350 2 0
|
||||
1553 2634 3360 2 0
|
||||
1553 2675 3349 2 0
|
||||
1513 2635 4676 0 0
|
||||
1513 2638 4684 0 1
|
||||
1516 2635 4693 3 0
|
||||
1519 2634 4693 3 0
|
||||
1589 2643 4682 0 2
|
||||
1590 2643 4683 0 2
|
||||
1516 2645 9828 0 0
|
||||
1519 2645 9829 0 0
|
||||
1506 2704 3463 0 0
|
||||
1507 2695 3488 2 0
|
||||
1507 2710 3487 2 0
|
||||
1508 2704 3462 0 0
|
||||
1511 2694 3488 0 0
|
||||
1511 2709 3487 0 0
|
||||
1516 2737 3477 3 0
|
||||
1519 2736 3477 3 0
|
||||
1589 2726 3494 1 1
|
||||
1590 2727 3494 1 1
|
||||
1516 2740 3572 1 0
|
||||
1519 2741 3572 1 0
|
||||
1557 2741 3555 1 0
|
||||
1558 2742 3555 1 0
|
||||
1516 2776 3400 0 0
|
||||
1519 2776 3401 0 0
|
||||
1551 2766 3444 2 0
|
||||
1553 2766 3443 2 0
|
||||
1512 2752 3508 0 2
|
||||
1512 2755 3508 2 2
|
||||
1512 2760 3505 1 2
|
||||
1512 2764 3508 2 2
|
||||
1516 2757 3503 1 0
|
||||
1516 2761 3505 1 1
|
||||
1519 2758 3503 1 0
|
||||
1519 2762 3505 1 1
|
||||
1557 2757 3482 1 0
|
||||
1558 2758 3482 1 0
|
||||
1590 2755 3512 2 2
|
||||
1596 2816 3182 0 0
|
||||
1597 2816 3183 0 0
|
||||
1551 2854 3371 2 0
|
||||
1553 2854 3370 2 0
|
||||
1551 2924 3292 3 0
|
||||
1553 2923 3292 3 0
|
||||
1596 2934 3320 3 0
|
||||
1597 2933 3320 3 0
|
||||
1516 2891 3511 2 0
|
||||
1519 2891 3510 2 0
|
||||
1512 2896 3559 0 0
|
||||
1512 2901 3559 2 0
|
||||
1512 2901 3568 2 0
|
||||
1516 2898 3558 1 0
|
||||
1519 2899 3558 1 0
|
||||
1512 2920 4683 2 0
|
||||
1512 2920 4700 2 0
|
||||
1512 2922 4689 1 0
|
||||
1512 2922 4694 3 0
|
||||
1516 2916 4692 2 0
|
||||
1516 2923 4691 0 0
|
||||
1519 2916 4691 2 0
|
||||
1519 2923 4692 0 0
|
||||
1516 2908 9698 3 0
|
||||
1519 2907 9698 3 0
|
||||
1557 2898 9831 0 0
|
||||
1558 2898 9832 0 0
|
||||
1516 3001 3177 0 0
|
||||
1519 3001 3178 0 0
|
||||
1516 2957 3509 1 0
|
||||
1519 2958 3509 1 0
|
||||
1516 2958 3820 0 0
|
||||
1519 2958 3821 0 0
|
||||
1596 2948 3904 3 0
|
||||
1597 2947 3904 3 0
|
||||
1513 3013 3515 0 2
|
||||
1513 3029 3508 1 2
|
||||
1516 3021 3632 2 0
|
||||
1519 3021 3631 2 0
|
||||
1596 3008 3849 0 0
|
||||
1596 3071 3857 2 0
|
||||
1597 3008 3850 0 0
|
||||
1597 3071 3856 2 0
|
||||
1557 3022 10312 2 0
|
||||
1557 3040 10308 2 0
|
||||
1557 3044 10342 2 0
|
||||
1558 3022 10311 2 0
|
||||
1558 3040 10307 2 0
|
||||
1558 3044 10341 2 0
|
||||
1507 3122 3119 2 0
|
||||
1511 3121 3119 0 0
|
||||
1516 3129 3106 0 0
|
||||
1551 3107 3273 0 0
|
||||
1553 3107 3274 0 0
|
||||
1516 3101 3509 0 0
|
||||
1519 3101 3510 0 0
|
||||
1551 3079 3500 1 0
|
||||
1553 3080 3500 1 0
|
||||
1557 3112 3514 0 0
|
||||
1558 3112 3515 0 0
|
||||
1557 3075 3867 1 0
|
||||
1558 3076 3867 1 0
|
||||
1557 3103 9910 2 0
|
||||
1558 3103 9909 2 0
|
||||
1596 3131 9917 1 0
|
||||
1597 3132 9917 1 0
|
||||
1516 3166 3302 1 0
|
||||
1519 3167 3302 1 0
|
||||
1551 3145 3291 1 0
|
||||
1551 3163 3290 3 0
|
||||
1551 3175 3316 3 0
|
||||
1551 3181 3289 3 0
|
||||
1551 3186 3268 0 0
|
||||
1551 3188 3279 1 0
|
||||
1551 3198 3282 3 0
|
||||
1553 3146 3291 1 0
|
||||
1553 3162 3290 3 0
|
||||
1553 3174 3316 3 0
|
||||
1553 3180 3289 3 0
|
||||
1553 3186 3269 0 0
|
||||
1553 3189 3279 1 0
|
||||
1553 3197 3282 3 0
|
||||
1589 3192 9825 3 0
|
||||
1590 3191 9825 3 0
|
||||
1557 3145 9871 2 0
|
||||
1558 3145 9870 2 0
|
||||
1516 3213 3221 0 0
|
||||
1516 3217 3218 0 0
|
||||
1516 3244 3216 3 0
|
||||
1519 3213 3222 0 0
|
||||
1519 3217 3219 0 0
|
||||
1519 3243 3216 3 0
|
||||
1551 3213 3261 0 0
|
||||
1553 3213 3262 0 0
|
||||
1551 3236 3285 2 0
|
||||
1551 3236 3296 2 0
|
||||
1551 3241 3301 0 0
|
||||
1551 3253 3266 0 0
|
||||
1551 3261 3321 1 0
|
||||
1553 3236 3284 2 0
|
||||
1553 3236 3295 2 0
|
||||
1553 3241 3302 0 0
|
||||
1553 3253 3267 0 0
|
||||
1553 3262 3321 1 0
|
||||
1551 3213 3353 1 0
|
||||
1551 3255 3348 3 0
|
||||
1553 3214 3353 1 0
|
||||
1553 3254 3348 3 0
|
||||
1517 3253 3449 1 0
|
||||
1520 3253 3448 3 0
|
||||
1589 3254 3419 3 1
|
||||
1590 3253 3419 3 1
|
||||
1512 3209 3490 3 0
|
||||
1512 3223 3491 3 0
|
||||
1512 3219 3472 0 2
|
||||
1514 3224 3493 1 0
|
||||
1516 3212 3470 1 0
|
||||
1516 3215 3494 0 1
|
||||
1517 3249 3480 1 0
|
||||
1517 3252 3480 1 0
|
||||
1517 3255 3471 0 0
|
||||
1519 3213 3470 1 0
|
||||
1519 3215 3495 0 1
|
||||
1520 3249 3479 3 0
|
||||
1520 3252 3479 3 0
|
||||
1520 3256 3471 2 0
|
||||
1596 3202 3856 3 0
|
||||
1597 3201 3856 3 0
|
||||
1596 3225 3904 3 0
|
||||
1597 3224 3904 3 0
|
||||
1596 3312 3331 0 0
|
||||
1597 3312 3332 0 0
|
||||
1517 3281 3506 2 0
|
||||
1520 3280 3506 0 0
|
||||
4423 2426 3088 0 0
|
||||
4424 2427 3088 0 0
|
||||
@@ -108,8 +108,6 @@
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.30</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.ogce/xpp3 -->
|
||||
<dependency>
|
||||
<groupId>org.ogce</groupId>
|
||||
@@ -134,6 +132,12 @@
|
||||
<artifactId>javacord-core</artifactId>
|
||||
<version>3.0.4</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.everythingrs</groupId>
|
||||
<artifactId>api</artifactId>
|
||||
|
||||
@@ -1,279 +1,317 @@
|
||||
package com.rebotted.game.globalworldobjects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.io.*;
|
||||
import java.util.Scanner;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.rebotted.GameEngine;
|
||||
import com.rebotted.game.objects.Objects;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.util.DoorData;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Doors {
|
||||
|
||||
private static Doors singleton = null;
|
||||
private static Doors singleton = null;
|
||||
|
||||
private List<Doors> doors = new ArrayList<Doors>();
|
||||
private final List<Doors> doors = new ArrayList<>();
|
||||
|
||||
private File doorFile;
|
||||
|
||||
public static Doors getSingleton() {
|
||||
if (singleton == null) {
|
||||
singleton = new Doors(System.getProperty("user.dir") + "/data/doors.txt");
|
||||
}
|
||||
return singleton;
|
||||
}
|
||||
private File doorFile;
|
||||
|
||||
private Doors(String file){
|
||||
doorFile = new File(file);
|
||||
}
|
||||
|
||||
private Doors(int door, int x, int y, int z, int face, int type, int open) {
|
||||
this.doorId = door;
|
||||
this.originalId = door;
|
||||
this.doorX = x;
|
||||
this.doorY = y;
|
||||
this.originalX = x;
|
||||
this.originalY = y;
|
||||
this.doorZ = z;
|
||||
this.originalFace = face;
|
||||
this.currentFace = face;
|
||||
this.type = type;
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
private Doors getDoor(int id, int x, int y, int z) {
|
||||
for (Doors d : doors) {
|
||||
if (d.doorId == id) {
|
||||
if (d.doorX == x && d.doorY == y && d.doorZ == z) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Doors getSingleton() {
|
||||
if (singleton == null) {
|
||||
singleton = new Doors(System.getProperty("user.dir") + "/data/doors.json");
|
||||
}
|
||||
return singleton;
|
||||
}
|
||||
|
||||
public boolean handleDoor(Player player, int id, int x, int y, int z) {
|
||||
Doors d = getDoor(id, x, y, z);
|
||||
private Doors(String file) {
|
||||
doorFile = new File(file);
|
||||
}
|
||||
|
||||
if (d == null) {
|
||||
//System.out.println("D: " + id + " null debug x: " + x + " y: " + y + ".");
|
||||
return DoubleDoors.getSingleton().handleDoor(player, id, x, y, z);
|
||||
}
|
||||
private Doors(int door, int x, int y, int z, int face, int type, int open) {
|
||||
this.doorId = door;
|
||||
this.originalId = door;
|
||||
this.doorX = x;
|
||||
this.doorY = y;
|
||||
this.originalX = x;
|
||||
this.originalY = y;
|
||||
this.doorZ = z;
|
||||
this.originalFace = face;
|
||||
this.currentFace = face;
|
||||
this.type = type;
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
//todo: improvment: if player manage to get to door then open the door.
|
||||
if(player.distanceToPoint(x, y) > 1) {
|
||||
//System.out.println("Door (single): " + id + " not in distance debug at x: " + x + " y: " + y + ".");
|
||||
return false;
|
||||
}
|
||||
private Doors getDoor(int id, int x, int y, int z) {
|
||||
for (Doors d : doors) {
|
||||
if (d.doorId == id) {
|
||||
if (d.doorX == x && d.doorY == y && d.doorZ == z) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//Remove clipping for old door (gets added back in placeObject)
|
||||
//Region.removeClipping(x, y, z);
|
||||
public boolean handleDoor(Player player, int id, int x, int y, int z) {
|
||||
Doors d = getDoor(id, x, y, z);
|
||||
|
||||
int xAdjustment = 0, yAdjustment = 0;
|
||||
if (d.type == 0) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
yAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
yAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
} else if (d.type == 9) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (xAdjustment != 0 || yAdjustment != 0) {
|
||||
Objects o = new Objects(-1, d.doorX, d.doorY, d.doorZ, 0, d.type, 0);
|
||||
GameEngine.objectHandler.placeObject(o);
|
||||
}
|
||||
if (d.doorX == d.originalX && d.doorY == d.originalY) {
|
||||
d.doorX += xAdjustment;
|
||||
d.doorY += yAdjustment;
|
||||
} else {
|
||||
Objects o = new Objects(-1, d.doorX, d.doorY, d.doorZ, 0, d.type, 0);
|
||||
GameEngine.objectHandler.placeObject(o);
|
||||
d.doorX = d.originalX;
|
||||
d.doorY = d.originalY;
|
||||
}
|
||||
if (d.doorId == d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId += 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId -= 1;
|
||||
}
|
||||
} else if (d.doorId != d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId -= 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId += 1;
|
||||
}
|
||||
}
|
||||
GameEngine.objectHandler.placeObject(new Objects(d.doorId, d.doorX, d.doorY, d.doorZ, getNextFace(d), d.type, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
private int getNextFace(Doors d) {
|
||||
int f = d.originalFace;
|
||||
if (d.type == 0) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 0;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
} else if (d.type == 9) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 0;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
}
|
||||
d.currentFace = f;
|
||||
return f;
|
||||
}
|
||||
|
||||
public void load() {
|
||||
//long start = System.currentTimeMillis();
|
||||
try {
|
||||
singleton.processLineByLine();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//System.out.println("Loaded "+ doors.size() +" doors in "+ (System.currentTimeMillis() - start) +"ms.");
|
||||
}
|
||||
|
||||
private final void processLineByLine() throws FileNotFoundException {
|
||||
Scanner scanner = new Scanner(new FileReader(doorFile));
|
||||
try {
|
||||
while(scanner.hasNextLine()) {
|
||||
processLine(scanner.nextLine());
|
||||
}
|
||||
} finally {
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
|
||||
protected void processLine(String line){
|
||||
Scanner scanner = new Scanner(line);
|
||||
scanner.useDelimiter(" ");
|
||||
try {
|
||||
while(scanner.hasNextLine()) {
|
||||
int id = Integer.parseInt(scanner.next());
|
||||
int x = Integer.parseInt(scanner.next());
|
||||
int y = Integer.parseInt(scanner.next());
|
||||
int f = Integer.parseInt(scanner.next());
|
||||
int z = Integer.parseInt(scanner.next());
|
||||
int t = Integer.parseInt(scanner.next());
|
||||
doors.add(new Doors(id,x,y,z,f,t,alreadyOpen(id)?1:0));
|
||||
}
|
||||
} finally {
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean alreadyOpen(int id) {
|
||||
for (int i = 0; i < openDoors.length; i++) {
|
||||
if (openDoors[i] == id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (d == null) {
|
||||
//System.out.println("D: " + id + " null debug x: " + x + " y: " + y + ".");
|
||||
return DoubleDoors.getSingleton().handleDoor(player, id, x, y, z);
|
||||
}
|
||||
|
||||
//todo: improvment: if player manage to get to door then open the door.
|
||||
if (player.distanceToPoint(x, y) > 1) {
|
||||
//System.out.println("Door (single): " + id + " not in distance debug at x: " + x + " y: " + y + ".");
|
||||
return false;
|
||||
}
|
||||
|
||||
//Remove clipping for old door (gets added back in placeObject)
|
||||
//Region.removeClipping(x, y, z);
|
||||
|
||||
int xAdjustment = 0, yAdjustment = 0;
|
||||
if (d.type == 0) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
yAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
yAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
} else if (d.type == 9) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (xAdjustment != 0 || yAdjustment != 0) {
|
||||
Objects o = new Objects(-1, d.doorX, d.doorY, d.doorZ, 0, d.type, 0);
|
||||
GameEngine.objectHandler.placeObject(o);
|
||||
}
|
||||
if (d.doorX == d.originalX && d.doorY == d.originalY) {
|
||||
d.doorX += xAdjustment;
|
||||
d.doorY += yAdjustment;
|
||||
} else {
|
||||
Objects o = new Objects(-1, d.doorX, d.doorY, d.doorZ, 0, d.type, 0);
|
||||
GameEngine.objectHandler.placeObject(o);
|
||||
d.doorX = d.originalX;
|
||||
d.doorY = d.originalY;
|
||||
}
|
||||
if (d.doorId == d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId += 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId -= 1;
|
||||
}
|
||||
} else if (d.doorId != d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId -= 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId += 1;
|
||||
}
|
||||
}
|
||||
GameEngine.objectHandler.placeObject(new Objects(d.doorId, d.doorX, d.doorY, d.doorZ, getNextFace(d), d.type, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
private int getNextFace(Doors d) {
|
||||
int f = d.originalFace;
|
||||
if (d.type == 0) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 0;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
} else if (d.type == 9) {
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 0;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
}
|
||||
d.currentFace = f;
|
||||
return f;
|
||||
}
|
||||
|
||||
public void load() {
|
||||
Gson gson = new Gson();
|
||||
//long start = System.currentTimeMillis();
|
||||
try {
|
||||
Type collectionType = new TypeToken<DoorData[]>() {
|
||||
}.getType();
|
||||
DoorData[] doorData = gson.fromJson(new FileReader(doorFile), collectionType);
|
||||
|
||||
for (DoorData data : doorData) {
|
||||
for (DoorData.Location location : data.getLocations()) {
|
||||
doors.add(new Doors(data.getId(), location.getX(), location.getY(), location.getHeight(), data.getFace(), data.getType(), alreadyOpen(data.getId()) ? 1 : 0));
|
||||
}
|
||||
}
|
||||
//singleton.writeJsonDump();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//System.out.println("Loaded "+ doors.size() +" doors in "+ (System.currentTimeMillis() - start) +" ms.");
|
||||
}
|
||||
|
||||
private void writeJsonDump() throws FileNotFoundException {
|
||||
try (Scanner scanner = new Scanner(new FileReader(doorFile))) {
|
||||
while (scanner.hasNextLine()) {
|
||||
processLine(scanner.nextLine());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void processLine(String line) {
|
||||
JSONArray array = new JSONArray();
|
||||
Scanner scanner = new Scanner(line);
|
||||
scanner.useDelimiter(" ");
|
||||
try {
|
||||
while (scanner.hasNextLine()) {
|
||||
int id = Integer.parseInt(scanner.next());
|
||||
int x = Integer.parseInt(scanner.next());
|
||||
int y = Integer.parseInt(scanner.next());
|
||||
int face = Integer.parseInt(scanner.next());
|
||||
int height = Integer.parseInt(scanner.next());
|
||||
int type = Integer.parseInt(scanner.next());
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
object.put("id", id);
|
||||
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
JSONObject object1 = new JSONObject();
|
||||
object1.put("x", x);
|
||||
object1.put("y", y);
|
||||
object1.put("height", height);
|
||||
jsonArray.put(0, object1);
|
||||
object.put("location", jsonArray);
|
||||
|
||||
object.put("face", face);
|
||||
object.put("type", type);
|
||||
|
||||
array.put(object);
|
||||
}
|
||||
} finally {
|
||||
scanner.close();
|
||||
|
||||
try {
|
||||
FileWriter fileWriter = new FileWriter("doors-dump.json");
|
||||
fileWriter.write(array.toString());
|
||||
|
||||
System.out.println(array.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean alreadyOpen(int id) {
|
||||
for (int openDoor : OPEN_DOORS) {
|
||||
if (openDoor == id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private int doorId;
|
||||
private int originalId;
|
||||
private int doorX;
|
||||
private int doorY;
|
||||
private int originalX;
|
||||
private int originalY;
|
||||
private int doorZ;
|
||||
private int originalFace;
|
||||
private int currentFace;
|
||||
private int type;
|
||||
private int open;
|
||||
|
||||
private static final int[] OPEN_DOORS = {
|
||||
1504, 1514, 1517, 1520, 1531,
|
||||
1534, 2033, 2035, 2037, 2998,
|
||||
3271, 4468, 4697, 6101, 6103,
|
||||
6105, 6107, 6109, 6111, 6113,
|
||||
6115, 6976, 6978, 8696, 8819,
|
||||
10261, 10263, 10265, 11708, 11710,
|
||||
11712, 11715, 11994, 12445, 13002,
|
||||
};
|
||||
|
||||
private int doorId;
|
||||
private int originalId;
|
||||
private int doorX;
|
||||
private int doorY;
|
||||
private int originalX;
|
||||
private int originalY;
|
||||
private int doorZ;
|
||||
private int originalFace;
|
||||
private int currentFace;
|
||||
private int type;
|
||||
private int open;
|
||||
|
||||
private static int[] openDoors = {
|
||||
1504, 1514, 1517, 1520, 1531,
|
||||
1534, 2033, 2035, 2037, 2998,
|
||||
3271, 4468, 4697, 6101,6103,
|
||||
6105, 6107, 6109, 6111, 6113,
|
||||
6115, 6976, 6978, 8696, 8819,
|
||||
10261, 10263,10265,11708,11710,
|
||||
11712,11715,11994,12445, 13002,
|
||||
};
|
||||
|
||||
}
|
||||
+408
-372
@@ -1,393 +1,429 @@
|
||||
package com.rebotted.game.globalworldobjects;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.rebotted.GameEngine;
|
||||
import com.rebotted.game.objects.Objects;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.util.DoorData;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Killamess
|
||||
*
|
||||
*/
|
||||
public class DoubleDoors {
|
||||
|
||||
private static DoubleDoors singleton = null;
|
||||
|
||||
private List<DoubleDoors> doors = new ArrayList<DoubleDoors>();
|
||||
private static DoubleDoors singleton = null;
|
||||
|
||||
private File doorFile;
|
||||
|
||||
public static DoubleDoors getSingleton() {
|
||||
if (singleton == null) {
|
||||
singleton = new DoubleDoors("./data/doubledoors.txt");
|
||||
}
|
||||
return singleton;
|
||||
}
|
||||
private final List<DoubleDoors> doors = new ArrayList<>();
|
||||
|
||||
private DoubleDoors(String file){
|
||||
doorFile = new File(file);
|
||||
}
|
||||
|
||||
private DoubleDoors getDoor(int id, int x, int y, int z) {
|
||||
for (DoubleDoors d : doors) {
|
||||
if (d.doorId == id) {
|
||||
if (d.x == x && d.y == y && d.z == z) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean handleDoor(Player player, int id, int x, int y, int z) {
|
||||
DoubleDoors doorClicked = getDoor(id, x, y, z);
|
||||
private File doorFile;
|
||||
|
||||
if (doorClicked == null) {
|
||||
//System.out.println("Door: " + id + " null debug at x: " + x + " y: " + y + ".");
|
||||
//GameEngine.objectHandler.placeObject(new Objects(-1, x, y, z, 0, 0, 0));
|
||||
return true;
|
||||
}
|
||||
if (doorClicked.doorId > 15000) {
|
||||
// System.out.println("Door: " + id + " clicking debug x: " + x + " y: " + y + ".");
|
||||
return true; //nearly all of these are not opened
|
||||
}
|
||||
public static DoubleDoors getSingleton() {
|
||||
if (singleton == null) {
|
||||
singleton = new DoubleDoors(System.getProperty("user.dir") + "/data/doubledoors.json");
|
||||
}
|
||||
return singleton;
|
||||
}
|
||||
|
||||
//Region.removeClipping(x, y, z);
|
||||
private DoubleDoors(String file) {
|
||||
doorFile = new File(file);
|
||||
}
|
||||
|
||||
if (doorClicked.open == 0) {
|
||||
if (doorClicked.originalFace == 0) {
|
||||
DoubleDoors lowerDoor = getDoor(id - 3, x, y -1, z);
|
||||
DoubleDoors upperDoor = getDoor(id + 3, x, y +1, z);
|
||||
if (lowerDoor != null) {
|
||||
changeLeftDoor(lowerDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (upperDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(upperDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 1) {
|
||||
DoubleDoors westDoor = getDoor(id - 3, x -1, y, z);
|
||||
DoubleDoors eastDoor = getDoor(id + 3, x +1, y, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (eastDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(eastDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 2) {
|
||||
DoubleDoors lowerDoor = getDoor(id - 3, x, y +1, z);
|
||||
DoubleDoors upperDoor = getDoor(id + 3, x, y -1, z);
|
||||
if (lowerDoor != null) {
|
||||
changeLeftDoor(lowerDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (upperDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(upperDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 3) {
|
||||
DoubleDoors westDoor = getDoor(id + 3, x -1, y, z);
|
||||
DoubleDoors eastDoor = getDoor(id - 3, x +1, y, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (eastDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(eastDoor);
|
||||
}
|
||||
}
|
||||
} else if (doorClicked.open == 1) {
|
||||
if (doorClicked.originalFace == 0) {
|
||||
DoubleDoors westDoor = getDoor(id - 3, x -1, y, z);
|
||||
DoubleDoors upperDoor = getDoor(id + 3, x +1, y, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (upperDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(upperDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 1) {
|
||||
DoubleDoors northDoor = getDoor(id - 3, x, y + 1, z);
|
||||
DoubleDoors southDoor = getDoor(id + 3, x, y -1, z);
|
||||
if (northDoor != null) {
|
||||
changeLeftDoor(northDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (southDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(southDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 2) {
|
||||
DoubleDoors westDoor = getDoor(id - 3, x -1, y, z);
|
||||
DoubleDoors eastDoor = getDoor(id + 3, x, y -1, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (eastDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(eastDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 3) {
|
||||
DoubleDoors northDoor = getDoor(id - 3, x, y + 1, z);
|
||||
DoubleDoors southDoor = getDoor(id + 3, x, y -1, z);
|
||||
if (northDoor != null) {
|
||||
changeLeftDoor(northDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (southDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(southDoor);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private DoubleDoors getDoor(int id, int x, int y, int z) {
|
||||
for (DoubleDoors d : doors) {
|
||||
if (d.doorId == id) {
|
||||
if (d.x == x && d.y == y && d.z == z) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void changeLeftDoor(DoubleDoors d) {
|
||||
int xAdjustment = 0, yAdjustment = 0;
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = +1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
yAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
yAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
if (xAdjustment != 0 || yAdjustment != 0) {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
}
|
||||
if (d.x == d.originalX && d.y == d.originalY) {
|
||||
d.x += xAdjustment;
|
||||
d.y += yAdjustment;
|
||||
} else {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
d.x = d.originalX;
|
||||
d.y = d.originalY;
|
||||
}
|
||||
if (d.doorId == d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId += 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId -= 1;
|
||||
}
|
||||
} else if (d.doorId != d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId = d.originalId;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId = d.originalId;
|
||||
}
|
||||
}
|
||||
GameEngine.objectHandler.placeObject(new Objects(d.doorId, d.x, d.y, d.z, getNextLeftFace(d), 0, 0));
|
||||
}
|
||||
|
||||
private int getNextLeftFace(DoubleDoors d) {
|
||||
int f = d.originalFace;
|
||||
public boolean handleDoor(Player player, int id, int x, int y, int z) {
|
||||
DoubleDoors doorClicked = getDoor(id, x, y, z);
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 0;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
d.currentFace = f;
|
||||
return f;
|
||||
}
|
||||
|
||||
public void changeRightDoor(DoubleDoors d) {
|
||||
int xAdjustment = 0, yAdjustment = 0;
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = +1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
yAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
yAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
if (xAdjustment != 0 || yAdjustment != 0) {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
}
|
||||
if (d.x == d.originalX && d.y == d.originalY) {
|
||||
d.x += xAdjustment;
|
||||
d.y += yAdjustment;
|
||||
} else {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
d.x = d.originalX;
|
||||
d.y = d.originalY;
|
||||
}
|
||||
if (d.doorId == d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId += 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId -= 1;
|
||||
}
|
||||
} else if (d.doorId != d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId = d.originalId;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId = d.originalId;
|
||||
}
|
||||
}
|
||||
GameEngine.objectHandler.placeObject(new Objects(d.doorId, d.x, d.y, d.z, getNextRightFace(d), 0, 0));
|
||||
}
|
||||
|
||||
private int getNextRightFace(DoubleDoors d) {
|
||||
int f = d.originalFace;
|
||||
if (doorClicked == null) {
|
||||
//System.out.println("Door: " + id + " null debug at x: " + x + " y: " + y + ".");
|
||||
//GameEngine.objectHandler.placeObject(new Objects(-1, x, y, z, 0, 0, 0));
|
||||
return true;
|
||||
}
|
||||
if (doorClicked.doorId > 15000) {
|
||||
// System.out.println("Door: " + id + " clicking debug x: " + x + " y: " + y + ".");
|
||||
return true; //nearly all of these are not opened
|
||||
}
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
//Region.removeClipping(x, y, z);
|
||||
|
||||
if (doorClicked.open == 0) {
|
||||
if (doorClicked.originalFace == 0) {
|
||||
DoubleDoors lowerDoor = getDoor(id - 3, x, y - 1, z);
|
||||
DoubleDoors upperDoor = getDoor(id + 3, x, y + 1, z);
|
||||
if (lowerDoor != null) {
|
||||
changeLeftDoor(lowerDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (upperDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(upperDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 1) {
|
||||
DoubleDoors westDoor = getDoor(id - 3, x - 1, y, z);
|
||||
DoubleDoors eastDoor = getDoor(id + 3, x + 1, y, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (eastDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(eastDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 2) {
|
||||
DoubleDoors lowerDoor = getDoor(id - 3, x, y + 1, z);
|
||||
DoubleDoors upperDoor = getDoor(id + 3, x, y - 1, z);
|
||||
if (lowerDoor != null) {
|
||||
changeLeftDoor(lowerDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (upperDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(upperDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 3) {
|
||||
DoubleDoors westDoor = getDoor(id + 3, x - 1, y, z);
|
||||
DoubleDoors eastDoor = getDoor(id - 3, x + 1, y, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (eastDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(eastDoor);
|
||||
}
|
||||
}
|
||||
} else if (doorClicked.open == 1) {
|
||||
if (doorClicked.originalFace == 0) {
|
||||
DoubleDoors westDoor = getDoor(id - 3, x - 1, y, z);
|
||||
DoubleDoors upperDoor = getDoor(id + 3, x + 1, y, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (upperDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(upperDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 1) {
|
||||
DoubleDoors northDoor = getDoor(id - 3, x, y + 1, z);
|
||||
DoubleDoors southDoor = getDoor(id + 3, x, y - 1, z);
|
||||
if (northDoor != null) {
|
||||
changeLeftDoor(northDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (southDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(southDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 2) {
|
||||
DoubleDoors westDoor = getDoor(id - 3, x - 1, y, z);
|
||||
DoubleDoors eastDoor = getDoor(id + 3, x, y - 1, z);
|
||||
if (westDoor != null) {
|
||||
changeLeftDoor(westDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (eastDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(eastDoor);
|
||||
}
|
||||
} else if (doorClicked.originalFace == 3) {
|
||||
DoubleDoors northDoor = getDoor(id - 3, x, y + 1, z);
|
||||
DoubleDoors southDoor = getDoor(id + 3, x, y - 1, z);
|
||||
if (northDoor != null) {
|
||||
changeLeftDoor(northDoor);
|
||||
changeRightDoor(doorClicked);
|
||||
} else if (southDoor != null) {
|
||||
changeLeftDoor(doorClicked);
|
||||
changeRightDoor(southDoor);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void changeLeftDoor(DoubleDoors d) {
|
||||
int xAdjustment = 0, yAdjustment = 0;
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = +1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
yAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
yAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
if (xAdjustment != 0 || yAdjustment != 0) {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
}
|
||||
if (d.x == d.originalX && d.y == d.originalY) {
|
||||
d.x += xAdjustment;
|
||||
d.y += yAdjustment;
|
||||
} else {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
d.x = d.originalX;
|
||||
d.y = d.originalY;
|
||||
}
|
||||
if (d.doorId == d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId += 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId -= 1;
|
||||
}
|
||||
} else if (d.doorId != d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId = d.originalId;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId = d.originalId;
|
||||
}
|
||||
}
|
||||
GameEngine.objectHandler.placeObject(new Objects(d.doorId, d.x, d.y, d.z, getNextLeftFace(d), 0, 0));
|
||||
}
|
||||
|
||||
private int getNextLeftFace(DoubleDoors d) {
|
||||
int f = d.originalFace;
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 0;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
d.currentFace = f;
|
||||
return f;
|
||||
}
|
||||
|
||||
public void changeRightDoor(DoubleDoors d) {
|
||||
int xAdjustment = 0, yAdjustment = 0;
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
yAdjustment = 1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
xAdjustment = +1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
yAdjustment = -1;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
xAdjustment = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
xAdjustment = -1;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
yAdjustment = -1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
xAdjustment = -1;
|
||||
}
|
||||
}
|
||||
if (xAdjustment != 0 || yAdjustment != 0) {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
}
|
||||
if (d.x == d.originalX && d.y == d.originalY) {
|
||||
d.x += xAdjustment;
|
||||
d.y += yAdjustment;
|
||||
} else {
|
||||
GameEngine.objectHandler.placeObject(new Objects(-1, d.x, d.y, d.z, 0, 0, 0));
|
||||
d.x = d.originalX;
|
||||
d.y = d.originalY;
|
||||
}
|
||||
if (d.doorId == d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId += 1;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId -= 1;
|
||||
}
|
||||
} else if (d.doorId != d.originalId) {
|
||||
if (d.open == 0) {
|
||||
d.doorId = d.originalId;
|
||||
} else if (d.open == 1) {
|
||||
d.doorId = d.originalId;
|
||||
}
|
||||
}
|
||||
GameEngine.objectHandler.placeObject(new Objects(d.doorId, d.x, d.y, d.z, getNextRightFace(d), 0, 0));
|
||||
}
|
||||
|
||||
private int getNextRightFace(DoubleDoors d) {
|
||||
int f = d.originalFace;
|
||||
|
||||
if (d.open == 0) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 2;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace) {
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
d.currentFace = f;
|
||||
return f;
|
||||
}
|
||||
|
||||
private int doorId;
|
||||
private int originalId;
|
||||
private int open;
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int originalX;
|
||||
private int originalY;
|
||||
private int currentFace;
|
||||
private int originalFace;
|
||||
|
||||
public DoubleDoors(int id, int x, int y, int z, int f, int open) {
|
||||
this.doorId = id;
|
||||
this.originalId = id;
|
||||
this.open = open;
|
||||
this.x = x;
|
||||
this.originalX = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.originalY = y;
|
||||
this.currentFace = f;
|
||||
this.originalFace = f;
|
||||
}
|
||||
|
||||
public boolean isOpenDoor(int id) {
|
||||
for (int openDoor : OPEN_DOORS) {
|
||||
if (id == openDoor || id + 3 == openDoor) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//Have not found any others yet. Maybe only 1 type of double
|
||||
//doors exist to operate.
|
||||
private static final int[] OPEN_DOORS = {
|
||||
1520, 1517
|
||||
};
|
||||
|
||||
public void load() {
|
||||
Gson gson = new Gson();
|
||||
long start = System.currentTimeMillis();
|
||||
try {
|
||||
Type collectionType = new TypeToken<DoorData[]>() {
|
||||
}.getType();
|
||||
DoorData[] doorData = gson.fromJson(new FileReader(doorFile), collectionType);
|
||||
|
||||
for (DoorData data : doorData) {
|
||||
for (DoorData.Location location : data.getLocations()) {
|
||||
doors.add(new DoubleDoors(data.getId(), location.getX(), location.getY(), location.getHeight(), data.getFace(), isOpenDoor(data.getId()) ? 1 : 0));
|
||||
}
|
||||
}
|
||||
|
||||
//singleton.writeJsonDump();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("Loaded "+ doors.size() +" Double doors in "+ (System.currentTimeMillis() - start) +"ms.");
|
||||
}
|
||||
|
||||
private void writeJsonDump() throws FileNotFoundException {
|
||||
try (Scanner scanner = new Scanner(new FileReader(doorFile))) {
|
||||
while (scanner.hasNextLine()) {
|
||||
processLine(scanner.nextLine());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void processLine(String line) {
|
||||
JSONArray array = new JSONArray();
|
||||
Scanner scanner = new Scanner(line);
|
||||
scanner.useDelimiter(" ");
|
||||
try {
|
||||
while (scanner.hasNextLine()) {
|
||||
int id = Integer.parseInt(scanner.next());
|
||||
int x = Integer.parseInt(scanner.next());
|
||||
int y = Integer.parseInt(scanner.next());
|
||||
int f = Integer.parseInt(scanner.next());
|
||||
int z = Integer.parseInt(scanner.next());
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
object.put("id", id);
|
||||
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
JSONObject object1 = new JSONObject();
|
||||
object1.put("x", x);
|
||||
object1.put("y", y);
|
||||
object1.put("height", z);
|
||||
jsonArray.put(0, object1);
|
||||
object.put("locations", jsonArray);
|
||||
|
||||
object.put("face", f);
|
||||
|
||||
array.put(object);
|
||||
}
|
||||
} finally {
|
||||
scanner.close();
|
||||
|
||||
try {
|
||||
FileWriter fileWriter = new FileWriter("doubledoors-dump.json");
|
||||
fileWriter.write(array.toString());
|
||||
|
||||
System.out.println(array.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (d.open == 1) {
|
||||
if (d.originalFace == 0 && d.currentFace == 0) {
|
||||
f = 3;
|
||||
} else if (d.originalFace == 1 && d.currentFace == 1) {
|
||||
f = 0;
|
||||
} else if (d.originalFace == 2 && d.currentFace == 2) {
|
||||
f = 1;
|
||||
} else if (d.originalFace == 3 && d.currentFace == 3) {
|
||||
f = 2;
|
||||
} else if (d.originalFace != d.currentFace){
|
||||
f = d.originalFace;
|
||||
}
|
||||
}
|
||||
d.currentFace = f;
|
||||
return f;
|
||||
}
|
||||
|
||||
private int doorId;
|
||||
private int originalId;
|
||||
private int open;
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int originalX;
|
||||
private int originalY;
|
||||
private int currentFace;
|
||||
private int originalFace;
|
||||
|
||||
public DoubleDoors(int id, int x, int y, int z, int f, int open) {
|
||||
this.doorId = id;
|
||||
this.originalId = id;
|
||||
this.open = open;
|
||||
this.x = x;
|
||||
this.originalX = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.originalY = y;
|
||||
this.currentFace = f;
|
||||
this.originalFace = f;
|
||||
}
|
||||
|
||||
public boolean isOpenDoor(int id){
|
||||
for (int i = 0; i < openDoors.length; i++) {
|
||||
if (id == openDoors[i] || id + 3 == openDoors[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//Have not found any others yet. Maybe only 1 type of double
|
||||
//doors exist to operate.
|
||||
private static int[] openDoors = {
|
||||
1520, 1517
|
||||
};
|
||||
|
||||
public void load() {
|
||||
//long start = System.currentTimeMillis();
|
||||
try {
|
||||
singleton.processLineByLine();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//System.out.println("Loaded "+ doors.size() +" Double doors in "+ (System.currentTimeMillis() - start) +"ms.");
|
||||
}
|
||||
|
||||
private final void processLineByLine() throws FileNotFoundException {
|
||||
Scanner scanner = new Scanner(new FileReader(doorFile));
|
||||
try {
|
||||
while(scanner.hasNextLine()) {
|
||||
processLine(scanner.nextLine());
|
||||
}
|
||||
} finally {
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
|
||||
protected void processLine(String line){
|
||||
Scanner scanner = new Scanner(line);
|
||||
scanner.useDelimiter(" ");
|
||||
try {
|
||||
while(scanner.hasNextLine()) {
|
||||
int id = Integer.parseInt(scanner.next());
|
||||
int x = Integer.parseInt(scanner.next());
|
||||
int y = Integer.parseInt(scanner.next());
|
||||
int f = Integer.parseInt(scanner.next());
|
||||
int z = Integer.parseInt(scanner.next());
|
||||
doors.add(new DoubleDoors(id, x, y, z, f, isOpenDoor(id) ? 1 : 0));
|
||||
}
|
||||
} finally {
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,8 @@ package com.rebotted.game.npcs.drops;
|
||||
|
||||
import com.rebotted.util.Misc;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ItemDrop {
|
||||
public int item_id, chance;
|
||||
public int[] amounts;
|
||||
@@ -29,4 +31,13 @@ public class ItemDrop {
|
||||
public int getAmount(){
|
||||
return Misc.random(this.amounts[0], this.amounts[1]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ItemDrop{" +
|
||||
"item_id=" + item_id +
|
||||
", chance=" + chance +
|
||||
", amounts=" + Arrays.toString(amounts) +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+79
-232
@@ -1,250 +1,97 @@
|
||||
package com.rebotted.game.npcs.drops;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.rebotted.GameEngine;
|
||||
import com.rebotted.game.items.ItemList;
|
||||
import com.rebotted.util.Misc;
|
||||
import com.rebotted.util.NpcDrop;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
|
||||
/**
|
||||
* Npc Drops Handler
|
||||
* @author Andrew (Mr Extremez)
|
||||
*
|
||||
* @author Andrew (Mr Extremez), SandroC
|
||||
*/
|
||||
|
||||
public class NPCDropsHandler {
|
||||
private static NpcDrop[] npcDrops;
|
||||
|
||||
public static int // found on http://runescape.wikia.com/wiki/Drop_rate
|
||||
ALWAYS = 0,
|
||||
COINSRATE = 3,
|
||||
COMMON = 32,
|
||||
UNCOMMON = 64,
|
||||
RARE = 256,
|
||||
VERY_RARE = 512;
|
||||
/*public static int // found on http://runescape.wikia.com/wiki/Drop rate
|
||||
ALWAYS = 0,
|
||||
COINSRATE = 3,
|
||||
COMMON = 32,
|
||||
UNCOMMON = 64,
|
||||
RARE = 256,
|
||||
VERY_RARE = 512;*/
|
||||
|
||||
/**
|
||||
* Handles the npc drops for the npc names.
|
||||
*
|
||||
* @param NPCId
|
||||
* @return
|
||||
*/
|
||||
public static final ItemDrop[] NPC_DROPS(String npc, int NPCId) {
|
||||
if (npc.equals("man") || npc.equals("woman") || npc.equals("drunken_man")) {
|
||||
return NPCDrops.man;
|
||||
} else if (npc.equals("skeletal_wyvern")) {
|
||||
return NPCDrops.wyvern;
|
||||
} else if (npc.equals("dark_beast")) {
|
||||
return NPCDrops.darkbeast;
|
||||
} else if (npc.equals("shade")) {
|
||||
return NPCDrops.shade;
|
||||
} else if (npc.equals("watchman")) {
|
||||
return NPCDrops.watchman;
|
||||
} else if (npc.equals("river_troll")) {
|
||||
return NPCDrops.rivertroll;
|
||||
} else if (npc.equals("cave_crawler")) {
|
||||
return NPCDrops.cavecrawler;
|
||||
} else if (npc.equals("thief")) {
|
||||
return NPCDrops.thief;
|
||||
} else if (npc.equals("tzhaar-xil") || npc.equals("Tzhaar-Xil")) {
|
||||
return NPCDrops.tzhaarxil;
|
||||
} else if (npc.equals("tzhaar-ket") || npc.equals("Tzhaar-Ket")) {
|
||||
return NPCDrops.tzhaarket;
|
||||
} else if (npc.equals("tzhaar-hur") || npc.equals("Tzhaar-Hur")) {
|
||||
return NPCDrops.tzhaarhur;
|
||||
} else if (npc.equals("tzhaar-mej") || npc.equals("Tzhaar-Mej")) {
|
||||
return NPCDrops.tzhaarmej;
|
||||
} else if (npc.equals("tree_spirit")) {
|
||||
return NPCDrops.treespirit;
|
||||
} else if (npc.equals("unicorn")) {
|
||||
return NPCDrops.unicorn;
|
||||
} else if (npc.equals("evil_chicken")) {
|
||||
return NPCDrops.evilchicken;
|
||||
} else if (npc.equals("white_knight")) {
|
||||
return NPCDrops.whiteknight;
|
||||
} else if (npc.equals("black_knight")) {
|
||||
return NPCDrops.blackknight;
|
||||
} else if (npc.equals("bear")) {
|
||||
return NPCDrops.bear;
|
||||
} else if (npc.equals("jogre")) {
|
||||
return NPCDrops.jogre;
|
||||
} else if (npc.equals("ogre")) {
|
||||
return NPCDrops.ogre;
|
||||
} else if (npc.equals("chaos_druid")) {
|
||||
return NPCDrops.chaosdruid;
|
||||
} else if (npc.equals("jailer")) {
|
||||
return NPCDrops.jailer;
|
||||
} else if (npc.equals("fire_giant") || npc.equals("Fire_giant")) {
|
||||
return NPCDrops.firegiant;
|
||||
} else if (npc.equals("basilisk")) {
|
||||
return NPCDrops.basilisk;
|
||||
} else if (npc.equals("baby_blue_dragon") || npc.equals("baby_red_dragon") || npc.equals("baby_dragon")) {
|
||||
return NPCDrops.babybluedragon;
|
||||
} else if (npc.equals("red_dragon")) {
|
||||
return NPCDrops.reddragon;
|
||||
} else if (npc.equals("elf_warrior")) {
|
||||
return NPCDrops.elfwarrior;
|
||||
} else if (npc.equals("dagannoth")) {
|
||||
return NPCDrops.dagannoth;
|
||||
} else if (npc.equals("giant_mole")) {
|
||||
return NPCDrops.giantmole;
|
||||
} else if (npc.equals("dagannoth_supreme")) {
|
||||
return NPCDrops.dagannothsupereme;
|
||||
} else if (npc.equals("chaos_elemental")) {
|
||||
return NPCDrops.chaoselemental;
|
||||
} else if (npc.equals("dagannoth_prime")) {
|
||||
return NPCDrops.dagannothprime;
|
||||
} else if (npc.equals("dagannoth_rex")) {
|
||||
return NPCDrops.daggannothrex;
|
||||
} else if (npc.equals("monkey_guard")) {
|
||||
return NPCDrops.monkeyguard;
|
||||
} else if (npc.equals("monk")) {
|
||||
return NPCDrops.monk;
|
||||
} else if (npc.equals("abyssal_demon")) {
|
||||
return NPCDrops.abyssaldemon;
|
||||
} else if (npc.equals("pyrefiend")) {
|
||||
return NPCDrops.pyrefiend;
|
||||
} else if (npc.equals("aberrant_spectre")
|
||||
|| npc.equals("aberrant_specter")
|
||||
|| npc.equals("aberant_specter")) {
|
||||
return NPCDrops.abberantspectre;
|
||||
} else if (npc.equals("earth_warrior")) {
|
||||
return NPCDrops.earthwarrior;
|
||||
} else if (npc.equals("gargoyle")) {
|
||||
return NPCDrops.gargoyle;
|
||||
} else if (npc.equals("dust_devil") || npc.equals("dustdevil")) {
|
||||
return NPCDrops.dustdevil;
|
||||
} else if (npc.equals("cockatrice")) {
|
||||
return NPCDrops.cockatrice;
|
||||
} else if (npc.equals("infernal_mage")) {
|
||||
return NPCDrops.infernalmage;
|
||||
} else if (npc.equals("nechryael")) {
|
||||
return NPCDrops.nechryael;
|
||||
} else if (npc.equals("bloodveld")) {
|
||||
return NPCDrops.bloodveld;
|
||||
} else if (npc.equals("turoth")) {
|
||||
return NPCDrops.turoth;
|
||||
} else if (npc.equals("banshee")) {
|
||||
return NPCDrops.banshee;
|
||||
} else if (npc.equals("crawling_hand")) {
|
||||
return NPCDrops.crawlinghand;
|
||||
} else if (npc.equals("highwayman")) {
|
||||
return NPCDrops.highwayman;
|
||||
} else if (npc.equals("wild_dog") || npc.equals("battle_mage")) {
|
||||
return NPCDrops.alwaysbones;
|
||||
} else if (npc.equals("kalphite_queen")) {
|
||||
return NPCDrops.kalphitequeen;
|
||||
} else if (npc.equals("kalphite_worker")) {
|
||||
return NPCDrops.kalphiteworker;
|
||||
} else if (npc.equals("kalphite_soldier")) {
|
||||
return NPCDrops.kalphitesoldier;
|
||||
} else if (npc.equals("kalphite_guardian")) {
|
||||
return NPCDrops.kalphiteguardian;
|
||||
} else if (npc.equals("bat") || npc.equals("giant_bat")) {
|
||||
return NPCDrops.bat;
|
||||
} else if (npc.equals("bronze_dragon")) {
|
||||
return NPCDrops.bronzedragon;
|
||||
} else if (npc.equals("black_dragon")) {
|
||||
return NPCDrops.blackdragon;
|
||||
} else if (npc.equals("iron_dragon")) {
|
||||
return NPCDrops.irondragon;
|
||||
} else if (npc.equals("steel_dragon")) {
|
||||
return NPCDrops.steeldragon;
|
||||
} else if (npc.equals("moss_giant")) {
|
||||
return NPCDrops.mossgiant;
|
||||
} else if (npc.equals("greater_demon")) {
|
||||
return NPCDrops.greaterdemon;
|
||||
} else if (npc.equals("black_demon")) {
|
||||
return NPCDrops.blackdemon;
|
||||
} else if (npc.equals("dwarf")) {
|
||||
return NPCDrops.dwarf;
|
||||
} else if (npc.equals("jelly")) {
|
||||
return NPCDrops.jelly;
|
||||
} else if (npc.equals("rock_crab")) {
|
||||
return NPCDrops.rockcrab;
|
||||
} else if (npc.equals("rockslug")) {
|
||||
return NPCDrops.rockslug;
|
||||
} else if (npc.equals("king_black_dragon")) {
|
||||
return NPCDrops.kingblackdragon;
|
||||
} else if (npc.equals("green_dragon")) {
|
||||
return NPCDrops.greendragon;
|
||||
} else if (npc.equals("blue_dragon")) {
|
||||
return NPCDrops.bluedragon;
|
||||
} else if (npc.equals("goblin")) {
|
||||
return NPCDrops.goblin;
|
||||
} else if (npc.equals("lesser_demon") || npc.equals("Lesser_demon")
|
||||
|| npc.equals("lesserdemon")) {
|
||||
return NPCDrops.lesserdemon;
|
||||
} else if (npc.equals("guard") || npc.equals("jail_guard")) {
|
||||
return NPCDrops.guard;
|
||||
} else if (npc.equals("al-kharid_warrior")) {
|
||||
return NPCDrops.alkharidwarrior;
|
||||
} else if (npc.equals("ice_warrior")) {
|
||||
return NPCDrops.icewarrior;
|
||||
} else if (npc.equals("kurask")) {
|
||||
return NPCDrops.kurask;
|
||||
} else if (npc.equals("ice_giant")) {
|
||||
return NPCDrops.icegiant;
|
||||
} else if (npc.equals("hobgoblin")) {
|
||||
return NPCDrops.hobgoblin;
|
||||
} else if (npc.equals("pirate")) {
|
||||
return NPCDrops.pirate;
|
||||
} else if (npc.equals("zombie")) {
|
||||
return NPCDrops.zombie;
|
||||
} else if (npc.equals("skeleton")) {
|
||||
return NPCDrops.skeleton;
|
||||
} else if (npc.equals("deadly_red_spider")) {
|
||||
return NPCDrops.deadlyredspider;
|
||||
} else if (npc.equals("rat")) {
|
||||
return NPCDrops.rat;
|
||||
} else if (npc.equals("imp")) {
|
||||
return NPCDrops.imp;
|
||||
} else if (npc.equals("cow") || npc.equals("cow_calf")) {
|
||||
return NPCDrops.cow;
|
||||
} else if (npc.equals("chicken") || npc.equals("rooster")) {
|
||||
return NPCDrops.chicken;
|
||||
} else if (npc.equals("hill_giant")) {
|
||||
return NPCDrops.hillgiant;
|
||||
} else if (npc.equals("giant_rat")) {
|
||||
return NPCDrops.giantrat;
|
||||
} else if (npc.equals("dark_wizard")) {
|
||||
return NPCDrops.darkwizard;
|
||||
} else {
|
||||
return NPCDrops.DEFAULT;
|
||||
}
|
||||
}
|
||||
public static void loadItemDropData() {
|
||||
try {
|
||||
npcDrops = new Gson().fromJson(new FileReader("./data/cfg/npcdrops.json"), NpcDrop[].class);
|
||||
} catch (FileNotFoundException fileex) {
|
||||
Misc.println("npcdrops.json: file not found.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item name
|
||||
*
|
||||
* @param ItemID
|
||||
* @return
|
||||
*/
|
||||
public static int i(String ItemName) {
|
||||
return getItemId(ItemName);
|
||||
}
|
||||
/**
|
||||
* Handles the npc drops for the npc id.
|
||||
*
|
||||
* @param npcId id of the npc
|
||||
*
|
||||
* @return Items dropped by that npc
|
||||
*/
|
||||
public static ItemDrop[] getNpcDrops(String npc, int npcId) {
|
||||
for (NpcDrop npcDrop : npcDrops) {
|
||||
if (npcDrop.getId() == npcId) {
|
||||
return npcDrop.getItems();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Item name main method
|
||||
*
|
||||
* @param itemName
|
||||
* @return
|
||||
*/
|
||||
public static int getItemId(String itemName) {
|
||||
for (ItemList i : GameEngine.itemHandler.itemList) {
|
||||
if (i != null) {
|
||||
if (i.itemName.equalsIgnoreCase(itemName)) {
|
||||
return i.itemId;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return new ItemDrop[]{
|
||||
new ItemDrop(i("bones"), 1, 0),
|
||||
new ItemDrop(995, new int[]{ 1, 10 }, 3),
|
||||
new ItemDrop(2677, 1, 512) };
|
||||
}
|
||||
|
||||
/**
|
||||
* Misc.random in shorter form
|
||||
*
|
||||
* @param random
|
||||
* @return
|
||||
*/
|
||||
public static int r(int random) {
|
||||
return Misc.random(random);
|
||||
}
|
||||
/**
|
||||
* short version of getItemId
|
||||
*
|
||||
* @param itemName name of the item
|
||||
*
|
||||
* @return itemId
|
||||
*/
|
||||
public static int i(String itemName) {
|
||||
return getItemId(itemName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Item id main method
|
||||
*
|
||||
* @param itemName name of the item
|
||||
*
|
||||
* @return itemId
|
||||
*/
|
||||
public static int getItemId(String itemName) {
|
||||
for (ItemList i : GameEngine.itemHandler.itemList) {
|
||||
if (i != null) {
|
||||
if (i.itemName.equalsIgnoreCase(itemName)) {
|
||||
return i.itemId;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Misc.random in shorter form
|
||||
*
|
||||
* @param max max number
|
||||
*
|
||||
* @return random number from 0->max
|
||||
*/
|
||||
public static int r(int max) {
|
||||
return Misc.random(max);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,249 +1,294 @@
|
||||
package com.rebotted.game.shops;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.rebotted.game.players.Client;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.game.players.PlayerHandler;
|
||||
import com.rebotted.util.Misc;
|
||||
import com.rebotted.util.ShopData;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
public class ShopHandler {
|
||||
|
||||
public static int MAX_SHOPS = 800;
|
||||
|
||||
public static int MAX_SHOP_ITEMS = 40;
|
||||
|
||||
public static int SHOW_DELAY = 1; // Restock 1 item every tick
|
||||
|
||||
public static int SPECIAL_DELAY = 60; // Remove overstocked items after 60 ticks
|
||||
|
||||
public static int totalshops = 0;
|
||||
|
||||
public static int[][] shopItems = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[][] shopItemsN = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[][] shopItemsDelay = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[][] shopItemsSN = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[] shopItemsStandard = new int[MAX_SHOPS];
|
||||
|
||||
public static String[] shopName = new String[MAX_SHOPS];
|
||||
|
||||
public static int[] shopSModifier = new int[MAX_SHOPS];
|
||||
|
||||
public static int[] shopBModifier = new int[MAX_SHOPS];
|
||||
|
||||
public static long[][] shopItemsRestock = new long[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
public static int MAX_SHOPS = 800;
|
||||
|
||||
public ShopHandler() {
|
||||
for (int i = 0; i < MAX_SHOPS; i++) {
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
ResetItem(i, j);
|
||||
shopItemsSN[i][j] = 0;
|
||||
public static int MAX_SHOP_ITEMS = 40;
|
||||
|
||||
public static int SHOW_DELAY = 1; // Restock 1 item every tick
|
||||
|
||||
public static int SPECIAL_DELAY = 60; // Remove overstocked items after 60 ticks
|
||||
|
||||
public static int totalshops = 0;
|
||||
|
||||
public static int[][] shopItems = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[][] shopItemsN = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[][] shopItemsDelay = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[][] shopItemsSN = new int[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public static int[] shopItemsStandard = new int[MAX_SHOPS];
|
||||
|
||||
public static String[] shopName = new String[MAX_SHOPS];
|
||||
|
||||
public static int[] shopSModifier = new int[MAX_SHOPS];
|
||||
|
||||
public static int[] shopBModifier = new int[MAX_SHOPS];
|
||||
|
||||
public static long[][] shopItemsRestock = new long[MAX_SHOPS][MAX_SHOP_ITEMS];
|
||||
|
||||
public ShopHandler() {
|
||||
for (int i = 0; i < MAX_SHOPS; i++) {
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
ResetItem(i, j);
|
||||
shopItemsSN[i][j] = 0;
|
||||
}
|
||||
shopItemsStandard[i] = 0;
|
||||
shopSModifier[i] = 0;
|
||||
shopBModifier[i] = 0;
|
||||
shopName[i] = "";
|
||||
}
|
||||
totalshops = 0;
|
||||
//writeShops("shops.cfg");
|
||||
loadShops();
|
||||
}
|
||||
|
||||
public static int restockTimeItem(int itemId) {
|
||||
switch (itemId) {
|
||||
default:
|
||||
return 1000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void process() {
|
||||
boolean DidUpdate = false;
|
||||
for (int i = 1; i <= totalshops; i++) {
|
||||
if (shopBModifier[i] == 0 || shopSModifier[i] == 0) {
|
||||
continue;
|
||||
}
|
||||
shopItemsStandard[i] = 0;
|
||||
shopSModifier[i] = 0;
|
||||
shopBModifier[i] = 0;
|
||||
shopName[i] = "";
|
||||
}
|
||||
totalshops = 0;
|
||||
loadshops("shops.cfg");
|
||||
}
|
||||
|
||||
public static int restockTimeItem(int itemId) {
|
||||
switch(itemId) {
|
||||
default:
|
||||
return 1000;
|
||||
}
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItems[i][j] > 0) {
|
||||
if (shopItemsDelay[i][j] >= SHOW_DELAY) {
|
||||
if (j <= shopItemsStandard[i] && shopItemsN[i][j] <= shopItemsSN[i][j]) {
|
||||
if (shopItemsN[i][j] < shopItemsSN[i][j] && System.currentTimeMillis() - shopItemsRestock[i][j] > restockTimeItem(shopItems[i][j])) {
|
||||
shopItemsN[i][j] += 1;
|
||||
shopItemsDelay[i][j] = 1;
|
||||
shopItemsDelay[i][j] = 0;
|
||||
DidUpdate = true;
|
||||
shopItemsRestock[i][j] = System.currentTimeMillis();
|
||||
}
|
||||
} else if (shopItemsDelay[i][j] >= SPECIAL_DELAY) {
|
||||
DiscountItem(i, j);
|
||||
shopItemsDelay[i][j] = 0;
|
||||
DidUpdate = true;
|
||||
}
|
||||
refreshshop(i);
|
||||
}
|
||||
shopItemsDelay[i][j]++;
|
||||
}
|
||||
}
|
||||
if (DidUpdate) {
|
||||
for (int k = 1; k < PlayerHandler.players.length; k++) {
|
||||
if (PlayerHandler.players[k] != null) {
|
||||
if (PlayerHandler.players[k].isShopping && PlayerHandler.players[k].shopId == i) {
|
||||
PlayerHandler.players[k].updateShop = true;
|
||||
PlayerHandler.players[k].updateShop(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
DidUpdate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void process() {
|
||||
boolean DidUpdate = false;
|
||||
for (int i = 1; i <= totalshops; i++) {
|
||||
if (shopBModifier[i] == 0 || shopSModifier[i] == 0) continue;
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItems[i][j] > 0) {
|
||||
if (shopItemsDelay[i][j] >= SHOW_DELAY) {
|
||||
if (j <= shopItemsStandard[i] && shopItemsN[i][j] <= shopItemsSN[i][j]) {
|
||||
if (shopItemsN[i][j] < shopItemsSN[i][j] && System.currentTimeMillis() - shopItemsRestock[i][j] > restockTimeItem(shopItems[i][j])) {
|
||||
shopItemsN[i][j] += 1;
|
||||
shopItemsDelay[i][j] = 1;
|
||||
shopItemsDelay[i][j] = 0;
|
||||
DidUpdate = true;
|
||||
shopItemsRestock[i][j] = System.currentTimeMillis();
|
||||
}
|
||||
} else if (shopItemsDelay[i][j] >= SPECIAL_DELAY) {
|
||||
DiscountItem(i, j);
|
||||
shopItemsDelay[i][j] = 0;
|
||||
DidUpdate = true;
|
||||
}
|
||||
refreshshop(i);
|
||||
}
|
||||
shopItemsDelay[i][j]++;
|
||||
}
|
||||
}
|
||||
if (DidUpdate) {
|
||||
for (int k = 1; k < PlayerHandler.players.length; k++) {
|
||||
if (PlayerHandler.players[k] != null) {
|
||||
if (PlayerHandler.players[k].isShopping && PlayerHandler.players[k].shopId == i) {
|
||||
PlayerHandler.players[k].updateShop = true;
|
||||
PlayerHandler.players[k].updateShop(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
DidUpdate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DiscountItem(int shopID, int ArrayID) {
|
||||
shopItemsN[shopID][ArrayID] -= 1;
|
||||
if (shopItemsN[shopID][ArrayID] <= 0) {
|
||||
shopItemsN[shopID][ArrayID] = 0;
|
||||
if (shopItemsStandard[shopID] <= ArrayID)
|
||||
private void DiscountItem(int shopID, int ArrayID) {
|
||||
shopItemsN[shopID][ArrayID] -= 1;
|
||||
if (shopItemsN[shopID][ArrayID] <= 0) {
|
||||
shopItemsN[shopID][ArrayID] = 0;
|
||||
if (shopItemsStandard[shopID] <= ArrayID) {
|
||||
ResetItem(shopID, ArrayID);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ResetItem(int shopID, int ArrayID) {
|
||||
if (shopItemsStandard[shopID] > ArrayID) return;
|
||||
shopItems[shopID][ArrayID] = 0;
|
||||
shopItemsN[shopID][ArrayID] = 0;
|
||||
shopItemsDelay[shopID][ArrayID] = 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean loadshops(String FileName) {
|
||||
String line = "";
|
||||
String token = "";
|
||||
String token2 = "";
|
||||
String[] token3 = new String[(MAX_SHOP_ITEMS * 2)];
|
||||
boolean EndOfFile = false;
|
||||
BufferedReader characterfile = null;
|
||||
try {
|
||||
characterfile = new BufferedReader(new FileReader("./data/cfg/" + FileName));
|
||||
} catch (FileNotFoundException fileex) {
|
||||
Misc.println(FileName + ": file not found.");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception) {
|
||||
Misc.println(FileName + ": error loading file.");
|
||||
}
|
||||
while (EndOfFile == false && line != null) {
|
||||
line = line.trim();
|
||||
int spot = line.indexOf("=");
|
||||
if (spot > -1) {
|
||||
token = line.substring(0, spot);
|
||||
token = token.trim();
|
||||
token2 = line.substring(spot + 1);
|
||||
token3 = token2.trim().split("\t+");
|
||||
if (token.equals("shop")) {
|
||||
int shopID = Integer.parseInt(token3[0]);
|
||||
shopName[shopID] = token3[1].replaceAll("_", " ");
|
||||
shopSModifier[shopID] = Integer.parseInt(token3[2]);
|
||||
shopBModifier[shopID] = Integer.parseInt(token3[3]);
|
||||
for (int i = 0; i < ((token3.length - 4) / 2); i++) {
|
||||
int itemID = Integer.parseInt(token3[(4 + (i * 2))]);
|
||||
int itemAmount = Integer.parseInt(token3[(5 + (i * 2))]);
|
||||
if (itemID > 0) {
|
||||
shopItems[shopID][i] = itemID + 1;
|
||||
shopItemsN[shopID][i] = itemAmount;
|
||||
shopItemsSN[shopID][i] = itemAmount;
|
||||
shopItemsStandard[shopID]++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
totalshops++;
|
||||
}
|
||||
} else {
|
||||
if (line.equalsIgnoreCase("[ENDOFSHOPLIST]")) {
|
||||
try {
|
||||
characterfile.close();
|
||||
} catch (IOException ioexception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception1) {
|
||||
EndOfFile = true;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ResetItem(int shopID, int ArrayID) {
|
||||
if (shopItemsStandard[shopID] > ArrayID) {
|
||||
return;
|
||||
}
|
||||
shopItems[shopID][ArrayID] = 0;
|
||||
shopItemsN[shopID][ArrayID] = 0;
|
||||
shopItemsDelay[shopID][ArrayID] = 0;
|
||||
}
|
||||
|
||||
public void loadShops() {
|
||||
Gson gson = new Gson();
|
||||
|
||||
try {
|
||||
Type collectionType = new TypeToken<ShopData[]>() {
|
||||
}.getType();
|
||||
ShopData[] data = gson.fromJson(new FileReader("./data/cfg/shops.json"), collectionType);
|
||||
|
||||
for (ShopData shop : data) {
|
||||
int shopID = shop.getId();
|
||||
shopName[shopID] = shop.getName();
|
||||
shopSModifier[shopID] = shop.getSellModifier();
|
||||
shopBModifier[shopID] = shop.getBuyModifier();
|
||||
for (int i = 0; i < shop.getItems().length; i++) {
|
||||
if (shop.getItems()[i].getItemId() > 0) {
|
||||
shopItems[shopID][i] = shop.getItems()[i].getItemId() + 1;
|
||||
shopItemsN[shopID][i] = shop.getItems()[i].getItemAmount();
|
||||
shopItemsSN[shopID][i] = shop.getItems()[i].getItemAmount();
|
||||
shopItemsStandard[shopID]++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
totalshops++;
|
||||
}
|
||||
} catch (FileNotFoundException fileex) {
|
||||
Misc.println("shops.json: file not found.");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean writeShops(String FileName) {
|
||||
String line = "";
|
||||
String token = "";
|
||||
String token2 = "";
|
||||
String[] token3 = new String[(MAX_SHOP_ITEMS * 2)];
|
||||
boolean EndOfFile = false;
|
||||
BufferedReader characterfile = null;
|
||||
JSONArray array = new JSONArray();
|
||||
try {
|
||||
characterfile = new BufferedReader(new FileReader("./data/cfg/" + FileName));
|
||||
} catch (FileNotFoundException fileex) {
|
||||
Misc.println(FileName + ": file not found.");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception) {
|
||||
Misc.println(FileName + ": error loading file.");
|
||||
}
|
||||
while (EndOfFile == false && line != null) {
|
||||
line = line.trim();
|
||||
int spot = line.indexOf("=");
|
||||
if (spot > -1) {
|
||||
token = line.substring(0, spot);
|
||||
token = token.trim();
|
||||
token2 = line.substring(spot + 1);
|
||||
token3 = token2.trim().split("\t+");
|
||||
if (token.equals("shop")) {
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
object.put("id", Integer.parseInt(token3[0]));
|
||||
object.put("name", token3[1].replace("_", " "));
|
||||
object.put("sellModifier", Integer.parseInt(token3[2]));
|
||||
object.put("buyModifier", Integer.parseInt(token3[3]));
|
||||
|
||||
JSONArray array1 = new JSONArray();
|
||||
for (int i = 0; i < ((token3.length - 4) / 2); i++) {
|
||||
JSONObject object1 = new JSONObject();
|
||||
object1.put("itemId", Integer.parseInt(token3[(4 + (i * 2))]));
|
||||
object1.put("itemAmount", Integer.parseInt(token3[(5 + (i * 2))]));
|
||||
array1.put(array1.length(), object1);
|
||||
}
|
||||
object.put("items", array1);
|
||||
|
||||
array.put(object);
|
||||
}
|
||||
} else {
|
||||
if (line.equalsIgnoreCase("[ENDOFSHOPLIST]")) {
|
||||
try {
|
||||
characterfile.close();
|
||||
} catch (IOException ioexception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception1) {
|
||||
EndOfFile = true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
characterfile.close();
|
||||
|
||||
FileWriter fileWriter = new FileWriter("shops-dump.json");
|
||||
fileWriter.write(array.toString());
|
||||
} catch (IOException ioexception) {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void createPlayerShop(Client player) {
|
||||
int id = getEmptyshop();
|
||||
player.shopId = id;
|
||||
shopSModifier[id] = 0;
|
||||
shopBModifier[id] = 0;
|
||||
shopName[id] = player.properName + "'s Store";
|
||||
for (int i = 0; i < MAX_SHOP_ITEMS; i++) {
|
||||
shopItems[id][i] = player.bankItems[i];
|
||||
shopItemsN[id][i] = player.bankItemsN[i];
|
||||
shopItemsSN[id][i] = 0;
|
||||
shopItemsDelay[id][i] = 0;
|
||||
}
|
||||
totalshops++;
|
||||
}
|
||||
|
||||
private static int getEmptyshop() {
|
||||
for (int i = 0; i < MAX_SHOPS; i++) {
|
||||
if (shopName[i].equals("")) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
try {
|
||||
characterfile.close();
|
||||
} catch (IOException ioexception) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void createPlayerShop(Client player){
|
||||
int id = getEmptyshop();
|
||||
player.shopId = id;
|
||||
shopSModifier[id] = 0;
|
||||
shopBModifier[id] = 0;
|
||||
shopName[id] = player.properName + "'s Store";
|
||||
for (int i = 0; i < MAX_SHOP_ITEMS; i++){
|
||||
shopItems[id][i] = player.bankItems[i];
|
||||
shopItemsN[id][i] = player.bankItemsN[i];
|
||||
shopItemsSN[id][i] = 0;
|
||||
shopItemsDelay[id][i] = 0;
|
||||
}
|
||||
totalshops++;
|
||||
}
|
||||
public static void refreshshop(int shop_id) {
|
||||
// We don't want to remove items that should be kept in stock
|
||||
for (int j = shopItemsStandard[shop_id]; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItemsN[shop_id][j] <= 0) {
|
||||
ResetItem(shop_id, j);
|
||||
int next = j + 1;
|
||||
if (next < MAX_SHOP_ITEMS && shopItemsN[shop_id][next] > 0) {
|
||||
shopItems[shop_id][j] = shopItems[shop_id][next];
|
||||
shopItemsN[shop_id][j] = shopItemsN[shop_id][next];
|
||||
shopItemsDelay[shop_id][j] = shopItemsDelay[shop_id][next];
|
||||
ResetItem(shop_id, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int getEmptyshop(){
|
||||
for (int i = 0; i < MAX_SHOPS; i++) {
|
||||
if (shopName[i].equals("")) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
public static int getStock(int shop_id, int item_id) {
|
||||
item_id++;
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItems[shop_id][j] == item_id) {
|
||||
return shopItemsN[shop_id][j];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void refreshshop(int shop_id){
|
||||
// We don't want to remove items that should be kept in stock
|
||||
for (int j = shopItemsStandard[shop_id]; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItemsN[shop_id][j] <= 0) {
|
||||
ResetItem(shop_id, j);
|
||||
int next = j + 1;
|
||||
if (next < MAX_SHOP_ITEMS && shopItemsN[shop_id][next] > 0) {
|
||||
shopItems[shop_id][j] = shopItems[shop_id][next];
|
||||
shopItemsN[shop_id][j] = shopItemsN[shop_id][next];
|
||||
shopItemsDelay[shop_id][j] = shopItemsDelay[shop_id][next];
|
||||
ResetItem(shop_id, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void buyItem(int shop_id, int item_id, int amount) {
|
||||
item_id++;
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItems[shop_id][j] == item_id) {
|
||||
shopItemsN[shop_id][j] -= amount;
|
||||
}
|
||||
}
|
||||
refreshshop(shop_id);
|
||||
}
|
||||
|
||||
public static int getStock(int shop_id, int item_id){
|
||||
item_id++;
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItems[shop_id][j] == item_id) {
|
||||
return shopItemsN[shop_id][j];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void buyItem(int shop_id, int item_id, int amount){
|
||||
item_id++;
|
||||
for (int j = 0; j < MAX_SHOP_ITEMS; j++) {
|
||||
if (shopItems[shop_id][j] == item_id) {
|
||||
shopItemsN[shop_id][j] -= amount;
|
||||
}
|
||||
}
|
||||
refreshshop(shop_id);
|
||||
}
|
||||
|
||||
public static boolean playerOwnsStore(int shop_id, Player player){
|
||||
return shopSModifier[shop_id] == 0 && shopBModifier[shop_id] == 0 && shopName[shop_id].equalsIgnoreCase(player.properName + "'s Store");
|
||||
}
|
||||
public static boolean playerOwnsStore(int shop_id, Player player) {
|
||||
return shopSModifier[shop_id] == 0 && shopBModifier[shop_id] == 0 && shopName[shop_id].equalsIgnoreCase(player.properName + "'s Store");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class DoorData {
|
||||
private final int id;
|
||||
private final Location[] locations;
|
||||
private final int face;
|
||||
private final int type;
|
||||
|
||||
public DoorData(int id, Location[] locations, int face, int type) {
|
||||
this.id = id;
|
||||
this.locations = locations;
|
||||
this.face = face;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Location[] getLocations() {
|
||||
return locations;
|
||||
}
|
||||
|
||||
public int getFace() {
|
||||
return face;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static class Location {
|
||||
private int x;
|
||||
private int y;
|
||||
private int height;
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class GlobalDropData {
|
||||
|
||||
private int id;
|
||||
private int amount;
|
||||
private int itemX;
|
||||
private int itemY;
|
||||
private int height;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public int getItemX() {
|
||||
return itemX;
|
||||
}
|
||||
|
||||
public int getItemY() {
|
||||
return itemY;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class ItemData {
|
||||
private final int id;
|
||||
private final String name;
|
||||
private final String examine;
|
||||
private final Values[] values;
|
||||
private final Bonuses[] bonuses;
|
||||
|
||||
public ItemData(int id, String name, String examine, Values[] values, Bonuses[] bonuses) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.examine = examine;
|
||||
this.values = values;
|
||||
this.bonuses = bonuses;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getExamine() {
|
||||
return examine;
|
||||
}
|
||||
|
||||
public Values getValues() {
|
||||
return values[0];
|
||||
}
|
||||
|
||||
public Bonuses getBonuses() {
|
||||
return bonuses[0];
|
||||
}
|
||||
|
||||
public static class Values {
|
||||
int shopValue;
|
||||
int lowAlch;
|
||||
int highAlch;
|
||||
|
||||
public int getShopValue() {
|
||||
return shopValue;
|
||||
}
|
||||
|
||||
public int getLowAlch() {
|
||||
return lowAlch;
|
||||
}
|
||||
|
||||
public int getHighAlch() {
|
||||
return highAlch;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Bonuses {
|
||||
int attackStab;
|
||||
int attackSlash;
|
||||
int attackCrush;
|
||||
int attackMagic;
|
||||
int attackRange;
|
||||
int defenceStab;
|
||||
int defenceSlash;
|
||||
int defenceCrush;
|
||||
int defenceMagic;
|
||||
int defenceRange;
|
||||
int strengthBonus;
|
||||
int prayerBonus;
|
||||
|
||||
public int getAttackStab() {
|
||||
return attackStab;
|
||||
}
|
||||
|
||||
public int getAttackSlash() {
|
||||
return attackSlash;
|
||||
}
|
||||
|
||||
public int getAttackCrush() {
|
||||
return attackCrush;
|
||||
}
|
||||
|
||||
public int getAttackMagic() {
|
||||
return attackMagic;
|
||||
}
|
||||
|
||||
public int getAttackRange() {
|
||||
return attackRange;
|
||||
}
|
||||
|
||||
public int getDefenceStab() {
|
||||
return defenceStab;
|
||||
}
|
||||
|
||||
public int getDefenceSlash() {
|
||||
return defenceSlash;
|
||||
}
|
||||
|
||||
public int getDefenceCrush() {
|
||||
return defenceCrush;
|
||||
}
|
||||
|
||||
public int getDefenceMagic() {
|
||||
return defenceMagic;
|
||||
}
|
||||
|
||||
public int getDefenceRange() {
|
||||
return defenceRange;
|
||||
}
|
||||
|
||||
public int getStrengthBonus() {
|
||||
return strengthBonus;
|
||||
}
|
||||
|
||||
public int getPrayerBonus() {
|
||||
return prayerBonus;
|
||||
}
|
||||
|
||||
public int[] getBonuses() {
|
||||
int[] bonuses = new int[12];
|
||||
|
||||
bonuses[0] = this.getAttackStab();
|
||||
bonuses[1] = this.getAttackSlash();
|
||||
bonuses[2] = this.getAttackCrush();
|
||||
bonuses[3] = this.getAttackMagic();
|
||||
bonuses[4] = this.getAttackRange();
|
||||
bonuses[5] = this.getDefenceStab();
|
||||
bonuses[6] = this.getDefenceSlash();
|
||||
bonuses[7] = this.getDefenceCrush();
|
||||
bonuses[8] = this.getDefenceMagic();
|
||||
bonuses[9] = this.getDefenceRange();
|
||||
bonuses[10] = this.getStrengthBonus();
|
||||
bonuses[11] = this.getPrayerBonus();
|
||||
|
||||
return bonuses;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class NpcData {
|
||||
private final int id;
|
||||
private final String name;
|
||||
private final int combat;
|
||||
private final int hitpoints;
|
||||
|
||||
public NpcData(int id, String name, int combat, int hitpoints) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.combat = combat;
|
||||
this.hitpoints = hitpoints;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getCombat() {
|
||||
return combat;
|
||||
}
|
||||
|
||||
public int getHitpoints() {
|
||||
return hitpoints;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
import com.rebotted.game.npcs.drops.ItemDrop;
|
||||
|
||||
/**
|
||||
* @author SandroC
|
||||
*/
|
||||
public class NpcDrop {
|
||||
private final int id;
|
||||
private final ItemDrop[] items;
|
||||
|
||||
public NpcDrop(int id, ItemDrop[] items) {
|
||||
this.id = id;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public ItemDrop[] getItems() {
|
||||
return items;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
/**
|
||||
* @author SandroC
|
||||
*/
|
||||
public class NpcSpawn {
|
||||
private final int id;
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int height;
|
||||
private final int walk;
|
||||
private final int maxHit;
|
||||
private final int attack;
|
||||
private final int strength;
|
||||
|
||||
public NpcSpawn(int id, int x, int y, int height, int walk, int maxHit, int attack, int strength) {
|
||||
this.id = id;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.height = height;
|
||||
this.walk = walk;
|
||||
this.maxHit = maxHit;
|
||||
this.attack = attack;
|
||||
this.strength = strength;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public int isWalk() {
|
||||
return walk;
|
||||
}
|
||||
|
||||
public int getMaxHit() {
|
||||
return maxHit;
|
||||
}
|
||||
|
||||
public int getAttack() {
|
||||
return attack;
|
||||
}
|
||||
|
||||
public int getStrength() {
|
||||
return strength;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
/**
|
||||
* @author SandroC
|
||||
*/
|
||||
public class ShopData {
|
||||
private final int id;
|
||||
private final String name;
|
||||
private final int sellModifier;
|
||||
private final int buyModifier;
|
||||
private final ShopItems[] items;
|
||||
|
||||
public ShopData(int id, String name, int sellModifier, int buyModifier, ShopItems[] items) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.sellModifier = sellModifier;
|
||||
this.buyModifier = buyModifier;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getSellModifier() {
|
||||
return sellModifier;
|
||||
}
|
||||
|
||||
public int getBuyModifier() {
|
||||
return buyModifier;
|
||||
}
|
||||
|
||||
public ShopItems[] getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public static class ShopItems {
|
||||
int itemId;
|
||||
int itemAmount;
|
||||
|
||||
public int getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public int getItemAmount() {
|
||||
return itemAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,370 +1,376 @@
|
||||
package com.rebotted.world;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.rebotted.event.CycleEvent;
|
||||
import com.rebotted.event.CycleEventContainer;
|
||||
import com.rebotted.event.CycleEventHandler;
|
||||
import com.rebotted.game.players.Client;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.game.players.PlayerHandler;
|
||||
import com.rebotted.util.GlobalDropData;
|
||||
import com.rebotted.util.Misc;
|
||||
import com.rebotted.util.ShopData;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Handles global drops which respawn after set amount of time when taken
|
||||
*
|
||||
*
|
||||
* @author Stuart <RogueX>
|
||||
*/
|
||||
public class GlobalDropsHandler {
|
||||
|
||||
/**
|
||||
* time in seconds it takes for the item to respawn
|
||||
*/
|
||||
private static final int TIME_TO_RESPAWN = 20;
|
||||
/**
|
||||
* time in seconds it takes for the item to respawn
|
||||
*/
|
||||
private static final int TIME_TO_RESPAWN = 20;
|
||||
|
||||
/**
|
||||
* holds all the objects
|
||||
*/
|
||||
private static List<GlobalDrop> globalDrops = new ArrayList<GlobalDrop>();
|
||||
|
||||
private static Set<GlobalDrop> spawnedDrops = new HashSet<>();
|
||||
/**
|
||||
* holds all the objects
|
||||
*/
|
||||
private static final List<GlobalDrop> globalDrops = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* loads the items
|
||||
*/
|
||||
public static void initialize() {
|
||||
String Data;
|
||||
BufferedReader Checker;
|
||||
try {
|
||||
Checker = new BufferedReader(new FileReader("./data/cfg/globaldrops.txt"));
|
||||
while ((Data = Checker.readLine()) != null) {
|
||||
if (Data.startsWith("#")) {
|
||||
continue;
|
||||
}
|
||||
String[] args = Data.split(":");
|
||||
if(args.length == 5) {
|
||||
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3]), Integer.parseInt(args[4])));
|
||||
private static final Set<GlobalDrop> spawnedDrops = new HashSet<>();
|
||||
|
||||
|
||||
/**
|
||||
* loads the items
|
||||
*/
|
||||
public static void initialize() {
|
||||
Gson gson = new Gson();
|
||||
try {
|
||||
Type collectionType = new TypeToken<GlobalDropData[]>() {
|
||||
}.getType();
|
||||
GlobalDropData[] globalDropData = gson.fromJson(new FileReader("./data/cfg/globaldrops.json"), collectionType);
|
||||
|
||||
for (GlobalDropData data : globalDropData) {
|
||||
if (data.getHeight() > 0) {
|
||||
globalDrops.add(new GlobalDrop(data.getId(), data.getAmount(), data.getItemX(), data.getItemY(), data.getHeight()));
|
||||
} else {
|
||||
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3])));
|
||||
globalDrops.add(new GlobalDrop(data.getId(), data.getAmount(), data.getItemX(), data.getItemY()));
|
||||
}
|
||||
}
|
||||
Checker.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Misc.println("Loaded " + globalDrops.size() + " global drops.");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Misc.println("Loaded " + globalDrops.size() + " global drops.");
|
||||
|
||||
for (Player player : PlayerHandler.players) {
|
||||
Client player2 = (Client) player;
|
||||
if(player2 != null) {
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (drop.isTaken() && drop.isSpawned()) {
|
||||
if (System.currentTimeMillis() - drop.getTakenAt() >= TIME_TO_RESPAWN * 1000) {
|
||||
drop.setTaken(false);
|
||||
if (player2.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
player2.getPacketSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
|
||||
spawnedDrops.add(drop);
|
||||
}
|
||||
for (Player player : PlayerHandler.players) {
|
||||
Client player2 = (Client) player;
|
||||
if (player2 != null) {
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (drop.isTaken() && drop.isSpawned()) {
|
||||
if (System.currentTimeMillis() - drop.getTakenAt() >= TIME_TO_RESPAWN * 1000) {
|
||||
drop.setTaken(false);
|
||||
if (player2.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
player2.getPacketSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
|
||||
spawnedDrops.add(drop);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void stop() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void read() {
|
||||
String Data;
|
||||
BufferedReader Checker;
|
||||
try {
|
||||
Checker = new BufferedReader(new FileReader("./data/cfg/globaldrops.txt"));
|
||||
while ((Data = Checker.readLine()) != null) {
|
||||
if (Data.startsWith("#")) {
|
||||
continue;
|
||||
}
|
||||
String[] args = Data.split(":");
|
||||
if(args.length == 5) {
|
||||
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3]), Integer.parseInt(args[4])));
|
||||
} else {
|
||||
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3])));
|
||||
}
|
||||
}
|
||||
Checker.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void stop() {
|
||||
|
||||
/**
|
||||
* See if a drop exists at the given place
|
||||
*
|
||||
* @param a
|
||||
* item id
|
||||
* @param b
|
||||
* x cord
|
||||
* @param c
|
||||
* y cord
|
||||
* @return return the statement
|
||||
*/
|
||||
private static GlobalDrop itemExists(int a, int b, int c) {
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (drop.getId() == a && drop.getX() == b && drop.getY() == c) {
|
||||
return drop;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean itemExists(int a, int b, int c, boolean yes) {
|
||||
for (GlobalDrop drop : spawnedDrops) {
|
||||
if (drop.getId() == a && drop.getX() == b && drop.getY() == c) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pick up an item at the given location
|
||||
*
|
||||
* @param player2
|
||||
* the Player
|
||||
* @param a
|
||||
* item id
|
||||
* @param b
|
||||
* cord x
|
||||
* @param c
|
||||
* cord y
|
||||
*/
|
||||
public static void pickup(Player player, int a, int b, int c) {
|
||||
GlobalDrop drop = itemExists(a, b, c);
|
||||
if (drop == null) {
|
||||
return;
|
||||
}
|
||||
if (drop.isTaken()) {
|
||||
return;
|
||||
}
|
||||
if (player.getItemAssistant().freeSlots() < 1) {
|
||||
if (!(player.getItemAssistant().playerHasItem(player.pItemId) && player.getItemAssistant().isStackable(player.pItemId))) {
|
||||
player.getPacketSender().sendMessage("Not enough space in your inventory.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
player.getItemAssistant().addItem(drop.getId(), drop.getAmount());
|
||||
drop.setTakenAt(System.currentTimeMillis());
|
||||
drop.setTaken(true);
|
||||
for (Player playerLoop : PlayerHandler.players) {
|
||||
Client cl = (Client) playerLoop;
|
||||
if (cl != null) {
|
||||
cl.getPacketSender().removeGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount());
|
||||
spawnedDrops.remove(drop);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void writeGlobalDropsDump() {
|
||||
String Data;
|
||||
BufferedReader Checker;
|
||||
JSONArray array = new JSONArray();
|
||||
try {
|
||||
Checker = new BufferedReader(new FileReader("./data/cfg/globaldrops.txt"));
|
||||
while ((Data = Checker.readLine()) != null) {
|
||||
if (Data.startsWith("#")) {
|
||||
continue;
|
||||
}
|
||||
String[] args = Data.split(":");
|
||||
|
||||
/**
|
||||
* Loads all the items when a player changes region
|
||||
*
|
||||
* @param Player
|
||||
* the Player
|
||||
*/
|
||||
public static void load(Client player) {
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (!drop.isTaken() && !drop.isSpawned() && !itemExists(drop.getId(), drop.getX(), drop.getY(), true) && player.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
player.getPacketSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
|
||||
spawnedDrops.add(drop);
|
||||
drop.setSpawned(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void reset(Player c) {
|
||||
for(GlobalDrop drop : globalDrops) {
|
||||
if(c.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
c.getPacketSender().removeGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount());
|
||||
}
|
||||
}
|
||||
spawnedDrops.clear();
|
||||
globalDrops.clear();
|
||||
read();
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (!drop.isTaken() && !drop.isSpawned() && !itemExists(drop.getId(), drop.getX(), drop.getY(), true) && c.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
c.getPacketSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
|
||||
spawnedDrops.add(drop);
|
||||
drop.setSpawned(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
/**
|
||||
* Holds each drops data
|
||||
*
|
||||
* @author Stuart
|
||||
*/
|
||||
static class GlobalDrop {
|
||||
object.put("id", Integer.parseInt(args[0]));
|
||||
object.put("amount", args[1].replace("_", " "));
|
||||
object.put("itemX", Integer.parseInt(args[2]));
|
||||
object.put("itemY", Integer.parseInt(args[3]));
|
||||
|
||||
/**
|
||||
* cord x
|
||||
*/
|
||||
int itemX;
|
||||
/**
|
||||
* cord y
|
||||
*/
|
||||
int itemY;
|
||||
|
||||
private int height;
|
||||
/**
|
||||
* item id
|
||||
*/
|
||||
int id;
|
||||
/**
|
||||
* item amount
|
||||
*/
|
||||
int amount;
|
||||
/**
|
||||
* has the item been taken
|
||||
*/
|
||||
boolean taken = false;
|
||||
|
||||
private boolean spawned = false;
|
||||
if (args.length == 5) {
|
||||
object.put("height", Integer.parseInt(args[4]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Time it was taken at
|
||||
*/
|
||||
long takenAt;
|
||||
array.put(object);
|
||||
}
|
||||
Checker.close();
|
||||
|
||||
/**
|
||||
* Sets the drop arguments
|
||||
*
|
||||
* @param pickAxe
|
||||
* item id
|
||||
* @param b
|
||||
* item amount
|
||||
* @param player
|
||||
* cord x
|
||||
* @param d
|
||||
* cord y
|
||||
*/
|
||||
|
||||
public GlobalDrop(int id, int amount, int itemX, int itemY) {
|
||||
this.id = id;
|
||||
this.amount = amount;
|
||||
this.itemX = itemX;
|
||||
this.itemY = itemY;
|
||||
}
|
||||
|
||||
public GlobalDrop(int id, int amount, int itemX, int itemY, int height) {
|
||||
this.id = id;
|
||||
this.amount = amount;
|
||||
this.itemX = itemX;
|
||||
this.itemY = itemY;
|
||||
this.height = height;
|
||||
}
|
||||
FileWriter fileWriter = new FileWriter("globaldrops-dump.json");
|
||||
fileWriter.write(array.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get cord x
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getX() {
|
||||
return itemX;
|
||||
}
|
||||
/**
|
||||
* See if a drop exists at the given place
|
||||
*
|
||||
* @param a item id
|
||||
* @param b x cord
|
||||
* @param c y cord
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
private static GlobalDrop itemExists(int a, int b, int c) {
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (drop.getId() == a && drop.getX() == b && drop.getY() == c) {
|
||||
return drop;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* get cord x
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getY() {
|
||||
return itemY;
|
||||
}
|
||||
public static boolean itemExists(int a, int b, int c, boolean yes) {
|
||||
for (GlobalDrop drop : spawnedDrops) {
|
||||
if (drop.getId() == a && drop.getX() == b && drop.getY() == c) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the item id
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* Pick up an item at the given location
|
||||
*
|
||||
* @param player the Player
|
||||
* @param a item id
|
||||
* @param b cord x
|
||||
* @param c cord y
|
||||
*/
|
||||
public static void pickup(Player player, int a, int b, int c) {
|
||||
GlobalDrop drop = itemExists(a, b, c);
|
||||
if (drop == null) {
|
||||
return;
|
||||
}
|
||||
if (drop.isTaken()) {
|
||||
return;
|
||||
}
|
||||
if (player.getItemAssistant().freeSlots() < 1) {
|
||||
if (!(player.getItemAssistant().playerHasItem(player.pItemId) && player.getItemAssistant().isStackable(player.pItemId))) {
|
||||
player.getPacketSender().sendMessage("Not enough space in your inventory.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
player.getItemAssistant().addItem(drop.getId(), drop.getAmount());
|
||||
drop.setTakenAt(System.currentTimeMillis());
|
||||
drop.setTaken(true);
|
||||
for (Player playerLoop : PlayerHandler.players) {
|
||||
Client cl = (Client) playerLoop;
|
||||
if (cl != null) {
|
||||
cl.getPacketSender().removeGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount());
|
||||
spawnedDrops.remove(drop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the item amount
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
/**
|
||||
* Loads all the items when a player changes region
|
||||
*
|
||||
* @param player the Player
|
||||
*/
|
||||
public static void load(Client player) {
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (!drop.isTaken() && !drop.isSpawned() && !itemExists(drop.getId(), drop.getX(), drop.getY(), true) && player.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
player.getPacketSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
|
||||
spawnedDrops.add(drop);
|
||||
drop.setSpawned(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* has the drop already been taken?
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public boolean isTaken() {
|
||||
return taken;
|
||||
}
|
||||
public static void reset(Player c) {
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (c.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
c.getPacketSender().removeGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount());
|
||||
}
|
||||
}
|
||||
spawnedDrops.clear();
|
||||
globalDrops.clear();
|
||||
initialize();
|
||||
for (GlobalDrop drop : globalDrops) {
|
||||
if (!drop.isTaken() && !drop.isSpawned() && !itemExists(drop.getId(), drop.getX(), drop.getY(), true) && c.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
|
||||
c.getPacketSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
|
||||
spawnedDrops.add(drop);
|
||||
drop.setSpawned(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set if or not the drop has been taken
|
||||
*
|
||||
* @param a
|
||||
* true yes false no
|
||||
*/
|
||||
public void setTaken(boolean a) {
|
||||
taken = a;
|
||||
}
|
||||
/**
|
||||
* Holds each drops data
|
||||
*
|
||||
* @author Stuart
|
||||
*/
|
||||
static class GlobalDrop {
|
||||
|
||||
/**
|
||||
* set the time it was picked up
|
||||
*
|
||||
* @param a
|
||||
* the a
|
||||
*/
|
||||
public void setTakenAt(long a) {
|
||||
takenAt = a;
|
||||
}
|
||||
/**
|
||||
* cord x
|
||||
*/
|
||||
int itemX;
|
||||
/**
|
||||
* cord y
|
||||
*/
|
||||
int itemY;
|
||||
|
||||
/**
|
||||
* get the time it was taken at
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public long getTakenAt() {
|
||||
return takenAt;
|
||||
}
|
||||
private int height;
|
||||
/**
|
||||
* item id
|
||||
*/
|
||||
int id;
|
||||
/**
|
||||
* item amount
|
||||
*/
|
||||
int amount;
|
||||
/**
|
||||
* has the item been taken
|
||||
*/
|
||||
boolean taken = false;
|
||||
|
||||
public boolean isSpawned() {
|
||||
return spawned;
|
||||
}
|
||||
private boolean spawned = false;
|
||||
|
||||
public void setSpawned(boolean spawned) {
|
||||
this.spawned = spawned;
|
||||
}
|
||||
/**
|
||||
* Time it was taken at
|
||||
*/
|
||||
long takenAt;
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
/**
|
||||
* Sets the drop arguments
|
||||
*
|
||||
* @param id item id
|
||||
* @param amount item amount
|
||||
* @param itemX cord x
|
||||
* @param itemY cord y
|
||||
*/
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
public GlobalDrop(int id, int amount, int itemX, int itemY) {
|
||||
this.id = id;
|
||||
this.amount = amount;
|
||||
this.itemX = itemX;
|
||||
this.itemY = itemY;
|
||||
}
|
||||
|
||||
}
|
||||
public GlobalDrop(int id, int amount, int itemX, int itemY, int height) {
|
||||
this.id = id;
|
||||
this.amount = amount;
|
||||
this.itemX = itemX;
|
||||
this.itemY = itemY;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
/**
|
||||
* get cord x
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getX() {
|
||||
return itemX;
|
||||
}
|
||||
|
||||
/**
|
||||
* get cord x
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getY() {
|
||||
return itemY;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the item id
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the item amount
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* has the drop already been taken?
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public boolean isTaken() {
|
||||
return taken;
|
||||
}
|
||||
|
||||
/**
|
||||
* set if or not the drop has been taken
|
||||
*
|
||||
* @param a true yes false no
|
||||
*/
|
||||
public void setTaken(boolean a) {
|
||||
taken = a;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the time it was picked up
|
||||
*
|
||||
* @param a the a
|
||||
*/
|
||||
public void setTakenAt(long a) {
|
||||
takenAt = a;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the time it was taken at
|
||||
*
|
||||
* @return return the statement
|
||||
*/
|
||||
public long getTakenAt() {
|
||||
return takenAt;
|
||||
}
|
||||
|
||||
public boolean isSpawned() {
|
||||
return spawned;
|
||||
}
|
||||
|
||||
public void setSpawned(boolean spawned) {
|
||||
this.spawned = spawned;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
package com.rebotted.world;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.rebotted.GameConstants;
|
||||
import com.rebotted.game.items.GroundItem;
|
||||
import com.rebotted.game.items.ItemAssistant;
|
||||
@@ -17,7 +10,16 @@ import com.rebotted.game.players.Client;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.game.players.PlayerHandler;
|
||||
import com.rebotted.util.GameLogger;
|
||||
import com.rebotted.util.ItemData;
|
||||
import com.rebotted.util.Misc;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* Handles ground items
|
||||
@@ -25,400 +27,455 @@ import com.rebotted.util.Misc;
|
||||
|
||||
public class ItemHandler {
|
||||
|
||||
public List<GroundItem> items = new ArrayList<GroundItem>();
|
||||
public static final int HIDE_TICKS = 100;
|
||||
public List<GroundItem> items = new ArrayList<GroundItem>();
|
||||
public static final int HIDE_TICKS = 100;
|
||||
|
||||
public ItemHandler() {
|
||||
for (int i = 0; i < GameConstants.ITEM_LIMIT; i++) {
|
||||
itemList[i] = null;
|
||||
}
|
||||
loadItemList("item.cfg");
|
||||
}
|
||||
public ItemHandler() {
|
||||
for (int i = 0; i < GameConstants.ITEM_LIMIT; i++) {
|
||||
itemList[i] = null;
|
||||
}
|
||||
//loadItemList("item.cfg");
|
||||
loadItemListJson();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds item to list
|
||||
**/
|
||||
public void addItem(GroundItem item) {
|
||||
items.add(item);
|
||||
}
|
||||
/**
|
||||
* Adds item to list
|
||||
**/
|
||||
public void addItem(GroundItem item) {
|
||||
items.add(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes item from list
|
||||
**/
|
||||
public void removeItem(GroundItem item) {
|
||||
items.remove(item);
|
||||
}
|
||||
/**
|
||||
* Removes item from list
|
||||
**/
|
||||
public void removeItem(GroundItem item) {
|
||||
items.remove(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Item amount
|
||||
**/
|
||||
/**
|
||||
* Item amount
|
||||
**/
|
||||
|
||||
public int itemAmount(String name, int itemId, int itemX, int itemY) {
|
||||
for(GroundItem i : items) {
|
||||
if (i.hideTicks >= 1 && i.getName().equalsIgnoreCase(name)) {
|
||||
if(i.getItemId() == itemId && i.getItemX() == itemX && i.getItemY() == itemY) {
|
||||
return i.getItemAmount();
|
||||
}
|
||||
} else if (i.hideTicks < 1) {
|
||||
if(i.getItemId() == itemId && i.getItemX() == itemX && i.getItemY() == itemY) {
|
||||
return i.getItemAmount();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* Item exists
|
||||
**/
|
||||
public boolean itemExists(int itemId, int itemX, int itemY) {
|
||||
for (GroundItem i : items) {
|
||||
if (i.getItemId() == itemId && i.getItemX() == itemX
|
||||
&& i.getItemY() == itemY) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public int itemAmount(String name, int itemId, int itemX, int itemY) {
|
||||
for (GroundItem i : items) {
|
||||
if (i.hideTicks >= 1 && i.getName().equalsIgnoreCase(name)) {
|
||||
if (i.getItemId() == itemId && i.getItemX() == itemX && i.getItemY() == itemY) {
|
||||
return i.getItemAmount();
|
||||
}
|
||||
} else if (i.hideTicks < 1) {
|
||||
if (i.getItemId() == itemId && i.getItemX() == itemX && i.getItemY() == itemY) {
|
||||
return i.getItemAmount();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads any items if you enter a new region
|
||||
**/
|
||||
public void reloadItems(Player c) {
|
||||
for (GroundItem i : items) {
|
||||
if (c != null) {
|
||||
if (c.getItemAssistant().tradeable(i.getItemId())
|
||||
|| i.getName().equalsIgnoreCase(c.playerName)) {
|
||||
if (c.distanceToPoint(i.getItemX(), i.getItemY()) <= 60) {
|
||||
if (i.hideTicks > 0
|
||||
&& i.getName().equalsIgnoreCase(c.playerName)) {
|
||||
c.getPacketSender().removeGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
c.getPacketSender().createGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
if (i.hideTicks == 0) {
|
||||
c.getPacketSender().removeGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
c.getPacketSender().createGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Item exists
|
||||
**/
|
||||
public boolean itemExists(int itemId, int itemX, int itemY) {
|
||||
for (GroundItem i : items) {
|
||||
if (i.getItemId() == itemId && i.getItemX() == itemX
|
||||
&& i.getItemY() == itemY) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
ArrayList<GroundItem> toRemove = new ArrayList<GroundItem>();
|
||||
for (int j = 0; j < items.size(); j++) {
|
||||
if (items.get(j) != null) {
|
||||
GroundItem i = items.get(j);
|
||||
if (i.hideTicks > 0) {
|
||||
i.hideTicks--;
|
||||
}
|
||||
if (i.hideTicks == 1) { // item can now be seen by others
|
||||
i.hideTicks = 0;
|
||||
createGlobalItem(i);
|
||||
i.removeTicks = HIDE_TICKS;
|
||||
}
|
||||
if (i.removeTicks > 0) {
|
||||
i.removeTicks--;
|
||||
}
|
||||
if (i.removeTicks == 1) {
|
||||
i.removeTicks = 0;
|
||||
toRemove.add(i);
|
||||
}
|
||||
/**
|
||||
* Reloads any items if you enter a new region
|
||||
**/
|
||||
public void reloadItems(Player c) {
|
||||
for (GroundItem i : items) {
|
||||
if (c != null) {
|
||||
if (c.getItemAssistant().tradeable(i.getItemId())
|
||||
|| i.getName().equalsIgnoreCase(c.playerName)) {
|
||||
if (c.distanceToPoint(i.getItemX(), i.getItemY()) <= 60) {
|
||||
if (i.hideTicks > 0
|
||||
&& i.getName().equalsIgnoreCase(c.playerName)) {
|
||||
c.getPacketSender().removeGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
c.getPacketSender().createGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
if (i.hideTicks == 0) {
|
||||
c.getPacketSender().removeGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
c.getPacketSender().createGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public void process() {
|
||||
ArrayList<GroundItem> toRemove = new ArrayList<GroundItem>();
|
||||
for (int j = 0; j < items.size(); j++) {
|
||||
if (items.get(j) != null) {
|
||||
GroundItem i = items.get(j);
|
||||
if (i.hideTicks > 0) {
|
||||
i.hideTicks--;
|
||||
}
|
||||
if (i.hideTicks == 1) { // item can now be seen by others
|
||||
i.hideTicks = 0;
|
||||
createGlobalItem(i);
|
||||
i.removeTicks = HIDE_TICKS;
|
||||
}
|
||||
if (i.removeTicks > 0) {
|
||||
i.removeTicks--;
|
||||
}
|
||||
if (i.removeTicks == 1) {
|
||||
i.removeTicks = 0;
|
||||
toRemove.add(i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < toRemove.size(); j++) {
|
||||
GroundItem i = toRemove.get(j);
|
||||
removeGlobalItem(i, i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the ground item
|
||||
**/
|
||||
public int[][] brokenBarrows = { { 4708, 4860 }, { 4710, 4866 },
|
||||
{ 4712, 4872 }, { 4714, 4878 }, { 4716, 4884 }, { 4720, 4896 },
|
||||
{ 4718, 4890 }, { 4720, 4896 }, { 4722, 4902 }, { 4732, 4932 },
|
||||
{ 4734, 4938 }, { 4736, 4944 }, { 4738, 4950 }, { 4724, 4908 },
|
||||
{ 4726, 4914 }, { 4728, 4920 }, { 4730, 4926 }, { 4745, 4956 },
|
||||
{ 4747, 4926 }, { 4749, 4968 }, { 4751, 4994 }, { 4753, 4980 },
|
||||
{ 4755, 4986 }, { 4757, 4992 }, { 4759, 4998 } };
|
||||
for (int j = 0; j < toRemove.size(); j++) {
|
||||
GroundItem i = toRemove.get(j);
|
||||
removeGlobalItem(i, i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
}
|
||||
|
||||
public void createGroundItem(Player c, int itemId, int itemX, int itemY, int itemAmount, int playerId) {
|
||||
if (itemId > 0) {
|
||||
if (itemId >= 2412 && itemId <= 2414) {
|
||||
c.getPacketSender().sendMessage("The cape vanishes as it touches the ground.");
|
||||
return;
|
||||
}
|
||||
if (itemId > 4705 && itemId < 4760) {
|
||||
for (int[] brokenBarrow : brokenBarrows) {
|
||||
if (brokenBarrow[0] == itemId) {
|
||||
itemId = brokenBarrow[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!com.rebotted.game.items.ItemData.itemStackable[itemId] && itemAmount > 0) {
|
||||
for (int j = 0; j < itemAmount; j++) {
|
||||
c.getPacketSender().createGroundItem(itemId, itemX, itemY, 1);
|
||||
GroundItem item = new GroundItem(itemId, itemX, itemY, c.getH(), 1, c.playerId, HIDE_TICKS, PlayerHandler.players[playerId].playerName);
|
||||
addItem(item);
|
||||
String itemName = ItemAssistant.getItemName(itemId).toLowerCase();
|
||||
if (c.isDead == false && itemId != 526) {
|
||||
if (c.getPlayerAssistant().isPlayer()) {
|
||||
GameLogger.writeLog(c.playerName, "dropitem", c.playerName + " dropped " + itemAmount + " " + itemName + " absX: " + c.absX + " absY: " + c.absY + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
c.getPacketSender().createGroundItem(itemId, itemX, itemY, itemAmount);
|
||||
GroundItem item = new GroundItem(itemId, itemX, itemY, c.getH(), itemAmount, c.playerId, HIDE_TICKS, PlayerHandler.players[playerId].playerName);
|
||||
addItem(item);
|
||||
String itemName = ItemAssistant.getItemName(itemId).toLowerCase();
|
||||
if (c.isDead == false && itemId != 526) {
|
||||
if (c.getPlayerAssistant().isPlayer()) {
|
||||
GameLogger.writeLog(c.playerName, "dropitem", c.playerName + " dropped " + itemAmount + " " + itemName + " absX: " + c.absX + " absY: " + c.absY + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates the ground item
|
||||
**/
|
||||
public int[][] brokenBarrows = { { 4708, 4860 }, { 4710, 4866 },
|
||||
{ 4712, 4872 }, { 4714, 4878 }, { 4716, 4884 }, { 4720, 4896 },
|
||||
{ 4718, 4890 }, { 4720, 4896 }, { 4722, 4902 }, { 4732, 4932 },
|
||||
{ 4734, 4938 }, { 4736, 4944 }, { 4738, 4950 }, { 4724, 4908 },
|
||||
{ 4726, 4914 }, { 4728, 4920 }, { 4730, 4926 }, { 4745, 4956 },
|
||||
{ 4747, 4926 }, { 4749, 4968 }, { 4751, 4994 }, { 4753, 4980 },
|
||||
{ 4755, 4986 }, { 4757, 4992 }, { 4759, 4998 } };
|
||||
|
||||
/**
|
||||
* Shows items for everyone who is within 60 squares
|
||||
**/
|
||||
public void createGlobalItem(GroundItem i) {
|
||||
for (Player p : PlayerHandler.players) {
|
||||
if (p != null) {
|
||||
Client person = (Client) p;
|
||||
if (person != null) {
|
||||
if (person.playerId != i.getItemController()) {
|
||||
if (!person.getItemAssistant().tradeable(i.getItemId())
|
||||
&& person.playerId != i.getItemController()) {
|
||||
continue;
|
||||
}
|
||||
if (person.distanceToPoint(i.getItemX(), i.getItemY()) <= 60) {
|
||||
person.getPacketSender().createGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void createGroundItem(Player c, int itemId, int itemX, int itemY, int itemAmount, int playerId) {
|
||||
if (itemId > 0) {
|
||||
if (itemId >= 2412 && itemId <= 2414) {
|
||||
c.getPacketSender().sendMessage("The cape vanishes as it touches the ground.");
|
||||
return;
|
||||
}
|
||||
if (itemId > 4705 && itemId < 4760) {
|
||||
for (int[] brokenBarrow : brokenBarrows) {
|
||||
if (brokenBarrow[0] == itemId) {
|
||||
itemId = brokenBarrow[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!com.rebotted.game.items.ItemData.itemStackable[itemId] && itemAmount > 0) {
|
||||
for (int j = 0; j < itemAmount; j++) {
|
||||
c.getPacketSender().createGroundItem(itemId, itemX, itemY, 1);
|
||||
GroundItem item = new GroundItem(itemId, itemX, itemY, c.getH(), 1, c.playerId, HIDE_TICKS, PlayerHandler.players[playerId].playerName);
|
||||
addItem(item);
|
||||
String itemName = ItemAssistant.getItemName(itemId).toLowerCase();
|
||||
if (c.isDead == false && itemId != 526) {
|
||||
if (c.getPlayerAssistant().isPlayer()) {
|
||||
GameLogger.writeLog(c.playerName, "dropitem", c.playerName + " dropped " + itemAmount + " " + itemName + " absX: " + c.absX + " absY: " + c.absY + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
c.getPacketSender().createGroundItem(itemId, itemX, itemY, itemAmount);
|
||||
GroundItem item = new GroundItem(itemId, itemX, itemY, c.getH(), itemAmount, c.playerId, HIDE_TICKS, PlayerHandler.players[playerId].playerName);
|
||||
addItem(item);
|
||||
String itemName = ItemAssistant.getItemName(itemId).toLowerCase();
|
||||
if (c.isDead == false && itemId != 526) {
|
||||
if (c.getPlayerAssistant().isPlayer()) {
|
||||
GameLogger.writeLog(c.playerName, "dropitem", c.playerName + " dropped " + itemAmount + " " + itemName + " absX: " + c.absX + " absY: " + c.absY + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removing the ground item
|
||||
**/
|
||||
/**
|
||||
* Shows items for everyone who is within 60 squares
|
||||
**/
|
||||
public void createGlobalItem(GroundItem i) {
|
||||
for (Player p : PlayerHandler.players) {
|
||||
if (p != null) {
|
||||
Client person = (Client) p;
|
||||
if (person != null) {
|
||||
if (person.playerId != i.getItemController()) {
|
||||
if (!person.getItemAssistant().tradeable(i.getItemId())
|
||||
&& person.playerId != i.getItemController()) {
|
||||
continue;
|
||||
}
|
||||
if (person.distanceToPoint(i.getItemX(), i.getItemY()) <= 60) {
|
||||
person.getPacketSender().createGroundItem(
|
||||
i.getItemId(), i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeGroundItem(Player c, int itemId, int itemX, int itemY, boolean add) {
|
||||
for (GroundItem i : items) {
|
||||
if (i.getItemId() == itemId && i.getItemX() == itemX
|
||||
&& i.getItemY() == itemY) {
|
||||
if (i.hideTicks > 0
|
||||
&& i.getName().equalsIgnoreCase(c.playerName)) {
|
||||
if (add) {
|
||||
if (!c.getItemAssistant().specialCase(itemId)) {
|
||||
if (c.getItemAssistant().addItem(i.getItemId(),
|
||||
i.getItemAmount())) {
|
||||
removeControllersItem(i, c, i.getItemId(),
|
||||
i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
removeControllersItem(i, c, i.getItemId(),
|
||||
i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
removeControllersItem(i, c, i.getItemId(),
|
||||
i.getItemX(), i.getItemY(), i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else if (i.hideTicks <= 0) {
|
||||
if (add) {
|
||||
if (c.getItemAssistant().addItem(i.getItemId(),
|
||||
i.getItemAmount())) {
|
||||
removeGlobalItem(i, i.getItemId(), i.getItemX(),
|
||||
i.getItemY(), i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
removeGlobalItem(i, i.getItemId(), i.getItemX(),
|
||||
i.getItemY(), i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Removing the ground item
|
||||
**/
|
||||
|
||||
/**
|
||||
* Remove item for just the item controller (item not global yet)
|
||||
**/
|
||||
public void removeGroundItem(Player c, int itemId, int itemX, int itemY, boolean add) {
|
||||
for (GroundItem i : items) {
|
||||
if (i.getItemId() == itemId && i.getItemX() == itemX
|
||||
&& i.getItemY() == itemY) {
|
||||
if (i.hideTicks > 0
|
||||
&& i.getName().equalsIgnoreCase(c.playerName)) {
|
||||
if (add) {
|
||||
if (!c.getItemAssistant().specialCase(itemId)) {
|
||||
if (c.getItemAssistant().addItem(i.getItemId(),
|
||||
i.getItemAmount())) {
|
||||
removeControllersItem(i, c, i.getItemId(),
|
||||
i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
removeControllersItem(i, c, i.getItemId(),
|
||||
i.getItemX(), i.getItemY(),
|
||||
i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
removeControllersItem(i, c, i.getItemId(),
|
||||
i.getItemX(), i.getItemY(), i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else if (i.hideTicks <= 0) {
|
||||
if (add) {
|
||||
if (c.getItemAssistant().addItem(i.getItemId(),
|
||||
i.getItemAmount())) {
|
||||
removeGlobalItem(i, i.getItemId(), i.getItemX(),
|
||||
i.getItemY(), i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
removeGlobalItem(i, i.getItemId(), i.getItemX(),
|
||||
i.getItemY(), i.getItemAmount());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeControllersItem(GroundItem i, Player c, int itemId,
|
||||
int itemX, int itemY, int itemAmount) {
|
||||
c.getPacketSender().removeGroundItem(itemId, itemX, itemY,
|
||||
itemAmount);
|
||||
removeItem(i);
|
||||
}
|
||||
/**
|
||||
* Remove item for just the item controller (item not global yet)
|
||||
**/
|
||||
|
||||
/**
|
||||
* Remove item for everyone within 60 squares
|
||||
**/
|
||||
public void removeControllersItem(GroundItem i, Player c, int itemId,
|
||||
int itemX, int itemY, int itemAmount) {
|
||||
c.getPacketSender().removeGroundItem(itemId, itemX, itemY,
|
||||
itemAmount);
|
||||
removeItem(i);
|
||||
}
|
||||
|
||||
public void removeGlobalItem(GroundItem i, int itemId, int itemX,
|
||||
int itemY, int itemAmount) {
|
||||
for (Player p : PlayerHandler.players) {
|
||||
if (p != null) {
|
||||
Client person = (Client) p;
|
||||
if (person != null) {
|
||||
if (person.distanceToPoint(itemX, itemY) <= 60) {
|
||||
person.getPacketSender().removeGroundItem(itemId,
|
||||
itemX, itemY, itemAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
removeItem(i);
|
||||
}
|
||||
/**
|
||||
* Remove item for everyone within 60 squares
|
||||
**/
|
||||
|
||||
/**
|
||||
* Item List
|
||||
**/
|
||||
public void removeGlobalItem(GroundItem i, int itemId, int itemX,
|
||||
int itemY, int itemAmount) {
|
||||
for (Player p : PlayerHandler.players) {
|
||||
if (p != null) {
|
||||
Client person = (Client) p;
|
||||
if (person != null) {
|
||||
if (person.distanceToPoint(itemX, itemY) <= 60) {
|
||||
person.getPacketSender().removeGroundItem(itemId,
|
||||
itemX, itemY, itemAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
removeItem(i);
|
||||
}
|
||||
|
||||
public ItemList itemList[] = new ItemList[GameConstants.ITEM_LIMIT];
|
||||
/**
|
||||
* Item List
|
||||
**/
|
||||
|
||||
public void newItemList(int ItemId, String ItemName, String ItemDescription, double ShopValue, double LowAlch, double HighAlch, int Bonuses[]) {
|
||||
// first, search for a free slot
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 11740; i++) {
|
||||
if (itemList[i] == null) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
public ItemList itemList[] = new ItemList[GameConstants.ITEM_LIMIT];
|
||||
|
||||
if (slot == -1) {
|
||||
return; // no free slot found
|
||||
}
|
||||
ItemList newItemList = new ItemList(ItemId);
|
||||
newItemList.itemName = ItemName;
|
||||
newItemList.itemDescription = ItemDescription;
|
||||
newItemList.ShopValue = ShopValue;
|
||||
newItemList.LowAlch = LowAlch;
|
||||
newItemList.HighAlch = HighAlch;
|
||||
newItemList.Bonuses = Bonuses;
|
||||
itemList[slot] = newItemList;
|
||||
}
|
||||
public void newItemList(int ItemId, String ItemName, String ItemDescription, double ShopValue, double LowAlch, double HighAlch, int Bonuses[]) {
|
||||
// first, search for a free slot
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 11740; i++) {
|
||||
if (itemList[i] == null) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void loadItemPrices(String filename) {
|
||||
try {
|
||||
@SuppressWarnings("resource")
|
||||
Scanner s = new Scanner(new File("./data/cfg/" + filename));
|
||||
while (s.hasNextLine()) {
|
||||
String[] line = s.nextLine().split(" ");
|
||||
ItemList temp = getItemList(Integer.parseInt(line[0]));
|
||||
if (temp != null) {
|
||||
temp.ShopValue = Integer.parseInt(line[1]);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (slot == -1) {
|
||||
return; // no free slot found
|
||||
}
|
||||
ItemList newItemList = new ItemList(ItemId);
|
||||
newItemList.itemName = ItemName;
|
||||
newItemList.itemDescription = ItemDescription;
|
||||
newItemList.ShopValue = ShopValue;
|
||||
newItemList.LowAlch = LowAlch;
|
||||
newItemList.HighAlch = HighAlch;
|
||||
newItemList.Bonuses = Bonuses;
|
||||
itemList[slot] = newItemList;
|
||||
}
|
||||
|
||||
public ItemList getItemList(int i) {
|
||||
for (com.rebotted.game.items.ItemList element : itemList) {
|
||||
if (element != null) {
|
||||
if (element.itemId == i) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void loadItemPrices(String filename) {
|
||||
try {
|
||||
@SuppressWarnings("resource")
|
||||
Scanner s = new Scanner(new File("./data/cfg/" + filename));
|
||||
while (s.hasNextLine()) {
|
||||
String[] line = s.nextLine().split(" ");
|
||||
ItemList temp = getItemList(Integer.parseInt(line[0]));
|
||||
if (temp != null) {
|
||||
temp.ShopValue = Integer.parseInt(line[1]);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean loadItemList(String FileName) {
|
||||
String line = "";
|
||||
String token = "";
|
||||
String token2 = "";
|
||||
String token2_2 = "";
|
||||
String[] token3 = new String[10];
|
||||
boolean EndOfFile = false;
|
||||
BufferedReader characterfile = null;
|
||||
try {
|
||||
characterfile = new BufferedReader(new FileReader("./data/cfg/"
|
||||
+ FileName));
|
||||
} catch (FileNotFoundException fileex) {
|
||||
Misc.println(FileName + ": file not found.");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception) {
|
||||
Misc.println(FileName + ": error loading file.");
|
||||
// return false;
|
||||
}
|
||||
while (EndOfFile == false && line != null) {
|
||||
line = line.trim();
|
||||
int spot = line.indexOf("=");
|
||||
if (spot > -1) {
|
||||
token = line.substring(0, spot);
|
||||
token = token.trim();
|
||||
token2 = line.substring(spot + 1);
|
||||
token2 = token2.trim();
|
||||
token2_2 = token2.replaceAll("\t+", "\t");
|
||||
token3 = token2_2.split("\t");
|
||||
if (token.equals("item")) {
|
||||
int[] Bonuses = new int[12];
|
||||
for (int i = 0; i < 12; i++) {
|
||||
if (token3[6 + i] != null) {
|
||||
Bonuses[i] = Integer.parseInt(token3[6 + i]);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
newItemList(Integer.parseInt(token3[0]),
|
||||
token3[1].replaceAll("_", " "),
|
||||
token3[2].replaceAll("_", " "),
|
||||
Double.parseDouble(token3[4]),
|
||||
Double.parseDouble(token3[4]),
|
||||
Double.parseDouble(token3[6]), Bonuses);
|
||||
}
|
||||
} else {
|
||||
if (line.equals("[ENDOFITEMLIST]")) {
|
||||
try {
|
||||
characterfile.close();
|
||||
} catch (IOException e) {}
|
||||
//return true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception1) {
|
||||
EndOfFile = true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
characterfile.close();
|
||||
} catch (IOException ioexception) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public ItemList getItemList(int i) {
|
||||
for (com.rebotted.game.items.ItemList element : itemList) {
|
||||
if (element != null) {
|
||||
if (element.itemId == i) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void loadItemListJson() {
|
||||
Gson gson = new Gson();
|
||||
|
||||
try {
|
||||
Type collectionType = new TypeToken<ItemData[]>() {
|
||||
}.getType();
|
||||
ItemData[] data = gson.fromJson(new FileReader("./data/cfg/items.json"), collectionType);
|
||||
|
||||
for (ItemData item : data) {
|
||||
newItemList(item.getId(),
|
||||
item.getName(),
|
||||
item.getExamine(),
|
||||
item.getValues().getShopValue(),
|
||||
item.getValues().getLowAlch(),
|
||||
item.getValues().getHighAlch(),
|
||||
item.getBonuses().getBonuses());
|
||||
}
|
||||
} catch (FileNotFoundException fileex) {
|
||||
Misc.println("items.json: file not found.");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean readCfgWriteJson(String FileName) {
|
||||
String line = "";
|
||||
String token = "";
|
||||
String token2 = "";
|
||||
String token2_2 = "";
|
||||
String[] token3 = new String[10];
|
||||
boolean EndOfFile = false;
|
||||
BufferedReader characterfile = null;
|
||||
JSONArray array = new JSONArray();
|
||||
try {
|
||||
characterfile = new BufferedReader(new FileReader("./data/cfg/"
|
||||
+ FileName));
|
||||
} catch (FileNotFoundException fileex) {
|
||||
Misc.println(FileName + ": file not found.");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception) {
|
||||
Misc.println(FileName + ": error loading file.");
|
||||
// return false;
|
||||
}
|
||||
while (EndOfFile == false && line != null) {
|
||||
line = line.trim();
|
||||
int spot = line.indexOf("=");
|
||||
if (spot > -1) {
|
||||
token = line.substring(0, spot);
|
||||
token = token.trim();
|
||||
token2 = line.substring(spot + 1);
|
||||
token2 = token2.trim();
|
||||
token2_2 = token2.replaceAll("\t+", "\t");
|
||||
token3 = token2_2.split("\t");
|
||||
|
||||
if (token.equals("item")) {
|
||||
int[] Bonuses = new int[12];
|
||||
for (int i = 0; i < 12; i++) {
|
||||
if (token3[6 + i] != null) {
|
||||
Bonuses[i] = Integer.parseInt(token3[6 + i]);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
object.put("id", token3[0]);
|
||||
object.put("name", token3[1].replaceAll("_", " "));
|
||||
object.put("examine", token3[2].replaceAll("_", " "));
|
||||
|
||||
JSONArray array1 = new JSONArray();
|
||||
JSONObject object1 = new JSONObject();
|
||||
object1.put("shopValue", token3[4]);
|
||||
object1.put("lowAlch", token3[5]);
|
||||
object1.put("highAlch", token3[6]);
|
||||
array1.put(0, object1);
|
||||
object.put("values", array1);
|
||||
|
||||
JSONArray array2 = new JSONArray();
|
||||
JSONObject object2 = new JSONObject();
|
||||
object2.put("attackStab", Bonuses[0]);
|
||||
object2.put("attackSlash", Bonuses[1]);
|
||||
object2.put("attackCrush", Bonuses[2]);
|
||||
object2.put("attackMagic", Bonuses[3]);
|
||||
object2.put("attackRange", Bonuses[4]);
|
||||
object2.put("defenceStab", Bonuses[5]);
|
||||
object2.put("defenceSlash", Bonuses[6]);
|
||||
object2.put("defenceCrush", Bonuses[7]);
|
||||
object2.put("defenceMagic", Bonuses[8]);
|
||||
object2.put("defenceRange", Bonuses[9]);
|
||||
object2.put("strengthBonus", Bonuses[10]);
|
||||
object2.put("prayerBonus", Bonuses[11]);
|
||||
array2.put(0, object2);
|
||||
object.put("bonuses", array2);
|
||||
|
||||
array.put(object);
|
||||
}
|
||||
} else {
|
||||
if (line.equals("[ENDOFITEMLIST]")) {
|
||||
try {
|
||||
FileWriter fileWriter = new FileWriter("item-dump.json");
|
||||
fileWriter.write(array.toString());
|
||||
characterfile.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
//return true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
line = characterfile.readLine();
|
||||
} catch (IOException ioexception1) {
|
||||
EndOfFile = true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
characterfile.close();
|
||||
} catch (IOException ioexception) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user