Ir para conteúdo

Featured Replies

  • Respostas 5
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Administrador

Bom primeiro va na pasta npc e copie um arquivo qual quer e renomeie para Jhonny e ponha isso dentro


<?xml version="1.0" encoding="UTF-8"?>

<npc name="Johnny" script="data/npc/scripts/promotion.lua" walkinterval="2000" floorchange="0">

<mana now="800" max="800"/>

<health now="200" max="200"/>

<look type="133" head="114" body="119" legs="132" feet="114"/>

</npc>

Agora em scripts copie um arquivo qual quer e renomeie para promotion.lua e adicione isto dentro

local sorcId = 9 -- id da vocation sorc vip

local druidId = 10 -- id da vocation druid vip

local pallyId = 11 -- id da vocation pally vip

local kinaId = 12 -- id da vocation kina vip

local cost = 20000

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

---------------------------------------Epic Elder Druid------------------------------

if msgcontains(msg, 'vip hells druid') then

selfSay("Do you want buy a vip promotion for "..cost.." golds?", cid)

talkState[cid] = 1

end

if talkState[cid] == 1

if msgcontains(msg, 'yes') then

if getPlayerMoney(cid) >= cost

doPlayerRemoveMoney(cid,cost)

doPlayerSetVocation(cid, druidId)

selfSay("Ok, as your wish.", cid)

talkState[cid] = 0

else

selfSay("Sorry, you don´t have enough gold.", cid)

talkState[cid] = 0

end

end

end

-----------------------------------------Epic Master Sorcerer------------------------------

if msgcontains(msg, 'vip hells sorcerer') then

selfSay("Do you want buy a vip promotion for "..cost.." golds?", cid)

talkState[cid] = 2

end

if talkState[cid] == 2

if msgcontains(msg, 'yes') then

if getPlayerMoney(cid) >= cost

doPlayerRemoveMoney(cid,cost)

doPlayerSetVocation(cid, sorcId)

selfSay("Ok, as your wish.", cid)

talkState[cid] = 0

else

selfSay("Sorry, you don´t have enough gold.", cid)

talkState[cid] = 0

end

end

end

---------------------------------------Epic Royal Paladin------------------------------

if msgcontains(msg, 'vip hells paladin') then

selfSay("Do you want buy a vip promotion for "..cost.." golds?", cid)

talkState[cid] = 3

end

if talkState[cid] == 3

if msgcontains(msg, 'yes') then

if getPlayerMoney(cid) >= cost

doPlayerRemoveMoney(cid,cost)

doPlayerSetVocation(cid, pallyId)

selfSay("Ok, as your wish.", cid)

talkState[cid] = 0

else

selfSay("Sorry, you don´t have enough gold.", cid)

talkState[cid] = 0

end

end

end

---------------------------------------Epic Elite Knight------------------------------

if msgcontains(msg, 'vip hells knight') then

selfSay("Do you want buy a vip promotion for "..cost.." golds?", cid)

talkState[cid] = 4

end

if talkState[cid] == 4

if msgcontains(msg, 'yes') then

if getPlayerMoney(cid) >= cost

doPlayerRemoveMoney(cid,cost)

doPlayerSetVocation(cid, kinaId)

selfSay("Ok, as your wish.", cid)

talkState[cid] = 0

else

selfSay("Sorry, you don´t have enough gold.", cid)

talkState[cid] = 0

end

end

end

return TRUE

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

é isso algum problema Posta ae ^^

Editado por Erimyth (veja o histórico de edições)

TibiaKing Team- KingTópicos
www.tibiaking.com

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo