• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

loosing promotion!

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
 
local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be promoted in your vocation for 20000 gold?'})
	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})
 
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
	node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
 
 
npcHandler:addModule(FocusModule:new())
 
Last edited by a moderator:
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
 
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})
--[[
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
	node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
]]--
 
npcHandler:addModule(FocusModule:new())
 
still loose promotion whan i loggout and inn :/ please help . rep++
i even tryed to change it on phpmyadmin. i logged on i had promotion. but i logged out i loose it . why
-Oddis
 
Lua:
local config = {
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	
local text = "- Welcome to AnnihilonOT, here's a list of commands:\n!aol               -> Buy an amulet of loss\n!bless             -> Get blessed by the Gods\n!exp             -> Experience for next level\n!spells            -> List of spells available\n!kills             -> See your current frags\n!explorer             -> Buy a bp with shovel, pick, rope for 500gps\nCtrl+R             -> Report bugs to staff\n- Visit our webpage for a complete list of commands.\n//AnnihilonOT Staff"
local useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
local loss = getConfigValue('deathLostPercent')

	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local lastLogin = getPlayerLastLoginSaved(cid)
	if(lastLogin > 0) then
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, text)
	else
		doPlayerSendOutfitWindow(cid)
	end
    
	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end
	registerCreatureEvent(cid, "inquisitionPortals")
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "ArenaKill")
	registerCreatureEvent(cid, "reward")
	registerCreatureEvent(cid, "PythiusTheRotten")
	registerCreatureEvent(cid, "levelUp")
	registerCreatureEvent(cid, "forever amulet")
    registerCreatureEvent(cid, "charge amulet")
    registerCreatureEvent(cid, "VipCheck")
    --registerCreatureEvent(cid, "vipLook")--
	
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena  
	return true
end
 
Last edited by a moderator:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
	
	<!-- Amulet -->
	<event type="preparedeath" name="forever amulet" event="script" value="forever amulet.lua"/>
	<event type="preparedeath" name="charge amulet" event="script" value="charge amulet.lua"/>
	
	<!-- Inquisition Full Quest -->
	<event type="kill" name="inquisitionPortals" script="Inquisition.lua"/>
	
	<!-- Custom Scripts-->
    <event type="login" name="Welcome" script="welcome.lua"/>
	<event type="advance" name="reward" event="script" value="reward45.lua"/>
	<event type="advance" name="levelUp" event="script" value="levelUp.lua"/>
	<event type="login" name="VipCheck" event="script" value="vipcheck.lua"/>
	<!--<event type="look" name="vipLook" event="script" value="lookvip.lua"/>-->
	
	<!-- Quests-->
	<event type="logout" name="demonOakLogout" event="script" value="demonOakLogout.lua"/>
	<event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/>
	<event type="kill" name="ArenaKill" event="script" value="arenakill.lua"/>
	<event type="death" name="PythiusTheRotten" event="script" value="PythiusTheRotten.lua"/>
</creaturescripts>

- - - Updated - - -

hmm i dont know how to make it in tags:p
 
Last edited by a moderator:
Please post your
Code:
login.lua
welcome.lua
vipcheck.lua
demonOakLogout.lua
from your data>creaturescripts>scripts folder
 
Back
Top