Fabi Marzan
Intermediate OT User
- Joined
- Aug 31, 2020
- Messages
- 172
- Solutions
- 8
- Reaction score
- 107
As you can see from the gif, when using the Sekizo spell it has an effect, when using another spell (buff) the Sekizo spell changes to another effect. For just 2 minutes and back to normal. How is it possible to do it? In OTX 2.
I would have to put a storage in the spell?

Spell Example:
Buff Example:
I would have to put a storage in the spell?

Spell Example:
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_HITCOLOR, COLOR_TEAL)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 0)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.0, -680, -1.0, -800)
function onCastSpell(cid, var)
local position = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
doSendMagicEffect(position, 718)
return doCombat(cid, combat, var)
end
Buff Example:
Code:
local tempo = 60 -- tempo em segundos.
local EffPerma = {646} -- effect no player, caso queira apenas 1, basta remover os outros numeros.
local EffOnUse = 653
local ml = 10 -- quantos ira aumentar o skill de ML
local skillfist = 10 -- quantos ira aumentar o skill de Fist
local skillsword = 10 -- quantos ira aumentar o skill de Sword
local skillshield = 10 -- quantos ira aumentar o skill de Shield
local health = 200-- A cada 1 segundo quantos aumentar de vida
local combat = createCombatObject()
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_FIST, skillfist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
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, 1000)
setCombatCondition(combat, condition)
function Guy(tempo2,tempo3,cid) -- Altera aqui o nome da funçao pelo nome do personagem
if (isCreature(cid)) then
for i=1, #EffPerma do
local position = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(position, EffPerma[i])
end
end
end
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 1500) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then
doCombat(cid, combat, var)
tempo2 = 0
while (tempo2 ~= (tempo*1000)) do
addEvent(Guy, tempo2, tempo2, tempo*1000, cid) -- Altere aqui pelo nome da função criada acima
tempo2 = tempo2 + 300
end
setPlayerStorageValue(cid, 1500,1) -- storage verifica transformado, quando = 1 player esta transformado.
doCreatureSay(cid, "Kaimon Kai!", TALKTYPE_ORANGE_1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Buff activado por "..tempo.." segundos!")
local PosOnUse = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}
doSendMagicEffect(PosOnUse, EffOnUse)
else
doPlayerSendCancel(cid, "Sorry, you are transformed.")
end
end
Last edited: