• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Pits of Inferno: Oil Lever & Stone

J.Dre

Unity Games
Joined
May 18, 2011
Messages
2,647
Solutions
3
Reaction score
648
Location
United States
When searching for this, I found so many threads about it not working. Here is one that is! ;)

Tested using TFS 0.3.7.

Screen Shots

Before:

w9teo1.png


After:

2n03dx0.png


Scripts:

data/actions/scripts/lever.lua

POI Lever - Pastebin.com

data/actions/scripts/pick.lua

POI Pick - Pastebin.com

Enjoy! :D
 
Last edited:
I've added an effect to every sqm that has changed, I hope you serve something, it was only a detail.
PHP:
--- Script by J.Dre and small edit by Knight God

local t = {
	{x = 1222, y = 1376, z = 11, stackpos = 0},
	{x = 1223, y = 1376, z = 11, stackpos = 0},
	{x = 1226, y = 1376, z = 11, stackpos = 0},
	{x = 1227, y = 1376, z = 11, stackpos = 0},
	{x = 1222, y = 1375, z = 11, stackpos = 0},
	{x = 1223, y = 1375, z = 11, stackpos = 0},
	{x = 1224, y = 1375, z = 11, stackpos = 0},
	{x = 1225, y = 1375, z = 11, stackpos = 0},
	{x = 1226, y = 1375, z = 11, stackpos = 0},
	{x = 1227, y = 1375, z = 11, stackpos = 0},
	{x = 1228, y = 1375, z = 11, stackpos = 0},
	{x = 1222, y = 1374, z = 11, stackpos = 0},
	{x = 1223, y = 1374, z = 11, stackpos = 0},
	{x = 1224, y = 1374, z = 11, stackpos = 0},
	{x = 1225, y = 1374, z = 11, stackpos = 0},
	{x = 1226, y = 1374, z = 11, stackpos = 0},
	{x = 1227, y = 1374, z = 11, stackpos = 0},
	{x = 1228, y = 1374, z = 11, stackpos = 0},
	{x = 1224, y = 1373, z = 11, stackpos = 0},
	{x = 1225, y = 1373, z = 11, stackpos = 0},
	{x = 1226, y = 1373, z = 11, stackpos = 0},
	{x = 1227, y = 1373, z = 11, stackpos = 0},
	{x = 1228, y = 1373, z = 11, stackpos = 0},
	{x = 1224, y = 1372, z = 11, stackpos = 0},
	{x = 1225, y = 1372, z = 11, stackpos = 0},
	{x = 1226, y = 1372, z = 11, stackpos = 0},
	{x = 1227, y = 1372, z = 11, stackpos = 0},
	{x = 1228, y = 1372, z = 11, stackpos = 0},
	{x = 1229, y = 1372, z = 11, stackpos = 0},
	{x = 1230, y = 1372, z = 11, stackpos = 0},
	{x = 1231, y = 1372, z = 11, stackpos = 0},
	{x = 1224, y = 1371, z = 11, stackpos = 0},
	{x = 1225, y = 1371, z = 11, stackpos = 0},
	{x = 1226, y = 1371, z = 11, stackpos = 0},
	{x = 1227, y = 1371, z = 11, stackpos = 0},
	{x = 1228, y = 1371, z = 11, stackpos = 0},
	{x = 1229, y = 1371, z = 11, stackpos = 0},
	{x = 1230, y = 1371, z = 11, stackpos = 0},
	{x = 1231, y = 1371, z = 11, stackpos = 0},
	{x = 1226, y = 1370, z = 11, stackpos = 0},
	{x = 1227, y = 1370, z = 11, stackpos = 0},
	{x = 1228, y = 1370, z = 11, stackpos = 0},
	{x = 1229, y = 1370, z = 11, stackpos = 0},
	{x = 1230, y = 1370, z = 11, stackpos = 0},
	{x = 1231, y = 1370, z = 11, stackpos = 0}
}
 
	local effect = {
	[1] = {pos = {1222,1376,11}, effect = {67}},
	[2] = {pos = {1223,1376,11}, effect = {67}},
	[3] = {pos = {1226,1376,11}, effect = {67}},
	[4] = {pos = {1227,1376,11}, effect = {67}},
	[5] = {pos = {1222,1375,11}, effect = {67}},
	[6] = {pos = {1223,1375,11}, effect = {67}},
	[7] = {pos = {1224,1375,11}, effect = {67}},
	[8] = {pos = {1225,1375,11}, effect = {67}},
	[9] = {pos = {1226,1375,11}, effect = {67}},
	[10] = {pos = {1227,1375,11}, effect = {67}},
	[11] = {pos = {1228,1375,11}, effect = {67}},
	[12] = {pos = {1222,1374,11}, effect = {67}},
	[13] = {pos = {1223,1374,11}, effect = {67}},
	[14] = {pos = {1224,1374,11}, effect = {67}},
	[15] = {pos = {1225,1374,11}, effect = {67}},
	[16] = {pos = {1226,1374,11}, effect = {67}},
	[17] = {pos = {1227,1374,11}, effect = {67}},
	[18] = {pos = {1228,1374,11}, effect = {67}},
	[19] = {pos = {1224,1373,11}, effect = {67}},
	[20] = {pos = {1225,1373,11}, effect = {67}},
	[21] = {pos = {1226,1373,11}, effect = {67}},
	[22] = {pos = {1227,1373,11}, effect = {67}},
	[23] = {pos = {1228,1373,11}, effect = {67}},
	[24] = {pos = {1224,1372,11}, effect = {67}},
	[25] = {pos = {1225,1372,11}, effect = {67}},
	[26] = {pos = {1226,1372,11}, effect = {67}},
	[27] = {pos = {1227,1372,11}, effect = {67}},
	[28] = {pos = {1228,1372,11}, effect = {67}},
	[29] = {pos = {1229,1372,11}, effect = {67}},
	[30] = {pos = {1230,1372,11}, effect = {67}},
	[31] = {pos = {1231,1372,11}, effect = {67}},
	[32] = {pos = {1224,1371,11}, effect = {67}},
	[33] = {pos = {1225,1371,11}, effect = {67}},
	[34] = {pos = {1226,1371,11}, effect = {67}},
	[35] = {pos = {1227,1371,11}, effect = {67}},
	[36] = {pos = {1228,1371,11}, effect = {67}},
	[37] = {pos = {1229,1371,11}, effect = {67}},
	[38] = {pos = {1230,1371,11}, effect = {67}},
	[39] = {pos = {1231,1371,11}, effect = {67}},
	[40] = {pos = {1226,1370,11}, effect = {67}},
	[41] = {pos = {1227,1370,11}, effect = {67}},
	[42] = {pos = {1228,1370,11}, effect = {67}},
	[43] = {pos = {1229,1370,11}, effect = {67}},
	[44] = {pos = {1230,1370,11}, effect = {67}},
	[45] = {pos = {1231,1370,11}, effect = {67}}
	}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.uid == 65532 and itemEx.itemid == 1304) then
		for i = 1, #t do
			doCreateItem(5815, 1, t[i])
		end
		doTransformItem(itemEx.uid, 2256)
		doSendMagicEffect(toPosition, CONST_ME_SMOKE)
	end
	for _, area in pairs(effect) do
		doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
	end
	return true
end

:)
 
@up
I think that you are in wrong, why you create second table? Not better use first table like that:
Code:
for i = 1, #t do
 doCreateItem(5815, 1, t[i])
 doSendMagicEffect(t[i], 67)
end
 
Lever not working for me so i use my own script, also upgraded your script with lava(added pick,effects,better stone id after destroying).

actions/scripts/poi/POIlever1oil.lua
Lua:
function onUse(cid, item, frompos, item2, topos)

wall1 = {x=408, y=1389, z=10, stackpos=1}
splash = {x=407, y=1392, z=10, stackpos=1}
oil = getThingfromPos(splash)
lever = getThingfromPos(splash)
bplayer = {x=408, y=1389, z=10, stackpos=253}
bplayer2 = getThingfromPos(bplayer)

		if item.uid == 10203 and item.itemid == 1945 and oil.itemid == 2016 and oil.type == 11 then
			doCreateItem(5770,1,wall1)
			doTransformItem(item.uid,item.itemid+1)
			doSendMagicEffect(splash,13)

		elseif item.uid == 10203 and item.itemid == 1946 and oil.itemid == 2016 and oil.type == 11 then
				if isCreature(bplayer2.uid) == TRUE then
					doMoveCreature(bplayer2.uid,WEST)
				end
			doCreateItem(493,1,wall1)
			doTransformItem(item.uid,item.itemid-1)
		else
			doCreatureSay(cid, "The lever is creaking and rusty.", 19)
		end
	return 1
end
actions/scripts/tools/pick.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
        doTransformItem(itemEx.uid, 392)
        doDecayItem(itemEx.uid)
        doSendMagicEffect(toPosition, CONST_ME_POFF)
        return true
    end

    if(itemEx.itemid == 7200) then
        doTransformItem(itemEx.uid, 7236)
        doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
        return true
    end
	
