sabodden
Member
- Joined
- Sep 27, 2019
- Messages
- 138
- Reaction score
- 18
Would be possible to when use this rune, instead of create a skeleton, get the monster corpse and create the creature killed?
I mean, if rune was used in a dead dwarf, create a dwarf, if was used in a dead rotworm, create a rotworm...
I mean, if rune was used in a dead dwarf, create a dwarf, if was used in a dead rotworm, create a rotworm...
Code:
<rune name="Animate Dead" id="2316" allowfaruse="1" charges="1" maglv="4" exhaustion="2000" blocktype="solid" event="script" value="summon/animate dead rune.lua"/>
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
doRemoveItem(corpse.uid)
doConvinceCreature(cid, doCreateMonster("Skeleton", position))
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
return true
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