0.4:
local pokemons = {"Zapdos", "Moltres", "Articuno","Entei","Lugia","Ho-oh"}
function onKill(cid, target, lastHit)
if isInArray(pokemons, getCreatureName(target)) then
for _, pid in pairs(getPlayersOnline()) do
doPlayerSendTextMessage(pid, MESSAGE_TYPES["blue"], "O jogador "..getCreatureName(cid).." derrotou o passáro lendario "..getCreatureName(target).."!")
end
end
return true
end
1.2:
local pokemons = {"Zapdos", "Moltres", "Articuno","Entei","Lugia","Ho-oh"}
function onKill(creature, target)
if isInArray(pokemons, target:getName()) then
for _, player in pairs(Game.getPlayers()) do
player:sendTextMessage(MESSAGE_TYPES["blue"], "O jogador "..player:getName().." derrotou o passáro lendario "..target:getName().."!")
end
end
return true
end
Caso dê algum erro de MESSAGE_TYPES (provavelmente na 1.2), adicione ao final do arquivo constant, na pasta data/lib do seu servidor, isso:
local MESSAGE_TYPES = {
["advance"] = MESSAGE_EVENT_ADVANCE,
["event"] = MESSAGE_EVENT_DEFAULT,
["white"] = MESSAGE_EVENT_DEFAULT,
["orange"] = MESSAGE_STATUS_CONSOLE_ORANGE,
["info"] = MESSAGE_INFO_DESCR,
["green"] = MESSAGE_INFO_DESCR,
["small"] = MESSAGE_STATUS_SMALL,
["blue"] = MESSAGE_STATUS_CONSOLE_BLUE,
["red"] = MESSAGE_STATUS_CONSOLE_RED,
["warning"] = MESSAGE_STATUS_WARNING,
["status"] = MESSAGE_STATUS_DEFAULT
}
Qualquer alteração, basta trocar no script "blue" para qualquer outro valor dessa tabela.