Postado Maio 30, 2014 10 anos Hello! Bom, gostaria de saber se alguém pode disponibilizar uma action de "life rune" Funciona assim... O player faz uma quest com storage "12355", e ganha uma "life rune"... mas para evitar de varios noob char fazer ela e poder vender pra outro... queria colocar na action da rune um comando que conta se o player tem essa storage... se tiver ele pode usar o item, se não tiver, vai aparecer a msg "sorry, not possible." quando usa ela irá aparecer a msg do player falando "Aaaah..." e com exaust de 1 segundo. Rep+ pra quem ajudar. Obrigado
Postado Maio 30, 2014 10 anos Solução Irei tentar fazer o script pra ti.., Quanto tu quer que essa "rune" cure? Vc já tem o script do bau que dará a life rune? Peguei 1 script de potion que tinha aqui e editei pra funcionar como vc quiser.... liferune.lua Mostrar conteúdo oculto --Configuração local msg1 = "Vc deve fazer tal quest para usar esta runa" -- Mensagem se o player tentar usar e não tiver a runa local minum = 1000 --mínimo que runa ira curar local maxum = 2000 --máximo que sua rua irá curar local suaruna = 2343 -- Id da sua runa local config = { removeOnUse = "no", usableOnTarget = "yes", -- can be used on target? (fe. healing friend) splashable = "no", realAnimation = "no", -- make text effect visible only for players in range 1x1 healthMultiplier = 1.0, manaMultiplier = 1.0 } config.removeOnUse = getBooleanFromString(config.removeOnUse) config.usableOnTarget = getBooleanFromString(config.usableOnTarget) config.splashable = getBooleanFromString(config.splashable) config.realAnimation = getBooleanFromString(config.realAnimation) local POTIONS = { [suaruna] = {empty = 7636, splash = 2, health = {minum, maxum}}, -- Runa } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local potion = POTIONS[item.itemid] if (getPlayerStorageValue(cid, stor) <= 0) then doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, msg1) return true end if(not potion) then return false end if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then if(not config.splashable) then return false end if(toPosition.x == CONTAINER_POSITION) then toPosition = getThingPos(item.uid) end doDecayItem(doCreateItem(2016, potion.splash, toPosition)) doTransformItem(item.uid, potion.empty) return TRUE end if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1) return TRUE end local health = potion.health if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then return false end local mana = potion.mana if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then return false end doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE) if(not realAnimation) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) else for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do if(isPlayer(tid)) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid) end end end doAddCondition(cid, exhaust) if(not potion.empty or config.removeOnUse) then doRemoveItem(item.uid, 1) return TRUE end doRemoveItem(item.uid, 0) doPlayerAddItem(cid, potion.empty, 0) doPlayerRemoveItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) doPlayerAddItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) return TRUE end Para configurar altere lá onde tem configuração actions.xml Mostrar conteúdo oculto <action itemid="id ad sua runa" script="liferune.lua" /> Teste ae acredito que estará funcionando. Editado Maio 30, 2014 10 anos por llucas75 (veja o histórico de edições) Scripter: |||||||||| 10% Te ajudei?? REP + e ficamos quites... Atenciosamente, Lucas. Abraços!
Postado Maio 30, 2014 10 anos Autor irei testar e posto o resultado =D certinho, vlw Editado Maio 31, 2014 10 anos por zuckah (veja o histórico de edições)
Postado Maio 31, 2014 10 anos Amigo tinha faltado 1 variável usa oque eu vou postar agora... Mostrar conteúdo oculto --Configuração local msg1 = "Vc deve fazer tal quest para usar esta runa" -- Mensagem se o player tentar usar e não tiver a runa local minum = 1000 --mínimo que runa ira curar local maxum = 2000 --máximo que sua rua irá curar local suaruna = 2343 -- Id da sua runa local stor = 12355 -- storage que sera verificado local config = { removeOnUse = "no", usableOnTarget = "yes", -- can be used on target? (fe. healing friend) splashable = "no", realAnimation = "no", -- make text effect visible only for players in range 1x1 healthMultiplier = 1.0, manaMultiplier = 1.0 } config.removeOnUse = getBooleanFromString(config.removeOnUse) config.usableOnTarget = getBooleanFromString(config.usableOnTarget) config.splashable = getBooleanFromString(config.splashable) config.realAnimation = getBooleanFromString(config.realAnimation) local POTIONS = { [suaruna] = {empty = 7636, splash = 2, health = {minum, maxum}}, -- Runa } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) function onUse(cid, item, fromPosition, itemEx, toPosition) local potion = POTIONS[item.itemid] if (getPlayerStorageValue(cid, stor) <= 0) then doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, msg1) return true end if(not potion) then return false end if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then if(not config.splashable) then return false end if(toPosition.x == CONTAINER_POSITION) then toPosition = getThingPos(item.uid) end doDecayItem(doCreateItem(2016, potion.splash, toPosition)) doTransformItem(item.uid, potion.empty) return TRUE end if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1) return TRUE end local health = potion.health if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then return false end local mana = potion.mana if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then return false end doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE) if(not realAnimation) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) else for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do if(isPlayer(tid)) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid) end end end doAddCondition(cid, exhaust) if(not potion.empty or config.removeOnUse) then doRemoveItem(item.uid, 1) return TRUE end doRemoveItem(item.uid, 0) doPlayerAddItem(cid, potion.empty, 0) doPlayerRemoveItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) doPlayerAddItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) return TRUE end Scripter: |||||||||| 10% Te ajudei?? REP + e ficamos quites... Atenciosamente, Lucas. Abraços!
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.