local t = {
	{x = 415, y = 1386, z = 10, stackpos = 0},
	{x = 416, y = 1386, z = 10, stackpos = 0},
	{x = 417, y = 1386, z = 10, stackpos = 0},
	{x = 418, y = 1386, z = 10, stackpos = 0},
	{x = 419, y = 1386, z = 10, stackpos = 0},
	{x = 420, y = 1386, z = 10, stackpos = 0},
	{x = 413, y = 1387, z = 10, stackpos = 0},
	{x = 414, y = 1387, z = 10, stackpos = 0},
	{x = 415, y = 1387, z = 10, stackpos = 0},
	{x = 416, y = 1387, z = 10, stackpos = 0},
	{x = 417, y = 1387, z = 10, stackpos = 0},
	{x = 418, y = 1387, z = 10, stackpos = 0},
	{x = 419, y = 1387, z = 10, stackpos = 0},
	{x = 420, y = 1387, z = 10, stackpos = 0},
	{x = 413, y = 1388, z = 10, stackpos = 0},
	{x = 414, y = 1388, z = 10, stackpos = 0},
	{x = 415, y = 1388, z = 10, stackpos = 0},
	{x = 416, y = 1388, z = 10, stackpos = 0},
	{x = 417, y = 1388, z = 10, stackpos = 0},
	{x = 418, y = 1388, z = 10, stackpos = 0},
	{x = 419, y = 1388, z = 10, stackpos = 0},
	{x = 420, y = 1388, z = 10, stackpos = 0},
	{x = 413, y = 1389, z = 10, stackpos = 0},
	{x = 414, y = 1389, z = 10, stackpos = 0},
	{x = 415, y = 1389, z = 10, stackpos = 0},
	{x = 416, y = 1389, z = 10, stackpos = 0},
	{x = 417, y = 1389, z = 10, stackpos = 0},
	{x = 412, y = 1390, z = 10, stackpos = 0},
	{x = 413, y = 1390, z = 10, stackpos = 0},
	{x = 414, y = 1390, z = 10, stackpos = 0},
	{x = 415, y = 1390, z = 10, stackpos = 0},
	{x = 416, y = 1390, z = 10, stackpos = 0},
	{x = 417, y = 1390, z = 10, stackpos = 0},
	{x = 412, y = 1391, z = 10, stackpos = 0},
	{x = 413, y = 1391, z = 10, stackpos = 0},
	{x = 414, y = 1391, z = 10, stackpos = 0},
	{x = 415, y = 1391, z = 10, stackpos = 0},
	{x = 416, y = 1391, z = 10, stackpos = 0},
	{x = 417, y = 1391, z = 10, stackpos = 0},
	{x = 412, y = 1392, z = 10, stackpos = 0},
	{x = 413, y = 1392, z = 10, stackpos = 0},
	{x = 415, y = 1392, z = 10, stackpos = 0},
	{x = 416, y = 1392, z = 10, stackpos = 0}
}
 

	if(itemEx.uid == 10286 and itemEx.itemid == 1304) then
		for i = 1, #t do
			doCreateItem(5815, 1, t[i])
			doSendMagicEffect(t[i], 67)
		end
		doTransformItem(itemEx.uid, 1309)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
	end

    return false
end
actions/actions.xml
Code:
<action uniqueid="10203" event="script" value="POI/POIlever1oil.lua" />
<action itemid="2553" event="script" value="tools/pick.lua"/>
 
Last edited:
Lever not working for me so i use my own script, also upgraded your script with lava(added pick,effects,better stone id after destroying).

actions/scripts/poi/POIlever1oil.lua
Lua:
function onUse(cid, item, frompos, item2, topos)

wall1 = {x=408, y=1389, z=10, stackpos=1}
splash = {x=407, y=1392, z=10, stackpos=1}
oil = getThingfromPos(splash)
lever = getThingfromPos(splash)
bplayer = {x=408, y=1389, z=10, stackpos=253}
bplayer2 = getThingfromPos(bplayer)

        if item.uid == 10203 and item.itemid == 1945 and oil.itemid == 2016 and oil.type == 11 then
            doCreateItem(5770,1,wall1)
            doTransformItem(item.uid,item.itemid+1)
            doSendMagicEffect(splash,13)

        elseif item.uid == 10203 and item.itemid == 1946 and oil.itemid == 2016 and oil.type == 11 then
                if isCreature(bplayer2.uid) == TRUE then
                    doMoveCreature(bplayer2.uid,WEST)
                end
            doCreateItem(493,1,wall1)
            doTransformItem(item.uid,item.itemid-1)
        else
            doCreatureSay(cid, "The lever is creaking and rusty.", 19)
        end
    return 1
