ALL CREDITS TO JBD (original post: http://otland.net/f82/heart-frag-reward-v1-1-a-55883/)
i edit something.. but no soo much
TFS 0.3.5
creaturescripts/creaturescripts.xml
creaturescripts/scripts/login.lua
creaturescripts/scripts/fragreward.lua
the problem is this:
the heart's of the dead, isn't in the backpack of the Killer (last hit), is in the body dead.
somebody can fix it? :S i was training, but is so difficult for me, i am begin in scripting.
THX
and sorry for me bad english (i speak spanish)
i edit something.. but no soo much
TFS 0.3.5
creaturescripts/creaturescripts.xml
Code:
<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>
creaturescripts/scripts/login.lua
Code:
registerCreatureEvent(cid, "FragReward")
creaturescripts/scripts/fragreward.lua
Code:
function onKill(cid, target, lastHitKiller)
if(isPlayer(lastHitKiller)) then
local values = { KILLER_NAME = getCreatureName(lastHitKiller), KILLER_LEVEL = getPlayerLevel(lastHitKiller), TARGET_NAME = getCreatureName(target), TARGET_LEVEL = getPlayerLevel(target) }
local reward = doPlayerAddItem(lastHitKiller, 5943, 1)
doSendMagicEffect(getCreaturePosition(lastHitKiller), CONST_ME_GIFT_WRAPS)
doSetItemSpecialDescription(reward, isPlayer(lastHitKiller) and "Este es el corazon de ".. values.TARGET_NAME ..". Asesinado en level ".. values.TARGET_LEVEL .." por ".. values.KILLER_NAME .." quien tenia level ".. values.KILLER_LEVEL .." en el momento. " .. (getCreatureSkullType(target) <= SKULL_GREEN and "[Injustificado]" or "[Justificado]") or "Este es el corazon de ".. values.TARGET_NAME ..". Asesinado en level ".. values.TARGET_LEVEL .." por ".. values.KILLER_NAME ..".")
setItemName(reward, "".. values.TARGET_NAME .."'s Heart.")
end
return true
end
the problem is this:
the heart's of the dead, isn't in the backpack of the Killer (last hit), is in the body dead.
somebody can fix it? :S i was training, but is so difficult for me, i am begin in scripting.
THX
and sorry for me bad english (i speak spanish)