• 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 0.X Reflect Stones For (Storage) - Need of Script Action is Missing

Enderlop

Banned User
Joined
Jan 10, 2024
Messages
93
Reaction score
16
This script reflects the damage that the player attacks you in the same way that the player's attack is the damage that will be reflected against himself, it is used for both the monster and the player player attack you reflect attack on player!!!
creaturescripts/scripts

Lua:
local lvldodge = 48903
local percent = 0.5

function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS and isCreature(attacker) then
if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then
    value = math.ceil(value*(percent))
    doCreatureAddHealth(attacker, -value)
    doSendAnimatedText(getCreaturePos(cid), "Reflected!", 6)
return false
end
end
return true
end

creaturescripts.xml
XML:
<event type="statschange" name="ReflectStone" event="script" value="reflectStone.lua"/>

login.lua
XML:
registerCreatureEvent(cid, "ReflectStone")

tibiaking.JPG.e5dc014e634ec12cc0411a1d22f5cae6.jpg
 
Last edited:
Therefore, please adjust the title to accurately describe what you require in terms of a script when clicking the stone, such as a 1/100 chance, reflect effects, etc. It's a straightforward matter. I overlooked your specific request initially, hence the need for the title modification.
 
Okay, I need the action script to reflect stone
Action
<action itemid="8303" script="reflect.lua"/>
Lua:
--- CRITICAL System by Night Wolf
  
  local config = {
   effectonuse = 68, -- efeito que sai
   levelscrit = 100,  --- leveis que terão
   storagecrit = 11903 -- storage que será verificado
   }
function onUse(cid, item, frompos, item2, topos)

    if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then
   doRemoveItem(item.uid, 1)
doSendMagicEffect(topos,config.effectonuse)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_LIGHT_BLUE, "{[REFLECT]} Você evoluiu para o nível [{"..(getPlayerStorageValue(cid, config.storagecrit) +1).."/"..config.levelscrit.."}] de reflect.")
setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1)
elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "[REFLECT] Você já atingiu o nível máximo de relfect [100/100].")
    return 0
    end
return 1
end
 
Back
Top