function in Use (cid, item, fromPosition item, toPosition)
local player = Player (cid)
--local v = tablica [item.actionid] if item.itemid == BB_GNOME_ITEMS_TBL.GNOMISH_REPAIR_CRYSTAL then if getPlayerStorageValue (cid, BB_GNOME_TASKS_KEEPER)> = 0 and getPlayerStorageValue (cid, BB_GNOME_TASKS_KEEPER) <5 then if (isInArray (BB_GNOME_ITEMS_TBL.DAMAGED_CRYSTALS, itemEx .itemid)) then setPlayerStorageValue (cid, BB_GNOME_TASKS_KEEPER, getPlayerStorageValue (cid, BB_GNOME_TASKS_KEEPER) + 1) doTransformItem (itemEx.uid, BB_GNOME_ITEMS_TBL.REPAIRED_CRYSTAL) doDecayItem (itemEx.uid) doSendMagicEffect (toPosition, BB_GNOME_KEEPER_EFFECT_WHEN_REPAIRING_CRYSTAL) BB_GNOME_send_player_white_text (cid, "You have repaired the damaged crystal! ") else doPlayerSendCancel (cid," You can only repair damaged crystals with this item! ") end elseif getPlayerStorageValue (cid, BB_GNOME_TASKS_KEEPER)> = 5 Then doPlayerSendCancel (cid," You allready repaired damaged enough crystals, mission report back to Commander Stone. ") else doPlayerSendCancel (cid," To use this crystal you need to take Crystal Keeper mission from Commander Stone. ") end elseif item.itemid == BB_GNOME_ITEMS_TBL.Gnomish_Extraction_Crystal then if getPlayerStorageValue (cid, BB_GNOME_TASKS_SPARK)> = 0 and getPlayerStorageValue (cid, BB_GNOME_TASKS_SPARK) <7 then if itemEx.itemid == BB_GNOME_ITEMS_TBL.crystal_crusher_body_possible_to_spark Then doSendMagicEffect (toPosition, BB_GNOME_SPARK_EFFECT_ON_CRYSTAL_CRUSHER_BODY) BB_GNOME_send_player_white_text (cid, "You Gathered the spark.") setPlayerStorageValue (cid, BB_GNOME_TASKS_SPARK, getPlayerStorageValue (cid, BB_GNOME_TASKS_SPARK ) + 1) doTransformItem (itemEx.uid, BB_GNOME_ITEMS_TBL.crystal_crusher_body_after_spark) elseif itemEx.itemid == BB_GNOME_ITEMS_TBL.crystal_crusher_body_too_much_fresh Then BB_GNOME_send_player_white_text (cid, "You will have to wait a moment for the corpse to be ready.") else doPlayerSendCancel (cid, "You can not use this object on this item.") end elseif getPlayerStorageValue (cid, BB_GNOME_TASKS_SPARK)> = 7 Then doPlayerSendCancel (cid, "You allready charged enough sparks, report mission back to Commander Stone.") elseif getPlayerStorageValue (cid, BB_GNOME_TASKS_SPARK ) <0 then doPlayerSendCancel (cid, "To use this you need to extraction crystal take Spark Hunting mission from Commander Stone.") end elseif item.itemid == BB_GNOME_ITEMS_TBL.fresh_mushroom_beer Then BB_GNOME_send_player_red_text (cid, "Gulp!") doRemoveItem (item .uid, 1) if BB_GNOME_getPlayerStorageValue (cid, BB_GNOME_MISSION_STG) == 4 Then BB_GNOME_setPlayerStorageValue (cid, BB_GNOME_MISSION_STG, 3) BB_GNOME_setPlayerStorageValue (cid, BB_GNOME_TEST_IN_GNOMOLOGY_ANSWERS_STG, 0) BB_GNOME_setPlayerStorageValue (cid, BB_GNOME_TEST_IN_GNOMOLOGY_POINTS_STG, 0) BB_GNOME_send_player_white_text (cid, "Your mind feels refreshed! ") end elseif item.itemid == BB_GNOME_ITEMS_TBL.stale_mushroom_beer Then BB_GNOME_send_player_red_text (cid," Phew! ") doRemoveItem (item.uid, 1) elseif item.itemid == == BB_GNOME_ITEMS_TBL.floor_with_some_truffels itemEx.itemid BB_GNOME_ITEMS_TBL.little_pig and then if BB_GNOME_getPlayerStorageValue (cid, BB_GNOME_TASKS_DIGGING)> = 0 and BB_GNOME_getPlayerStorageValue (cid, BB_GNOME_TASKS_DIGGING) <3 Then BB_GNOME_setPlayerStorageValue (cid, BB_GNOME_TASKS_DIGGING, BB_GNOME_getPlayerStorageValue (cid, BB_GNOME_TASKS_DIGGING) + 1) doSendMagicEffect (toPosition, BB_GNOME_DIGGING_LITTLE_PIG_EAT_TRUFFLES_EFFECT) BB_GNOME_send_player_white_text (cid, "The little pig happily eats the truffles. ") end end
return true
end
[/ LUA]
It is the function fo fresh mushroom beer. The others are normal.