Jump to content

Pedido Como colocar cooldown nessa spell?


Go to solution Solved by XGaduX,

Recommended Posts

  • Solution

 

local scom1 = createCombatObject()

local scom2 = createCombatObject()

local scom3 = createCombatObject()

local scom4 = createCombatObject()



local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat3, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat4, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


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, 0, 0, 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, 0, 1, 1, 2, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}


arr2 = {

{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, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}


arr3 = {
{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, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}


arr4 = {

{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, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}



local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr2)

local area4 = createCombatArea(arr2)

setCombatArea(scom1, area1)

setCombatArea(scom2, area2)

setCombatArea(scom3, area3)

setCombatArea(scom4, area4)



function onTargetTile(cid, pos)

local p = getThingPos(cid)

local basep = {x = p.x + 5, y = p.y - 5, z = p.z}

doSendDistanceShoot(basep, pos, 55)

doCombat(cid,combat1,positionToVariant(pos))

end


function onTargetTile2(cid, pos)

local p1 = getThingPos(cid)

local basep1 = {x = p1.x - 5, y = p1.y + 5, z = p1.z}

doSendDistanceShoot(basep1, pos, 55)

doCombat(cid,combat2,positionToVariant(pos))

end


function onTargetTile3(cid, pos)

local p2 = getThingPos(cid)

local basep2 = {x = p2.x - 5, y = p2.y + 5, z = p2.z}

local baseep2 = {x = p2.x + 5, y = p2.y - 5, z = p2.z}

doSendDistanceShoot(basep2, pos, 112)

doSendDistanceShoot(baseep2, pos, 112)

doCombat(cid,combat3,positionToVariant(pos))

end


function onTargetTile4(cid, pos)

local p3 = getThingPos(cid)

local basep3 = {x = p3.x - 5, y = p3.y - 5, z = p3.z}

local baseep3 = {x = p3.x + 5, y = p3.y + 5, z = p3.z}

doSendDistanceShoot(basep3, pos, 112)

doSendDistanceShoot(baseep3, pos, 112)

doCombat(cid,combat4,positionToVariant(pos))

end


setCombatCallback(scom1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(scom2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

setCombatCallback(scom3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

setCombatCallback(scom4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")


local function onCastSpell1(parameters)

doCombat(parameters.cid, scom1, parameters.var)

end


local function onCastSpell2(parameters)

doCombat(parameters.cid, scom2, parameters.var)

end


local function onCastSpell3(parameters)

doCombat(parameters.cid, scom3, parameters.var)

end


local function onCastSpell4(parameters)

doCombat(parameters.cid, scom4, parameters.var)

end




function onCastSpell(cid, var)

local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 100, parameters)

addEvent(onCastSpell2, 100, parameters)

addEvent(onCastSpell3, 1200, parameters)

addEvent(onCastSpell4, 1200, parameters)


return TRUE


end

Como insiro essa função na spell?  \/

 

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
if exhaustion.get(cid, 5) then
	doPlayerSendCancel(cid, "Wait "..exhaustion.get(cid, 5).." seconds.")
	return false
end

 

Link to post
Share on other sites

Tente desta forma

local scom1 = createCombatObject()

local scom2 = createCombatObject()

local scom3 = createCombatObject()

local scom4 = createCombatObject()



local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat3, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat4, CALLBACK_PARAM_LEVELMAGICVAL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, 0, 0, 0, 1, 1, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}


arr4 = {

{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, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}



local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr2)

local area4 = createCombatArea(arr2)

setCombatArea(scom1, area1)

setCombatArea(scom2, area2)

setCombatArea(scom3, area3)

setCombatArea(scom4, area4)



function onTargetTile(cid, pos)

local p = getThingPos(cid)

local basep = {x = p.x + 5, y = p.y - 5, z = p.z}

doSendDistanceShoot(basep, pos, 55)

doCombat(cid,combat1,positionToVariant(pos))

end


function onTargetTile2(cid, pos)

local p1 = getThingPos(cid)

local basep1 = {x = p1.x - 5, y = p1.y + 5, z = p1.z}

doSendDistanceShoot(basep1, pos, 55)

doCombat(cid,combat2,positionToVariant(pos))

end


function onTargetTile3(cid, pos)

local p2 = getThingPos(cid)

local basep2 = {x = p2.x - 5, y = p2.y + 5, z = p2.z}

local baseep2 = {x = p2.x + 5, y = p2.y - 5, z = p2.z}

doSendDistanceShoot(basep2, pos, 112)

doSendDistanceShoot(baseep2, pos, 112)

doCombat(cid,combat3,positionToVariant(pos))

end


function onTargetTile4(cid, pos)

local p3 = getThingPos(cid)

local basep3 = {x = p3.x - 5, y = p3.y - 5, z = p3.z}

local baseep3 = {x = p3.x + 5, y = p3.y + 5, z = p3.z}

doSendDistanceShoot(basep3, pos, 112)

doSendDistanceShoot(baseep3, pos, 112)

doCombat(cid,combat4,positionToVariant(pos))

end


setCombatCallback(scom1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(scom2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

setCombatCallback(scom3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

setCombatCallback(scom4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")


local function onCastSpell1(parameters)

doCombat(parameters.cid, scom1, parameters.var)

end


local function onCastSpell2(parameters)

doCombat(parameters.cid, scom2, parameters.var)

end


local function onCastSpell3(parameters)

doCombat(parameters.cid, scom3, parameters.var)

end


local function onCastSpell4(parameters)

doCombat(parameters.cid, scom4, parameters.var)

end




function onCastSpell(cid, var)

local waittime = 1,0 -- Tempo de exhaustion em segundos
local storage = 26002

if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "Aguarde" .. exhaustion.get(cid, storage) .. " Segundos Para Usar Novamente.")
return false
end


local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 100, parameters)

addEvent(onCastSpell2, 100, parameters)

addEvent(onCastSpell3, 1200, parameters)

addEvent(onCastSpell4, 1200, parameters)

exhaustion.set(cid, storage, waittime)


return TRUE


end

 

Link to post
Share on other sites

12 horas atrás, Garoto Prodigio disse:

Tente desta forma


local scom1 = createCombatObject()

local scom2 = createCombatObject()

local scom3 = createCombatObject()

local scom4 = createCombatObject()



local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat3, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_HITCOLOR, COLOR_LIGHTGREEN)
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 850)
 
function kiaiho(cid, level, maglevel) 
   local min = -(level * 1.0 +  maglevel * 1 + 0)
   local max = -(level * 1.0 + maglevel * 1 + 0)
   return min, max 
end
setCombatCallback(combat4, CALLBACK_PARAM_LEVELMAGICVALUE, "kiaiho")


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, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0},

}


arr4 = {

{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, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 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},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}



local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr2)

local area4 = createCombatArea(arr2)

setCombatArea(scom1, area1)

setCombatArea(scom2, area2)

setCombatArea(scom3, area3)

setCombatArea(scom4, area4)



function onTargetTile(cid, pos)

local p = getThingPos(cid)

local basep = {x = p.x + 5, y = p.y - 5, z = p.z}

doSendDistanceShoot(basep, pos, 55)

doCombat(cid,combat1,positionToVariant(pos))

end


function onTargetTile2(cid, pos)

local p1 = getThingPos(cid)

local basep1 = {x = p1.x - 5, y = p1.y + 5, z = p1.z}

doSendDistanceShoot(basep1, pos, 55)

doCombat(cid,combat2,positionToVariant(pos))

end


function onTargetTile3(cid, pos)

local p2 = getThingPos(cid)

local basep2 = {x = p2.x - 5, y = p2.y + 5, z = p2.z}

local baseep2 = {x = p2.x + 5, y = p2.y - 5, z = p2.z}

doSendDistanceShoot(basep2, pos, 112)

doSendDistanceShoot(baseep2, pos, 112)

doCombat(cid,combat3,positionToVariant(pos))

end


function onTargetTile4(cid, pos)

local p3 = getThingPos(cid)

local basep3 = {x = p3.x - 5, y = p3.y - 5, z = p3.z}

local baseep3 = {x = p3.x + 5, y = p3.y + 5, z = p3.z}

doSendDistanceShoot(basep3, pos, 112)

doSendDistanceShoot(baseep3, pos, 112)

doCombat(cid,combat4,positionToVariant(pos))

end


setCombatCallback(scom1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatCallback(scom2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")

setCombatCallback(scom3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

setCombatCallback(scom4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")


local function onCastSpell1(parameters)

doCombat(parameters.cid, scom1, parameters.var)

end


local function onCastSpell2(parameters)

doCombat(parameters.cid, scom2, parameters.var)

end


local function onCastSpell3(parameters)

doCombat(parameters.cid, scom3, parameters.var)

end


local function onCastSpell4(parameters)

doCombat(parameters.cid, scom4, parameters.var)

end




function onCastSpell(cid, var)

local waittime = 1,0 -- Tempo de exhaustion em segundos
local storage = 26002

if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "Aguarde" .. exhaustion.get(cid, storage) .. " Segundos Para Usar Novamente.")
return false
end


local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 100, parameters)

addEvent(onCastSpell2, 100, parameters)

addEvent(onCastSpell3, 1200, parameters)

addEvent(onCastSpell4, 1200, parameters)

exhaustion.set(cid, storage, waittime)


return TRUE


end

 

Grato!.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By jhonathan wendrell
      .Qual servidor ou website você utiliza como base? 
      1.2  10.90
      Qual o motivo deste tópico?  preciso fazer esse script funcionar no tfs 1.2  ou de algum script que faça mudar o outfit ao atacar alguém pode me ajudar por favor agradeço muito, mudei meu ot e tfs de 8.60 0.4 para 10.90 1.2 esse script fazia uma animação de atk usando sprites que eu fiz, noa sei mas acho que não tem mas o onAttack no 1.2 se alguem souber como faço agradeço muito desculpe se tiver postado errado mova por favor.
       
      segue o script que eu itilizava
       
       creaturescripts.xml
       
        <event type="attack" name="AttackAnimation" event="script" value="attackanimation.lua"/>
       
       
      creaturescripts/script lua
       
      local outfits = {
             [367] = 372,
             [366] = 160,
             [130] = 373,
             [138] = 373,
      }
      function onAttack(cid, target)
      doCreatureSetLookDirection(cid, getDirectionTo(getPlayerPosition(cid), getPlayerPosition(target)))
              local tmp = getCreatureOutfit(cid)
             if outfits[tmp.lookType] then
                     tmp.lookType = outfits[tmp.lookType]
                     doSetCreatureOutfit(cid, tmp, 900)
             end
             return true
      end
       
       
      login.lua
       
          registerCreatureEvent(cid, "AttackAnimation")
       
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a 
    • By underpunk
      .Qual servidor ou website você utiliza como base? 
      TFS 0.4
      Qual o motivo deste tópico? 
      Queria pedir um script que ao matar um monstro especifico, surgisse a mensagem, "parabens, voce derrotou tal monstro" e ai add uma storage, 
      Pois quero adicionar um sistema de conquistas, "vou usar o quest log para registrar as conquistas por storage"
      Então irei adicionar alguns monstros especificos espalhados no mapa, e cada um dará uma conquista.
      Se puder adicionar para ganhar um ou mais premios seria interessante.
       
       
    • By Hardtokill
      Olá pessoal, estou usando uma base DxP poketibia e estou fazendo algumas quests e eu gostaria de um script para baú que verificasse se o player esta com a bag cheia e não completasse a quest! ou que enviasse os itens para o depot, pois atualmente com meu script se o player clica no baú com a bag cheia ele completa a quest e não ganha a recompensa.
       
    • By tentandosermapper
      Olá amigos, dei uma procurada no forúm mas não vi nada do tipo
      preciso de um script (talkaction) que dê um aviso ao player ao ele fazer algo errado tipo uma 'notation'
       
      ex: /aviso "nomedoplayer", 'motivo'
       
      base que estou usando: alfabaiak
      otx 0.3.6
       
      ( é a primeira vez que posto algo aqui então me desculpe se estiver na área errada)
    • By Bruce Pereira
      TFS 0.4.
      Gostaria de uma spell que impedisse que o alvo não conseguisse se curar por x tempo.
       
      Alguém poderia me passar o contato de um programador de script, como na criação de uma magia?
  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...

Important Information

Confirmação de Termo