kito2
www.masteria.net
Hello everyone,
I am working currently at a loyalty system same as CipSoft (http://tibia.wikia.com/wiki/Loyalty_System). This system consist about you getting "loyalty days" for each day that you have been premium and will keep adding as you are premium. This system add a bonus on your base skills, also a tittle. I have done this part so far. But I got some problems adding this base bonus.
What I know: I have reading TFS 1.2 compat.lua script and found this
Lets asume we already have the variable "bonus" with the respective percent according to your "loyalty days".
So basically it should be (for skillId 1 - I don't even remember which skill this was hahah):
Would this be sufficient to be added at login.lua and "bypass" any trouble with offline trainer?
PD: Asking cause has been out of OTs for some years and I feel rusty.
I am working currently at a loyalty system same as CipSoft (http://tibia.wikia.com/wiki/Loyalty_System). This system consist about you getting "loyalty days" for each day that you have been premium and will keep adding as you are premium. This system add a bonus on your base skills, also a tittle. I have done this part so far. But I got some problems adding this base bonus.
What I know: I have reading TFS 1.2 compat.lua script and found this
Code:
function doPlayerAddSkillTry(cid, skillid, n) local p = Player(cid) return p ~= nil and p:addSkillTries(skillid, n * configManager.getNumber(configKeys.RATE_SKILL)) or false end
Lets asume we already have the variable "bonus" with the respective percent according to your "loyalty days".
So basically it should be (for skillId 1 - I don't even remember which skill this was hahah):
Code:
...
local bonus = 1.05
local formula = getPlayerSkill(cid, 1)*bonus
doPlayerAddSkillTry(player,1,formula)
...
Would this be sufficient to be added at login.lua and "bypass" any trouble with offline trainer?
PD: Asking cause has been out of OTs for some years and I feel rusty.