Ir para conteúdo

Featured Replies

Postado

Olá,gostaria que me ajudassem com uma magia que ao usar no target iria deixar ele trapado(não ficaria stun,ficaria imóvel mesmo) e uma que faria a mesma coisa só que em área proucurei aqui no tk mas não achei :/, não sei se coloquei na área certa não manjo muito das áreas aqui do tk

Editado por G Asa (veja o histórico de edições)

Resolvido por Capitao wyz

Ir para solução
Postado

Este tópico foi movido para a seção de Suporte Otserv Alternativo

function onLove()
if getPlayerTrueLove(girlfriend) then
doPlayerBeHappy(cid, true)
doRemoveVirginity(cid, true)
else
doSendCancel(cid,"you do not know how good it feels to be loved")
end end

;)

 

Postado
Em 06/04/2021 em 19:34, G Asa disse:

Olá,gostaria que me ajudassem com uma magia que ao usar no target iria deixar ele trapado(não ficaria stun,ficaria imóvel mesmo) e uma que faria a mesma coisa só que em área proucurei aqui no tk mas não achei :/, não sei se coloquei na área certa não manjo muito das áreas aqui do tk

algo tipo isso? 

(não ta funcional)

local pos = getThingPos(cid)
local positions = { 
	[1] = {x = pos.x, y = pos.y-1, z = pos.z},
	[2] = {x = pos.x -1, y = pos.y-1, z = pos.z},
	}
	
function isWalkable(positions) -- by Nord / editado por Omega
	if getTileThingByPos({x = positions.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then
		return false
	elseif isCreature(getTopCreature(pos).uid) then
		return false
	elseif getTileInfo(pos).protection then
		return false
	elseif hasProperty(getThingFromPos(pos).uid, 3) or hasProperty(getThingFromPos(pos).uid, 7) then
		return false
	end
	return true
end 
function onCastSpell(cid, var)
	for _, var in pairs(positions) do
		if isWalkable(var) then
		doCreatureSetNoMove(var, 1)
		
		local combat = createCombatObject()
		return doCombat(cid, combat, var)
		end
	end
	return true
end

 

Postado
  • Solução

Em area

 

local config = {
	exhaust_storage = 5750,
	exhaust_time = 30,
	
	-- walls conf
	walls_time = 10,
	area_size = 3,
	walls_pos = {
		["vertical"] = 13051,
		["horizontal"] = 13051,
		["rightcorner"] = 13051,
		["leftcorner"] = 13051
	}
}

local function buildWalls(cid)
	local cid_pos = getThingPosition(cid)
	local size = config.area_size
	for x = -size, size do
		for y = -size, size do
			if(math.abs(x) == size or math.abs(y) == size) then
				local target_pos = {x = (cid_pos.x + x), y = (cid_pos.y + y), z = cid_pos.z}
				if(doTileQueryAdd(cid, target_pos) == 1 and not getTileInfo(target_pos).protection) then
					local create_item = nil
					if(x == -size and y == -size) then
						create_item = config.walls_pos["leftcorner"]
					elseif(x == size and y == size) then
						create_item = config.walls_pos["rightcorner"]
					elseif(math.abs(x) == size and not (x == size and y == -size)) then
						create_item = config.walls_pos["vertical"]
					else
						create_item = config.walls_pos["horizontal"]
					end
					
					doCreateItem(create_item, 1, target_pos)
					local _time = config.walls_time
					for i = 0, _time do
						addEvent(function()
							local uid = getTileItemById(target_pos, create_item).uid
							if(uid ~= 0) then
								if(i < _time) then
									doSendAnimatedText(target_pos, (_time - i), 180)
								else
									doRemoveItem(uid)
								end
							end
						end, 1000 * i)
					end
				end
			end
		end
	end
end

function onCastSpell(cid, var)
	if(isPlayer(cid) and exhaustion.check(cid, config.exhaust_storage)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde " .. exhaustion.get(cid, config.exhaust_storage) .. " segundos para usar novamente.")
		return false
	end
	
	exhaustion.set(cid, config.exhaust_storage, config.exhaust_time)
	buildWalls(cid)
	return true
end
	<instant name="Nome da magia" words="Nome da magia" lvl="325" mana="10" aggressive="1" range="5" blockwalls="1" selftarget="1" exhaustion="1900" needlearn="0" event="script" value="EX:Hashirama/Nome da magia.lua">

Em Target

local t = { 
remove_time = 5, -- tempo em segundos para remover as magic wall
item_id = 13057, -- id da lavar que vai ficar ao redor
effe =  480 -- efeito da lava(fogo- sla)
}

function isWalkable(pos, creature, pz, proj)
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
	local creature = getTopCreature(pos)
    if creature.type > 0 then	return false end
	if getTilePzInfo(pos) and not pz then return false end
	local n = not proj and 3 or 2
	for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
	end
return true
end

function removeItem(posAll)
	for i=1, #posAll do
		for j=0, 255 do
			pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j}
			removeTile = getThingfromPos(pos_stack)
			if removeTile.itemid == t.item_id then
				doRemoveItem(removeTile.uid)
			end
		end
	end
end

function onCastSpell(cid, var)



local waittime = 3 -- Tempo de exhaustion em segundos
local storage = 5853 -- Storage de Spell, nunca usar a mesma em outra spell, a menos que não queira usar duas spell juntas!

if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
return false
end

local pos = getPlayerPosition(getCreatureTarget(cid))
posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}
posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}
posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}
posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}
posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}
posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}
posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}
posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}
posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8}


---- aqui \/ você configura de acordo com a posição do seu efeito, para centralizar ele
local pose = getPlayerPosition(getCreatureTarget(cid))
posTe1 = {x=pose.x+1,y=pose.y+1,z=pose.z}
posTe2 = {x=pose.x+1,y=pose.y,z=pose.z}
posTe3 = {x=pose.x+1,y=pose.y-1,z=pose.z}
posTe4 = {x=pose.x,y=pose.y-1,z=pose.z}
posTe5 = {x=pose.x-0,y=pose.y-1,z=pose.z}
posTe6 = {x=pose.x-0,y=pose.y,z=pose.z}
posTe7 = {x=pose.x-0,y=pose.y+1,z=pose.z}
posTe8 = {x=pose.x,y=pose.y+1,z=pose.z}
posTall = {posTe1,posTe2,posTe3,posTe4,posTe5,posTe6,posTe7,posTe8}
--- fim /\ da configuração

for a= 1, #posTall do
doSendMagicEffect(posTall[a], t.effe)
end

addEvent(function()
for i=1, #posAll do
	if isWalkable(posAll[i]) then
		doCreateItem(t.item_id, 1, posAll[i])
	end
end
end, 500)

addEvent(removeItem, t.remove_time*1000, posAll)
exhaustion.set(cid, storage, waittime)

return true
end
<instant name="Nome da magia" words="Nome da magia" lvl="180" mana="10" aggressive="1" range="5" blockwalls="1" needtarget="1" exhaustion="1900" needlearn="0" event="script" value="EX:Hashirama/Nome da magia.lua">

Se ajudei deixe o like e rep se possivel :3

  • 3 weeks later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo