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 ascension(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerLevel(cid) >= 150 and getPlayerPromotionLevel(cid) == 2 then
npcHandler:say('LET THE GODS SACRIFICE THIS SOUL SO THAT HE MAY BE REBORN!', cid)
doCreatureAddHealth(cid, -(getCreatureHealth(cid))) --kills the player
db.executeQuery("UPDATE `empire`.`players` SET `experience` = '4200' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT
1;")
db.executeQuery("UPDATE `empire`.`players` SET `level` = '8' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT 1;")
db.executeQuery("UPDATE `empire`.`players` SET `healthmax` = '185' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT
1;")
db.executeQuery("UPDATE `empire`.`players` SET `maglevel` = '10' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT 1;")
db.executeQuery("UPDATE `empire`.`players` SET `health` = '185' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT 1;")
db.executeQuery("UPDATE `empire`.`players` SET `mana` = '35' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT 1;")
db.executeQuery("UPDATE `empire`.`players` SET `manamax` = '35' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT 1;")
db.executeQuery("UPDATE `empire`.`players` SET `manaspent` = '0' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT 1;")
db.executeQuery("UPDATE `empire`.`players` SET `cap` = '385' WHERE `players`.`name` = '" .. getPlayerName(cid) .. "' LIMIT 1;")
doTeleportThing(cid, {x=1018, y=1023, z=7})
doPlayerPopupFYI(cid, 'You have Ascended! Your level has been sacrificed in return for this godly status.')
doPlayerSetPromotionLevel(cid, 2)
else
npcHandler:say('You need level 150 and first Promotion to ascend!', cid)
end
end
keywordHandler:addKeyword({'ascension'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "The process of {ascend}
ing is a very spiritual practice where by your level is sacrificed, along with your life in order to be reborn a new soul with a
higher understanding of your chosen vocation, be it magic, combat or a mixture of both."})
local node1 = keywordHandler:addKeyword({'ascend'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you really
want to ascend? There is no turning back once you say {yes}. Please think about this before you do.'})
node1:addChildKeyword({'yes'}, ascension, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'This is your choice, if you
ever change your mind, do not hesitate to return.', reset = true})
npcHandler:addModule(FocusModule:new())