Alscara

Untitled

Nov 7th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. local function getBaseVoc(v)
  2. if not v then
  3. return false
  4. end
  5. if not v:getDemotion() then
  6. return v
  7. end
  8. while v:getDemotion() do
  9. v = v:getDemotion()
  10. end
  11. return v
  12. end
  13.  
  14.  
  15. local configT = {
  16. sv = 2000,
  17. bonus = {
  18. [1] = {CONDITION_PARAM_STAT_MAGICPOINTS, 15},
  19. [2] = {CONDITION_PARAM_STAT_MAGICPOINTS, 15},
  20. [3] = {CONDITION_PARAM_SKILL_DISTANCE, 30},
  21. [4] = {CONDITION_PARAM_SKILL_SHIELD, 20},
  22. [5] = {CONDITION_PARAM_SKILL_MELEE, 30},
  23. [6] = {CONDITION_PARAM_STAT_MAGICPOINTS, 15},
  24. [19] = {CONDITION_PARAM_SKILL_FIST, 50},
  25. }
  26. }
  27.  
  28.  
  29. function onUse(player, item, frompos, itemEx, topos)
  30. if player:getStorageValue(configT.sv) ~= 1 then
  31. player:setStorageValue(configT.sv, 1)
  32. item:remove()
  33. return activatFireWalk(player)
  34. end
  35. return false
  36. end
  37.  
  38. function activatFireWalk(player)
  39. local bonusSkills = Condition(CONDITION_ATTRIBUTES, 5)
  40. bonusSkills:setTicks(-1)
  41. if player:getStorageValue(configT.sv) == 1 then
  42. local voc = getBaseVoc(player:getVocation()):getId()
  43. local bonusT = configT.bonus[voc]
  44. if bonusT then
  45. bonusSkills:setParameter(bonusT[1], bonusT[2])
  46. player:addCondition(bonusSkills)
  47. end
  48. return player:registerEvent("firewalk")
  49. end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment