Class Description
author: Elm description - Crafting Class usage: if(!isObject($class::crafting)) { error("crafting_handle.cs -> Crafting class has not been executed, aborting."); } else { %crafting = $class::crafting; %recipe = %crafting.newRecipe("handle"); %recipe.addItem("Wood",5); %recipe.onComplete("handle",1); }
crafting::newRecipe(%this,%name)
Notes: attempts to create a new recipe object
crafting::hasRecipe(%this,%name)
Notes: checks the crafting class to see if %name string is already defined in the crafting class
crafting::getRecipe(%this,%name)
Notes: attempts to get a recipe object by name
recipe::addItem(%this,%name,%amount)
Notes: attempts to add a new item into the recipe class. Item in this case would be one or many requirements to successfully craft the recipe.
recipe::hasItem(%this,%name)
Notes: checks to see if an item already exists in the recipe class
recipe::setRequirementLevel(%this,%level)
Notes: set the recipe's required crafting level
recipe::getRequirementLevel(%this)
Notes: get's the required crafting level to craft this recipe
recipe::onComplete(%this,%itemName,%amount)
Notes: called when a recipe is completed to get the end-items the user crafted
recipe::clientVerified(%this,%cl)
Notes: verifies that the client has everything required to craft a recipe
gameConnection::canCraft(%this,%nameOrObj)
Notes: Checks to see if a client can craft a recipe by name or by obj is supported in this
gameConnection::craftingStart(%this,%recipe)
Notes: attempts to craft a recipe
gameConnection::craftingFinish(%this,%recipe)
Notes: cleanup give items, remove items, etc