Postado Setembro 8, 2017 7 anos Tentei criar umas potions no arquivo liquids, porém não deu certo não. Então, peço 2 action scripts se possivel: 1 - Mana Potion editavel, configuração de quantidade que sobe de mana, no caso, podendo ser, subir apenas 1000, ou, 500 até 1000. 2 - Health Potion + Mp, nesse é mais dificil, precisa identificar a vocação, se for Knight, só heala o Health, se for paladin, heala mapa e life (tipo a spirit potion). Não esquecer de colocar uma mensagemzinha, "aaaah" ao usar, e também, sair em roxo igual um potion, ou vermelho. (tem que ser infinito) --[2099] = {empty = 2099, splash = 47, mana = {750, 1000}, level = 8, vocations = {1, 2, 5, 6, 9, 10}, vocStr = "sorcerers and druids"}, -- potion editavel (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Setembro 9, 2017 7 anos Você consegue editar o valor de heal da mana potion no seu script de potions. Essa parte mana = {750, 1000} é o {valor mínimo, valor máximo} para healar. Sobre o outro, crie um arquivo em actions/scripts: potionifinito.lua Spoiler local t = {level = 10, mana = {500, 1000}, health = {300, 500}, voc_add = { [1] = {"mana"}, -- [id da vocação] [2] = {"mana"}, [3] = {"mana", "health"}, [4] = {"health"}} } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local voc = t.voc_add[getPlayerVocation(cid)] local p = getPlayerPosition(cid) if not voc then doPlayerSendCancel(cid, "Your vocation can not use this item.") doSendMagicEffect(p, CONST_ME_POFF) return true end if(hasCondition(cid, CONDITION_EXHAUST)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) doSendMagicEffect(p, CONST_ME_POFF) return true end if getPlayerLevel(cid) < t.level then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHLEVEL) doSendMagicEffect(p, CONST_ME_POFF) return true end for i = 1, #voc do if voc[i] == "mana" then doPlayerAddMana(cid, math.ceil(math.random(t.mana[1], t.mana[2]))) else doCreatureAddHealth(cid, math.ceil(math.random(t.health[1], t.health[2]))) end end doSendMagicEffect(p, CONST_ME_MAGIC_BLUE) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doAddCondition(cid, exhaust) return true end Em actions.xml: <action itemid="ID_DO_ITEM" script="potioninfinito.lua" /> Contato: Email: [email protected] Discord: Dwarfer#2715
Postado Setembro 9, 2017 7 anos Autor Em teste 34 minutos atrás, Dwarfer disse: Você consegue editar o valor de heal da mana potion no seu script de potions. Essa parte mana = {750, 1000} é o {valor mínimo, valor máximo} para healar. Sobre o outro, crie um arquivo em actions/scripts: potionifinito.lua Mostrar conteúdo oculto local t = {level = 10, mana = {500, 1000}, health = {300, 500}, voc_add = { [1] = {"mana"}, -- [id da vocação] [2] = {"mana"}, [3] = {"mana", "health"}, [4] = {"health"}} } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local voc = t.voc_add[getPlayerVocation(cid)] local p = getPlayerPosition(cid) if not voc then doPlayerSendCancel(cid, "Your vocation can not use this item.") doSendMagicEffect(p, CONST_ME_POFF) return true end if(hasCondition(cid, CONDITION_EXHAUST)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) doSendMagicEffect(p, CONST_ME_POFF) return true end if getPlayerLevel(cid) < t.level then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHLEVEL) doSendMagicEffect(p, CONST_ME_POFF) return true end for i = 1, #voc do if voc[i] == "mana" then doPlayerAddMana(cid, math.ceil(math.random(t.mana[1], t.mana[2]))) else doCreatureAddHealth(cid, math.ceil(math.random(t.health[1], t.health[2]))) end end doSendMagicEffect(p, CONST_ME_MAGIC_BLUE) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doAddCondition(cid, exhaust) return true end Em actions.xml: <action itemid="ID_DO_ITEM" script="potioninfinito.lua" /> Nota 10, uma dúvida, se eu por assim, funciona? E o exaust ta igual o de potion? local t = {level = 8, mana = {750, 1000}, health = {500, 750}, voc_add = { [1,5,9] = {"mana"}, -- [id da vocação] [2,6,10] = {"mana"}, [3,7,11] = {"mana", "health"}, [4,8,12] = {"health"}} } ou [1] = {"mana"}, -- [id da vocação] [2] = {"mana"}, [3] = {"mana", "health"}, [4] = {"health"}, [5] = {"mana"}, -- [id da vocação] [6] = {"mana"}, [7] = {"mana", "health"}, [8] = {"health"}, [9] = {"mana"}, -- [id da vocação] [10] = {"mana"}, [11] = {"mana", "health"}, [12] = {"health"}} } Editado Setembro 9, 2017 7 anos por jNo (veja o histórico de edições) (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Setembro 9, 2017 7 anos Solução @jNo Sim, o exausthed é o mesmo dos potions. Da segunda forma que você colocou aí funcionaria, mas faça assim: Spoiler local t = {level = 8, mana = {500, 1000}, health = {300, 500}, voc_add = { [{1,5,9}] = {"mana"}, [{2,6,10}] = {"mana"}, [{3,7,11}] = {"mana", "health"}, [{4,8,12}] = {"health"}} } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local check, p = {}, getPlayerPosition(cid) for id, v in pairs(t.voc_add) do if isInArray(id, getPlayerVocation(cid)) then check = v break end end if #check == 0 then doPlayerSendCancel(cid, "Your vocation can not use this item.") doSendMagicEffect(p, CONST_ME_POFF) return true end if(hasCondition(cid, CONDITION_EXHAUST)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) doSendMagicEffect(p, CONST_ME_POFF) return true end if getPlayerLevel(cid) < t.level then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHLEVEL) doSendMagicEffect(p, CONST_ME_POFF) return true end for i = 1, #check do if check[i] == "mana" then doPlayerAddMana(cid, math.ceil(math.random(t.mana[1], t.mana[2]))) else doCreatureAddHealth(cid, math.ceil(math.random(t.health[1], t.health[2]))) end end doSendMagicEffect(p, CONST_ME_MAGIC_BLUE) doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1) doAddCondition(cid, exhaust) return true end Contato: Email: [email protected] Discord: Dwarfer#2715
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.