• 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!

TalkAction Second Promotion

Status
Not open for further replies.

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Solutions
2
Reaction score
115
I updated this script, I don't remember where I got it from.
I had updated it and tested to make sure it works properly.


Tested and works 100%

Config.lua:
Lua:
premiumForPromotion = "no"

Script:
Lua:
function onSay(cid, words, param, channel)
local cfg = { level = 100, vocs = { 5, 6, 7, 8 }, storage = 45231, cost = 100000, msgtype = MESSAGE_STATUS_CONSOLE_BLUE }
    if getPlayerStorageValue(cid, cfg.storage) == -1 then
        if getPlayerLevel(cid) >= cfg.level then
            if isInArray(cfg.vocs, getPlayerVocation(cid)) == true then
                if (getPlayerMoney(cid) >= cfg.cost) then
		    doPlayerRemoveMoney(cid, cfg.cost)
                    setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1)
                    doPlayerSendTextMessage(cid, cfg.msgtype, "You have been promoted to ".. getVocationInfo(getPlayerVocation(cid)).name ..".")
                    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
                    setPlayerStorageValue(cid, cfg.storage, 1)
                else
                    doPlayerSendTextMessage(cid, cfg.msgtype, "You need ".. cfg.cost .." gold coins to purchase the second promotion.")
                end
            else
                doPlayerSendTextMessage(cid, cfg.msgtype, "Only players with first promotion may get the second promotion.")
            end
        else
            doPlayerSendTextMessage(cid, cfg.msgtype, "Only characters of level ".. cfg.level .." or above, may purchase the second promotion.")
        end
    else
        doPlayerSendTextMessage(cid, cfg.msgtype, "You have already purchased the second promotion.")
    end
    return true
end
 
Last edited:
Thanks for all the comments, glad to release it :cool:
 
PHP:
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 10000 gold coins. Do you want me to promote you?'})
  node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 10000, 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 100000 gold coins. Do you want me to epicize you?'})
  node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 100000, level = 100, 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())

I don't really make NPCs...
 
Thanks for comments :thumbup:
 
Bump: :thumbup:
 
No. Again i am this one who is finding Bug. In TFS 0,3+ No longer works addvocation+4. If u log out then you will be again that u were before u type this promotion. To make it works you should use function to Add Player Promotion At level 2. ( 1 lvl = ms,ed, rp and ek.)
 
:D :D :D Whats the point XD! Just go to npcs and say:
Player:Hi
Npcs:Hello player,blablablabla
Player:Buy promotion
Npcs:You are now promoted *****
 
Fixed and Working.
Tested it myself.


Thanks Quas. :thumbup: Rep++
 
Bump :thumbup:
 
this is not working for me i added this into talkactions/scripts
than added line in talkactions.xml
<talkaction words="!slayer" event="script" value="slayervoc.lua"/>

nothing happens.. :( been trying for hours to get it to work I got evolution 8.5
 
edit i took the npc promotion in the thread it works when saying epic but that will only change your promotion id to 2 and then somehow your voc gets changed automaticly to 0 not to 9 or 10 or 11 or 12 the slayer vocs.
When I tried give manually voc 10 (slayer sorcerer) to a guy in my server it said something about cannot find voc 46594859376 many numbers.
And server got real laggy and i had to restart.
please help
 
It works on 0.3.4
 
Status
Not open for further replies.

Similar threads

Back
Top