• 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!

Add Charges To Weapon

Gazzy

Server Owner
Joined
Sep 25, 2013
Messages
55
Reaction score
3
Hey guys,
I need help for a script I need. I want to have the enchanted staff able to have charges added to it when an item is used on it. How do I do this?

I also want the staff to change to an enchanted staff when it has charges and to change back to a staff when it doesn't.

Bump
 
Last edited by a moderator:
I want it like the "Death Stick" from spider OT. I also use The Forgotten Server - Version 0.2.15 (Mystic Spirit).
 
I don't know this ot, but you mean adding charges attribute to weapons with an item?
If you use TFS 0.2, there isn't a function in this server to do this.
 
Okay, thanks anyway.

Is there a way for a bow to only use one item as ammunition?

Bump

Anyone
 
Last edited by a moderator:
Ok well i got a gem script buttttt it ust charges the weapon once
I use gems 7760 on item 2401 to make it 2433 but it wont charge it more than once :/


Code:
local config = {
    manaCost = 300,
    soulCost = 2
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 2147 and itemEx.itemid == 2342) then
        doTransformItem(itemEx.uid, 2343)
        doDecayItem(itemEx.uid)
        doRemoveItem(item.uid, 1)

        doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
        return true
    end

    if(item.itemid == 7760 and isInArray({2401}, itemEx.itemid)) then
        doTransformItem(itemEx.uid, 2433)
        doRemoveItem(item.uid, 1)

        doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
        return true
    end

    if(isInArray(enchantableGems, item.itemid)) then
        local subtype = item.type
        if(subtype == 0) then
            subtype = 1
        end

        local mana = config.manaCost * subtype
        if(getPlayerMana(cid) < mana) then
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
            return true
        end

        local soul = config.soulCost * subtype
        if(getPlayerSoul(cid) < soul) then
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHSOUL)
            return true
        end

        local a = table.find(enchantableGems, item.itemid)
        if(a == nil or not isInArray(enchantingAltars[a], itemEx.itemid)) then
            return false
        end

        doTransformItem(item.uid, enchantedGems[a])
        doPlayerAddMana(cid, -mana)
        doPlayerAddSoul(cid, -soul)

        doPlayerAddSpentMana(cid, mana)
        doSendMagicEffect(fromPosition, CONST_ME_HOLYDAMAGE)
        return true
    end


        local b = table.find(enchantedGems, item.itemid)
        if(b == nil) then
            return false
        end

        local subtype = itemEx.type
        if(not isInArray({2544, 8905}, itemEx.itemid)) then
            subtype = 1000
        end

        doTransformItem(itemEx.uid, enchantedItems[itemEx.itemid][b], subtype)
        doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HOLYDAMAGE)
        doDecayItem(itemEx.uid)
        doRemoveItem(item.uid, 1)
        return true
end
 
Items.xml
Code:
<attribute key="charges" value="100"/>
<attribute key="decayTo" value="2401"/>
After 100 hits it will turn back to normal staff.

This works even on 0.3.0
 
Instead of adding the 7760 to the 2433 and get 1 charge i want it to add as many as want

Like when u use the 7760 on the 2401 it makes 2433 and has 1 charge avaliable and it will not take anymorw 7760 to upgrade the item to more charges example

My staff has 1 charge because i used the item 7760 on it and made it transform from a staff to a enchanted staff alright thats good now when i use the item 7760 to add more charges to the weapon it will not add more charges so its kinda crap it doesnt add a charge to it i tried to mess with it but yeah i need help

@andu i got it set like that i just need the staff to take the gems as many times as people use on it because it only accepts 1 gem on them i want it to take as many gems as u got lol
Which is the script i provided
 
Last edited by a moderator:
Back
Top