Advertisement
Guest User

Untitled

a guest
Feb 18th, 2014
1,240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.13 KB | None | 0 0
  1. local shield2 = Condition(CONDITION_ATTRIBUTES)
  2. shield2:setTicks(-1)
  3. shield2:setParameter(CONDITION_PARAM_BUFF_SPELL, 1)
  4. shield2:setParameter(CONDITION_PARAM_SUBID, 13)
  5. shield2:setParameter(CONDITION_PARAM_SKILL_SHIELD, 5)
  6.  
  7. local itemsmod = {
  8. ---------------
  9. [1] = {
  10.     [1] = {},           --- Helmet
  11.     [2] = {2136},       --- Amulet
  12.     [3] = {},           --- Backpack
  13.     [4] = {2476},       --- Armor
  14.     [5] = {},           --- Right
  15.     [6] = {},           --- Left
  16.     [7] = {2477},       --- Legs
  17.     [8] = {},           --- Feet
  18.     [9] = {},           --- Ring
  19.     [10] = {},          --- Ammo
  20.     [11] = {16750},     --- Put a unique storage value here
  21.     [12] = {
  22. [1] = {text = "Set 2 Equipped"},         --- Equip Text 1
  23. [2] = {},                   --- Equip Text 2
  24. [3] = {text = "Item 1 Equipped"}        --- Equip Text 3
  25. },         
  26. [13] = {
  27. [1] = {enable = true},         --- Enable All items bonus
  28. [2] = {enable = true},         --- Enable All-1 setitems bonus
  29. [3] = {enable = true}},        --- Enable All-2 setitems bonus  
  30.     [14] = {
  31. [1] = {condition = shield2, typ = CONDITION_ATTRIBUTES, sub = 13},        
  32. [2] = {maxHealth = 50, maxMana = 50},        
  33. [3] = {itemStorageAddNumber = {45003, 5}}
  34. },    
  35. },
  36.  
  37. [2] = {
  38.     [1] = {},           --- Helmet
  39.     [2] = {},           --- Amulet
  40.     [3] = {},           --- Backpack
  41.     [4] = {},           --- Armor
  42.     [5] = {2376},           --- Right
  43.     [6] = {2525},           --- Left
  44.     [7] = {},           --- Legs
  45.     [8] = {},           --- Feet
  46.     [9] = {},           --- Ring
  47.     [10] = {},           --- Ammo
  48.     [11] = {16752},           --- Put a unique storage value here
  49.     [12] = {
  50. [1] = {text = "Set 2 Equipped"},         --- Equip Text 1
  51. [2] = {},                               --- Equip Text 2
  52. [3] = {text = "Item 1 Equipped"}        --- Equip Text 3
  53. },  
  54.     [13] = {
  55. [1] = {enable = true},         --- Enable All items bonus
  56. [2] = {enable = false},         --- Enable All-1 items bonus
  57. [3] = {enable = false}},         --- Enable All-1 items bonus  
  58.     [14] = {
  59. [1] = {maxHealth = 50, maxMana = 50},        
  60. [2] = {},        
  61. [3] = {}
  62. },        
  63. }
  64.  
  65. --------------
  66. }
  67.  
  68. local shield2 = Condition(CONDITION_ATTRIBUTES)
  69. shield2:setTicks(-1)
  70. shield2:setParameter(CONDITION_PARAM_BUFF_SPELL, 1)
  71. shield2:setParameter(CONDITION_PARAM_SUBID, 13)
  72. shield2:setParameter(CONDITION_PARAM_SKILL_SHIELD, 5)
  73.  
  74. function onEquip(cid, item, slot)
  75. local player = Player(cid)
  76.  
  77. for i = 1,#itemsmod do
  78. local fullset = {}
  79. local counter = 0
  80.  
  81. -----------------------------
  82.  
  83.  
  84. if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][5][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][5][1] then
  85. counter = counter + 1
  86. end
  87.  
  88. if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][6][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][6][1] then
  89. counter = counter + 1
  90. end
  91.  
  92. for var, item in pairs(itemsmod[i]) do
  93.  
  94.  
  95. -----------------------------
  96. if var <= 10 then
  97. if item[1] ~= nil then
  98.  
  99. table.insert(fullset, 1)
  100. if not(getPlayerSlotItem(cid, 5).itemid == item[1] or getPlayerSlotItem(cid, 6).itemid == item[1]) then
  101. if getPlayerSlotItem(cid, var).itemid == item[1] then
  102. counter = counter + 1
  103.     end
  104.     end
  105.     end
  106.     end
  107.     end
  108. -----------------------------
  109.  
  110. if itemsmod[i][13][3].enable == true then
  111. if getPlayerStorageValue(cid, itemsmod[i][11][1]) < 1 then
  112. if (counter) >= table.getn(fullset) - 2 then
  113. setPlayerStorageValue(cid, itemsmod[i][11][1], 1)
  114.  
  115. if (itemsmod[i][14][3]).maxHealth ~= nil then
  116.                 player:setMaxHealth(player:getMaxHealth() + (itemsmod[i][14][3]).maxHealth)
  117.                 player:addHealth((itemsmod[i][14][3]).maxHealth)
  118.             end
  119.          
  120.             if (itemsmod[i][14][3]).maxMana ~= nil then
  121.                 player:setMaxMana(player:getMaxMana() + (itemsmod[i][14][3]).maxMana)
  122.                 player:addMana((itemsmod[i][14][3]).maxMana)
  123.             end
  124.  
  125.                  if (itemsmod[i][14][3]).condition ~= nil then
  126.                 player:addCondition(itemsmod[i][14][3].condition)
  127.             end
  128.  
  129.          if (itemsmod[i][14][3]).itemStorageAddNumber ~= nil then
  130.                 player:setStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1]) + itemsmod[i][14][3].itemStorageAddNumber[2])
  131.            end
  132.  
  133.             if (itemsmod[i][12][3].text) ~= nil then
  134.         player:sendTextMessage(MESSAGE_INFO_DESCR, "" ..itemsmod[i][12][3].text.. "")
  135.     end
  136.  
  137. end
  138. end
  139. end
  140.  
  141. if itemsmod[i][13][2].enable == true then
  142. if getPlayerStorageValue(cid, itemsmod[i][11][1]) < 2 then
  143. if (counter) >= table.getn(fullset) - 1 then
  144. setPlayerStorageValue(cid, itemsmod[i][11][1], 2)
  145.  
  146. if (itemsmod[i][14][2]).maxHealth ~= nil then
  147.                 player:setMaxHealth(player:getMaxHealth() + (itemsmod[i][14][2]).maxHealth)
  148.                 player:addHealth((itemsmod[i][14][2]).maxHealth)
  149.             end
  150.          
  151.             if (itemsmod[i][14][2]).maxMana ~= nil then
  152.                 player:setMaxMana(player:getMaxMana() + (itemsmod[i][14][2]).maxMana)
  153.                 player:addMana((itemsmod[i][14][2]).maxMana)
  154.             end
  155.          
  156.      if (itemsmod[i][14][2]).condition ~= nil then
  157.                 player:addCondition(itemsmod[i][14][2].condition)
  158.             end
  159.  
  160.          if (itemsmod[i][14][2]).itemStorageAddNumber ~= nil then
  161.                 player:setStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1]) + itemsmod[i][14][2].itemStorageAddNumber[2])
  162.            end
  163.  
  164.     if (itemsmod[i][12][2].text) ~= nil then
  165.         player:sendTextMessage(MESSAGE_INFO_DESCR, "" ..itemsmod[i][12][2].text.. "")
  166.     end
  167.  
  168. end
  169. end
  170. end
  171.  
  172. if itemsmod[i][13][1].enable == true then
  173. if getPlayerStorageValue(cid, itemsmod[i][11][1]) < 3 then
  174. if (counter) == table.getn(fullset) then
  175. setPlayerStorageValue(cid, itemsmod[i][11][1], 3)
  176.  
  177. if (itemsmod[i][14][1]).maxHealth ~= nil then
  178.                 player:setMaxHealth(player:getMaxHealth() + (itemsmod[i][14][1]).maxHealth)
  179.                 player:addHealth((itemsmod[i][14][1]).maxHealth)
  180.             end
  181.          
  182.             if (itemsmod[i][14][1]).maxMana ~= nil then
  183.                 player:setMaxMana(player:getMaxMana() + (itemsmod[i][14][1]).maxMana)
  184.                 player:addMana((itemsmod[i][14][1]).maxMana)
  185.             end
  186.  
  187.      if (itemsmod[i][14][1]).condition ~= nil then
  188.                 player:addCondition(itemsmod[i][14][1].condition)
  189.             end
  190.  
  191.  
  192.          if (itemsmod[i][14][1]).itemStorageAddNumber ~= nil then
  193.                 player:setStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1]) + itemsmod[i][14][1].itemStorageAddNumber[2])
  194.            end
  195.  
  196.     if (itemsmod[i][12][1].text) ~= nil then
  197.         player:sendTextMessage(MESSAGE_INFO_DESCR, "" ..itemsmod[i][12][1].text.. "")
  198.     end
  199.              
  200.  
  201.  
  202. end
  203. end
  204. end
  205.  
  206. counter = 0
  207.  
  208. end
  209.  
  210.  
  211. return true
  212. end
  213.  
  214.  
  215.  
  216.  
  217. function onDeEquip(cid, item, slot)
  218.  
  219. local player = Player(cid)
  220.  
  221. for i = 1,#itemsmod do
  222. local fullset = {}
  223. local counter = 0
  224.  
  225. -----------------------------
  226.  
  227.  
  228. if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][5][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][5][1] then
  229. counter = counter + 1
  230. end
  231.  
  232. if getPlayerSlotItem(cid, 5).itemid == itemsmod[i][6][1] or getPlayerSlotItem(cid, 6).itemid == itemsmod[i][6][1] then
  233. counter = counter + 1
  234. end
  235.  
  236. for var, item in pairs(itemsmod[i]) do
  237.  
  238.  
  239. -----------------------------
  240. if var <= 10 then
  241. if item[1] ~= nil then
  242.  
  243. table.insert(fullset, 1)
  244. if not(getPlayerSlotItem(cid, 5).itemid == item[1] or getPlayerSlotItem(cid, 6).itemid == item[1]) then
  245. if getPlayerSlotItem(cid, var).itemid == item[1] then
  246. counter = counter + 1
  247.     end
  248.     end
  249.     end
  250.     end
  251.     end
  252.  
  253. -----------------------------
  254.  
  255. if itemsmod[i][13][1].enable == true then
  256. if getPlayerStorageValue(cid, itemsmod[i][11][1]) >= 3 then
  257. if (counter) < table.getn(fullset) then
  258. setPlayerStorageValue(cid, itemsmod[i][11][1], 2)
  259.  
  260. if (itemsmod[i][14][1]).maxHealth ~= nil then
  261.                 player:setMaxHealth(player:getMaxHealth() - (itemsmod[i][14][1]).maxHealth)
  262.                 player:addHealth((itemsmod[i][14][1]).maxHealth)
  263.             end
  264.          
  265.             if (itemsmod[i][14][1]).maxMana ~= nil then
  266.                 player:setMaxMana(player:getMaxMana() - (itemsmod[i][14][1]).maxMana)
  267.                 player:addMana((itemsmod[i][14][1]).maxMana)
  268.             end
  269.          
  270.             if (itemsmod[i][14][1]).condition ~= nil then
  271.                 Creature(cid):removeCondition((itemsmod[i][14][1]).typ, CONDITIONID_COMBAT, (itemsmod[i][14][1]).sub)
  272.             end
  273.  
  274.  
  275.          if (itemsmod[i][14][1]).itemStorageAddNumber ~= nil then
  276.                 player:setStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][1].itemStorageAddNumber[1]) - itemsmod[i][14][1].itemStorageAddNumber[2])
  277.            end
  278.  
  279. end
  280. end
  281. end
  282.  
  283.  
  284. if itemsmod[i][13][2].enable == true then
  285. if getPlayerStorageValue(cid, itemsmod[i][11][1]) >= 2 then
  286. if (counter) < table.getn(fullset) - 1 then
  287. setPlayerStorageValue(cid, itemsmod[i][11][1], 1)
  288.  
  289. if (itemsmod[i][14][2]).maxHealth ~= nil then
  290.                 player:setMaxHealth(player:getMaxHealth() - (itemsmod[i][14][2]).maxHealth)
  291.                 player:addHealth((itemsmod[i][14][2]).maxHealth)
  292.             end
  293.          
  294.             if (itemsmod[i][14][2]).maxMana ~= nil then
  295.                 player:setMaxMana(player:getMaxMana() - (itemsmod[i][14][2]).maxMana)
  296.                 player:addMana((itemsmod[i][14][2]).maxMana)
  297.             end
  298.          
  299.             if (itemsmod[i][14][2]).condition ~= nil then
  300.                 Creature(cid):removeCondition((itemsmod[i][14][2]).typ, CONDITIONID_COMBAT, (itemsmod[i][14][2]).sub)
  301.             end
  302.  
  303.          if (itemsmod[i][14][2]).itemStorageAddNumber ~= nil then
  304.                 player:setStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][2].itemStorageAddNumber[1]) - itemsmod[i][14][2].itemStorageAddNumber[2])
  305.            end
  306.  
  307. end
  308. end
  309. end
  310.  
  311. if itemsmod[i][13][3].enable == true then
  312. if getPlayerStorageValue(cid, itemsmod[i][11][1]) >= 1 then
  313. if (counter) < table.getn(fullset) - 2 then
  314. setPlayerStorageValue(cid, itemsmod[i][11][1], 0)
  315.  
  316. if (itemsmod[i][14][3]).maxHealth ~= nil then
  317.                 player:setMaxHealth(player:getMaxHealth() - (itemsmod[i][14][3]).maxHealth)
  318.                 player:addHealth((itemsmod[i][14][3]).maxHealth)
  319.             end
  320.          
  321.             if (itemsmod[i][14][3]).maxMana ~= nil then
  322.                 player:setMaxMana(player:getMaxMana() - (itemsmod[i][14][3]).maxMana)
  323.                 player:addMana((itemsmod[i][14][3]).maxMana)
  324.             end
  325.        
  326.          if (itemsmod[i][14][3]).condition ~= nil then
  327.                 Creature(cid):removeCondition((itemsmod[i][14][3]).typ, CONDITIONID_COMBAT, (itemsmod[i][14][3]).sub)
  328.             end
  329.  
  330.          if (itemsmod[i][14][3]).itemStorageAddNumber ~= nil then
  331.                 player:setStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1], player:getStorageValue(itemsmod[i][14][3].itemStorageAddNumber[1]) - itemsmod[i][14][3].itemStorageAddNumber[2])
  332.            end
  333.  
  334. end
  335. end
  336. end
  337.  
  338.  
  339. counter = 0
  340.  
  341. end
  342.  
  343. print(counter)
  344.  
  345.  
  346. return true
  347. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement