Olá galerinha do xtibia , eu gostaria de pedir uma ajuda a rapaziada o pedido é bem pequeno , quem puder me ajuda ganha REP++ então vamos ao pedido !.
~> Pedido
Eu gostaria de um npc que , removesse frags e redskull , Por 1kk
Olá galerinha do xtibia , eu gostaria de pedir uma ajuda a rapaziada o pedido é bem pequeno , quem puder me ajuda ganha REP++ então vamos ao pedido !.
~> Pedido
Eu gostaria de um npc que , removesse frags e redskull , Por 1kk
Tente esse :
Primeiramente crie um arquivo na pasta data/npc com o nome Removedor.xml e cole isto nele:
<?xml version="1.0"?> <npc name="Removedor" script="data/npc/scripts/skullremover.lua" walkinterval="5000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Eu posso {remover} sua skull ou battle, diga {remover}." /> </parameters> </npc>
Agora vamos ao script do NPC, vá até a pasta data\npc\scripts crie um arquivo com o nome skullremover.lua coloque isto nele:
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 S = { [3] = 100000, -- white skull preço [4] = 500000, -- red skull preço [5] = 1000000 -- black skull preço } local battle_price = 10000 -- battle preço if(msgcontains(msg, 'remover') or msgcontains(msg, 'REMOVER')) then selfSay('E ai oque vai ser? Remover {skulls} e o battle ou quer retirar só {battle}?', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'skulls') and talkState[talkUser] == 1 then if not S[getCreatureSkullType(cid)] then selfSay('Você não está com nenhuma skull!', cid) talkState[talkUser] = 0 else selfSay('Você quer remover sua skull por '..S[getCreatureSkullType(cid)]..' gps? {yes}', cid) talkState[talkUser] = 2 end elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then if doPlayerRemoveMoney(cid, S[getCreatureSkullType(cid)]) == TRUE then db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") doCreatureSetSkullType(cid, 0) if getCreatureCondition(cid, CONDITION_INFIGHT) ~= FALSE then doRemoveCondition(cid, CONDITION_INFIGHT) end selfSay('Pronto meu caro,seus males foram removidos!', cid) talkState[talkUser] = 0 else selfSay('Você não tem '..S[getCreatureSkullType(cid)]..' gps suficientes!', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'battle') and talkState[talkUser] == 1 then selfSay('Você quer remover seu battle por '.. battle_price ..' gps? {yes}', cid) talkState[talkUser] = 3 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then if getCreatureCondition(cid, CONDITION_INFIGHT) ~= FALSE then if doPlayerRemoveMoney(cid, battle_price) == TRUE then doRemoveCondition(cid, CONDITION_INFIGHT) selfSay('Pronto meu caro,seu battle foi removido!', cid) talkState[talkUser] = 0 else selfSay('Você não tem '.. battle_price ..' gps suficientes!', cid) talkState[talkUser] = 0 end else selfSay('Você não está com battle!', cid) talkState[talkUser] = 0 end elseif msg == "no" and talkState[talkUser] >= 1 then selfSay("Then not", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Créditos: VodKart
Skype: Gabrielks4
@AvengerPlayer uma dica
Ponha seus script em spoiler ou code para facilitar os usuarios, caso n saiba
[.spoiler]
ponha o script aki
[./spoiler]
e code mesmo coisa:
[.CODE]
ponha o script aki
[./CODE]
mas tire o . q deixei antes de spoiler e CODE, ou so clicar em BBCode Especial do lado esquerdo de Fonte clica em spoiler ou code e abrirar uma caixa de texto e ponha o script nela.
-----Edit-------
Duvida Resolvida peça para mover.
Aten. Yan18.
@Yan18
Desculpa ae vou começar a fazer isso sou novo aqui no fórum.
xD
Skype: Gabrielks4
Pedido resolvido, tópico movido para a área correta.