Postado Fevereiro 28, 2015 10 anos É o seguinte eu fiz essa script mas não to conseguindo coloca o dano do jeito que eu quero, eu quero que atinga o oponente com um dano equivalente a 10% do seu life atual. Por exemplo eu to com 700 de life ai uso a magia e do um atk de 70, outro exemplo eu to com 300 de life ai uso a magia e do um atk de 30 Eu já tenho a script feita só basta adicionar o dano. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) local storage = 10002 local tempo = 2 local mana = 12 local ClearMind = 10000 function onCastSpell(cid, var) if getPlayerStorageValue(cid, storage) < os.time() then if getPlayerStorageValue(cid, ClearMind) == -1 then if getCreatureMana(cid) >= mana then doCombat(cid, combat, var) setPlayerStorageValue(cid, storage, os.time() + tempo) doCreatureAddMana(cid, -mana) else doPlayerSendCancel(cid, "É preciso de "..mana.." para usar a magia.") return false end elseif getCreatureMana(cid) >= (mana/2) then doCombat(cid, combat, var) doCreatureAddMana(cid, -mana/2) setPlayerStorageValue(cid, storage, os.time() + tempo) else doPlayerSendCancel(cid, "É preciso de "..mana.." para usar a magia.") return false end else doPlayerSendCancel(cid, "Você tem que esperar "..getPlayerStorageValue(cid, storage) - os.time().." segundos para usar a magia novamente.") return false end return true end Editado Fevereiro 28, 2015 10 anos por RigBy (veja o histórico de edições)
Postado Fevereiro 28, 2015 10 anos Solução local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) local storage = 10002 local tempo = 2 local mana = 12 local ClearMind = 10000 function onCastSpell(cid, var) if getPlayerStorageValue(cid, storage) < os.time() then if getPlayerStorageValue(cid, ClearMind) == -1 then if getCreatureMana(cid) >= mana then doCombat(cid, combat, var) setPlayerStorageValue(cid, storage, os.time() + tempo) doCreatureAddMana(cid, -mana) else doPlayerSendCancel(cid, "É preciso de "..mana.." para usar a magia.") return false end elseif getCreatureMana(cid) >= (mana/2) then health = getCreatureHealth(cid)/10 health = math.ceil(health) doTargetCombatHealth(cid, variantToNumber(var), COMBAT_FIREDAMAGE, -health, -health, -1) doCombat(cid, combat, var) doCreatureAddMana(cid, -mana/2) setPlayerStorageValue(cid, storage, os.time() + tempo) else doPlayerSendCancel(cid, "É preciso de "..mana.." para usar a magia.") return false end else doPlayerSendCancel(cid, "Você tem que esperar "..getPlayerStorageValue(cid, storage) - os.time().." segundos para usar a magia novamente.") return false end return true end Editado Fevereiro 28, 2015 10 anos por Danves (veja o histórico de edições)
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.