Ir para conteúdo

Featured Replies

Postado

Bom tropa do tibiaking, vim aqui mas um vez perdir ajuda de vocês. To tentando cria um wand que hita dois elemental.

 

 

Spoiler

w = {

[1] = {ef = 37, sh = 4, dmg = COMBAT_ENERGYDAMAGE},

[2] = {ef = 43, sh = 36, dmg = COMBAT_ICEDAMAGE},

}

 

function onUseWeapon(cid, var)

min, max = 110, 150 -- dano minimo e maximo

target = getCreatureTarget(cid)

if target ~= 0 then

wx = w[math.random(1, #w)]

doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)

addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)

end

return true

end

 

 

Bom tropa esse script faz tudo que eu quero, mas só que ficou no aleatorio. Tipo o certo que o primeiro hit sair o elemento ENERGY e o segundo elemento ICE. assim por diante.

 

Só que nos script eu eu postei ai em cima O primeiro sair efeito energy e no segundo as vez sair o msm efeito. la no terceiro que sair o efeito ICE.

 

Quero 1 hit ENERGY, 2 hit ICE, 3 hit ENERGY, 4 hit ICE, 5 hit ENERGY, 6 hit ICE assim por diante.

 

Uso tfs 0.4 versao 8.60

Resolvido por luangop

Ir para solução
Postado
  • Solução
w = {
	[1] = {ef = 37, sh = 4, dmg = COMBAT_ENERGYDAMAGE},
	[2] = {ef = 43, sh = 36, dmg = COMBAT_ICEDAMAGE},
}



function onUseWeapon(cid, var)
	local storage = getPlayerStorageValue(cid, 8445601)
	if storage <= 0 then
		atual = 1
	else
		atual = 2
	end
	
	min, max = 110, 150 -- dano minimo e maximo
	target = getCreatureTarget(cid)
	
	if target ~= 0 then
		wx = w[atual]
		doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
		addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
		setPlayerStorageValue(cid, atual == 1 and 1 or 0)
	end
	return true
end

 

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Postado
  • Autor
2 horas atrás, luangop disse:

w = {
	[1] = {ef = 37, sh = 4, dmg = COMBAT_ENERGYDAMAGE},
	[2] = {ef = 43, sh = 36, dmg = COMBAT_ICEDAMAGE},
}



function onUseWeapon(cid, var)
	local storage = getPlayerStorageValue(cid, 8445601)
	if storage <= 0 then
		atual = 1
	else
		atual = 2
	end
	
	min, max = 110, 150 -- dano minimo e maximo
	target = getCreatureTarget(cid)
	
	if target ~= 0 then
		wx = w[atual]
		doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
		addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
		setPlayerStorageValue(cid, atual == 1 and 1 or 0)
	end
	return true
end

 

Muito obrigado  :D

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo