• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

(REQUEST) Rebirth Weapons and Spells

They are right, you can only bump if 24 hours have passed from the last post on the thread


add this on your spells(before the doCombat):
Code:
local REQUIRED_REBIRTHS = 2  --Change this for the number of rebirths
if getCreatureStorage(cid, 133) < REQUIRED_REBIRTHS then
    doPlayerSendCancel(cid, "You can only use this spell if you have " .. REQUIRED_REBIRTHS .. " reborns.")
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    return false
end

add this to your movements.xml(change as needed):
Code:
    <movevent type="Equip" itemid="11111" slot="left-hand" event="script" value="weaponRebirth1.lua"
    <movevent type="Equip" itemid="11111" slot="right-hand" event="script" value="weaponRebirth1.lua">

create(and repeat as u need) this file in movements/scripts and name it weaponRebirth1.lua:
Code:
function onEquip(cid, item, slot)
    local REQUIRED_REBIRTHS = 1  --Change this for the number of rebirths
    if getCreatureStorage(cid, 133) < REQUIRED_REBIRTHS then
        doPlayerSendCancel(cid, "You can only use this spell if you have " .. REQUIRED_REBIRTHS .. " reborns.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return false
    end
    return true
end


This should do the trick
Let me know here or thru PM if it doesn't work or if it needs some tweak ^_^
 
Your friggin awesome!

EDIT: Is there a way to set the !spells command so it checks if the player has the required rebirths to use the spell, he sees the spell in !spells but if he doesnt have enuf required rebs, he/she doesnt see it in !spells.
 
Back
Top