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

TFS 0.4 Sharing equally the EXP gained from players based on overall % dmg done

thief

Member
Joined
Sep 23, 2008
Messages
342
Reaction score
16
Location
Canada
Hello, I've been testing so many different scripts and trying to figure this out but its not happening.

All these scripts released either gives EXP to the player who takes the last hit or shares exp to everyone equally even if you did 10dmg only.

i want a script that if I do 30% of dmg and my buddy does 70% of the dmg he gets more experience then me.
 
Lua:
onKill(cid, target, damage, flags)
You could use damage to figure out how much experience to give each player, but if the monster has healing.. then their damage might be higher then expected.

Here's some pseudo code to give you an idea how this might work.
Lua:
(monster_max_experience / monster_max_life) * player_damage = experience_to_give
if experience_to_give > monster_max_experience then
    experience_to_give = monster_max_experience
end
Code:
(300 / 1000) * 200 = 60
(300 / 1000) * 800 = 240

(8000 / 1000) * 200 = 1600
(8000 / 1000) * 800 = 6400
 
Last edited:
Back
Top