Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function getBaseVoc(v)
- if not v then
- return false
- end
- if not v:getDemotion() then
- return v
- end
- while v:getDemotion() do
- v = v:getDemotion()
- end
- return v
- end
- local configT = {
- sv = 2000,
- bonus = {
- [1] = {CONDITION_PARAM_STAT_MAGICPOINTS, 15},
- [2] = {CONDITION_PARAM_STAT_MAGICPOINTS, 15},
- [3] = {CONDITION_PARAM_SKILL_DISTANCE, 30},
- [4] = {CONDITION_PARAM_SKILL_SHIELD, 20},
- [5] = {CONDITION_PARAM_SKILL_MELEE, 30},
- [6] = {CONDITION_PARAM_STAT_MAGICPOINTS, 15},
- [19] = {CONDITION_PARAM_SKILL_FIST, 50},
- }
- }
- function onUse(player, item, frompos, itemEx, topos)
- if player:getStorageValue(configT.sv) ~= 1 then
- player:setStorageValue(configT.sv, 1)
- item:remove()
- return activatFireWalk(player)
- end
- return false
- end
- function activatFireWalk(player)
- local bonusSkills = Condition(CONDITION_ATTRIBUTES, 5)
- bonusSkills:setTicks(-1)
- if player:getStorageValue(configT.sv) == 1 then
- local voc = getBaseVoc(player:getVocation()):getId()
- local bonusT = configT.bonus[voc]
- if bonusT then
- bonusSkills:setParameter(bonusT[1], bonusT[2])
- player:addCondition(bonusSkills)
- end
- return player:registerEvent("firewalk")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment