Ir para conteúdo
  • 0

kinglekke

Pergunta

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Templarium Taboos" script="Templarium.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="268" head="255" body="94" legs="255" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Olá |PLAYERNAME|. Fale {trade} para ver minhas ofertas, {bless} para compra bless somente acima do level {60}, {premium} para compra 5 dia de premium account." />
<parameter key="message_decline" value="Adeus, |PLAYER NAME|." /> 
<parameter key="message_walkaway" value="Adeus, |PLAYER NAME|." />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="bless;premium;" />
<parameter key="keyword_reply1" value="{first bless},{second bless},{third bless},{third bless},{fifth bless} or {all}" />
<parameter key="keyword_reply2" value="O valor de 5 days premium esta custando atualmente 300k, ira querer ?" />
<parameter key="shop_buyable" value="Amulet of Loss,2173,200000;"/>
</parameters>
</npc>

 

a ideia é essa do npc 

só preciso da parte da .lua

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

tentei montya um script mais nao deu muito certo

 

Spoiler

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


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


if(msgcontains(msg, "premium") or msgcontains(msg, "price")) then
selfSay("O premium esta no valor de 300K por 5 days.", cid)
elseif(msgcontains(msg, "premium") or msgcontains(msg, "Premium")) then
selfSay("Você gostaria de comprar 5 dias de premium?", cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, "yes") and talkState[talkUser] == 1) then
if(doPlayerRemoveItem(cid, 2160, 30) == true) then
selfSay("Muito bem! Aproveite!", cid)
doPlayerAddPremiumDays(cid, 5)
talkState[talkUser] = 0
elseif(doPlayerRemoveItem(cid, 2152, 200) == true) then
selfSay("Muito bem! Aproveite!", cid)
doPlayerAddPremiumDays(cid, 5)
talkState[talkUser] = 0
elseif(doPlayerRemoveItem(cid, 2148, 20000) == true) then
selfSay("Muito bem! Aproveite!", cid)
doPlayerAddPremiumDays(cid, 5)
talkState[talkUser] = 0
else
selfSay("Desculpe, você não tem o {valor} necessário parar comprar uma premium.", cid)
talkState[talkUser] = 0
end
end
return TRUE
end


local node1 = keywordHandler:addKeyword({"first bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the first blessing for 2000 (plus level depending amount) gold?"})
node1:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200})
node1:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"})


local node2 = keywordHandler:addKeyword({"second bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the second blessing for 2000 (plus level depending amount) gold?"})
node2:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200})
node2:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"})


local node3 = keywordHandler:addKeyword({"third bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the third blessing for 2000 (plus level depending amount) gold?"})
node3:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 3, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200})
node3:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"})


local node4 = keywordHandler:addKeyword({"fourth bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the fourth blessing for 2000 (plus level depending amount) gold?"})
node4:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 4, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 60, endLevel = 200})
node4:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"})


local node5 = keywordHandler:addKeyword({"fifth bless"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to buy the fifth blessing for 2000 (plus level depending amount) gold?"})
node5:addChildKeyword({"yes"}, StdModule.bless, {npcHandler = npcHandler, number = 5, premium = true, baseCost = 200000, levelCost = 666, startLevel = 60, endLevel = 200})
node5:addChildKeyword({"no"}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Too expensive, eh?"})

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

pfv me ajudem

Editado por kinglekke
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...