• 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 Error Doors & Closing doors at tfs 0.3.7 for 9.60

povedijah

Member
Joined
Jan 11, 2010
Messages
93
Reaction score
6
Hello Otland!, maybe you can help me with my problem

TFS: 0.3.7 9.6

When i try to open a door, or a quest door

.exe say me:
Code:
18:17:50.229] [Error - MoveEvents Interface]
18:17:50.230] data/movements/scripts/closingdoor.lua:onStepOut
18:17:50.231] Description:
18:17:50.232] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table
xpected, got nil)
18:17:50.233] stack traceback:
18:17:50.234]  [C]: in function 'ipairs'
18:17:50.235]  data/lib/050-function.lua:10: in function 'isInArray'
18:17:50.235]  data/movements/scripts/closingdoor.lua:3: in function <data/move
ents/scripts/closingdoor.lua:1>
Doors.lua:

Code:
18:17:50.229] [Error - MoveEvents Interface]
18:17:50.230] data/movements/scripts/closingdoor.lua:onStepOut
18:17:50.231] Description:
18:17:50.232] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table
xpected, got nil)
18:17:50.233] stack traceback:
18:17:50.234]  [C]: in function 'ipairs'
18:17:50.235]  data/lib/050-function.lua:10: in function 'isInArray'
18:17:50.235]  data/movements/scripts/closingdoor.lua:3: in function <data/move
ents/scripts/closingdoor.lua:1>

MY lib-function.lua
Code:
function isInArray(array, value, caseSensitive)
	if (caseSensitive == nil or caseSensitive == false) and type(value) == "string" then
		local lowerValue = value:lower()
		for _, _value in ipairs(array) do
			if type(_value) == "string" and lowerValue == _value:lower() then
				return true
			end
		end
	else
		for _, _value in ipairs(array) do
			if (value == _value) then return true end
		end
	end
	return false
end

function doPlayerGiveItem(cid, itemid, amount, subType)
	local item = 0
	if(isItemStackable(itemid)) then
		item = doCreateItemEx(itemid, amount)
		if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then
			return false
		end
	else
		for i = 1, amount do
			item = doCreateItemEx(itemid, subType)
			if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then
				return false
			end
		end
	end

	return true
end

function doPlayerGiveItemContainer(cid, containerid, itemid, amount, subType)
	for i = 1, amount do
		local container = doCreateItemEx(containerid, 1)
		for x = 1, getContainerCapById(containerid) do
			doAddContainerItem(container, itemid, subType)
		end

		if(doPlayerAddItemEx(cid, container, true) ~= RETURNVALUE_NOERROR) then
			return false
		end
	end

	return true
end

function doPlayerTakeItem(cid, itemid, amount)
	return getPlayerItemCount(cid, itemid) >= amount and doPlayerRemoveItem(cid, itemid, amount)
end

function doPlayerSellItem(cid, itemid, count, cost)
	if(not doPlayerTakeItem(cid, itemid, count)) then
		return false
	end

	if(not doPlayerAddMoney(cid, cost)) then
		error('[doPlayerSellItem] Could not add money to: ' .. getPlayerName(cid) .. ' (' .. cost .. 'gp).')
	end

	return true
end

function doPlayerWithdrawMoney(cid, amount)
	if(not getBooleanFromString(getConfigInfo('bankSystem'))) then
		return false
	end

	local balance = getPlayerBalance(cid)
	if(amount > balance or not doPlayerAddMoney(cid, amount)) then
		return false
	end

	doPlayerSetBalance(cid, balance - amount)
	return true
end

function doPlayerDepositMoney(cid, amount)
	if(not getBooleanFromString(getConfigInfo('bankSystem'))) then
		return false
	end

	if(not doPlayerRemoveMoney(cid, amount)) then
		return false
	end

	doPlayerSetBalance(cid, getPlayerBalance(cid) + amount)
	return true
end

function doPlayerAddStamina(cid, minutes)
	return doPlayerSetStamina(cid, getPlayerStamina(cid) + minutes)
end

function isPremium(cid)
	return (isPlayer(cid) and (getPlayerPremiumDays(cid) > 0 or getBooleanFromString(getConfigValue('freePremium'))))
end

function getMonthDayEnding(day)
	if(day == "01" or day == "21" or day == "31") then
		return "st"
	elseif(day == "02" or day == "22") then
		return "nd"
	elseif(day == "03" or day == "23") then
		return "rd"
	end

	return "th"
end

function getMonthString(m)
	return os.date("%B", os.time{year = 1970, month = m, day = 1})
end

function getArticle(str)
	return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a"
end

function doNumberFormat(i)
	local str, found = string.gsub(i, "(%d)(%d%d%d)$", "%1,%2", 1), 0
	repeat
		str, found = string.gsub(str, "(%d)(%d%d%d),", "%1,%2,", 1)
	until found == 0
	return str
end

function doPlayerAddAddons(cid, addon)
	for i = 0, table.maxn(maleOutfits) do
		doPlayerAddOutfit(cid, maleOutfits[i], addon)
	end

	for i = 0, table.maxn(femaleOutfits) do
		doPlayerAddOutfit(cid, femaleOutfits[i], addon)
	end
end

function getTibiaTime(num)
	local minutes, hours = getWorldTime(), 0
	while (minutes > 60) do
		hours = hours + 1
		minutes = minutes - 60
	end

	if(num) then
		return {hours = hours, minutes = minutes}
	end

	return {hours =  hours < 10 and '0' .. hours or '' .. hours, minutes = minutes < 10 and '0' .. minutes or '' .. minutes}
end

function doWriteLogFile(file, text)
	local f = io.open(file, "a+")
	if(not f) then
		return false
	end

	f:write("[" .. os.date("%d/%m/%Y %H:%M:%S") .. "] " .. text .. "\n")
	f:close()
	return true
end

function getExperienceForLevel(lv)
	lv = lv - 1
	return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3
end

function doMutePlayer(cid, time)
	local condition = createConditionObject(CONDITION_MUTED, (time == -1 and time or time * 1000))
	return doAddCondition(cid, condition, false)

end

function doSummonCreature(name, pos)
	local cid = doCreateMonster(name, pos, false, false)
	if(not cid) then
		cid = doCreateNpc(name, pos)
	end

	return cid
end

function getPlayersOnlineEx()
	local players = {}
	for i, cid in ipairs(getPlayersOnline()) do
		table.insert(players, getCreatureName(cid))
	end

	return players
end

function getPlayerByName(name)
	local cid = getCreatureByName(name)
	return isPlayer(cid) and cid or nil
end

function isPlayer(cid)
	return isCreature(cid) and cid >= AUTOID_PLAYERS and cid < AUTOID_MONSTERS
end

function isPlayerGhost(cid)
	return isPlayer(cid) and (getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE, CONDITIONID_DEFAULT) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN))
end

function isMonster(cid)
	return isCreature(cid) and cid >= AUTOID_MONSTERS and cid < AUTOID_NPCS
end

function isNpc(cid)
	-- Npc IDs are over int32_t range (which is default for lua_pushnumber),
	-- therefore number is always a negative value.
	return isCreature(cid) and (cid < 0 or cid >= AUTOID_NPCS)
end

function isUnderWater(cid)
	return isInArray(underWater, getTileInfo(getCreaturePosition(cid)).itemid)
end

function doPlayerAddLevel(cid, amount, round)
	local experience, level, amount = 0, getPlayerLevel(cid), amount or 1
	if(amount > 0) then
		experience = getExperienceForLevel(level + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(level))
	else
		experience = -((round and getPlayerExperience(cid) or getExperienceForLevel(level)) - getExperienceForLevel(level + amount))
	end

	return doPlayerAddExperience(cid, experience)
end

function doPlayerAddMagLevel(cid, amount)
	local amount = amount or 1
	for i = 1, amount do
		doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid), false)
	end

	return true
end

function doPlayerAddSkill(cid, skill, amount, round)
	local amount = amount or 1
	if(skill == SKILL__LEVEL) then
		return doPlayerAddLevel(cid, amount, round)
	elseif(skill == SKILL__MAGLEVEL) then
		return doPlayerAddMagLevel(cid, amount)
	end

	for i = 1, amount do
		doPlayerAddSkillTry(cid, skill, getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill), false)
	end

	return true
end

function isPrivateChannel(channelId)
	return channelId >= CHANNEL_PRIVATE
end

function doBroadcastMessage(text, class)
	local class = class or MESSAGE_STATUS_WARNING
	if(type(class) == 'string') then
		local className = MESSAGE_TYPES[class]
		if(className == nil) then
			return false
		end

		class = className
	elseif(class < MESSAGE_FIRST or class > MESSAGE_LAST) then
		return false
	end

	for _, pid in ipairs(getPlayersOnline()) do
		doPlayerSendTextMessage(pid, class, text)
	end

	print("> Broadcasted message: \"" .. text .. "\".")
	return true
end

function doPlayerBroadcastMessage(cid, text, class, checkFlag, ghost)
	local checkFlag, ghost, class = checkFlag or true, ghost or false, class or TALKTYPE_BROADCAST
	if(checkFlag and not getPlayerFlagValue(cid, PLAYERFLAG_CANBROADCAST)) then
		return false
	end

	if(type(class) == 'string') then
		local className = TALKTYPE_TYPES[class]
		if(className == nil) then
			return false
		end

		class = className
	elseif(class < TALKTYPE_FIRST or class > TALKTYPE_LAST) then
		return false
	end

	for _, pid in ipairs(getPlayersOnline()) do
		doCreatureSay(cid, text, class, ghost, pid)
	end

	print("> " .. getCreatureName(cid) .. " broadcasted message: \"" .. text .. "\".")
	return true
end

function doCopyItem(item, attributes)
	local attributes = ((type(attributes) == 'table') and attributes or { "aid" })

	local ret = doCreateItemEx(item.itemid, item.type)
	for _, key in ipairs(attributes) do
		local value = getItemAttribute(item.uid, key)
		if(value ~= nil) then
			doItemSetAttribute(ret, key, value)
		end
	end

	if(isContainer(item.uid)) then
		for i = (getContainerSize(item.uid) - 1), 0, -1 do
			local tmp = getContainerItem(item.uid, i)
			if(tmp.itemid > 0) then
				doAddContainerItemEx(ret, doCopyItem(tmp, true).uid)
			end
		end
	end

	return getThing(ret)
end

function doSetItemText(uid, text, writer, date)
	local thing = getThing(uid)
	if(thing.itemid < 100) then
		return false
	end

	doItemSetAttribute(uid, "text", text)
	if(writer ~= nil) then
		doItemSetAttribute(uid, "writer", tostring(writer))
		if(date ~= nil) then
			doItemSetAttribute(uid, "date", tonumber(date))
		end
	end

	return true
end

function getItemWeightById(itemid, count, precision)
	local item, count, precision = getItemInfo(itemid), count or 1, precision or false
	if(not item) then
		return false
	end

	if(count > 100) then
		-- print a warning, as its impossible to have more than 100 stackable items without "cheating" the count
		print('[Warning] getItemWeightById', 'Calculating weight for more than 100 items!')
	end

	local weight = item.weight * count
	return precission and weight or math.round(weight, 2)
end

function choose(...)
	local arg = {...}
	return arg[math.random(1, table.maxn(arg))]
end

function doPlayerAddExpEx(cid, amount)
	if(not doPlayerAddExp(cid, amount)) then
		return false
	end

	local position = getThingPosition(cid)
	doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "You gained " .. amount .. " experience.", amount, COLOR_WHITE, position)

	local spectators, name = getSpectators(position, 7, 7), getCreatureName(cid)
	for _, pid in ipairs(spectators) do
		if(isPlayer(pid) and cid ~= pid) then
			doPlayerSendTextMessage(pid, MESSAGE_EXPERIENCE_OTHERS, name .. " gained " .. amount .. " experience.", amount, COLOR_WHITE, position)
		end
	end

	return true
end

function getItemTopParent(uid)
	local parent = getItemParent(uid)
	if(not parent or parent.uid == 0) then
		return nil
	end

	while(true) do
		local tmp = getItemParent(parent.uid)
		if(tmp and tmp.uid ~= 0) then
			parent = tmp
		else
			break
		end
	end

	return parent
end

function getItemHolder(uid)
	local parent = getItemParent(uid)
	if(not parent or parent.uid == 0) then
		return nil
	end

	local holder = nil
	while(true) do
		local tmp = getItemParent(parent.uid)
		if(tmp and tmp.uid ~= 0) then
			if(tmp.itemid == 1) then -- a creature
				holder = tmp
				break
			end

			parent = tmp
		else
			break
		end
	end

	return holder
end

function valid(f)
	return function(p, ...)
		if(isCreature(p)) then
			return f(p, ...)
		end
	end
end

function getItemsFromList(items) -- by vodka
local str = ''
if table.maxn(items) > 0 then
for i = 1, table.maxn(items) do
str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1])
if i ~= table.maxn(items) then str = str .. ', ' end end end
return str
end

function doRemoveItemsFromList(cid,items) -- by vodka
local count = 0
if table.maxn(items) > 0 then
for i = 1, table.maxn(items) do
if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
count = count + 1 end  end  end
if count == table.maxn(items) then
for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
else return false end
return true end

Thank you!!
 
Last edited by a moderator:
Code:
function onStepOut(cid, item, position, fromPosition)
	local newPosition = {x = position.x, y = position.y, z = position.z}
	if isInArray(verticalOpenDoors, item.itemid) == TRUE then
		newPosition.x = newPosition.x + 1
	else
		newPosition.y = newPosition.y + 1
	end
	doRelocate(position, newPosition)

	local tmpPos = {x = position.x, y = position.y, z = position.z, stackpos = -1}
	local tileCount = getTileThingByPos(tmpPos)
	local i = 1
	local tmpItem = {uid = 1}
	while(tmpItem.uid ~= 0 and i < tileCount) do
		tmpPos.stackpos = i
		tmpItem = getTileThingByPos(tmpPos)
		if tmpItem.uid ~= item.uid and tmpItem.uid ~= 0 and isMoveable(tmpItem.uid) == TRUE then
			doRemoveItem(tmpItem.uid)
		else
			i = i + 1
		end
	end
	doTransformItem(item.uid, item.itemid - 1)
	return TRUE
end

Here is it!
 
For some reason, I think it doesn't like 'verticalOpenDoors'.
Search for 'verticalOpenDoors' in data/lib/000-constant.lua and see if it's there.

If it's not in there, try this:
Lua:
function onStepOut(cid, item, position, lastPosition)
	if(getTileInfo(position).creatures > 0) then
		return true
	end

	local newPosition = {x = position.x + 1, y = position.y, z = position.z}
	local query = doTileQueryAdd(cid, newPosition)
	if(query == RETURNVALUE_NOTENOUGHROOM) then
		newPosition.x = newPosition.x - 1
		newPosition.y = newPosition.y + 1
		query = doTileQueryAdd(cid, newPosition) -- repeat until found
	end

	if(query == RETURNVALUE_NOERROR and query == RETURNVALUE_NOTENOUGHROOM) then
		doRelocate(position, newPosition)
	end

	position.stackpos = -1
	local i, tileItem, tileCount = 1, {uid = 1}, getTileThingByPos(position)
	while(tileItem.uid ~= 0 and i < tileCount) do
		position.stackpos = i
		tileItem = getTileThingByPos(position)
		if(tileItem.uid ~= 0 and tileItem.uid ~= item.uid and isMovable(tileItem.uid)) then
			doRemoveItem(tileItem.uid)
		else
			i = i + 1
		end
	end

	local itemInfo = getItemInfo(item.itemid)
	doTransformItem(item.uid, itemInfo.transformUseTo)
	return true
end
 
I searched in my constant.lua and i found nothing of vertical open doors, so i added your code like it:
Code:
 NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
SOUTHWEST = 4
SOUTHEAST = 5
NORTHWEST = 6
NORTHEAST = 7
 
COMBAT_FORMULA_UNDEFINED = 0
COMBAT_FORMULA_LEVELMAGIC = 1
COMBAT_FORMULA_SKILL = 2
COMBAT_FORMULA_DAMAGE = 3
 
CONDITION_PARAM_OWNER = 1
CONDITION_PARAM_TICKS = 2
CONDITION_PARAM_OUTFIT = 3
CONDITION_PARAM_HEALTHGAIN = 4
CONDITION_PARAM_HEALTHTICKS = 5
CONDITION_PARAM_MANAGAIN = 6
CONDITION_PARAM_MANATICKS = 7
CONDITION_PARAM_DELAYED = 8
CONDITION_PARAM_SPEED = 9
CONDITION_PARAM_LIGHT_LEVEL = 10
CONDITION_PARAM_LIGHT_COLOR = 11
CONDITION_PARAM_SOULGAIN = 12
CONDITION_PARAM_SOULTICKS = 13
CONDITION_PARAM_MINVALUE = 14
CONDITION_PARAM_MAXVALUE = 15
CONDITION_PARAM_STARTVALUE = 16
CONDITION_PARAM_TICKINTERVAL = 17
CONDITION_PARAM_FORCEUPDATE = 18
CONDITION_PARAM_SKILL_MELEE = 19
CONDITION_PARAM_SKILL_FIST = 20
CONDITION_PARAM_SKILL_CLUB = 21
CONDITION_PARAM_SKILL_SWORD = 22
CONDITION_PARAM_SKILL_AXE = 23
CONDITION_PARAM_SKILL_DISTANCE = 24
CONDITION_PARAM_SKILL_SHIELD = 25
CONDITION_PARAM_SKILL_FISHING = 26
CONDITION_PARAM_STAT_MAXHEALTH = 27
CONDITION_PARAM_STAT_MAXMANA = 28
CONDITION_PARAM_STAT_SOUL = 29
CONDITION_PARAM_STAT_MAGICLEVEL = 30
CONDITION_PARAM_STAT_MAXHEALTHPERCENT = 31
CONDITION_PARAM_STAT_MAXMANAPERCENT = 32
CONDITION_PARAM_STAT_SOULPERCENT = 33
CONDITION_PARAM_STAT_MAGICLEVELPERCENT = 34
CONDITION_PARAM_SKILL_MELEEPERCENT = 35
CONDITION_PARAM_SKILL_FISTPERCENT = 36
CONDITION_PARAM_SKILL_CLUBPERCENT = 37
CONDITION_PARAM_SKILL_SWORDPERCENT = 38
CONDITION_PARAM_SKILL_AXEPERCENT = 39
CONDITION_PARAM_SKILL_DISTANCEPERCENT = 40
CONDITION_PARAM_SKILL_SHIELDPERCENT = 41
CONDITION_PARAM_SKILL_FISHINGPERCENT = 42
CONDITION_PARAM_PERIODICDAMAGE = 43
CONDITION_PARAM_BUFF = 44
CONDITION_PARAM_SUBID = 45
CONDITION_PARAM_FIELD = 46
 
COMBAT_PARAM_TYPE = 1
COMBAT_PARAM_EFFECT = 2
COMBAT_PARAM_DISTANCEEFFECT = 3
COMBAT_PARAM_BLOCKSHIELD = 4
COMBAT_PARAM_BLOCKARMOR = 5
COMBAT_PARAM_TARGETCASTERORTOPMOST = 6
COMBAT_PARAM_CREATEITEM = 7
COMBAT_PARAM_AGGRESSIVE = 8
COMBAT_PARAM_DISPEL = 9
COMBAT_PARAM_USECHARGES = 10
COMBAT_PARAM_TARGETPLAYERSORSUMMONS = 11
COMBAT_PARAM_DIFFERENTAREADAMAGE = 12
COMBAT_PARAM_HITEFFECT = 13
COMBAT_PARAM_HITCOLOR = 14
COMBAT_PARAM_ELEMENTTYPE = 15
COMBAT_PARAM_ELEMENTDAMAGE = 16

CALLBACK_PARAM_LEVELMAGICVALUE = 1
CALLBACK_PARAM_SKILLVALUE = 2
CALLBACK_PARAM_TARGETTILE = 3
CALLBACK_PARAM_TARGETCREATURE = 4

COMBAT_NONE = 0
COMBAT_PHYSICALDAMAGE = 1
COMBAT_ENERGYDAMAGE = 2
COMBAT_EARTHDAMAGE = 4
COMBAT_POISONDAMAGE = 4
COMBAT_FIREDAMAGE = 8
COMBAT_UNDEFINEDDAMAGE = 16
COMBAT_LIFEDRAIN = 32
COMBAT_MANADRAIN = 64
COMBAT_HEALING = 128
COMBAT_DROWNDAMAGE = 256
COMBAT_ICEDAMAGE = 512
COMBAT_HOLYDAMAGE = 1024
COMBAT_DEATHDAMAGE = 2048
 
CONDITION_NONE = 0
CONDITION_POISON = 1
CONDITION_FIRE = 2
CONDITION_ENERGY = 4
CONDITION_BLEEDING = 8
CONDITION_HASTE = 16
CONDITION_PARALYZE = 32
CONDITION_OUTFIT = 64
CONDITION_INVISIBLE = 128
CONDITION_LIGHT = 256
CONDITION_MANASHIELD = 512
CONDITION_INFIGHT = 1024
CONDITION_DRUNK = 2048
CONDITION_EXHAUST = 4096
CONDITION_FOOD = 8192
CONDITION_REGENERATION = 8192
CONDITION_SOUL = 16384
CONDITION_DROWN = 32768
CONDITION_MUTED = 65536
CONDITION_ATTRIBUTES = 131072
CONDITION_FREEZING = 262144
CONDITION_DAZZLED = 524288
CONDITION_CURSED = 1048576
CONDITION_PACIFIED = 2097152
CONDITION_GAMEMASTER = 4194304
CONDITION_HUNTING = 8388608
CONDITION_SPELLCOOLDOWN = 16777216

CONDITIONID_DEFAULT = -1
CONDITIONID_COMBAT = 0
CONDITIONID_HEAD = 1
CONDITIONID_NECKLACE = 2
CONDITIONID_BACKPACK = 3
CONDITIONID_ARMOR = 4
CONDITIONID_RIGHT = 5
CONDITIONID_LEFT = 6
CONDITIONID_LEGS = 7
CONDITIONID_FEET = 8
CONDITIONID_RING = 9
CONDITIONID_AMMO = 10
CONDITIONID_OUTFIT = 11
 
EXHAUST_OTHER = 0
EXHAUST_SPELLGROUP_NONE = 1
EXHAUST_SPELLGROUP_ATTACK = 2
EXHAUST_SPELLGROUP_HEALING = 3
EXHAUST_SPELLGROUP_SUPPORT = 4
EXHAUST_SPELLGROUP_SPECIAL = 5
EXHAUST_MELEE = 6

MUTED_BUFFER = 0
MUTED_YELL = 1
MUTED_MAIL = 2
MUTED_TRADE = 3
MUTED_TRADE_ROOK = 4
 
GAMEMASTER_INVISIBLE = 0
GAMEMASTER_IGNORE = 1
GAMEMASTER_TELEPORT = 2

CONST_SLOT_FIRST = 1
CONST_SLOT_HEAD = CONST_SLOT_FIRST
CONST_SLOT_NECKLACE = 2
CONST_SLOT_BACKPACK = 3
CONST_SLOT_ARMOR = 4
CONST_SLOT_RIGHT = 5
CONST_SLOT_LEFT = 6
CONST_SLOT_LEGS = 7
CONST_SLOT_FEET = 8
CONST_SLOT_RING = 9
CONST_SLOT_AMMO = 10
CONST_SLOT_LAST = CONST_SLOT_AMMO

CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_GREEN = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_TUTORIALARROW = 55
CONST_ME_TUTORIALSQUARE = 56
CONST_ME_MIRRORHORIZONTAL = 57
CONST_ME_MIRRORVERTICAL = 58
CONST_ME_SKULLHORIZONTAL = 59
CONST_ME_SKULLVERTICAL = 60
CONST_ME_ASSASSIN = 61
CONST_ME_STEPSHORIZONTAL = 62
CONST_ME_BLOODYSTEPS = 63
CONST_ME_STEPSVERTICAL = 64
CONST_ME_YALAHARIGHOST = 65
CONST_ME_BATS = 66
CONST_ME_SMOKE = 67
CONST_ME_INSECTS = 68
CONST_ME_DRAGONHEAD = 69
CONST_ME_ORCSHAMAN = 70
CONST_ME_ORCSHAMAN_FIRE = 71
CONST_ME_THUNDER = 72
CONST_ME_FERUMBRAS = 73
CONST_ME_CONFETTIHORIZONTAL = 74
CONST_ME_CONFETTIVERTICAL = 75
CONST_ME_NONE = 255
CONST_ME_LAST = CONST_ME_CONFETTIVERTICAL

