Ir para conteúdo

Posts Recomendados

o meu npc ele ja da promotion mais ele fika pra sempre eu kero ke acabe junto com a minha vip.

 

 

1° NPC

Script

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
local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
npcHandler:addModule(FocusModule:new())

 

XML

<npc name="The King" script="data/npc/scripts/promotion.lua" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="132" head="114" body="114" legs="94" feet="132" addons="3" corpse="2212"/>
<parameters>
 <parameter key="message_greet" value="Hello |PLAYERNAME|. I sell {promotion}." />
</parameters>
</npc>

Link para o comentário
https://xtibia.com/forum/topic/182811-kero-ke-arrumen-npc-de-promontion-e-acabe-quando-vip-acabar/
Compartilhar em outros sites

o meu sistema vip e dakeles ke quando vc usa um item vc recebe 30 dias de vip

 

 

ae o scrpit:

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

local config={

removeOnUse = "yes" -- remover quando usar ("yes" or "no")

}

 

local days = 30 -- dias que serão adicionados

local daysvalue = days * 30 * 60 * 60

local storageplayer = getPlayerStorageValue(cid, 13540)

local timenow = os.time()

 

if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then

time = timenow + daysvalue

else

time = storageplayer + daysvalue

end

 

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")

setPlayerStorageValue(cid, 13540, time)

local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(30 * 60 * 60))

doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")

if (config.removeOnUse == "yes") then

doRemoveItem(item.uid, 1)

end

 

return TRUE

end

×
×
  • Criar Novo...