Thread: Sigex - Castle wars Ticket Exchange 100% [re:]

Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1 Sigex - Castle wars Ticket Exchange 100% [re:] 
    F*ck the rest join the best, WoR

    sigex's Avatar
    Join Date
    Mar 2008
    Age
    31
    Posts
    2,088
    Thanks given
    122
    Thanks received
    146
    Rep Power
    690
    This works on all WL servers and if your don't have any of the methods i used then just post and i will add them here.

    This was made by me! Sigex,littleplop (Stephen Rayner)
    and help from my friend x19 forgiving me the idear and helping me test/ collect data.

    How hard this is going to be? hmm not very. but i wouldn't try it if you can't read the code.. (c)


    Client.java:
    add this..

    [PHP]
    public void itemOnInterface(int frame,int item,int slot,int amount){
    outStream.createFrameVarSizeWord(34);
    outStream.writeWord(frame);
    outStream.writeByte(slot);
    outStream.writeWord(item+1);
    outStream.writeByte(255);
    outStream.writeDWord(amount);
    outStream.endFrameVarSizeWord();
    }
    public boolean isExchanging = false;
    public int[] cwCost = {4,8,5,6,6,40,80,50,60,60,400,800,500,600,600,10,1 0,10,10,5,};
    public int[] cwItems = {4071,4069,4068,4072,4070,4506,4504,4503,4507,4505 ,4511,4509,4508,4512,4510,4513,4514,4515,4516,4055 ,};
    public void openUpCWExchange(boolean show){
    int i = 0;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    itemOnInterface(12392,cwItems[i],i,server.cwStock[i]); i++;
    if(show) sendFrame248(11367,13293); resetItems(13294);
    i = 0; isExchanging = false;
    }
    public void ticketExchange(int itemID ,int itemSlot,int packet,int interfaceID){
    String currency = "tickets";
    if(interfaceID == 12392){
    if(packet == 145){
    if(itemID == 4055) currency = "coins";
    sendMessage("The "+GetItemName(itemID)+" costs "+cwCost[itemSlot]+" "+currency+".");
    } else {
    if(itemID == 4055){
    if(!playerHasItem(995,cwCost[itemSlot])){ currency = "coins";
    sendMessage("You need "+cwCost[itemSlot]+" "+currency+" to buy the "+GetItemName(itemID)+".");
    } else {
    if(freeSlots() > 0){
    deleteItem(995,cwCost[itemSlot]);
    server.cwStock[itemSlot] = server.cwStock[itemSlot]-1;
    openUpCWExchange(true); isExchanging = true;
    }
    addItem(4055,1);
    }
    } else {
    if(!playerHasItem(4067,cwCost[itemSlot])){ currency = "tickets";
    sendMessage("You need "+cwCost[itemSlot]+" "+currency+" to buy the "+GetItemName(itemID)+".");
    } else {
    if(freeSlots() > 0){
    deleteItem(4067,cwCost[itemSlot]);
    server.cwStock[itemSlot] = server.cwStock[itemSlot]-1;
    openUpCWExchange(true); isExchanging = true;
    }
    addItem(cwItems[itemSlot],1);
    }
    }
    }
    } else {
    if(packet == 145){
    if(itemID == cwItems[getItemArraySlot(itemID)] && itemID != 4055){
    sendMessage("The "+GetItemName(itemID)+" sells for "+cwCost[getItemArraySlot(itemID)]+" tickets.");
    } else {
    sendMessage("You can't sell this item to this shop.");
    }
    } else {
    if(itemID == cwItems[getItemArraySlot(itemID)] && itemID != 4055){
    deleteItem(itemID,itemSlot); addItem(4067,cwCost[getItemArraySlot(itemID)]);
    server.cwStock[getItemArraySlot(itemID)] = server.cwStock[getItemArraySlot(itemID)]+1;
    openUpCWExchange(true); isExchanging = true;
    } else {
    sendMessage("You can't sell this item to this shop.");
    }
    }
    }
    }
    public int getItemArraySlot(int item){
    for(int i = 0; i < cwItems.length; i++){
    if(item == cwItems[i]) return i;
    }
    return i;
    }[/PHP]

    and in process add

    [PHP] if(isExchanging == true){
    for(int i = 0; i < server.playerHandler.players.length; i++){
    Player p = server.playerHandler.players[i];
    if (p != null) {
    client person = (client) p;
    if(person.playerName != null) {
    person.openUpCWExchange(false);
    }
    }
    }
    }[/PHP]

    and to packet 145 and packet 117 (first and secound click options on interface)

    [PHP] else if (interfaceID == 12392 || interfaceID == 13294) {//Castle wars Ticket Exchange
    ticketExchange(removeID, removeSlot,packetType,interfaceID);
    }[/PHP]
    [PHP]
    else if (interfaceID == 12392 || interfaceID == 13294) {//Castle wars Ticket Exchange
    ticketExchange(removeID, removeSlot,packetType,interfaceID);
    }[/PHP]

    packet 17 option two on npc add switch or if

    [PHP]
    case 1526: openUpCWExchange(true); break;
    [/PHP]

    [PHP]if(NPCID == 1526){
    openUpCWExchange(true);
    }[/PHP]

    Server.java

    add this any were.. in server.java!!!

    [PHP]public static int[] cwStock = {100,100,100,100,100,50,50,50,50,50,25,25,25,25,25 ,200,200,200,200,1000,}/PHP]

    Right click trade the npc ant giving autospawn code you can make it... (H) cba to make it..and yea it all works sell buy value on interface and sidebar enjoy stock dont restore cba to do that yet and when i do im not giving it out so mines a little better then the one you guys would be using..


    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]




    else if(noob){
    Code:
    shop = -1	Castle wars Ticket Exchange		2	2	4071	100	4069	100	4068	100	4072	100	4070	100	4506	50	4504	50	4503	50	4507	50	4505	50	4511	25	4509	25	4508	25	4512	25	4510	25	4513	200	4514	200	4515	200	4516	200	4055	1000
    }


    The wor has begun.

    Reply With Quote  
     

  2. #2  
    Registered Member
    wh1p's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    1,983
    Thanks given
    26
    Thanks received
    285
    Rep Power
    320
    Eh Love this, everyone uses

    Nice job once again
    Reply With Quote  
     

  3. #3  
    F*ck the rest join the best, WoR

    sigex's Avatar
    Join Date
    Mar 2008
    Age
    31
    Posts
    2,088
    Thanks given
    122
    Thanks received
    146
    Rep Power
    690
    Quote Originally Posted by The Linux View Post
    Stop reposting Rep Whore
    lol dude get a life i'm like one of the most anti rep people on here..


    The wor has begun.

    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Jan 2008
    Age
    28
    Posts
    1,380
    Thanks given
    76
    Thanks received
    384
    Rep Power
    962
    Quote Originally Posted by sigex View Post
    lol dude get a life i'm like one of the most anti rep people on here..
    LOL thats a damn lie. All you did was copy your old cws tut DUH.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,336
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    whatd you change?
    Reply With Quote  
     

  6. #6  
    F*ck the rest join the best, WoR

    sigex's Avatar
    Join Date
    Mar 2008
    Age
    31
    Posts
    2,088
    Thanks given
    122
    Thanks received
    146
    Rep Power
    690
    Quote Originally Posted by stricken716 View Post
    LOL thats a damn lie. All you did was copy your old cws tut DUH.
    how has that got to do with rep? i reposted on sigex account because littleplop has been locked


    The wor has begun.

    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Jan 2008
    Posts
    1,338
    Thanks given
    243
    Thanks received
    85
    Rep Power
    250
    hmm ? i think it's nice if someone need cwars and this work..
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Simon
    Guest
    Quote Originally Posted by 5blacksmith5 View Post
    This looks smaller then your other... is it? I might use it if it works

    edit:
    Code:
    Files\Java\client.java:86: playerHasItem(int) in client cannot be applied to (in
    t,int)
                        if(!playerHasItem(995,cwCost[itemSlot])){ currency = "coins"
    ;
                            ^
    Files\Java\client.java:97: playerHasItem(int) in client cannot be applied to (in
    t,int)
                        if(!playerHasItem(4067,cwCost[itemSlot])){ currency = "ticke
    ts";
                            ^
    Note: Files\Java\stream.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    Press any key to continue . . .
    Maybe you don't need the !?
    Reply With Quote  
     

  9. #9  
    Soulze
    Guest
    why not just edit your shop packet so you need tickets for one shop?
    Reply With Quote  
     

  10. #10  
    Simon
    Guest
    Quote Originally Posted by Sarah P View Post
    why not just edit your shop packet so you need tickets for one shop?
    Hes trying to make it as simple as he can for new java coders.
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

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