Codex NG
Recurrent Flamer
- Joined
- Jul 24, 2015
- Messages
- 2,994
- Solutions
- 12
- Reaction score
- 1,657
I didn't write this script all I did was update it to the latest sources on github, I'll post it here in sections as it is really big
Credits & Instructions
Credits & Instructions
Code:
--[[
Square Skill Trainer made by Arthur aka artofwork 12/1/14
Updated 8/29/2015, to 1.2? based on tfs sources on github by Codex NG :)
This script will train all of a players skills indefintely including magic level
It has a small configuration setup where you can set the number of tries per skill
The time interval in between each skill try added
A storage value to help prevent abuse
You can assign any tile you wish to this script that a player can walk on with action id 900
Added a time check based on how much soul they have left
New in this script?
skill tries for both free account & premium accounts
mana gain for both free & premium accounts
mana multipliers to effect magic level for both free and premium accounts
experience gain for both free and prem accounts
Added tile trainer exhaust, added optional all skills for free accounts or just the weapons & shield they have equiped
add this too movements
<!-- Square Trainer -->
<movevent event="StepIn" actionid="900" script="squaretrainer.lua"/>
<movevent event="StepOut" actionid="900" script="squaretrainer.lua"/>
save this file in data\movements\script\ as squaretrainer.lua
add this to login.lua inside of onLogin(cid)
player:setStorageValue(18010, 0) -- when they login it will reset / set the storage values
player:setStorageValue(18009, 0)
]]--
Code:
local currentTime = os.time()
local day = 86400 -- 1 full day in seconds
local minimumTime = 0 -- minimum time for vip
local exhaust = 3 -- exhaust in seconds from using trainer
local special = true -- true for vip false for prem
local removeSoul = false -- remove soul from free account
local soul = 1 -- soul to take per minute
local removeSoul = false -- do you want to remove soul from the free accounts forcing them to go out and hunt or let them afk train like prem
local amount = 0 -- amount of soul to take from player per minute
local bonus = special and "VIP" or "premium"
local addSkillTimer = 1000 -- time at which skill tries are added
local skills = 5 -- 0 to 5 includes 0:fist, 1:club, 2:sword, 3:axe, 4:distance, 5:shield -- do not edit
local allskills = false -- should free accounts train all their skills
local useConfigMlRate = false -- do you want to use the config settings rate of Magic in this script
local useConfigExpRate = false -- do you want to use the config settings rate of Exp in this script
local useConfigSkillRate = false -- do you want to use the config settings rate of Skills in this script
local addskills =
{
prem = 1000, -- xp to add as vip/prem (depends if special is true) account per interval
manaGainPrem = 1200, -- mana to add as vip/prem (depends if special is true) account per interval
premSkillTries = 100, -- Number of tries per skill for vip/prem (depends if special is true) account per interval
premManaMultiplier = 5, -- when player has full mana multiply how much more mana is used to gain magic level
free = 100,
manaGainFree = 600, -- mana to add as free account per interval
freeSkillTries = 10, -- Number of tries per skill for free account
freeManaMultiplier = 1, -- when player has full mana multiply how much more mana is used to gain magic level
balanceShield = 3 -- 3 is good, but if shielding goes up too quick then lower it, use only whole numbers e.g. 1, 2, 3
}
local weaponTypes = {
{ 1, 2 }, -- Sword
{ 2, 1 }, -- Club
{ 3, 3 }, -- Axe
{ 4, 5 }, -- Shield
{ 5, 4 } -- Distance
}
function soulCheck(p)
local msg = ""
local hour = math.floor(p.soul / 60)
local minutes = p.soul % 60
if isSpecial(p.player) then
msg = ", As a "..bonus.." player you will start training right away! :D "
else
if removeSoul then
if(p.soul > 120) then
msg = ", you have enough soul points to train for "..hour.." hours and "..minutes.." minutes"
elseif(p.soul == 120) then
msg = ", you have enough soul points to train for "..hour.." hours."
elseif(p.soul > 60 and p.soul < 120) then
msg = ", you have enough soul points to train for "..hour.." hour and "..minutes.." minutes"
elseif(p.soul == 60) then
msg = ", you have enough soul points to train for "..hour.." hour."
else
msg = ", you have enough soul points to train for "..minutes.." minutes"
end
else
msg = ", If you were a "..bonus.." player you wouldn't have to wait to train."
end
end
p.player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, p.name..msg)
end
-- this function is only effected by free accounts
function templeTeleport(p)
local player = p.player
local temple = player:getTown():getTemplePosition()
if player:isPlayer() then
player:setStorageValue( 18010, 0)
Position(p.pos):sendMagicEffect(CONST_ME_TELEPORT)
player:teleportTo(temple)
Position(temple):sendMagicEffect(CONST_ME_ENERGYAREA)
else
player:sendCancelMessage(p.name..", You dont have the access to do this.")
end
end
-- this function is only effected by free accounts
function takeSoulPoints(p)
local player = p.player
if(player:getSoul() > amount) then
player:addSoul(-p.soul)
p.seconds = 60000 -- reset the timer
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Sorry "..(p.name)..", You not have enough soul points to train.")
addEvent(templeTeleport, 1, p)
end
end