Ots Forum
Health Potion
health.lua
function onUse(cid, item, frompos, item2, topos)
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(100,300)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7636)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
else
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
Strong Health Potion
health2.lua
function onUse(cid, item, frompos, item2, topos)
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(200,600)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.itemid == 7634 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if lvl >= 50 then
if voc == 4 or voc == 3 or voc == 7 or voc == 8 then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7634)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
doPlayerSendCancel(cid, 'This potion can only be consumed by paladins and knights of level 50 or higher.')
end
else
doPlayerSendCancel(cid,'This potion can only be consumed by paladins and knights of level 50 or higher.')
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7634)
doDecayItem(splash)
end
end
else
if item.itemid == 7634 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7634)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
Great Health Potion
health3.lua
function onUse(cid, item, frompos, item2, topos)
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(400,800)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.itemid == 7635 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if lvl >= 80 then
if voc == 4 or voc == 8 then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7635)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
doPlayerSendCancel(cid, 'This potion can only be consumed by knights of level 80 or higher.')
end
else
doPlayerSendCancel(cid,'This potion can only be consumed by knights of level 80 or higher.')
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7635)
doDecayItem(splash)
end
end
else
if item.itemid == 7635 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7635)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
Mana potion
mana.lua
function onUse(cid, item, frompos, item2, topos)
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(50,150)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if ex == -1 then
doPlayerAddMana(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7636)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
else
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
Strong Mana Potion
mana2.lua
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(100,300)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.itemid == 7634 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if lvl >= 50 then
if voc == 1 or voc == 2 or voc == 3 or voc == 5 or voc == 6 or voc == 7 then
if ex == -1 then
doPlayerAddMana(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7634)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
doPlayerSendCancel(cid, 'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.')
end
else
doPlayerSendCancel(cid,'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.')
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7634)
doDecayItem(splash)
end
end
else
if item.itemid == 7634 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7634)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
Great Mana Potion
mana3.lua
function onUse(cid, item, frompos, item2, topos)
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(150,450)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.itemid == 7635 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if lvl >= 80 then
if voc == 1 or voc == 2 or voc == 5 or voc == 6 then
if ex == -1 then
doPlayerAddMana(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7635)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
doPlayerSendCancel(cid, 'This potion can only be consumed by druids and sorcerers of level 80 or higher.')
end
else
doPlayerSendCancel(cid,'This potion can only be consumed by druids and sorcerers of level 80 or higher.')
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7635)
doDecayItem(splash)
end
end
else
if item.itemid == 7635 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7635)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end
Mastermind Potion
mastermind potion.lua
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 60 * 1000) -- 10 minutes
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICPOINTS, 3)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -10)
function onUse(cid, item, frompos, item2, topos)
if not(isSorcerer(cid) or isDruid(cid)) then
doCreatureSay(cid, "Only sorcerers and druids may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
if(doTargetCombatCondition(0, cid, condition, CONST_ME_MAGIC_RED) == LUA_ERROR) then
return FALSE
end
doCreatureSay(cid, "You feel smarter.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
return TRUE
end
Berserk Potion
berserk potion.lua
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEE, 5)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -10)
function onUse(cid, item, frompos, item2, topos)
if(doTargetCombatCondition(0, cid, condition, CONST_ME_MAGIC_RED) == LUA_ERROR) then
return FALSE
end
doRemoveItem(item.uid)
return TRUE
end
Bullseye Potion
bullseye potion.lua
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 30 * 60 * 1000) -- 30 minutes
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, 5)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, -10)
function onUse(cid, item, frompos, item2, topos)
if(doTargetCombatCondition(0, cid, condition, CONST_ME_MAGIC_RED) == LUA_ERROR) then
return FALSE
end
doRemoveItem(item.uid)
return TRUE
end
Concentrated Demonic Blood
demonic blood.lua
local POTIONS = {7588, 7589}
function onUse(cid, item, frompos, item2, topos)
local rand = math.random(1,#POTIONS)
doTransformItem(item.uid, POTIONS[rand])
doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_RED)
return TRUE
end
Offline