JE
pedido

Spell Arrow Storm, Alguem consegue?

Por JeanCristian, 21 de abr. de 2014 em Scripts

resolvido
18
3.4k
JeanCristianJ
21 de abril de 2014 às 22:16

Nome da Spell: arrow storm


Dano: dano baseado na arrow que o personagem esta usando


Tipo de Dano: muda conforme a arrow que usa


Como que ela vai proceder:fica dois segundos mandando arrow para cima como se fossem tiros do personagem para vertical, e logo em seguida fica 2 segundos caindo fechas de cima para baixo como meteoros, aleatorios, e quando chegar ao chao seja o efeito da arrow, se for arrow de gelo o efeito no chao é de ice, mais a chuva e os tiros sao de flexas de gelo ( foi 1 exemplo) o efeito muda conforme o elemento da arrow. qualquer coisa tenho a base para vc fazer.


Quanto tempo pra usar denovo: 5000= 5 segundos


Vocaçoes:3/9/15


(OPCIONAL) Formula: ponha 1 formula qualquer, que depois eu configuro o dano



OneshotO
22 de abril de 2014 às 08:05

Eu consigo.

 

Tchau.

JeanCristianJ
23 de abril de 2014 às 18:19

ahh :@ kkkkkkkkkkkk isso é mancada garou kkkkkkkkkkkkkkkk pow vey posta ai para de ser ruim u.u essa ai foi mancada kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk


'


up

Editado Abril 23 por JeanCristian

OneshotO
24 de abril de 2014 às 10:43

Vê se isso aí dá certo, fiz de cabeça e não tenho como testar no trabalho

local arrow_storm = {
	[2544] = {
		[0] = COMBAT_PHYSICALDAMAGE, -- Tipo de dano
		[1] = CONST_ME_HITAREA, -- Efeito de área
		[2] = CONST_ANI_ARROW, -- Efeito do tiro da flecha
		[3] = 2, -- Área de alcance dos danos
		[4] = {-1.3, -1.5, -30, -45, 5, 5, 2, 3}, -- Fórmula
	},
}

local storage = {78881, 78882}

