Olá eu gostaria do script do NPC Teleportador VIP, tentei achar no fórum mas não encontrei que o NPC contenha as seguintes funções:
Checa se o player é VIP ou não,
Configurar a área para onde ele será teleportar (x=xxxx,y=xxxx,z=x)
Se puderem me ajudar dou RESP+ por uma semana, desde já agradeço =)
NPC que teleporta para área VIP PDA

Vamos lá.
Crie um arquivo .xml com o nome que vc quiser na pasta Data/NPC e cole isso:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Junior" script="viajador.lua" walkinterval="350000" floorchange="0" speed="0">
<health now="100" max="100"/>
<look type="662" head="114" body="94" legs="57" feet="0"/>
<parameters>
<parameter key="message_greet" value="Ola. Para mais informacoes de meus servicos diga {travel}." />
<parameter key="message_farewell" value="Tchau." />
<parameter key="message_walkaway" value="Tchau." />
</parameters>
</npc>
Para Configurar é simples:
Em NPC Name vc coloca o nome do npc.
Looktype é o outfit que ele vai usar, Head é a cor do Cabelo, Body a camisa,legs é a cor da calça,feet é a cor do tenis.
Agora vá em Data/NPC/Scripts e crie um arquivo chamado viajador.lua e cole isso dentro:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer mesmo viajar?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=436, y=1788, z=7} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'premmy'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu posso te teleportar. Fale \'premmy\'.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
Para configurar aqui tb é simples:
Premium = True ou false para requerer premium account.
Level = Level necessário pra usar o travel.
cost = preço a pagar.
destination = coloca as coordenadas do local.
#include <iostream>
using namespace std;
int main( ){
setlocale(LC_ALL,"");
int total, num;
total = 0;
while( total < 20 ) {
cout << "Total = " << total << endl;
cout << "Entre com um numero: ";
cin >> num;
total = total + num;
}
cout << "Final total = " << total << endl;
system("pause");
}
Bom desculpe esqueci de citar que era para versão 8.54 (PDA) mas mesmo assim funcionou e obrigado por responder me ajudou bastante agradeço muito
Tópico movido para a seção de dúvidas e pedidos resolvidos.
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.