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

RevScripts mana training square (otservbr)

CamMista

New Member
Joined
Dec 1, 2021
Messages
11
Reaction score
4
Looking for a movement script to assign x mana to player every x seconds standing on a specific location.
I havnt been able to find anything that works when searching. Any help with be appreciated :)
 
I had a classic system that was for training before that did that function that you asked for but I'm not sure if it can help you since you haven't said what version of TFS or what version of OTX do you need, but you can take this system and modify it To your liking I hope I have helped you here this system was lost a long time ago.

In movements.xml
<movevent type="StepIn" actionid="900" script="Trainers VIP.lua"/>
<movevent type="StepOut" actionid="900" script="Trainers VIP.lua"/>

Trainers VIP.lua
-- Config by the administration catlina --
local skillTries = 10 -- Number of tries per skill
local t = 4 * 1000 -- Set the time before try is added to skills
local lock = 10 -- Time to wait before start again in seconds

-- Weapon Types --
local weaponTypes = {
{ 1, 2 }, -- Sword
{ 2, 1 }, -- Club
{ 3, 3 }, -- Axe
{ 4, 5 }, -- Shield
{ 5, 4 } -- Distance
}

function onStepIn(cid, item, pos, fromPos)
local p = {cid = cid, item = item, pos = pos}
if getPlayerStorageValue(p.cid, 18010) == 2 then
doTeleportThing(p.cid, fromPos, TRUE)
doPlayerSendTextMessage(p.cid,22,"You must wait "..lock.." seconds before you start again")
return false
end
setPlayerStorageValue(p.cid, 18010, 1)
if isPlayer(p.cid) and p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
addEvent(trainMe, t, p)
end
return true
end
function onStepOut(cid, item)
if getPlayerStorageValue(cid, 18010) == 2 then
return false
end
setPlayerStorageValue(cid, 18010, 2)
addEvent(trainLock, lock * 1000, cid)
doPlayerSendTextMessage(cid,22,"Your training session has now ended")
return true
end
function trainLock (cid)
if isPlayer(cid) then
setPlayerStorageValue(cid, 18010, 0)
end
end
function trainMe(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 and p.item.actionid == 900 then
local weaponLeft = getPlayerSlotItem(p.cid, CONST_SLOT_LEFT)
local weaponRight = getPlayerSlotItem(p.cid, CONST_SLOT_RIGHT)
if weaponLeft.itemid ~= 0 then
weaponLeft = getItemWeaponType(weaponLeft.uid)
end
if weaponRight.itemid ~= 0 then
weaponRight = getItemWeaponType(weaponRight.uid)
end
for _, t in pairs(weaponTypes) do
if t[1] == weaponLeft or t[1] == weaponRight then
doPlayerAddSkillTry(p.cid, t[2], skillTries)
end
end
manaspent = getPlayerMana(p.cid)
doPlayerAddSpentMana(p.cid, manaspent)
doTargetCombatMana(0, p.cid, -manaspent, -manaspent, CONST_ME_NONE)

doSendMagicEffect(getPlayerPosition(p.cid),34)

addEvent(trainMe, t, p)
end
return true
end
 
Back
Top