Thread: Gambling XP [OFFICIAL RELEASE]

Page 1 of 10 123 ... LastLast
Results 1 to 10 of 99
  1. #1 Gambling XP [OFFICIAL RELEASE] 
    Registered Member
    Join Date
    Jan 2007
    Posts
    329
    Thanks given
    0
    Thanks received
    0
    Rep Power
    60
    Purpose: To add gambling to your server (no glitches!)

    Difficulty: 2

    Assumed Knowledge: Copy and paste

    Server Base: Chezzscape

    Classes Modified: client.java

    Procedure

    Ok open client.java and add this method:

    Code:
    public int GambleEmote(int RandomLevel) {
    		emoteTimer = 5;
            if (RandomLevel == 0) { //ATTACK
                    return 2890;
    			}
    		 if (RandomLevel == 1) { //DEF
                    return 2836;
                }
    		 if (RandomLevel == 2) { //STR
                    return 3157;
                }
    		 if (RandomLevel == 3) { //HP
                    return 921;
                }
    		 if (RandomLevel == 4) { //RANGE
                    return 426;
                }
    		 if (RandomLevel == 5) { //PRAY
                    return 827;
                }
    		 if (RandomLevel == 6) { //MAGIC
                    return 1979;
                }
    				return 860;
    			}
    Then add all these cases under object click one, by your other cases

    Code:
    case 2693:
    					if(!playerHasItemAmount(995, 50000) && actionTimer <= 0) 
    					{
    						sendFrame126("@red@This gambling chest requires you to have 50k", 357);
    						sendFrame126("@red@Click here to continue", 358);
    						sendFrame164(356);
    					} 
    					else if(playerHasItemAmount(995, 50000) && actionTimer <= 0) 
    					{
    						double roll = Math.random()*100;
    						if (roll < 9.0) 
    							{
    								int[]items =  {};
    								int r = (int)(Math.random()*items.length);
    								int xp = misc.random(15000);
    								int RandomLevel = misc.random(6);
    								addSkillXP((xp*playerLevel[RandomLevel]), RandomLevel);	
    								actionTimer = 12;
    								deleteItem(995, GetItemSlot(995), 50000);
    								pEmote = GambleEmote(RandomLevel);
    								sendFrame126("@red@You won "+xp+" exp in "+GambleStat[RandomLevel]+"", 357);
    								sendFrame126("@red@Click here to continue", 358);
    								sendFrame164(356);
    							}
    							else if(roll > 9.0) 
    							{   								
    				                sendMessage("Sorry you've lost you're cash!");
    				                deleteItem(995, GetItemSlot(995), 50000);
    								actionTimer = 12;
    								stillgfx(444, objectY, objectX);
    							}
    					}
    					break;
    case 2197:
    				sendMessage("under con.");
    			 break;	
    					
    					
    case 5270:
    				if(!playerHasItemAmount(995, 100000) && actionTimer <= 0)
    				{
    					sendFrame126("@red@This gambling chest requires you to have 100k", 357);
    						sendFrame126("@red@Click here to continue", 358);
    						sendFrame164(356);
    				}
    				else if(playerHasItemAmount(995, 100000) && actionTimer <= 0)
    				{
    	                double roll = Math.random()*100;
    	                if (roll < 11.0) 
    							{
    								int[]items =  {};
    								int r = (int)(Math.random()*items.length);
    								int xp = misc.random(18000);
    								int RandomLevel = misc.random(6);
    								addSkillXP((xp*playerLevel[RandomLevel]), RandomLevel);	
    								actionTimer = 12;
    								deleteItem(995, GetItemSlot(995), 100000);
    								pEmote = GambleEmote(RandomLevel);
    								sendFrame126("@red@You won "+xp+" exp in "+GambleStat[RandomLevel]+"", 357);
    								sendFrame126("@red@Click here to continue", 358);
    								sendFrame164(356);
    							}
    							else if(roll > 11.0) 
    							{   								
    				                sendMessage("Sorry you've lost you're cash!");
    				                deleteItem(995, GetItemSlot(995), 100000);
    								actionTimer = 12;
    								stillgfx(444, objectY, objectX);
    					}
    				}
    			 break;		
    
    					case 5272:
    					if(!playerHasItemAmount(995, 500000) && actionTimer <= 0) 
    					{
    						sendFrame126("@red@This gambling chest requires you to have 500k", 357);
    						sendFrame126("@red@Click here to continue", 358);
    						sendFrame164(356);
    					} 
    					else if(playerHasItemAmount(995, 500000) && actionTimer <= 0) 
    					{
    						double roll = Math.random()*100;
    						if (roll < 14.0) 
    							{
    								int[]items =  {};
    								int r = (int)(Math.random()*items.length);
    								int xp = misc.random(25000);
    								int RandomLevel = misc.random(6);
    								addSkillXP((xp*playerLevel[RandomLevel]), RandomLevel);	
    								actionTimer = 12;
    								deleteItem(995, GetItemSlot(995), 500000);
    								pEmote = GambleEmote(RandomLevel);
    								sendFrame126("@red@You won "+xp+" exp in "+GambleStat[RandomLevel]+"", 357);
    								sendFrame126("@red@Click here to continue", 358);
    								sendFrame164(356);
    							}
    							else if(roll > 14.0) 
    							{   								
    				                sendMessage("Sorry you've lost you're cash!");
    				                deleteItem(995, GetItemSlot(995), 500000);
    								actionTimer = 12;
    								stillgfx(444, objectY, objectX);
    							}
    					}
    					break;		
    
    					case 5273:
    					if(!playerHasItemAmount(995, 5000000) && actionTimer <= 0) 
    					{
    						sendFrame126("@red@This gambling chest requires you to have 5M", 357);
    						sendFrame126("@red@Click here to continue", 358);
    						sendFrame164(356);
    					} 
    					else if(playerHasItemAmount(995, 5000000) && actionTimer <= 0) 
    					{
    						double roll = Math.random()*100;
    						if (roll < 22.3) 
    							{
    								int[]items =  {};
    								int r = (int)(Math.random()*items.length);
    								int xp = misc.random(130300);
    								int RandomLevel = misc.random(6);
    								addSkillXP((xp*playerLevel[RandomLevel]), RandomLevel);	
    								actionTimer = 12;
    								deleteItem(995, GetItemSlot(995), 5000000);
    								pEmote = GambleEmote(RandomLevel);
    								sendFrame126("@red@You won "+xp+" exp in "+GambleStat[RandomLevel]+"", 357);
    								sendFrame126("@red@Click here to continue", 358);
    								sendFrame164(356);
    							}
    							else if(roll > 22.3) 
    							{   								
    				                sendMessage("Sorry you've lost you're cash!");
    				                deleteItem(995, GetItemSlot(995), 5000000);
    								actionTimer = 12;
    								stillgfx(444, objectY, objectX);
    							}
    					}
    					break;			
    
    					case 103:
    					if(!playerHasItemAmount(995, 100000000) && actionTimer <= 0) 
    					{
    						sendFrame126("@red@This gambling chest requires you to have 100M", 357);
    						sendFrame126("@red@Click here to continue", 358);
    						sendFrame164(356);
    					} 
    					else if(playerHasItemAmount(995, 100000000) && actionTimer <= 0) 
    					{
    						double roll = Math.random()*100;
    						if (roll < 27.1) 
    							{
    								int[]items =  {};
    								int r = (int)(Math.random()*items.length);
    								int xp = misc.random(200000);
    								int RandomLevel = misc.random(6);
    								addSkillXP((xp*playerLevel[RandomLevel]), RandomLevel);	
    								actionTimer = 12;
    								deleteItem(995, GetItemSlot(995), 100000000);
    								pEmote = GambleEmote(RandomLevel);
    								sendFrame126("@red@You won "+xp+" exp in "+GambleStat[RandomLevel]+"", 357);
    								sendFrame126("@red@Click here to continue", 358);
    								sendFrame164(356);
    							}
    							else if(roll > 27.1) 
    							{   								
    				                sendMessage("Sorry you've lost you're cash!");
    				                deleteItem(995, GetItemSlot(995), 100000000);
    								actionTimer = 12;
    								stillgfx(444, objectY, objectX);
    							}
    					}
    					break;
    Next declare this int and timer, to do this, put the int above boolean process, or almost anywhere, and put the timer BELOW boolean process:

    Code:
    public int emoteTimer;
    and put this below boolean process:

    Code:
    if(emoteTimer > 0) {
    	emoteTimer--;
    	}
    	if(emoteTimer <= 0) {
    	resetAnimation();
    	}
    Next add this public string, with your other public strings, e.g. above public String teleLoc = ""; would be ok

    Code:
    public String GambleStat[] = {"Attack", "Defence", "Strength", "Hitpoints", "Range", "Prayer", "Magic"};

    Theres 5 chests, a 50k chest, 100k chest, 500k chest, 5m chest, and 100m chest. the higher the chest the better chance you have of winning and the more you could win.


    Pictures:







    I worked EXTREMELY hard on this! So comments are appreciated!

    Credits: Me
     

  2. #2  
    Lostprophets
    Guest
    Wow this is awesome rep =)

    Lame i gotta spread it around ill make sure ill get you
     

  3. #3  
    mkmk4
    Guest
    it looks pretty awesome but like this will make it easy for people to get max stat but still pretty dam awesome good job reped++
     

  4. #4  
    Registered Member
    Join Date
    Jan 2007
    Posts
    329
    Thanks given
    0
    Thanks received
    0
    Rep Power
    60
    Quote Originally Posted by mkmk4 View Post
    it looks pretty awesome but like this will make it easy for people to get max stat but still pretty dam awesome good job reped++
    Thanks
    but , if you set the exp lower it wont

    to do that find your misc.random line and change the number.
     

  5. #5  
    Lostprophets
    Guest
    Quote Originally Posted by mkmk4 View Post
    it looks pretty awesome but like this will make it easy for people to get max stat but still pretty dam awesome good job reped++
    Thats why this is pretty much pk servers and you could just lower the exps
     

  6. #6  
    Lostprophets
    Guest
    Quote Originally Posted by The Linux View Post
    can you make it so that the xp you get is lower?
    Its not that hard to do lol
     

  7. #7  
    Registered Member Gicu200100's Avatar
    Join Date
    Aug 2007
    Posts
    186
    Thanks given
    0
    Thanks received
    0
    Rep Power
    5
    Good job..its something different from what i had seen recently..awsome!
     

  8. #8  
    i java i
    Guest
    Nice tut, but phail of scamming irl cash. Gona put server back up anytime soon
     

  9. #9  
    sk8ter107
    Guest
    thats sum master codin rite there sir
     

  10. #10  
    Old School Member

    Join Date
    Feb 2008
    Age
    29
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    Nice work but you already released this but u removed anyways alex gj
     

Page 1 of 10 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
  •