Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------
- -- Script
- -------------------------------------------
- if player:getExhaustion(exhaustStorage) > 0 then
- player:getPosition():sendMagicEffect(CONST_ME_POFF)
- player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You are exhausted." )
- return true
- end
- local rune
- for k,v in pairs(config) do
- if item:getId() == v.itemId then
- rune = k
- end
- end
- if rune == nil then
- print("Rune ID not found in confg")
- return true
- end
- local settings = config[rune]
- local amount = math.random(settings.formulas.min, settings.formulas.max)
- local playerVoc = player:getVocation():getId()
- if rune == "manaRune" then
- if table.contains(settings.allowedVocs, playerVoc) then
- player:say('+'..amount.."mp", TALKTYPE_MONSTER_SAY)
- player:addMana(amount)
- player:getPosition():sendMagicEffect(settings.effect)
- else
- player:getPosition():sendMagicEffect(CONST_ME_POFF)
- player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You cannot use this rune." )
- return true
- end
- elseif rune == "healthRune" then
- if table.contains(settings.allowedVocs, playerVoc) then
- player:say('+'..amount.."hp", TALKTYPE_MONSTER_SAY)
- player:addMana(amount)
- player:getPosition():sendMagicEffect(settings.effect)
- else
- player:getPosition():sendMagicEffect(CONST_ME_POFF)
- player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You cannot use this rune." )
- return true
- end
- elseif rune == "paladinRune" then
- if table.contains(settings.allowedVocs, playerVoc) then
- player:say('+'..amount.."mp", TALKTYPE_MONSTER_SAY)
- player:say('+'..amount.."hp", TALKTYPE_MONSTER_SAY)
- player:addMana(amount)
- player:addHealth(amount)
- player:getPosition():sendMagicEffect(settings.effect)
- else
- player:getPosition():sendMagicEffect(CONST_ME_POFF)
- player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "You cannot use this rune." )
- return true
- end
- end
- player:setExhaustion(exhaustStorage, settings.cooldown)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement