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

[mod] Exp By Hit

fortyy150

New Member
Joined
May 10, 2010
Messages
107
Reaction score
1
.-first open folder of you ot, and search this lines

experienceStages = false
rateExperience = 50

2.-experienceStages change to false
rateExperience change to 0

experienceStages = false
rateExperience = 0

3.-
open creaturescripts/scripts and create a file lua with name exphit.lua and paste this code
function CalculeExp(monsterhp, exptotal, hit)
local x = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0
local x2 = x - 20 + math.random(20)
return x2 > 0 and x2 or 0
end

function isSummon(uid)
return uid ~= getCreatureMaster(uid) or false
end

function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS then
if isMonster(cid) then
if isCreature(attacker) then
local sid = isSummon(attacker) == true and getCreatureMaster(attacker) or attacker
if isPlayer(sid) then
local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp, value)
doPlayerSendTextMessage(sid, 23, "You gain "..expg.." exp.")
doPlayerAddExp(sid, expg)
end
end
end
elseif type == STATSCHANGE_HEALTHGAIN then
return false
end
return true
end

function onCombat(cid, target)
if isMonster(target) and not isSummon(target) and not isPlayer(target) then
registerCreatureEvent(target, "ExpGain")
end
return true
end


open login from your folder creaturescripts/scripts/
and paste this

registerCreatureEvent(cid, "ExpHit")

now go to creaturescripts.xml and paste this
<event type="statschange" name="ExpGain" event="script" value="exphit.lua"/>
<event type="combat" name="ExpHit" event="script" value="exphit.lua"/>

to edit exp rate from hit open config.lua and past this
rateExp = 50

enjoy :D

PDT: nice script for ot war :) xd bye
 
bump...im curious too. If i hit harder than a noob who gets loot?
 
If someone have bugs change this:
Lua:
local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp, value)

On this:

Lua:
local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * 5, value)

RateExp in config 5 so there is 5.

Didin't work with rateExp, so enter there what rate you have on your server.
 
margoh did u tryed ? ( i dont )

rateExp = rateExp or 5
local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp, value)
 
Back
Top