kimokimo
Kimo
i want script for my zombie event becuase players use magic wall to block themself beside walls can anyone can anyone tell me how to make magic wall cant be used in the zombie?
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
function onCastSpell(cid, var)
local pos = variantToPosition(var)
if getTileInfo(getThingPos(cid)).protection then
return not doPlayerSendDefaultCancel(cid, RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE)
else
local s = getTileInfo(pos)
if s.protection then
return not doPlayerSendDefaultCancel(cid, RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE)
elseif s.nopvp then
return not doPlayerSendCancel(cid, 'You can\'t use it here.')
end
end
local v = getTileItemByType(pos, ITEM_TYPE_MAGICFIELD).uid
if v ~= 0 then
doRemoveItem(v)
end
v = doCreateItemEx(1497)
if doTileAddItemEx(pos, v) == 1 and getTileItemByType(pos, ITEM_TYPE_MAGICFIELD).uid ~= 0 then
doDecayItem(v)
return doCombat(cid, combat, var)
else
return not doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)
end
end