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

Some scripts need to be add

Adiko

GetOnMyHorse
Joined
Apr 25, 2009
Messages
177
Reaction score
0
Location
Poland \ Wodzisław
Hi. I need add to this script that every 4th second reloads 30% of mana and when mana gets full it casting spell that uses full mana.

Here is script"
PHP:
-- Square Skill Trainer made by Arthur aka artofwork
-- This script will train all of a players skills indefintely
-- It has a small configuration setup where you can set the number of tries per skill
-- The time internveral in between each skill try added
-- A storage value to help prevent abuse
-- This is truely my first script, it comes without support since lua is new to me
-- You can assign any tile you wish to this script that a player can walk on with action id 900


-- Config --
local storage = 18010 -- Storage value for the player when he steps on and off the tile

local skilltries = 1 -- Number of tries per skill
local t = 4 * 1000 -- Set the time before try is added to skills

-------------------------------------------------------------------------
function trainerthree(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 30 seconds")
addEvent(trainertwo, 10 * 1000, p)
end
end
return FALSE
end
function trainertwo(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 20 seconds")
addEvent(trainerone, 10 * 1000, p)
end
end
return FALSE
end
function trainerone(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will begin in 10 seconds")
addEvent(readyToTrain, 10 * 1000, p)
end
end
return FALSE
end



function readyToTrain(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
doPlayerSendTextMessage(p.cid,22,"Your training session will now begin")
addEvent(trainMeA, t, p)
end
end
return FALSE
end


function trainMeA(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then

for a = 1, t do
if(a == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)
end
end
end
addEvent(trainMeB, t, p)
end
return FALSE
end

function trainMeB(p)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
for b = 1, t do
if(b == t) then
doPlayerAddSkillTry(p.cid, SKILL_FIST, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_CLUB, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SWORD, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_AXE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_DISTANCE, skilltries)
doPlayerAddSkillTry(p.cid, SKILL_SHIELD, skilltries)

end
end
end
addEvent(trainMeA, t, p)
end
return FALSE
end



function onStepIn(cid, item)
local p = {cid = cid, item = item, pos = pos}
setPlayerStorageValue(p.cid, 18010, 1)
if isPlayer(p.cid) and getPlayerStorageValue(p.cid, 18010) == 1 then
if p.item.actionid == 900 then
addEvent(trainerthree, 1 * 1000, p)
end
end
return FALSE
end


function onStepOut(cid, item)
getPlayerStorageValue(cid, 18010)
setPlayerStorageValue(cid, 18010, 0)
doPlayerSendTextMessage(cid,22,"Your training session has now ended")
end
 
u have to create a global event that executes every 4th second...

OBS: This mabye wont work... this is just an example of how it would look like. Some other scripter can fix better if it wont work.

XXXX.lua
Code:
local config = {
manapercent = 30,
storageid = 18010,
}

function onThink(interval, lastExecution)
local maxmana = getCreatureMaxMana(cid)
  if isPlayer(cid) and getPlayerStorageValue(cid, storageid) == 1 then
    doCreatureAddMana(cid, maxmana / 100 * config.manapercent)
  end
  return TRUE
end

Code:
<globalevent name="trainer" interval="4" event="script" value="[B][COLOR="Red"][U]XXXX.lua[/U][/COLOR][/B]"/>
 
Back
Top