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

Desintegrate rune not working perfectly.

Joined
Oct 18, 2011
Messages
611
Reaction score
7
Hi guys,

I need a working desintegrate rune: (Desintegrate - TibiaWiki - Quests, Items, Spells, and more).

Right now the scripts works, yet it ALSO removes items from a distance. (which it shouldn't, you should only be able to use it when you stand next to it)

My script: [data/spells/lib/support/desintegrate_rune.lua]

Code:
local unremovable = {} -- itemids of human dead bodies. 
 
local function doRemoveObject(cid, pos, rb)
	local object = getThingfromPos(pos)
	if(object.uid > 0 and 
		isCreature(object.uid) == FALSE and
			isItemMoveable(object.itemid) == TRUE and
				isInArray(unremovable, object.itemid) == FALSE) then
 
		doRemoveItem(object.uid)
		doRemoveObject(cid, pos, true)
		return LUA_NO_ERROR
	elseif(object.uid > 0) then
		pos.stackpos = pos.stackpos + 1
		return doRemoveObject(cid, pos, rb)
	elseif(not rb) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return LUA_ERROR
	end
end
 
function onCastSpell(cid, var)
	local pos = variantToPosition(var)
	if(pos.x ~= 0 and pos.y ~= 0 and pos.z ~= 0) then
		pos.stackpos = 1
		return doRemoveObject(cid, pos)
	end
	doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	return LUA_ERROR
end
 
Solution

Ey gail

just add this in spells.xml
Code:
<rune name="adito tera" id="2310" maglv="4" charges="3" range="0" script="support/desintegrate_rune.lua">

that's all this worked on my server!

i also use avesta 7.72


King regards 53701688
 
Last edited by a moderator:
does it works because i dont understand ur line of text a bit terrible english but w/e xD

king regards 53701688
 
Last edited by a moderator:
hello people sorry I have my ot860war how can I make it so that the disintegrate rune disintegrates my gps under a player to make the push time wall with disintegrate

desintegrate rune.lua
local function doRemoveObject(cid, pos)
pos.stackpos = 255
local object = getThingFromPos(pos)
if(object.uid > 65535 and not isCreature(object.uid) and isMovable(object.uid) and object.actionid == 0 and not getTileInfo(pos).protection) then
doRemoveItem(object.uid)
doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
return true
end

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return false
end

function onCastSpell(cid, var)
local pos = variantToPosition(var)
if(pos.x == CONTAINER_POSITION) then
pos = getThingPos(cid)
end

if(pos.x ~= 0 and pos.y ~= 0) then
return doRemoveObject(cid, pos)
end

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return false
end
 
Back
Top Bottom