'find an item in an itemtablefunction find_item(ItemName as string,ItemTable() as Item) as integer for i as integer = lbound(ItemTable) to ubound(ItemTable) If ItemTable(i).Itemname = ItemName then return i end if next return -1end function

'get the cost of an item from the itemtablefunction get_cost (ItemName as String,ItemTable() as Item) as integer dim as integer id = find_Item(ItemName,ItemTable()) if id = -1 then print "F Item not found" : exit function Return ItemTable(id).costend function

'lists all inventorys from characteresub list_inventory(char as charakter) Print "Charakter '";char.username;"' has this items:" print "Amount","ItemName","ItemType","Damage" for i as integer = lbound(char.inventory) to ubound(char.inventory) with char.inventory(i) Print .amount,.Itemname,.ItemType,.Damage end with

sub set_waepon_damage_from_charakter (char as charakter) with char for i as integer = lbound(char.inventory) to ubound(char.inventory) .damage += char.inventory(i).damage * char.inventory(i).amount next end withend sub

'example fightPrint "An Enemy is standing in the top of you hit him with [SPACE] :)"Print "Enemy stats: "list_player_stats(Enemy1)print "Press a key to do this!"sleepfight (Player,Enemy1,Items())print "Your Stats:"list_player_stats(Player)

'find an item in an itemtablefunction find_item(ItemName as string,ItemTable() as Item) as integer for i as integer = lbound(ItemTable) to ubound(ItemTable) If ItemTable(i).Itemname = ItemName then return i end if next return -1end function

'get the cost of an item from the itemtablefunction get_cost (ItemName as String,ItemTable() as Item) as integer dim as integer id = find_Item(ItemName,ItemTable()) if id = -1 then print "F Item not found" : exit function Return ItemTable(id).costend function

'lists all inventorys from characteresub list_inventory(char as charakter) Print "Charakter '";char.username;"' has this items:" print "Amount","ItemName","ItemType","Damage" for i as integer = lbound(char.inventory) to ubound(char.inventory) with char.inventory(i) Print .amount,.Itemname,.ItemType,.Damage end with nextend sub

function find_item_id_by_type_and_aviable(ItemType as String,ItemTable() as Item) as uinteger for i as integer = lbound(ItemTable) to ubound(ItemTable) if ItemTable(i).ItemType = ItemType and ItemTable(i).Amount > 0 then return i end if next return -1end function

sub set_waepon_damage_from_charakter (char as charakter) with char for i as integer = lbound(char.inventory) to ubound(char.inventory) .damage += char.inventory(i).damage * char.inventory(i).amount next end withend sub

function search_item_type (ItemTypeName as string,ItemTable() as Item) as uinteger For i as integer = lbound(ItemTable) to ubound(ItemTable) If ItemTypeName = ItemTable(i).ItemType then return i end if nextend function

'example fightPrint "An Enemy is standing in the top of you hit him with [SPACE],[H] to Heal :)"Print "Your stats: "list_player_stats(Player)Print "Enemy stats: "list_player_stats(Enemy1)print "Press a key to do this!"sleep