Hey friends can anyone tell me how to add extra exp for vip players
I want 20 % more exp
But with the script below is not successful , the system of the msg but I have 20 % but not to kill the monster and added 20%
creaturescripts.xml adcione a tag:
creaturescripts/scripts/login.lua:
I want 20 % more exp
But with the script below is not successful , the system of the msg but I have 20 % but not to kill the monster and added 20%
Code:
local rate = 20 --- porcentagem que irá ganhar a mais.
function onKill(cid, target, lastHit)
if hasVip(cid) == true then
local monster = Monster(target)
if not monster then
return true
end
for id, damage in pairs(monster:getDamageMap()) do
local player = Player(id)
if player then
local experience = damage.total / monster:getType():getHealth() * monster:getType():getExperience()
local expFormula = (((experience * Game.getExperienceStage(player:getLevel())) / 100) * rate)
player:addExperience(math.floor(expFormula), true)
end
end
end
return true
end
creaturescripts.xml adcione a tag:
Code:
<event type="kill" name="Exp_Extra" event="script" value="extraexp.lua"/>
creaturescripts/scripts/login.lua:
Code:
player:registerEvent("Exp_Extra")