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

Flute buffing people

  • Thread starter Thread starter Deleted member 49793
  • Start date Start date
D

Deleted member 49793

Guest
So ya my request is a flute that when you use it itll give everyone in the party the druid buff from tibia... i.e making there health regen 20 a second isntead of 2 for 1 minute :D

Thanks

Rep++ for who helps
 
Here you got, sir. If player isn't in party won't work. After using the flute, if a party member logs out or gets out of the party, buff will stop for him.
Flute can't be used consecutively, after one use it will transform into an useless wooden flute, then that wooden flute in certain time will decay to the previous party healing flute

Used Colandus' auto heal and JDB's party teleport

change at your actions.xml:
XML:
<action fromid="2070" toid="2085" event="script" value="other/music.lua"/>
to:
XML:
<action fromid="2071" toid="2085" event="script" value="other/music.lua"/>

You must know that original flute won't be able to be used as a simple musical instrument anymore.
Now, go to your items.xml
change
XML:
    <item id="2374" article="un/a" name="wooden flute">
        <attribute key="weight" value="200" />
    </item>
to
XML:
<item id="2374" article="un/a" name="wooden flute">
        <attribute key="weight" value="200" />
        <attribute key="decayTo" value="2070" />
        <attribute key="duration" value="180" />
</item>
^180 = time it turns back to original flute, you can change it
script:
XML:
<action itemid="2070" event="script" value="partyflute.lua"/>
LUA:
local HEAL_DELAY = 1000
local HEAL_TIMES = 60
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0.4, -0.5, 0.7, -1)

function onUse(cid, item, fromPosition, itemEx, toPosition)    
    if not getPlayerParty(cid) then
        doPlayerSendCancel(cid, 'You aren\'t in a party.')
        return true
    end 
        
    for _, party in ipairs(getPartyMembers(cid)) do
        doSendMagicEffect(getThingPos(party), CONST_ME_MAGIC_GREEN)
        local param = {cid = party, combat = combat, var = numberToVariant(party)}
        local function onCastSpell(param)
            if isPlayer(param.cid) and isInParty(param.cid) then
                doCombat(param.cid, param.combat, param.var)
                doSendMagicEffect(getThingPos(param.cid), math.random(21, 24))
            end
        end
        for i = 0, math.max(HEAL_TIMES, 1) - 1 do
            addEvent(onCastSpell, HEAL_DELAY * i, param)
        end
    end
    
    doTransformItem(item.uid, 2374)
    doDecayItem(item.uid)
    
    return true
end

This script has been tested in tfs 0.3.6 as I found out it's the one you are using
 
Last edited:
Back
Top