Serginov
Onkonkoronkonk
I've been making some spells/skills for my team battle ot but it will never go online cause of my internet and lack of money.
This is my newest skill, Vampiric touch.
Tested on TFS 0.3.6. I'm not sure, but I think it will work for 0.4 too.
When you cast this spell you will get health on each physical attack as long as the spell lasts. This mean you can use exori gran, hur, mas, everything that use physical damage.
It have a cooldown on 240 seconds. you can change this in the config
The skill lasts for 180 seconds which you also can change in the config
Spells/scripts/attack/vampiric touch.luaThis is my newest skill, Vampiric touch.
Tested on TFS 0.3.6. I'm not sure, but I think it will work for 0.4 too.
When you cast this spell you will get health on each physical attack as long as the spell lasts. This mean you can use exori gran, hur, mas, everything that use physical damage.
It have a cooldown on 240 seconds. you can change this in the config
The skill lasts for 180 seconds which you also can change in the config
Code:
local combat = createCombatObject()
local config = {
spellName = "Vampiric Touch", -- The spells name. Not the words you say to cast it.
storage = 1401,
timeStorage = 1402,
cooldown = 240, -- Cooldown on the spell in seconds
skillTime = 180, -- For this long the skill will be activated.
}
function onCastSpell(cid, var)
if not exhaustion.get(cid, config.storage) then
exhaustion.set(cid, config.storage, config.cooldown)
exhaustion.set(cid, config.timeStorage, config.skillTime)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doCreatureSay(cid, "VAMPIRIC TOUCH!", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, config.spellName .. " is still on " .. exhaustion.get(cid, config.storage) .. " seconds cooldown!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return false
end
doCombat(cid, combat, var)
return true
end
Code:
<instant name="Vampiric touch" words="utori con" lvl="75" mana="320" prem="1" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="attack/vampiric touch.lua">
<vocation id="3"/>
<vocation id="4"/>
<vocation id="7"/>
<vocation id="8"/>
</instant>
Code:
local config = {
spellName = "Vampiric Touch",
storage = 1401,
timeStorage = 1402,
lifeStealPercent = 50, -- Percent of the damage you deal you will get in health.
}
function onStatsChange(cid, attacker, type, combat, value)
if type == COMBAT_PHYSICALDAMAGE then
if exhaustion.get(attacker, config.storage) then
doCreatureAddHealth(attacker, math.ceil(value * (config.lifeStealPercent / 100)))
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendMagicEffect(getPlayerPosition(attacker), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(attacker), "+" .. math.ceil(value * (config.lifeStealPercent / 100)) .. " HP", TEXTCOLOR_RED)
doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "You stole " .. math.ceil(value * (config.lifeStealPercent / 100)) .. " health from " .. getPlayerName(cid) .. "\n" .. config.spellName .. " will last for " .. exhaustion.get(attacker, config.timeStorage) .. " seconds more.")
end
end
return true
end
Code:
<event type="statschange" name="vampiricTouch" event="script" value="vampiric touch.lua"/>
Code:
registerCreatureEvent(cid, "vampiricTouch")
Last edited: