sallem
Member
- Joined
- Nov 18, 2024
- Messages
- 20
- Reaction score
- 14
It would be possible to configure it to steal life and mana instead of critical?
creaturescripts.xml
creaturescripts\scripts\critical.lua:
actions.xml:
actions\scripts\criticalrock.lua:
creaturescripts.xml
<!-- CRITICAL SYSTEM -->
<event type="statschange" name="critical" event="script" value="critical.lua"/>
creaturescripts\scripts\login.lua
--- CRITICAL SYSTEM ----
registerCreatureEvent(cid, "critical")
if getPlayerStorageValue(cid, 48903) == -1 then
setPlayerStorageValue(cid, 48903, 0)
end
creaturescripts\scripts\critical.lua:
-----[[Critical System
by Night Wolf]]
local lvlcrit = 48903
local multiplier = 1.5
function onStatsChange(cid, attacker, type, combat, value)
if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and isPlayer(attacker) and isCreature(cid) then
if (getPlayerStorageValue(attacker, lvlcrit)*3) >= math.random (0,1000) then
value = math.ceil(value*(multiplier))
doTargetCombatHealth(attacker, cid, combat, -value, -value, 255)
doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!!", 144)
return false
end
end
return true
end
actions.xml:
<action itemid="1294" script="criticalrock.lua"/>
actions\scripts\criticalrock.lua:
--- CRITICAL System by Night Wolf
local config = {
effectonuse = 14, --
levelscrit = 100, ---
storagecrit = 48903 -- storage
}
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,22,"You've Leveled your Critical Skill to ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].")
setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1)
elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then
doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Critical Skill.\nCongratulations!!!!")
return 0
end
return 1
end
Last edited: