Thread: 317 Mystery box spinner

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37
  1. #1 317 Mystery box spinner 
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    thought id make this quick.. took 1 hr, kinda inspired by Nighels graphics..posting bc its not hard to do and other ppl could use it

    Attached image

    sprites
    Code:
    public static void spinTab(GameFont[] wid) {
    		Widget list = addTabInterface(13000);
    		Widget items = addTabInterface(13100);
    		Widget reward = addTabInterface(13300);
    		reward.invisible = true;
    		addTransparentSprite(13301, 546, 90);
    		addSprite(13302, 547);
    		addText(13304, "You won:", wid, 2, 0xff9040, true, true);
    		addText(13305, "name_here", wid, 1, 0xff9040, true, true);
    		Widget rewardContainer = addTabInterface(13303);
    		rewardContainer.spritesX = new int[1];
    		rewardContainer.spritesY = new int[1];
    		rewardContainer.inventoryItemId = new int[1];
    		rewardContainer.inventoryAmounts = new int[300];
    		rewardContainer.filled = false;
    		rewardContainer.replaceItems = false;
    		rewardContainer.usableItems = false;
    		rewardContainer.hasActions = false;
    		rewardContainer.invisible = true;
    		rewardContainer.allowSwapItems = false;
    		rewardContainer.spritePaddingX = 0;
    		rewardContainer.spritePaddingY = 0;
    		rewardContainer.height = 1;
    		rewardContainer.width = 1;
    		rewardContainer.parent = 41002;
    		rewardContainer.type = TYPE_INVENTORY;
    		int rewardChild = 0;
    		reward.totalChildren(8);
    		reward.child(rewardChild++, 13301, 0, 0);
    		reward.child(rewardChild++, 13302, 140, 110);
    		reward.child(rewardChild++, 13003, 190, 42);
    		reward.child(rewardChild++, 13004, 190, 42);
    		reward.child(rewardChild++, 13007, 245, 47);
    		reward.child(rewardChild++, 13303, 230, 127);
    		reward.child(rewardChild++, 13304, 245, 172);
    		reward.child(rewardChild++, 13305, 244, 188);
    		items.width = 391;
    		addSprite(13001, 539);
    		addSprite(13002, 538);
    		addHoverButton_sprite_loader(13003, 542, 114, 25, "Spin", 250, 13004, 0);
    		addHoveredButton_sprite_loader(13004, 543, 114, 25, 4400);
    		addText(13007, "SPIN", wid, 2, 0xff9040, true, true);
    		addText(13009, "Spin to win!", wid, 2, 0xff9040, true, true);
    		addText(13010, "Possible rewards:", wid, 2, 0xff9040, true, true);
    		addHoverText3(13011, "<u>Buy more spins", "Go to website", wid, 0, 0xff9040, true, false, 75, 0xFFB885);
    		addSprite(13101, 541);
    		addSprite(13012, 544);
    		addText(13014, "New items in:", wid, 2, 0xff9040, true, true);
    		addText(13015, "24:00", wid, 0, 0xff9040, false, true);
    		addText(13016, "Spins left:", wid, 2, 0xff9040, true, true);
    		addText(13017, "100", wid, 0, 0xff9040, false, true);
    		addText(13018, "Total gp won:", wid, 2, 0xff9040, true, true);
    		addText(13019, "1.5b", wid, 0, 0xff9040, false, true);
    		Widget container = addTabInterface(13200);
    		container.spritesX = new int[300];
    		container.spritesY = new int[300];
    		container.inventoryItemId = new int[300];
    		container.inventoryAmounts = new int[300];
    		container.filled = false;
    		container.replaceItems = false;
    		container.usableItems = false;
    		container.hasActions = false;
    		container.invisible = true;
    		container.allowSwapItems = false;
    		container.spritePaddingX = 9;
    		container.spritePaddingY = 0;
    		container.height = 1;
    		container.width = 300;
    		container.parent = 41002;
    		container.type = TYPE_INVENTORY;
    		Widget possibleRewards = addTabInterface(13202);
    		possibleRewards.spritesX = new int[300];
    		possibleRewards.spritesY = new int[300];
    		possibleRewards.inventoryItemId = new int[300];
    		possibleRewards.inventoryAmounts = new int[300];
    		possibleRewards.filled = false;
    		possibleRewards.replaceItems = false;
    		possibleRewards.usableItems = false;
    		possibleRewards.hasActions = false;
    		possibleRewards.invisible = true;
    		possibleRewards.allowSwapItems = false;
    		possibleRewards.spritePaddingX = 9;
    		possibleRewards.spritePaddingY = 0;
    		possibleRewards.height = 20;
    		possibleRewards.width = 4;
    		possibleRewards.parent = 41002;
    		possibleRewards.type = TYPE_INVENTORY;
    		Widget rewardScroll = addTabInterface(13201);
    		rewardScroll.width = 161;
    		rewardScroll.height = 133;
    		rewardScroll.scrollMax = 455;
    		int rewardScrollChild = 0;
    		rewardScroll.totalChildren(1);
    		rewardScroll.child(rewardScrollChild, 13202, 0, 0);
    		int listChild = 0;
    		int itemChild = 0;
    		items.totalChildren(2);
    		items.child(itemChild++, 13101, 0, 0);
    		items.child(itemChild++, 13200, 3, 3);
    		list.totalChildren(18);
    		list.child(listChild++, 13001, 10, 10);
    		list.child(listChild++, 13003, 200, 52);
    		list.child(listChild++, 13004, 200, 52);
    		list.child(listChild++, 13007, 255, 57);
    		list.child(listChild++, 13009, 252, 20);
    		list.child(listChild++, 13100, 58, 86);
    		list.child(listChild++, 13002, 250, 83);
    		list.child(listChild++, 13010, 145, 130);
    		list.child(listChild++, 13201, 60, 152);
    		list.child(listChild++, 13011, 27, 21);
    		list.child(listChild++, 13012, 265, 170);
    		list.child(listChild++, 13014, 337, 180);
    		list.child(listChild++, 13015, 385, 183);
    		list.child(listChild++, 13016, 345, 203);
    		list.child(listChild++, 13017, 385, 206);
    		list.child(listChild++, 13018, 345, 226);
    		list.child(listChild++, 13019, 392, 229);
    		list.child(listChild++, 13300, 10, 10);
    	}
    Code:
    private void startSpinner() {
    		Widget w = Widget.interfaceCache[13101];
    		Widget w2 = Widget.interfaceCache[13200];
    		Widget rewardInt = Widget.interfaceCache[13300];
    		Widget rewards = Widget.interfaceCache[13303];
    		if(w.horizontalOffset >= -1000) {
    			w.horizontalOffset -= 25;
    			w2.horizontalOffset -= 25;
    		}
    		if(w.horizontalOffset >= -1912 && w.horizontalOffset <= -1001) {
    			w.horizontalOffset -= (25 / spinSpeed);
    			w2.horizontalOffset -= (25 / spinSpeed);
    		spinSpeed = spinSpeed + 0.07f;
    		}
    		if(w.horizontalOffset >= -2000 && w.horizontalOffset < -1913) {
    			w.horizontalOffset -= (25 / spinSpeed);
    			w2.horizontalOffset -= (25 / spinSpeed);
    			spinSpeed = spinSpeed + 2f;
    		}
    		if(w.horizontalOffset <= -1913) {
    			rewardInt.invisible = false;
    			amountValue += (w2.inventoryAmounts[51] * ItemDefinition.lookup((w2.inventoryItemId[51]) - 1).value);
    			Widget.interfaceCache[13019].defaultText = Integer.toString(amountValue);
    			Widget.interfaceCache[13305].defaultText = ItemDefinition.lookup((w2.inventoryItemId[51]) - 1).name.replaceAll("_", " ");
    			rewards.inventoryItemId[0] = w2.inventoryItemId[51];
    			rewards.inventoryAmounts[0] = w2.inventoryAmounts[51];
    			startSpin = false;
    			
    		}
    	}
    and if you'd like to test it client sided, DO NOT USE THIS FOR FINAL PRODUCT

    Code:
    if(startSpin) {
    			startSpinner();
    		}
    Code:
    if (inputString.contains("::int 13000")) {
    						Widget w = Widget.interfaceCache[13200];
    						Widget w2 = Widget.interfaceCache[13202];
    						for(int i = 0; i < rewards.length; i++) {
    							w2.inventoryItemId[i] = rewards[i];
    							w2.inventoryAmounts[i] = 1;
    							if(w2.inventoryItemId[i] == 996) {
    									w2.inventoryAmounts[i] = 50000000;
    							}
    							
    						}
    						for(int j22 = 0; j22 < 300; j22++) {
    						if(j22 == w.inventoryItemId.length) {
    							break;
    						}
    							w.inventoryItemId[j22] = rewards[MiscUtils.random(rewards.length - 1)];
    							w.inventoryAmounts[j22] = 1;
    							if(w.inventoryItemId[j22] == 996) {
    								w.inventoryAmounts[j22] = 50000000;
    						}
    							
    						}
    					}
    					if (inputString.startsWith("::spin")) {
    						if(spinSpeed > 1) {
    							Widget w = Widget.interfaceCache[13200];
    							Widget w2 = Widget.interfaceCache[13202];
    							for(int i = 0; i < rewards.length; i++) {
    								w2.inventoryItemId[i] = rewards[i];
    								w2.inventoryAmounts[i] = 1;
    								if(w2.inventoryItemId[i] == 996) {
    									w2.inventoryAmounts[i] = 50000000;
    							}
    							}
    							for(int j22 = 0; j22 < 300; j22++) {
    							if(j22 == w.inventoryItemId.length) {
    								break;
    							}
    								w.inventoryItemId[j22] = rewards[MiscUtils.random(rewards.length - 1)];
    								w.inventoryAmounts[j22] = 1;
    								if(w.inventoryItemId[j22] == 996) {
    									w.inventoryAmounts[j22] = 50000000;
    							}
    								
    							}
    						}
    						spinSpeed = 1;
    						Widget.interfaceCache[13101].horizontalOffset = 0;
    						Widget.interfaceCache[13200].horizontalOffset = 0;
    						Widget.interfaceCache[13300].invisible = true;
    						startSpin = true;
    					}
    Last edited by rebecca; 06-26-2018 at 12:02 PM.
    Reply With Quote  
     


  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Looks good GJ.
    Reply With Quote  
     

  3. #3  
    Super Donator

    RSPSi's Avatar
    Join Date
    Mar 2011
    Posts
    169
    Thanks given
    70
    Thanks received
    173
    Rep Power
    328
    Looks great man. Just an FYI, this
    Code:
    inventoryAmounts = new int[100000000];
    Only needs to be the same size as inventoryItemId is since they're linked.
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    Quote Originally Posted by RSPSi View Post
    Looks great man. Just an FYI, this
    Code:
    inventoryAmounts = new int[100000000];
    Only needs to be the same size as inventoryItemId is since they're linked.
    oh yeah sorry that was just a test i forgot to revert it
    Reply With Quote  
     

  6. #5  
    Banned

    Join Date
    May 2016
    Age
    55
    Posts
    1,137
    Thanks given
    565
    Thanks received
    600
    Rep Power
    0
    nice thanks for the share.
    Reply With Quote  
     

  7. #6  
    Banned

    Join Date
    Mar 2015
    Age
    31
    Posts
    1,332
    Thanks given
    215
    Thanks received
    329
    Rep Power
    0
    goodjob buddy
    Reply With Quote  
     

  8. #7  
    Donator

    Join Date
    Jan 2009
    Posts
    468
    Thanks given
    144
    Thanks received
    41
    Rep Power
    65
    looks good buddy
    Reply With Quote  
     

  9. #8  
    Registered Member

    Join Date
    Feb 2013
    Posts
    1,682
    Thanks given
    401
    Thanks received
    402
    Rep Power
    446
    Your release are pretty useful & decent buddy.

    Thank you.
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Nov 2017
    Posts
    304
    Thanks given
    36
    Thanks received
    75
    Rep Power
    3
    Nice job!

    PS: I think you made Nighel run out of business ;P
    Reply With Quote  
     

  11. Thankful user:


  12. #10  
    Registered Member
    Join Date
    Oct 2013
    Posts
    72
    Thanks given
    23
    Thanks received
    13
    Rep Power
    11
    Nice, I made one of these a couple of week ago.

    Wasn't too hard.

    I'm glad someone has released anyway, people are charging a fuck load for this and it's essentially just moving some sprites.

    GJ Anyway!
    Reply With Quote  
     

Page 1 of 4 123 ... 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. 317 PI Mystery Box (ADVANCED)
    By x USMC x in forum Tutorials
    Replies: 36
    Last Post: 04-23-2015, 03:35 AM
  2. [317] Mystery Box Help
    By SGS5 in forum Help
    Replies: 4
    Last Post: 08-21-2013, 08:42 PM
  3. Replies: 18
    Last Post: 08-17-2013, 01:18 AM
  4. Replies: 3
    Last Post: 03-30-2013, 08:05 AM
  5. [317] Mystery Box [317]
    By pyrotic in forum Tutorials
    Replies: 25
    Last Post: 08-18-2011, 12:24 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
  •