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

Looking for RPG monster Expiernce.

unicodem

New Member
Joined
Dec 18, 2011
Messages
48
Reaction score
1
Looking for a script or code where the monsters give less exp as we have a higher level than them.
e.g.
We have 100 lvl, a monster has 90lvl then get 25% exp for him.
 
Looking for a script or code where the monsters give less exp as we have a higher level than them.
e.g.
We have 100 lvl, a monster has 90lvl then get 25% exp for him.

Do your monsters already have levels? or do you want us to create that too?

You could just do an onDeath script

Code:
local lowLevelBonus = 2 --How much more exp you will get for being a low-level killing a high-level monster
local highLevelNerf = 0.5 --How much less exp you will get for being a high-level killing a low-level monster

local monsterLevel = {
["Rat"] = {minlevel = 5, exp = 5, maxlevel = 10},
["Rotworm"] = {minlevel = 10, exp = 30, maxLevel = 20},
["Dragon"] = {minlevel = 30, exp = 700, maxLevel = 60},
}

function onDeath(cid, corpse, deathList)
local name = getCreatureName(cid)
local list = monsterLevel[name]
local exp = 0
if list then
  if #deathList > 0 then
   for _, tid in ipairs(deathList) do
    if isPlayer(tid) then
     local level = getPlayerLevel(tid)
     if level < list.minlevel then
      doPlayerAddExperience(cid, list.exp*lowLevelBonus)
     elseif level > list.maxlevel then
      doPlayerAddExperience(cid, list.exp*highLevelNerf)
     else
      doPlayerAddExperience(cid, list.exp)
     end
    end
   end
  end
end
return true
end

Warning: I didn't test, or double-check this script, it is an example of one way you can do it, and not only that, it doesn't split the EXP using damage done like it should because I couldn't be bothered. Also I don't know if it would even work with the way I used deathList.

Again this is an example of how you could do it.
 
Thank you for the script but doesnt work with stage exp.
you would be able to do it in cpp? My source files 0.3.6 TFS 8.54
example :
when in monster file have a line :
<level min="50" max="100"/>
And as we have 50-100 level then we get about 25% less exp, and when we have above 100 level then we have 50% less exp.

Could you create something like this?

If not, and so thank you for taking the time to my post.
 
Back
Top