Histórico de Curtidas
-
tsoad12 deu reputação a Markin em [PEDIDO] NPC vocationarquivo.xml
<?xml version="1.0"?> <npc name="Daniel" script="data/npc/scripts/setvocation.lua" walkinterval="1000" floorchange="0"> <health now="100" max="100"/> <look type="133" head="114" body="119" legs="132" feet="114" addons="3"/> <parameters> <parameter key="message_greet" value="Ola {|PLAYERNAME|}, voce pode se transformar em um {sorcerer}, {druid}, {paladin} ou {knight}." /> </parameters> </npc> setvocation.lua
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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local storage = 67413 if msgcontains(msg, 'sorcerer') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 1) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end elseif msgcontains(msg, 'druid') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 2) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end elseif msgcontains(msg, 'paladin') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 3) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end elseif msgcontains(msg, 'knight') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 4) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
tsoad12 deu reputação a Teiko em [PEDIDO] NPC vocationBem amigo ver se isso te ajuda
vá em data/npc crie um arquivo chamado vocation.xml e coloque isso dentro.
Agora vá em data/npc/scripts e crie um arquivo chamado vocation.lua e coloque isso dentro
Vermelho:Vocação
Roxo:ID Da Voc
Obs: Eu só coloquei o Sorcerer e Kinght como exemplo se quiser mais é só fazer do mesmo jeito Se for de tibia as vocações não estão configuradas corretamente então configureas -
tsoad12 deu reputação a Nogard em [PEDIDO] NPC vocationlocal 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local storage = 67413 if msgcontains(msg, 'sorcerer') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 1) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) doTeleportThing(cid,{x= 000, y=000, z=000}) ---- Aqui colocara as coordenadas que o player será mandado doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Bem vindo, novo' .. getPlayerVocation(cid) .. ' !') else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end elseif msgcontains(msg, 'druid') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 2) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) doTeleportThing(cid,{x= 000, y=000, z=000}) ---- Aqui colocara as coordenadas que o player será mandado doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Bem vindo, novo' .. getPlayerVocation(cid) .. ' !') else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end elseif msgcontains(msg, 'paladin') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 3) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) doTeleportThing(cid,{x= 000, y=000, z=000}) ---- Aqui colocara as coordenadas que o player será mandado doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Bem vindo, novo' .. getPlayerVocation(cid) .. ' !') else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end elseif msgcontains(msg, 'knight') then if getPlayerStorageValue(cid, storage) == -1 then doPlayerSetVocation(cid, 4) doSendMagicEffect(getPlayerPosition(cid), 28) doPlayerSetStorageValue(cid, storage, 1) selfSay('Parabéns {'..getPlayerName(cid)..'} agora você é um {'..getPlayerVocation(cid)..'}!', cid) doTeleportThing(cid,{x= 000, y=000, z=000}) ---- Aqui colocara as coordenadas que o player será mandado doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Bem vindo, novo' .. getPlayerVocation(cid) .. ' !') else selfSay('Desculpe {'..getPlayerName(cid)..'} mais você já tem uma vocação!', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Edit ao .lua da AnneMotta, para o script também teleportar o player, como pediu.
-
tsoad12 deu reputação a Nogard em [PEDIDO] NPC vocationPra configurar o item que será cobrado, e a quantidade, basta editar:
local item = 2160 --- Item ID do item que será cobrado local itemcost = 5 --- Quantidade do item que será cobrado