@likinho: acho que isso não tem nada a ver com o pedido que o cara fez ,esse script e so um changer vocation feito pelo 20cm.
@topico: Caso ainda não tenha resolvindo fala ai que não, que quando eu chega em casa eu tento fazer sua script falo.
@script
npc
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tobi" script="data/npc/scripts/tobi npc script.lua" walkinterval="2000" speed="0" floorchange="0">
<health now="100" max="100"/>
<look type="480" head="0" body="0" legs="0" feet="0" addons="0"/>
<parameters>
<parameter key="message_greet" value="Voce que troca seus coracoes para pode entra na akatsuki.reponda {yes} ?"/>
</parameters>
</npc>
script do npc
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local vocation = 120 -- vocation que precisa ter
local vocatiion = 900 -- vocation que vai se transforma
local item = 5943 -- ID do Item que necessita para trocar
local quantidade = 10 -- quantidade de corações
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'sim')) then
if getPlayerStorageValue(cid, 8219382) == -1 then
if getPlayerVocation(cid) == vocation then
if getPlayerItemCount(cid, item) < quantidade then
selfSay('Não tente me enganar, voce não tem os '..quantidade..' corações !', cid)
else
doPlayerRemoveItem(cid, item, quantidade)
doPlayerSetVocation(cid, vocatiion)
setPlayerStorageValue(cid,8219382,1)
selfSay('Voce agora faz parte da akatsuki.', cid)
end
else
selfSay('Voce nao tem a vocacao nessessaria.', cid)
end
else
selfSay('Voce ja faz parte da akatsuki.', cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Coração
Creaturescript/script/nome do script adicione isso dentro
function onKill(cid, target, lastHit)
local item = 5943
local level = 300
if isPlayer(cid) and isPlayer(target) then
if getPlayerLevel(target) >= level then
local add = doPlayerAddItem(cid, item, 1)
doItemSetAttribute(add, "description","Esse coração é de "..getPlayerName(target).." que foi morto no level "..getPlayerLevel(target).." por "..getPlayerName(cid)..".")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce Mato " ..getPlayerName(target).. ".")
doSendMagicEffect(getPlayerPosition(cid),12)
end
end
return true
end
Tag:
<event type="kill" name="HeartSys" event="script" value="heart.lua"/>
Testado e funcionando