<action itemid="ID OF YOUR ITEM HERE" event="script" value="dodge.lua" />
local config = {
effectonuse = 28, -- effect (/z)
levelsdodge = 100, --- Maximum dodge you can use
storagedodge = 48902 -- storage verification
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, config.storagedodge) < config.levelsdodge then
doRemoveItem(item.uid, 1)
doSendMagicEffect(topos,config.effectonuse)
doPlayerSendTextMessage(cid,22,"You've advanced your dodge skill to ["..(getPlayerStorageValue(cid, config.storagedodge)+1).."/100].")...
<action itemid="ID OF YOUR ITEM HERE" event="script" value="dodge.lua" />
local config = {
effectonuse = 28, -- effect (/z)
levelsdodge = 100, --- Maximum dodge you can use
storagedodge = 48902 -- storage verification
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, config.storagedodge) < config.levelsdodge then
doRemoveItem(item.uid, 1)
doSendMagicEffect(topos,config.effectonuse)
doPlayerSendTextMessage(cid,22,"You've advanced your dodge skill to ["..(getPlayerStorageValue(cid, config.storagedodge)+1).."/100].")
setPlayerStorageValue(cid, config.storagedodge, getPlayerStorageValue(cid, config.storagedodge)+1)
elseif getPlayerStorageValue(cid, config.storagedodge) >= config.levelsdodge then
doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of dodge skill.\nCongratulations!!!!")
return 0
end
return 1
end
<event type="statschange" name="dodge" event="script" value="dodge.lua"/>
local lvldodge = 48902
local percent = 1
function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) then
if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then
value = math.ceil(value*(percent))
doTargetCombatHealth(attacker, cid, combat, -value, -value, 255)
doSendAnimatedText(getCreaturePos(cid), "DODGE", 6)
return false
end
end
return true
end
if getPlayerStorageValue(cid, 48902) == -1 then -- dodge system essential
setPlayerStorageValue(cid, 48902, 0)
end
registerCreatureEvent(cid, "dodge")
local lvldodge = 48902
local percent = 1
function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) then
if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then
value = math.ceil(value*(percent))
doTargetCombatHealth(attacker, cid, combat, -value, -value, 255)
doSendAnimatedText(getCreaturePos(cid), "DODGE", 6)
return false
end
end
return true
end
what about criticalAlright, you will need to add this in /data/action/action.xml:
XML:<action itemid="ID OF YOUR ITEM HERE" event="script" value="dodge.lua" />
Then you need to add this in /data/action/script :
Name it dodge.lua
Lua:local config = { effectonuse = 28, -- effect (/z) levelsdodge = 100, --- Maximum dodge you can use storagedodge = 48902 -- storage verification } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, config.storagedodge) < config.levelsdodge then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) doPlayerSendTextMessage(cid,22,"You've advanced your dodge skill to ["..(getPlayerStorageValue(cid, config.storagedodge)+1).."/100].") setPlayerStorageValue(cid, config.storagedodge, getPlayerStorageValue(cid, config.storagedodge)+1) elseif getPlayerStorageValue(cid, config.storagedodge) >= config.levelsdodge then doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of dodge skill.\nCongratulations!!!!") return 0 end return 1 end
Then you must add this in /data/creaturescript/creaturescript.xml :
XML:<event type="statschange" name="dodge" event="script" value="dodge.lua"/>
then you must add again in /data/creaturescript/script :
Name it dodge.lua
Lua:local lvldodge = 48902 local percent = 1 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) then if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then value = math.ceil(value*(percent)) doTargetCombatHealth(attacker, cid, combat, -value, -value, 255) doSendAnimatedText(getCreaturePos(cid), "DODGE", 6) return false end end return true end
Finaly, add this in /data/creaturescript/script/login.lua
Lua:if getPlayerStorageValue(cid, 48902) == -1 then -- dodge system essential setPlayerStorageValue(cid, 48902, 0) end registerCreatureEvent(cid, "dodge")
That's not made by me, I took it on blacktibia.
2 years later xD, I'll see what I can dowhat about critical
<action itemid="ITEM ID HERE" event="script" value="critical.lua" />
local config = {
effectonuse = 28, -- effect (/z)
levelscrit = 100, --- maximum critical you can use
storagecrit = 48903 -- storage verification
}
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 advanced 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
<event type="statschange" name="critical" event="script" value="critical.lua"/>
local lvlcrit = 48903
local multiplier = 1
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
if getPlayerStorageValue(cid, 48903) == -1 then --critical system essential
setPlayerStorageValue(cid, 48903, 0)
end
registerCreatureEvent(cid, "critical")
do you have one place who teach do this?if you have more than 100 players online will get laaag with this script, the best way to make dodge and critical for 0.3 or 0.4 in source edit
mana leech and life leech and dodge and critical and increase damage and reduction damage fo 0.4 source edit