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

Tile X - magic wall does't work.

Demonder

New Member
Joined
May 22, 2009
Messages
8
Reaction score
0
Hello guys.
I'm doing a system here for my server, and I need to make the magic wall does not work if it is used in a tile X.
Example:
I am in any tile, then I use a magic wall in a tile with a position {x="100" y="100", z ="7"}, i receive a msg that i cannot use magic wall rune on this position, or remove automatic this magic wall.
What function that i need to use to make this?

Thanks for attention.

No More~
XIna~
 
Code:
local restrict = {
	{x=100, y=100, z=7},
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)

function onCastSpell(cid, var)
	local pos = variantToPosition(var)
	for i = 1, #restrict do
		if restrict[i].x == pos.x and restrict[i].y == pos.y and restrict[i].z == pos.z then
			return not doPlayerSendCancel(cid, 'You cannot use magic wall rune on this position.')
		end
	end
	return doCombat(cid, combat, var)
end
 
Lua:
function onAddItem(moveitem, tileitem, position, cid)
    local field = getTileItemByType(position, ITEM_TYPE_MAGICFIELD).uid
    if (field > 0) then
        doRemoveItem(field)
    end
    return true
end

+ action id (?)
 
Lua:
function onAddItem(moveItem, tileItem, position, cid)
	if getTileItemByType(position, ITEM_TYPE_MAGICFIELD).uid > 0 then
		doRemoveItem(moveItem.uid)
	end
end
Script by Cykotitan works in 100% :D
 
Back
Top Bottom