Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Então, as potions do meu servidor está sem exhausted, podendo usa-las sem parar.

Aqui está o meu potions.lua:

 

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

        [8704] = {empty = 8704, splash = 2, health = {50, 100}}, -- small health potion

        [7618] = {empty = 7618, splash = 2, health = {100, 200}}, -- health potion

        [7588] = {empty = 7588, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion

        [7591] = {empty = 7591, splash = 2, health = {500, 700}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion

        [8473] = {empty = 8473, splash = 2, health = {800, 1000}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion

        [7620] = {empty = 7620, splash = 7, mana = {70, 150}}, -- mana potion

        [7589] = {empty = 7589, splash = 7, mana = {130, 220}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion

        [7590] = {empty = 7590, splash = 7, mana = {300, 400}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion

        [8472] = {empty = 8472, splash = 3, health = {200, 300}, mana = {150, 250}, level = 80, vocations = {3, 7}, vocStr = "paladins"} -- 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

horizontallogowhite1.png

Link para o post
Compartilhar em outros sites

tente usar o meu e fala se arrumou

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 = {
	[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
	[7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion
	[7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion
	[7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion
	[8473] = {empty = 7635, splash = 2, health = {800, 1000}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion

	[7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion
	[7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
	[7590] = {empty = 7635, splash = 7, mana = {200, 300}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion

	[8472] = {empty = 7635, splash = 3, health = {200, 400}, mana = {110, 190}, level = 80, vocations = {3, 7}, vocStr = "paladins"} -- 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, 1)
     doPlayerAddItem(cid, potion.empty, 1)
	return true
end

Editado por roriscrave (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Nada, o erro continua.. alguma alma boa pra me ajudar? Imagem do erro

BXUPoq.png

 

Isso acontece com todas as potions e apenas com as potions.


Uma observação, quando eu coloco a potion pra ser finita (não infinita) o bug sai.

horizontallogowhite1.png

Link para o post
Compartilhar em outros sites

tente assim

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 = {
	[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
	[7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion
	[7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion
	[7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion
	[8473] = {empty = 7635, splash = 2, health = {800, 1000}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion

	[7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion
	[7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
	[7590] = {empty = 7635, splash = 7, mana = {200, 300}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion

	[8472] = {empty = 7635, splash = 3, health = {200, 400}, mana = {110, 190}, level = 80, vocations = {3, 7}, vocStr = "paladins"} -- 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
        doAddCondition(cid, exhaust)
	doRemoveItem(item.uid, 1)
     doPlayerAddItem(cid, potion.empty, 1)
	return true
end
Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por daviscript
      Após verificar que vários servidores estão sofrendo com problemas na página Guilds, onde era possível fazer diversas modificações com os players de qualquer guild, até a Cipsoft passou por esse problema recentemente...
      Resolvi compartilhar com vocês a correção de todos os Bugs conhecidos na Página de Guilds.
       
      Foram fixados os seguintes Bugs:
      ● Remover Players que não forem de sua guild.
      ● Aceitar guild com 1 personagem que não seja da sua conta.
      ● Editar o Text/Title de 1 player que não esteja na sua guild.
      ● Editar Ranks que não sejam da sua guild.
      ● Editar Rank de Players que não são da sua guild.
       
      Qualquer outro BUG que você encontrar... Pode listar aqui nesse tópico.
       
      OBS: É meu primeiro post... Então se estiver no local errado ou se algum moderador quiser reformular / formatar o tópico, fique a vontade.
       
       Vou deixar o Spoiler do php abaixo, mas também estou anexando o arquivo.
       
       
      Download: Mediafire
      Scan: Virus Total
       
       
    • Por Barca Furada
      Boa noite meus caros colegas!
      Preciso de um Help!
       
       
      Quando eu coloco meu itens editados no meu xml e otb, acontece isso com os teleportes, perde todas as propriedades:
       
      No lado direito é sem meu Itemxml
      No lado Esquerdo é com meu Itemxml
       
      Como vcs pode vem ele perde a propriedade de destino!
       
      O arquivo Check File Signatures está desativados!
       
      Quando eu entro no REM com meu Itemxml, ele da essas mensagem de erro:
       
       
       
      Antes de fazer tudo isso eu No item editor, todos itens estava com essa borda vermelha, eu tinha dado reload em todos itens para o cliente OTCv8 conseguir visualizar, no primeiro momento achei que era isso que tinha acontecido para bugar meus teleportes, então eu dei reload em todos itens um por um e deixei o teleport sem dar reload, para ver se era esses o bug! e deu na mesma , quando edito o mapa para colocar novas hunt e cidade ele buga todos teleportes!
       
       
       
       
      No itemxml o teleport está com mesmo id!
       
      alguma alma bondosa para ajudar um colega?
    • Por marvadon
      Boa noite pessoal.
       
       
      To com problemas com os npcs dos bank.
       
      o único que funciona é o NPC de Thais, o resto dos npcs não respondem aos comandos(balance, deposit, withdraw)
       
       
      alguém poderia me ajudar?
       
       
      obrigado
    • Por gabrieldiaszin
      Olá, bom existem diversos tópicos com Stamina Refiller, Stamina potion, etc.
      Porém, eu quero um script que ao player usar a potion em si ele recuperar X tempo de stamina.
      Por exemplo: A Stamina Potion está configurada para enxer  5 horas de stamina , e eu tenho 30 horas, então eu uso ela em mim e fico com 35 horas de stamina. 
       
      Os scripts que tem aqui são assim: se eu boto o tanto de tempo que quero, ele deixa o player com aquela stamina, no caso acima, o player desceu de 30 para 5 horas de stamina.
       
      Atualmente tem esse aqui que eu testei:
      local config = { effect = 30, remove_on_use = "yes" } function onUse(cid, item, frompos, item2, topos) doPlayerAddStamina(cid, (300 - getPlayerStamina(cid))) doSendMagicEffect(getThingPos(cid), config.effect) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua stamina foi aumentada em 5 horas.") if config.remove_on_use == "yes" then doRemoveItem(item.uid, 1) end return true end Porém, como disse acima, ao dar use no item, o player fica com 5 horas de stamina ( 300 minutos).
       
      Obrigado e Rep++ para quem me ajudar.
       
       
    • Por Digoshow
      Gente eu troquei de distro e com ele veio alguns bugs, quero saber se voces podem me ajudar com algum deles, pois to tendo muito trabalho para conseguir arrumar esses erros.
       

       
      Alguem ae sabe resolver algum desses erros?
      Obrigado, REP + .
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo