Quanta criatividade!
Se alguém conseguir, também irei colocar no meu OT.
Parabéns pela criativade ![]()
info
Grupo: Campones
Registrado: 09/10/11
Posts: 51
Reputação: +2
Char no Tibia: Secret :x

Quanta criatividade!
Se alguém conseguir, também irei colocar no meu OT.
Parabéns pela criativade ![]()
Eai, bom fiz a primeira spell, mas não cheguei a testá-la entao não sei se irá funcionar ![]()
local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+20) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_SUBID, 50) function onCastSpell(cid, var) doAddCondition(cid, condition) addEvent(doRemoveCondition, 10*60*1000, cid, CONDITION_ATTRIBUTES) return true end
Bom é isso ![]()
A segunda magia fiz assim:
--< Copyleft by Digaao for xtibia >--
local area = {
{-1, 0, 1},
{-1, "n", 1},
{-1, 0, 1}
}
function isNum(str)
return tonumber(str) ~= nil
end
function onCastSpell(cid, var)
local config = {
monster = false, -- mover monster?
player = true, -- mover player?
npc = false, -- mover npcs?
sqm = 3 -- numero de sqm para a afastar
}
local a = -2
local b = getCreaturePosition(cid)
local cont = 0
for c, d in ipairs(area) do
for _, e in ipairs(d) do
if e ~= "n" and type(e) == "number" then
local f = { x=b.x+e, y=b.y+a+c, z=b.z, stackpos=253 }
local g = getThingFromPos(f).uid
if (config.monster == true and isMonster(g)) or (config.player == true and isPlayer(g)) or (config.npc == true and isNpc(g)) and not isPlayerGhost(cid) then
local h = { x=f.x, y=f.y, z=f.z }
local i = config.sqm
if a+c < 0 then h.y = h.y - i end
if a+c > 0 then h.y = h.y + i end
if e < 0 then h.x = h.x - i end
if e > 0 then h.x = h.x + i end
local j = getClosestFreeTile(g, h, true, true)
if (j ~= false and isNum(j.x .. j.y .. j.z) and j.x > 0 and j.y > 0 and j.z >= 0 and j.z <= 15) then
cont = cont + 1
doTeleportThing(g, j, true)
end
end
end
end
end
if cont > 0 then
doPlayerSendCancel(cid, cont .. " creature foram afastadas de voce!")
for i = 1, 30 do
doSendDistanceShoot(b, {x = b.x + math.random(-7, 7), y = b.y + math.random(-5, 5), z = b.z}, 4)
end
else
doPlayerSendCancel(cid, "Nao foi possivel afastar nenhuma creature de voce!")
doSendMagicEffect(b, CONST_ME_POFF)
end
doCreatureSay(cid, "AFASTEM-SE", TALKTYPE_ORANGE_1, false)
return true
end
Você só precisa a principio mudar o true/false no config ![]()
Creio que funcionara ![]()
Editado Outubro 18 por Digaao
info
Grupo: Campones
Registrado: 09/10/11
Posts: 7
Reputação: +2
Char no Tibia: Zina Lee
Bom galera eu qero fze aki em meu ot 2 spells, mas estou com certa dificuldades para faze-los
o 1° eu qero q o player ganhe 20% a mais de sua vida total durante tantos minutos, como se foce um buff, omax q eu consegui foi isso ae, deu certo so q se o player morre ou desloga ele n perde os 20% d vida q ele ganho com o spell:
function onCastSpell(cid, var,param) local max = getCreatureMaxHealth(cid) setCreatureMaxHealth(cid, max+20*(max/100)) doCreatureAddHealth(cid, 20*(max/100)) doSetCreatureOutfit(cid,{lookType = 16, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons},10 * 60 * 1000) doAddCondition(cid, condition) doAddCondition(cid, condition2) doAddCondition(cid, condition3) addEvent(setCreatureMaxHealth,600000,-20*(max/100)) return LUA_NO_ERROR endO segundo eu nem sei se eh possivel, mais vai ai o pedido, qeria um spell q mande os players inimigos q estão em volta do player q esta apanhando para uns 3 sqm para tras,esse é um ataque em area entao n funciona o getCreatureTarget(cid), esse eu so consegui manda o TARGET para uma distancia certa tipo pos.x-5, eu qero q mande para tras n importa onde ele esteja,
judiei neh
hauhuaahauh
flw
abrçss