Some1
New Member
- Joined
- Jan 12, 2013
- Messages
- 40
- Reaction score
- 4
Hello, could anyone tell me whats wrong with this? I mean, until level 20 the player summons Skeletons, after 21 he summons Skeleton Warriors but after 40 he still summons Skeleton Warriors instead of Demon Skeletons.
Code:
local function doTargetCorpse(cid, position)
position.stackpos = 255
local corpse = getThingFromPos(position)
if(corpse.uid > 0 and isCorpse(corpse.uid) and isMoveable(corpse.uid) and getCreatureSkullType(cid) ~= SKULL_BLACK) then
if getPlayerLevel(cid) <= 20 then
doRemoveItem(corpse.uid)
doPlayerRemoveItem(cid, 2316, 1)
doConvinceCreature(cid, doCreateMonster("Skeleton", position))
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) else
if getPlayerLevel(cid) >= 21 then
doPlayerRemoveItem(cid, 2316, 1)
doRemoveItem(corpse.uid)
doConvinceCreature(cid, doCreateMonster("Skeleton Warrior", position))
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) else
if getPlayerLevel(cid) >= 40 then
doPlayerRemoveItem(cid, 2316, 1)
doRemoveItem(corpse.uid)
doConvinceCreature(cid, doCreateMonster("Demon Skeleton", position))
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) else
return true
end
end
end
end
doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return false
end
function onCastSpell(cid, var)
local position = variantToPosition(var)
if(position.x ~= 0 and position.y ~= 0) then
return doTargetCorpse(cid, position)
end
doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return false
end