Postado Fevereiro 7, 2017 8 anos weapons/weapons.xml <melee id="XXXX" level="100" unproperly="1" event="script" value="arma.lua"/> weapons/scripts/arma.lua function onUseWeapon(cid, var) local position = getCreaturePosition(cid) local target = variantToNumber(var) local playerTarget = getCreatureTarget(cid) local level = getPlayerLevel(cid) local magic = getPlayerMagLevel(cid) if(target ~= 0) then if (getPlayerVocation(cid) == 1 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 2)) then local dmgMin = (300 + (magic * 1.5)) local dmgMax = (350 + (level * 1.8)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_TELEPORT) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_ENERGYBALL) end if (getPlayerVocation(cid) == 2 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 2)) then local dmgMin = (300 + (magic * 1.5)) local dmgMax = (350 + (level * 1.8)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_SMALLPLANTS) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_POISON) end if (getPlayerVocation(cid) == 3 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 5)) then local dmgMin = (260 + (level * 2.1)) local dmgMax = (360 + (level * 2.3)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_HOLYDAMAGE) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_SMALLHOLY) end if (getPlayerVocation(cid) == 4 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 1)) then local dmgMin = (310 +(level * 2.7)) local dmgMax = (420 +(level * 3.2)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_GROUNDSHAKER) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_SMALLEARTH) end end return ret end Cara, deixei bastante opções de efeitos, multiplicadores de danos e distancias, no weapons.xml só coloca aquela linha ali em cima e cria o script com o nome declarado lá. Qualquer coisa pede ai vejo se consigo fazer, não testei.
Postado Fevereiro 9, 2017 8 anos Autor Em 07/02/2017 ás 17:56, DukeeH disse: weapons/weapons.xml <melee id="XXXX" level="100" unproperly="1" event="script" value="arma.lua"/> weapons/scripts/arma.lua function onUseWeapon(cid, var) local position = getCreaturePosition(cid) local target = variantToNumber(var) local playerTarget = getCreatureTarget(cid) local level = getPlayerLevel(cid) local magic = getPlayerMagLevel(cid) if(target ~= 0) then if (getPlayerVocation(cid) == 1 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 2)) then local dmgMin = (300 + (magic * 1.5)) local dmgMax = (350 + (level * 1.8)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_TELEPORT) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_ENERGYBALL) end if (getPlayerVocation(cid) == 2 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 2)) then local dmgMin = (300 + (magic * 1.5)) local dmgMax = (350 + (level * 1.8)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_SMALLPLANTS) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_POISON) end if (getPlayerVocation(cid) == 3 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 5)) then local dmgMin = (260 + (level * 2.1)) local dmgMax = (360 + (level * 2.3)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_HOLYDAMAGE) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_SMALLHOLY) end if (getPlayerVocation(cid) == 4 and getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(playerTarget) <= 1)) then local dmgMin = (310 +(level * 2.7)) local dmgMax = (420 +(level * 3.2)) ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, CONST_ME_GROUNDSHAKER) and doSendDistanceShoot(position, getCreaturePosition(playerTarget), CONST_ANI_SMALLEARTH) end end return ret end Cara, deixei bastante opções de efeitos, multiplicadores de danos e distancias, no weapons.xml só coloca aquela linha ali em cima e cria o script com o nome declarado lá. Qualquer coisa pede ai vejo se consigo fazer, não testei. Deu erro. "Attempt to compare table with number" Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
Postado Fevereiro 10, 2017 8 anos 13 horas atrás, tetheuscunha disse: Deu erro. "Attempt to compare table with number" Manda uma foto do erro ou copia ele todo? Valeu
Postado Fevereiro 10, 2017 8 anos Autor 7 horas atrás, DukeeH disse: Manda uma foto do erro ou copia ele todo? Valeu Consegui arrumar ja. Obrigado Senhoras e senhores, se alguma resposta lhe ajudou, marque-a como a melhor resposta e de ponto positivo, assim você incentiva quem lhe ajudou a continuar ajudando!!.
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.