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

Destroy Field Rune

Kojiiro

Nobody cares. Do yourself.
Joined
May 10, 2010
Messages
534
Reaction score
9
Location
Brazil
I wonder why the fields do not disappear can not be taken to destroy field rune. help me please

Hugs Kojiiro :peace:
 
Here:

<item id="1487" article="a" name="fire field">
<attribute key="type" value="magicfield"/>
<attribute key="field" value="fire">
<attribute key="damage" value="20"/>
<attribute key="ticks" value="10000"/>
<attribute key="count" value="7"/>
<attribute key="damage" value="10"/>
</attribute>
</item>
<item id="1488" article="a" name="fire field">
<attribute key="type" value="magicfield"/>
<attribute key="field" value="fire">
<attribute key="ticks" value="10000"/>
<attribute key="count" value="7"/>
<attribute key="damage" value="10"/>
</attribute>
</item>
<item id="1489" article="a" name="fire field">
<attribute key="type" value="magicfield"/>
<attribute key="replaceable" value="0"/>
<attribute key="field" value="fire"/>
</item>
<item id="1490" article="a" name="poison field">
<attribute key="type" value="magicfield"/>
<attribute key="field" value="poison">
<attribute key="ticks" value="5000"/>
<attribute key="start" value="5"/>
<attribute key="damage" value="100"/>
</attribute>
</item>
<item id="1491" article="an" name="energy field">
<attribute key="type" value="magicfield"/>
<attribute key="field" value="energy">
<attribute key="damage" value="30"/>
<attribute key="ticks" value="10000"/>
<attribute key="damage" value="25"/>
</attribute>
</item>

...
 
local function doRemoveField(cid, pos)
local field = getTileItemByType(pos, ITEM_TYPE_MAGICFIELD)
if(field.itemid ~=0) then
doRemoveItem(field.uid)
doSendMagicEffect(pos, CONST_ME_POFF)
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 doRemoveField(cid, pos)
end

doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return false
end
 
Destory field rune
Code:
UNREMOVABLE_FIELDS = {1497, 1498, 1499, 1505, 1506, 1507, 1508, 7465, 7466, 7467, 7468, 7469, 7470, 7471, 7472, 7473, 11094, 11095}

local function doRemoveField(cid, pos)
	local field = getTileItemByType(pos, ITEM_TYPE_MAGICFIELD)
	if(not isInArray(UNREMOVABLE_FIELDS, field.itemid)) then
		doRemoveItem(field.uid)
		doSendMagicEffect(pos, CONST_ME_POFF)
		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 doRemoveField(cid, pos)
	end

	doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	return false
end
I meant, post your field spell which makes that field what you couldn't remove with this :p
 
Back
Top