• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

createConditionObject(CONDITION_REGENERATION)

MalyFanek

New Member
Joined
Oct 10, 2019
Messages
37
Reaction score
2
Hello, as the title sais im trying to do function of player wear set of eq and the problem is:
Code:
local IDFEET = 13499
local IDARMOR = 13497
local IDLEGS = 13498
local bonus = createConditionObject(CONDITION_REGENERATION)
setConditionParam(bonus, CONDITION_PARAM_BUFF, 1)
setConditionParam(bonus, CONDITION_PARAM_SUBID, 1)
setConditionParam(bonus, CONDITION_PARAM_TICKS, -1)
setConditionParam(bonus, CONDITION_PARAM_HEALTHGAIN, 100000)
setConditionParam(bonus, CONDITION_PARAM_HEALTHTICKS, 10)
function onThink(cid, item, slot)
   if isPlayer(cid) then
-- set --
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS  and getPlayerStorageValue(cid, 326463) <= 4 then
setPlayerStorageValue(cid, 326463, 4)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Bills Set bonus active.")
end
if getPlayerStorageValue(cid, 326463) == 4 then
setPlayerStorageValue(cid, 326463, 5)
end
 if getPlayerStorageValue(cid, 326463) == 5  then
 doAddCondition(cid, bonus)
 elseif getPlayerStorageValue(cid, 326463) < 5  then
  doRemoveCondition(cid, CONDITION_REGENERATION, 1)
 end
-- booty --
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS and getPlayerStorageValue(cid, 326463) == 5 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost the set bonus.")
setPlayerStorageValue(cid, 326463, 1)
elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET  and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid ~= IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid ~= IDLEGS then
setPlayerStorageValue(cid, 326463, 0)
end
-- legi --
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid ~= IDLEGS and getPlayerStorageValue(cid, 326463) == 5 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost the set bonus.")
setPlayerStorageValue(cid, 326463, 2)
doRemoveCondition(cid,bonus)
elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= IDFEET  and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid ~= IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS then
setPlayerStorageValue(cid, 326463, 0)
end
-- armor --   
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid ~= IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS and getPlayerStorageValue(cid, 326463) == 5 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost the set bonus.")
setPlayerStorageValue(cid, 326463, 3)
doRemoveCondition(cid,bonus)
elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= IDFEET  and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid ~= IDLEGS then
setPlayerStorageValue(cid, 326463, 0)
end
 end
return true
end

This one works perfectly added in creaturescripts but... while i try to add 2nd one like:
Code:
local IDFEET = 2645
local IDARMOR = 2463
local IDLEGS = 2647
local IDHEAD = 2457
local bonus4 = createConditionObject(CONDITION_REGENERATION)
setConditionParam(bonus4, CONDITION_PARAM_BUFF, 1)
setConditionParam(bonus4, CONDITION_PARAM_SUBID, 4)
setConditionParam(bonus4, CONDITION_PARAM_TICKS, -1)
setConditionParam(bonus4, CONDITION_PARAM_HEALTHGAIN, 1000000)
setConditionParam(bonus4, CONDITION_PARAM_HEALTHTICKS, 10)
function onThink(cid, item, slot)
   if isPlayer(cid) then
-- set --
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == IDHEAD  and getPlayerStorageValue(cid, 329463) <= 5 then
setPlayerStorageValue(cid, 329463, 5)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Darkness Set bonus active.")
end
if getPlayerStorageValue(cid, 329463) == 5 then
setPlayerStorageValue(cid, 329463, 6)
end
 if getPlayerStorageValue(cid, 326463) == 6  then
 doAddCondition(cid, bonus4)
  elseif getPlayerStorageValue(cid, 326463) < 6  then
  doRemoveCondition(cid, CONDITION_REGENERATION, 4)
 end
-- booty --
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == IDHEAD  and getPlayerStorageValue(cid, 329463) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost the set bonus.")
setPlayerStorageValue(cid, 329463, 1)
elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid ~= IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid ~= IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid ~= IDHEAD  then
setPlayerStorageValue(cid, 329463, 0)
end
-- legi --
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid ~= IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == IDHEAD  and getPlayerStorageValue(cid, 329463) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost the set bonus.")
setPlayerStorageValue(cid, 329463, 2)
elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid ~= IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid ~= IDHEAD then
setPlayerStorageValue(cid, 329463, 0)
end
-- armor --   
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid ~= IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == IDHEAD   and getPlayerStorageValue(cid, 329463) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost the set bonus.")
setPlayerStorageValue(cid, 329463, 3)
elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid ~= IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid ~= IDHEAD  then
setPlayerStorageValue(cid, 329463, 0)
end
-- helm --
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid ~= IDHEAD and  getPlayerStorageValue(cid, 329463) == 6 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You just lost the set bonus.")
setPlayerStorageValue(cid, 329463, 4)
elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= IDFEET and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid ~= IDARMOR and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid ~= IDLEGS and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == IDHEAD  then
setPlayerStorageValue(cid, 329463, 0)
end
end
return true
end
The "set" msg appear etc but condition doesnt work and no errors in tfs, what am im doing wrong? I cant use twice same condition with diff values or what? ;x
Using tfs 0,4
 
Back
Top