Postado Julho 23, 2013 12 anos Bom, este é um NPC que troca Premium por Diamond como no proprio Titulo já diz ! Bom vamos Direto ao assunto.... Vá em data/npc e crie um Premium.xml e cole isso dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="Kyler" script="premium.lua" walkinterval="3000" floorchange="0" access="5" > <health now="150" max="150"/> <look type="251" head="0" body="114" legs="114" feet="0"/> <parameters> <parameter key="message_greet" value="Bem-vindo, aqui voce pode comprar Premium , mudar de sexo e comprar bencao. Para ver as ofertas diga 'offer' "/> <parameter key="message_farewell" value="Ate a proxima."/> </parameters> </npc> Agora vai em npc/scripts e cria um premium.lua e cola isso dentro: 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 -- Conversa Jogador/NPC if(msgcontains(msg, 'offer') or msgcontains(msg, 'offer')) then selfSay('Para Premium diga ( premium ) Para bencao diga ( bencao ) Para trocar de sexo diga ( trocar sexo ) Para trocar de cidade natal diga ( cidade natal ).', cid) elseif(msgcontains(msg, 'premium') or msgcontains(msg, 'Premium')) then selfSay('dialogo da premium - diga sim para comprar-', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'bencao') or msgcontains(msg, 'Bencao')) then selfSay('Com bencao reduz sua penalidade quando morto ( perde menos XP skills etc..) ela custa apenas 3 Diamonds.Deseja ter a Bencao??', cid) talkState[talkUser] = 2 elseif(msgcontains(msg, 'trocar sexo') or msgcontains(msg, 'trocar sexo')) then selfSay('Para trocar de sexo sao nescessarios 5 Diamonds. Deseja mudar seu sexo??', cid) talkState[talkUser] = 3 elseif(msgcontains(msg, 'cidade natal') or msgcontains(msg, 'cidade natal')) then selfSay('deseja trocar de cidade natal? custa apenas 1 Diamonds. Deseja trocar Cidade Natal??', cid) talkState[talkUser] = 4 -- Confirmação da Compra elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 1) thenif(doPlayerRemoveItem(cid, 3956, 10) == true) then selfSay('Parabens, Premium de 30 dias!', cid) doPlayerAddPremiumDays(cid, 30) talkState[talkUser] = 0 else selfSay('Voce nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'sim') and talkState[talkUser] == 2) then if getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5) then selfSay('Voce ja esta usando bencao!', cid) elseif(doPlayerRemoveItem(cid, 102, 3) == true) then selfSay('Thanks!', cid) doPlayerAddBlessing(cid, 1) doPlayerAddBlessing(cid, 2) doPlayerAddBlessing(cid, 3) doPlayerAddBlessing(cid, 4) doPlayerAddBlessing(cid, 5) talkState[talkUser] = 0 else selfSay('Voce nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) thenif(doPlayerRemoveItem(cid, 2145, 5) == true) then selfSay('Thanks!', cid) if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then doPlayerSetSex(cid, PLAYERSEX_MALE) else doPlayerSetSex(cid, PLAYERSEX_FEMALE) end talkState[talkUser] = 0 else selfSay('Você nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'sendas') and talkState[talkUser] == 4) thenif(doPlayerRemoveItem(cid, 2145, 5) == true) then selfSay('Thanks!', cid) doPlayerSetTown(cid, 2) talkState[talkUser] = 0 else selfSay('Você nao tem Diamonds suficientes.', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'falador') and talkState[talkUser] == 4) thenif(doPlayerRemoveItem(cid, 2145, 5) == true) then selfSay('Thanks!', cid) doPlayerSetTown(cid, 1) talkState[talkUser] = 0 else selfSay('Você não tem Dimond suficientes.', cid) talkState[talkUser] = 0 end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ID do Diamond e a quantidade ! Agora vá em movements/scripts e crie um premium.lua e cole isso dentro: vips = {} vips.__index = vips function vips.moveBack(cid, fromPosition, text) doTeleportThing(cid, fromPosition, TRUE) doPlayerSendCancel(cid, text) end function onStepIn(cid, item, position, fromPosition) if item.actionid == 65535 then if(getPlayerPremiumDays(cid) < 1) then vips.moveBack(cid, fromPosition, "apenas premium account podem passar.") end end end Agora vá em movements.xml e cole isso dentro: <movevent type="StepIn" actionid="65535" event="script" value="premium.lua"/> Action ID, tem que ser o mesmo actionid na script e na tag do movements.xml. Para fazer a área vip só dar 2 cliques no tile e colocar o actionid ! Gostou? Não custa nada dar REP+
Postado Julho 23, 2013 12 anos Interesante, mais qual a Utilidade desse NPC Contato : under12451 (Skype) Meus Tutoriais O Que é DDoS ? como se Proteger Por Tony Criando Servidor Poketibia Sistemas de Vips com [VIP] No Nome Cyclops - Mistrock - 100% AFK Como Editar um NPC 8.6 [ Itens e Preços] Editando Swords 8.6 Como Editar um NPC 8.6 [VENDA]
Postado Julho 23, 2013 12 anos Autor No proprio titulo já fala --' É uma forma de um Server ganhar dinheiro, coloca os Diamonds no Shop e o player compra, recebe os Diamonds, vai no NPC, fala com ele, pode mudar de sexo, comprar bençao e se tornar Premium --' vc leu pelo menos ?
Postado Julho 23, 2013 12 anos @Kuchiki Kenpachi Desculpe, Confundi Tópicos. rsrsr eu esta com 3 Abas abertas rsrs, tava editando um tópico Sobre DDoS. @Tópic Cara é bom Sim, agora entendi Melhor, Editado Julho 23, 2013 12 anos por TonyHalk (veja o histórico de edições) Contato : under12451 (Skype) Meus Tutoriais O Que é DDoS ? como se Proteger Por Tony Criando Servidor Poketibia Sistemas de Vips com [VIP] No Nome Cyclops - Mistrock - 100% AFK Como Editar um NPC 8.6 [ Itens e Preços] Editando Swords 8.6 Como Editar um NPC 8.6 [VENDA]
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.