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

[BUG] Annih Quest

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Code:
local playerPosition =
{
	{x = 235, y = 493, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 235, y = 494, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 235, y = 495, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 235, y = 496, z = 13, stackpos = STACKPOS_TOP_CREATURE}
}
local newPosition =
{
	{x=424, y=485, z=10},
	{x=423, y=485, z=10},
	{x=422, y=485, z=10},
	{x=421, y=485, z=10}
}
local demonPosition =
{
	{x=422, y=483, z=10},
	{x=424, y=483, z=10},
	{x=423, y=487, z=10},
	{x=425, y=487, z=10},
	{x=425, y=485, z=10},
	{x=426, y=485, z=10}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local player = {0, 0, 0, 0}
	local failed = TRUE
	local count = 0
	item.new = 1946
	if(item.itemid == 1945) then
		if(os.time(t) >= (getGlobalStorageValue(9000) + 3600)) then
			for i = 1, 4 do
				player[i] = getThingfromPos(playerPosition[i])
				if(player[i].itemid > 0) then
					if(isPlayer(player[i].uid) == TRUE) then
						if(getPlayerStorageValue(player[i].uid, 9000) < 1) then
							if(getPlayerLevel(player[i].uid) >= 100 or getPlayerAccess(player[i].uid) >= 3) then
								failed = FALSE
								count = count + 1
							end
						end
					end
				end
				if(failed == TRUE) then
					doTransformItem(item.uid, 1946)
					return TRUE
				end
			end
			if(count == 4) then
				for i = 1, 6 do
					doSummonCreature("Demon", demonPosition[i])
				end
				for i = 1, 4 do
					doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
					doTeleportThing(player[i].uid, newPosition[i], FALSE)
					doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
					setPlayerStorageValue(player[i].uid, 9000, 1)
				end
				setGlobalStorageValue(9000, os.time(t))
			end
		end
	else
		item.new = 1945
	end
	doTransformItem(item.uid, item.new)
	return TRUE
end
Fixed plx? :x

Bug:
he does not go to the place
 
edit this script to your needs

Lua:
-- Annihilator by Shawak v2.1

        -- CONFIG --

        local room = {     -- room with demons
        fromX = 80,
        fromY = 122,
        fromZ = 7,
        --------------
        toX = 83,
        toY = 126,
        toZ = 7
        }

        local monster_pos = {
        [1] = {pos = {80, 122, 7}, monster = "Demon"},
        [2] = {pos = {82, 122, 7}, monster = "Demon"},
        [3] = {pos = {81, 126, 7}, monster = "Demon"},
        [4] = {pos = {83, 126, 7}, monster = "Demon"},
        [5] = {pos = {84, 124, 7}, monster = "Demon"},
        [6] = {pos = {85, 124, 7}, monster = "Demon"}
        }

        local players_pos = {
		{x = 83, y = 136, z = 7, stackpos = 253},
		{x = 84, y = 136, z = 7, stackpos = 253},
		{x = 85, y = 136, z = 7, stackpos = 253},
		{x = 86, y = 136, z = 7, stackpos = 253}
        }

        local new_player_pos = {
		{x = 80, y = 124, z = 7},
		{x = 81, y = 124, z = 7},
		{x = 82, y = 124, z = 7},
		{x = 83, y = 124, z = 7}
        }

        local playersOnly = "no"
        local questLevel = 100

        ------------------------------------------------------
        --- CONFIG END ---------------------------------------
        ------------------------------------------------------

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player[i].itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player[i].uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos[i], FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end
 
Lua:
        local room = {     -- room with demons
        fromX = 80,
        fromY = 122,
        fromZ = 7,
        --------------
        toX = 83,
        toY = 126,
        toZ = 7

I did not understand that part
 
if you understand that its from corner to corner

x3ii2o.jpg


corner to corner :)
 
Back
Top