Postado Maio 24, 2018 6 anos fala, pessoal! Então, estava pensando num sistema de level para as spells.. Funcionaria assim: Cada spell aumenta 10% do attack com o level, podendo chegar até o level 5 E a única forma de conseguir "upar" de spell level, seria usando a spell... Obrigado desde já!
Postado Dezembro 8, 2023 1 ano local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_IMMORTAL) setConditionParam(condition, CONDITION_PARAM_TICKS, 1500) setCombatCondition(combat, condition) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat2, COMBAT_PARAM_AGGRESSIVE, 0) local condition2 = createConditionObject(CONDITION_IMMORTAL) setConditionParam(condition2, CONDITION_PARAM_TICKS, 2000) setCombatCondition(combat2, condition2) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat3, COMBAT_PARAM_AGGRESSIVE, 0) local condition3 = createConditionObject(CONDITION_IMMORTAL) setConditionParam(condition3, CONDITION_PARAM_TICKS, 3000) setCombatCondition(combat3, condition3) local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat4, COMBAT_PARAM_AGGRESSIVE, 0) local condition4 = createConditionObject(CONDITION_IMMORTAL) setConditionParam(condition4, CONDITION_PARAM_TICKS, 4000) setCombatCondition(combat4, condition4) local combat5 = createCombatObject() setCombatParam(combat5, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) setCombatParam(combat5, COMBAT_PARAM_AGGRESSIVE, 0) local condition5 = createConditionObject(CONDITION_IMMORTAL) setConditionParam(condition5, CONDITION_PARAM_TICKS, 5000) setCombatCondition(combat5, condition5) local function CooldownTime(cid) if isPlayer(cid) == TRUE then doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'CD:Aurea dos Deuses.') end end function onCastSpell(cid, var) local exhaustedstorage = 800005 -- Storage Value do exhausted da magia! local magialevel = getPlayerStorageValue(cid, 800540) local magiaup = getPlayerStorageValue(cid, 800541) local upmagia1 = getPlayerStorageValue(cid, 800541)/100 * 100 local upmagia2 = getPlayerStorageValue(cid, 800541)/100 * 100 local upmagia3 = getPlayerStorageValue(cid, 800541)/100 * 100 local upmagia4 = getPlayerStorageValue(cid, 800541)/100 * 100 local manacast1 = 30*getPlayerMaxMana(cid)/100 local manacast2 = 28*getPlayerMaxMana(cid)/100 local manacast3 = 26*getPlayerMaxMana(cid)/100 local manacast4 = 24*getPlayerMaxMana(cid)/100 local manacast5 = 22*getPlayerMaxMana(cid)/100 local yellow = { lookType = getCreatureOutfit(cid).lookType, lookHead = 79, lookBody = 79, lookLegs = 79, lookFeet = 79, lookAddons = 3 } if hasCondition(cid, CONDITION_EXHAUSTED) == 1 then doPlayerSendTextMessage(cid,20,"Está esgotado.") doSendMagicEffect(getCreaturePosition(cid), 2) return FALSE end if(isPlayer(cid) == 1 and magialevel == 1 and magiaup <= 100 and os.time() < getPlayerStorageValue(cid, exhaustedstorage)) then doPlayerSendCancel(cid,"Aurea dos Deuses em cooldown por " .. getPlayerStorageValue(cid, exhaustedstorage) - os.time() .. " segundos.") return FALSE end if isPlayer(cid) == 1 and magialevel == 1 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerMana(cid) < manacast1 then doPlayerSendTextMessage(cid,20,"Voce nao tem mana suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 1 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerSoul(cid) < 26 then doPlayerSendTextMessage(cid,20,"Voce nao tem Soul suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel < 0 and magiaup < 0 and getPlayerMana(cid) < manacast1 then doPlayerSendTextMessage(cid,20,"Voce nao tem mana suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel < 0 and magiaup < 0 and getPlayerSoul(cid) < 26 then doPlayerSendTextMessage(cid,20,"Voce nao tem Soul suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel < 0 and magiaup < 0 then setPlayerStorageValue(cid, 800540, 1) setPlayerStorageValue(cid, 800541, 1) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 26) doPlayerSendTextMessage(cid,24,"Magia: Aurea dos Deuses, Level da Magia: 1 Up: 0%.") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-26) doSetCreatureOutfit(cid, yellow, 1500) addEvent(CooldownTime, 1*26000,cid) doPlayerAddManaSpell(cid,manacast1) doPlayerAddManaSpent(cid,manacast1) doCombat(cid, combat, var) return FALSE end if isPlayer(cid) == 1 and magialevel == 1 and magiaup < 100 then setPlayerStorageValue(cid, 800541, magiaup+1) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 26) doPlayerSendTextMessage(cid,24,"Magia: Aurea dos Deuses, Level da Magia: "..magialevel.." Up: "..math.ceil(upmagia1).."%.") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-26) doSetCreatureOutfit(cid, yellow, 1500) addEvent(CooldownTime, 1*26000,cid) doPlayerAddManaSpell(cid,manacast1) doPlayerAddManaSpent(cid,manacast1) doCombat(cid, combat, var) return FALSE end if isPlayer(cid) == 1 and magialevel == 1 and magiaup == 100 then setPlayerStorageValue(cid, 800540, magialevel+1) setPlayerStorageValue(cid, 800541, magiaup-magiaup) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 26) doPlayerSendTextMessage(cid,22,"Parabéns, agora sua magia Aurea dos Deuses está level "..1+magialevel..".") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-26) doSetCreatureOutfit(cid, yellow, 1500) addEvent(CooldownTime, 1*26000,cid) doPlayerAddManaSpell(cid,manacast1) doPlayerAddManaSpent(cid,manacast1) doCombat(cid, combat, var) return FALSE end if(isPlayer(cid) == 1 and magialevel == 2 and magiaup <= 100 and os.time() < getPlayerStorageValue(cid, exhaustedstorage)) then doPlayerSendCancel(cid,"Aurea dos Deuses em cooldown por " .. getPlayerStorageValue(cid, exhaustedstorage) - os.time() .. " segundos.") return FALSE end if isPlayer(cid) == 1 and magialevel == 2 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerMana(cid) < manacast2 then doPlayerSendTextMessage(cid,20,"Voce nao tem mana suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 2 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerSoul(cid) < 24 then doPlayerSendTextMessage(cid,20,"Voce nao tem Soul suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 2 and magiaup < 100 then setPlayerStorageValue(cid, 800541, magiaup+1) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 28) doPlayerSendTextMessage(cid,24,"Magia: Aurea dos Deuses, Level da Magia: "..magialevel.." Up: "..math.ceil(upmagia2).."%.") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-24) doSetCreatureOutfit(cid, yellow, 2000) doPlayerAddManaSpell(cid,manacast2) doPlayerAddManaSpent(cid,manacast2) addEvent(CooldownTime, 1*28000,cid) doCombat(cid, combat2, var) return false end if isPlayer(cid) == 1 and magialevel == 2 and magiaup == 100 then setPlayerStorageValue(cid, 800540, magialevel+1) setPlayerStorageValue(cid, 800541, magiaup-magiaup) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 28) doPlayerSendTextMessage(cid,22,"Parabéns, agora a magia Aurea dos Deuses está level "..1+magialevel..".") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-24) doSetCreatureOutfit(cid, yellow, 2000) doPlayerAddManaSpell(cid,manacast2) doPlayerAddManaSpent(cid,manacast2) addEvent(CooldownTime, 1*28000,cid) doCombat(cid, combat2, var) return false end if(isPlayer(cid) == 1 and magialevel == 3 and magiaup <= 100 and os.time() < getPlayerStorageValue(cid, exhaustedstorage)) then doPlayerSendCancel(cid,"Aurea dos Deuses em cooldown por " .. getPlayerStorageValue(cid, exhaustedstorage) - os.time() .. " segundos.") return FALSE end if isPlayer(cid) == 1 and magialevel == 3 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerMana(cid) < manacast3 then doPlayerSendTextMessage(cid,20,"Voce nao tem mana suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 3 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerSoul(cid) < 22 then doPlayerSendTextMessage(cid,20,"Voce nao tem Soul suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 3 and magiaup < 100 then setPlayerStorageValue(cid, 800541, magiaup+1) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 26) doPlayerSendTextMessage(cid,24,"Magia: Aurea dos Deuses, Level da Magia: "..magialevel.." Up: "..math.ceil(upmagia3).."%.") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-22) doSetCreatureOutfit(cid, yellow, 3000) doPlayerAddManaSpell(cid,manacast3) doPlayerAddManaSpent(cid,manacast3) addEvent(CooldownTime, 1*26000,cid) doCombat(cid, combat3, var) return false end if isPlayer(cid) == 1 and magialevel == 3 and magiaup == 100 then setPlayerStorageValue(cid, 800540, magialevel+1) setPlayerStorageValue(cid, 800541, magiaup-magiaup) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 26) doPlayerSendTextMessage(cid,22,"Parabéns, agora a magia Aurea dos Deuses está level "..1+magialevel..".") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-22) doSetCreatureOutfit(cid, yellow, 3000) doPlayerAddManaSpell(cid,manacast3) doPlayerAddManaSpent(cid,manacast3) addEvent(CooldownTime, 1*26000,cid) doCombat(cid, combat3, var) return false end if(isPlayer(cid) == 1 and magialevel == 4 and magiaup <= 100 and os.time() < getPlayerStorageValue(cid, exhaustedstorage)) then doPlayerSendCancel(cid,"Aurea dos Deuses em cooldown por " .. getPlayerStorageValue(cid, exhaustedstorage) - os.time() .. " segundos.") return FALSE end if isPlayer(cid) == 1 and magialevel == 4 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerMana(cid) < manacast4 then doPlayerSendTextMessage(cid,20,"Voce nao tem mana suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 4 and magiaup <= 100 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerSoul(cid) < 22 then doPlayerSendTextMessage(cid,20,"Voce nao tem Soul suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 4 and magiaup < 100 then setPlayerStorageValue(cid, 800541, magiaup+1) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 24) doPlayerSendTextMessage(cid,24,"Magia: Aurea dos Deuses, Level da Magia: "..magialevel.." Up: "..math.ceil(upmagia4).."%.") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-20) doSetCreatureOutfit(cid, yellow, 4000) doPlayerAddManaSpell(cid,manacast4) doPlayerAddManaSpent(cid,manacast4) addEvent(CooldownTime, 1*24000,cid) doCombat(cid, combat4, var) return false end if isPlayer(cid) == 1 and magialevel == 4 and magiaup == 100 then setPlayerStorageValue(cid, 800540, magialevel+1) setPlayerStorageValue(cid, 800541, magiaup-magiaup) setPlayerStorageValue(cid, exhaustedstorage, os.time() + 24) doPlayerSendTextMessage(cid,22,"Parabéns, agora a magia Aurea dos Deuses está level "..1+magialevel..".") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddSoul(cid,-20) doSetCreatureOutfit(cid, yellow, 4000) doPlayerAddManaSpell(cid,manacast4) doPlayerAddManaSpent(cid,manacast4) addEvent(CooldownTime, 1*24000,cid) doCombat(cid, combat4, var) return false end if(isPlayer(cid) == 1 and magialevel == 5 and os.time() < getPlayerStorageValue(cid, exhaustedstorage)) then doPlayerSendCancel(cid,"Aurea dos Deuses em cooldown por " .. getPlayerStorageValue(cid, exhaustedstorage) - os.time() .. " segundos.") return FALSE end if isPlayer(cid) == 1 and magialevel == 5 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerMana(cid) < manacast5 then doPlayerSendTextMessage(cid,20,"Voce nao tem mana suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 5 and os.time() > getPlayerStorageValue(cid, exhaustedstorage) and getPlayerSoul(cid) < 18 then doPlayerSendTextMessage(cid,20,"Voce nao tem Soul suficiente para usar esta magia.") return FALSE end if isPlayer(cid) == 1 and magialevel == 5 then setPlayerStorageValue(cid, exhaustedstorage, os.time() + 22) doPlayerSendTextMessage(cid,24,"Magia: Aurea dos Deuses, Level da Magia: 5.") doCreatureSay(cid,"Exeta Mas God!", 16) doPlayerAddManaSpell(cid,manacast5) doPlayerAddManaSpent(cid,manacast5) addEvent(CooldownTime, 1*22000,cid) doPlayerAddSoul(cid,-18) doSetCreatureOutfit(cid, yellow, 5000) doCombat(cid, combat5, var) return false end end
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.