• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

You don't get exp at level 100 until you make a quest / promotion. And Quest doors.

Tera

New Member
Joined
Jul 6, 2010
Messages
5
Reaction score
0
Hi, I need some things.

I need a script that makes that you don't get exp when you reach level 100 until you make a quest or until you get promotion (2 diferent scripts)

---

I need that you can only use the quest doors (the ones which have the red thing) until you make a quest (storage xxx > 0)

---

And is there any posibility of adding new items? I mean same sprite but 2 different items, like 2 mpa's one arm 17 and other arm 18?


I am using TFS 0.3.6pl1 and 8.54

Thanks.
 
First script
creaturescripts
LUA:
local queststorage = 1111
function onAdvance(cid, skill, oldlevel, newlevel)
if skill = SKILL_LEVEL and newlevel >= 100 and getPlayerStorageValue(cid, 9999) ~= 1 and getPlayerPromotionLevel(cid) == 0 then
doPlayerSetStorageValue(cid, 9999, 1)
doPlayerSetStorageValue(cid, queststorage, 1)
doPlayerSetExperienceRate(cid, 0.0)
end
end

and
LUA:
local queststorage = 1111
function onLogin(cid)
if getPlayerStorageValue(cid, queststorage) ~= 1 or getPlayerPromotionLevel(cid) == 0 then
doPlayerSetExperienceRate(cid, 0.0)
end
end

And the quest and promoter NPC must set this storage to 0 :P
 
Thanks for your reply but I am very new.

I put my promotion.lua code (inside npc folder)

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 40000 gold coins. Do you want me to promote you?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 40000, level = 60, 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 1000000 (1kk) gold coins. Do you want me to epicize you?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 1000000, level = 180, 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())

1º is quest and promotion? and where do I put the second?

and in creaturescript.xml what do I put?
 
Last edited:
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end

if msgcontains(msg, 'promotion') then
            talk_state = 1
            selfSay('Do you want to be promoted for 20k?')

    elseif msgcontains(msg, 'yes') and talk_state == 1 then
        if getPlayerPromotionLevel(cid) ~= 1 then
            if doPlayerRemoveMoney(cid, 20000) == TRUE then
            doPlayerSetPromotionLevel(cid, 1)
            doPlayerSetExperienceRate(cid, 1.0)
            doPlayerSetStorageValue(cid, 1111, 0)
            selfSay('Here u are.')
            else
            selfSay('You don\'t have enough money.')
            talk_state = 0
            end
        else
        selfSay('You are already promoted.')
        talk_state = 0
        end
    end

return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Thanks but can you tell me where I put the second script and what di I put on creaturescript.xml?

And can't it be more easy? For example

function onAdvance(cid, skill, oldlevel, newlevel)
if getPlayerLevel(cid) >= 50 and getPlayerPromotionLevel(cid) == 0 then
doPlayerSetExperienceRate(cid, 0.0)
end
end
 
@up

no.. because you your not declaring the param (skill).. just leave it how it was, also you requested you needed to also do a quest which the storage check was doing. if you don't know lua why try and suggest or edit the code?
 
Ok thanks, but can anybody tell me how to di it step by step?
Just the script that makes that you don't get exp until you get the first promotion. (or vocs 5,6,7,8)
 
First script
creaturescripts
LUA:
local queststorage = 1111
function onAdvance(cid, skill, oldlevel, newlevel)
if skill = SKILL_LEVEL and newlevel >= 100 and getPlayerStorageValue(cid, 9999) ~= 1 and getPlayerPromotionLevel(cid) == 0 then
doPlayerSetStorageValue(cid, 9999, 1)
doPlayerSetStorageValue(cid, queststorage, 1)
doPlayerSetExperienceRate(cid, 0.0)
end
end

and
LUA:
local queststorage = 1111
function onLogin(cid)
if getPlayerStorageValue(cid, queststorage) ~= 1 or getPlayerPromotionLevel(cid) == 0 then
doPlayerSetExperienceRate(cid, 0.0)
end
end

And the quest and promoter NPC must set this storage to 0 :P

Ok thanks, but can anybody tell me how to di it step by step?
Just the script that makes that you don't get exp until you get the first promotion. (or vocs 5,6,7,8)

...
 
... I put the first in data\creaturescripts\scripts (promo1)
Where do I put the second? (promo2)

And in creaturescripts.xml what do I put?


<event type="???" name="promo1" event="script" value="promo1.lua"/>

<event type="???" name="promo2" event="script" value="promo2.lua"/>
 
... I put the first in data\creaturescripts\scripts (promo1)
Where do I put the second? (promo2)

And in creaturescripts.xml what do I put?
Code:
<event type="advance" name="promo1" event="script" value="promo1.lua"/>  

<event type="login" name="promo2" event="script" value="promo2.lua"/>
and register it in login.lua

#JDB
I use doPlayerSetExperienceRate(cid, 0.0) in many scripts and it works fine :D
 
Back
Top