function onCastSpell(cid, var)
	local arrow = getPlayerSlotItem(cid, CONST_SLOT_AMMO)
	if not arrow then
		doPlayerSendCancel(cid, "You need to equip an arrow type in ammo slot.")
		return false
	end
	
	if not arrow_storm[arrow.itemid] then
		doPlayerSendCancel(cid, "Sorry, you can't use Arrow Storm with this arrow.")
		return false
	end
	
	local tmp = arrow_storm[arrow.itemid]
	
	local isShooting = true
	doCreatureSetStorage(cid, storage[1], os.time() + 2)
	while isShooting do
		local fromPosition = getCreaturePosition(cid)
		local toPosition = fromPosition
		toPosition.y = toPosition.y - 8

		addEvent(doSendDistanceShoot, 55, fromPosition, toPosition, tmp[2])
		if os.time() > getCreatureStorage(cid, storage[1]) then
			isShooting = false
		end
	end
	
	if isShooting == false then
		local fallingArrows = true
		doCreatureSetStorage(cid, storage[2], os.time() + 2)
		while fallingArrows do
			local playerPosition = getCreaturePosition(cid)
			
			local toPosition = {x = math.random(playerPosition.x - tmp[3], playerPosition.x + tmp[3]), y = math.random(playerPosition.y - tmp[3], playerPosition.y + tmp[3]), z = playerPosition.z}

			local fromPosition = toPosition
			fromPosition.y = fromPosition.y - 8
			
			local level = getPlayerLevel(cid)
			local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
			
			local min = (level / tmp[4][5] + skill * tmp[4][7]) * tmp[4][1] + tmp[4][3]
			local max = (level / tmp[4][6] + skill * tmp[4][8]) * tmp[4][2] + tmp[4][4]
			
			doSendDistanceShoot(fromPosition, toPosition, tmp[2]
			addEvent(doAreaCombatHealth, 55, cid, tmp[0], toPosition, 0, min, max, tmp[1])
			
			if os.time() > getCreatureStorage(cid, storage[2]) then
				fallingArrows = false
			end
		end
	end
	return true
end

Editado Abril 24 por Garou

JeanCristianJ
24 de abril de 2014 às 15:21

vo testar

<a href="http://www.casimages.com.br/i/140424083116415770.png.html" mini_140424083116415770.png

GAROUUUUUUUUUUUUUUUUUUUUUUUUU ME AJUDA LOVE <3

Editado Abril 24 por JeanCristian

OneshotO
24 de abril de 2014 às 15:38

Arrumei o erro, era umas "," faltando, vê aí se funciona.

JeanCristianJ
24 de abril de 2014 às 15:40

eu vi, só nao ponhei pq achei que ia fazer merda. apareceu outro erro na linha 58

mini_140424084723220230.png

Editado Abril 24 por JeanCristian

OneshotO
24 de abril de 2014 às 15:48

A imagem do erro que você postou é a das "," que já foi arrumado.

JeanCristianJ
24 de abril de 2014 às 15:49

verdade, desculpa perae vo manda denovo

mini_140424085434101981.png

Editado Abril 24 por JeanCristian

OneshotO
24 de abril de 2014 às 15:53
Melhor resposta

Isso que dá fazer script de cabeça, a gente acaba esquecendo um ")", uma "," pacman%2Bemoticon.png

 

Vê aí, pls

local arrow_storm = {
	[2544] = {
		[0] = COMBAT_PHYSICALDAMAGE, -- Tipo de dano
		[1] = CONST_ME_HITAREA, -- Efeito de área
		[2] = CONST_ANI_ARROW, -- Efeito do tiro da flecha
		[3] = 2, -- Área de alcance dos danos
		[4] = {-1.3, -1.5, -30, -45, 5, 5, 2, 3}, -- Fórmula
	},
}

local storage = {78881, 78882}

function onCastSpell(cid, var)
	local arrow = getPlayerSlotItem(cid, CONST_SLOT_AMMO)
	if not arrow then
		doPlayerSendCancel(cid, "You need to equip an arrow type in ammo slot.")
		return false
	end
	
	if not arrow_storm[arrow.itemid] then
		doPlayerSendCancel(cid, "Sorry, you can't use Arrow Storm with this arrow.")
		return false
	end
	
	local tmp = arrow_storm[arrow.itemid]
	
	local isShooting = true
	doCreatureSetStorage(cid, storage[1], os.time() + 2)
	while isShooting do
		local fromPosition = getCreaturePosition(cid)
		local toPosition = fromPosition
		toPosition.y = toPosition.y - 8

		addEvent(doSendDistanceShoot, 55, fromPosition, toPosition, tmp[2])
		if os.time() > getCreatureStorage(cid, storage[1]) then
			isShooting = false
		end
	end
	
	if isShooting == false then
		local fallingArrows = true
		doCreatureSetStorage(cid, storage[2], os.time() + 2)
		while fallingArrows do
			local playerPosition = getCreaturePosition(cid)
			
			local toPosition = {x = math.random(playerPosition.x - tmp[3], playerPosition.x + tmp[3]), y = math.random(playerPosition.y - tmp[3], playerPosition.y + tmp[3]), z = playerPosition.z}

			local fromPosition = toPosition
			fromPosition.y = fromPosition.y - 8
			
			local level = getPlayerLevel(cid)
			local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
			
			local min = (level / tmp[4][5] + skill * tmp[4][7]) * tmp[4][1] + tmp[4][3]
			local max = (level / tmp[4][6] + skill * tmp[4][8]) * tmp[4][2] + tmp[4][4]
			
			doSendDistanceShoot(fromPosition, toPosition, tmp[2])
			addEvent(doAreaCombatHealth, 55, cid, tmp[0], toPosition, 0, min, max, tmp[1])
			
			if os.time() > getCreatureStorage(cid, storage[2]) then
				fallingArrows = false
			end
		end
	end
	return true
end
JeanCristianJ
24 de abril de 2014 às 15:55

debug no cliente

----- edit-

se vc quizer, precisa desse negocio de arrow nao para nao complicar a sua cabeça,

ponha só para os efeitos subir em diagonal para cima e dps decer como chuva fica mais facil, eu ja vi esse script antes eu sei que é possivel, porem ele mudava o efeito conforme a arrow, se vc quizer pode fazer depois quando chegar em casa, nao quero dar trabalho para vc #garou

Editado Abril 24 por JeanCristian

OneshotO
24 de abril de 2014 às 18:24

Pronto, chefe, fiz usando recursividade, sem debugs e funcionando perfeitamente.

local arrow_storm = {
	[2544] = {
		[0] = COMBAT_PHYSICALDAMAGE, -- Tipo de dano
		[1] = CONST_ME_HITAREA, -- Efeito de área
		[2] = CONST_ANI_ARROW, -- Efeito do tiro da flecha
		[3] = 2, -- Área de alcance dos danos
		[4] = {-1.3, -1.5, -30, -45, 5, 5, 2, 3}, -- Fórmula
	},
}

local storage = {78881, 78882}

local function doArrowCombat(cid, arrow)
	if getCreatureStorage(cid, storage[2]) > os.time() then
		local playerPosition = getCreaturePosition(cid)
		
		local toPosition = {x = math.random(playerPosition.x - arrow[3], playerPosition.x + arrow[3]), y = math.random(playerPosition.y - arrow[3], playerPosition.y + arrow[3]), z = playerPosition.z}

		local fromPosition = {x = toPosition.x, y = toPosition.y - 8, z = toPosition.z}
		
		local level = getPlayerLevel(cid)
		local skill = getPlayerSkillLevel(cid, SKILL_DISTANCE)
		
		local min = (level / arrow[4][5] + skill * arrow[4][7]) * arrow[4][1] + arrow[4][3]
		local max = (level / arrow[4][6] + skill * arrow[4][8]) * arrow[4][2] + arrow[4][4]
		
		doSendDistanceShoot(fromPosition, toPosition, arrow[2])
		doAreaCombatHealth(cid, arrow[0], toPosition, 0, min, max, arrow[1])
		
		addEvent(doArrowCombat, 100, cid, arrow)
	end
end

local function doShootArrows(cid, arrow)
	if os.time() > getCreatureStorage(cid, storage[1]) then
		doCreatureSetStorage(cid, storage[2], os.time() + 2)
		doArrowCombat(cid, arrow)
	else
		local fromPosition = getCreaturePosition(cid)
		local toPosition = {x = fromPosition.x, y = fromPosition.y - 8, z = fromPosition.z}
		
		doSendDistanceShoot(fromPosition, toPosition, arrow[2])
		addEvent(doShootArrows, 100, cid, arrow)
	end
end

function onCastSpell(cid, var)
	local arrow = getPlayerSlotItem(cid, CONST_SLOT_AMMO)
	if arrow.uid == 0 then
		doPlayerSendCancel(cid, "You need to equip an arrow type in ammo slot.")
		return false
	end
	
	if not arrow_storm[arrow.itemid] then
		doPlayerSendCancel(cid, "Sorry, you can't use Arrow Storm with this arrow.")
		return false
	end
	
	doCreatureSetStorage(cid, storage[1], os.time() + 2)
	doShootArrows(cid, arrow_storm[arrow.itemid])
	return true
end

Flw

Editado Abril 24 por Garou

JeanCristianJ
24 de abril de 2014 às 18:36

<p>testar</p>

<br />

<p>ele só nao muda o efeito de atack conforme a arrow, mais blz é só eu fazer + 5 spells iguais com efeitos diferente, e sobre o tempo quando cai no chao, tem como aumentar? para cair mais arrows no chao tipo 3 vezes mais? u.u</p>

<p>o tempo eu ja consegui configurar</p>

<p>agora falta só os efeitos , vc nao consegue fazer eles sairem iguais nao né?</p>

<p>tipo shiver arrow o efeito é de gelo</p>

<p>fire arrow o efeito é de fogo, e por ai vai, tem 1 funçao especifica para soltar a magia conforme a weapon só nao lembro qual é</p>

Editado Abril 24 por JeanCristian

OneshotO
24 de abril de 2014 às 18:47

Não, filhote, você não entendeu, você vai configurar essa tabela aqui, seguindo o modelo da arrow que eu já configurei

local arrow_storm = {
	[2544] = {
		[0] = COMBAT_PHYSICALDAMAGE, -- Tipo de dano
		[1] = CONST_ME_HITAREA, -- Efeito de área
		[2] = CONST_ANI_ARROW, -- Efeito do tiro da flecha
		[3] = 2, -- Área de alcance dos danos
		[4] = {-1.3, -1.5, -30, -45, 5, 5, 2, 3}, -- Fórmula
	},
}

Por exemplo:

local arrow_storm = {
	[2544] = {
		[0] = COMBAT_PHYSICALDAMAGE, -- Tipo de dano
		[1] = CONST_ME_HITAREA, -- Efeito de área
		[2] = CONST_ANI_ARROW, -- Efeito do tiro da flecha
		[3] = 2, -- Área de alcance dos danos
		[4] = {-1.3, -1.5, -30, -45, 5, 5, 2, 3}, -- Fórmula
	},
	[ID_DA_ARROW] = {
		[0] = COMBAT_,-- TIPO DE DANO
		[1] = CONST_ME_, -- TIPO DE EFEITO
		[2] = CONST_ANI_, -- TIPO DE TIRO
		[3] = 0, -- ÁREA QUE AS FLECHAS CAIEM
		[4] = {0, 0, 0, 0, 0, 0, 0, 0}, -- FÓRMULA
	},
}

Se você configurar tudo certo, vai conseguir fazer uma única spell para flecha normal, flecha de fogo, flecha de gelo, flecha do caralho.

 

Flw.

JeanCristianJ
24 de abril de 2014 às 18:47

to com 1 duvida, só sai esse poquinho de arrow? aonde eu configuro para ter cair mais quantitdade de arrow do ceu? eu ja descobri aonde faz para cair por mais tempo, agora quero saber como aumentar a quantidade das arrow que cai


te amo garou <3