Thread: Super Basic Flatpacking [637]

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Super Basic Flatpacking [637] 
    ★☆♥♣♥☆★

    EndlessZombies's Avatar
    Join Date
    Aug 2008
    Age
    31
    Posts
    440
    Thanks given
    30
    Thanks received
    4
    Rep Power
    125
    Tested on Dementhium 637 base
    Classes editted: ActionButtonHandler, ObjectPacketHandler
    New Classes: ConTable

    Let me start by saying, that this is BASIC. I'm sure anybody here could come up with a better system, BUT, I haven't seen it around yet. So this is a start.

    Step 1:
    Open ActionButtonHandler.java and find:
    Code:
    switch (interfaceId) {
    Under that add,
    Code:
    case 397:
    	org.dementhium.content.skills.construction.ConTable.handleCon(player, buttonId);
    		break;
    also import this:
    Code:
    import org.dementhium.content.skills.construction.*;
    Save, close.

    Step 2:
    Open ObjectPacketHandler.java and find:
    Code:
    switch (objectId) {
    Under that add,
    Code:
        case 13704:
    		case 13705:
    		case 13706:
    		case 13707:
    		case 13708:
    		case 46300: //just a test object
    		ActionSender.sendInterface(player, 397);
    		break; 
    		//end Con cases
    Save, close.

    Step 3:
    Last but not least create a new folder inside "\content\skills\" named "construction"

    inside the newly created construction folder, create a new java class named "ConTable.java"

    Open it and paste the following inside:
    Code:
    package org.dementhium.content.skills.construction;
    /* Made by Legendairy, Aka Domanico of Rune-Server */
    import org.dementhium.model.player.*;
    import org.dementhium.net.ActionSender;
    import org.dementhium.action.ProduceAction;
    import org.dementhium.model.Item;
    import org.dementhium.model.definition.ItemDefinition;
    import org.dementhium.model.mask.Animation;
    import org.dementhium.model.mask.Graphic;
    import org.dementhium.model.player.Player;
    import org.dementhium.model.player.Skills;
    import org.dementhium.net.ActionSender;
    
    
    public class ConTable {
    	
    	public static ActionSender Action;
    	public static int modifier = 1;
    	//Below is the Interface options for interface: 397 flatpack workbench
    	//Very basic, and barely 15% done
    
    	public static void handleCon(Player p, int buttonId) {
    		// if (buttonId <= 44 || buttonId >= 61) {
    			// System.out.println("Unmatched childID," + buttonId + ", On interface 397.");
    			// return;
    		// } 
    			if (p.getInventory().numberOf(8794) >= 1 && p.getInventory().numberOf(2347) >= 1) {
    				switch (buttonId) {
    					
    					case 45:
    						if (p.getInventory().numberOf(960) >= 2) {
    						tableConfigs(p, "Rocking Chair", 96, 8500, 960, 2);
    						} else {
    						tableCloseMsg(p, "2 planks");
    						}
    					break;
    					
    					case 46:
    					if (Level(p, 29) == true) {
    						if (p.getInventory().numberOf(8778) >= 2) {
    								tableConfigs(p, "Oak bookcase", 180, 8512, 8778, 2);
    								} else {
    									tableCloseMsg(p, "2 Oak planks");
    								}
    							}
    					break;
    					
    					case 47:
    					if (Level(p, 36) == true) {
    						if (p.getInventory().numberOf(8778) >= 2 && p.getInventory().numberOf(2353) >= 1) {
    								tableConfigs(p, "Dragon Bitter barrel", 224, 8524, 8778, 2);
    								p.getInventory().deleteItem(2353, 1);
    								} else {
    									tableCloseMsg(p, "2 Oak planks and 1 Steel bar");
    								}
    							}
    					break;
    					
    					case 48:
    					if (Level(p, 52) == true) {
    						if (p.getInventory().numberOf(8780) >= 3) {
    								tableConfigs(p, "Teak kitchen table", 270, 8532, 8780, 3);
    								} else {
    									tableCloseMsg(p, "3 Teak planks");
    								}
    							}
    					break;
    					
    					case 49:
    					if (Level(p, 52) == true) {
    						if (p.getInventory().numberOf(8782) >= 6) {
    								tableConfigs(p, "Mahogany table", 840, 8558, 8782, 6);
    								} else {
    									tableCloseMsg(p, "6 Mahogany planks");
    								}
    							}
    					break;
    					
    					case 50:
    					if (Level(p, 61) == true) {
    						if (p.getInventory().numberOf(8782) >= 4 && p.getInventory().numberOf(8784) >= 4) {
    								tableConfigs(p, "Gilded bench", 1760, 8574, 8782, 4);
    								p.getInventory().deleteItem(8784, 4);
    								} else {
    									tableCloseMsg(p, "4 Mahogany planks and 4 Gold leaves");
    								}
    							}
    					break;
    					
    					case 51:
    					if (Level(p, 53) == true) {
    						if (p.getInventory().numberOf(8782) >= 3) {
    						tableConfigs(p, "Mahogany 4-Poster", 450, 8586, 8782, 3);
    							} else {
    							tableCloseMsg(p, "3 Mahogany planks");
    							}
    						}
    					break;
    					
    					case 52:
    					if (Level(p, 64) == true) {
    						if (p.getInventory().numberOf(8782) >= 2) {
    						tableConfigs(p, "Mahogany dresser", 281, 8606, 8782, 2);
    							} else {
    							tableCloseMsg(p, "2 Mahogany planks");
    							}
    						}
    					break;
    					
    					case 53: 
    					if (Level(p, 87) == true) {
    						if (p.getInventory().numberOf(8782) >= 3 && p.getInventory().numberOf(8784) >= 1) {
    						tableConfigs(p, "Gilded wardrobe", 720, 8622, 8782, 3);
    						p.getInventory().deleteItem(8784, 1);
    							} else {
    							tableCloseMsg(p, "3 Mahogany planks and 1 Gold leaf");
    							}
    						}
    					break;
    					
    					case 54:
    					if (Level(p, 85) == true) {
    						if (p.getInventory().numberOf(8782) >= 2 && p.getInventory().numberOf(8784) >= 1) {
    								tableConfigs(p, "Gilded clock", 602, 8594, 8782, 2);
    								p.getInventory().deleteItem(8784, 1);
    								} else {
    									tableCloseMsg(p, "2 Mahogany planks and 1 Gold leaf");
    								}
    							}
    					break;
    					
    					case 55:
    					if (Level(p, 90) == true) {
    						if (p.getInventory().numberOf(8786) >= 1) {
    							tableConfigs(p, "Marble cape rack", 500, 9847, 8786, 1);
    								} else {
    								tableCloseMsg(p, "1 Marble block");
    								}
    						}
    					break;
    					
    					case 56:
    					if (Level(p, 96) == true) {
    						if (p.getInventory().numberOf(8786) >= 1) {
    						tableConfigs(p, "Marble magic wardrobe", 550, 9858, 8786, 1);
    							} else {
    							tableCloseMsg(p, "1 Marble block");
    							}
    						}
    					break;
    					
    					case 57:
    					if (Level(p, 82) == true) {
    						if (p.getInventory().numberOf(8782) >= 3) {
    						tableConfigs(p, "Mahogany armour case", 420, 9861, 8782, 3);
    							} else {
    							tableCloseMsg(p, "3 Mahogany planks");
    							}
    						}
    					break;
    					
    					case 58:
    					if (Level(p, 84) == true) {
    						if (p.getInventory().numberOf(8782) >= 2) {
    						tableConfigs(p, "Mahogany treasure chest", 280, 9864, 8782, 2);
    							} else {
    							tableCloseMsg(p, "2 Mahogany planks");
    							}
    						}
    					break;
    					
    					case 59:
    					if (Level(p, 80) == true) {
    						if (p.getInventory().numberOf(8782) >= 2) {
    						tableConfigs(p, "Mahogany costume box", 280, 9867, 8782, 2);
    							} else {
    							tableCloseMsg(p, "2 Mahogany planks");
    							}
    						}
    					break;
    					
    					case 60:
    					if (Level(p, 80) == true) {
    						if (p.getInventory().numberOf(8782) >= 2) {
    						tableConfigs(p, "Mahogany toy box", 280, 9851, 8782, 2);
    							} else {
    							tableCloseMsg(p, "2 Mahogany planks");
    							}
    						}
    					break;
    					
    				}
    			} else {
    			Action.sendCloseInterface(p);
    			Action.sendMessage(p, "You must have a saw and hammer in your inventory to construct this item.");
    			}
    	}
    	
    	public static void tableConfigs(Player p, String name, int exp, int id, int plank, int amount)	{
    	//7276 lean over emote, 898 smithing emote //Could not find actual table emote :/
    		p.getInventory().deleteItem(plank, amount);
    		Action.sendCloseInterface(p);
    		p.animate(7276);
    		p.getInventory().addItem(id, 1);
    		p.getSkills().addExperience(22, exp * modifier);
    		Action.sendMessage(p, "You have packed a new " + name + "!");
    	}
    	
    	public static void tableCloseMsg(Player p, String string) {
    		Action.sendCloseInterface(p);
    		Action.sendMessage(p, "Minimum " + string + " required.");
    	}
    	
    	public static boolean Level(Player p, int lvl) {
    		if (p.getSkills().getLevel(Skills.CONSTRUCTION) >= lvl) {
    			return true;
    		} else {
    			lvlClose(p, lvl);
    		return false;
    		}
    	}
    	
    	public static void lvlClose(Player p, int lvl) { //made this before "Level" boolean, so.. I kept it lol.
    				Action.sendCloseInterface(p);
    				Action.sendMessage(p, "Level " + lvl + " Construction is required to construct this item.");
    		}
    }

    Checks for materials and levels




    If you've done everything right it should work perfectly, enjoy

    "Snapback with my city on it, text back with yo titties on it, levi's with yo kitty on it"


    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Member Nouish's Avatar
    Join Date
    Jun 2011
    Posts
    822
    Thanks given
    142
    Thanks received
    177
    Rep Power
    282
    A rather good idea as it makes the construction skill trainable Good job
    Reply With Quote  
     

  4. #3  
    Registered Member
    'Shinobi's Avatar
    Join Date
    Jan 2011
    Posts
    254
    Thanks given
    50
    Thanks received
    16
    Rep Power
    121
    Quote Originally Posted by Nouish View Post
    A rather good idea as it makes the construction skill trainable Good job
    I agree.
    Reply With Quote  
     

  5. #4  
    ★☆♥♣♥☆★

    EndlessZombies's Avatar
    Join Date
    Aug 2008
    Age
    31
    Posts
    440
    Thanks given
    30
    Thanks received
    4
    Rep Power
    125
    Quote Originally Posted by Nouish View Post
    A rather good idea as it makes the construction skill trainable Good job
    Quote Originally Posted by Fizzyelf View Post
    I agree.
    Thanks guys

    "Snapback with my city on it, text back with yo titties on it, levi's with yo kitty on it"


    Reply With Quote  
     

  6. #5  
    Registered Member
    Santaher0's Avatar
    Join Date
    Sep 2008
    Posts
    2,033
    Thanks given
    324
    Thanks received
    49
    Rep Power
    1282
    Nice indeed, I suggest you've a look at Laxika's 508 construction, you might get some ideas out of it on how to make one in a 637, combined with this that would be sweet.
    - Support my project ArkScape

    - Santaher0's MusicBot

    - Santaher0's MovieBot
    Reply With Quote  
     

  7. #6  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,146
    Thanks given
    256
    Thanks received
    1,252
    Rep Power
    3714
    Your conventions and naming need work but you're on the right track, good job



    Reply With Quote  
     

  8. #7  
    ★☆♥♣♥☆★

    EndlessZombies's Avatar
    Join Date
    Aug 2008
    Age
    31
    Posts
    440
    Thanks given
    30
    Thanks received
    4
    Rep Power
    125
    Quote Originally Posted by Santaher0 View Post
    Nice indeed, I suggest you've a look at Laxika's 508 construction, you might get some ideas out of it on how to make one in a 637, combined with this that would be sweet.
    Thanks! Would love to make fully working con, its the 2nd least touched 637 skill. Going to look into it. :]

    Quote Originally Posted by 'Mystic Flow View Post
    Your conventions and naming need work but you're on the right track, good job
    I try xD hahaha, been yelled at for conventions since 508 ;P haha Thanks though

    "Snapback with my city on it, text back with yo titties on it, levi's with yo kitty on it"


    Reply With Quote  
     

  9. #8  
    Banned

    Join Date
    Mar 2010
    Posts
    1,092
    Thanks given
    214
    Thanks received
    117
    Rep Power
    0
    It works for having the skill trainable, so it make's server's look dedicated, Im steeling this And giving you credits thankss
    Reply With Quote  
     

  10. #9  
    Registered Member wildking72's Avatar
    Join Date
    Sep 2011
    Age
    27
    Posts
    506
    Thanks given
    62
    Thanks received
    36
    Rep Power
    11
    I can't find ConTable.java in construction folder



    Reply With Quote  
     

  11. #10  
    ★☆♥♣♥☆★

    EndlessZombies's Avatar
    Join Date
    Aug 2008
    Age
    31
    Posts
    440
    Thanks given
    30
    Thanks received
    4
    Rep Power
    125
    Quote Originally Posted by erica View Post
    It works for having the skill trainable, so it make's server's look dedicated, Im steeling this And giving you credits thankss
    Thanks mate :]

    Quote Originally Posted by wildking72 View Post
    I can't find ConTable.java in construction folder



    lmfao, you have to make it.

    "Snapback with my city on it, text back with yo titties on it, levi's with yo kitty on it"


    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. Very Basic Super Mario Cape.
    By jeremy in forum Models
    Replies: 3
    Last Post: 07-04-2010, 01:58 AM
  2. *508*fletching BASIC whit BASIC interface
    By Sir Zap in forum Show-off
    Replies: 7
    Last Post: 11-13-2009, 05:51 AM
  3. Basic Arrays ( We create a VERY basic login )
    By Dick2Deep in forum Website Development
    Replies: 0
    Last Post: 02-23-2009, 07:06 AM
  4. the most basic, basic npc combat system ever.
    By ritz929 in forum Tutorials
    Replies: 19
    Last Post: 09-15-2008, 11:08 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
  •