EDIT:
Version 2:
http://otland.net/f81/fusion-upgrade-script-ver-2-final-recipes-forgotten-server-0-3-4-a-34880/
--------------------------------------------------------
TESTED ON TFS 0.3.5beta (rev. 2055)
Idea from Shawak thread:
http://otland.net/f81/fusion-item-item-new-item-34557/
Player put bag/backpack/box (container) with items on one 'pos', use switch and if in bag are needed items script create new item(s) on second 'pos'. Number of items required (backpack size '20'!)/created and recipes unlimited. You can require runes/items with count/charges (like require rune SD x25 only available from one quest on ots)
How to configure? It's simple. Default config:
There are 2 'recipes':
1 - put in bag item 2171(subtype/count = 0), 2171(subtype/count = 0), 2154(subtype/count = 0) and you will get item 2197 (subtype/count = 999) and item 2197 (subtype/count = 999) [2 x platium amulet, yellow gem and you get 2x SSA (each x999)]
2 - put in bag item 2171(subtype/count = 0), 2154(subtype/count = 0) and you will get item 2197 (subtype/count = 99) and item 2197 (subtype/count = 999) [1x platium amulet, yellow gem and you get 2xSSA (each x99)
(in my script it's not first/second position, it's just a position)
actions.xml:
fusion.lua:
You can post your recipes on your server site or hide in bookcases on server map.
POST BUGS IN THIS THREAD!
Version 2:
http://otland.net/f81/fusion-upgrade-script-ver-2-final-recipes-forgotten-server-0-3-4-a-34880/
--------------------------------------------------------
TESTED ON TFS 0.3.5beta (rev. 2055)
Idea from Shawak thread:
http://otland.net/f81/fusion-item-item-new-item-34557/
Player put bag/backpack/box (container) with items on one 'pos', use switch and if in bag are needed items script create new item(s) on second 'pos'. Number of items required (backpack size '20'!)/created and recipes unlimited. You can require runes/items with count/charges (like require rune SD x25 only available from one quest on ots)
How to configure? It's simple. Default config:
PHP:
local item_config = {{{{2197,999}, {2197,999}}, {{2171,0}, {2171,0}, {2154,0}}}, {{{2197,99}, {2197,99}}, {{2171,0}, {2154,0}}}}
1 - put in bag item 2171(subtype/count = 0), 2171(subtype/count = 0), 2154(subtype/count = 0) and you will get item 2197 (subtype/count = 999) and item 2197 (subtype/count = 999) [2 x platium amulet, yellow gem and you get 2x SSA (each x999)]
2 - put in bag item 2171(subtype/count = 0), 2154(subtype/count = 0) and you will get item 2197 (subtype/count = 99) and item 2197 (subtype/count = 999) [1x platium amulet, yellow gem and you get 2xSSA (each x99)
(in my script it's not first/second position, it's just a position)
actions.xml:
PHP:
<action actionid="8000" event="script" value="quests/fusion.lua"/>
PHP:
-- Script by Gesior --
-- Fusion Script ver. 1 (BETA)--
local item_config = {{{{2197,999}, {2197,999}}, {{2171,0}, {2171,0}, {2154,0}}}, {{{2197,99}, {2197,99}}, {{2171,0}, {2154,0}}}}
local pos_1 = {x = 1035, y = 1226, z = 7}
local pos_2 = {x = 1037, y = 1226, z = 7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local create_item_pos = pos_2
local container = getTileItemByType(pos_1, ITEM_TYPE_CONTAINER)
if(container.uid == 0 or not(isContainer(container.uid))) then
create_item_pos = pos_1
container = getTileItemByType(pos_2, ITEM_TYPE_CONTAINER)
end
if(container.uid == 0 or not(isContainer(container.uid))) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Put bag or backpack with items to fusion.")
return FALSE
end
items_in_container = {}
item_slot = 0
while(true) do
item_in = getContainerItem(container.uid, item_slot)
if item_in.itemid > 0 then
table.insert(items_in_container, item_in)
else
break
end
item_slot = item_slot+1
end
local fusion_id = 0
for i = 1, table.getn(item_config) do
fusion_items = item_config[i]
items_create = fusion_items[1]
items_required = fusion_items[2]
local tmp_items_required = {}
for s = 1, table.getn(items_required) do
table.insert(tmp_items_required, items_required[s])
end
if(table.getn(items_in_container) == table.getn(tmp_items_required)) then
for c = 1, table.getn(items_in_container) do
local item_in_container = items_in_container[c]
for r = 1, table.getn(tmp_items_required) do
local item_required = tmp_items_required[r]
if(item_in_container.itemid == item_required[1] and item_in_container.type == item_required[2]) then
table.remove(tmp_items_required, r)
break
end
end
end
if(table.getn(tmp_items_required) == 0) then
fusion_id = i
break
end
end
end
if(fusion_id > 0) then
while(true) do
item_in = getContainerItem(container.uid, 0)
if item_in.uid > 0 then
doRemoveItem(item_in.uid)
else
break
end
end
for u = 1, table.getn(items_create) do
local item_to_create = items_create[u]
local new_item_uid = doCreateItemEx(item_to_create[1], item_to_create[2])
doTileAddItemEx(create_item_pos, new_item_uid)
end
doSendMagicEffect(pos_1,CONST_ME_GREEN_RINGS)
doSendMagicEffect(pos_2,CONST_ME_GREEN_RINGS)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_GREEN)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Unknown recipe.")
end
if(item.itemid == 1945) then
doTransformItem(item.uid,item.itemid+1)
elseif(item.itemid == 1946) then
doTransformItem(item.uid,item.itemid-1)
end
return TRUE
end
You can post your recipes on your server site or hide in bookcases on server map.
POST BUGS IN THIS THREAD!
Last edited: