- Joined
- Feb 4, 2009
- Messages
- 1,314
Inventory with unlimited slots
system got released http://www.hiveworkshop.com/forums/spells-569/inventory-extension-176817/
I made an inventory extension which should be able to handle more than just 6 items. Since the code is rather long it is very likely to contain bugs so I upload it here first so you can play around with it. Feel free to tell me about any suggestions you would like to see. If I feel like and am able to add it I might do so.
Have fun
edit:
you drop an item by double-clicking it
system got released http://www.hiveworkshop.com/forums/spells-569/inventory-extension-176817/
Have fun
edit:
you drop an item by double-clicking it
edit2:
they will vanish as soon as one gets vision over that area and looks at it in the same moment
a solution would be to reveal that area all the time but I think just ignoring it is easier than finding a workaround for it
edit3: nevermind, chaning the boolean value of "fog visibility" of the empty tile to "true" fixed it
edit4: update (v2)
edit5: screenshot, triggers
this is caused by blizzards vision systemAwesome, however when you pick up an item, in the space where you show the inventory, if you cant see that area, blank inventory slots appear.
they will vanish as soon as one gets vision over that area and looks at it in the same moment
a solution would be to reveal that area all the time
edit3: nevermind, chaning the boolean value of "fog visibility" of the empty tile to "true" fixed it
edit4: update (v2)
edit5: screenshot, triggers
-
GIIni
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- Number of supported item types --------
-
Set GI_ItemNumber = 8
-
-------- Number of inventory slots --------
-
Set GI_ButtonNumber = 50
-
-------- Visible region for inventory --------
-
Set rect = (Region(-1300.00, 512.00, -250.00, 1024.00))
-
For each (Integer i) from 1 to 12, do (Actions)
-
Loop - Actions
-
Set p = (Player(i))
-
Visibility - Create an initially Disabled visibility modifier for p emitting Visibility across rect
-
Set GI_Vision[i] = (Last created visibility modifier)
-
Set P2G[i] = (Player group(p))
-
Trigger - Add to GIOpenClose <gen> the event (Player - p skips a cinematic sequence)
-
-
-
Custom script: call RemoveRect(udg_rect)
-
Set zLoc = (Point(0.00, 0.00))
-
Hashtable - Create a hashtable
-
Set GI_Hashtable = (Last created hashtable)
-
Set GI_Button[0] = war3mapImported\UdInvTile.blp
-
-------- ITEM SETUP --------
-
-------- ITEM SETUP --------
-
-------- ITEM SETUP --------
-
-------- Item index --------
-
Set i = 1
-
-------- Button type --------
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNBelt.blp
-
-------- Item type --------
-
Set GI_ItemType[i] = Belt of Giant Strength +6
-
-------- Convert item id to integer --------
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
-------- Number of stat modifications --------
-
Hashtable - Save 1 as 0 of i in GI_Hashtable
-
-------- Type of stat modification --------
-
Hashtable - Save 5 as 1 of i in GI_Hashtable
-
-------- Ammount of added stats --------
-
Hashtable - Save 6 as 2 of i in GI_Hashtable
-
Set i = 2
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNClawsOfAttack.blp
-
Set GI_ItemType[i] = Claws of Attack +15
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
Hashtable - Save 1 as 0 of i in GI_Hashtable
-
Hashtable - Save 1 as 1 of i in GI_Hashtable
-
Hashtable - Save 15 as 2 of i in GI_Hashtable
-
Set i = 3
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNHelmOfValor.blp
-
Set GI_ItemType[i] = Helm of Valor
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
Hashtable - Save 2 as 0 of i in GI_Hashtable
-
Hashtable - Save 5 as 1 of i in GI_Hashtable
-
Hashtable - Save 4 as 2 of i in GI_Hashtable
-
Hashtable - Save 6 as 3 of i in GI_Hashtable
-
Hashtable - Save 4 as 4 of i in GI_Hashtable
-
Set i = 4
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNPendantOfMana.blp
-
Set GI_ItemType[i] = Pendant of Mana
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
Hashtable - Save 1 as 0 of i in GI_Hashtable
-
Hashtable - Save 4 as 1 of i in GI_Hashtable
-
Hashtable - Save 250 as 2 of i in GI_Hashtable
-
Set i = 5
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNPeriapt.blp
-
Set GI_ItemType[i] = Periapt of Vitality
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
Hashtable - Save 1 as 0 of i in GI_Hashtable
-
Hashtable - Save 3 as 1 of i in GI_Hashtable
-
Hashtable - Save 150 as 2 of i in GI_Hashtable
-
Set i = 6
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNPeriapt1.blp
-
Set GI_ItemType[i] = Khadgar's Gem of Health
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
Hashtable - Save 1 as 0 of i in GI_Hashtable
-
Hashtable - Save 3 as 1 of i in GI_Hashtable
-
Hashtable - Save 300 as 2 of i in GI_Hashtable
-
Set i = 7
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNMedalionOfCourage.blp
-
Set GI_ItemType[i] = Medallion of Courage
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
Hashtable - Save 2 as 0 of i in GI_Hashtable
-
Hashtable - Save 5 as 1 of i in GI_Hashtable
-
Hashtable - Save 4 as 2 of i in GI_Hashtable
-
Hashtable - Save 7 as 3 of i in GI_Hashtable
-
Hashtable - Save 4 as 4 of i in GI_Hashtable
-
Set i = 8
-
Set GI_Button[i] = ReplaceableTextures\CommandButtons\BTNRingGreen.blp
-
Set GI_ItemType[i] = Ring of Protection +5
-
Custom script: set udg_i = udg_GI_ItemType[udg_i]
-
Hashtable - Save 1 as 0 of i in GI_Hashtable
-
Hashtable - Save 0 as 1 of i in GI_Hashtable
-
Hashtable - Save 5 as 2 of i in GI_Hashtable
-
-------- ITEM SETUP END --------
-
-------- ITEM SETUP END --------
-
-------- ITEM SETUP END --------
-
-------- Create inventorys for preplaced heros --------
-
Custom script: call GroupEnumUnitsInRect(udg_g, bj_mapInitialPlayableArea, null)
-
Unit Group - Pick every unit in g and do (Actions)
-
Loop - Actions
-
Set u = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(u is A Hero) Equal to True
-
-
Then - Actions
-
Trigger - Run GICreateInventory <gen> (ignoring conditions)
-
-
Else - Actions
-
-
-
-
Game - Display to (All players) for 0.00 seconds the text: Press Esc to open y...
-
-
-
GINewHero
-
Events
-
Unit - A unit enters (Entire map)
-
-
Conditions
-
Actions
-
-------- Create an inventory for new hero --------
-
Set u = (Triggering unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(u is A Hero) Equal to True
-
-
Then - Actions
-
Trigger - Run GICreateInventory <gen> (ignoring conditions)
-
-
Else - Actions
-
-
-
-
GICreateInventory
-
Events
-
Conditions
-
Actions
-
-------- Get handle id of unit u --------
-
Custom script: set udg_i = GetHandleId(udg_u)
-
-------- Number of columns --------
-
Set i3 = 10
-
For each (Integer i2) from 0 to (GI_ButtonNumber - 1), do (Actions)
-
Loop - Actions
-
-------- -1150: x offset --------
-
Set x = ((Real(((i2 mod i3) x 64))) + -1150.00)
-
-------- 900: y offset --------
-
Set y = ((Real(((i2 / i3) x -64))) + 900.00)
-
Custom script: call MoveLocation(udg_zLoc, udg_x, udg_y)
-
-------- Create button --------
-
Destructible - Create a GI_Button[0] at zLoc facing 0.00 with scale 1.00 and variation 0
-
-------- Hide button --------
-
Custom script: call ShowDestructable(bj_lastCreatedDestructable, false)
-
-------- Save button --------
-
Hashtable - Save Handle Of(Last created destructible) as i2 of i in GI_Hashtable
-
-
-
-
-
GIOpenClose
-
Events
-
Conditions
-
Actions
-
Set p = (Triggering player)
-
Set i3 = (Player number of p)
-
-------- If inventory is open already --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(p is in GI_Players) Equal to False
-
-
Then - Actions
-
-------- Pick all units selected by that player --------
-
Custom script: call GroupEnumUnitsSelected(udg_g, udg_p, null)
-
-------- Set u = first unit (unitgroups usually have the hero sorted to position 1 in a group) --------
-
Custom script: set udg_u = FirstOfGroup(udg_g)
-
-------- Check if unit is valid (hero, owned by that player) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of u) Equal to p
-
(u is A Hero) Equal to True
-
-
Then - Actions
-
-------- Save player to active inventory players --------
-
Player Group - Add p to GI_Players
-
-------- Save hero --------
-
Set GI_Hero[i3] = u
-
-------- Get hero handle id --------
-
Custom script: set udg_i = GetHandleId(udg_u)
-
-------- Set last button selected to false --------
-
Hashtable - Save -1 as (Key Last) of i in GI_Hashtable
-
-------- Reveal inventory area --------
-
Visibility - Enable GI_Vision[i3]
-
-------- Load first button --------
-
Set d = (Load 0 of i in GI_Hashtable)
-
Custom script: call MoveLocation(udg_zLoc, GetWidgetX(udg_d), GetWidgetY(udg_d))
-
-------- Apply top down view --------
-
Camera - Set p's camera Angle of attack to 270.00 over 0.00 seconds
-
-------- Pan cam to position of first button --------
-
Camera - Pan camera as necessary for p to zLoc over 0.00 seconds
-
-------- Show buttons for owner of hero --------
-
Set b = False
-
Custom script: if udg_p == GetLocalPlayer() then
-
Set b = True
-
Custom script: endif
-
For each (Integer i2) from 0 to GI_ButtonNumber, do (Actions)
-
Loop - Actions
-
Set d = (Load i2 of i in GI_Hashtable)
-
Custom script: call ShowDestructable(udg_d, udg_b)
-
-
-
-
Else - Actions
-
Game - Display to P2G[i3] the text: Please select a val...
-
-
-
-
Else - Actions
-
-------- Load hero --------
-
Set u = GI_Hero[i3]
-
-------- Get hero handle id --------
-
Custom script: set udg_i = GetHandleId(udg_u)
-
-------- Remove player from active inventory players --------
-
Player Group - Remove p from GI_Players
-
-------- Disable vision of inventory area --------
-
Visibility - Disable GI_Vision[i3]
-
Custom script: call MoveLocation(udg_zLoc, GetUnitX(udg_u), GetUnitY(udg_u))
-
-------- Reset cam --------
-
Camera - Reset camera for p to standard game-view over 0.00 seconds
-
-------- Pan cam to hero --------
-
Camera - Pan camera as necessary for p to zLoc over 0.00 seconds
-
-------- Destroy selection effect --------
-
Special Effect - Destroy (Load (Key Effect) of i in GI_Hashtable)
-
-------- Hide buttons --------
-
For each (Integer i2) from 0 to GI_ButtonNumber, do (Actions)
-
Loop - Actions
-
Destructible - Hide (Load i2 of i in GI_Hashtable)
-
-
-
-
-
-
-
GIOnSelect
-
Events
-
Unit - A unit Is issued an order targeting a point
-
-
Conditions
-
((Owner of (Triggering unit)) is in GI_Players) Equal to True
-
-
Actions
-
Set p = (Owner of (Triggering unit))
-
-------- Get the coordinates of the order point --------
-
Custom script: set udg_x = GetOrderPointX()
-
Custom script: set udg_y = GetOrderPointY()
-
-------- Load hero --------
-
Set u = GI_Hero[(Player number of p)]
-
-------- If hero is alive --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Life of u) Greater than 0.00
-
-
Then - Actions
-
-------- Get hero handle id --------
-
Custom script: set udg_i = GetHandleId(udg_u)
-
-------- Loop through inventory slots --------
-
For each (Integer i2) from 0 to (GI_ButtonNumber - 1), do (Actions)
-
Loop - Actions
-
-------- Load button --------
-
Set d = (Load i2 of i in GI_Hashtable)
-
-------- Get position --------
-
Custom script: set udg_x2 = GetWidgetX(udg_d)
-
Custom script: set udg_y2 = GetWidgetY(udg_d)
-
-------- Check distance between click and current button --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Abs((x - x2))) Less than 32.00
-
(Abs((y - y2))) Less than 32.00
-
-
Then - Actions
-
-------- Load last selected button number --------
-
Set i3 = (Load (Key Last) of i from GI_Hashtable)
-
-------- If -1 there was no last selected button --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
i3 Not equal to -1
-
-
Then - Actions
-
Custom script: call MoveLocation(udg_zLoc, udg_x2, udg_y2)
-
-------- Destroy old selection effect --------
-
Special Effect - Destroy (Load (Key Effect) of i in GI_Hashtable)
-
-------- set d2 to last selected button --------
-
Set d2 = (Load i3 of i in GI_Hashtable)
-
-------- Set last button to false --------
-
Hashtable - Save -1 as (Key Last) of i in GI_Hashtable
-
Set item = (Load i of i2 in GI_Hashtable)
-
-------- Check doubleclick --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
d Equal to d2
-
-
Then - Actions
-
-------- If tile not empty --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Destructible-type of d) Not equal to GI_Button[0]
-
-
Then - Actions
-
-------- Set tile empty --------
-
Destructible - Remove d
-
Destructible - Create a GI_Button[0] at zLoc facing 0.00 with scale 1.00 and variation 0
-
Hashtable - Save Handle Of(Last created destructible) as i2 of i in GI_Hashtable
-
-------- Drop item --------
-
Custom script: call MoveLocation(udg_zLoc, GetUnitX(udg_u), GetUnitY(udg_u))
-
Item - Move item to zLoc
-
-------- Disable trigger so it won't trigger pickup event --------
-
Trigger - Turn off GIAcquireItem <gen>
-
Hero - Give item to u
-
Trigger - Turn on GIAcquireItem <gen>
-
-------- Update stats --------
-
Trigger - Run BonusSetStatsAll <gen> (ignoring conditions)
-
-
Else - Actions
-
-
-
Else - Actions
-
-------- Swap tiles and items --------
-
Set dt = (Destructible-type of d)
-
Set dt2 = (Destructible-type of d2)
-
Custom script: set udg_x2 = GetWidgetX(udg_d2)
-
Custom script: set udg_y2 = GetWidgetY(udg_d2)
-
Destructible - Remove d
-
Destructible - Remove d2
-
Destructible - Create a dt2 at zLoc facing 0.00 with scale 1.00 and variation 0
-
Hashtable - Save Handle Of(Last created destructible) as i2 of i in GI_Hashtable
-
Custom script: call MoveLocation(udg_zLoc, udg_x2, udg_y2)
-
Destructible - Create a dt at zLoc facing 0.00 with scale 1.00 and variation 0
-
Hashtable - Save Handle Of(Last created destructible) as i3 of i in GI_Hashtable
-
Hashtable - Save Handle Of(Load i of i3 in GI_Hashtable) as i of i2 in GI_Hashtable
-
Hashtable - Save Handle Ofitem as i of i3 in GI_Hashtable
-
-
-
-
Else - Actions
-
-------- Destroy old effect --------
-
Special Effect - Destroy (Load (Key Effect) of i in GI_Hashtable)
-
Hashtable - Save i2 as (Key Last) of i in GI_Hashtable
-
-------- Create selection effect for local player --------
-
Set s = <Empty String>
-
Custom script: if udg_p == GetLocalPlayer() then
-
Set s = war3mapImported\BTNselection.mdx
-
Custom script: endif
-
Custom script: call MoveLocation(udg_zLoc, udg_x2, udg_y2)
-
Special Effect - Create a special effect at zLoc using s
-
Hashtable - Save Handle Of(Last created special effect) as (Key Effect) of i in GI_Hashtable
-
-
-
-------- Stop hero from walking around --------
-
Wait 0.10 game-time seconds
-
Unit - Order (Triggering unit) to Stop
-
-------- Skip all other actions since the button was found already --------
-
Skip remaining actions
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
Game - Display to P2G[(Player number of p)] the text: Your hero is dead
-
-
-
-
-
GIAcquireItem
-
Events
-
Unit - A unit Acquires an item
-
-
Conditions
-
Actions
-
Set u = (Triggering unit)
-
Set p = (Owner of u)
-
Set i3 = (Key (Triggering unit))
-
-------- Loop through all item types --------
-
For each (Integer i) from 1 to GI_ItemNumber, do (Actions)
-
Loop - Actions
-
-------- If current item = acquired item --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of (Item being manipulated)) Equal to GI_ItemType[i]
-
-
Then - Actions
-
-------- Loop through inventory slots --------
-
For each (Integer i2) from 0 to (GI_ButtonNumber - 1), do (Actions)
-
Loop - Actions
-
-------- If slot is empty --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Destructible-type of (Load i2 of i3 in GI_Hashtable)) Equal to GI_Button[0]
-
-
Then - Actions
-
-------- Save item --------
-
Hashtable - Save Handle Of(Item being manipulated) as i3 of i2 in GI_Hashtable
-
Set d = (Load i2 of i3 in GI_Hashtable)
-
Custom script: call MoveLocation(udg_zLoc, GetWidgetX(udg_d), GetWidgetY(udg_d))
-
-------- Hide item --------
-
Item - Move (Item being manipulated) to zLoc
-
Item - Hide (Item being manipulated)
-
Destructible - Remove d
-
-------- Create a button for item type --------
-
Destructible - Create a GI_Button[i] at zLoc facing 0.00 with scale 1.00 and variation 0
-
-------- Save new button --------
-
Hashtable - Save Handle Of(Last created destructible) as i2 of i3 in GI_Hashtable
-
-------- Show item if inventory is active for owning player --------
-
Set b = False
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(p is in GI_Players) Equal to True
-
-
Then - Actions
-
Custom script: if udg_p == GetLocalPlayer() then
-
Set b = True
-
Custom script: endif
-
-
Else - Actions
-
-
Custom script: call ShowDestructable(bj_lastCreatedDestructable, udg_b)
-
-------- Update stats --------
-
Trigger - Run BonusSetStatsAll <gen> (ignoring conditions)
-
-------- Item got saved in inventory; stop doing stuff --------
-
Skip remaining actions
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
-
-
-
-
-
BonusIni
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- Number of bonus types --------
-
Set Bonus_Number = 8
-
Set Bonus_Ability[0] = Item Armor Bonus (+1)
-
Set Bonus_Ability[1] = Item Armor Bonus (+2)
-
Set Bonus_Ability[2] = Item Armor Bonus (+4)
-
Set Bonus_Ability[3] = Item Armor Bonus (+8)
-
Set Bonus_Ability[4] = Item Armor Bonus (+16)
-
Set Bonus_Ability[5] = Item Armor Bonus (+32)
-
Set Bonus_Ability[6] = Item Armor Bonus (+64)
-
Set Bonus_Ability[7] = Item Armor Bonus (+128)
-
Set Bonus_Ability[8] = Item Armor Bonus (+256)
-
Set Bonus_Ability[9] = Item Armor Bonus (+512)
-
Set Bonus_Ability[100] = Item Damage Bonus (+1)
-
Set Bonus_Ability[101] = Item Damage Bonus (+2)
-
Set Bonus_Ability[102] = Item Damage Bonus (+4)
-
Set Bonus_Ability[103] = Item Damage Bonus (+8)
-
Set Bonus_Ability[104] = Item Damage Bonus (+16)
-
Set Bonus_Ability[105] = Item Damage Bonus (+32)
-
Set Bonus_Ability[106] = Item Damage Bonus (+64)
-
Set Bonus_Ability[107] = Item Damage Bonus (+128)
-
Set Bonus_Ability[108] = Item Damage Bonus (+256)
-
Set Bonus_Ability[109] = Item Damage Bonus (+512)
-
Set Bonus_Ability[110] = Item Damage Bonus (+1024)
-
Set Bonus_Ability[111] = Item Damage Bonus (+2048)
-
Set Bonus_Ability[112] = Item Damage Bonus (+4096)
-
Set Bonus_Ability[113] = Item Damage Bonus (+8192)
-
Set Bonus_Ability[114] = Item Damage Bonus (+16384)
-
Set Bonus_Ability[115] = Item Damage Bonus (+32768)
-
Set Bonus_Ability[200] = Item Attack Speed Bonus (+1)
-
Set Bonus_Ability[201] = Item Attack Speed Bonus (+2)
-
Set Bonus_Ability[202] = Item Attack Speed Bonus (+4)
-
Set Bonus_Ability[203] = Item Attack Speed Bonus (+8)
-
Set Bonus_Ability[204] = Item Attack Speed Bonus (+16)
-
Set Bonus_Ability[205] = Item Attack Speed Bonus (+32)
-
Set Bonus_Ability[206] = Item Attack Speed Bonus (+64)
-
Set Bonus_Ability[207] = Item Attack Speed Bonus (+128)
-
Set Bonus_Ability[208] = Item Attack Speed Bonus (+256)
-
Set Bonus_Ability[209] = Item Attack Speed Bonus (+512)
-
Set Bonus_Ability[300] = Item Life Bonus (+1)
-
Set Bonus_Ability[301] = Item Life Bonus (+2)
-
Set Bonus_Ability[302] = Item Life Bonus (+4)
-
Set Bonus_Ability[303] = Item Life Bonus (+8)
-
Set Bonus_Ability[304] = Item Life Bonus (+16)
-
Set Bonus_Ability[305] = Item Life Bonus (+32)
-
Set Bonus_Ability[306] = Item Life Bonus (+64)
-
Set Bonus_Ability[307] = Item Life Bonus (+128)
-
Set Bonus_Ability[308] = Item Life Bonus (+256)
-
Set Bonus_Ability[309] = Item Life Bonus (+512)
-
Set Bonus_Ability[310] = Item Life Bonus (+1024)
-
Set Bonus_Ability[311] = Item Life Bonus (+2048)
-
Set Bonus_Ability[312] = Item Life Bonus (+4096)
-
Set Bonus_Ability[313] = Item Life Bonus (+8192)
-
Set Bonus_Ability[314] = Item Life Bonus (+16384)
-
Set Bonus_Ability[315] = Item Life Bonus (+32768)
-
Set Bonus_Ability[400] = Item Mana Bonus (+1)
-
Set Bonus_Ability[401] = Item Mana Bonus (+2)
-
Set Bonus_Ability[402] = Item Mana Bonus (+4)
-
Set Bonus_Ability[403] = Item Mana Bonus (+8)
-
Set Bonus_Ability[404] = Item Mana Bonus (+16)
-
Set Bonus_Ability[405] = Item Mana Bonus (+32)
-
Set Bonus_Ability[406] = Item Mana Bonus (+64)
-
Set Bonus_Ability[407] = Item Mana Bonus (+128)
-
Set Bonus_Ability[408] = Item Mana Bonus (+256)
-
Set Bonus_Ability[409] = Item Mana Bonus (+512)
-
Set Bonus_Ability[410] = Item Mana Bonus (+1024)
-
Set Bonus_Ability[411] = Item Mana Bonus (+2048)
-
Set Bonus_Ability[412] = Item Mana Bonus (+4096)
-
Set Bonus_Ability[413] = Item Mana Bonus (+8192)
-
Set Bonus_Ability[414] = Item Mana Bonus (+16384)
-
Set Bonus_Ability[415] = Item Mana Bonus (+32768)
-
Set Bonus_Ability[500] = Item Strength Bonus (+1)
-
Set Bonus_Ability[501] = Item Strength Bonus (+2)
-
Set Bonus_Ability[502] = Item Strength Bonus (+4)
-
Set Bonus_Ability[503] = Item Strength Bonus (+8)
-
Set Bonus_Ability[504] = Item Strength Bonus (+16)
-
Set Bonus_Ability[505] = Item Strength Bonus (+32)
-
Set Bonus_Ability[506] = Item Strength Bonus (+64)
-
Set Bonus_Ability[507] = Item Strength Bonus (+128)
-
Set Bonus_Ability[508] = Item Strength Bonus (+256)
-
Set Bonus_Ability[509] = Item Strength Bonus (+512)
-
Set Bonus_Ability[600] = Item Agility Bonus (+1)
-
Set Bonus_Ability[601] = Item Agility Bonus (+2)
-
Set Bonus_Ability[602] = Item Agility Bonus (+4)
-
Set Bonus_Ability[603] = Item Agility Bonus (+8)
-
Set Bonus_Ability[604] = Item Agility Bonus (+16)
-
Set Bonus_Ability[605] = Item Agility Bonus (+32)
-
Set Bonus_Ability[606] = Item Agility Bonus (+64)
-
Set Bonus_Ability[607] = Item Agility Bonus (+128)
-
Set Bonus_Ability[608] = Item Agility Bonus (+256)
-
Set Bonus_Ability[609] = Item Agility Bonus (+512)
-
Set Bonus_Ability[700] = Item Intelligence Bonus (+1)
-
Set Bonus_Ability[701] = Item Intelligence Bonus (+2)
-
Set Bonus_Ability[702] = Item Intelligence Bonus (+4)
-
Set Bonus_Ability[703] = Item Intelligence Bonus (+8)
-
Set Bonus_Ability[704] = Item Intelligence Bonus (+16)
-
Set Bonus_Ability[705] = Item Intelligence Bonus (+32)
-
Set Bonus_Ability[706] = Item Intelligence Bonus (+64)
-
Set Bonus_Ability[707] = Item Intelligence Bonus (+128)
-
Set Bonus_Ability[708] = Item Intelligence Bonus (+256)
-
Set Bonus_Ability[709] = Item Intelligence Bonus (+512)
-
Set Bonus_Ability[800] = Item Move Speed Bonus (+1)
-
Set Bonus_Ability[801] = Item Move Speed Bonus (+2)
-
Set Bonus_Ability[802] = Item Move Speed Bonus (+4)
-
Set Bonus_Ability[803] = Item Move Speed Bonus (+8)
-
Set Bonus_Ability[804] = Item Move Speed Bonus (+16)
-
Set Bonus_Ability[805] = Item Move Speed Bonus (+32)
-
Set Bonus_Ability[806] = Item Move Speed Bonus (+64)
-
Set Bonus_Ability[807] = Item Move Speed Bonus (+128)
-
Set Bonus_Ability[808] = Item Move Speed Bonus (+256)
-
Set Bonus_Ability[809] = Item Move Speed Bonus (+512)
-
-------- Preload abilities --------
-
Custom script: set udg_u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'hfoo', 0.00, 0.00, 0.00 )
-
Set i2 = ((Bonus_Number x 100) + 50)
-
For each (Integer i) from 0 to i2, do (Actions)
-
Loop - Actions
-
Unit - Add Bonus_Ability[i] to u
-
-
-
Unit - Remove u from the game
-
-
-
BonusSetStats
-
Events
-
Conditions
-
Actions
-
-------- Save udg_i so it won't fuck up --------
-
Custom script: local integer i = udg_i
-
-------- Find number of bonus abilities for type --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Bonus_Type Not equal to 1
-
Bonus_Type Not equal to 3
-
Bonus_Type Not equal to 4
-
-
Then - Actions
-
Set r = 9.00
-
-
Else - Actions
-
Set r = 15.00
-
-
-
-------- Remove old abilities --------
-
For each (Integer i) from 0 to (Integer(r)), do (Actions)
-
Loop - Actions
-
Unit - Remove Bonus_Ability[(i + (Bonus_Type x 100))] from u
-
-
-
-------- Loop from biggest to smallest bonus --------
-
Custom script: loop
-
-------- If still abilities and bonus left --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
i Greater than 0
-
Bonus_Value Greater than 0
-
-
Then - Actions
-
-------- Decrease loop count --------
-
Set i = (i - 1)
-
-------- Get ability bonus --------
-
Set r = (Power(2.00, (Real(i))))
-
-------- If ability bonus smaller then left over bonus --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Real(Bonus_Value)) Greater than or equal to r
-
-
Then - Actions
-
-------- Add bonus ability --------
-
Unit - Add Bonus_Ability[(i + (Bonus_Type x 100))] to u
-
-------- Decrease left over bonus --------
-
Set Bonus_Value = (Bonus_Value - (Integer(r)))
-
-
Else - Actions
-
-
-
Else - Actions
-
-------- Exit loop --------
-
Custom script: exitwhen true
-
-
-
Custom script: endloop
-
-------- restore udg_i --------
-
Custom script: set udg_i = i
-
-
-
BonusSetStatsAll
-
Events
-
Conditions
-
Actions
-
-------- Set all stats to 0 --------
-
For each (Integer i) from 0 to Bonus_Number, do (Actions)
-
Loop - Actions
-
Set Bonus_Stats[i] = 0
-
-
-
-------- Loop through inventory --------
-
For each (Integer i) from 0 to (GI_ButtonNumber - 1), do (Actions)
-
Loop - Actions
-
-------- Load items in current inventory slot --------
-
Custom script: set udg_i2 = GetHandleId(udg_u)
-
Set item = (Load i2 of i in GI_Hashtable)
-
-------- If slot is not empty --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
GI_Button[0] Not equal to (Destructible-type of (Load i of i2 in GI_Hashtable))
-
-
Then - Actions
-
-------- Loop through item types --------
-
For each (Integer i2) from 1 to GI_ItemNumber, do (Actions)
-
Loop - Actions
-
-------- If current item type = item type of current item --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Item-type of item) Equal to GI_ItemType[i2]
-
-
Then - Actions
-
-------- Load number of bonus type --------
-
Custom script: set udg_i2 = udg_GI_ItemType[udg_i2]
-
-------- Loop through bonus types provided by that item --------
-
For each (Integer i3) from 1 to (Load 0 of i2 from GI_Hashtable), do (Actions)
-
Loop - Actions
-
-------- Increase specific bonus value --------
-
Set Bonus_Stats[(Load ((i3 x 2) - 1) of i2 from GI_Hashtable)] = (Bonus_Stats[(Load ((i3 x 2) - 1) of i2 from GI_Hashtable)] + (Load (i3 x 2) of i2 from GI_Hashtable))
-
-
-
-------- Exit loop --------
-
Custom script: exitwhen true
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
-
-
-
-------- Loop through bonus types --------
-
For each (Integer i) from 0 to Bonus_Number, do (Actions)
-
Loop - Actions
-
-------- Apply bonus for current bonus type --------
-
Set Bonus_Value = Bonus_Stats[i]
-
Set Bonus_Type = i
-
Trigger - Run BonusSetStats <gen> (ignoring conditions)
-
-
-
-
Attachments
Last edited: