1
[Pedido] NPC para 3ra Promotion tfs 1.xx el Jue Mayo 11, 2017 4:30 pm
eisais

Nuevo Miembro

The OTX Server Version: (3.7 . DEV) y es 10.98 ... gracias
Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...
function StdModule.promotePlayerr(cid, message, keywords, parameters, node)
local npcHandler = parameters.npcHandler
if npcHandler == nil then
error("StdModule.promotePlayerr called without any npcHandler instance.")
end
if not npcHandler:isFocused(cid) then
return false
end
local vocs = {
nonPromoted = {1, 2, 3, 4, 9, 16},
promoted = {11, 12, 13, 14, 15, 18},
setPromotion = {
[5] = 11, --------> promotion nomal 5 -----> tercera vocation 11
[6] = 12,
[7] = 13,
[8] = 14,
[10] = 15,
[17] = 18
}
}
local player = Player(cid)
if player:isPremium() or not parameters.premium then
local promotion = player:getVocation():getPromotion()
if isInArray(vocs.nonPromoted, vocId) then
npcHandler:say("usted necesita la primer promotion!", cid)
elseif player:getLevel() < parameters.level then
npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid)
elseif not player:removeMoney(parameters.cost) then
npcHandler:say("You do not have enough money!", cid)
else
npcHandler:say(parameters.text, cid)
player:setVocation(vocs.setPromotion[vocId])
player:setStorageValue(50001, 1)
end
else
npcHandler:say("You need a premium account in order to get promoted.", cid)
end
npcHandler:resetNpc(cid)
return true
end
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, 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})
local node2 = keywordHandler:addKeyword({'super'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayerr, {npcHandler = npcHandler, cost = 20000, level = 70, text = 'Congratulations! You are now promoted.'})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
npcHandler:addModule(FocusModule:new())
TibiaFace » Descargas de Otserv y Ayuda » Pedidos de Scripts » [Pedido] NPC para 3ra Promotion tfs 1.xx
Temas similares
Permisos de este foro:
No puedes responder a temas en este foro.
|
|