- System Name:
Item Stacking System - Author:
Mr. Zero - Category:
Gameplay Affecting, Item Manipulation - Current Version:
1.0.7 - Features:
- Stacking of items
- Split of items
- Merging of items
- Description:
Item Stacking System is a triggered system for Warcraft 3 maps. (TFT and RoC as well.) That it does is 'stack' items. Instead you have two healing potions with three charges each, the Item Stacking System will stack them and make one healing potion with six charges. Very useful when you need lots of healing potions... or mana potions.
You can also double right click on the item and it will drop the default charge and place it in the inventory. Right clicking on one item and another item will cause them to merge if they are of same type and one of them is not above iteml level. - Warcraft 3 Test:
The Frozen Throne, Version 1.21
Works
Reign of Chaos, Version 1.21
Works - Required Functions/Systems:
None - Configurable Variables:
None - Globals Variables Required:
gg_trg_Item_Stacking_System - Credits:
- Comments:
How to install and use:
Copy the folder called "Item Stacking System" into your map. To copy; mark the folder and press CTRL+C (The hotkey for Copy) or mark the folder and go in the menu line under "Edit" and select "Copy".
Now go to your map's trigger editor and either press CTRL+V (The hotkey for Paste) or go in the menu line under "Edit" and select "Paste". You should now see the folder in your map.
Item Stacking System uses Item Level for know how much it can be stacked.
Example; Lets say that my mana potion is a level 5 item, and I get one each time I pick one up (1 charge). When I have four in my inventory and I pick one more up, the Item Stacking System goes and look at the item level of the item.
If the item's charges equals to item level, it will not stack the items. So all you have to is set the item level on the item you want to stack.
(Remember to set "Number of Charges" as well.)
Question 1. said:Is it MUI (MultiUnit Instantiable) and MPI (MultiPlayer Instantiable)?
Yes. Multi players can use it on multi units at the same time.
Question 2. said:Why can I not set item level higher then 8?
Hold down shift and double click on Stats - Item Level. Now you should be able to write higher values.
Question 3. said:Why will the system not stack? I have set the item level.
Remember to set charges as well. No charges means no stacking. - Changelog:
Current Version:
- Version 1.0.7 - Date 01/01-2008
- Changes / Additions
- Changed from a few integer variables to one integer array in both functions.
- Instead of checking if the created item "c" is needed, it removes item "c" completly, once the needed information has been recorded. The system will first create a new item when the condition is fulfilled.
- Removed "return" from both functions, since the functions is not returning anything.
- Changes / Additions
Older Versions:
- Version 1.06 - Date 12/23-2007
- Changes / Additions
- "GetItemTypeId" function call changed to variable.
- Fixes
- Minor fixes on clean up after use of item.
- Changes / Additions
- Version 1.05a - Date 11/20-2007
- Changes / Additions
- Lots of native function calls changed to stored variables
- Changes / Additions
- Version 1.05 - Date 11/20-2007
- Changes / Additions
- Right click, with a non-full charged item, on a full charged item will cause the two items to trade charges.
- Changes / Additions
- Version 1.04b - Date 11/18-2007
- Fixes
- Didn't remove item
- Fixes
- Version 1.04a - Date 11/18-2007
- Changes / Additions
- Optimized for a smaller size
- Removed; when double right click on item with less then default charges it won't drop the item any more.
- Changes / Additions
- Version: 1.03 - Date: 06/28-07
- Changes / Additions
- Optimizied the code
- Removed unneeded spaces
- Changes / Additions
- Version: 1.02 - Date: 06/27-07
- Changes / Additions
- Replaced Location with Real
- Changes / Additions
- Version: 1.01 - Date: 05/08-07
- Changes / Additions
- Merged Loop in the event
- Changes / Additions
- Version: 1.00 - Date: 05/07-07
- Changes / Additions
- No Longer Beta
- Optimized all the code
- Do no longer uses variables
- All leaks founded and cleaned
- All BJs founded and made to negatives
- Fixed an endless loop
- Changes / Additions
- Version: 0.65 - Date: 03/06-07
- Changes / Additions
- "Set Charges" trigger is reduced by 48% (Old: 50 lines, New: 27 lines)
- "Remove Charges" trigger is reduced by 48% (Old: 120 lines, New: 56 lines)
- Changes / Additions
- Version: 0.63 - Date: 03/05-07
- Changes / Additions
- Removed GUI Setup and Settings trigger
- Removed almost every variable
- Fixes
- Fixed a bug that a player could drop items outside boundary
- Fixed a small errors in the code
- Changes / Additions
- Version: 0.50 - Date: 02/11-07
- Changes / Additions
- Entered Beta Stage
- Optimized the code
- Added a GUI Setup and Settings trigger
- Remove all remaining unneeded functions
- Changes / Additions
- Version: 0.45 - Date: 02/10-07
- Changes / Additions
- "Remove Charges" trigger has been rewritten
- "Set Charges" trigger has been rewritten
- Added new variables for "Remove Charges" trigger
- "Remove Charges" trigger do no longer use custom value of item
- Fixes
- Fixed a bug that would cause a endless loop
- Changes / Additions
- Version: 0.17 - Date: 02/05-07
- Changes / Additions
- Optimized the "Set Charges" trigger
- "Set Charges" trigger no longer uses custom value of the item
- Fixes
- Fixed a bug that could get the player a full charges of the item
- Changes / Additions
- Version: 0.15 - Date: 02/05-07
- Changes / Additions
- Now 100% JASS for "Set Charges" trigger
- Optimized the "Set Charges" trigger
- Added new variables for "Set Charges" trigger
- Removed the old "Set Charges" variables
- Fixes
- Fixed a bug that could terminate the loop in "Set Charges" trigger
- Fixed a bug that non-hero units couldn't pick up items
- Changes / Additions
- Version: 0.10 - Date: 02/03-07
- Changes / Additions
- Entered Alpha Stage
- Changes / Additions
- Version 1.0.7 - Date 01/01-2008
- Source Code:
Trigger: gg_trg_Item_Stacking_System 102 lines ~ 3.56 KB.
JASS://*************************************************************************** //* //* Item Stacking System //* Version 1.0.7, 01/01-08 //* //* Coded by Mr. Zero - [email protected] //* //*************************************************************************** function ISS_SC takes nothing returns nothing local integer array i local item a=GetManipulatedItem() local unit b=GetManipulatingUnit() local item c set i[0]=0 set i[1]=GetItemLevel(a) set i[2]=GetItemCharges(a) set i[3]=GetItemTypeId(a) if(i[2]!=0)then loop exitwhen i[0]>5 set c=UnitItemInSlot(b,i[0]) set i[4]=GetItemCharges(c) set i[5]=GetItemTypeId(c) if(((c!=a)and(i[5]==i[3]))and(i[4]<i[1]))then if((i[4]+i[2])<=i[1])then call SetItemCharges(c,(i[4]+i[2])) call RemoveItem(a) exitwhen true else call SetItemCharges(a,(i[4]+i[2])-i[1]) call SetItemCharges(c,i[1]) call UnitAddItem(b,a) exitwhen true endif endif set i[0]=i[0]+1 endloop endif set a=null set b=null set c=null endfunction function ISS_RC takes nothing returns nothing local integer array i local unit a=GetOrderedUnit() local item b=GetOrderTargetItem() local item c=UnitItemInSlot(a,(GetIssuedOrderId()-852002)) set i[0]=0 set i[1]=GetItemCharges(b) set i[2]=GetItemLevel(b) set i[3]=GetItemTypeId(b) set i[4]=GetItemCharges(c) set i[5]=GetItemTypeId(c) if((((GetIssuedOrderId()>=852002)and(GetIssuedOrderId()<=852007))and(i[1]!=0)and(c!=null)))then if(b==c)then set c=CreateItem(i[3],0,0) set i[4]=GetItemCharges(c) call RemoveItem(c) if(i[1]>i[4])then loop exitwhen i[0]>5 if(UnitItemInSlot(a,i[0])==null)then call SetItemCharges(b,(i[1]-i[4])) set b=CreateItem(i[3],0,0) call DisableTrigger(gg_trg_Item_Stacking_System) call UnitAddItem(a,b) call EnableTrigger(gg_trg_Item_Stacking_System) exitwhen true endif set i[0]=i[0]+1 endloop endif else if((i[5]==i[3])and(i[4]<i[2]))then if((i[1]+i[4])<=i[2])then call SetItemCharges(b,(i[1]+i[4])) call RemoveItem(c) else call SetItemCharges(c,(i[1]+i[4])-i[2]) call SetItemCharges(b,i[2]) endif endif endif endif set a=null set b=null set c=null endfunction function InitTrig_Item_Stacking_System takes nothing returns nothing local integer i=0 local trigger t=CreateTrigger() set gg_trg_Item_Stacking_System=CreateTrigger() loop exitwhen i==16 call TriggerRegisterPlayerUnitEvent(gg_trg_Item_Stacking_System,Player(i),EVENT_PLAYER_UNIT_PICKUP_ITEM,null) call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null) set i=i+1 endloop call TriggerAddAction(gg_trg_Item_Stacking_System,function ISS_SC) call TriggerAddAction(t,function ISS_RC) set t=null endfunction
- Download:
Attached below.
Download views in total: 149
(From last version)