• 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!

Solved Modified Yakchal tomb by teckman

Lightonia

Lightonia.servegame.com
Joined
Jun 4, 2007
Messages
492
Reaction score
9
I have no idea why it don't work, No errors, when i use the item nothing happens at all.

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 ?
 
try this
LUA:
local t = {
	bossPosition = {x = 226, y = 330, z = 8},
	bossNewPosition  = {x = 232, y = 331, z = 8},
	storage = 5678
} 
local monsterPositions = {
	 {monsterPos = {x=232, y=328, z=8}, monsterName = "dizazter"}, 
     {monsterPos = {x=232, y=328, z=8}, monsterName = "red dizazter"},
     {monsterPos = {x=232, y=328, z=8}, monsterName = "dimensional dizazter"},
     {monsterPos = {x=235, y=334, z=8}, monsterName = "red dizazter"},
     {monsterPos = {x=235, y=334, z=8}, monsterName = "evil dizazter"},
     {monsterPos = {x=235, y=334, z=8}, monsterName = "dimensional dizazter"}
 }
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(itemEx.itemid == 10098 and item.itemid == 2177) then 
        if(getGlobalStorageValue(t.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", t.bossPosition)
                setGlobalStorageValue(t.storage, 1)
                addEvent(setGlobalStorageValue, 15 * 60 * 1000, t.storage, -1)
            for k, v in pairs(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(t.bossPosition).uid, t.bossNewPosition)
            addEvent(doSendMagicEffect, 3 * 60 * 1000 + 7 * 1000, t.bossNewPosition, CONST_ME_TELEPORT)
        else
            doPlayerSendCancel(cid,"You dont have enough refined crystal power.")
        end
    end
    return true
end
 
Last edited:
It doesn't give any error, though i dont know how to use this quest, i mean do u right-click and use it or do u throw the item on it, what is the problem?
 
It's useful if you add which server you use. I just looked at your other threads and I'm guessing you use TFS 0.3?
If that's true, use event and value instead of script or look at the other actions.xml lines how they are added, and add it the same way.
 
Try this:

LUA:
local config = {
	storage = 5678
}

local t = {
	monsterPos = {
		[{x = 232, y = 328, z = 8}] = {"dizazter", "red dizazter", "dimensional dizazter"},
		[{x = 235, y = 334, z = 8}] = {"red dizazter", "evil dizazter", "dimensional dizazter"}
	},
	bossPos = {x = 226, y = 330, z = 8, stackpos = 255},
	bossNewPos = {x = 232, y = 331, z = 8}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local timer, k, t = 0, itemEx.itemid == 10098, item.itemid == 2177
	if k and t then
		if getStorage(config.storage) > 0 then
			return doPlayerSendCancel(cid, "You don't have enough refined crystal power."), false
		else
			local chance = math.random(1, 5)
			if(chance == 1) then
				doRemoveItem(item.uid, 1)
				doCreatureSay(cid, "You have disturbed Yezid the Wahabi! He sounds furious.", TALKTYPE_MONSTER, nil, nil, getThingPos(cid))
			else
				doCreatureSay(cid, "Yezid the Wahabi has been awoken! He returns from his long slumber... He sounds furious!", TALKTYPE_MONSTER, nil, nil, getThingPos(cid))
			end
			doSetStorage(config.storage, 1)
			doSummonCreature("yezid the wahabi", t.bossPos)
			addEvent(doSetStorage, 15 * 60 * 1000, config.storage, -1)
			for f, v in pairs(t.monsterPos) do
				timer = 5 * 1000
				for i = 1, 3 do
					addEvent(doSummonCreature, timer, v[i], f)
					addEvent(doSendMagicEffect, timer, f, CONST_ME_TELEPORT)
					timer = timer + (55 * 1000)
				end
			end
			addEvent(doTeleportThing, 10 * 60 * 1000, getThingPos(t.bossPos).uid, t.bossNewPos)
			addEvent(doSendMagicEffect, 10 * 60 * 1000, t.bossNewPos, CONST_ME_TELEPORT)
		end
	end
	return true
end
Double check your actions.xml as well. Something should be happening if you edited this file properly.
 
Last edited:
Well, if the support of the premiums where active, i would ofcourse use it, but unfortunately, i have put out threads there and they dont get answered for days,
anyhow i solved this issue, thanks!
 
Back
Top