Thread: [OSRSPK/Elvarg] Platinum Token exchanging

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 [OSRSPK/Elvarg] Platinum Token exchanging 
    Registered Member
    Join Date
    Apr 2017
    Posts
    303
    Thanks given
    34
    Thanks received
    59
    Rep Power
    65
    Very simple to do, kind of nice to have an additional currency that many stakers should be familiar with being introduced into the economy.

    Modify to your needs.

    Anyways. Add this into your Items.json file.
    Code:
    	{
    	  "id": 13204,
    	  "name": "Platinum Tokens",
    	  "examine": "Shiny currency, could be useful to some.",
    	  "value": 1000,
    	  "stackable": true,
    	  "noted": false,
    	  "noteId": -1,
    	  "tradeable": true,
    	  "sellable": false,
    	  "dropable": true
    	},
    In your UseItemPacketListener class, itemOnObject method
    Code:
    		if (itemId == 995 && gameObject.getDefinition().getName().contains("Bank")) {
    			final int size = player.getInventory().getAmount(995);
    			player.getInventory().delete(new Item(995, size));
    			player.getInventory().add(new Item(13204, size / 2));
    			player.getPacketSender().sendMessage("You exchange " + Misc.format(size) + " Coins for " + Misc.format(player.getInventory().getAmount(13204)) + " Platinum tokens.");
    		}
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2016
    Posts
    106
    Thanks given
    16
    Thanks received
    14
    Rep Power
    69
    how would you go about making
    1 platinum token give back 1000 coins

    i've done it so 1000 coins gives 1 platinum token,
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Feb 2015
    Posts
    818
    Thanks given
    11
    Thanks received
    192
    Discord
    View profile
    Rep Power
    112
    Quote Originally Posted by Too Moist View Post
    how would you go about making
    1 platinum token give back 1000 coins

    i've done it so 1000 coins gives 1 platinum token,
    just do amount of tokens x 1000:
    for example: Amount being the amount of tokens exchanged.
    player.getItems().addItem(13204, amount / 1000);
    Reply With Quote  
     

  4. #4  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    25
    Posts
    4,432
    Thanks given
    892
    Thanks received
    1,525
    Rep Power
    3228
    Simple but thanks
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member
    Andys1814's Avatar
    Join Date
    Feb 2013
    Posts
    978
    Thanks given
    684
    Thanks received
    449
    Rep Power
    672
    The way you're doing it, you just print out the number of platinum tokens in the inventory. If there is already more tokens in the inventory this won't work as intended.


    You should, instead, make a separate variable for the tokens that tracks the amount of coins in your inventory and divides by two, as such:

    Code:
    int tokens = size / 2;
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Apr 2017
    Posts
    18
    Thanks given
    0
    Thanks received
    2
    Rep Power
    0
    simple but thanks anyway !!!
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Apr 2017
    Posts
    303
    Thanks given
    34
    Thanks received
    59
    Rep Power
    65
    Quote Originally Posted by Andys1814 View Post
    The way you're doing it, you just print out the number of platinum tokens in the inventory. If there is already more tokens in the inventory this won't work as intended.


    You should, instead, make a separate variable for the tokens that tracks the amount of coins in your inventory and divides by two, as such:

    Code:
    int tokens = size / 2;
    Yeah I got lazy when writing this quickly up.
    Reply With Quote  
     

  8. #8  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,858
    Thanks given
    1,206
    Thanks received
    1,614
    Rep Power
    5000
    Quote Originally Posted by Too Moist View Post
    how would you go about making
    1 platinum token give back 1000 coins

    i've done it so 1000 coins gives 1 platinum token,
    just make it do the same thing but the other way around lol
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Jun 2016
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Code:
    		}
    		if (itemId == 13307 && gameObject.getDefinition().getName().contains("Bank")) {
    			final int size = player.getInventory().getAmount(13307);
    			player.getInventory().delete(new Item(13307, size));
    			player.getInventory().add(new Item(13204, size / 2));
    			player.getPacketSender().sendMessage("You exchange " + Misc.format(size) + " Blood money for " + Misc.format(player.getInventory().getAmount(13204)) + " Platinum tokens.");
    		}
    		if (itemId == 13204 && gameObject.getDefinition().getName().contains("Bank")) {
    			final int size = player.getInventory().getAmount(13204);
    			player.getInventory().delete(new Item(13204, size));
    			player.getInventory().add(new Item(13307, size * 2));
    			player.getPacketSender().sendMessage("You exchange " + Misc.format(size) + " Platinum tokens for " + Misc.format(player.getInventory().getAmount(13307)) + " Blood money.");
    		}
    	}
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Mar 2020
    Posts
    29
    Thanks given
    7
    Thanks received
    0
    Rep Power
    10
    Okay i need help i tried to add it to the game but still give me error... Any of you can help me?

    Token id=12852
    Coin id=995
    Token value=1,000,000
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. [REQ] Platinum Tokens
    By pityer tank in forum Models
    Replies: 6
    Last Post: 11-07-2020, 07:56 AM
  2. Platinum Tokens? [PI]
    By zayuhh in forum Help
    Replies: 1
    Last Post: 02-14-2017, 12:12 AM
  3. [REQ Platinum tokens + ints]
    By White Vans in forum Models
    Replies: 3
    Last Post: 11-08-2015, 09:17 AM
  4. skilling token exchange?
    By pk3r john in forum Help
    Replies: 4
    Last Post: 11-22-2011, 11:26 PM
  5. Minigame Token Exchanging
    By Rugrats in forum Help
    Replies: 4
    Last Post: 04-19-2009, 09:20 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •