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

Dodge Skill (TFS 0.4 REV 3996)

WikiArk21

New Member
Joined
Oct 24, 2023
Messages
11
Reaction score
1
I found a dodge script on internet forums, but it does not have the necessary tags. I know it's for creaturescripts, but which tag should be added?
local SKILL_ID = 5 -- id do skill...

local percentual = 0.3

function onStatsChange(cid, attacker, type, combat, value)
local COLOR_ID = 200 -- cor do texto
local MAGIC_EFFECT = 1 -- id do magic effect

if not isCreature(cid) then
return false
end

for _, tudo in pairs(skills) do
local chance = (getPlayerSkillLevel(cid, SKILL_ID) * percentual) * 10
if math.random(1, 1000) <= chance then
if combat ~= COMBAT_HEALING then
doSendMagicEffect(getCreaturePosition(cid), MAGIC_EFFECT)
doSendAnimatedText(getCreaturePosition(cid), "MISS!", COLOR_ID)
return false
end
end
end
return true
end
 
Solution
Just add it through the CreatureScript and see the NameScript. You should include the script name and test it... However, I'm unsure if it needs to be registered in the Login.lua.
XML:
<event type="StatsChange" name="dodge" event="script" value="nameScript.lua"/>
Just add it through the CreatureScript and see the NameScript. You should include the script name and test it... However, I'm unsure if it needs to be registered in the Login.lua.
XML:
<event type="StatsChange" name="dodge" event="script" value="nameScript.lua"/>
 
Solution
Just add it through the CreatureScript and see the NameScript. You should include the script name and test it... However, I'm unsure if it needs to be registered in the Login.lua.
XML:
<event type="StatsChange" name="dodge" event="script" value="nameScript.lua"/>
Yes, I had to put it in login.lua, and I had to add the skills table. But it worked correctly! Thank you for your help
 
Back
Top