Ir para conteúdo
  • 0

Magia Só Pode Ser Usada Se O Player Estiver Usando Um Buff


pedrizito15

Pergunta

Galera eu queria que essa magia só pudesse ser usada com esse buff :

 

 

EX : Se o player usar a magia e não estiver com o buff aparecerá o comentário Desculpe você só pode usar essa magia se estiver com o BUFF O Algoz, Se o player estiver com o buff a magia será executada normalmente...

 

Com fácil edite porque sou meio retardado.

 

(peguei a magia só como exemplo ok)

 

 

Magia :

 

 

<instant name="Hells Core" words="exevo gran mas flam" lvl="60" mana="1200" prem="1" exhaustion="2000" selftarget="1" needlearn="0" event="script" value="attack/hells core.lua">
<vocation id="1"/>
<vocation id="5"/>
</instant>

 

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 7, 14)

local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

 

BUFF :

 

 


<instant name="BM 1 Druid" words="o algoz" lvl="120" mana="2800" soul="70" aggressive="0" selftarget="1" exhaustion="90000" needlearn="1" event="script" value="o algoz.lua">
		   <vocation id="2"/>
		   <vocation id="6"/>
		   </instant>

 

 

local outfit = {lookType = 308} -- Roupa que ira transformar no caso seu corpo ficara em choque
local tempo = 80 * 1000 -- Tempo, nesse caso esta 60 segundos Lembrando que 1000 = 1 segundo

local ml = 30 -- quantos ira aumentar o skill de ML
local skillshield = 30 -- quantos ira aumentar o skill de Shield
local health = 30 -- A cada 1 segundo quantos aumentar de vida
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 48)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, 350)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 5000)
setCombatCondition(combat, condition)

local sys = createConditionObject(CONDITION_OUTFIT)
setConditionParam(sys, CONDITION_PARAM_TICKS, tempo)
addOutfitCondition(sys, outfit)
setCombatCondition(combat, sys)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end

Editado por pedrizito15
Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

local outfit = {lookType = 308} -- Roupa que ira transformar no caso seu corpo ficara em choque
local tempo = 80 -- Tempo, nesse caso esta 60 segundos Lembrando que 1000 = 1 segundo
local ml = 30 -- quantos ira aumentar o skill de ML
local skillshield = 30 -- quantos ira aumentar o skill de Shield
local health = 30 -- A cada 1 segundo quantos aumentar de vida
local storage = 150266


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 48)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, 350)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 5000)
setCombatCondition(combat, condition)

local sys = createConditionObject(CONDITION_OUTFIT)
setConditionParam(sys, CONDITION_PARAM_TICKS, tempo*1000)

addOutfitCondition(sys, outfit)
setCombatCondition(combat, sys)
function onCastSpell(cid, var)
setPlayerStorageValue(cid, storage, os.time()+tempo) 
return doCombat(cid, combat, var)
end

 

 

magia

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 7, 14)

local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)

local storage = 150266

function onCastSpell(cid, var)
if getPlayerStorageValue(cid, storage) >= os.time() then
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, " Desculpe,você só pode usar essa magia se estiver com o BUFF O Algoz.") return false
end
return true
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...