@,
Vá em data/creaturescripts/creaturescripts.xml e adicione a seguinte tag:
<event type="kill" name="bossKill" script="bosskill.lua"/>
Em
data/creaturescripts/scripts crie o arquivo
bosskill.lua com o seguinte conteúdo:
local config = {
boss = "Nome do Boss",
storage = 724800
}
function onKill(cid, target, damage, flags)
if isMonster(target) then
if getCreatureName(target) == config.boss and getPlayerStorageValue(cid, config.storage) == -1 then
setPlayerStorageValue(cid, config.storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabens por matar o boss " .. config.boss .. ", pode pegar sua recompensa.")
doSendMagicEffect(getCreaturePosition(cid), 66)
end
end
return true
end
Ainda em
data/creaturescripts/scripts adicione isso em
login.lua antes do
ultimo return true:
registerCreatureEvent(cid, "bossKill")
Agora vá em
data/actions/actions.xml e coloque a seguinte tag:
<action actionid="4213" script="rewardBoss.lua" />
E para finalizar, em
data/actions/scripts crie o arquivo
rewardBoss.lua com o seguinte conteúdo:
local config = {
questStorage = 724877,
bossStorage = 724800,
item = {18422, 5} -- itemid, amount
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.bossStorage) >= 1 then
if getPlayerStorageValue(cid, config.questStorage) >= 1 then
doPlayerSendTextMessage(cid, 25, "Desculpe, mas voce ja completou essa quest!")
return false
end
doPlayerAddItem(cid, config.item[1], config.item[2])
setPlayerStorageValue(cid, config.questStorage, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabens! Voce recebeu "..config.item[2].." "..getItemNameById(config.item[1])..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
return true
else
doPlayerSendTextMessage(cid, 25, "The chest is empty.")
end
return false
end
Atenciosamente,
Bruno Minervino
Tibia Clients - Downloads Window