Guest User

Untitled

a guest
Apr 26th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. function onKill(cid, target, lastHit)
  2. local _EXP_AREA = {
  3. {from = {x = x, y = y, z = z}, to = {x = x, y = y, z = z}, extra = 50},
  4. {from = {x = x, y = y, z = z}, to = {x = x, y = y, z = z}, extra = 25},
  5. }
  6.  
  7. for _, V in pairs(_EXP_AREA) do
  8. if isPlayer(cid) and isMonster(target) then
  9. if isInArea(getThingPos(cid), V.from, V.to) then
  10. local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
  11. local percent = V.extra * exp
  12. local count = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience * percent / 100)))
  13. doPlayerAddExperience(cid, count)
  14. addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+' .. count, math.random(50, 60))
  15. break
  16. end
  17. end
  18. end
  19. return true
  20. end
Advertisement
Add Comment
Please, Sign In to add comment