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

Anni problem.

konrad_polar

New Member
Joined
Oct 7, 2007
Messages
37
Reaction score
0
Location
Poland
Can anyone post working scripts for anni and anni chests? Cause I downloaded some, but not working =(

Thx.
 
omg -.- i know how to edit script, but it dont work :/ i see error in console with "onUse" function :/

Lua script error: [Action Interface]
data/actions/scripts/annihilator.lua: onUse

Anyone know what is wrong?
 
Last edited:
This One Works perfect for me.

In actions.xml
Code:
	<action uniqueid="5000" script="quests/annihilator.lua"/>
	<action uniqueid="5001" script="quests/annihilator.lua"/>
	<action uniqueid="5002" script="quests/annihilator.lua"/>
	<action uniqueid="5003" script="quests/annihilator.lua"/>
	<action uniqueid="5004" script="quests/annihilator.lua"/>

And Annihilator.lua
Code:
local playerPosition =
{
	{x = 1363, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE},
	{x = 1364, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE},
	{x = 1365, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE},
	{x = 1366, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
	{x = 1353, y = 795, z = 9},
 	{x = 1354, y = 795, z = 9},
	{x = 1355, y = 795, z = 9},
	{x = 1356, y = 795, z = 9}
}

-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = FALSE

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 then
		for i = 1, 4 do
			failed = TRUE
			player[i] = getThingfromPos(playerPosition[i])
			if player[i].itemid > 0 then
				if isPlayer(player[i].uid) == TRUE then
					if getPlayerStorageValue(player[i].uid, 30015) == -1 then
						if getPlayerLevel(player[i].uid) >= 100 then
							failed = FALSE
						end
					end
				end
			end
			if failed == TRUE then
				doPlayerSendCancel(cid, "Sorry, not possible.")
				return TRUE
			end
		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)
		end
		doTransformItem(item.uid, item.itemid + 1)
	elseif item.itemid == 1946 then
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	return TRUE
end

function onUse(cid, item, frompos, item2, topos)

if item.uid == 5001 then
 queststatus = getPlayerStorageValue(cid,100)
 if queststatus == -1 then
  doPlayerSendTextMessage(cid,22,"You have found a demon armor.")
  doPlayerAddItem(cid,2494,1)
  setPlayerStorageValue(cid,100,1)
 else
  doPlayerSendTextMessage(cid,22,"It is empty.")
 end
end
if item.uid == 5002 then
 queststatus = getPlayerStorageValue(cid,100)
 if queststatus ~= 1 then
  doPlayerSendTextMessage(cid,22,"You have found a magic sword.")
  doPlayerAddItem(cid,2400,1)
  setPlayerStorageValue(cid,100,1)
 else
  doPlayerSendTextMessage(cid,22,"It is empty.")
 end
end
if item.uid == 5003 then
 queststatus = getPlayerStorageValue(cid,100)
 if queststatus ~= 1 then
  doPlayerSendTextMessage(cid,22,"You have found a stonecutter axe.")
  doPlayerAddItem(cid,2431,1)
  setPlayerStorageValue(cid,100,1)
 else
  doPlayerSendTextMessage(cid,22,"It is empty.")
 end
end
if item.uid == 5004 then
 queststatus = getPlayerStorageValue(cid,100)
 if queststatus ~= 1 then
  doPlayerSendTextMessage(cid,22,"You have found a present.")
  doPlayerAddItem(cid,2326,1)
  setPlayerStorageValue(cid,100,1)
 else
  doPlayerSendTextMessage(cid,22,"It is empty.")
 end

else
return 0
end
return 1
end
 
Back
Top