AdiMit
c(;
- Joined
- May 2, 2016
- Messages
- 70
- Solutions
- 2
- Reaction score
- 3
Hello dear community,
I tried to create a spell working exactly in the same way as the Destroy Field Rune does; however, I wanted to make it massive (=CIRCLE3X3)...
I'm currently using the [8.60] The Forgotten Server 0.3.6 (Crying Damson) V8 by Printer, from the thread: [8.60] The Forgotten Server 0.3.6 (Crying Damson) V8;
The spell is possible to be casted, but it does not remove any fields (and yet the rune works fine).
I get the following error message:
Here is the script of the spell:
If you happen to know how to resolve the issue, I would be greatly thankful for your support,
Best Regards!
I tried to create a spell working exactly in the same way as the Destroy Field Rune does; however, I wanted to make it massive (=CIRCLE3X3)...
I'm currently using the [8.60] The Forgotten Server 0.3.6 (Crying Damson) V8 by Printer, from the thread: [8.60] The Forgotten Server 0.3.6 (Crying Damson) V8;
The spell is possible to be casted, but it does not remove any fields (and yet the rune works fine).
I get the following error message:
Here is the script of the spell:
Lua:
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
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_NONE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POFF)
local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)
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)
doRemoveField(cid, pos)
doCombat(cid, combat, var)
return true
end
If you happen to know how to resolve the issue, I would be greatly thankful for your support,
Best Regards!