end
actions/scripts/tools/pick.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
        doTransformItem(itemEx.uid, 392)
        doDecayItem(itemEx.uid)
        doSendMagicEffect(toPosition, CONST_ME_POFF)
        return true
    end

    if(itemEx.itemid == 7200) then
        doTransformItem(itemEx.uid, 7236)
        doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
        return true
    end
   
local t = {
    {x = 415, y = 1386, z = 10, stackpos = 0},
    {x = 416, y = 1386, z = 10, stackpos = 0},
    {x = 417, y = 1386, z = 10, stackpos = 0},
    {x = 418, y = 1386, z = 10, stackpos = 0},
    {x = 419, y = 1386, z = 10, stackpos = 0},
    {x = 420, y = 1386, z = 10, stackpos = 0},
    {x = 413, y = 1387, z = 10, stackpos = 0},
    {x = 414, y = 1387, z = 10, stackpos = 0},
    {x = 415, y = 1387, z = 10, stackpos = 0},
    {x = 416, y = 1387, z = 10, stackpos = 0},
    {x = 417, y = 1387, z = 10, stackpos = 0},
    {x = 418, y = 1387, z = 10, stackpos = 0},
    {x = 419, y = 1387, z = 10, stackpos = 0},
    {x = 420, y = 1387, z = 10, stackpos = 0},
    {x = 413, y = 1388, z = 10, stackpos = 0},
    {x = 414, y = 1388, z = 10, stackpos = 0},
    {x = 415, y = 1388, z = 10, stackpos = 0},
    {x = 416, y = 1388, z = 10, stackpos = 0},
    {x = 417, y = 1388, z = 10, stackpos = 0},
    {x = 418, y = 1388, z = 10, stackpos = 0},
    {x = 419, y = 1388, z = 10, stackpos = 0},
    {x = 420, y = 1388, z = 10, stackpos = 0},
    {x = 413, y = 1389, z = 10, stackpos = 0},
    {x = 414, y = 1389, z = 10, stackpos = 0},
    {x = 415, y = 1389, z = 10, stackpos = 0},
    {x = 416, y = 1389, z = 10, stackpos = 0},
    {x = 417, y = 1389, z = 10, stackpos = 0},
    {x = 412, y = 1390, z = 10, stackpos = 0},
    {x = 413, y = 1390, z = 10, stackpos = 0},
    {x = 414, y = 1390, z = 10, stackpos = 0},
    {x = 415, y = 1390, z = 10, stackpos = 0},
    {x = 416, y = 1390, z = 10, stackpos = 0},
    {x = 417, y = 1390, z = 10, stackpos = 0},
    {x = 412, y = 1391, z = 10, stackpos = 0},
    {x = 413, y = 1391, z = 10, stackpos = 0},
    {x = 414, y = 1391, z = 10, stackpos = 0},
    {x = 415, y = 1391, z = 10, stackpos = 0},
    {x = 416, y = 1391, z = 10, stackpos = 0},
    {x = 417, y = 1391, z = 10, stackpos = 0},
    {x = 412, y = 1392, z = 10, stackpos = 0},
    {x = 413, y = 1392, z = 10, stackpos = 0},
    {x = 415, y = 1392, z = 10, stackpos = 0},
    {x = 416, y = 1392, z = 10, stackpos = 0}
}


    if(itemEx.uid == 10286 and itemEx.itemid == 1304) then
        for i = 1, #t do
            doCreateItem(5815, 1, t[I])
            doSendMagicEffect(t[I], 67)
        end
        doTransformItem(itemEx.uid, 1309)
        doSendMagicEffect(toPosition, CONST_ME_POFF)
    end

    return false
end
actions/actions.xml
Code:
<action uniqueid="10203" event="script" value="POI/POIlever1oil.lua" />
<action itemid="2553" event="script" value="tools/pick.lua"/>
[/I][/I]

Perhaps it didn't work for you because you're using a different version of TFS than what this was made for? You didn't "upgrade" my script.
 
Last edited:
'Tested using TFS 0.3.7' not mean 'just for 0.3.7' i've used many scripts tested on lower than 0.3.7 and it worked for me.

Downgraded? Seems like you should read better, because i upgraded just your 'second' script (lava) NOT 'first one'.
- pick instead of 'right click'
- better destroyed stone id 1309 (stone)
- added effect

your -> check ids, 2256 -> movable, pickupable, crap look (metal trash from stone?)

So my oil lever script works on TFS 0.4

No offense, i do not attack you, rofl. Just make life easier.
 
Last edited:
'Tested using TFS 0.3.7' not mean 'just for 0.3.7'

In this case it means 0.3.7 and later. Why? Because at the time I made this script, it was for the latest client which happened to be TFS 0.3.7.
 
Last edited:
Could probably shorten that huge table in second script using some math o_O
 
Back
Top