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

[HELP!] TFS 1.0 DODGE SYSTEM 100%

Sharinganja

New Member
Joined
Feb 4, 2018
Messages
5
Reaction score
0
Well I'm here because I had already acquired a nice script tfs 1.0 for dodge but as I stopped wobbling on servers I ended up losing and not finding anymore because I had managed to get it on XTibia but it was not working

Could anyone get this script and move to tfs 1.0 ??


Dodge System.lua

function onStatsChange(cid, attacker, type, combat, value)
local getStorage = getPlayerStorageValue(cid, 123455678)
if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
local chance = math.random (0,100)
if chance <= getStorage then
doSendAnimatedText(getCreaturePos(cid), "MISS!", 214)
doSendMagicEffect(getCreaturePosition(cid), 30)
return false
end
end
return true
end

Creaturescript.xml
<event type="StatsChange" name="DodgeSystem" event="script" value="Dodge System.lua"/>

Login.lua
-- ordered as in creaturescripts.xml
local events = {
'pythiusDead',
'bossesGrayIsland',
'ElementalSpheres',
'ElementalSpheresKill',
'ElementalSpheresLogin',
'WarzoneThree',
'WarzoneTwo',
'bossesWarzone',
'SvargrondArenaKill',
'PharaoKillPortal',
'inServiceOfYalaharQuestsDiseased',
'inServiceOfYalaharQuestsMorik',
'inServiceOfYalaharQuestsQuara',
'inquisitionQuestBosses',
'inquisitionQuestUngreez',
'killingInTheNameOfQuestKills',
'TaskCustom',
'Yielothax',
'Energized',
'Raging',
'MastersVoiceServants',
'wrathBoss',
'wrathZalamon',
'PlayerDeath',
'ThievesGuildNomad',
'AdvanceSave',
'SpikeDrillworm',
'SecretServiceBlackKnight'
}

function onLogin(cid)
local player = Player(cid)

local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendTutorial(1)
else
if loginStr ~= '' then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end
if getPlayerStorageValue(cid, 12345678) == -1 then -- dodge system essential
setPlayerStorageValue(cid,12345678, 0)
end

registerCreatureEvent(cid, "dodge system")

loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
db.query("UPDATE `players` SET `cast` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)

for i = 1, #events do
player:registerEvent(events)
end

return true
end


em action:
dodgestone.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)

local max = 100 -- limite de dodge
local storagedodge = 123455678 -- storage do dodge

if getPlayerStorageValue(cid, storagedodge) >= max then
return doPlayerSendTextMessage(cid,22,"Você ja chego no limite de Dodge.")
else
doPlayerSetStorageValue(cid, storagedodge, (getPlayerStorageValue(cid, storagedodge)) + 1)
doPlayerSendTextMessage(cid,22, "DodgeSKILL:["..getPlayerStorageValue(cid, storagedodge).."/"..max.."].")
doRemoveItem(item.uid, 1)
end
return true
end

action.xml tag
<action itemid="23467" event="script" value="dodge system.lua"/>
 
TFS 1.0 uses onHealthChange & onManaChange, the onStatsChange method is no longer supported.
Lua:
onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
Lua:
onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
Here you will find more information about these two interfaces.
TFS 1.x Series Interface Explanations
In the future please use code tags so it looks readable :)
 
27661729_2045686345447310_1713818463_n.jpg
 
Back
Top