Crafting.cs

API


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);
  }


Method 1

crafting::newRecipe(%this,%name)

Notes: attempts to create a new recipe object


Method 2

crafting::hasRecipe(%this,%name)

Notes: checks the crafting class to see if %name string is already defined in the crafting class


Method 3

crafting::getRecipe(%this,%name)

Notes: attempts to get a recipe object by name


Method 4

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.


Method 5

recipe::hasItem(%this,%name)

Notes: checks to see if an item already exists in the recipe class


Method 6

recipe::setRequirementLevel(%this,%level)

Notes: set the recipe's required crafting level


Method 7

recipe::getRequirementLevel(%this)

Notes: get's the required crafting level to craft this recipe


Method 8

recipe::onComplete(%this,%itemName,%amount)

Notes: called when a recipe is completed to get the end-items the user crafted


Method 9

recipe::clientVerified(%this,%cl)

Notes: verifies that the client has everything required to craft a recipe


Method 10

gameConnection::canCraft(%this,%nameOrObj)

Notes: Checks to see if a client can craft a recipe by name or by obj is supported in this


Method 11

gameConnection::craftingStart(%this,%recipe)

Notes: attempts to craft a recipe


Method 12

gameConnection::craftingFinish(%this,%recipe)

Notes: cleanup give items, remove items, etc