Co nowego?
Tibia.net.pl

PO ZMIANIE SKRYPTU FORUM MOGĄ WYSTĘPOWAĆ PROBLEMY Z LOGOWANIEM. "ZRESETUJ HASŁO(klik)", ABY SIĘ ZALOGOWAĆ .

JEŻELI NIE PAMIĘTASZ STAREGO E-MAILA ZAJRZYJ NA NASZEGO "DISCORDA(klik)" LUB "NAPISZ E-MAILA(klik)"

Spells Fala + Cooldown + Lua Obiektowe

Status
Zamknięty.

TheAllienII

Stały bywalec
Dołączył
Lipiec 2, 2014
Posty
119
Liczba reakcji
6
[LUA]local cd = 1 -- 1 = 1s --
local cdnumber = 1 -- numer naszego czaru w systemie CD --
local area = {
{1},
{1},
{1},
{3}
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, 10)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -9.0, 0, -9.5, 0)
setCombatArea(combat, createCombatArea(area))

local combatArea = createCombatArea(area)

function onCastSpell(cid, var)
if exhaustion.check(cid,c) then
doPlayerSendCancel(cid, "Your NAZWA CZARU still has "..exhaustion.get(cid, c).." seconds on cooldown.")
return false
end
player.add(cid)
player:sendDirEffect(106, 0, -1, 104, 4, 0, 107, 0, 4, 105, -1, 0)
exhaustion.set(cid,cdnumber,cd)
return doCombat(cid, combat, var)
end[/LUA]

Funkcja Lua
[LUA]P_DEBUG_MESSAGE = true


player = {}
player.__index = player

player.add = function(cid, self)
player.cid = cid
setmetatable(player, player)
return player
end

function player:sendDirEffect(m_north, m_xNorth, m_yNorth, m_east, m_xEast, m_yEast,
m_south, m_xSouth, m_ySouth, m_west, m_xWest, m_yWest, m_time)
local effect = 1
local eX = 0
local eY = 0
if self:getDir() == NORTH then
effect = m_north
eX = m_xNorth
eY = m_yNorth
elseif self:getDir() == EAST then
effect = m_east
eX = m_xEast
eY = m_yEast
elseif self:getDir() == SOUTH then
effect = m_south
eX = m_xSouth
eY = m_ySouth
else
effect = m_west
eX = m_xWest
eY = m_yWest
end

if not m_time then
doSendMagicEffect({x = self:getPos().x + eX, y = self:getPos().y + eY, z = self:getPos().z}, effect)
else
addEvent(doSendMagicEffect, m_time, {x = self:getPos().x + eX, y = self:getPos().y + eY, z = self:getPos().z}, effect)
end
end[/LUA]
 
Status
Zamknięty.
Do góry