[TUTORIAL]Maconha No Tibia, é isso mesmo!

taaatuu

Member Legendary XPZ
Delta XPZ
7 de Abril de 2009
557
29
0
26
va em actions.xml e adicione

<action itemid="5953" script="Maconha.lua"/>
depois abra o bloco de notas e coloque o codigo abaixo e salve na pasta Scripts da pasta actions como Maconha.lua

obs: ela usa o StorageID 5555

-- By Luke sky walkerlocal exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, 3000)

local Barato = createConditionObject(CONDITION_DRUNK)

setConditionParam(Barato, CONDITION_PARAM_TICKS, 15000)

function onUse(cid, item, frompos, item2, topos)

    if getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == FALSE then

        if getPlayerStorageValue(cid, 5555) > 0 then

            setPlayerStorageValue(cid, 5555, -1)

            doAddCondition(cid, Barato)

            doAddCondition(cid, exhaust)

            doRemoveItem(item.uid, 1)

        elseif getPlayerStorageValue(cid, 5555) == -1 then

            doAddCondition(cid, Barato)

            doAddCondition(cid, exhaust)

            doRemoveItem(item.uid, 1)

            addEvent(Maconha, 100, cid, item2, toPosition)

        end

    else

        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)

        doSendMagicEffect(getPlayerPosition(cid), 2)

    end

    return TRUE

end

function Maconha(cid, item2, topos)

    if getPlayerStorageValue(cid, 5555) == -1 then

        doTargetCombatHealth(0, cid, COMBAT_DROWNDAMAGE    , -50, -100, 1)

        setPlayerStorageValue(cid, 5555, 1)

        addEvent(Maconha, 2000, cid, item2, toPosition)

    elseif getPlayerStorageValue(cid, 5555) > 0 and getPlayerStorageValue(cid, 5555) < 10 then

        doTargetCombatHealth(0, cid, COMBAT_DROWNDAMAGE    , -50, -100, 1)

        setPlayerStorageValue(cid, 5555, getPlayerStorageValue(cid, 5555) + 1)

        addEvent(Maconha, 2000, cid, item2, toPosition)

    elseif getPlayerStorageValue(cid, 5555) == 10 then

        setPlayerStorageValue(cid, 5555, -1)

    end

end
Creditos:

Luke sky walker