• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction !exp, !mana for TFS 1.0 - shows exp rate and stamina modifier!

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,327
Solutions
27
Reaction score
2,703
Location
Poland
Old school talkaction in new way!
23:54 You need 11719875 experience more, for 507 level.
23:54 Current rate: x18 (stamina bonus)

23:54 You need 403843 mana, for next magic level.

Do not post that script on other forums without my permission

Code:
  <talkaction words="!exp" script="expmana.lua"/>
   <talkaction words="!mana" script="expmana.lua"/>
Code:
function onSay(cid, words, param)
local p = Player(cid)
local s = function(p, lv)
       local k = Game.getExperienceStage(lv)
       local st = p:getStamina()
         if st > 2400 then
           return k*1.5 .. " (stamina bonus)"
         elseif st < 1 then
           return 0 .. " (out of stamina)"
         elseif st < 841 then
           return k*0.5 .. " (stamina penalty)"
         else
           return k
         end
       end

   if words == "!exp" then
     local lv = p:getLevel()
     p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You need " .. ((50 * lv^3) - (150 * lv^2) + (400 * lv)) / 3 - p:getExperience() .. " experience more, for " .. lv+1 .. " level.")
     p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current rate: x" .. s(p, lv))
     return false
   end
  p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to spend " .. math.ceil((Vocation(getPlayerVocation(cid)):getRequiredManaSpent(p:getBaseMagicLevel() + 1) - p:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC))  .. " mana more, for next magic level.")
return false
end
 
Last edited:
First to test?!???!?

Doesn't work properly. My experience stage is x 1 for over level 201 and my guy is 354 and his experience multiplier reads as x27. Doesn't pull the number from config (which ultimately it would need to anyways if it were going to work properly if stages are disabled.), and it Doesn't even read same for players under same conditons, 201+ level and full stamina, two different multipliers, x6 for my GM level 1337. So I looked at code to see where it was pulling such numbers.... I believe the problem is here:

local s = function(p, lv)

Idk anyone got the fix?
 
Using it, works great, thank you.
Oldschool is Always nice ;)

Kind Regards,
Eldin.
 
Back
Top