Advertisement
Guest User

Basic level class for crafts

a guest
Jul 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.90 KB | None | 0 0
  1. //First we'll create some kind of general method to call to start crafting in general
  2.  
  3. CraftingStart(int[] IngredientID, int ProcessID){
  4.             //here we are creating this method and the int[] creates an array that we can use to store the ItemIDs of all the items we'll use in creafting
  5.             //this will reference the database we'd use
  6.         for(int i = 0; i > IngredientID.length; i++){
  7.             ingredientList.setIngredients(getIngredientInfo(IngredientID.(i)));
  8.         }
  9.             //here we're going through each itemID from the table that would be sent through in the function's call (CraftingStart) and finding what they are
  10.             //while also creating an ingredientList which will store them in a different way than an array to let us interact with the information a bit better
  11.            
  12.         Recipe recipeFinder(ingredientList, ProcessID, getCraftingLevel(Account.Character.Crafting.ProcessID.Level));
  13.         //here we'll be use the provided information from above as well as going back into the database to check the character's crafting level to find out what
  14.         //they're looking to craft and creating a custom made Recipe.
  15.         ItemCreate(itemName,recipe,modifiers)
  16.         //ItemCreate would create an instance of the object Item which will then create a unqiue id for the object, and will allow us to populate the object's info.
  17.         //to explain more you'd need to know about object oriented programming which you dont right now
  18.        
  19.        
  20.         //now an example of what you've provided >sword thing
  21.        
  22.     CraftingStart({12,26,28,40},8); //here i've made up values for the items > wood is 12, aluminium is 26, steel is 28 and leather is 40 - 8 is tool creation process
  23.    
  24.     //the code will then go through and get the stats of the items for use in crafting > e.g wood id 12 is mahogany with high weight and strenght so would apply X modifier to the craft
  25.    
  26.     recipeFinder({12,26,28,40},8,21);
  27.    
  28.     ItemCreate(recipe.getItemName,recipe.getRecipe,recipe.getModifiers){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement