Thread: [Vencillio] Bank chest inventory item (Donator perk?)

Results 1 to 10 of 10
  1. #1 [Vencillio] Bank chest inventory item (Donator perk?) 
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Hello dear rune-server community.

    I wanted to release this thing as some peoples might find it useful nothing too special about it. Easy to add so not going to spoonfeed if you need any help comment below.

    It is up to you how you decide the charged to be added to the game.

    What are you adding?

    https://imgur.com/oRy6Lza
    Attached image


    Client side:
    Code:
    case 8152:
    			itemDef.name = "Bank chest";
    			itemDef.description = "Used to open bank almost everywhere.".getBytes();
    			itemDef.itemActions = new String[5];
    			itemDef.itemActions[0] = "Open";
    			itemDef.itemActions[2] = "Check-charges";
    			itemDef.itemActions[4] = "Drop";
    			break;
    Server side:
    Code:
    public int bankCharges;
    Code:
    case 8152:
    				if (player.inWilderness() && player.inDuelArena() && player.inJailed() && player.inWGGame() && player.inWGLobby() && player.inCorp() && player.inGodwars()) {
    					player.send(new SendMessage("@red@You are not allowed to use this item in this location!"));
    					return;
    				} else {
    				if (player.bankCharges < 1) {
    					player.send(new SendMessage("You have no charges left."));
    					return;
    				} else {
    				if (player.bankCharges > 0) {
    					player.getBank().openBank();
    					player.bankCharges --;
    					player.send(new SendMessage("You have "+player.bankCharges+" charges left."));
    					return;
    					}
    		}
    	}
    	break;
    Code:
    case 8152:
    				player.send(new SendMessage("@red@You currently have @dre@"+player.bankCharges+" @red@charges left."));
    				break;
    For the player saving...
    Code:
    player.setBankCharges(details.bankCharges);
    Code:
    private final int bankCharges;
    Code:
    bankCharges = player.getBankCharges();
    Nothing too special and hard to do... But some of newbies might find it useful for their project or maybe someone else will create somethink similar for they own server
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Respected Member


    Join Date
    Jul 2015
    Posts
    781
    Thanks given
    206
    Thanks received
    394
    Rep Power
    524
    This conditional is impossible (assume you intended OR ||):
    Code:
    if (player.inWilderness() && player.inDuelArena() && player.inJailed() && player.inWGGame() && player.inWGLobby() && player.inCorp() && player.inGodwars())
    also, your use of a single nested 'if' instead an else is weird, and could just be an 'else if'..

    Code:
    boolean canUse = (player.inWilderness() || player.inDuelArena() || player.inJailed() || player.inWGGame() || player.inWGLobby() || player.inCorp() || player.inGodwars();
    
    if (canUse && player.bankCharges > 0) {
        // do your stuff
    } else {
        player.send(new SendMessage("You " + canUse ? "have no charges left." : "are not allowed to use this item in this location"));
    }
    Reply With Quote  
     

  4. #3  
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by Khaleesi View Post
    This conditional is impossible (assume you intended OR ||):
    Code:
    if (player.inWilderness() && player.inDuelArena() && player.inJailed() && player.inWGGame() && player.inWGLobby() && player.inCorp() && player.inGodwars())
    also, your use of a single nested 'if' instead an else is weird, and could just be an 'else if'..

    Code:
    boolean canUse = (player.inWilderness() || player.inDuelArena() || player.inJailed() || player.inWGGame() || player.inWGLobby() || player.inCorp() || player.inGodwars();
    
    if (canUse && player.bankCharges > 0) {
        // do your stuff
    } else {
        player.send(new SendMessage("You " + canUse ? "have no charges left." : "are not allowed to use this item in this location"));
    }
    Somethink i found inside my source been there for some time i should improve it little but this is a snippet so maybe someone will use but thanks for pointing this out to me
    Reply With Quote  
     

  5. #4  
    TeraPS Founder

    OneTrueGodTet's Avatar
    Join Date
    Jan 2012
    Posts
    115
    Thanks given
    45
    Thanks received
    21
    Rep Power
    146
    pretty cool nice release mate


    Rip.
    Spoiler for vouches:
    http://smokin-elite.forumotion.com/t81285-kid-gildarts-vouches-19#1123917


    Reply With Quote  
     

  6. #5  
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by OneTrueGodTet View Post
    pretty cool nice release mate
    Thanks
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Jan 2019
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Thank you for this, but the banktabs are broken on vencillio
    Reply With Quote  
     

  8. #7  
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by pioz View Post
    Thank you for this, but the banktabs are broken on vencillio
    Yup i know i've fixxed that issue long time ago not even sure what was causing it...
    Reply With Quote  
     

  9. #8  
    Registered Member
    Join Date
    Jan 2019
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by replicant View Post
    Yup i know i've fixxed that issue long time ago not even sure what was causing it...
    You got the bank java, can you share it? Thank you very much!

    Sent from my EML-L29 using Tapatalk
    Reply With Quote  
     

  10. #9  
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by DirtyCream View Post
    Just a random question because this is a pretty cool idea. Instead of opening it like a bank would it be possible to make it a "casket" where it gives random loot sort like a clue scroll? And, if so could you point me in the right direction of making it into a a reward chest vs bank one (as in perhaps a file to look for or really whatever information you can give). Because I been doing a lot of trial and error with different things, and I find it kind of tough to create things like a reward chest from scratch mainly because I haven't found an example I can follow. The best I can do currently is edit the items; granted I just started learning how to do the developer side of RSPS I know, I know I'm a tad late to the party.
    Indeed you can convert it to whatever you want. In item defition you can change the name from "Bank chest" To whatever you want and than you have to code the rewards handling (vencillio alredy have clue scrolls) so if you look around you might be able to figure it out

    If you need more help add my discord Replicant#1054
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Mar 2019
    Posts
    57
    Thanks given
    3
    Thanks received
    2
    Rep Power
    13
    @replicant
    Could you help me convert this into a storage chest used during an instance upon a teleport?
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 10-05-2013, 01:20 PM
  2. How to make items donater/owner/admin only
    By pwnage8 in forum Tutorials
    Replies: 20
    Last Post: 12-18-2011, 11:29 AM
  3. Z-508 PKING help.. WITH ITEMS/DONATOR
    By project-infinity' in forum Help
    Replies: 3
    Last Post: 10-31-2009, 03:56 PM
  4. Replies: 3
    Last Post: 07-18-2009, 02:16 AM
  5. Bank if inventory full
    By Jukk in forum Show-off
    Replies: 10
    Last Post: 06-07-2009, 08:47 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •