Ajuda ake!
No meu ot as potions não tão funcionando direito
Por exemplo: lv 8 mage usa Great Health Pot
Como configura as potions pra isso não acontecer?
Vlw
Ajuda ake!
No meu ot as potions não tão funcionando direito
Por exemplo: lv 8 mage usa Great Health Pot
Como configura as potions pra isso não acontecer?
Vlw
local ultimateHealthPot = 8473local greatHealthPot = 7591
local greatManaPot = 7590
local greatSpiritPot = 8472
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local smallHealthPot = 8704
local antidotePot = 8474
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636
local antidote = createCombatObject()
setCombatParam(antidote, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(antidote, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(antidote, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE)
setCombatParam(antidote, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(antidote, COMBAT_PARAM_DISPEL, CONDITION_POISON)
local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(itemEx.uid ~= cid or itemEx.itemid ~= 1) then
return TRUE
end
if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if(item.itemid == antidotePot) then
if(doCombat(cid, antidote, numberToVariant(cid)) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == smallHealthPot) then
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 50, 100, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == healthPot) then
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 100, 200, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == manaPot) then
if(doTargetCombatMana(0, cid, 70, 130, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == strongHealthPot) then
if(not(isKnight(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then
doCreatureSay(cid, "This potion can only be consumed by paladins and knights of level 50 or higher.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, strongEmptyPot)
elseif(item.itemid == strongManaPot) then
if(not(isSorcerer(cid) or isDruid(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then
doCreatureSay(cid, "This potion can only be consumed by sorcerers, druids and paladins of level 50 or higher.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, strongEmptyPot)
elseif(item.itemid == greatSpiritPot) then
if(not(isPaladin(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
doCreatureSay(cid, "This potion can only be consumed by paladins of level 80 or higher.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR or doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, greatEmptyPot)
elseif(item.itemid == greatHealthPot) then
if(not(isKnight(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
doCreatureSay(cid, "This potion can only be consumed by knights of level 80 or higher.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 700, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, greatEmptyPot)
elseif(item.itemid == greatManaPot) then
if(not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, greatEmptyPot)
elseif(item.itemid == ultimateHealthPot) then
if(not(isKnight(cid)) or (getPlayerLevel(cid) < 130)) and not(getPlayerGroupId(cid) >= 2) then
doCreatureSay(cid, "This potion can only be consumed by knights of level 130 or higher.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 800, 1000, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doAddCondition(cid, exhaust)
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, greatEmptyPot)
end
return TRUE
end
Tente usar este.
É para The Forgotten Server 8.22
Todos os créditos para a equipe TFS !
Se não funciona, diga a versão do seu server e poste o script que você usa atualmente.
Abraço !
Entrada na equipe: 23/10/2008 Cargo: Estagiário
Promoção: 25/11/2008 Cargo: Moderador
Promoção: 21/10/2009 Cargo: Coordenador
Remoção: 09/05/2010 Motivo: Estudos
Retorno: 15/11/2010 Cargo: Moderador
Remoção: 20/12/2012.
O meu server é Aries-XML 8.1
Esse dai não deu aki
Preciso de um 8.1 que configure os leveis das pots
Vlw
Hum... Tente usar este:
Health Potion:
function onUse(cid, item, frompos, item2, topos)mag = getPlayerMagLevel(cid)
if mag >= 1 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
doPlayerAddHealth(cid, math.random(80, 200))
doSendMagicEffect(topos, 12)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"You don't have the required level to use that potion.")
end
return 1
end
mana potion:
function onUse(cid, item, frompos, item2, topos)mag = getPlayerMagLevel(cid)
if mag >= 1 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
doPlayerAddMana(cid, math.random(50, 100))
doSendMagicEffect(topos, 12)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"You don't have the required level to use that potion.")
end
return 1
end
Strong Health Potion:
function onUse(cid, item, frompos, item2, topos)mag = getPlayerMagLevel(cid)
if getPlayerLevel(cid) < 50 then
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 50 or higher.")
return 1
end
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
doPlayerAddHealth(cid, math.random(200, 400))
doSendMagicEffect(topos, 12)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 50 or higher.")
end
return 1
end
Strong Mana Potion
function onUse(cid, item, frompos, item2, topos)mag = getPlayerMagLevel(cid)
if getPlayerLevel(cid) < 50 then
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.")
return 1
end
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
doPlayerAddHealth(cid, math.random(200, 400))
doSendMagicEffect(topos, 12)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by sorcerers, paladins and druids of level 50 or higher.")
end
return 1
end
Great Health Potion:
function onUse(cid, item, frompos, item2, topos)mag = getPlayerMagLevel(cid)
if getPlayerLevel(cid) < 80 then
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 80 or higher.")
return 1
end
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
doPlayerAddHealth(cid, math.random(200, 400))
doSendMagicEffect(topos, 12)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 80 or higher.")
end
return 1
end
Great Mana Potion:
function onUse(cid, item, frompos, item2, topos)mag = getPlayerMagLevel(cid)
if getPlayerLevel(cid) < 80 then
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by paladins, druids and sorcerers of level 80 or higher.")
return 1
end
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
doPlayerAddMana(cid, math.random(250, 500))
doSendMagicEffect(topos, 12)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"This potion can only be consumed by sorcerers and druids of level 80 or higher.")
end
return 1
end
Créditos = ?????
Eu uso este no meu server 8.1, faz tempo que peguei, não me lembro de quem era os créditos.
PS: Você deve ter uma noção de scripting para usar, caso não consiga adicionar no seu OTServ, me mande uma PM !
Abraço !
Entrada na equipe: 23/10/2008 Cargo: Estagiário
Promoção: 25/11/2008 Cargo: Moderador
Promoção: 21/10/2009 Cargo: Coordenador
Remoção: 09/05/2010 Motivo: Estudos
Retorno: 15/11/2010 Cargo: Moderador
Remoção: 20/12/2012.
maninhow, ali no strong mana, não ta pra adiciona health nao? :S
Shynzo Fan ~~
Está sim, troca lá doPlayerAddHealth por doPlayerAddMana
isso nao funciono no meu OT 8.31... eh TFS