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"/>
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"/>