CONST_ANI_SPEAR = 0
CONST_ANI_BOLT = 1
CONST_ANI_ARROW = 2
CONST_ANI_FIRE = 3
CONST_ANI_ENERGY = 4
CONST_ANI_POISONARROW = 5
CONST_ANI_BURSTARROW = 6
CONST_ANI_THROWINGSTAR = 7
CONST_ANI_THROWINGKNIFE = 8
CONST_ANI_SMALLSTONE = 9
CONST_ANI_DEATH = 10
CONST_ANI_LARGEROCK = 11
CONST_ANI_SNOWBALL = 12
CONST_ANI_POWERBOLT = 13
CONST_ANI_POISON = 14
CONST_ANI_INFERNALBOLT = 15
CONST_ANI_HUNTINGSPEAR = 16
CONST_ANI_ENCHANTEDSPEAR = 17
CONST_ANI_REDSTAR = 18
CONST_ANI_GREENSTAR = 19
CONST_ANI_ROYALSPEAR = 20
CONST_ANI_SNIPERARROW = 21
CONST_ANI_ONYXARROW = 22
CONST_ANI_PIERCINGBOLT = 23
CONST_ANI_WHIRLWINDSWORD = 24
CONST_ANI_WHIRLWINDAXE = 25
CONST_ANI_WHIRLWINDCLUB = 26
CONST_ANI_ETHEREALSPEAR = 27
CONST_ANI_ICE = 28
CONST_ANI_EARTH = 29
CONST_ANI_HOLY = 30
CONST_ANI_SUDDENDEATH = 31
CONST_ANI_FLASHARROW = 32
CONST_ANI_FLAMMINGARROW = 33
CONST_ANI_SHIVERARROW = 34
CONST_ANI_ENERGYBALL = 35
CONST_ANI_SMALLICE = 36
CONST_ANI_SMALLHOLY = 37
CONST_ANI_SMALLEARTH = 38
CONST_ANI_EARTHARROW = 39
CONST_ANI_EXPLOSION = 40
CONST_ANI_CAKE = 41
CONST_ANI_UNK1 = 42 -- Debug!
CONST_ANI_TARSALARROW = 43
CONST_ANI_VORTEXBOLT = 44
CONST_ANI_UNK2 = 45 -- Debug!
CONST_ANI_UNK3 = 46 -- Debug!
CONST_ANI_PRISMATBOLT = 47 
CONST_ANI_CRYSTALARROW = 48 
CONST_ANI_DRILLBOLT = 49
CONST_ANI_ENVENOMARROW = 50 
CONST_ANI_UNK4 = 51 -- Debug!
CONST_ANI_WEAPONTYPE = 254
CONST_ANI_NONE = 255
CONST_ANI_LAST = CONST_ANI_UNK4
 
TALKTYPE_FIRST = 1
TALKTYPE_SAY = TALKTYPE_FIRST
TALKTYPE_WHISPER = 2
TALKTYPE_YELL = 3
TALKTYPE_PRIVATE_FROM = 4
TALKTYPE_PRIVATE_TO = 5
TALKTYPE_CHANNEL = 7
TALKTYPE_CHANNEL_HIGHLIGHT = 8
TALKTYPE_SPELL = 9
TALKTYPE_PRIVATE_NP = 10
TALKTYPE_PRIVATE_PN = 11
TALKTYPE_GAMEMASTER_BROADCAST = 12
TALKTYPE_GAMEMASTER_CHANNEL = 13
TALKTYPE_GAMEMASTER_PRIVATE_FROM = 14
TALKTYPE_GAMEMASTER_PRIVATE_TO = 15
TALKTYPE_MONSTER_SAY = 34
TALKTYPE_MONSTER_YELL = 35
 
TALKTYPE_FIRST = TALKTYPE_SAY
TALKTYPE_LAST = TALKTYPE_GAMEMASTER_PRIVATE_TO
TALKTYPE_MONSTER_FIRST = TALKTYPE_MONSTER_SAY
TALKTYPE_MONSTER_LAST = TALKTYPE_MONSTER_YELL

TALKTYPE_TYPES = {
	["say"] = TALKTYPE_SAY,
	["whisper"] = TALKTYPE_WHISPER,
	["yell"] = TALKTYPE_YELL,
	["private-playernpc"] = TALKTYPE_PRIVATE_PN,
	["private-npcplayer"] = TALKTYPE_PRIVATE_NP,
	["private"] = TALKTYPE_PRIVATE_FROM,
	["channel-yellow"] = TALKTYPE_CHANNEL,
	["channel-white"] = TALKTYPE_CHANNEL_MANAGEMENT,
	["broadcast"] = TALKTYPE_GAMEMASTER_BROADCAST,
	["channel-red"] = TALKTYPE_GAMEMASTER_CHANNEL,
	["private-red"] = TALKTYPE_GAMEMASTER_PRIVATE_FROM,
	["channel-orange"] = TALKTYPE_CHANNEL_HIGHLIGHT,
	["monster"] = TALKTYPE_MONSTER_SAY,
	["monster-yell"] = TALKTYPE_MONSTER_YELL
}
 
MESSAGE_STATUS_CONSOLE_BLUE = 4
MESSAGE_STATUS_CONSOLE_RED = 12
MESSAGE_STATUS_DEFAULT = 16
MESSAGE_STATUS_WARNING = 17
MESSAGE_EVENT_ADVANCE = 18
MESSAGE_STATUS_SMALL = 19
MESSAGE_INFO_DESCR = 20
MESSAGE_DAMAGE_DEALT = 21
MESSAGE_DAMAGE_RECEIVED = 22
MESSAGE_HEALED = 23
MESSAGE_EXPERIENCE = 24
MESSAGE_DAMAGE_OTHERS = 25
MESSAGE_HEALED_OTHERS = 26
MESSAGE_EXPERIENCE_OTHERS = 27
MESSAGE_EVENT_DEFAULT = 28
MESSAGE_LOOT = 29
MESSAGE_TRADE_NPC = 30
MESSAGE_EVENT_GUILD = 31
MESSAGE_PARTY_MANAGEMENT = 32
MESSAGE_PARTY = 33
MESSAGE_EVENT_ORANGE = 34
MESSAGE_STATUS_CONSOLE_ORANGE = 35
MESSAGE_REPORT = 36
MESSAGE_HOTKEY_USE = 37
MESSAGE_TUTORIAL_HINT = 38
 
MESSAGE_FIRST = MESSAGE_STATUS_CONSOLE_BLUE
MESSAGE_LAST = MESSAGE_TUTORIAL_HINT
 
MESSAGE_TYPES = {
	["advance"] = MESSAGE_EVENT_ADVANCE,
	["event"] = MESSAGE_EVENT_DEFAULT,
	["white"] = MESSAGE_EVENT_DEFAULT,
	["orange"] = MESSAGE_STATUS_CONSOLE_ORANGE,
	["info"] = MESSAGE_INFO_DESCR,
	["green"] = MESSAGE_INFO_DESCR,
	["small"] = MESSAGE_STATUS_SMALL,
	["blue"] = MESSAGE_STATUS_CONSOLE_BLUE,
	["red"] = MESSAGE_STATUS_CONSOLE_RED,
	["warning"] = MESSAGE_STATUS_WARNING,
	["status"] = MESSAGE_STATUS_DEFAULT
}
 
COLOR_BLACK = 0
COLOR_BLUE = 5
COLOR_GREEN = 18
COLOR_LIGHTGREEN = 66
COLOR_DARKBROWN = 78
COLOR_LIGHTBLUE = 89
COLOR_MAYABLUE = 95
COLOR_DARKRED = 108
COLOR_DARKPURPLE = 112
COLOR_BROWN = 120
COLOR_GREY = 129
COLOR_TEAL = 143
COLOR_DARKPINK = 152
COLOR_PURPLE = 154
COLOR_DARKORANGE = 156
COLOR_RED = 180
COLOR_PINK = 190
COLOR_ORANGE = 192
COLOR_DARKYELLOW = 205
COLOR_YELLOW = 210
COLOR_WHITE = 215
COLOR_NONE = 255
 
MAPMARK_TICK = 0
MAPMARK_QUESTION = 1
MAPMARK_EXCLAMATION = 2
MAPMARK_STAR = 3
MAPMARK_CROSS = 4
MAPMARK_TEMPLE = 5
MAPMARK_KISS = 6
MAPMARK_SHOVEL = 7
MAPMARK_SWORD = 8
MAPMARK_FLAG = 9
MAPMARK_LOCK = 10
MAPMARK_BAG = 11
MAPMARK_SKULL = 12
MAPMARK_DOLLAR = 13
MAPMARK_REDNORTH = 14
MAPMARK_REDSOUTH = 15
MAPMARK_REDEAST = 16
MAPMARK_REDWEST = 17
MAPMARK_GREENNORTH = 18
MAPMARK_GREENSOUTH = 19

ITEM_TYPE_NONE = 0
ITEM_TYPE_DEPOT = 1
ITEM_TYPE_MAILBOX = 2
ITEM_TYPE_TRASHHOLDER = 3
ITEM_TYPE_CONTAINER = 4
ITEM_TYPE_DOOR = 5
ITEM_TYPE_MAGICFIELD = 6
ITEM_TYPE_TELEPORT = 7
ITEM_TYPE_BED = 8
ITEM_TYPE_KEY = 9
ITEM_TYPE_RUNE = 10
 
ITEM_GROUP_NONE = 0
ITEM_GROUP_GROUND = 1
ITEM_GROUP_CONTAINER = 2
ITEM_GROUP_CHARGES = 6
ITEM_GROUP_SPLASH = 11
ITEM_GROUP_FLUID = 12

CONST_PROP_BLOCKSOLID = 0
CONST_PROP_HASHEIGHT = 1
CONST_PROP_BLOCKPROJECTILE = 2
CONST_PROP_BLOCKPATHFIND = 3
CONST_PROP_ISVERTICAL = 4
CONST_PROP_ISHORIZONTAL = 5
CONST_PROP_MOVABLE = 6
CONST_PROP_BLOCKINGANDNOTMOVABLE = 7
CONST_PROP_SUPPORTHANGABLE = 8
 
CHASEMODE_STANDSTILL = 0
CHASEMODE_FOLLOW = 1

FIGHTMODE_ATTACK = 0
FIGHTMODE_BALANCED = 1
FIGHTMODE_DEFENSE = 2
 
SECUREMODE_ON = 0
SECUREMODE_OFF = 1
 
TRADE_NONE = 0
TRADE_INITIATED = 1
TRADE_ACCEPT = 2
TRADE_ACKNOWLEDGE = 3
TRADE_TRANSFER = 4

MANAGER_NONE = 0
MANAGER_NEW = 1
MANAGER_ACCOUNT = 2
MANAGER_NAMELOCK = 3

PLAYERSEX_FEMALE = 0
PLAYERSEX_MALE = 1
 
PLAYERLOSS_EXPERIENCE = 0
PLAYERLOSS_MANA = 1
PLAYERLOSS_SKILLS = 2
PLAYERLOSS_CONTAINERS = 3
PLAYERLOSS_ITEMS = 4

STATSCHANGE_HEALTHGAIN = 0
STATSCHANGE_HEALTHLOSS = 1
STATSCHANGE_MANAGAIN = 2
STATSCHANGE_MANALOSS = 3

SKILL_FIRST = 0
SKILL_FIST = SKILL_FIRST
SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6
SKILL__MAGLEVEL = 7
SKILL__LEVEL = 8
SKILL__EXPERIENCE = 9
SKILL_LAST = SKILL_FISHING
SKILL__PRE_LAST = SKILL__LEVEL
SKILL__LAST = SKILL__EXPERIENCE

SKILL_NAMES = {
	[SKILL_FIST] = "fist fighting",
	[SKILL_CLUB] = "club fighting",
	[SKILL_SWORD] = "sword fighting",
	[SKILL_AXE] = "axe fighting",
	[SKILL_DISTANCE] = "distance fighting",
	[SKILL_SHIELD] = "shielding",
	[SKILL_FISHING] = "fishing",
	[SKILL__LEVEL] = "level",
	[SKILL__MAGLEVEL] = "magic level"
}

SKILL_IDS = {
	["fist"] = SKILL_FIST,
	["club"] = SKILL_CLUB,
	["sword"] = SKILL_SWORD,
	["axe"] = SKILL_AXE,
	["distance"] = SKILL_DISTANCE,
	["dist"] = SKILL_DISTANCE,
	["shielding"] = SKILL_SHIELD,
	["shield"] = SKILL_SHIELD,
	["fishing"] = SKILL_FISHING,
	["fish"] = SKILL_FISHING,
	["level"] = SKILL__LEVEL,
	["magic"] = SKILL__MAGLEVEL
}

GUILD_MEMBER = 1
GUILD_VICE = 2
GUILD_LEADER = 3

SKULL_NONE = 0
SKULL_YELLOW = 1
SKULL_GREEN = 2
SKULL_WHITE = 3
SKULL_RED = 4
SKULL_BLACK = 5
SKULL_ORANGE = 6
SKULL_LAST = SKULL_ORANGE

SHIELD_NONE = 0
SHIELD_WHITEYELLOW = 1
SHIELD_WHITEBLUE = 2
SHIELD_BLUE = 3
SHIELD_YELLOW = 4
SHIELD_BLUE_SHAREDEXP = 5
SHIELD_YELLOW_SHAREDEXP = 6
SHIELD_BLUE_NOSHAREDEXP_BLINK = 7
SHIELD_YELLOW_NOSHAREDEXP_BLINK = 8
SHIELD_BLUE_NOSHAREDEXP = 9
SHIELD_YELLOW_NOSHAREDEXP = 10
SHIELD_LAST = SHIELD_YELLOW_NOSHAREDEXP

EMBLEM_NONE = 0
EMBLEM_GREEN = 1
EMBLEM_RED = 2
EMBLEM_BLUE = 3

WORLDTYPE_OPTIONAL = 1
WORLDTYPE_OPEN = 2
WORLDTYPE_HARDCORE = 3

DATABASE_NONE = 0
DATABASE_MYSQL = 1
DATABASE_SQLITE = 2
DATABASE_POSTGRESQL = 3

GAMESTATE_STARTUP = 1
GAMESTATE_INIT = 2
GAMESTATE_NORMAL = 3
GAMESTATE_MAINTAIN = 4
GAMESTATE_CLOSED = 5
GAMESTATE_CLOSING = 6
GAMESTATE_SHUTDOWN = 7

RELOAD_ACTIONS = 1
RELOAD_CHAT = 2
RELOAD_CONFIG = 3
RELOAD_CREATUREEVENTS = 4
RELOAD_GAMESERVERS = 5
RELOAD_GLOBALEVENTS = 6
RELOAD_GROUPS = 7
RELOAD_HIGHSCORES = 8
RELOAD_ITEMS = 10
RELOAD_MONSTERS = 11
RELOAD_MOUNTS = 12
RELOAD_MOVEEVENTS = 13
RELOAD_NPCS = 14
RELOAD_OUTFITS = 15
RELOAD_QUESTS = 16
RELOAD_RAIDS = 17
RELOAD_SPELLS = 18
RELOAD_STAGES = 19
RELOAD_TALKACTIONS = 20
RELOAD_VOCATIONS = 21
RELOAD_WEAPONS = 22
RELOAD_MODS = 23
RELOAD_ALL = 24

BAN_NONE = 0
BAN_IP = 1
BAN_PLAYER = 2
BAN_ACCOUNT = 3
BAN_NOTATION = 4

PLAYERBAN_NONE = 0
PLAYERBAN_REPORT = 1
PLAYERBAN_LOCK = 2
PLAYERBAN_BANISHMENT = 3

CHANNEL_GUILD = 0
CHANNEL_PARTY = 1
CHANNEL_HELP = 7
CHANNEL_DEFAULT = 0xFFFE
CHANNEL_PRIVATE = 0xFFFF

STACKPOS_GROUND = 0
STACKPOS_TOP_CREATURE = 253
STACKPOS_TOP_FIELD = 254
STACKPOS_TOP_MOVABLE_ITEM_OR_CREATURE = 255

WEAPON_NONE = 0
WEAPON_SWORD = 1
WEAPON_CLUB = 2
WEAPON_AXE = 3
WEAPON_DIST = 4
WEAPON_SHIELD = 5
WEAPON_FIST = 6
WEAPON_WAND = 7
WEAPON_AMMO = 8

RECURSE_FIRST = -1
RECURSE_NONE = 0
RECURSE_ALL = 1

ITEM_GOLD_COIN = 2148
ITEM_PLATINUM_COIN = 2152
ITEM_CRYSTAL_COIN = 2160
ITEM_SCARAB_COIN = 2159
ITEM_FISH = 2667
ITEM_WORM = 3976
ITEM_MECHANICAL_FISH = 10224
ITEM_NAIL = 8309
ITEM_MECHANICAL_FISHING_ROD = 10223
ITEM_GREEN_PERCH = 7159
ITEM_RAINBOW_TROUT = 7158
ITEM_NORTHERN_PIKE = 2669
ITEM_PARCEL = 9081
ITEM_LABEL = 2599
ITEM_ACTION_BOOK = 1977
ITEM_MAGIC_WALL = 1497
ITEM_WILD_GROWTH = 1499

ITEM_FOOD_MEAT = 2666
ITEM_FOOD_HAM = 2671
ITEM_FOOD_GRAPE = 2681
ITEM_FOOD_APLE = 2674
ITEM_FOOD_BREAD = 2689
ITEM_FOOD_ROOL = 2690
ITEM_FOOD_CHEESE = 2696

RETURNVALUE_NOERROR = 0
RETURNVALUE_NOTPOSSIBLE = 1
RETURNVALUE_NOTENOUGHROOM = 2
RETURNVALUE_PLAYERISPZLOCKED = 3
RETURNVALUE_PLAYERISNOTINVITED = 4
RETURNVALUE_CANNOTTHROW = 5
RETURNVALUE_THEREISNOWAY = 6
RETURNVALUE_DESTINATIONOUTOFREACH = 7
RETURNVALUE_CREATUREBLOCK = 8
RETURNVALUE_NOTMOVABLE = 9
RETURNVALUE_DROPTWOHANDEDITEM = 10
RETURNVALUE_BOTHHANDSNEEDTOBEFREE = 11
RETURNVALUE_CANONLYUSEONEWEAPON = 12
RETURNVALUE_NEEDEXCHANGE = 13
RETURNVALUE_CANNOTBEDRESSED = 14
RETURNVALUE_PUTTHISOBJECTINYOURHAND = 15
RETURNVALUE_PUTTHISOBJECTINBOTHHANDS = 16
RETURNVALUE_TOOFARAWAY = 17
RETURNVALUE_FIRSTGODOWNSTAIRS = 18
RETURNVALUE_FIRSTGOUPSTAIRS = 19
RETURNVALUE_CONTAINERNOTENOUGHROOM = 20
RETURNVALUE_NOTENOUGHCAPACITY = 21
RETURNVALUE_CANNOTPICKUP = 22
RETURNVALUE_THISISIMPOSSIBLE = 23
RETURNVALUE_DEPOTISFULL = 24
RETURNVALUE_CREATUREDOESNOTEXIST = 25
RETURNVALUE_CANNOTUSETHISOBJECT = 26
RETURNVALUE_PLAYERWITHTHISNAMEISNOTONLINE = 27
RETURNVALUE_NOTREQUIREDLEVELTOUSERUNE = 28
RETURNVALUE_YOUAREALREADYTRADING = 29
RETURNVALUE_THISPLAYERISALREADYTRADING = 30
RETURNVALUE_YOUMAYNOTLOGOUTDURINGAFIGHT = 31
RETURNVALUE_DIRECTPLAYERSHOOT = 32
RETURNVALUE_NOTENOUGHLEVEL = 33
RETURNVALUE_NOTENOUGHMAGICLEVEL = 34
RETURNVALUE_NOTENOUGHMANA = 35
RETURNVALUE_NOTENOUGHSOUL = 36
RETURNVALUE_YOUAREEXHAUSTED = 37
RETURNVALUE_PLAYERISNOTREACHABLE = 38
RETURNVALUE_CANONLYUSETHISRUNEONCREATURES = 39
RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE = 40
RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER = 41
RETURNVALUE_YOUMAYNOTATTACKAPERSONINPROTECTIONZONE = 42
RETURNVALUE_YOUMAYNOTATTACKAPERSONWHILEINPROTECTIONZONE = 43
RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE = 44
RETURNVALUE_YOUCANONLYUSEITONCREATURES = 45
RETURNVALUE_CREATUREISNOTREACHABLE = 46
RETURNVALUE_TURNSECUREMODETOATTACKUNMARKEDPLAYERS = 47
RETURNVALUE_YOUNEEDPREMIUMACCOUNT = 48
RETURNVALUE_YOUNEEDTOLEARNTHISSPELL = 49
RETURNVALUE_YOURVOCATIONCANNOTUSETHISSPELL = 50
RETURNVALUE_YOUNEEDAWEAPONTOUSETHISSPELL = 51
RETURNVALUE_PLAYERISPZLOCKEDLEAVEPVPZONE = 52
RETURNVALUE_PLAYERISPZLOCKEDENTERPVPZONE = 53
RETURNVALUE_ACTIONNOTPERMITTEDINANOPVPZONE = 54
RETURNVALUE_YOUCANNOTLOGOUTHERE = 55
RETURNVALUE_YOUNEEDAMAGICITEMTOCASTSPELL = 56
RETURNVALUE_CANNOTCONJUREITEMHERE = 57
RETURNVALUE_TILEISFULL = 58
RETURNVALUE_NAMEISTOOAMBIGUOUS = 59
RETURNVALUE_CANONLYUSEONESHIELD = 60
RETURNVALUE_YOUARENOTTHEOWNER = 61
RETURNVALUE_YOUMAYNOTCASTAREAONBLACKSKULL = 62
RETURNVALUE_NOTENOUGHSKILL = 63

CONTAINER_POSITION = 0xFFFF
EMPTY_STORAGE = -1
EMPTY_RESULT = -1
ITEMCOUNT_MAX = 100

WAR_GUILD = 0
WAR_ENEMY = 1

AUTOID_PLAYERS = 0x10000000
AUTOID_MONSTERS = 0x40000000
AUTOID_NPCS = 0x80000000

PLAYERFLAG_CANNOTUSECOMBAT = 0
PLAYERFLAG_CANNOTATTACKPLAYER = 1
PLAYERFLAG_CANNOTATTACKMONSTER = 2
PLAYERFLAG_CANNOTBEATTACKED = 3
PLAYERFLAG_CANCONVINCEALL = 4
PLAYERFLAG_CANSUMMONALL = 5
PLAYERFLAG_CANILLUSIONALL = 6
PLAYERFLAG_CANSENSEINVISIBILITY = 7
PLAYERFLAG_IGNOREDBYMONSTERS = 8
PLAYERFLAG_NOTGAININFIGHT = 9
PLAYERFLAG_HASINFINITEMANA = 10
PLAYERFLAG_HASINFINITESOUL = 11
PLAYERFLAG_HASNOEXHAUSTION = 12
PLAYERFLAG_CANNOTUSESPELLS = 13
PLAYERFLAG_CANNOTPICKUPITEM = 14
PLAYERFLAG_CANALWAYSLOGIN = 15
PLAYERFLAG_CANBROADCAST = 16
PLAYERFLAG_CANEDITHOUSES = 17
PLAYERFLAG_CANNOTBEBANNED = 18
PLAYERFLAG_CANNOTBEPUSHED = 19
PLAYERFLAG_HASINFINITECAPACITY = 20
PLAYERFLAG_CANPUSHALLCREATURES = 21
PLAYERFLAG_CANTALKREDPRIVATE = 22
PLAYERFLAG_CANTALKREDCHANNEL = 23
PLAYERFLAG_TALKORANGEHELPCHANNEL = 24
PLAYERFLAG_NOTGAINEXPERIENCE = 25
PLAYERFLAG_NOTGAINMANA = 26
PLAYERFLAG_NOTGAINHEALTH = 27
PLAYERFLAG_NOTGAINSKILL = 28
PLAYERFLAG_SETMAXSPEED = 29
PLAYERFLAG_SPECIALVIP = 30
PLAYERFLAG_NOTGENERATELOOT = 31
PLAYERFLAG_CANTALKREDCHANNELANONYMOUS = 32
PLAYERFLAG_IGNOREPROTECTIONZONE = 33
PLAYERFLAG_IGNORESPELLCHECK = 34
PLAYERFLAG_IGNOREWEAPONCHECK = 35
PLAYERFLAG_CANNOTBEMUTED = 36
PLAYERFLAG_ISALWAYSPREMIUM = 37
PLAYERFLAG_38 = 38 -- ignore
PLAYERFLAG_39 = 39 -- ignore
PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION = 40
PLAYERFLAG_HASINFINITESTAMINA = 41
PLAYERFLAG_CANNOTMOVEITEMS = 42
PLAYERFLAG_CANNOTMOVECREATURES = 43
PLAYERFLAG_CANREPORTBUGS = 44
PLAYERFLAG_45 = 45 -- ignore
PLAYERFLAG_CANNOTBESEEN = 46
PLAYERFLAG_HIDEHEALTH = 47
PLAYERFLAG_CANPASSTHROUGHALLCREATURES = 48

PLAYERCUSTOMFLAG_ALLOWIDLE = 0
PLAYERCUSTOMFLAG_CANSEEPOSITION	= 1
PLAYERCUSTOMFLAG_CANSEEITEMDETAILS = 2
PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS = 3
PLAYERCUSTOMFLAG_NOTSEARCHABLE = 4
PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES = 5
PLAYERCUSTOMFLAG_CANTHROWANYWHERE = 6
PLAYERCUSTOMFLAG_CANPUSHALLITEMS = 7
PLAYERCUSTOMFLAG_CANMOVEANYWHERE = 8
PLAYERCUSTOMFLAG_CANMOVEFROMFAR = 9
PLAYERCUSTOMFLAG_CANUSEFAR = 10
PLAYERCUSTOMFLAG_CANLOGINMULTIPLECHARACTERS = 11
PLAYERCUSTOMFLAG_CANLOGOUTANYTIME = 12
PLAYERCUSTOMFLAG_HIDELEVEL = 13
PLAYERCUSTOMFLAG_ISPROTECTED = 14
PLAYERCUSTOMFLAG_ISIMMUNE = 15
PLAYERCUSTOMFLAG_NOTGAINSKULL = 16
PLAYERCUSTOMFLAG_NOTGAINUNJUSTIFIED = 17
PLAYERCUSTOMFLAG_IGNOREPACIFICATION = 18
PLAYERCUSTOMFLAG_IGNORELOGINDELAY = 19
PLAYERCUSTOMFLAG_CANSTAIRHOP = 20
PLAYERCUSTOMFLAG_CANTURNHOP = 21
PLAYERCUSTOMFLAG_IGNOREHOUSERENT = 22
PLAYERCUSTOMFLAG_CANWEARALLADDONS = 23
PLAYERCUSTOMFLAG_ISWALKABLE = 24
PLAYERCUSTOMFLAG_CANUSEALLMOUNTS = 25
PLAYERCUSTOMFLAG_HASFULLLIGHT = 26

maleOutfits = {128, 129, 130, 131, 132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 328, 335, 367, 430, 432, 463, 465, 472}
femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 329, 336, 366, 431, 433, 464, 466, 471}
mountOutfits = {368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 387, 388, 389, 390, 392, 401, 402, 405, 406, 421, 426, 437, 438, 447, 450}

underWater = {5405, 5406, 5407, 5408, 5409, 5410}

enchantableGems = {2147, 2146, 2149, 2150}
enchantableItems = {2383, 7383, 7384, 7406, 7402, 2429, 2430, 7389, 7380, 2454, 2423, 2445, 7415, 7392, 2391, 2544, 8905}

enchantingAltars = {
	{7504, 7505, 7506, 7507},
	{7508, 7509, 7510, 7511},
	{7516, 7517, 7518, 7519},
	{7512, 7513, 7514, 7515}
}

enchantedGems = {7760, 7759, 7761, 7762}
enchantedItems = {
	[2383] = {7744, 7763, 7854, 7869},
	[7383] = {7745, 7764, 7855, 7870},
	[7384] = {7746, 7765, 7856, 7871},
	[7406] = {7747, 7766, 7857, 7872},
	[7402] = {7748, 7767, 7858, 7873},
	[2429] = {7749, 7768, 7859, 7874},
	[2430] = {7750, 7769, 7860, 7875},
	[7389] = {7751, 7770, 7861, 7876},
	[7380] = {7752, 7771, 7862, 7877},
	[2454] = {7753, 7772, 7863, 7878},
	[2423] = {7754, 7773, 7864, 7879},
	[2445] = {7755, 7774, 7865, 7880},
	[7415] = {7756, 7775, 7866, 7881},
	[7392] = {7757, 7776, 7867, 7882},
	[2391] = {7758, 7777, 7868, 7883},
	[2544] = {7840, 7839, 7850, 7838},
	[8905] = {8906, 8907, 8909, 8908}
}

Config_meta =
{
	__index = function(t, k)
		if(k == "type") then
			return function()
				return "Config"
			end
		end

		return getConfigValue(k)
	end,

	__newindex = function(t, k, v)
		return false
	end
}

CONFIG = {}
setmetatable(CONFIG, Config_meta)

Storage_meta =
{
	__index = function(t, k)
		if(k == "type") then
			return function()
				return "Storage"
			end
		end

		return getStorage(k)
	end,

	__newindex = function(t, k, v)
		return doSetStorage(k, v)
	end
}

STORAGE = {}
setmetatable(STORAGE, Storage_meta)

function onStepOut(cid, item, position, lastPosition)
	if(getTileInfo(position).creatures > 0) then
		return true
	end
 
	local newPosition = {x = position.x + 1, y = position.y, z = position.z}
	local query = doTileQueryAdd(cid, newPosition)
	if(query == RETURNVALUE_NOTENOUGHROOM) then
		newPosition.x = newPosition.x - 1
		newPosition.y = newPosition.y + 1
		query = doTileQueryAdd(cid, newPosition) -- repeat until found
	end
 
	if(query == RETURNVALUE_NOERROR and query == RETURNVALUE_NOTENOUGHROOM) then
		doRelocate(position, newPosition)
	end
 
	position.stackpos = -1
	local i, tileItem, tileCount = 1, {uid = 1}, getTileThingByPos(position)
	while(tileItem.uid ~= 0 and i < tileCount) do
		position.stackpos = i
		tileItem = getTileThingByPos(position)
		if(tileItem.uid ~= 0 and tileItem.uid ~= item.uid and isMovable(tileItem.uid)) then
			doRemoveItem(tileItem.uid)
		else
			i = i + 1
		end
	end
 
	local itemInfo = getItemInfo(item.itemid)
	doTransformItem(item.uid, itemInfo.transformUseTo)
	return true
end

But now when i open or close a door, it shows me other error:

Error:
Code:
[19:17:50.052] [Error - Action Interface]
[19:17:50.053] data/actions/scripts/other/doors.lua:onUse
[19:17:50.054] Description:
[19:17:50.054] data/actions/scripts/other/doors.lua:13: attempt to index global
'DOORS' (a nil value)
[19:17:50.055] stack traceback:
[19:17:50.056]  data/actions/scripts/other/doors.lua:13: in function <data/actio
ns/scripts/other/doors.lua:7>

Thank you for helping me!
 
No no no, you don't add my code in 000_constant.lua.
Just replace closingdoor.lua with my code.
 
Lua:
doors = {[1209] = 1211, [1210] = 1211, [1212] = 1214, [1213] = 1214, [1219] = 1220, [1221] = 1222, [1231] = 1233, [1232] = 1233, [1234] = 1236, [1235] = 1236, [1237] = 1238, [1239] = 1240, [1249] = 1251, [1250] = 1251, [1252] = 1254, [1253] = 1254, [1539] = 1540, [1541] = 1542, [3535] = 3537, [3536] = 3537, [3538] = 3539, [3544] = 3546, [3545] = 3546, [3547] = 3548, [4913] = 4915, [4914] = 4915, [4916] = 4918, [4917] = 4918, [5082] = 5083, [5084] = 5085, [5098] = 5100, [5099] = 5100, [5101] = 5102, [5107] = 5109, [5108] = 5109, [5110] = 5111, [5116] = 5118, [5117] = 5118, [5119] = 5120, [5125] = 5127, [5126] = 5127, [5128] = 5129, [5134] = 5136, [5135] = 5136, [5137] = 5139, [5138] = 5139, [5140] = 5142, [5141] = 5142, [5143] = 5145, [5144] = 5145, [5278] = 5280, [5279] = 5280, [5281] = 5283, [5282] = 5283, [5284] = 5285, [5286] = 5287, [5515] = 5516, [5517] = 5518, [5732] = 5734, [5733] = 5734, [5735] = 5737, [5736] = 5737, [6192] = 6194, [6193] = 6194, [6195] = 6197, [6196] = 6197, [6198] = 6199, [6200] = 6201, [6249] = 6251, [6250] = 6251, [6252] = 6254, [6253] = 6254, [6255] = 6256, [6257] = 6258, [6795] = 6796, [6797] = 6798, [6799] = 6800, [6801] = 6802, [6891] = 6893, [6892] = 6893, [6894] = 6895, [6900] = 6902, [6901] = 6902, [6903] = 6904, [7033] = 7035, [7034] = 7035, [7036] = 7037, [7042] = 7044, [7043] = 7044, [7045] = 7046, [7054] = 7055, [7056] = 7057, [8541] = 8543, [8542] = 8543, [8544] = 8546, [8545] = 8546, [8547] = 8548, [8549] = 8550, [9165] = 9167, [9166] = 9167, [9168] = 9170, [9169] = 9170, [9171] = 9172, [9173] = 9174, [9267] = 9269, [9268] = 9269, [9270] = 9272, [9271] = 9272, [9273] = 9274, [9275] = 9276, [10276] = 10277, [10274] = 10275, [10268] = 10270, [10269] = 10270, [10271] = 10273, [10272] = 10273, [10471] = 10472, [10480] = 10481, [10477] = 10479, [10478] = 10479, [10468] = 10470, [10469] = 10470, [10774] = 10776, [10775] = 10776, [10779] = 10780, [10781] = 10782, [10783] = 10785, [10784] = 10785, [10788] = 10789, [10790] = 10791}
closingDoors = {1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133, 5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558, 9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284, 10279, 10281, 10283, 10285, 10474, 10476, 10483, 10485, 10780, 10782, 10789, 10791}
verticalOpenDoors = {1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131, 5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044, 7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274, 9278, 9282, 10270, 10275, 10279, 10283, 10479, 10481, 10483, 10485, 10789, 10791}
horizontalOpenDoors = {1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118, 5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893, 6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276, 9280, 9284, 10273, 10277, 10281, 10285, 10470, 10472, 10474, 10476, 10780, 10782}
specialDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049, 8551, 8553, 9175, 9177, 9277, 9279, 10278, 10280, 10475, 10484, 10781, 10790}
keys = {2086, 2087, 2088, 2089, 2090, 2091, 2092, 10032, 10091}
 
i don't have any script closing door.lua :S
i post my actions maybe u can found
Code:
<?xml version="1.0"?>

<actions>

<!-- Change of Vocations -->

<action itemid="2329" script="vocations/mages.lua"/>
<action itemid="9663" script="vocations/elite-to-elder.lua"/>
<action itemid="7529" script="vocations/elite-to-royal.lua"/>
<action itemid="9664" script="vocations/elite-to-master.lua"/>
<action itemid="9665" script="vocations/royal-to-elder.lua"/>
<action itemid="9666" script="vocations/royal-to-master.lua"/>
<action itemid="7530" script="vocations/royal-to-elite.lua"/>
<action itemid="7531" script="vocations/elder-to-elite.lua"/>
<action itemid="7532" script="vocations/elder-to-royal.lua"/>
<action itemid="7533" script="vocations/master-to-elite.lua"/>
<action itemid="7534" script="vocations/master-to-royal.lua"/>
<action itemid="7722" event="script" value="expscroll.lua"/>
<action actionid="3133" event="script" value="woe.lua"/>
<action itemid="5952" event="script" value="expscroll1.lua"/>
<action actionid="2299" script="chestdiners.lua" />
<action actionid="5788" script="other/vipdoor.lua" />
<action itemid="5785" script="other/vip.lua" />
<action actionid="11304" script="zaoanlegs.lua" />
<action actionid="8903" script="spellbooksouls.lua" />

<action itemid="8293" event="script"  value="demonOak.lua"/>
<action fromuid="12901" touid ="12904" event="script" value="demonOakChests.lua"/>
<action uniqueid="55100" event="script" value="demonOakGravestone.lua" /> 
<action itemid="2345" script="stamina-refuel.lua"/>
<!-- Outfit Quests -->
<action uniqueid="12001" event="script" value="outfits.lua"/>  -- Hunter 
<action uniqueid="12002" event="script" value="outfits.lua"/>  -- Mage  
<action uniqueid="12003" event="script" value="outfits.lua"/>  -- Knight 
<action uniqueid="12005" event="script" value="outfits.lua"/>  -- Summoner 
<action uniqueid="12006" event="script" value="outfits.lua"/>  -- Warrior 
<action uniqueid="12007" event="script" value="outfits.lua"/>  -- Barbarian 
<action uniqueid="12008" event="script" value="outfits.lua"/>  -- Druid 
<action uniqueid="12009" event="script" value="outfits.lua"/>  -- Wizard  
<action uniqueid="12010" event="script" value="outfits.lua"/>  -- Oriental 
<action uniqueid="12011" event="script" value="outfits.lua"/>  -- Pirate 
<action uniqueid="12012" event="script" value="outfits.lua"/>  -- Assassin 
<action uniqueid="12013" event="script" value="outfits.lua"/>  -- Beggar 
<action uniqueid="12014" event="script" value="outfits.lua"/>  -- Shaman 
<action uniqueid="12015" event="script" value="outfits.lua"/>  -- Norseman 
<action uniqueid="12016" event="script" value="outfits.lua"/>  -- Knightmare 
<action uniqueid="12017" event="script" value="outfits.lua"/>  -- Jester 
<action uniqueid="12018" event="script" value="outfits.lua"/>  -- Brotherhood 
<action uniqueid="12020" event="script" value="outfits.lua"/>  -- Yalahari 


<!-- Other -->

<action uniqueid="9009" script="soft.lua"/>
<action itemid="4869" script="botanist.lua"/>

<action actionid="20006" script="private_rooms.lua" />
<action actionid="20007" script="private_rooms.lua" />
<action actionid="20008" script="private_rooms.lua" />
<action actionid="20009" script="private_rooms.lua" />
<action actionid="20010" script="private_rooms.lua" />
<action actionid="20011" script="private_rooms.lua" />
<action actionid="20012" script="private_rooms.lua" />
<action actionid="20013" script="private_rooms.lua" />
<action actionid="20014" script="private_rooms.lua" />
<action actionid="20015" script="private_rooms.lua" />
<action actionid="20016" script="private_rooms.lua" />
<action actionid="20017" script="private_rooms.lua" />
<action actionid="20018" script="private_rooms.lua" />
<action actionid="20019" script="private_rooms.lua" />
<action actionid="20020" script="private_rooms.lua" />
<action actionid="20021" script="private_rooms.lua" />
<action actionid="20022" script="private_rooms.lua" />
<action actionid="20023" script="private_rooms.lua" />

<action uniqueid="2335" script="hota/hota_pieces.lua" />
<action uniqueid="2336" script="hota/hota_pieces.lua" />
<action uniqueid="2337" script="hota/hota_pieces.lua" />
<action uniqueid="2338" script="hota/hota_pieces.lua" />
<action uniqueid="2339" script="hota/hota_pieces.lua" />
<action uniqueid="2340" script="hota/hota_pieces.lua" />
<action uniqueid="2341" script="hota/hota_pieces.lua" />
<action uniqueid="2363" script="hota/hota_pieces.lua" />

<action itemid="7731" script="tools/grope.lua" />
<action uniqueid="2748" script="quest/golden rope.lua" />
<action uniqueid="2374" script="quest/dshield.lua" />


<!-- Inkisitor -->
<action actionid="30000" script="inkisitorquest.lua" />
<action uniqueid="9876" script="inkisitor.lua" />
<action uniqueid="9875" script="inkisitor.lua" />
<action uniqueid="9874" script="inkisitor.lua" />
<action uniqueid="9873" script="inkisitor.lua" />
<action uniqueid="9872" script="inkisitor.lua" />
<action uniqueid="9871" script="inkisitor.lua" />

<!-- Vip zone -->
<action uniqueid="1511" script="Behemoth.lua" />
<action uniqueid="1510" script="Black Knight.lua" />
<action uniqueid="1499" script="Bog raider.lua" />
<action uniqueid="1506" script="Demon.lua" />
<action uniqueid="1496" script="Dragon Lord.lua" />
<action uniqueid="1495" script="dragon.lua" />
<action uniqueid="1502" script="Earth Elemental.lua" />
<action uniqueid="1514" script="Frost Dragon Hatchling.lua" />
<action uniqueid="1501" script="Frost dragon.lua" />
<action uniqueid="1509" script="Giant Spider.lua" />
<action uniqueid="1508" script="Grim Reaper.lua" />
<action uniqueid="1503" script="Hero.lua" />
<action uniqueid="1512" script="Hydra.lua" />
<action uniqueid="1513" script="Ice Witch.lua" />
<action uniqueid="1504" script="Nightmare.lua" />
<action uniqueid="1500" script="Sea Serpent.lua" />
<action uniqueid="1507" script="Serpent Spawn.lua" />
<action uniqueid="1498" script="Vampire.lua" />
<action uniqueid="1505" script="Warlock.lua" />
<action uniqueid="1497" script="Wyrm.lua" />

	<!-- Enchanted weapons -->

	<action itemid="2146" script="enchanted.lua" />
	<action itemid="2147" script="enchanted.lua" />
	<action itemid="2150" script="enchanted.lua" />
	<action itemid="2149" script="enchanted.lua" />
	<action itemid="7759" script="enchanted.lua" />
	<action itemid="7760" script="enchanted.lua" />
	<action itemid="7761" script="enchanted.lua" />
	<action itemid="7762" script="enchanted.lua" />




-- Tools
<action itemid="2580" script="fishing_rod.lua" allowfaruse="1" />
<action itemid="2120" script="rope.lua"	 />
<action itemid="2554" script="shovel.lua"  />
<action itemid="2420" script="machete.lua"/>
<action itemid="2442" script="machete.lua"/>
<action itemid="2550" script="scythe.lua"  />


-- Tibia Update
<action itemid="2114" script="piggybank.lua" />
<action itemid="6578" script="partyitems.lua" />
<action itemid="5792" script="dice.lua" />
<action itemid="5793" script="dice.lua" />
<action itemid="5794" script="dice.lua" />
<action itemid="5795" script="dice.lua" />
<action itemid="5796" script="dice.lua" />
<action itemid="5797" script="dice.lua" />
<action itemid="6576" script="fireworks.lua" />
<action itemid="4852" script="rage trinket.lua"/>
<action itemid="2175" script="spellbook.lua" /> --spell book for vocation - no working - wait for update on SVN

-- Others
<action itemid="2785" script="blueberry_bush.lua"   />

-- Doors
	<action fromid="1209" toid="1214" script="other/doors.lua"/>
	<action fromid="1219" toid="1222" script="other/doors.lua"/>
	<action fromid="1223" toid="1262" script="other/doors.lua"/>
	<action fromid="1539" toid="1542" script="other/doors.lua"/>
	<action fromid="2086" toid="2092" script="other/doors.lua"/>
	<action fromid="3535" toid="3552" script="other/doors.lua"/>
	<action fromid="4913" toid="4918" script="other/doors.lua"/>
	<action fromid="5082" toid="5085" script="other/doors.lua"/>
	<action fromid="5098" toid="5145" script="other/doors.lua"/>
	<action fromid="5278" toid="5295" script="other/doors.lua"/>
	<action fromid="5515" toid="5518" script="other/doors.lua"/>
	<action fromid="5732" toid="5737" script="other/doors.lua"/>
	<action fromid="5745" toid="5749" script="other/doors.lua"/>
	<action fromid="6192" toid="6209" script="other/doors.lua"/>
	<action fromid="6249" toid="6266" script="other/doors.lua"/>
	<action fromid="6795" toid="6802" script="other/doors.lua"/>
	<action fromid="6891" toid="6908" script="other/doors.lua"/>
	<action fromid="7033" toid="7050" script="other/doors.lua"/>
	<action fromid="7054" toid="7057" script="other/doors.lua"/>

-- Construction Kits
<action itemid="3901" script="construction_kits.lua" />
<action itemid="3902" script="construction_kits.lua" />
<action itemid="3903" script="construction_kits.lua" />
<action itemid="3904" script="construction_kits.lua" />
<action itemid="3905" script="construction_kits.lua" />
<action itemid="3906" script="construction_kits.lua" />
<action itemid="3907" script="construction_kits.lua" />
<action itemid="3908" script="construction_kits.lua" />
<action itemid="3909" script="construction_kits.lua" />
<action itemid="3910" script="construction_kits.lua" />
<action itemid="3911" script="construction_kits.lua" />
<action itemid="3912" script="construction_kits.lua" />
<action itemid="3913" script="construction_kits.lua" />
<action itemid="3914" script="construction_kits.lua" />
<action itemid="3915" script="construction_kits.lua" />
<action itemid="3916" script="construction_kits.lua" />
<action itemid="3917" script="construction_kits.lua" />
<action itemid="3918" script="construction_kits.lua" />
<action itemid="3919" script="construction_kits.lua" />
<action itemid="3920" script="construction_kits.lua" />
<action itemid="3921" script="construction_kits.lua" />
<action itemid="3922" script="construction_kits.lua" />
<action itemid="3923" script="construction_kits.lua" />
<action itemid="3924" script="construction_kits.lua" />
<action itemid="3925" script="construction_kits.lua" />
<action itemid="3926" script="construction_kits.lua" />
<action itemid="3927" script="construction_kits.lua" />
<action itemid="3928" script="construction_kits.lua" />
<action itemid="3929" script="construction_kits.lua" />
<action itemid="3930" script="construction_kits.lua" />
<action itemid="3931" script="construction_kits.lua" />
<action itemid="3932" script="construction_kits.lua" />
<action itemid="3933" script="construction_kits.lua" />
<action itemid="3934" script="construction_kits.lua" />
<action itemid="3935" script="construction_kits.lua" />
<action itemid="3936" script="construction_kits.lua" />
<action itemid="3937" script="construction_kits.lua" />
<action itemid="3938" script="construction_kits.lua" />


-- Teleports
<action itemid="430" script="teleport.lua"  />
<action itemid="1386" script="teleport.lua" />
<action itemid="3678" script="teleport.lua" />
<action itemid="3135" script="teleport.lua" />

-- Foods
<action itemid="2328" script="food.lua" />
<action itemid="2362" script="food.lua" />
<action itemid="2363" script="food.lua" />
<action itemid="2666" script="food.lua" />
<action itemid="2667" script="food.lua" />
<action itemid="2668" script="food.lua" />
<action itemid="2669" script="food.lua" />
<action itemid="2670" script="food.lua" />
<action itemid="2671" script="food.lua" />
<action itemid="2672" script="food.lua" />
<action itemid="2673" script="food.lua" />
<action itemid="2674" script="food.lua" />
<action itemid="2675" script="food.lua" />
<action itemid="2676" script="food.lua" />
<action itemid="2677" script="food.lua" />
<action itemid="2678" script="food.lua" />
<action itemid="2679" script="food.lua" />
<action itemid="2680" script="food.lua" />
<action itemid="2681" script="food.lua" />
<action itemid="2682" script="food.lua" />
<action itemid="2683" script="food.lua" />
<action itemid="2684" script="food.lua" />
<action itemid="2685" script="food.lua" />
<action itemid="2686" script="food.lua" />
<action itemid="2687" script="food.lua" />
<action itemid="2688" script="food.lua" />
<action itemid="2689" script="food.lua" />
<action itemid="2690" script="food.lua" />
<action itemid="2691" script="food.lua" />
<action itemid="2695" script="food.lua" />
<action itemid="2696" script="food.lua" />
<action itemid="2787" script="food.lua" />
<action itemid="2788" script="food.lua" />
<action itemid="2789" script="food.lua" />
<action itemid="2790" script="food.lua" />
<action itemid="2791" script="food.lua" />
<action itemid="2792" script="food.lua" />
<action itemid="2793" script="food.lua" />
<action itemid="2794" script="food.lua" />
<action itemid="2795" script="food.lua" />
<action itemid="2796" script="food.lua" />

-- Fluids
<action itemid="1775" script="fluids.lua" />
<action itemid="2562" script="fluids.lua" />
<action itemid="2006" script="fluids.lua" />
<action itemid="2034" script="fluids.lua" />
<action itemid="2574" script="fluids.lua" />
<action itemid="2575" script="fluids.lua" />
<action itemid="2576" script="fluids.lua" />
<action itemid="2577" script="fluids.lua" />
<action itemid="2005" script="fluids.lua" />
<action itemid="2007" script="fluids.lua" />
<action itemid="2008" script="fluids.lua" />
<action itemid="2009" script="fluids.lua" />
<action itemid="2011" script="fluids.lua" />
<action itemid="2012" script="fluids.lua" />
<action itemid="2013" script="fluids.lua" />
<action itemid="2014" script="fluids.lua" />
<action itemid="2015" script="fluids.lua" />
<action itemid="2023" script="fluids.lua" />
<action itemid="2031" script="fluids.lua" />
<action itemid="2032" script="fluids.lua" />
<action itemid="2033" script="fluids.lua" />
<action itemid="3941" script="fluids.lua" />
<action itemid="3942" script="fluids.lua" />

-- Decayto Items
<action itemid="2047" script="decayto.lua" />
<action itemid="2048" script="decayto.lua" />
<action itemid="2044" script="decayto.lua" />
<action itemid="2045" script="decayto.lua" />
<action itemid="2057" script="decayto.lua" />
<action itemid="2042" script="decayto.lua" />
<action itemid="2041" script="decayto.lua" />
<action itemid="2050" script="decayto.lua" />
<action itemid="2051" script="decayto.lua" />
<action itemid="2052" script="decayto.lua" />
<action itemid="2053" script="decayto.lua" />
<action itemid="2054" script="decayto.lua" />
<action itemid="2055" script="decayto.lua" />

