• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.X+ RateMagic not working on tfs 1.4.2

Berciq

Veteran OT User
Joined
Aug 7, 2018
Messages
336
Reaction score
398
Location
Poland
Hey, I moved from tfs 1.3 to 1.4.2 and my magic rate from config.lua doesn't work, regardless to its value:

rateExp = 1
rateSkill = 5
rateLoot = 2
rateMagic = 5
rateSpawn = 1

rate skills works perfectily, but magic works like x1
I have in vocations.xml for example for no vocation manamultiplier="3.0":

<vocation id="0" clientid="0" name="None" description="none" gaincap="20" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="3.0" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="0">
<formula meleeDamage="1.1" distDamage="1.1" defense="1.1" armor="1.1" />
<skill id="0" multiplier="1.5" /> <!-- Fist -->
<skill id="1" multiplier="2.0" /> <!-- Club -->
<skill id="2" multiplier="2.0" /> <!-- Sword -->
<skill id="3" multiplier="2.0" /> <!-- Axe -->
<skill id="4" multiplier="2.0" /> <!-- Dist -->
<skill id="5" multiplier="1.5" /> <!-- Shield -->
<skill id="6" multiplier="1.1" /> <!-- Fish -->

So i'm expecting required mana from level 0 to level 1 as in normal tibia 400 mana spent,
then from level 1 to level 2 it shoukld require 400*3.0 = 1200 mana spent etc. and it works, it requires this exact amount of mana spent... but...

but on tfs 1.3 when i set rateMagic to 5 spending 10 mana was treated like spending 5x more so 50 mana
I want it to work same on tfs 1.4.2 and i'm surprised it doesn't work like this when it probably should.

Do you have any idea what file I could skip when moving, or accidentaly exchanged on the old one?
compat.lua? player.lua? chat says i should change sth in source and recompile but don't tell me you all had to do this because for noone rate magic didn't work... i'd rather believe i messed sth up while moving.
 
Maybe u have magic rate in stages if you have file stages.xml idk first thought. Search for restriction files in global or xml format.
 
I had previously stages.xml and there i just had experience stages:

<?xml version="1.0" encoding="UTF-8"?>
<stages>
<config enabled="1" />
<stage minlevel="1" maxlevel="1" multiplier="1" />
<stage minlevel="2" maxlevel="2" multiplier="2" />
<stage minlevel="3" maxlevel="200" multiplier="3" />
<stage minlevel="201" multiplier="1" />
</stages>


but in 1.4.2 i had to move them to config.lua and disable this file so now it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<stages>
<config enabled="0" />
</stages>

I'm afraid it is not this stages.xml, I tried to search in files which one uses doPlayerAddManaSpent but it last like forever
Post automatically merged:

No way.... Rate magic works... i just messed around with it and found what is causing the problem:

base mana spend needed from 0 to 1 magic level should be 400
i had magic rate x4 so i thought i need just 100 mana... and then it turned out is is going as normal and i had to use 400 mana...
so i thought rate magic don't work...
but i changed it to 1 and it turns out that it worked... It is just that from level 0 to level 1 it requires 1600 mana...
with x4 rate magic 4x400 mana=1600 mana spent that is why it was hidden...

so almost solved: why on Earth my base manaspent required from level 0 to level 1 is 1600 and not 400 and where to change this?
 
Last edited:
I think I can just walkaround giving rate magic 4xhigher and noone will know so if i want rate magic x5 i would make rate x20,

but why it requires 1600 mana rather than 400 in first place?
 
I think I can just walkaround giving rate magic 4xhigher and noone will know so if i want rate magic x5 i would make rate x20,

but why it requires 1600 mana rather than 400 in first place?
forgottenserver/src/vocation.cpp at 5b3b0d7460f377a599d5d7df6627e3a1c9fc7e46 · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/5b3b0d7460f377a599d5d7df6627e3a1c9fc7e46/src/vocation.cpp#L155)

The value you are looking for is here for the latest TFS (1.6?), but it should be the same for you in 1.42 also
Edit: the commit changing from 400 to 1600 is here:
Correcting magic level mana spent calculation (#2581) · otland/forgottenserver@4f2e55a (https://github.com/otland/forgottenserver/commit/4f2e55a54725b5c47fe1a1bede51190bcd0b97cf)
 
Last edited:
Back
Top