Ir para conteúdo

[10.76][TFS 1.1] Old MW sprite + timer


Furabio

Posts Recomendados

Esse script vai mudar a sua mw para a sprite velha e vai funcionar da mesma forma:

 

in0KLGT.jpg

 

movements.xml

<movevent event="StepIn" itemid="8753" script="mwstep.lua"/>

mwstep.lua

function onStepIn(creature, item, position, fromPosition)
	removeMw(creature:getPosition(), 8753, 1027)
	return true
end

\data\spells\scripts\support\magic wall rune.lua

substituir o que tem dentro por :

local id = 8753
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, id)

function tile_timer(id, pos, delay, color)
	if getTileItemById(pos, id).uid == 0 then
		return true
	end
	
	if delay ~= 1 then
		addEvent(tile_timer, 1000, id, pos, delay - 1, color)
	end
   
	local people = Game.getSpectators(pos, 7, 7, 5, 5, false, true)
	if not people then
		return true
	end
	
	for i = 1, #people do
		people[i]:sendTextMessage(MESSAGE_EXPERIENCE, "Magic wall will disappear in " .. delay .. " second" .. (delay > 1 and "s" or "") .. ".", pos, delay, color)
	end
end

function removeMw(pos, mw, wall)
	local tile = Tile(pos)
	mw = tile:getItemById(mw)
	wall = tile:getItemById(wall)
	if mw then mw:remove() end
	if wall then wall:remove() end
end

function onCastSpell(creature, var, isHotkey)
	local c = combat:execute(creature, var)
	if c then
		local pos = variantToPosition(var)
		local wall = Game.createItem(1027, 1, pos)
		addEvent(removeMw, 20000, pos, id, wall:getId())
		tile_timer(id, pos, 20, TEXTCOLOR_LIGHTBLUE)
	end
	return c
end

opcional :

 

bPomnnH.jpg

 

\data\spells\scripts\support\wild growth rune.lua

substituir por :

local id = ITEM_WILDGROWTH
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
combat:setParameter(COMBAT_PARAM_CREATEITEM, id)

function onCastSpell(creature, var, isHotkey)
	local c = combat:execute(creature, var)
	if c then
		local pos = variantToPosition(var)
		addEvent(removeMw, 40000, pos, id)
		tile_timer(id, pos, 40, TEXTCOLOR_LIGHTGREEN)
	end
	return c
end

Créditos: zbizu.

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

×
×
  • Criar Novo...