Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /data/creaturescripts/scripts/ crie um arquivo e renomeie para killRecompense:
- function onKill(cid, target)
- local KILL = {
- ["Demon"] = {killed = 50, storage = 28382, rewards = {{2160, 10}, {2222, 2}, {3232, 2}}},
- ["Rat"] = {killed = 10, storage = 28383, rewards = {{2160, 10}, {2222, 2}, {3232, 2}}},
- }
- local a = KILL[getCreatureName(target)]
- if isMonster(target) then
- if a then
- if getPlayerStorageValue(cid, a.storage) >= a.killed then
- for _, T in pairs(a.rewards) do
- doPlayerAddItem(cid, T[1], T[2])
- end
- doPlayerSendTextMessage(cid, 27, "You win your recompense for kill " .. a.killed .. " " .. getCreatureName(target) .. ".")
- setPlayerStorageValue(cid, a.storage, 0)
- else
- setPlayerStorageValue(cid, a.storage, getPlayerStorageValue(cid, a.storage) + 1)
- doPlayerSendTextMessage(cid, 27, "Now you need kill only more " .. getPlayerStorageValue(cid, a.storage) - a.killed .. " " .. getCreatureName(target) .. ".")
- end
- end
- end
- return true
- end
- data/creaturescripts/scripts/login.lua:
- registerCreatureEvent(cid, "killRec")
- data/creaturescripts/creaturescripts.xml:
- <event type="kill" name="killRec" event="script" value="killRecompense.lua"/>
Advertisement
Add Comment
Please, Sign In to add comment