I have no idea why it don't work, No errors, when i use the item nothing happens at all.
devia.lua
actions.xml
Whats wrong ?
devia.lua
LUA:
local config = {
monsterPositions = {
[{x = 232, y = 328, z = 8}] = {"dizazter", "red dizazter", "dimensional dizazter"},
[{x = 235, y = 334, z = 8}] = {"red dizazter", "evil dizazter", "dimensional dizazter"}
},
bossPosition = {x = 226, y = 330, z = 8, stackpos = 255},
bossNewPosition = {x = 232, y = 331, z = 8},
storage = 5678
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(itemEx.itemid == 10098 and item.itemid == 2177) then
if(getGlobalStorageValue(config.storage) == -1) then
if(math.random(1, 5) == 1) then
doCreatureSay(cid, "Yezid the Wahabi has been awoken, and he returns from his long slumber, he sounds furious ...", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doCreatureSay(cid, "Yezid the Wahabi has been awoken, and he returns from his long slumber, he sounds furious ...", TALKTYPE_ORANGE_1)
end
doSummonCreature("yezid the wahabi", config.bossPosition)
setGlobalStorageValue(config.storage, 1)
addEvent(setGlobalStorageValue, 15 * 60 * 1000, config.storage, -1)
for k, v in pairs(config.monsterPositions) do
timer = 7 * 1000
for i = 1, 3 do
addEvent(doSummonCreature, timer, v[i], k)
addEvent(doSendMagicEffect, timer, k, CONST_ME_TELEPORT)
timer = timer + 60 * 1000
end
end
addEvent(doTeleportThing, 3 * 60 * 1000 + 7 * 1000, getThingfromPos(config.bossPosition).uid, config.bossNewPosition)
addEvent(doSendMagicEffect, 3 * 60 * 1000 + 7 * 1000, config.bossNewPosition, CONST_ME_TELEPORT)
else
doPlayerSendCancel(cid,"You dont have enough refined crystal power.")
end
end
return true
end
actions.xml
Code:
<action itemid="2177" script="devia.lua" />
<action actionid="10222" script="devia.lua" />
Whats wrong ?