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

TFS 1.X+ Little problems in 3 scripts I cannot fix myself :|

Feurig

New Member
Joined
May 11, 2020
Messages
1
Reaction score
0
Hello everyone.

I have struggle with this 3 scripts. can't think of an idea to fix it :/
I hope someone is able to help me with that :)
using TFS 1.3

Well here we go:
1st script should work like that:
If you use botanist (4869) on blooming griffinclaw (5659) then
botanist transforms into filled botanist (5937)
--------------------------------------------------
everything untill here works. but how do I add that blooming griffinclaw transform into (5687)?

First code:
Code:
local griffinclaw = {5659}
local pos = Tile(1931,853,7)

function onUse(cid, item, fromPosition, itemEx, toPosition)

    if(item.itemid == 4869 and isInArray(griffinclaw, itemEx.itemid)) then
        doTransformItem(item.uid, 5937, 1)
        do
        doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
        return true
    end
end

second script should work like that.
If server starts and chance is <= 5, then game removes item 5687 from pos and adds 5659 to pos
It should check every 30 minutes for that
if chance <=5 and 5659 is already on position, then it doesnt do anything

I have no script for that.
game.removeitem function doesn't work somehow :| - only game.createitem works
could anyone explain me that?


3. script I cannot fix somehow is

How do I add to this heal spell that the 'const_me_magic_blue' comes with every healthtick?
like 1*10*1000

Code:
local combat = createCombatObject()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)


function onCastSpell(cid, var)
    local level, maglevel = getPlayerLevel(cid), getPlayerMagLevel(cid)

    local min = ((level * 2) + (maglevel * 3)) * 0.01
    local max = ((level * 2) + (maglevel * 3)) * 0.02

    local condition = createConditionObject(CONDITION_REGENERATION)
    setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 10 * 1000)
    setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, math.max(25, math.random(min, max)))
    setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)

    doAddCondition(cid, condition)
    return doCombat(cid, combat, var)
end

Thanks for even reading!
 
Last edited:
Back
Top