Crie um arquivo chamado fire strike.lua na pasta data/spells/scripts/attack e cole isso
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 30)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -42.6, -45.5, -47.5, -49.5)
local condition1 = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition1, CONDITION_PARAM_TICKS, 2)
--setConditionParam(condition1, CONDITION_PARAM_SPEED, -500)
setConditionFormula(condition1, -07, 0, -08, 0)
setCombatCondition(combat1, condition1)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 29)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -42.6, -45.5, -47.5, -49.5)
local condition2 = createConditionObject(CONDITION_CURSED)
setConditionParam(condition2, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition2, 10, 2, -2)
setCombatCondition(combat2, condition2)
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 53)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -42.6, -45.5, -47.5, -49.5)
local condition3 = createConditionObject(CONDITION_DAZZLED)
setConditionParam(condition3, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition3, 10, 2, -2)
setCombatCondition(combat3, condition3)
arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 3, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
arr2 = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}
arr3 = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end
local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end
local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3 }
if getPlayerItemCount(cid, 8302) >= 1 then
addEvent(onCastSpell1, 1, parameters)
addEvent(onCastSpell2, 2, parameters)
addEvent(onCastSpell3, 3, parameters)
else
doPlayerSendTextMessage(cid, 22, 'You need 1 or more of '.. getItemNameById(8302) ..'.')
end
return true
end
Adicione a seguinte linha no arquivo spells.xml que se encontra na pasta data/spells
<instant name="strike" words="caldera" lvl="250" maglv="5" mana="500" exhaustion="2000" prem="0" needlearn="1" casterTargetOrDirection="1" selftarget="1" blockwalls="0" aggressive="1" event="script" value="attack/fire strike.lua">
<vocation id="0"/>
<vocation name="Master Sorcerer"/>
<vocation name="Elder Druid"/>
<vocation name="Royal Paladin"/>
<vocation name="Elite Knight"/>
</instant>
Crie um arquivo chamado strike.lua na pasta data/actions/scripts e cole isso
function onUse(cid, item, frompos, item2, topos)
if isPlayer(cid) then
doPlayerLearnInstantSpell(cid, "strike")
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerSendTextMessage(cid, 22, 'You learn a new spell.')
end
return TRUE
end
Adicione a seguinte linha no arquivo actions.xml que se encontra na pasta data/actions
<action itemid="8302" event="script" value="strike.lua"/>
Não testado
Dúvidas? Me avise.
Att.
Giovani Rodrigo