Hello, I've made a script which will = remove soul, change outfit for 1 min and add mp/hp regeneration for 1 min, i'm not a good scripter (come back on ots after 6 years of no scripting) but i think the script looks like it should almost work and yet it does not. If you have some spare time could you fix this script for me so i could learn from my mistakes.
tfs 0.3.6 no errors returned
here is the script:
Thank you for taking the time to read my problem
tfs 0.3.6 no errors returned
here is the script:
Code:
local duration = 1
local level = getPlayerLevel(cid)
local voc = getPlayerVocation(cid)
if level > 0 and < 150 then
if isInArray({1,5,9,2,6,10}, voc) then
heal = level * 7.5
elseif level > 0 and < 150 then
if isInArray({3,7,11}, voc) then
heal = level * 10
elseif level > 0 and < 150 then
if isInArray({4,8,12}, voc) then
heal = level * 13
elseif level > 149 then
if isInArray({1,5,9,2,6,10}, voc) then
heal = level * 10
elseif level > 149 then
if isInArray({3,7,11}, voc) then
heal = level * 13
elseif level > 149 then
if isInArray({4,8,12}, voc) then
heal = level * 17
local regeneration = createConditionObject(CONDITION_REGENERATION)
setConditionParam(regeneration, CONDITION_PARAM_TICKS, duration * 60 * 1000)
setConditionParam(regeneration, CONDITION_PARAM_HEALTHGAIN, heal)
setConditionParam(regeneration, CONDITION_PARAM_HEALTHTICKS, 1000)
setConditionParam(regeneration, CONDITION_PARAM_MANAGAIN, heal)
setConditionParam(regeneration, CONDITION_PARAM_MANATICKS, 1000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 7443 then
if getPlayerSoul(cid) >= 100 then
doSetCreatureOutfit(cid, {lookType= 12}, duration * 60 * 1000)
doPlayerAddSoul(cid, -100)
doAddCondition(cid, regeneration)
doSendMagicEffect(fromPosition, CONST_ME_MORTAREA)
end
end
return TRUE
end
Thank you for taking the time to read my problem
Last edited: