function onLogin(cid)
if getPlayerVocation(cid) < 5 then
doPlayerSendTextMessage(cid,22,"You are now promoted, Congratulations!")
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
end
end
<event type="login" name="PromotionLogin" script="promotionlogin.lua"/>
registerCreatureEvent(cid, "PromotionLogin")
-- Blessings
blessingOnlyPremium = true
blessingReductionBase = 30
blessingReductionDecreament = 5
eachBlessReduction = 10
function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 100000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 10 crystal coin to get blessed!")
end
end
return 1
end
<talkaction words="!bless" event="script" value="bless.lua"/>
local bless = {1, 2, 3, 4, 5}
local cost = 0
function onLogin(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already all blessings.")
return TRUE
end
end
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "You are now blessed!" ,19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "You don't have enough money.")
end
return TRUE
end
<event type="login" name="BlessLogin" script="blesslogin.lua"/>
registerCreatureEvent(cid, "BlessLogin")
local config = {
promotion = 1, -- promotion level, default = 1 . Ignore if you don't have new vocations.
minLevel = 1, -- Level needed to buy promotion
cost = 0, -- Promotion cost in gp
premium = "no" -- is premium needed to buy promotion?
}
local disabledVocations = {0}
config.premium = getBooleanFromString(config.premium)
function onLogin(cid, words, param)
if(isInArray(disabledVocations, getPlayerVocation(cid)) == TRUE) then
doPlayerSendCancel(cid, "Your vocation cannot gain promotion.")
elseif(config.premium == TRUE and isPremium(cid) == FALSE) then
doPlayerSendCancel(cid, "You need a premium account.")
elseif(getPlayerPromotionLevel(cid) >= config.promotion) then
doPlayerSendCancel(cid, "You are already promoted.")
elseif(getPlayerLevel(cid) < config.minLevel) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need " .. config.minLevel .. " to get promotion.")
elseif(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have enought money! (Promotion cost " .. config.cost .. " gp.")
else
setPlayerPromotionLevel(cid, config.promotion)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
end
return TRUE
end
<event type="login" name="PromotionLogin" script="promotionlogin.lua"/>
registerCreatureEvent(cid, "PromotionLogin")
unction onLogin(cid)
local freePromotion = getConfigInfo('premiumForPromotion')
if freePromotion == "NO" and getPlayerStorageValue(cid, 43545) == -1 then
setPlayerPromotionLevel(cid, 1)
setPlayerStorageValue(cid, 43545, 1)
end
return TRUE
end
<event type="login" name="PromotionLogin" script="promotionlogin.lua"/>
registerCreatureEvent(cid, "PromotionLogin")
umm client 8.7? so you mean Mystic Spirit 0.2.9?