-- Watch and Clocks
<action itemid="1728" script="watch_clock.lua" />
<action itemid="1729" script="watch_clock.lua" />
<action itemid="1730" script="watch_clock.lua" />
<action itemid="1731" script="watch_clock.lua" />
<action itemid="1732" script="watch_clock.lua" />
<action itemid="1733" script="watch_clock.lua" />
<action itemid="1734" script="watch_clock.lua" />
<action itemid="1735" script="watch_clock.lua" />
<action itemid="1873" script="watch_clock.lua" />
<action itemid="1874" script="watch_clock.lua" />
<action itemid="1875" script="watch_clock.lua" />
<action itemid="1876" script="watch_clock.lua" />
<action itemid="1877" script="watch_clock.lua" />
<action itemid="1881" script="watch_clock.lua" />
<action itemid="2036" script="watch_clock.lua" />

-- Make Bread
<action itemid="2694" script="bread2.lua" />
<action itemid="2692" script="bread3.lua" />
<action itemid="2693" script="bread4.lua" />

-- Music
<action itemid="2070" script="music.lua" />
<action itemid="2372" script="music.lua" />
<action itemid="2332" script="music.lua" />
<action itemid="2367" script="music.lua" />
<action itemid="2368" script="music.lua" />
<action itemid="2076" script="music.lua" />
<action itemid="2079" script="music.lua" />
<action itemid="2369" script="music.lua" />
<action itemid="2370" script="music.lua" />
<action itemid="2080" script="music.lua" />
<action itemid="2081" script="music.lua" />
<action itemid="2082" script="music.lua" />
<action itemid="2083" script="music.lua" />
<action itemid="2084" script="music.lua" />
<action itemid="2085" script="music.lua" />
<action itemid="2077" script="music.lua" />
<action itemid="2364" script="music.lua" />
<action itemid="2371" script="music.lua" />
<action itemid="2078" script="music.lua" />
<action itemid="2075" script="music.lua" />
<action itemid="2074" script="music.lua" />
<action itemid="2373" script="music.lua" />
<action itemid="2072" script="music.lua" />
<action itemid="2073" script="music.lua" />
<action itemid="2071" script="music.lua" />
<action itemid="2374" script="music.lua" />
<action itemid="3951" script="music.lua" />
<action itemid="3952" script="music.lua" />
<action itemid="3953" script="music.lua" />

-- Objects
<action itemid="1479" script="trans_inc.lua" />
<action itemid="1480" script="trans_dec.lua" />

<action itemid="1945" script="trans_inc.lua" /> 
<action itemid="1946" script="trans_dec.lua" /> 

<action itemid="2037" script="trans_inc.lua" />
<action itemid="2038" script="trans_dec.lua" />

<action itemid="2039" script="trans_inc.lua" />
<action itemid="2040" script="trans_dec.lua" />

<action itemid="2058" script="trans_inc.lua" />
<action itemid="2059" script="trans_dec.lua" />

<action itemid="2060" script="trans_inc.lua" />
<action itemid="2061" script="trans_dec.lua" />

<action itemid="2066" script="trans_inc.lua" />
<action itemid="2067" script="trans_dec.lua" />

<action itemid="2068" script="trans_inc.lua" />
<action itemid="2069" script="trans_dec.lua" />

<action itemid="2578" script="trans_inc.lua" />
<action itemid="2579" script="trans_dec.lua" />

<action itemid="2064" script="trans_inc.lua" />
<action itemid="2065" script="trans_dec.lua" />


<action itemid="2096" script="trans_inc.lua" />
<action itemid="2097" script="trans_dec.lua" />

<action itemid="1786" script="trans_inc.lua" />
<action itemid="1787" script="trans_dec.lua" />

<action itemid="1788" script="trans_inc.lua" />
<action itemid="1789" script="trans_dec.lua" />

<action itemid="1790" script="trans_inc.lua" />
<action itemid="1791" script="trans_dec.lua" />

<action itemid="1792" script="trans_inc.lua" />
<action itemid="1793" script="trans_dec.lua" />

<action itemid="2162" script="trans_inc.lua" />
<action itemid="2163" script="trans_dec.lua" />

<action itemid="1634" script="trans_inc.lua" />
<action itemid="1635" script="trans_dec.lua" />

<action itemid="1636" script="trans_inc.lua" />
<action itemid="1637" script="trans_dec.lua" />

<action itemid="1638" script="trans_inc.lua" />
<action itemid="1639" script="trans_dec.lua" />

<action itemid="1640" script="trans_inc.lua" />
<action itemid="1641" script="trans_dec.lua" />

<action itemid="3697" script="trans_inc.lua" />
<action itemid="3698" script="trans_dec.lua" />

<action itemid="3699" script="trans_inc.lua" />
<action itemid="3700" script="trans_dec.lua" />

<action itemid="3709" script="trans_inc.lua" />
<action itemid="3710" script="trans_dec.lua" />

<action itemid="3743" script="trans_inc.lua" />
<action itemid="3744" script="trans_dec.lua" />

<action itemid="3943" script="trans_inc.lua" />
<action itemid="3944" script="trans_dec.lua" />

<action itemid="3945" script="trans_inc.lua" />
<action itemid="3946" script="trans_dec.lua" />

<action itemid="3947" script="trans_inc.lua" />
<action itemid="3948" script="trans_dec.lua" />

<action itemid="3949" script="trans_inc.lua" />
<action itemid="3950" script="trans_dec.lua" />


-- new 7.8
<action itemid="5097" script="food.lua" />

<action itemid="5543" script="teleport.lua" />


<action itemid="5812" script="trans_inc.lua" />
<action itemid="5813" script="trans_dec.lua" />


<action itemid="6123" script="music.lua" />

<action itemid="5710" script="shovel.lua"  />
<action itemid="5468" script="fire_bug.lua" />

<action itemid="5467" script="distilling.lua" />

-- Transform money
<action itemid="2148" script="gold.lua" />
<action itemid="2152" script="platinum.lua" />
<action itemid="2160" script="crystal.lua" />

-- Levers
<action uniqueid="7002" script="walllever.lua" />
<action uniqueid="7003" script="walllever2.lua" />

-- more
<!-- other quests -->
<action uniqueid="5006" script="annichest.lua" />
<action uniqueid="5007" script="annichest.lua" />
<action uniqueid="5008" script="annichest.lua" />
<action uniqueid="5009" script="annichest.lua" />
<action uniqueid="5021" script="poichest.lua" />
<action uniqueid="5022" script="poichest.lua" />
<action uniqueid="5023" script="poichest.lua" />
<action uniqueid="5024" script="poichest.lua" />
<action uniqueid="7004" script="banuta.lua" />
<action uniqueid="7006" script="banuta3.lua" />
<action uniqueid="7000" script="annilever2.lua" />
<action uniqueid="7009" script="banshee.lua" />
<action uniqueid="7010" script="banshee1.lua" />
<action uniqueid="7005" script="banuta2.lua" />
<action uniqueid="7777" script="temple.lua" />
<action uniqueid="9999" script="temple1.lua" />
<action uniqueid="8888" script="temple3.lua" />
<action uniqueid="1337" script="ancienthelmet.lua" />
<action uniqueid="6666" script="full.lua" />
<action uniqueid="4006" script="scarab.lua" />
<action uniqueid="8989" script="voc_quest.lua" />
<action uniqueid="8181" script="ring.lua" />
<action uniqueid="1818" script="100p.lua" />
<action itemid="5757" script="tortu.lua" />

<action uniqueid="2270" script="secreta1.lua" />
<action uniqueid="2271" script="secreta2.lua" />
<action uniqueid="2711" script="puente.lua" />
<action uniqueid="2712" script="puente1.lua" />
<action uniqueid="2713" script="puente2.lua" />
<action uniqueid="2714" script="piedra.lua" />
<action uniqueid="8999" script="darashia.lua" />
<action uniqueid="8981" script="undercity.lua" />
<action uniqueid="12347" script="talescity.lua" />
<action uniqueid="6777" script="liberty city.lua" />
<action uniqueid="7999" script="enigma city.lua" />
<action uniqueid="12345" script="svargrond.lua" />
<action uniqueid="12346" script="ankrah.lua" />
<action uniqueid="8777" script="piedrademon.lua" />
<action uniqueid="7171" script="pit1.lua" />
<action uniqueid="7272" script="pit2.lua" />
<action uniqueid="7373" script="pit3.lua" />
<action uniqueid="1589" script="addons.lua" />
<action uniqueid="1895" script="paradox.lua" />
<action uniqueid="1896" script="paradox1.lua" />
<action uniqueid="1897" script="paradox2.lua" />
<action uniqueid="1898" script="paradox3.lua" />
<action uniqueid="1900" script="paradox4.lua" />
<action uniqueid="5159" script="para1.lua" />
<action uniqueid="5158" script="para1.lua" />
<action uniqueid="5157" script="para2.lua" />
<action uniqueid="5156" script="para2.lua" />
<action actionid="3500" script="runest.lua" />
<action itemid="4470" script="runest.lua" />
<action itemid="362" script="runest.lua" />
<action itemid="360" script="runest.lua" />
<action itemid="2734" script="runest.lua" />
<action actionid="3600" script="runest.lua" />
<action actionid="3700" script="runest.lua" />
<action actionid="3800" script="runest.lua" />
<action actionid="3900" script="runest.lua" />
<action actionid="4000" script="runest.lua" />
<action actionid="4500" script="arrowst.lua" />
<action actionid="4600" script="arrowst.lua" />
<action actionid="4700" script="arrowst.lua" />
<action actionid="4800" script="arrowst.lua" />
<action actionid="4900" script="arrowst.lua" />
<action actionid="5000" script="arrowst.lua" />
<action actionid="5100" script="arrowst.lua" />
<action actionid="2671" script="comida.lua" />
<action actionid="2666" script="comida.lua" />

<!-- training room-doors, beginning -->
<action actionid="4211" script="trainroom.lua" />
<action actionid="4212" script="trainroom.lua" />
<action actionid="4213" script="trainroom.lua" />
<action actionid="4214" script="trainroom.lua" />
<!-- training room-doors, end -->


--items djin

<action actionid="3501" script="boh.lua" />
<action actionid="3502" script="rh.lua" />
<action actionid="3503" script="dshield.lua" />
<action actionid="3504" script="ka.lua" />
<action actionid="3505" script="kl.lua" />
<action actionid="3506" script="fires.lua" />
<action actionid="3507" script="serpent.lua" />
<action actionid="3508" script="giant.lua" />
<action actionid="3509" script="warrior.lua" />
<action actionid="3510" script="war.lua" />
<action actionid="3511" script="dragonha.lua" />
<action actionid="3512" script="skull.lua" />
<action actionid="3513" script="fireaxe.lua" />
<action actionid="3514" script="tower.lua" />
<action actionid="3515" script="goldenarmor.lua" />
<action actionid="3516" script="knightaxe.lua" />
<action actionid="3517" script="crownlegs.lua" />
<action actionid="3518" script="crownarmor.lua" />
<action actionid="3519" script="demonshield.lua" />
<action actionid="3520" script="icerapier.lua" />
<action actionid="3521" script="vampireshield.lua" />
<action actionid="3522" script="spike.lua" />
<action actionid="3523" script="devilhelmet.lua" />
<action actionid="3524" script="medusa.lua" />
<action actionid="3525" script="steelboot.lua" />
<action actionid="3526" script="crownhel.lua" />
<action actionid="3527" script="dsm.lua" />
<action actionid="3528" script="crownshield.lua" />
<action actionid="3529" script="shiel.lua" />
<action actionid="3566" script="dragonlance.lua" />

--items tienda

<action actionid="3530" script="mace.lua" />
<action actionid="3531" script="sword.lua" />
<action actionid="3532" script="katana.lua" />
<action actionid="3533" script="2axe.lua" />
<action actionid="3534" script="baxe.lua" />
<action actionid="3535" script="bhammer.lua" />
<action actionid="3536" script="2hand.lua" />
<action actionid="3537" script="broad.lua" />
<action actionid="3538" script="mace1.lua" />
<action actionid="3539" script="steelhel.lua" />
<action actionid="3540" script="ironhel.lua" />
<action actionid="3541" script="brasshel.lua" />
<action actionid="3542" script="platearm.lua" />
<action actionid="3543" script="chainarm.lua" />
<action actionid="3544" script="brassarm.lua" />
<action actionid="3545" script="viking.lua" />
<action actionid="3546" script="brasslegs.lua" />
<action actionid="3547" script="legionhel.lua" />
<action actionid="3548" script="dwarv.lua" />
<action actionid="3549" script="plateleg.lua" />
<action actionid="3550" script="chainleg.lua" />
<action actionid="3551" script="steelshield.lua" />
<action actionid="3552" script="plateshield.lua" />
<action actionid="3553" script="batleshiel.lua" />
<action actionid="3554" script="soldierhel.lua" />
<action actionid="3555" script="scalearm.lua" />
<action actionid="3556" script="darkhel.lua" />

--more seller

<action actionid="3557" script="rope1.lua" />
<action actionid="3558" script="rope1.lua" />
<action actionid="3559" script="rope1.lua" />
<action actionid="3560" script="rope1.lua" />
<action actionid="3561" script="rope1.lua" />
<action actionid="3562" script="rope1.lua" />
<action actionid="3563" script="rope1.lua" />
<action actionid="3564" script="rope1.lua" />
<action actionid="3565" script="rope1.lua" />
<action uniqueid="8382" script="djinperlas.lua" />
<action actionid="3570" script="parcels.lua" />
<action actionid="3571" script="parcels.lua" />
<action actionid="3572" script="parcels.lua" />
<action actionid="3573" script="parcels.lua" />
<action actionid="7759" script="perlas.lua" />
<action actionid="7761" script="perlas.lua" />
<action actionid="7762" script="perlas.lua" />
<action actionid="7760" script="perlas.lua" />
<action actionid="123" script="pharaosword.lua" />
<action actionid="6132" script="softboots.lua" />
<action actionid="5791" script="stuffdragon.lua" />
<action actionid="652" script="dlance.lua" />
<action actionid="3574" script="backpackroja.lua" />
<action actionid="1845" script="bless.lua" />
<action actionid="9821" script="aol.lua" />
<action uniqueid="6363" script="trainexit.lua" />
<action uniqueid="6262" script="trainexit1.lua" />
<action uniqueid="6161" script="train1.lua" />
<action uniqueid="6060" script="train2.lua" />
<action actionid="3585" script="bp3.lua" />
<action actionid="3586" script="mpa.lua" />
<action actionid="3587" script="glegs.lua" />
<action actionid="3588" script="mms.lua" />
<action actionid="3589" script="bluerobe.lua" />
<action actionid="3590" script="crusader.lua" />
<action actionid="3591" script="strange.lua" />
<action uniqueid="6138" script="soft boots.lua" />
<action actionid="3592" script="woi.lua" />
<action actionid="3593" script="tempest.lua" />
<action actionid="3594" script="quamire.lua" />
<action actionid="3595" script="cosmic.lua" />
<action actionid="3596" script="uno.lua" />
<action actionid="3597" script="dos.lua" />
<action actionid="3598" script="tres.lua" />
<action actionid="3599" script="cuatro.lua" />
<action actionid="3891" script="cinco.lua" />
<action actionid="3601" script="seis.lua" />
<action actionid="3602" script="siete.lua" />
<action actionid="2381" script="halberd.lua" />
<action actionid="3603" script="ocho.lua" />
<action actionid="3604" script="nueve.lua" />
<action actionid="3605" script="dies.lua" />
<action actionid="2800" script="runes20sell.lua" />
<action actionid="2801" script="runes20sell.lua" />
<action actionid="2802" script="runes20sell.lua" />
<action actionid="2803" script="runes20sell.lua" />
<action actionid="2804" script="runes20sell.lua" />
<action actionid="2805" script="runes20sell.lua" />
<action actionid="2806" script="runes20sell.lua" />
<action actionid="7791" script="runes20sell.lua" />
<action actionid="7590" script="runes20sell.lua" />
<action actionid="7588" script="runes20sell.lua" />
<action actionid="7589" script="runes20sell.lua" />
<action actionid="7618" script="runes20sell.lua" />
<action actionid="7620" script="runes20sell.lua" />
<action actionid="8472" script="runes20sell.lua" />
<action actionid="8473" script="runes20sell.lua" />


--Sell Ice
<action actionid="7462" script="ice1.lua" />
<action actionid="7461" script="ice2.lua" />
<action actionid="7459" script="ice3.lua" />
<action actionid="7457" script="ice4.lua" />
<action actionid="7449" script="ice5.lua" />
<action actionid="7437" script="ice6.lua" />
<action actionid="7432" script="ice7.lua" />
<action actionid="7408" script="ice8.lua" />
<action actionid="7402" script="ice9.lua" />
<action actionid="7379" script="ice10.lua" />
<action actionid="1990" script="ice11.lua" />
<action actionid="2177" script="ice12.lua" />
<action actionid="2652" script="ice13.lua" />

--more adds

<action itemid="2553" script="pick.lua" />
<action itemid="5908" script="obsidian knife.lua"/>
<action itemid="5942" script="blessed wooden stake.lua"/>

<!-- Arena Svargrond -->
<action actionid="42366" event="script" value="quests/arenadoors.lua"/>
<action actionid="42376" event="script" value="quests/arenadoors.lua"/>
<action actionid="42386" event="script" value="quests/arenadoors.lua"/>
<action actionid="42357" event="script" value="quests/arenadoors.lua"/>
<action fromaid="42361" toaid="42365" event="script" value="quests/arenareward.lua"/>
<action fromaid="42371" toaid="42375" event="script" value="quests/arenareward.lua"/>
<action fromaid="42381" toaid="42385" event="script" value="quests/arenareward.lua"/>  



<action actionid="7369" script="copa.lua" />
<action actionid="7390" script="presword.lua" />
<action actionid="7434" script="preaxe.lua" />
<action uniqueid="44441" script="softrecar.lua" />
<action actionid="7429" script="preclub.lua" />
<action actionid="8605" script="voc.lua" />
<action actionid="8606" script="voc.lua" />
<action actionid="8607" script="voc.lua" />
<action actionid="8608" script="voc.lua" />
<action uniqueid="30104" script="questdoor.lua" />
<action uniqueid="30105" script="greendoor.lua" />
<action itemid="2322" script="christmas card.lua" />
<action actionid="7378" script="spears.lua" />
<action actionid="7366" script="spears.lua" />
<action actionid="7368" script="spears.lua" />


-- Mapa del tesoro
<action itemid="5091" script="slimeliberty.lua" />


--Example all outfit quest--you need use my actions/lib/actions.lua
<action actionid="9101" script="outfitquest.lua" /> -- outfit quest
<action actionid="9102" script="outfitquest.lua" /> -- outfit quest  
<action actionid="9103" script="outfitquest.lua" /> -- outfit quest 
<action actionid="9104" script="outfitquest.lua" /> -- outfit quest 
<action actionid="9105" script="outfitquest.lua" /> -- outfit quest 
<action actionid="9106" script="outfitquest.lua" /> -- outfit quest
<action actionid="9107" script="outfitquest.lua" /> -- outfit quest
<action actionid="9108" script="outfitquest.lua" /> -- outfit quest
<action actionid="9109" script="outfitquest.lua" /> -- outfit quest
<action actionid="9110" script="outfitquest.lua" /> -- outfit quest
<action actionid="9111" script="outfitquest.lua" /> -- outfit quest
<action actionid="9112" script="outfitquest.lua" /> -- outfit quest
<action actionid="9113" script="outfitquest.lua" /> -- outfit quest
<action actionid="9114" script="outfitquest.lua" /> -- outfit quest
<action actionid="9115" script="outfitquest.lua" /> -- outfit quest
<action actionid="9116" script="outfitquest.lua" /> -- outfit quest
<action actionid="9117" script="outfitquest.lua" /> -- outfit quest
<action actionid="9118" script="outfitquest.lua" /> -- outfit quest
<action actionid="9119" script="outfitquest.lua" /> -- outfit quest
<action actionid="9120" script="outfitquest.lua" /> -- outfit quest

-- Boat system --
<action itemid="3588" script="evre_boat_sail.lua"/> <!-- Boat Sail without rune -->
<action itemid="3590" script="evre_boat_sail.lua"/> <!-- Boat Sail without rune -->
<action itemid="3593" script="evre_boat_sail.lua"/> <!-- Boat Sail without rune -->
<action itemid="3595" script="evre_boat_sail.lua"/> <!-- Boat Sail without rune -->
<action itemid="2297" script="evre_boat_sail.lua" allowfaruse="1"/> <!-- Boat Sail -->


<action uniqueid="60084" script="xavi1.lua"/>
<action uniqueid="60085" script="xavi2.lua"/>
<action uniqueid="60086" script="xavi3.lua"/>
<action uniqueid="60087" script="xavi4.lua"/>

-- summons
<action actionid="11546" script="tales1.lua" />
<action actionid="11547" script="tales2.lua" />
<action actionid="11548" script="tales3.lua" />
<action actionid="11549" script="tales4.lua" />
<action actionid="11550" script="tales5.lua" />
<action uniqueid="11551" script="talesofcapernia.lua" />
<action actionid="11552" script="tales6.lua" />
<action actionid="11553" script="tales7.lua" />
<action actionid="11555" script="tales9.lua" />
<action actionid="11556" script="tales10.lua" />
<action actionid="11557" script="tales11.lua" />
<action actionid="11558" script="tales12.lua" />
<action actionid="11561" script="tales13.lua" />
<action actionid="11559" script="tales 13.lua" />
<action actionid="11560" script="tales 14.lua" />

-- Potions
	<action itemid="7588-7591;8472-8473;7618;7620;8704" event="script" value="potions.lua"/>
</actions>
 
You just posted your closingdoor.lua in your second post lol.
data/movements/scripts/closingdoor.lua
 
yes really i have it, XD, same error i put your code in closingdors.lua, and i get the same error

Code:
[19:17:50.052] [Error - Action Interface]
[19:17:50.053] data/actions/scripts/other/doors.lua:onUse
[19:17:50.054] Description:
[19:17:50.054] data/actions/scripts/other/doors.lua:13: attempt to index global
'DOORS' (a nil value)
[19:17:50.055] stack traceback:
[19:17:50.056]  data/actions/scripts/other/doors.lua:13: in function <data/actio
ns/scripts/other/doors.lua:7>

:/
 
i Add loneys part in my constant, but now says me error :/

Code:
[20:5:35.543] [Error - Action Interface]
[20:5:35.543] data/actions/scripts/other/doors.lua:onUse
[20:5:35.543] Description:
[20:5:35.544] data/actions/scripts/other/doors.lua:13: attempt to index global '
DOORS' (a nil value)
[20:5:35.544] stack traceback:
[20:5:35.544]   data/actions/scripts/other/doors.lua:13: in function <data/actio
ns/scripts/other/doors.lua:7>

- - - Updated - - -

I found it!!, i got it now works corretctly the problem is in my file of doors.lua i changed for a new and it works, i put down the code, thank evans for help and loneys too, you get REP !! Thank you , good luck

Code:
local function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingfromPos(position)
position.stackpos = STACKPOS_TOP_FIELD
local field = getThingfromPos(position)
if(item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0) then
return FALSE
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local nuevas = {
{closed=10269, open=10270},
{closed=10272, open=10273},
{closed=10274, open=10275},
{closed=10276, open=10277},
{closed=10278, open=10279},
{closed=10280, open=10281},
{closed=10282, open=10283},
{closed=10284, open=10285},
{closed=10469, open=10470},
{closed=10471, open=10472},
{closed=10473, open=10474},
{closed=10475, open=10476},
{closed=10478, open=10479},
{closed=10480, open=10481},
{closed=10482, open=10483},
{closed=10484, open=10485},
}
for ia = 1,#nuevas do
if (item.itemid == nuevas[ia].closed) then
doTransformItem(item.uid, nuevas[ia].open)
elseif (item.itemid == nuevas[ia].open) then
doTransformItem(item.uid, nuevas[ia].closed)
end
end
if(getItemLevelDoor(item.itemid) > 0) then
if(item.actionid > 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid))) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end
return TRUE
end
if(isInArray(specialDoors, item.itemid) == TRUE) then
if(item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) ~= -1) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return TRUE
end
if(isInArray(keys, item.itemid) == TRUE) then
if(itemEx.actionid > 0) then
if(item.actionid == itemEx.actionid) then
if doors[itemEx.itemid] ~= nil then
doTransformItem(itemEx.uid, doors[itemEx.itemid])
return TRUE
end
end
doPlayerSendCancel(cid, "The key does not match.")
return TRUE
end
return FALSE
end
if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition) == TRUE) then
local newPosition = toPosition
newPosition.y = newPosition.y + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end
return TRUE
end
doTransformItem(item.uid, item.itemid - 1)
return TRUE
end
if(isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition) == TRUE) then
local newPosition = toPosition
newPosition.x = newPosition.x + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end
return TRUE
end
doTransformItem(item.uid, item.itemid - 1)
return TRUE
end
if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition) == TRUE) then
if(item.actionid == 0) then
doTransformItem(item.uid, doors[item.itemid])
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
end
return TRUE
end
return FALSE
end
 
Back
Top Bottom