Donate
Search
Latest topics
Top posters
Mr. Linksys (18) | ||||
Demonkill101 (13) | ||||
Dragonking (12) | ||||
Ripvayne (10) | ||||
King Redrum (10) | ||||
daniel89 (6) | ||||
Lighting bolt (5) | ||||
someguy (3) | ||||
thedisciple (3) | ||||
yangxue (2) |
[release] 508 shops
4 posters
Page 1 of 1
[release] 508 shops
FIRST OFF CREDS
[SIZE="24"][color:8008="Red"]Reason for release if jedi reads this
[/SIZE][/center]
First off make a new java class called
in there add
next go to
then add
then go to
and add
next go to packetmanager.java
under
add
then find
replace that whole case with
next find
and replace that case with
then go to itemoption1.java and add
i think thats is and the npcoption one stuff u may have to change to what the npc id id is in ur server XD so thats up to you and if im missing sometihng il add tommarow im going to bed... lol:lol:
converted for pali thanks to †_
in there add
next go to
then add
then go to
and add
next go to packetmanager.java
under
add
then find
replace that whole case with
next find
and replace that case with
then go to itemoption1.java and add
next go to your playeritems.java and under
add
- Jedi for base of shops
- Dragonking(me) fixing and makeing work right
- zymus for helping me with it all
[SIZE="24"][color:8008="Red"]Reason for release if jedi reads this
- I edited everything and changed it
- this should be in ever server...
- other people are about to release
- this will help us get farther into the server editing and maybe someone can give me the inventory for selling hint hint
[/SIZE][/center]
First off make a new java class called
- Code:
Shopbuyconfig
in there add
- Code:
/*
* Class Shopbuyconfig
*
* Version 1.0
*
* Novemeber 20, 2008
*
* Created by Dragonking <redragon5321@hotmail.com>
*/
package net.com.espeon.net.packethandler;
import net.com.espeon.model.Player;
import net.com.espeon.util.Misc;
import net.com.espeon.model.items.PlayerItems;
import net.com.espeon.*;
public class Shopbuyconfig implements Packet {
/**
* Handles operating equipped items.
* @param p The Player which the frame should be handled for.
* @param packetId The packet id this belongs to.
* @param packetSize The amount of bytes being recieved for this packet.
*/
public Server Server;
public void handlePacket(Player p, int packetId, int packetSize) {
if (p == null || p.stream == null) {
return;
}
PlayerItems pi = new PlayerItems();
NPCOption1 N1 = new NPCOption1();
int junk = p.stream.readDWord();
int itemId = p.stream.readUnsignedWordA();
int itemSlot = p.stream.readUnsignedWordBigEndianA();
//if (itemSlot < 0 || itemSlot >= p.equipment.length || p.equipment[itemSlot] != itemId) {
// return;
//}
if (p.shopid == 2 && pi.hasPlayerItemAmount(p, 995, p.shop2p[itemSlot]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop2p[itemSlot]);
pi.addItem(p, p.shop2[itemSlot], 1);
}
else if (p.shopid == 3 && pi.hasPlayerItemAmount(p, 995, p.shop3p[0]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop3p[0]);
pi.addItem(p, p.shop3[itemSlot], 1);
}
else if (p.shopid == 4 && pi.hasPlayerItemAmount(p, 995, p.shop4p[itemSlot]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop4p[itemSlot]);
pi.addItem(p, p.shop4[itemSlot], 1);
}
else if (p.shopid == 5 && pi.hasPlayerItemAmount(p, 995, p.shop5p[0]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop5p[0]);
pi.addItem(p, p.shop5[itemSlot], 1);
}
else
{
p.getActionSender().sendMessage(p,"You dont have enough coins.");
}
}
}
next go to
- Code:
NPCOption1
then add
- Code:
case 87: //bandit
p.viewings = 1;
p.shopid = 2;
p.getActionSender().showInterface(p, 278);
p.getActionSender().setItems(p, 278, 89, 94, p.shop2, p.shop2n);
p.getActionSender().setString(p, " <col=ffffff><img=1>God Range Armor Shop<img=0>", 278, 88);
break;
case 88: //fancy
p.viewings = 1;
p.shopid = 4;
p.getActionSender().showInterface(p, 278);
p.getActionSender().setItems(p, 278, 89, 94, p.shop4, p.shop4n);
p.getActionSender().setString(p, " Fancy shop", 278, 88);
break;
case 89: //skill
p.viewings = 1;
p.shopid = 3;
p.getActionSender().showInterface(p, 278);
p.getActionSender().setItems(p, 278, 89, 94, p.shop3, p.shop3n);
p.getActionSender().setString(p, " Skill cape shop", 278, 88);
break;
then go to
- Code:
player.java
and add
- Code:
public int[] shop2 = {10368, 10370, 10372, 10374, 10376,10378, 10380, 10382, 10384,10386, 10388, 10390, -1, -1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
public int[] shop2n = {10, 10, 10, 10,10,10,10,10,10,10,10,10, 110, 123, 0,0,0,0,0,0,0,0,0,0,0,0,0};
public int[] shop2p = {355000, 585000, 59000, 162000,12000,53000,28000,94000,260000,426000,40000,160000, 200000, 234561, 0,0,0,0,0,0,0,0,0,0,0,0,0};
public int[] shop3 = {9748, 9751, 9754, 9757, 9760,9763, 9766,9769, 9772, 9775, 9778,9781, 9784, 9787, 9790, 9793, 9796, 9799, 9801, 9804, 9807, 9810, 9811};
public int[] shop3n = {100000, 100000, 100000, 100000,100000,100000,100000,100000,100000,100000,100000,100000, 100000, 100000, 100000,100000,100000,100000,100000,100000,100000,100000,100000,100000};
public int[] shop3p = {99000};
public int[] shop4 = {11724, 11726, 11728, 11732, 11718,11720, 11722,11696, 11698, 11700, 11730,11694, 1052, 11284};
public int[] shop4n = {100000, 100000, 100000, 100000,100000,100000,100000,100000,100000,100000,100000,100000,100000, 100000, 100000};
public int[] shop4p = {11000000, 8900000, 990000, 288000,4200000,8400000,8700000,19300000,38100000,25600000,7500000,19300000,100000, 100000, 100000};
public int[] shop5 = {9748, 9751, 9754, 9757, 9760,9763, 9766,9769, 9772, 9775, 9778,9781, 9784, 9787, 9790};
public int[] shop5n = {10, 10, 10, 10,10,10,10,10,10,10,10,10,10,10,10};
public int[] shop5p = {99000};
public int shopid = 0;
public int viewings = 0;
next go to packetmanager.java
under
- Code:
public ItemOnObject itemOnObject = new ItemOnObject();
add
- Code:
public Shopbuyconfig Shopbuyconfig = new Shopbuyconfig();
then find
- Code:
case 186:
/*
* Item operating.
*/
replace that whole case with
- Code:
case 186:
/*
* Item operating.
*/
if(p.viewings == 0) {
itemOperate.handlePacket(p, packetId, packetSize);
} else {
Shopbuyconfig.handlePacket(p, packetId, packetSize);
}
next find
- Code:
case 108:
/*
* Remove open interfaces.
*/
and replace that case with
- Code:
case 108:
/*
* Remove open interfaces.
*/
p.viewings = 0;
p.getActionSender().removeShownInterface(p);
break;
then go to itemoption1.java and add
- Code:
case 278:
if(itemId == p.shop2[itemSlot])
{
p.getActionSender().sendMessage(p, "This item costs "+p.shop2p[itemSlot]);
}
else if(itemId == p.shop3[itemSlot])
{
p.getActionSender().sendMessage(p, "This item costs "+p.shop3p[0]);
}
else if(itemId == p.shop4[itemSlot])
{
p.getActionSender().sendMessage(p, "This item costs "+p.shop4p[itemSlot]);
}
else if(itemId == p.shop5[itemSlot])
{
p.getActionSender().sendMessage(p, "This item costs "+p.shop5p[0]);
}
break;
- Code:
/*Shops*/
spawn = 1552 2612 3089 0 0 0 0 0 santa
spawn = 553 3173 3498 0 0 0 0 0 aurbery
spawn = 1917 3170 3494 0 0 0 0 0 bandet
spawn = 554 3160 3494 0 0 0 0 0 fancy
spawn = 3838 3165 3496 0 0 0 0 0 skillcapes
i think thats is and the npcoption one stuff u may have to change to what the npc id id is in ur server XD so thats up to you and if im missing sometihng il add tommarow im going to bed... lol:lol:
converted for pali thanks to †_
- Code:
Shopbuyconfig
in there add
- Code:
/*
* Class Shopbuyconfig
*
* Version 1.0
*
* Novemeber 20, 2008
*
* Edited by †_`griffin.donnelly@yahoo.com>
*/
package palidino76.rs2.io.packets;
import palidino76.rs2.Engine;
import palidino76.rs2.players.Player;
import palidino76.rs2.util.Misc;
import palidino76.rs2.players.items.PlayerItems;
public class Shopbuyconfig implements Packet {
/**
* Handles operating equipped items.
* @param p The Player which the frame should be handled for.
* @param packetId The packet id this belongs to.
* @param packetSize The amount of bytes being recieved for this packet.
*/
public void handlePacket(Player p, int packetId, int packetSize) {
if (p == null || p.stream == null) {
return;
}
PlayerItems pi = new PlayerItems();
NPCOption1 N1 = new NPCOption1();
int junk = p.stream.readDWord();
int itemId = p.stream.readUnsignedWordA();
int itemSlot = p.stream.readUnsignedWordBigEndianA();
//if (itemSlot < 0 || itemSlot >= p.equipment.length || p.equipment[itemSlot] != itemId) {
// return;
//}
if (p.shopid == 2 && pi.haveItem(p, 995, p.shop2p[itemSlot]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop2p[itemSlot]);
pi.addItem(p, p.shop2[itemSlot], 1);
}
else if (p.shopid == 3 && pi.haveItem(p, 995, p.shop3p[0]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop3p[0]);
pi.addItem(p, p.shop3[itemSlot], 1);
}
else if (p.shopid == 4 && pi.haveItem(p, 995, p.shop4p[itemSlot]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop4p[itemSlot]);
pi.addItem(p, p.shop4[itemSlot], 1);
}
else if (p.shopid == 5 && pi.haveItem(p, 995, p.shop5p[0]))
{
pi.deleteItem(p, 995, pi.getItemSlot(p, 995), p.shop5p[0]);
pi.addItem(p, p.shop5[itemSlot], 1);
}
else
{
p.frames.sendMessage(p,"You dont have enough coins.");
}
}
}
next go to
- Code:
NPCOption1
then add
- Code:
case 197: //bandit
p.viewings = 1;
p.shopid = 2;
p.frames.showInterface(p, 278);
p.frames.setItems(p, 278, 89, 94, p.shop2, p.shop2n);
p.frames.setString(p, " <col=ffffff><img=1>God Range Armor Shop<img=0>", 278, 88);
break;
case 198: //fancy
p.viewings = 1;
p.shopid = 4;
p.frames.showInterface(p, 278);
p.frames.setItems(p, 278, 89, 94, p.shop4, p.shop4n);
p.frames.setString(p, " Fancy shop", 278, 88);
break;
case 200: //skill
p.viewings = 1;
p.shopid = 3;
p.frames.showInterface(p, 278);
p.frames.setItems(p, 278, 89, 94, p.shop3, p.shop3n);
p.frames.setString(p, " Skill cape shop", 278, 88);
break;
then go to
- Code:
player.java
and add
- Code:
public int[] shop2 = {10368, 10370, 10372, 10374, 10376,10378, 10380, 10382, 10384,10386, 10388, 10390, -1, -1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
public int[] shop2n = {10, 10, 10, 10,10,10,10,10,10,10,10,10, 110, 123, 0,0,0,0,0,0,0,0,0,0,0,0,0};
public int[] shop2p = {355000, 585000, 59000, 162000,12000,53000,28000,94000,260000,426000,40000,160000, 200000, 234561, 0,0,0,0,0,0,0,0,0,0,0,0,0};
public int[] shop3 = {9748, 9751, 9754, 9757, 9760,9763, 9766,9769, 9772, 9775, 9778,9781, 9784, 9787, 9790, 9793, 9796, 9799, 9801, 9804, 9807, 9810, 9811};
public int[] shop3n = {100000, 100000, 100000, 100000,100000,100000,100000,100000,100000,100000,100000,100000, 100000, 100000, 100000,100000,100000,100000,100000,100000,100000,100000,100000,100000};
public int[] shop3p = {99000};
public int[] shop4 = {11724, 11726, 11728, 11732, 11718,11720, 11722,11696, 11698, 11700, 11730,11694, 1052, 11284};
public int[] shop4n = {100000, 100000, 100000, 100000,100000,100000,100000,100000,100000,100000,100000,100000,100000, 100000, 100000};
public int[] shop4p = {11000000, 8900000, 990000, 288000,4200000,8400000,8700000,19300000,38100000,25600000,7500000,19300000,100000, 100000, 100000};
public int[] shop5 = {9748, 9751, 9754, 9757, 9760,9763, 9766,9769, 9772, 9775, 9778,9781, 9784, 9787, 9790};
public int[] shop5n = {10, 10, 10, 10,10,10,10,10,10,10,10,10,10,10,10};
public int[] shop5p = {99000};
public int shopid = 0;
public int viewings = 0;
next go to packetmanager.java
under
- Code:
public Walking walk = new Walking();
add
- Code:
public Shopbuyconfig shopbuyconfig = new Shopbuyconfig();
then find
- Code:
case 186:
/*
* Item operating.
*/
replace that whole case with
- Code:
case 186:
/*
* Item operating.
*/
if(p.viewings == 0) {
itemOperate.handlePacket(p, packetId, packetSize);
} else {
shopbuyconfig.handlePacket(p, packetId, packetSize);
}
next find
- Code:
case 108:
/*
* Remove open interfaces.
*/
and replace that case with
- Code:
case 108:
/*
* Remove open interfaces.
*/
p.viewings = 0;
p.frames.removeShownInterface(p);
break;
then go to itemoption1.java and add
- Code:
case 278:
if(itemId == p.shop2[itemSlot])
{
p.frames.sendMessage(p, "This item costs "+p.shop2p[itemSlot]);
}
else if(itemId == p.shop3[itemSlot])
{
p.frames.sendMessage(p, "This item costs "+p.shop3p[0]);
}
else if(itemId == p.shop4[itemSlot])
{
p.frames.sendMessage(p, "This item costs "+p.shop4p[itemSlot]);
}
else if(itemId == p.shop5[itemSlot])
{
p.frames.sendMessage(p, "This item costs "+p.shop5p[0]);
}
break;
next go to your playeritems.java and under
- Code:
/**
* Adds an item to the specified player.
* <p>Adds an item to Player p if that player has enough space. If it doesnt,
* it will return false and give the error message to the player,
* "Not enough space in your inventory."
* @param p The player to add the item to.
* @param itemId The item to give the player.
* @param itemAmt The amount of itemId to give the player.
* @return Returns true if the item was successfully added.
*/
add
- Code:
public boolean HasItemAmount(Player p, int itemID, int itemAmount) {
int playerItemAmountCount = 0;
for (int i=0; i<p.items.length; i++)
{
if (p.items[i] == itemID)
{
playerItemAmountCount = p.items[i];
}
if(playerItemAmountCount >= itemAmount){
return true;}
}
return false;
}
- Code:
/*Shops*/
spawn = 1552 2612 3089 0 0 0 0 0 santa
spawn = 553 3173 3498 0 0 0 0 0 aurbery
spawn = 1917 3170 3494 0 0 0 0 0 bandet
spawn = 554 3160 3494 0 0 0 0 0 fancy
spawn = 3838 3165 3496 0 0 0 0 0 skillcapes
Dragonking- Admin
- Posts : 12
Join date : 2008-11-08
Re: [release] 508 shops
Not bad at all, however I'm not into 508's atm lol.
King Redrum- Veteran
- Posts : 10
Join date : 2008-11-08
Age : 33
Location : Virginia.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Tue Aug 23, 2011 3:25 pm by Demonkill101
» wow gold wow
Wed Jun 08, 2011 11:47 pm by yangxue
» DragonScape 508 Server
Mon Mar 29, 2010 7:33 pm by AERA808
» Linksys, have you seen\do you know about this?
Tue Jan 20, 2009 1:18 pm by Demonkill101
» Rune-Server Domain Name Expired
Tue Jan 20, 2009 1:17 pm by Demonkill101
» Simple Attack requirement messup.
Sun Dec 28, 2008 11:43 am by thedisciple
» Dragonscape 508 Ip switcher v2
Fri Dec 26, 2008 8:54 pm by Ripvayne
» Rules Of This Forum
Fri Dec 26, 2008 8:53 pm by Ripvayne
» Dragonking/Patragon
Mon Dec 22, 2008 3:48 pm by Mr. Linksys