davio147
July 25th, 2010, 17:20
hi guys, im coding a server and i want to share codes with y'all :D (backup the source before starting)
1.)Open your source & open : \Davio-Scape Source\build\data\npcs\npcspawn.cfg
2.) add this ABOVE [ENDOFSPAWNLIST]
spawn = 747 3187 3444 0 0 0 0 0 0 Oziach
spawn = 3161 3188 3444 0 0 0 0 0 0 Charley
spawn = 682 3186 3444 0 0 0 0 0 0 Armour_salesman
spawn = 1862 3185 3444 0 0 0 0 0 0 Ali
spawn = 2339 3184 3444 0 0 0 0 0 0 Alain
spawn = 4513 3183 3444 0 0 0 0 0 0 Baba
spawn = 520 3567 3289 0 0 0 0 0 0 General
3.)goto: Davio-Scape Source\src\net\com\codeusa\ShopHandler.java
4.) press CTRL+F and search for:
public void openshop(Player p, int shopid) {
5.) under the CODE you should see switch (shopid) {
6.) under the switch (shopid) { add:
case 1: // Shop Case
shopopen(p, 730); // donator
items = Engine.shops.donatorshop; // Declaring this from Shops.java
itemsN = Engine.shops.donatorshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 2:
shopopen(p, 730);
items = Engine.shops.oziachshop; // Declaring this from Shops.java
itemsN = Engine.shops.oziachshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 3:
shopopen(p, 730);
items = Engine.shops.charleyshop; // Declaring this from Shops.java
itemsN = Engine.shops.charleyshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 4:
shopopen(p, 730);
items = Engine.shops.armourshop; // Declaring this from Shops.java
itemsN = Engine.shops.armourshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 5:
shopopen(p, 730);
items = Engine.shops.alishop; // Declaring this from Shops.java
itemsN = Engine.shops.alishopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 6:
shopopen(p, 730);
items = Engine.shops.alainshop; // Declaring this from Shops.java
itemsN = Engine.shops.alainshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 7:
shopopen(p, 730);
items = Engine.shops.babashop; // Declaring this from Shops.java
itemsN = Engine.shops.babashopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 8:
shopopen(p, 868); // shop id 868 general store.
generalStore = true;
items = Engine.shops.Generalshopvarrock;
itemsN = Engine.shops.GeneralshopvarrockN;
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);//Shop Inventory
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);//Main Stock //set to 32 to be in playerstock
break;
7.)save
8.)open \Davio-Scape Source\src\net\com\codeusa\shops.java
9.)now, you should see something like this:
public int[] Generalshopfalador = new int[maxItems];
10.) under the last code, paste this:
/*Davio's shops */
public int[] oziachshop = {9747,9748,9749,9750,9751,9752,9753,9754,9755,9756 ,9757,9758,9759,9760,9761,9762,9763,9764,9768,9769 ,9770,12169,12170,12171,10662,9814}; // the items
public int[] oziachshopN = {100000,100000,100000,100000,100000,100000,100000, 100000,100000,100000,100000,100000,100000,100000,1 00000,100000,100000,100000,100000,100000,100000,10 0000,100000,100000,100000,100000}; // the amout
int[] armourshop = {379, 2434, 2438, 3024, 6685, 392, 386, 3145, 7061, 2435, 2443, 2437, 2445, 2441, 3025, 6686};
int[] armourshopN = {50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000};
int[] charleyshop = {6914, 6916, 6918, 6920, 6922, 6924, 6889, 6731, 4675, 4708, 4710, 4712, 4714, 13858, 13861, 13864, 13867, 6585, 555, 565, 9075, 560, 557, 566, 2412, 2413, 2414};
int[] charleyshopN = {100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 200000, 200000, 200000, 200000, 200000, 20000, 100000, 100000, 1000};
int[] alishop = { 6737, 6107, 6109, 6108, 3105, 5698, 11694, 1725, 7458, 7459, 4153, 6733, 6528, 11128, 8848, 8849, 10499, 868, 9244, 11212, 2497, 1129, 3842, 892, 4740, 4734, 861, 11235, 9185, 2577, 4151};
int[] alishopN = { 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000};
int[] alainshop = {10887, 10548, 10551, 10553, 10555, 13109, 1053, 1055, 1057, 9925, 13107, 13111, 13113, 13115, 14595, 14602, 14603, 14605, 1050, 1038, 1040, 1042, 1044, 1046, 1048, 10836, 10837, 10838, 10839, 10840, 1419};
int[] alainshopN = {10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000};
public int[] babashop = {4716, 4718, 4720, 4722, 4753, 4755, 4757, 4759, 4745, 4747, 4749, 4751, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4740, 4708, 4710, 4712, 4714, 11732, 2577, 6920, 6737, 6733, 6731, 6585, 7462,6570}; // the items
public int[] babashopN = {100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000}; // the amout
now, the shop is for the item IDS, the shopN is the amount so u always can change it :)
11.)save
12.) goto src\net\com\codeusa\net\packethandler\NPCOption1.j ava
13.) you should see something at the middle of the script something with break;
14.) under the break; add this:
case 190:
Engine.shopHandler.openshop(p, 2);
break;
case 191:
Engine.shopHandler.openshop(p, 3);
break;
case 192:
Engine.shopHandler.openshop(p, 4);
break;
case 193:
Engine.shopHandler.openshop(p, 5);
break;
case 194:
Engine.shopHandler.openshop(p, 6);
break;
case 195:
Engine.shopHandler.openshop(p, 7);
break;
case 196:
Engine.shopHandler.openshop(p, 8);
break;
15.) safe & compile & have fun, and heres a picture :):
Only the registered members can see the link.
Only the registered members can see the link.
NOTE: (the General, is for barrows to sell the drops if you need money, so also check out my barrows script!!!
1.)Open your source & open : \Davio-Scape Source\build\data\npcs\npcspawn.cfg
2.) add this ABOVE [ENDOFSPAWNLIST]
spawn = 747 3187 3444 0 0 0 0 0 0 Oziach
spawn = 3161 3188 3444 0 0 0 0 0 0 Charley
spawn = 682 3186 3444 0 0 0 0 0 0 Armour_salesman
spawn = 1862 3185 3444 0 0 0 0 0 0 Ali
spawn = 2339 3184 3444 0 0 0 0 0 0 Alain
spawn = 4513 3183 3444 0 0 0 0 0 0 Baba
spawn = 520 3567 3289 0 0 0 0 0 0 General
3.)goto: Davio-Scape Source\src\net\com\codeusa\ShopHandler.java
4.) press CTRL+F and search for:
public void openshop(Player p, int shopid) {
5.) under the CODE you should see switch (shopid) {
6.) under the switch (shopid) { add:
case 1: // Shop Case
shopopen(p, 730); // donator
items = Engine.shops.donatorshop; // Declaring this from Shops.java
itemsN = Engine.shops.donatorshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 2:
shopopen(p, 730);
items = Engine.shops.oziachshop; // Declaring this from Shops.java
itemsN = Engine.shops.oziachshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 3:
shopopen(p, 730);
items = Engine.shops.charleyshop; // Declaring this from Shops.java
itemsN = Engine.shops.charleyshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 4:
shopopen(p, 730);
items = Engine.shops.armourshop; // Declaring this from Shops.java
itemsN = Engine.shops.armourshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 5:
shopopen(p, 730);
items = Engine.shops.alishop; // Declaring this from Shops.java
itemsN = Engine.shops.alishopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 6:
shopopen(p, 730);
items = Engine.shops.alainshop; // Declaring this from Shops.java
itemsN = Engine.shops.alainshopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 7:
shopopen(p, 730);
items = Engine.shops.babashop; // Declaring this from Shops.java
itemsN = Engine.shops.babashopN; // Declaring this from Shops.java
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);
break;
case 8:
shopopen(p, 868); // shop id 868 general store.
generalStore = true;
items = Engine.shops.Generalshopvarrock;
itemsN = Engine.shops.GeneralshopvarrockN;
p.getActionSender().setItems(p, -1, 64209, 93, p.items, p.itemsN);//Shop Inventory
p.getActionSender().setItems(p, -1, 64271, 31, items, itemsN);//Main Stock //set to 32 to be in playerstock
break;
7.)save
8.)open \Davio-Scape Source\src\net\com\codeusa\shops.java
9.)now, you should see something like this:
public int[] Generalshopfalador = new int[maxItems];
10.) under the last code, paste this:
/*Davio's shops */
public int[] oziachshop = {9747,9748,9749,9750,9751,9752,9753,9754,9755,9756 ,9757,9758,9759,9760,9761,9762,9763,9764,9768,9769 ,9770,12169,12170,12171,10662,9814}; // the items
public int[] oziachshopN = {100000,100000,100000,100000,100000,100000,100000, 100000,100000,100000,100000,100000,100000,100000,1 00000,100000,100000,100000,100000,100000,100000,10 0000,100000,100000,100000,100000}; // the amout
int[] armourshop = {379, 2434, 2438, 3024, 6685, 392, 386, 3145, 7061, 2435, 2443, 2437, 2445, 2441, 3025, 6686};
int[] armourshopN = {50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000};
int[] charleyshop = {6914, 6916, 6918, 6920, 6922, 6924, 6889, 6731, 4675, 4708, 4710, 4712, 4714, 13858, 13861, 13864, 13867, 6585, 555, 565, 9075, 560, 557, 566, 2412, 2413, 2414};
int[] charleyshopN = {100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 200000, 200000, 200000, 200000, 200000, 20000, 100000, 100000, 1000};
int[] alishop = { 6737, 6107, 6109, 6108, 3105, 5698, 11694, 1725, 7458, 7459, 4153, 6733, 6528, 11128, 8848, 8849, 10499, 868, 9244, 11212, 2497, 1129, 3842, 892, 4740, 4734, 861, 11235, 9185, 2577, 4151};
int[] alishopN = { 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000};
int[] alainshop = {10887, 10548, 10551, 10553, 10555, 13109, 1053, 1055, 1057, 9925, 13107, 13111, 13113, 13115, 14595, 14602, 14603, 14605, 1050, 1038, 1040, 1042, 1044, 1046, 1048, 10836, 10837, 10838, 10839, 10840, 1419};
int[] alainshopN = {10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000};
public int[] babashop = {4716, 4718, 4720, 4722, 4753, 4755, 4757, 4759, 4745, 4747, 4749, 4751, 4724, 4726, 4728, 4730, 4732, 4734, 4736, 4738, 4740, 4708, 4710, 4712, 4714, 11732, 2577, 6920, 6737, 6733, 6731, 6585, 7462,6570}; // the items
public int[] babashopN = {100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000}; // the amout
now, the shop is for the item IDS, the shopN is the amount so u always can change it :)
11.)save
12.) goto src\net\com\codeusa\net\packethandler\NPCOption1.j ava
13.) you should see something at the middle of the script something with break;
14.) under the break; add this:
case 190:
Engine.shopHandler.openshop(p, 2);
break;
case 191:
Engine.shopHandler.openshop(p, 3);
break;
case 192:
Engine.shopHandler.openshop(p, 4);
break;
case 193:
Engine.shopHandler.openshop(p, 5);
break;
case 194:
Engine.shopHandler.openshop(p, 6);
break;
case 195:
Engine.shopHandler.openshop(p, 7);
break;
case 196:
Engine.shopHandler.openshop(p, 8);
break;
15.) safe & compile & have fun, and heres a picture :):
Only the registered members can see the link.
Only the registered members can see the link.
NOTE: (the General, is for barrows to sell the drops if you need money, so also check out my barrows script!!!