Hi!
I am trying to make a script for my OT that gives the killer Exp when he kills a player. Since the servers world type is set to PvP people are getting skulls when tey are PK-ing.
I have taken the formula from TibiaWiki - Quests, Items, Spells, and more but the script is not working:
a = victim's level * 1,1, rounded down
b = killer's level
c = victim's level
d = total experience of victim * 0,05, rounded down
e = round this number down to get your exp-gain
This is how it looks so far:
I will REP++ if i you help me!
I am trying to make a script for my OT that gives the killer Exp when he kills a player. Since the servers world type is set to PvP people are getting skulls when tey are PK-ing.
I have taken the formula from TibiaWiki - Quests, Items, Spells, and more but the script is not working:
a = victim's level * 1,1, rounded down
b = killer's level
c = victim's level
d = total experience of victim * 0,05, rounded down
e = round this number down to get your exp-gain
This is how it looks so far:
PHP:
function onDeath(cid, corpse, lastHitKiller, round)
local victim = getPlayerLevel(cid)
local k = getPlayerExperience(cid)
if(isPlayer(lastHitKiller) == TRUE) then
local killer = getPlayerLevel(lastHitKiller)
local a = (round and victim * 1.1)
local d = (round and k * 0.05)
local e = ((a - killer) / victim) * d
local gain = (round and e)
if gain < 0 then
doPlayerAddExperience(lastHitKiller, gain)
doSendMagicEffect(cidpos,12)
end
end
return TRUE
end
I will REP++ if i you help me!