BE
dúvida

Mudanca De Runa, Trocando Formula, Ajuda!

Por beddy, 18 de jun. de 2012 em Scripts

ajuda
3
998
beddyB
18 de junho de 2012 às 08:45

TFS 8.6

 

 

local runa = 2394
local msg = "Equipe a %s na mão, para poder atirar."
local attackmin, attackmax = 300, 340 -- attack minimo, attack maximo
function onCastSpell(cid, var)
	local left, right = getPlayerSlotItem(cid, CONST_SLOT_LEFT), getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
	if isInArray({left.itemid, right.itemid}, runa) then
	else
			return doPlayerSendCancel(cid, msg:format(getItemNameById(runa)))
	end
if doPlayerRemoveItem(cid, 2543, 1) then -- troque pelo id da bolt
target = getCreatureTarget(cid)
if (target <= 0) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Selecione um target.")
return false
end
hit = (math.random(attackmin,attackmax) + getPlayerSkillLevel(cid, SKILL_DISTANCE) / 3)
							   doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA)
								doSendDistanceShoot(getCreaturePos(cid), getCreaturePos(target), CONST_ANI_BOLT)
								return  TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.")
return false
end

 

 

Quero mudar a formula do hit para seguinte:

 

hit = (math.random(attackmin,attackmax) + VER SE TEM UM ITEM XXXX, EQUIPADO NO ANEL, entao ADICIONAR +30 de HIT
														 + VER SE TEM OUTRO ITEM , EQUIPADO NO ANEL, ENTAO ADICIONAR +30 de HIT
							   doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA)
							    doSendDistanceShoot(getCreaturePos(cid), getCreaturePos(target), CONST_ANI_BOLT)
							    return  TRUE
end

 

se tiver um item XXXX equipado no ANEL, adicionar mais 30 de hit

se tiver outro item XXXX equipado no ANEL. adicionar mais 50 de hit

 

 

alguem ajuda?

UP!

Editado Junho 18 por beddy

jhon992J
18 de junho de 2012 às 11:35

local runa = 2394
local msg = "Equipe a %s na mão, para poder atirar."
local attackmin, attackmax = 300, 340 -- attack minimo, attack maximo

local ring = { -- [iddoitemnoslotdoring] = acrescimonohit
[1234] = 30,
[1235] = 50
}


function onCastSpell(cid, var)
local left, right = getPlayerSlotItem(cid, CONST_SLOT_LEFT), getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
if not isInArray({left.itemid, right.itemid}, runa) then
	return doPlayerSendCancel(cid, msg:format(getItemNameById(runa)))
 end
if doPlayerRemoveItem(cid, 2543, 1) then -- troque pelo id da bolt
	target = getCreatureTarget(cid)
	if (target <= 0) then
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Selecione um target.")
		return false
	end
	hit = (math.random(attackmin,attackmax) + getPlayerSkillLevel(cid, SKILL_DISTANCE) / 3)
	if ring[getPlayerSlotItem(cid, CONST_SLOT_RING).itemid] then
		hit = hit + ring[getPlayerSlotItem(cid, CONST_SLOT_RING).itemid]
	end
	doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA)
	doSendDistanceShoot(getCreaturePos(cid), getCreaturePos(target), CONST_ANI_BOLT)
	return true
else
	doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.")
end
return false
end

 

@Edited:

- Arrumado.

Editado Junho 18 por Jhon992

beddyB
18 de junho de 2012 às 12:05

Quando coloco os ANEIS, ele nao acrecenta 30 a mais de hit