Ae gente, queria saber se vocês podem me ajuda, como botar o potion igual ao pxg Ex: você usa o hyper potion e encima do seu pokémon, sair um nome grande HYPER POTION quem me ajuda eu do rep+
[Encerrado] Potion igual ao pxg
É tipo uma mana rune de tibia? (Não entendo nada de outros jogos como PokeTibia, Pokemon, GTA, sei lá, só mesmo de tibia, Mas, vou te passar o script de mana rune editado, talvez pode ser igual as configurações de PXG a de Tibia).
Vá em: Pasta do seu OT/data/spells/scripts/support/mana rune.lua:
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 280, 0, 320) function onCastSpell(cid, var) return doCombat(cid, combat, var) end function onCastSpell(cid, var) if getPlayerLevel(cid) > 400 then doSendAnimatedText(getPlayerPosition(cid), "Aaaaah...", TEXTCOLOR_RED) elseif getPlayerLevel(cid) > 300 then doSendAnimatedText(getPlayerPosition(cid), "Aaaaah...", TEXTCOLOR_WHITE) elseif getPlayerLevel(cid) > 200 then doSendAnimatedText(getPlayerPosition(cid), "Aaaaah...", TEXTCOLOR_ORANGE) elseif getPlayerLevel(cid) > 1 then doSendAnimatedText(getPlayerPosition(cid), "Aaaaah...", TEXTCOLOR_BLUE) end if (((getPlayerLevel(cid))%10) == 0) then manaextra = (((getPlayerLevel(cid))/10)*3) else manaextra = ((((getPlayerLevel(cid))/10)+0.5)*3) end doCreatureAddMana(cid, manaextra) return doCombat(cid, combat, var) end
Vá em: Pasta do seu OT/data/spells/spells.xml:
<rune name="Mana Rune" id="2296" allowfaruse="1" charges="100" lvl="10" maglv="1" exhaustion="800" aggressive="0" needtarget="1" blocktype="solid" script="support/mana rune.lua"/>
É pra healar mana ou hp? se for hp, me desculpe, então não sei. Só estou tentando ajudar.
OBS: Não esqueça de editar o script.
hmmm é tipo uma actions, eu uso a base do pda slicer o script do potion é essa
function doHealOverTime(cid, div, turn, effect) --alterado v1.6 peguem o script todo!!
if not isCreature(cid) then return true end
if turn <= 0 or (getCreatureHealth(cid) == getCreatureMaxHealth(cid)) or getPlayerStorageValue(cid, 173) <= 0 then
setPlayerStorageValue(cid, 173, -1)
return true
end
local d = div / 10000
local amount = math.floor(getCreatureMaxHealth(cid) * d)
doCreatureAddHealth(cid, amount)
if math.floor(turn/10) == turn/10 then
doSendMagicEffect(getThingPos(cid), effect)
end
addEvent(doHealOverTime, 100, cid, div, turn - 1, effect)
end
local potions = {
[12347] = {effect = 13, div = 30}, --super potion
[12348] = {effect = 13, div = 50}, --great potion
[12346] = {effect = 12, div = 60}, --ultra potion
[12345] = {effect = 14, div = 70}, --hyper potion
[12343] = {effect = 14, div = 100},
}
function onUse(cid, item, frompos, item2, topos)
local pid = getThingFromPosWithProtect(topos)
if not isCreature(pid) or not isSummon(pid) then
return doPlayerSendCancel(cid, "You can only use potions on pokemons!")
end
if getCreatureMaster(pid) ~= cid then
return doPlayerSendCancel(cid, "You can only use potions on your own Pokemons!")
end
if getCreatureHealth(pid) == getCreatureMaxHealth(pid) then
return doPlayerSendCancel(cid, "This pokemon is already at full health.")
end
if getPlayerStorageValue(pid, 173) >= 1 then
return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.")
end
if getPlayerStorageValue(cid, 52481) >= 1 then
return doPlayerSendCancel(cid, "You can't do that while a duel.")
end
doCreatureSay(cid, ""..getCreatureName(pid)..", take this potion!", TALKTYPE_SAY)
doSendMagicEffect(getThingPos(pid), 172)
setPlayerStorageValue(pid, 173, 1)
doRemoveItem(item.uid, 1)
local a = potions[item.itemid]
doHealOverTime(pid, a.div, 100, a.effect)
return true
end
Eu queria que quando você usa se cada potion no pokémon sai se o nome do potion em cima do pokémon exemplo: Usei Great potion no charizard ai encima dele aparecer GREAT POTION
Usa esse aqui.
function doHealOverTime(cid, div, turn, effect) --alterado v1.6 peguem o script todo!! if not isCreature(cid) then return true end if turn <= 0 or (getCreatureHealth(cid) == getCreatureMaxHealth(cid)) or getPlayerStorageValue(cid, 173) <= 0 then setPlayerStorageValue(cid, 173, -1) return true end local d = div / 10000 local amount = math.floor(getCreatureMaxHealth(cid) * d) doCreatureAddHealth(cid, amount) if math.floor(turn/10) == turn/10 then doSendMagicEffect(getThingPos(cid), effect) end addEvent(doHealOverTime, 100, cid, div, turn - 1, effect) end local potions = { [12347] = {effect = 13, div = 30, msg = "SUPER POTION"}, --super potion [12348] = {effect = 13, div = 50, msg = "GREAT POTION"}, --great potion [12346] = {effect = 12, div = 60, msg = "ULTRA POTION"}, --ultra potion [12345] = {effect = 14, div = 70, msg = "HYPER POTION"}, --hyper potion [12343] = {effect = 14, div = 100, msg = "?"}, } function onUse(cid, item, frompos, item2, topos) local pid = getThingFromPosWithProtect(topos) if not isCreature(pid) or not isSummon(pid) then return doPlayerSendCancel(cid, "You can only use potions on pokemons!") end if getCreatureMaster(pid) ~= cid then return doPlayerSendCancel(cid, "You can only use potions on your own Pokemons!") end if getCreatureHealth(pid) == getCreatureMaxHealth(pid) then return doPlayerSendCancel(cid, "This pokemon is already at full health.") end if getPlayerStorageValue(pid, 173) >= 1 then return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.") end if getPlayerStorageValue(cid, 52481) >= 1 then return doPlayerSendCancel(cid, "You can't do that while a duel.") end doCreatureSay(cid, ""..getCreatureName(pid)..", take this potion!", TALKTYPE_SAY) doSendMagicEffect(getThingPos(pid), 172) doSendAnimatedText(getThingPos(pid), potions[item.itemid].msg, math.random(1, 255)) setPlayerStorageValue(pid, 173, 1) doRemoveItem(item.uid, 1) local a = potions[item.itemid] doHealOverTime(pid, a.div, 100, a.effect) return true end
ae
Skymagnum funfo vlw rep +
Tópico movido para a seção de dúvidas e pedidos resolvidos.
Oie :D
+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
"O fracasso é a oportunidade de se começar de novo inteligentemente"