Rune Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Donate
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Guys Its Me PrettyBirds I'm Back !
[release] 508 shops EmptyTue Aug 23, 2011 3:25 pm by Demonkill101

» wow gold wow
[release] 508 shops EmptyWed Jun 08, 2011 11:47 pm by yangxue

» DragonScape 508 Server
[release] 508 shops EmptyMon Mar 29, 2010 7:33 pm by AERA808

» Linksys, have you seen\do you know about this?
[release] 508 shops EmptyTue Jan 20, 2009 1:18 pm by Demonkill101

» Rune-Server Domain Name Expired
[release] 508 shops EmptyTue Jan 20, 2009 1:17 pm by Demonkill101

» Simple Attack requirement messup.
[release] 508 shops EmptySun Dec 28, 2008 11:43 am by thedisciple

» Dragonscape 508 Ip switcher v2
[release] 508 shops EmptyFri Dec 26, 2008 8:54 pm by Ripvayne

» Rules Of This Forum
[release] 508 shops EmptyFri Dec 26, 2008 8:53 pm by Ripvayne

» Dragonking/Patragon
[release] 508 shops EmptyMon Dec 22, 2008 3:48 pm by Mr. Linksys

Top posters
Mr. Linksys (18)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
Demonkill101 (13)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
Dragonking (12)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
Ripvayne (10)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
King Redrum (10)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
daniel89 (6)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
Lighting bolt (5)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
someguy (3)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
thedisciple (3)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 
yangxue (2)
[release] 508 shops Votingbar2[release] 508 shops Votingbar[release] 508 shops Votingbar3 


[release] 508 shops

4 posters

Go down

[release] 508 shops Empty [release] 508 shops

Post  Dragonking Sat Nov 22, 2008 8:37 pm

FIRST OFF CREDS

  • 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

  1. I edited everything and changed it
  2. this should be in ever server...
  3. other people are about to release
  4. 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;
now last go to ur npcspawn.cfg and add

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:

[release] 508 shops Ztzp5d

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;
      }
now last go to ur npcspawn.cfg and add

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
Admin

Posts : 12
Join date : 2008-11-08

Back to top Go down

[release] 508 shops Empty Re: [release] 508 shops

Post  King Redrum Sun Nov 23, 2008 8:20 pm

Not bad at all, however I'm not into 508's atm lol.
King Redrum
King Redrum
Veteran
Veteran

Posts : 10
Join date : 2008-11-08
Age : 33
Location : Virginia.

Back to top Go down

[release] 508 shops Empty Re: [release] 508 shops

Post  Demonkill101 Mon Nov 24, 2008 10:57 am

woah lol i suck at coding ;p
Demonkill101
Demonkill101
Veteran
Veteran

Posts : 13
Join date : 2008-11-08
Age : 29
Location : Streets

https://www.youtube.com/fatbobster

Back to top Go down

[release] 508 shops Empty Re: [release] 508 shops

Post  pur3frostyx3 Sun Nov 30, 2008 7:28 pm

thanks, added to my server

pur3frostyx3
Newbie

Posts : 2
Join date : 2008-11-30

Back to top Go down

[release] 508 shops Empty Re: [release] 508 shops

Post  Demonkill101 Wed Dec 17, 2008 9:50 am

:O didn't hav to do anything Razz alredy on my source
Demonkill101
Demonkill101
Veteran
Veteran

Posts : 13
Join date : 2008-11-08
Age : 29
Location : Streets

https://www.youtube.com/fatbobster

Back to top Go down

[release] 508 shops Empty Re: [release] 508 shops

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum