hello
1.i have problem with spell.
When i using this spell, it don't make anything
1.i have problem with spell.
When i using this spell, it don't make anything
2. I have spell script and i need to change script. I need script to check only summoned skeletons.function onTargetTile(cid, pos)
local getPos = pos
getPos.stackpos = 255
local corpse = getThingFromPos(getPos)
if(corpse.uid > 0 and isCorpse(corpse.uid) and isMoveable(corpse.uid) and getCreatureSkullType(cid) ~= SKULL_BLACK) then
doRemoveItem(corpse.uid)
doPlayerAddHealth(cid,80)
doPlayerAddMana(cid,80)
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
return true
end
return false
end
local area, combat = createCombatArea(AREA_CIRCLE3X3), createCombatObject()
setCombatArea(combat, area)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
function onTargetTile(cid, pos)
if (NECRO_MAX_SKELETONS < getPlayerStorageValue(cid, STORAGE_SAVE)) then
doConvinceCreature(cid, doCreateMonster(cid, "Skeleton", pos))
setPlayerStorageValue(cid, STORAGE_SAVE, getPlayerStorageValue(cid, STORAGE_SAVE) + 1)
elseif getCreatureSummons(cid) == 4 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 4)
elseif getCreatureSummons(cid) == 3 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 3)
elseif getCreatureSummons(cid) == 2 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 2)
elseif getCreatureSummons(cid) == 1 then
SetPlayerStorageValue(cid, STORAGE_SAVE, 1)
elseif getCreatureSummons(cid) < 1 then
SetPlayerStorageValue(cid, STORAGE_SAVE, -1)
elseif (NECRO_MAX_SKELETONS > getPlayerStorageValue(cid, STORAGE_SAVE)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You cannot summon more creatures.")
end
end
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
Last edited: