Need help for finish this script any one can help me plx ?
Maybe a idea and we can do that ...
REP ++ for help ...
Tks a lot
[Error - Action Interface]
data/actions/scripts/inq/mw_last_room.luanUse
Description:
(luaAddEvent) Callback parameter should be a function.
Maybe script check if the barrierc is on barrierpos but it should be change last than 20 sec is that ?
And if is its possible do a event inside another event to make script work ...
items.xml
mw_last_room.lua
Maybe a idea and we can do that ...
REP ++ for help ...
Tks a lot
[Error - Action Interface]
data/actions/scripts/inq/mw_last_room.luanUse
Description:
(luaAddEvent) Callback parameter should be a function.
Maybe script check if the barrierc is on barrierpos but it should be change last than 20 sec is that ?
And if is its possible do a event inside another event to make script work ...
items.xml
Code:
<item id="8753" article="a" name="magic barrier">
<attribute key="type" value="magicfield" />
</item>
<item id="8754" article="an" name="energy barrier">
<attribute key="decayTo" value="8755"/>
<attribute key="duration" value="20"/>
</item>
<item id="8755" article="a" name="fire barrier">
<attribute key="decayTo" value="8753"/>
<attribute key="duration" value="60"/>
</item>
<item id="8756" article="an" name="energy barrier">
<attribute key="decayTo" value="8757"/>
<attribute key="duration" value="20"/>
</item>
<item id="8757" article="a" name="fire barrier">
<attribute key="decayTo" value="8753"/>
<attribute key="duration" value="60"/>
</item>
<item id="8758" article="an" name="energy barrier">
<attribute key="decayTo" value="8757"/>
<attribute key="duration" value="20"/>
</item>
<item id="8759" article="a" name="fire barrier">
<attribute key="decayTo" value="8753"/>
<attribute key="duration" value="10"/>
</item>
mw_last_room.lua
Code:
local config = {
BarrierPos = { x = 1069, y = 1328, z = 13, stackpos = 255},
FinalPosition = { x = 1069, y = 1327, z = 13},
Owned = "You has changed the wall!",
AlreadyOwned = "You already do that!",
Finished = "Congratulations! You has done the missions now you is a Great Lord Inquisitor",
BarrierIdA = 8753,
BarrierIdB = 8754,
BarrierIdC = 8755,
BarrierIdD = 8756,
BarrierIdE = 8757,
BarrierIdF = 8758,
BarrierIdG = 8759,
ActionId = 1294,
Storage = 1294,
Timer = 24 -- in seconds
}
local event = 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
local getBarrierIdA = getTileItemById(config.BarrierPos, config.BarrierIdA).uid
local getBarrierIdB = getTileItemById(config.BarrierPos, config.BarrierIdB).uid
local getBarrierIdC = getTileItemById(config.BarrierPos, config.BarrierIdC).uid
local getBarrierIdD = getTileItemById(config.BarrierPos, config.BarrierIdD).uid
local getBarrierIdE = getTileItemById(config.BarrierPos, config.BarrierIdE).uid
local getBarrierIdF = getTileItemById(config.BarrierPos, config.BarrierIdF).uid
local getBarrierIdG = getTileItemById(config.BarrierPos, config.BarrierIdG).uid
if item.itemid == config.BarrierIdA and item.actionid == config.ActionId and getPlayerStorageValue(cid,config.storage) >= -1 then
stopEvent(event)
if getBarrierIdA > 0 then
doTransformItem(item.uid, config.BarrierIdB)
doDecayItem(itemEx.uid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.Owned)
event = addEvent(doSetItemActionId, config.Timer * 1000, getBarrierIdC, config.ActionId)
setPlayerStorageValue(cid,config.Storage, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.AlreadyOwned)
end
elseif item.itemid == config.BarrierIdC and item.actionid == config.ActionId and getPlayerStorageValue(cid,config.storage) >= 1 then
stopEvent(event)
if getBarrierIdC > 0 then
doTransformItem(item.uid, config.BarrierIdD)
doDecayItem(itemEx.uid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.Owned)
event = addEvent(doSetItemActionId, config.Timer * 1000, getBarrierIdE, config.ActionId)
setPlayerStorageValue(cid,config.Storage, 2)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.AlreadyOwned)
end
elseif item.itemid == config.BarrierIdE and item.actionid == config.ActionId and getPlayerStorageValue(cid,config.storage) >= 2 then
stopEvent(event)
if getBarrierIdE > 0 then
doTransformItem(item.uid, config.BarrierIdF)
doDecayItem(itemEx.uid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.Owned)
event = addEvent(doSetItemActionId, config.Timer * 1000, getBarrierIdE, config.ActionId)
setPlayerStorageValue(cid,config.Storage, 3)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.AlreadyOwned)
end
elseif item.itemid == config.BarrierIdE and item.actionid == config.ActionId and getPlayerStorageValue(cid,config.storage) >= 3 then
stopEvent(event)
if getBarrierIdG > 0 then
doTransformItem(item.uid, config.BarrierIdG)
doDecayItem(itemEx.uid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.Owned)
doSetItemActionId(getBarrierIdE, config.ActionId)
setPlayerStorageValue(cid,config.Storage, 4)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.AlreadyOwned)
end
elseif item.itemid == config.BarrierIdG and item.actionid == config.ActionId and getPlayerStorageValue(cid,config.storage) >= -1 then
stopEvent(event)
if getBarrierIdG > 0 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.Finished)
doTeleportThing(cid, config.FinalPosition)
setPlayerStorageValue(cid,config.Storage, 4)
event = addEvent(doSetItemActionId, config.Timer * 1000, getBarrierIdA, config.ActionId)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.AlreadyOwned)
end
end
return TRUE
end
Last edited: