creatserver
New Member
- Joined
- Feb 7, 2015
- Messages
- 25
- Reaction score
- 0
Wanted to put in this script to win whoever gives the last hit.
Lua:
local config = {
storagekill = 19500,
storageaegis = 19332,
tempo = 5,
times = 1, --- quantidade de vezes que tenho que matar
charges = 1,
effect1 = 66,
effect2 = 10
}
function onKill(cid, target, lastHit)
local killed = getPlayerStorageValue(cid,config.storagekill) < 0 and 0 or getPlayerStorageValue(cid,config.storagekill)
local skill = getPlayerStorageValue(cid, config.storageaegis)
if isMonster(target) and getCreatureName(target):lower() == 'aegis' then
if killed + 1 < config.times then
doCreatureSay(target, "I'll be back mortal...", 20)
doSendMagicEffect(getCreaturePosition(target), config.effect1)
setPlayerStorageValue(cid, config.storagekill, killed + 1)
addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2)
addEvent(doCreateMonster, 1000*config.tempo, "Aegis", getCreaturePosition(target), true)
elseif killed + 1 >= config.times then
setPlayerStorageValue(cid, config.storagekill, 0)
if skill < config.charges then
doPlayerSendTextMessage(cid,22,"Congratulations, you just killed "..getCreatureName(target).." and earned Aegis of Immortal skill!")
doBroadcastMessage("O jogador ".. getCreatureName(cid) .." absorveu a special skill Aegis of the Immortal ao desferir o último golpe no BOSS Aegis.", 26)
setPlayerStorageValue(cid, config.storageaegis, config.charges)
zEffect(cid, 37)
end
end
end
return true
end
Last edited by a moderator: