platano
Active Member
Hello dear forum, I'm looking to create a simple script for an item or a NPC that allows me to INSERT into my PLAYERS table.
I was looking at the promotion.lua script of one of my NPCs is there anyway I can change the promotion value for HP / MP increase in exchange for gold?
So instead of promotion = 1, is there a way to increase their 'healthmax' and 'manamax' values using a NPC?
I was looking at the promotion.lua script of one of my NPCs is there anyway I can change the promotion value for HP / MP increase in exchange for gold?
Lua:
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 onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) 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())
So instead of promotion = 1, is there a way to increase their 'healthmax' and 'manamax' values using a NPC?