Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, frompos, item2, topos)
- local config = {storages = {st0 = 65528 ,st1 = 65535, st2 = 65534, st3 = 65533, st4 = 65532, st5 = 65531, st6 = 65530, st7 = 65529}, --Tem que ser a mesma da magia.lua
- soul = 50,
- message_soul = 'You do not have 50 soul points.',
- mp = (getCreatureMaxMana(cid) * 0.15), --- Mana---
- hp = (getCreatureMaxHealth(cid) * 0.20), ---Health ---
- duration = 30, ---Segundos---
- intervalo = 2, ---Intervalo das healada---
- magic = 28, --- magic effect que manda---
- message_2x = 'You are already taking effect from this item.',
- outfits = {
- [1] = {name = "Hazus",
- lookAddon = 0,
- lookType = 262,
- lookHead = 114,
- lookTypeEx = 0,
- lookLegs = 114,
- lookBody = 114,
- lookFeet = 114,
- },
- [2] = {name = "Kazard",
- lookAddon = 0,
- lookType = 194,
- lookHead = 114,
- lookTypeEx = 0,
- lookLegs = 114,
- lookBody = 114,
- lookFeet = 114,
- },
- [3] = {name = "Chronos",
- lookAddon = 0,
- lookType = 251,
- lookHead = 114,
- lookTypeEx = 0,
- lookLegs = 114,
- lookBody = 114,
- lookFeet = 114,
- },
- [4] = {name = "Royalty",
- lookAddon = 0,
- lookType = 309,
- lookHead = 114,
- lookTypeEx = 0,
- lookLegs = 114,
- lookBody = 114,
- lookFeet = 114,
- },
- },
- }
- s = math.random(1,4)
- local outfit_use = config.outfits[s]
- if getPlayerSoul(cid) >= config.soul then
- if getPlayerStorageValue(cid, config.storages.st7) == -1 then
- doPlayerAddSoul(cid, (config.soul * (-1)))
- local er = (config.duration / config.intervalo)
- function heal(cid)
- if isPlayer(cid) then
- doCreatureAddHealth(cid, config.hp)
- doCreatureAddMana(cid, config.mp)
- doSendMagicEffect(getCreaturePosition(cid), config.magic)
- if er >= 1 then
- addEvent(heal, (config.intervalo * 1000), cid)
- end
- er = er - 1
- end
- end
- local player_outfit_magia = getCreatureOutfit(cid)
- doPlayerSetStorageValue(cid, config.storages.st0, player_outfit_magia.lookAddon)
- doPlayerSetStorageValue(cid, config.storages.st1, player_outfit_magia.lookType)
- doPlayerSetStorageValue(cid, config.storages.st2, player_outfit_magia.lookHead)
- doPlayerSetStorageValue(cid, config.storages.st3, player_outfit_magia.lookTypeEx)
- doPlayerSetStorageValue(cid, config.storages.st4, player_outfit_magia.lookLegs)
- doPlayerSetStorageValue(cid, config.storages.st5, player_outfit_magia.lookBody)
- doPlayerSetStorageValue(cid, config.storages.st6, player_outfit_magia.lookFeet)
- doPlayerSay(cid, "MUAHAHAHA!", TALKTYPE_ORANGE_1)
- doRemoveItem(item.uid,1)
- doPlayerSendTextMessage(cid,20, "His body went into metamorphosis and now you've turned into a guardian of Olympus ("..outfit_use.name..").")
- er = er - 1
- doPlayerSetStorageValue(cid, config.storages.st7, 1)
- function outfit(cid)
- if isPlayer(cid) then
- doCreatureChangeOutfit(cid, player_outfit_magia)
- doPlayerSetStorageValue(cid, config.storages.st7, -1)
- end
- end
- table.remove(outfit_use, name)
- doCreatureChangeOutfit(cid, outfit_use)
- doCreatureAddHealth(cid, config.hp)
- doCreatureAddMana(cid, config.mp)
- doSendMagicEffect(getCreaturePosition(cid), config.magic)
- heal(cid)
- addEvent(outfit, (((config.duration) * 1000) + 2), cid)
- else
- doPlayerSendCancel(cid, config.message_2x)
- end
- else
- doPlayerSendCancel(cid, config.message_soul)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement