:ninja:Another simple script. For those who prefer to give the promo in an unusual way...
(> Author: Cybermaster
(> Revised by: Shawak
(> Scripted in: TFS 0.3.6pl1
FEATURES
~Adds the vocation promotion to the player when he first reaches the configured level.
~Displays a configurable message with the new vocation name.
~Amazing effects when obtaining the new vocation(worth to see it!)
~Restores the player's health and mana when he gets the promotion.
~Saves the character's data too.
~May be useful for War ot's, I guess...
SETUP
1) Create the file "advpromo.lua" at data/creaturescripts/scripts
(> [ "advpromo.lua" ]
2) Add this line to data/creaturescripts/creaturescripts.xml
3) Add this line to data/creaturescripts/scripts/login.lua
Enjoy! Please report bugs and other issues.
You may Rep++ [
] me in exchange.eace:
(> Author: Cybermaster
(> Revised by: Shawak
(> Scripted in: TFS 0.3.6pl1
FEATURES
~Adds the vocation promotion to the player when he first reaches the configured level.
~Displays a configurable message with the new vocation name.
~Amazing effects when obtaining the new vocation(worth to see it!)
~Restores the player's health and mana when he gets the promotion.
~Saves the character's data too.
~May be useful for War ot's, I guess...
SETUP
1) Create the file "advpromo.lua" at data/creaturescripts/scripts
(> [ "advpromo.lua" ]
Lua:
--[[
Promotion_OnAdvance
|-------------------|
(> Author: Cybermaster
(> Revised by: Shawak
(> Scripted in: TFS 0.3.6pl1
(> [url=http://www.otland.net]OtLand[/url]
--]]
function onAdvance(cid, skill, oldLevel, newLevel)
local _SETUP = {
level = 30, --level where the player will obtain the promotion when he reaches it
type = MESSAGE_STATUS_CONSOLE_ORANGE, --the message class
text = "You have just been promoted to " .. getPlayerVocationName(cid) .."!",
effect = 37 --the effect for the leveling up animation
}
if skill == SKILL__LEVEL and newLevel < _SETUP.level then
return true
end
if getPlayerPromotionLevel(cid) ~= 0 then
return true
end
local p = getPlayerPosition(cid)
local positions = {
{ pos= {x=p.x+1,y=p.y,z=p.z}, delay = 100, delay2 = 900},
{ pos= {x=p.x+1,y=p.y+1,z=p.z}, delay = 200, delay2 = 980},
{ pos= {x=p.x,y=p.y+1,z=p.z}, delay = 300, delay2 = 1060},
{ pos= {x=p.x-1,y=p.y+1,z=p.z}, delay = 400, delay2 = 1140},
{ pos= {x=p.x-1,y=p.y,z=p.z}, delay = 500, delay2 = 1220},
{ pos= {x=p.x-1,y=p.y-1,z=p.z}, delay = 600, delay2 = 1300},
{ pos= {x=p.x,y=p.y-1,z=p.z}, delay = 700, delay2 = 1380},
{ pos= {x=p.x+1,y=p.y-1,z=p.z}, delay = 800, delay2 = 1460}
}
for i = 1, 8 do
addEvent(doSendDistanceShoot, positions[i].delay, positions[i].pos, p, _SETUP.effect)
addEvent(doSendDistanceShoot, positions[i].delay2, positions[i].pos, p, _SETUP.effect)
end
addEvent(doSendMagicEffect, 900, p, 49)
setPlayerPromotionLevel(cid, 1)
doPlayerSendTextMessage(cid, _SETUP.type, _SETUP.text)
doSendAnimatedText(p, "Promoted!", math.random(1,255))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doPlayerSave(cid, true)
return true
end
2) Add this line to data/creaturescripts/creaturescripts.xml
Lua:
<event type="advance" name="Promo" script="advpromo.lua"/>
3) Add this line to data/creaturescripts/scripts/login.lua
Lua:
registerCreatureEvent(cid, "Promo")
Enjoy! Please report bugs and other issues.
You may Rep++ [
Last edited: