Nome: Ice Wall
Tipo: Spell
Autor: Eddy Havoc
Essa é a versão final da spell Ice Wall ou Block Wall criada por mim.
Exibição in-game:
Crie um arquivo chamado ice_wall.lua na pasta data/spells/scripts/conjuring e copie o conteúdo abaixo:
--[[
Created by: Eddy Havoc
name: Victor Amaral
contact:
[email protected]
É proibido a venda ou a cópia sem os devidos créditos desse script.
]]--
local north = 0
local south = 2
local east = 1
local west = 3
local delay = 1 -- Tempo em segundos
local itemh = 6728
local itemv = 6729
combat = createCombatObject()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE)
function onCastSpell(creature, variant)
local cDir = creature:getDirection()
local cPos = creature:getPosition ()
local pos = (Position(0,0,0))
if cDir == north then
if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemv)
pos = Position(cPos + Position(0, -1))
meffect = pos:sendMagicEffect(44)
end
elseif cDir == east then
if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemh)
pos = Position(cPos + Position(1, 0))
meffect = pos:sendMagicEffect(44)
end
elseif cDir == south then
if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemv)
pos = Position(cPos + Position(0, 1))
meffect = pos:sendMagicEffect(44)
end
elseif cDir == west then
if not getTileInfo(cPos).house and not getTilePzInfo(cPos) then
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, itemh)
pos = Position(cPos + Position(-1, 0))
meffect = pos:sendMagicEffect(44)
end
end
addEvent(function()
local wall = {itemh, itemv}
for i = 1, 2 do
if getTileItemById(pos, wall[i]).uid > 0 then
doRemoveItem(getTileItemById(pos, wall[i]).uid)
return TRUE
end
end
end,delay*1000)
return doCombat(creature, combat, variant)
end
Adicione a seguinte tag no arquivo spells.xml localizadon a pasta data/spells:
<instant group="support" spellid="94" name="Protection" words="Ice Wall" level="1" mana="1" casterTargetOrDirection="1" blocktype="all" prem="0" cooldown="1000" groupcooldown="500" needlearn="0" script="conjuring/ice_wall.lua">
<vocation name="Elder Druid"/>
</instant>
Para configurar qual item a spell irá conjurar edite itemh/itemv.
Itemh: item que irá aparecer horizontalmente (norte e sul).
Itemv: item que irá aparecer verticalmente (leste e oeste).
Qualquer dúvida estou a disposição,
Atenciosamente, Eddy Havoc.