Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local shield2 = Condition(CONDITION_ATTRIBUTES)
- shield2:setTicks(-1)
- shield2:setParameter(CONDITION_PARAM_BUFF_SPELL, 1)
- shield2:setParameter(CONDITION_PARAM_SUBID, 13)
- shield2:setParameter(CONDITION_PARAM_SKILL_SHIELD, 5)
- local itemsmod = {
- ---------------
- [1] = {
- [1] = {}, --- Helmet
- [2] = {2136}, --- Amulet
- [3] = {}, --- Backpack
- [4] = {2476}, --- Armor
- [5] = {}, --- Right
- [6] = {}, --- Left
- [7] = {2477}, --- Legs
- [8] = {}, --- Feet
- [9] = {}, --- Ring
- [10] = {}, --- Ammo
- [11] = {16750}, --- Put a unique storage value here
- [12] = {
- [1] = {text = "Set 2 Equipped"}, --- Equip Text 1
- [2] = {}, --- Equip Text 2
- [3] = {text = "Item 1 Equipped"} --- Equip Text 3
- },
- [13] = {
- [1] = {enable = true}, --- Enable All items bonus
- [2] = {enable = true}, --- Enable All-1 setitems bonus
- [3] = {enable = true}}, --- Enable All-2 setitems bonus
- [14] = {
- [1] = {condition = shield2, typ = CONDITION_ATTRIBUTES, sub = 13},
- [2] = {maxHealth = 50, maxMana = 50},
- [3] = {itemStorageAddNumber = {45003, 5}}
- },
- },
- [2] = {
- [1] = {}, --- Helmet
- [2] = {}, --- Amulet
- [3] = {}, --- Backpack
- [4] = {}, --- Armor
- [5] = {2376}, --- Right
- [6] = {2525}, --- Left
- [7] = {}, --- Legs
- [8] = {}, --- Feet
- [9] = {}, --- Ring
- [10] = {}, --- Ammo
- [11] = {16752}, --- Put a unique storage value here
- [12] = {
- [1] = {text = "Set 2 Equipped"}, --- Equip Text 1
- [2] = {}, --- Equip Text 2
- [3] = {text = "Item 1 Equipped"} --- Equip Text 3
- },
- [13] = {
- [1] = {enable = true}, --- Enable All items bonus
- [2] = {enable = false}, --- Enable All-1 items bonus
- [3] = {enable = false}}, --- Enable All-1 items bonus
- [14] = {
- [1] = {maxHealth = 50, maxMana = 50},
- [2] = {},
- [3] = {}
- },
- }
- --------------
- }
- local shield2 = Condition(CONDITION_ATTRIBUTES)
- shield2:setTicks(-1)
- shield2:setParameter(CONDITION_PARAM_BUFF_SPELL, 1)
- shield2:setParameter(CONDITION_PARAM_SUBID, 13)
- shield2:setParameter(CONDITION_PARAM_SKILL_SHIELD, 5)
- function onEquip(cid, item, slot)
- local player = Player(cid)
- for i = 1,#itemsmod do
- local fullset = {}
- local counter = 0
- -----------------------------
- if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][5][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][5][1] then
- counter = counter + 1
- end
- if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][6][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][6][1] then
- counter = counter + 1
- end
- for var, item in pairs(itemsmod[i]) do
- -----------------------------
- if var <= 10 then
- if item[1] ~= nil then
- table.insert(fullset, 1)
- if not(getPlayerSlotItem(cid, 5).itemid == item[1] or getPlayerSlotItem(cid, 6).itemid == item[1]) then
- if getPlayerSlotItem(cid, var).itemid == item[1] then
- counter = counter + 1
- end
- end
- end
- end
- end
- -----------------------------
- if itemsmod[i][13][3].enable == true then
- if getPlayerStorageValue(cid, itemsmod[i][11][1]) < 1 then
- if (counter) >= table.getn(fullset) - 2 then
- setPlayerStorageValue(cid, itemsmod[i][11][1], 1)
- if (itemsmod[i][14][3]).maxHealth ~= nil then
- player:setMaxHealth(player:getMaxHealth() + (itemsmod[i][14][3]).maxHealth)
- player:addHealth((itemsmod[i][14][3]).maxHealth)
- end
- if (itemsmod[i][14][3]).maxMana ~= nil then
- player:setMaxMana(player:getMaxMana() + (itemsmod[i][14][3]).maxMana)
- player:addMana((itemsmod[i][14][3]).maxMana)
- end
- if (itemsmod[i][14][3]).condition ~= nil then
- player:addCondition(itemsmod[i][14][3].condition)
- end
- if (itemsmod[i][14][3]).itemStorageAddNumber ~= nil then
- player:setStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1]) + itemsmod[i][14][3].itemStorageAddNumber[2])
- end
- if (itemsmod[i][12][3].text) ~= nil then
- player:sendTextMessage(MESSAGE_INFO_DESCR, "" ..itemsmod[i][12][3].text.. "")
- end
- end
- end
- end
- if itemsmod[i][13][2].enable == true then
- if getPlayerStorageValue(cid, itemsmod[i][11][1]) < 2 then
- if (counter) >= table.getn(fullset) - 1 then
- setPlayerStorageValue(cid, itemsmod[i][11][1], 2)
- if (itemsmod[i][14][2]).maxHealth ~= nil then
- player:setMaxHealth(player:getMaxHealth() + (itemsmod[i][14][2]).maxHealth)
- player:addHealth((itemsmod[i][14][2]).maxHealth)
- end
- if (itemsmod[i][14][2]).maxMana ~= nil then
- player:setMaxMana(player:getMaxMana() + (itemsmod[i][14][2]).maxMana)
- player:addMana((itemsmod[i][14][2]).maxMana)
- end
- if (itemsmod[i][14][2]).condition ~= nil then
- player:addCondition(itemsmod[i][14][2].condition)
- end
- if (itemsmod[i][14][2]).itemStorageAddNumber ~= nil then
- player:setStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1]) + itemsmod[i][14][2].itemStorageAddNumber[2])
- end
- if (itemsmod[i][12][2].text) ~= nil then
- player:sendTextMessage(MESSAGE_INFO_DESCR, "" ..itemsmod[i][12][2].text.. "")
- end
- end
- end
- end
- if itemsmod[i][13][1].enable == true then
- if getPlayerStorageValue(cid, itemsmod[i][11][1]) < 3 then
- if (counter) == table.getn(fullset) then
- setPlayerStorageValue(cid, itemsmod[i][11][1], 3)
- if (itemsmod[i][14][1]).maxHealth ~= nil then
- player:setMaxHealth(player:getMaxHealth() + (itemsmod[i][14][1]).maxHealth)
- player:addHealth((itemsmod[i][14][1]).maxHealth)
- end
- if (itemsmod[i][14][1]).maxMana ~= nil then
- player:setMaxMana(player:getMaxMana() + (itemsmod[i][14][1]).maxMana)
- player:addMana((itemsmod[i][14][1]).maxMana)
- end
- if (itemsmod[i][14][1]).condition ~= nil then
- player:addCondition(itemsmod[i][14][1].condition)
- end
- if (itemsmod[i][14][1]).itemStorageAddNumber ~= nil then
- player:setStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1]) + itemsmod[i][14][1].itemStorageAddNumber[2])
- end
- if (itemsmod[i][12][1].text) ~= nil then
- player:sendTextMessage(MESSAGE_INFO_DESCR, "" ..itemsmod[i][12][1].text.. "")
- end
- end
- end
- end
- counter = 0
- end
- return true
- end
- function onDeEquip(cid, item, slot)
- local player = Player(cid)
- for i = 1,#itemsmod do
- local fullset = {}
- local counter = 0
- -----------------------------
- if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][5][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][5][1] then
- counter = counter + 1
- end
- if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][6][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][6][1] then
- counter = counter + 1
- end
- for var, item in pairs(itemsmod[i]) do
- -----------------------------
- if var <= 10 then
- if item[1] ~= nil then
- table.insert(fullset, 1)
- if not(getPlayerSlotItem(cid, 5).itemid == item[1] or getPlayerSlotItem(cid, 6).itemid == item[1]) then
- if getPlayerSlotItem(cid, var).itemid == item[1] then
- counter = counter + 1
- end
- end
- end
- end
- end
- -----------------------------
- if itemsmod[i][13][1].enable == true then
- if getPlayerStorageValue(cid, itemsmod[i][11][1]) >= 3 then
- if (counter) < table.getn(fullset) then
- setPlayerStorageValue(cid, itemsmod[i][11][1], 2)
- if (itemsmod[i][14][1]).maxHealth ~= nil then
- player:setMaxHealth(player:getMaxHealth() - (itemsmod[i][14][1]).maxHealth)
- player:addHealth((itemsmod[i][14][1]).maxHealth)
- end
- if (itemsmod[i][14][1]).maxMana ~= nil then
- player:setMaxMana(player:getMaxMana() - (itemsmod[i][14][1]).maxMana)
- player:addMana((itemsmod[i][14][1]).maxMana)
- end
- if (itemsmod[i][14][1]).condition ~= nil then
- Creature(cid):removeCondition((itemsmod[i][14][1]).typ, CONDITIONID_COMBAT, (itemsmod[i][14][1]).sub)
- end
- if (itemsmod[i][14][1]).itemStorageAddNumber ~= nil then
- player:setStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1]) - itemsmod[i][14][1].itemStorageAddNumber[2])
- end
- end
- end
- end
- if itemsmod[i][13][2].enable == true then
- if getPlayerStorageValue(cid, itemsmod[i][11][1]) >= 2 then
- if (counter) < table.getn(fullset) - 1 then
- setPlayerStorageValue(cid, itemsmod[i][11][1], 1)
- if (itemsmod[i][14][2]).maxHealth ~= nil then
- player:setMaxHealth(player:getMaxHealth() - (itemsmod[i][14][2]).maxHealth)
- player:addHealth((itemsmod[i][14][2]).maxHealth)
- end
- if (itemsmod[i][14][2]).maxMana ~= nil then
- player:setMaxMana(player:getMaxMana() - (itemsmod[i][14][2]).maxMana)
- player:addMana((itemsmod[i][14][2]).maxMana)
- end
- if (itemsmod[i][14][2]).condition ~= nil then
- Creature(cid):removeCondition((itemsmod[i][14][2]).typ, CONDITIONID_COMBAT, (itemsmod[i][14][2]).sub)
- end
- if (itemsmod[i][14][2]).itemStorageAddNumber ~= nil then
- player:setStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1]) - itemsmod[i][14][2].itemStorageAddNumber[2])
- end
- end
- end
- end
- if itemsmod[i][13][3].enable == true then
- if getPlayerStorageValue(cid, itemsmod[i][11][1]) >= 1 then
- if (counter) < table.getn(fullset) - 2 then
- setPlayerStorageValue(cid, itemsmod[i][11][1], 0)
- if (itemsmod[i][14][3]).maxHealth ~= nil then
- player:setMaxHealth(player:getMaxHealth() - (itemsmod[i][14][3]).maxHealth)
- player:addHealth((itemsmod[i][14][3]).maxHealth)
- end
- if (itemsmod[i][14][3]).maxMana ~= nil then
- player:setMaxMana(player:getMaxMana() - (itemsmod[i][14][3]).maxMana)
- player:addMana((itemsmod[i][14][3]).maxMana)
- end
- if (itemsmod[i][14][3]).condition ~= nil then
- Creature(cid):removeCondition((itemsmod[i][14][3]).typ, CONDITIONID_COMBAT, (itemsmod[i][14][3]).sub)
- end
- if (itemsmod[i][14][3]).itemStorageAddNumber ~= nil then
- player:setStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1]) - itemsmod[i][14][3].itemStorageAddNumber[2])
- end
- end
- end
- end
- counter = 0
- end
- print(counter)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement