Shawak
Intermediate OT User
Hello,
Here is my litle "Fusion" Script, I hope you like it
.
Testet with TFS 0.3.4.
How it works?

You put one item on the first position, and one at the second position.
Then you turn the lever and get a new item.
How to Install?
create a fusion.lua in
data/actions/scripts
then goto data/actions/actions.xml
and write before the "</actions>"
Any bugs? Post them!
Enjoy
.
Regards,
Shawak
Here is my litle "Fusion" Script, I hope you like it

Testet with TFS 0.3.4.
How it works?
You put one item on the first position, and one at the second position.
Then you turn the lever and get a new item.
How to Install?
create a fusion.lua in
data/actions/scripts
LUA:
-- Script by Shawak --
-- Fusion Script v1.0 --
function onUse(cid, item, fromPosition, itemEx, toPosition)
-----------------------------------------------------
firstID = ITEMID -- id of the first item
secondID = ITEMID -- id of the second item
newID = ITEMID -- id of the new item
count = 1 -- You get 1 of the new item
local piece1pos = {
x = xxx,
y = yyy, -- Position of the first item
z = z,
stackpos=1}
local piece2pos = {
x = xxx,
y = yyy, -- Position of the second item
z = z,
-----------------------------------------------------
stackpos=1}
local getpiece1 = getThingfromPos(piece1pos)
local getpiece2 = getThingfromPos(piece2pos)
local playerpos = getPlayerPosition(cid)
if getpiece1.itemid == firstID and getpiece2.itemid == secondID or getpiece1.itemid == secondID and getpiece2.itemid == firstID then
if item.itemid == 1945 then
doTransformItem(item.uid,item.itemid+1)
elseif item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
end
doRemoveItem(getpiece1.uid,1)
doRemoveItem(getpiece2.uid,1)
doSendMagicEffect(piece1pos,2)
doSendMagicEffect(piece2pos,2)
doPlayerAddItem(cid,newID,count)
doSendMagicEffect(playerpos,14)
doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(newID) .. " " .. getItemNameById(newID) .. ".")
end
else
doPlayerSendTextMessage(cid, 22, "You need " .. getItemArticleById(firstID) .. " "..getItemNameById(firstID).." and " .. getItemArticleById(secondID) .. " "..getItemNameById(secondID)..".")
end
return TRUE
end
then goto data/actions/actions.xml
and write before the "</actions>"
LUA:
<action actionid="8000" script="fusion.lua" />
Any bugs? Post them!
Enjoy

Regards,
Shawak
Last edited: