Jump to content
Close
leozincorsair

Scripting Juntar essas duas Spells em uma

Recommended Posts

Eu gostaria que essas duas Spells fossem somente uma script, ou seja, o player fica invencível e tbm ganharia um Outfit temporário.

TFS: 0.4

+REP

 

Script 1: (imortal)

local config = { 
storage = 3482101,
cooldown = 30,  --- tempo entre um uso e outro
duration = 5, --- duração
effect1 = 29 -- efeito que sai ao falar a spell
} 


local outfit = createConditionObject(CONDITION_INVISIBLE, config.duration * 1000, false)


function onCastSpell(cid, var)
  
  if os.time() - getPlayerStorageValue(cid, 55695) >= config.cooldown then
setPlayerStorageValue(cid, 55695, os.time())
doSendMagicEffect(getCreaturePosition(cid), config.effect1)
setPlayerStorageValue(cid, config.storage, os.time() + config.duration)
doCreatureSay(cid,"UNTOUCHABLE!!!", 19)
doAddCondition(cid, outfit)
doPlayerSendTextMessage(cid, 27, "You have now ".. config.duration .." seconds of invulnerability.")
else
doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." seconds.")
return false
end  
    return true
end

Script 2: (ganha outfit)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_YELLOW)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -415.0, 0, -425.0, 0)
 
arr1 = {
{0, 3, 0}
}
 
local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)
 
local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end
 
function onCastSpell(cid, var)

local outfit = {lookType = 607, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local time = 20 -- segundos que ficará com a outfit

local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+3, y=getThingPosition(getCreatureTarget(cid)).y+0, z=getThingPosition(getCreatureTarget(cid)).z}
local parameters = { cid = cid, var = var, combat1 = combat1 }
addEvent(onCastSpell1, 0, parameters)
doSetCreatureOutfit(cid, outfit, time)
doSendMagicEffect(position1, 83)
return true
end

 


Share this post


Link to post
Share on other sites
local nighttowl = { 
storage = 3482101,
cooldown = 30,  --- tempo entre um uso e outro
duration = 5, --- duração
effect1 = 29, -- efeito que sai ao falar a spell
effect2 = 83 -- efeito da segunda spell
} 
local outfit = createConditionObject(CONDITION_INVISIBLE, nighttowl.duration * 1000, false)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_YELLOW)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -415.0, 0, -425.0, 0)
 
arr1 = {
{0, 3, 0}
}
 
local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)

local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

function onCastSpell(cid, var)
local outfit = {lookType = 607, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local time = 20 -- segundos que ficará com a outfit
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+3, y=getThingPosition(getCreatureTarget(cid)).y+0, z=getThingPosition(getCreatureTarget(cid)).z}
local parameters = { cid = cid, var = var, combat1 = combat1 }

if os.time() - getPlayerStorageValue(cid, 55695) >= nighttowl.cooldown then
setPlayerStorageValue(cid, 55695, os.time())
doSendMagicEffect(getCreaturePosition(cid), nighttowl.effect1)
setPlayerStorageValue(cid, nighttowl.storage, os.time() + nighttowl.duration)
doCreatureSay(cid,"UNTOUCHABLE!!!", 19)
doAddCondition(cid, outfit)
doSetCreatureOutfit(cid, outfit, time)
doSendMagicEffect(position1, nighttowl.effect2)
addEvent(onCastSpell1, 0, parameters)
doPlayerSendTextMessage(cid, 27, "You have now ".. nighttowl.duration .." seconds of invulnerability.")
else
doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(nighttowl.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." seconds.")
return false
end  
    return true
end

se te ajudei REP+ e marque como melhor resposta.


Share this post


Link to post
Share on other sites
5 horas atrás, Nightowl disse:

local nighttowl = { 
storage = 3482101,
cooldown = 30,  --- tempo entre um uso e outro
duration = 5, --- duração
effect1 = 29, -- efeito que sai ao falar a spell
effect2 = 83 -- efeito da segunda spell
} 
local outfit = createConditionObject(CONDITION_INVISIBLE, nighttowl.duration * 1000, false)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_YELLOW)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -415.0, 0, -425.0, 0)
 
arr1 = {
{0, 3, 0}
}
 
local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)

local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

function onCastSpell(cid, var)
local outfit = {lookType = 607, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local time = 20 -- segundos que ficará com a outfit
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+3, y=getThingPosition(getCreatureTarget(cid)).y+0, z=getThingPosition(getCreatureTarget(cid)).z}
local parameters = { cid = cid, var = var, combat1 = combat1 }

if os.time() - getPlayerStorageValue(cid, 55695) >= nighttowl.cooldown then
setPlayerStorageValue(cid, 55695, os.time())
doSendMagicEffect(getCreaturePosition(cid), nighttowl.effect1)
setPlayerStorageValue(cid, nighttowl.storage, os.time() + nighttowl.duration)
doCreatureSay(cid,"UNTOUCHABLE!!!", 19)
doAddCondition(cid, outfit)
doSetCreatureOutfit(cid, outfit, time)
doSendMagicEffect(position1, nighttowl.effect2)
addEvent(onCastSpell1, 0, parameters)
doPlayerSendTextMessage(cid, 27, "You have now ".. nighttowl.duration .." seconds of invulnerability.")
else
doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(nighttowl.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." seconds.")
return false
end  
    return true
end

se te ajudei REP+ e marque como melhor resposta.

 

 

Screenshot_41.png


Share this post


Link to post
Share on other sites
local nighttowl = { 
storage = 3482101,
cooldown = 30,  --- tempo entre um uso e outro
duration = 5, --- duração
effect1 = 29, -- efeito que sai ao falar a spell
effect2 = 83 -- efeito da segunda spell
} 
local outfit = createConditionObject(CONDITION_INVISIBLE, nighttowl.duration * 1000, false)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_YELLOW)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -415.0, 0, -425.0, 0)
 
arr1 = {
{0, 3, 0}
}
 
local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)

local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

function onCastSpell(cid, var)
local outfit = {lookType = 607, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local time = 20 -- segundos que ficará com a outfit
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+3, y=getThingPosition(getCreatureTarget(cid)).y+0, z=getThingPosition(getCreatureTarget(cid)).z}
local parameters = { cid = cid, var = var, combat1 = combat1 }

if os.time() - getPlayerStorageValue(cid, 55695) >= nighttowl.cooldown then
setPlayerStorageValue(cid, 55695, os.time())
doSendMagicEffect(getCreaturePosition(cid), nighttowl.effect1)
setPlayerStorageValue(cid, nighttowl.storage, os.time() + nighttowl.duration)
doCreatureSay(cid,"UNTOUCHABLE!!!", 19)
doAddCondition(cid, outfit)
addEvent(onCastSpell1, 0, parameters)
doSetCreatureOutfit(cid, outfit, time)
doSendMagicEffect(position1, nighttowl.effect2)
doPlayerSendTextMessage(cid, 27, "You have now ".. nighttowl.duration .." seconds of invulnerability.")
else
doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(nighttowl.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." seconds.")
return false
end  
    return true
end

testa.


Share this post


Link to post
Share on other sites
24 minutos atrás, Nightowl disse:

local nighttowl = { 
storage = 3482101,
cooldown = 30,  --- tempo entre um uso e outro
duration = 5, --- duração
effect1 = 29, -- efeito que sai ao falar a spell
effect2 = 83 -- efeito da segunda spell
} 
local outfit = createConditionObject(CONDITION_INVISIBLE, nighttowl.duration * 1000, false)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_YELLOW)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -415.0, 0, -425.0, 0)
 
arr1 = {
{0, 3, 0}
}
 
local area1 = createCombatArea(arr1)
setCombatArea(combat1, area1)

local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

function onCastSpell(cid, var)
local outfit = {lookType = 607, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local time = 20 -- segundos que ficará com a outfit
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+3, y=getThingPosition(getCreatureTarget(cid)).y+0, z=getThingPosition(getCreatureTarget(cid)).z}
local parameters = { cid = cid, var = var, combat1 = combat1 }

if os.time() - getPlayerStorageValue(cid, 55695) >= nighttowl.cooldown then
setPlayerStorageValue(cid, 55695, os.time())
doSendMagicEffect(getCreaturePosition(cid), nighttowl.effect1)
setPlayerStorageValue(cid, nighttowl.storage, os.time() + nighttowl.duration)
doCreatureSay(cid,"UNTOUCHABLE!!!", 19)
doAddCondition(cid, outfit)
addEvent(onCastSpell1, 0, parameters)
doSetCreatureOutfit(cid, outfit, time)
doSendMagicEffect(position1, nighttowl.effect2)
doPlayerSendTextMessage(cid, 27, "You have now ".. nighttowl.duration .." seconds of invulnerability.")
else
doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(nighttowl.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." seconds.")
return false
end  
    return true
end

testa.

 

 

Screenshot_42.png

Screenshot_42.png


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia começando do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer fazer um plano publicitário para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução!

×
×
  • Create New...