Estoy editando el ItemBag del Mix_Senior del CS, por horas he estado probando de diferentes formas cambiando el: SocketCount="#" con diferentes valores [1 a 5] y por mas que hago eso, da el item con los soket aleatorio.
Estoy buscando la forma de que el valor que coloque en (SocketCount="3") sea el mismo que me genere y no sea aleatorio.
Por ultimo la columna Option="#" solo me genera item hasta +16 por mas que coloque Option="7"
Dejo el fragmento del cΓ³digo quizΓ‘ sea de referencia ya que no lo entiendo.
-- ### /4/ Create Item (using Event Bag Structure) - Mix/Inventory - LuckyCoin, CherryBlossom, LordMix ### --
function EventBagMakeItem()
local ItemID = MakeItemID(ItemInfo.ItemType, ItemInfo.ItemIndex)
local ItemCheck = IsItem(ItemID);
if ItemCheck == false then
LogAdd(string.format('Wrong Item In Bag (ItemID: %d)', ItemID))
return 0
end
local ItemLevel = GetBagItemLevel(ItemInfo.ItemMinLevel, ItemInfo.ItemMaxLevel)
local ItemDur = ItemInfo.Durability
local IsSkill = 0
local IsLuck = 0
local IsOption = 0
local IsExc = 0
local IsAncient = 0
local IsSocket = 0
local IsElemental = 0
local Duration = ItemInfo.Duration
local MuunEvoItemID = 0
if (ItemInfo.Skill == 1) then -- Skill Always
IsSkill = 1
elseif (ItemInfo.Skill == -1) then -- Random, 50% chance for Skill
IsSkill = GetRandomValue(2)
else -- No Skill (protection against unsupported values)
IsSkill = 0
end
if (ItemInfo.Luck == 1) then -- Luck Always
IsLuck = 1
elseif (ItemInfo.Luck == -1) then -- Random, 50% chance for Luck
IsLuck = GetRandomValue(2)
else -- no Luck (protection against unsupported values)
IsLuck = 0
end
if (ItemInfo.Option == -1) then -- Random Option
if (GetRandomValue(3) >= 1) then -- 66% chance to get option, if greater than or equal 1 then
if (Is28Option == 0) then
IsOption = GetRandomValue(5) -- +0 up to +16
else
IsOption = GetRandomValue(8) -- +0 up to +28
end
end
elseif (ItemInfo.Option > 0 and ItemInfo.Option <= 7) then -- options +4 (1) to +28 (7)
IsOption = ItemInfo.Option
else -- no option
IsOption = 0
end
if (ItemInfo.Exc > 0) then -- sets item with options of configured exc mask
IsExc = ItemInfo.Exc
elseif (ItemInfo.Exc == -1) then -- random exc option(s)
IsExc = GetExcellentOpt(ItemID);
elseif (ItemInfo.Exc == -2) then -- Original setting for Lord Mix
IsExc = MakeExcOptForLordMix() -- random exc option, up to 5
IsSkill = 1 -- +Skill
if (GetRandomValue(100) < 20) then -- drawn value from range, 20% chance
IsLuck = 1 -- then get Luck
else
IsLuck = 0 -- otherwise, no luck
end
elseif (ItemInfo.Exc == -3) then
IsExc = GetExcellentOptByKind(ItemInfo.KindA);
else
IsExc = 0
end
if (ItemInfo.Anc == 1) then -- Says item must be ancient (must be configured as possible ancient)
IsAncient = GetAncientOpt(ItemID)
end
-- Item must be of Type 2 in item list settings
if (IsSocketItem(ItemID) == true) then
if (ItemInfo.Socket > 0 and ItemInfo.Socket <= 5) then -- if slots value is supported (0-5)
IsSocket = GetRandomValue(ItemInfo.Socket)+1 -- set up to configured value of sockets
end
else
IsSocket = 0 -- no socket, applies for items of no item type 2 only
end
if (IsElementalItem(ItemID) == true) then
if (ItemInfo.Elemental > 0 and ItemInfo.Elemental <= 5) then
IsElemental = ItemInfo.Elemental -- Attributes selection
elseif (ItemInfo.Elemental == -1) then -- Random attribute
IsElemental = GetRandomValue(6)
end
if (ItemID >= 6244 and ItemID <= 6364) then
if (ItemInfo.Socket > 0 and ItemInfo.Socket <= 5) then
IsSocket = GetRandomValue(ItemInfo.Socket)+1
end
end
else
IsElemental = 0 -- no elemental attributes, applies for non elemental items only
end
-- ### Elemental Items ###
-- (12,144) -- Mithril Fragment
-- (12,145) -- Mithril
-- (12,148) -- Mithril Fragment Bunch
-- (12,149) -- Elixir Fragment Bunch
-- (12,200) -- Muren's Book of Magic
-- (12,201) -- Scroll of Etramu
-- (12,202) -- Lorencia Knights' Iron Shield
-- (12,203) -- Iron Shield of the Magic
-- (12,204) -- Hero Elixir
-- (12,205) -- Brave Hero Elixir
-- (12,206) -- Gladiator's Dagger
-- (12,207) -- Merciless Gladiator's Dagger
-- (12,208) -- Kundun's Madness Blade
-- (12,209) -- Kundun's Magic Spell Scroll
-- (12,210) -- Empire Guardians' Stronghold
-- (12,211) -- Ancient Icarus Scroll
-- (12,212) -- Arca's Prophecy
-- (12,213) -- Antonia's Sword
-- (12,214) -- Kundun's Seal Scroll
-- (12,221) -- Errtel of Anger
-- (12,231) -- Errtel of Blessing
-- (12,241) -- Errtel of Integrity
-- (12,251) -- Errtel of Divinity
-- (12,261) -- Errtel of Gale
-- Protection against specified items which should not come with extra options
if ItemID == MakeItemID(12,15) -- Jewel of Chaos
or ItemID == MakeItemID(14,13) -- Jewel of Bless
or ItemID == MakeItemID(14,14) -- Jewel of Soul
or ItemID == MakeItemID(14,16) -- Jewel of Life
or ItemID == MakeItemID(14,22) -- Jewel of Creation
then
ItemLevel = 0
IsSkill = 0
IsLuck = 0
IsOption = 0
IsExc = 0
IsAncient = 0
IsSocket = 0
IsElemental = 0
Duration = 0
MuunEvoItemID = 0
end
-- Protection against elemental setting value to unsupported items
if (IsElementalItem(ItemID) == false) then -- if item not elemental then set elemental to 0
IsElemental = 0
elseif (IsElementalItem(ItemID) == true and IsElemental == 0) then -- if elemental item and no attribute set
IsElemental = GetRandomValue(6) -- make a draw, 0-5
if (IsElemental == 0) then -- if 0 then
IsElemental = 1 -- set attribute 1
end
end
-- Range of items 12,200 - 12,220
if (ItemID >= 6244 and ItemID <= 6364 and IsSocket == 0) then
IsSocket = GetRandomValue(3) -- empty slots 0-2
if (IsSocket == 0) then -- if 0
IsSocket = 1 -- set 1
end
end
-- If Errtel then hang execution of the script (Errtels cannot be dropped at present using ItemBags)
if ItemID == MakeItemID(12,221) -- Errtel of Anger
or ItemID == MakeItemID(12,231) -- Errtel of Blessing
or ItemID == MakeItemID(12,241) -- Errtel of Integrity
or ItemID == MakeItemID(12,251) -- Errtel of Divinity
or ItemID == MakeItemID(12,261) -- Errtel of Gale
then
LogAdd(string.format('Errtel drop attempt from ItemBag. Drop not supported, item removed, ID: %d', ItemID))
return
end
-- New draw of option if server is configured to support option up to +16 only
if (Is28Option == 0 and IsOption > 4) then
IsOption = GetRandomValue(5) -- option draw 0-4
end
-- Protection against socket items configured with no sockets
if (IsSocketItem(ItemID) == true and IsSocket == 0) then
IsSocket = 1 -- set to one socket only
end
-- Protection against unsupported options for EvolutionStone item
if (ItemID == MakeItemID(13,211)) then
MuunEvoItemID = MakeItemID(ItemInfo.MuunEvolutionItemType, ItemInfo.MuunEvolutionItemIndex)
IsSkill = 0
IsLuck = 0
IsOption = 0
IsExc = 0
IsAncient = 0
IsSocket = 0
IsElemental = 0
else
MuunEvoItemID = 0;
end
return ItemLevel, ItemDur, IsSkill, IsLuck, IsOption, IsExc, IsAncient, IsElemental, IsSocket, MuunEvoItemID, Duration
end