Ir para conteúdo

Pedido Potions


LucasCastro

Posts Recomendados

Tpw eu tenhu a potion que ela heala 40k de mana e de vida só q porem qnd usa não aparece o escrito somente +40000 de mana e não o de vida eu sei q mesmo assim heala só q eu qria q aparesece se alguem puder ajudar aew

 

crieo q seja nessa linha:

 

realAnimation = "yes", -- make text effect visible only for players in range 1x1

 

aumentar o 1x1 para 2x2 só escrevendo só ali não da certo !

 

Vlw's

 

;D

Editado por LucasCastro
Link para o comentário
Compartilhar em outros sites

local config = {

removeOnUse = "no",

usableOnTarget = "no", -- can be used on target? (fe. healing friend)

splashable = "no",

realAnimation = "yes", -- make text effect visible only for players in range 3x3

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 = {

[5468] = {empty = 7635, splash = 3, health = {40000, 40000}, mana = {40000, 40000}, level = 8, vocations = {1, 2, 3, 4, 9, 10, 11, 12}, vocStr = "paladin, knight, druid, sorcerer"}, -- great spirit potion

}

 

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(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), 36)

if(not config.realAnimation) then

doCreatureSay(itemEx.uid, "Supreme", TALKTYPE_ORANGE_1)

else

for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do

if(isPlayer(tid)) then

doCreatureSay(itemEx.uid, "", 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)

doSendAnimatedText(getPlayerPosition(cid), 'HALLOW', 4)

doPlayerRemoveItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty))

doPlayerAddItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty))

return TRUE

end

Link para o comentário
Compartilhar em outros sites

ver que agora da.

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 = local POTIONS = {
[5468] = {empty = 7635, splash = 3, health = {40000, 40000}, mana = {40000, 40000}, level = 8, vocations = {1, 2, 3, 4, 9, 10, 11, 12}, vocStr = "paladin, knight, druid, sorcerer"}, -- great spirit potion
}

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(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

Link para o comentário
Compartilhar em outros sites

local config = { 
removeOnUse = "no", 
usableOnTarget = "no", -- can be used on target? (fe. healing friend) 
splashable = "no", 
realAnimation = "yes", -- make text effect visible only for players in range 3x3 
showHealingMsg = "yes", -- By Byerne
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 = { 
[5468] = {textcolor = COLOR_PURPLE, empty = 7635, splash = 3, health = {40000, 40000}, mana = {40000, 40000}, level = 8, vocations = {1, 2, 3, 4, 9, 10, 11, 12}, vocStr = "paladin, knight, druid, sorcerer"}, -- great spirit potion 
} 

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(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), 36)
if config.showHealingMsg then
doSendAnimatedText(toPosition, math.ceil(math.random(health[1], health[2]), potion.textcolor)
end
if(not config.realAnimation) then 
doCreatureSay(itemEx.uid, "Aahhh...", TALKTYPE_ORANGE_1) 
else 
for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do 
if(isPlayer(tid)) then 
doCreatureSay(itemEx.uid, "Aahhh...", 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)
doSendAnimatedText(getPlayerPosition(cid), 'HALLOW', 4) 
doPlayerRemoveItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) 
doPlayerAddItem(cid, potion.empty, getPlayerItemCount(cid, potion.empty)) 
return TRUE 
end 

Se quiser pode mudar ali em textcolor = COLOR_PURPLE para outras cores dessa lista:

 

COLOR_BLACK = 0
COLOR_BLUE = 5
COLOR_GREEN = 18
COLOR_TEAL = 35
COLOR_LIGHTGREEN = 66
COLOR_DARKBROWN = 78
COLOR_LIGHTBLUE = 89
COLOR_DARKPURPLE = 112
COLOR_BROWN = 120
COLOR_GREY = 129
COLOR_DARKRED = 144
COLOR_DARKPINK = 152
COLOR_PURPLE = 154
COLOR_DARKORANGE = 156
COLOR_RED = 180
COLOR_PINK = 190
COLOR_ORANGE = 192
COLOR_DARKYELLOW = 205
COLOR_YELLOW = 210
COLOR_WHITE = 215
COLOR_NONE = 255

Link para o comentário
Compartilhar em outros sites

Eaew. pois é nenhum desses deu certo ;/

 

alguem puder ajeitar!

 

tpw ta subindo o escrito HALLOW aew qria q so lado> subisse +40000

 

:D

 

mesmo q só posse pra subir +40000 do lado sem ser qnd heala msm mais qnd usa o item!

 

VLw's

Editado por LucasCastro
Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...