I want a hashtable to store all stats and when you equip and item, gets a buff, chooses a passive skill, it will calculate the stats for your hero.
So far I made it work so when you equip an item, it sets the attribute to the stat given - but then from there on out nothing happens. It doesn't change if I equip more items with stats or lose the item.
What am I missing?
So far I made it work so when you equip an item, it sets the attribute to the stat given - but then from there on out nothing happens. It doesn't change if I equip more items with stats or lose the item.
What am I missing?
-
HSS Key Stats
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


-------- Creating Hashtable --------
-


Hashtable - Create a hashtable
-


Set VariableSet HSS_ItemHashtable = (Last created hashtable)
-


-------- Stat Keys --------
-


Set VariableSet HSS_KeyMaxTypes = 0
-


Set VariableSet HSS_KeyMaxTypes = (HSS_KeyMaxTypes + 1)
-


Set VariableSet HSS_KeySTR = HSS_KeyMaxTypes
-


Set VariableSet HSS_KeyMaxTypes = (HSS_KeyMaxTypes + 1)
-


Set VariableSet HSS_KeyAGI = HSS_KeyMaxTypes
-


Set VariableSet HSS_KeyMaxTypes = (HSS_KeyMaxTypes + 1)
-


Set VariableSet HSS_KeyINT = HSS_KeyMaxTypes
-


Set VariableSet HSS_KeyMaxTypes = (HSS_KeyMaxTypes + 1)
-


Set VariableSet HSS_KeyREA = HSS_KeyMaxTypes
-


Set VariableSet HSS_KeyMaxTypes = (HSS_KeyMaxTypes + 1)
-


Set VariableSet HSS_KeyPOT = HSS_KeyMaxTypes
-


Set VariableSet HSS_KeyMaxTypes = (HSS_KeyMaxTypes + 1)
-


Set VariableSet HSS_KeyMUL = HSS_KeyMaxTypes
-


Set VariableSet HSS_KeyMaxTypes = (HSS_KeyMaxTypes + 1)
-


Set VariableSet HSS_KeyMAG = HSS_KeyMaxTypes
-
-
-
HSS Item Initial Variables
-

Events
-


Time - Elapsed game time is 0.01 seconds
-
-

Conditions
-

Actions
-


-------- Creating Hashtables --------
-


Hashtable - Create a hashtable
-


Set VariableSet HSS_ItemHashtable = (Last created hashtable)
-


Hashtable - Create a hashtable
-


Set VariableSet HSS_ItemInvHashtable = (Last created hashtable)
-


-------- Stat Defaults --------
-


Set VariableSet HSS_ItemNewStatsBase = 5
-


Set VariableSet HSS_ItemNewStatsRollRange = 50
-


Set VariableSet HSS_ItemNewStatRollsMin = 2
-


Set VariableSet HSS_ItemNewLvlAdd = 2
-


Set VariableSet HSS_ItemNewStatsFactAdd = 2
-


Set VariableSet HSS_ItemNewRollPerc = 25
-


Set VariableSet HSS_ItemAvailableStatCount = HSS_KeyMaxTypes
-
-
-
HSS Item Stat Creator
-

Events
-


Game - HSS_ItemNewRunStatCreator becomes Equal to 1.00
-
-

Conditions
-

Actions
-


-------- Reset trigger real --------
-


Set VariableSet HSS_ItemNewRunStatCreator = 0.00
-


-------- Count max items in play, add custom value to item --------
-


Set VariableSet HSS_ItemMaxCount = (HSS_ItemMaxCount + 1)
-


Set VariableSet HSS_ItemNewIntCV = HSS_ItemMaxCount
-


Set VariableSet HSS_ItemNew = (Last created item)
-


Item - Set the custom value of HSS_ItemNew to HSS_ItemNewIntCV
-


-------- Calculate how many stat types --------
-


Set VariableSet HSS_ItemNewStatTypeRoll = ((Random integer number between 1 and 100) x HSS_ItemNewLvl)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




HSS_ItemNewLvl Greater than or equal to 1
-
-



Then - Actions
-




Set VariableSet HSS_ItemNewStatRollsMax = 1
-
-



Else - Actions
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




HSS_ItemNewLvl Greater than or equal to 200
-
-



Then - Actions
-




Set VariableSet HSS_ItemNewStatRollsMax = 2
-
-



Else - Actions
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




HSS_ItemNewLvl Greater than or equal to 400
-
-



Then - Actions
-




Set VariableSet HSS_ItemNewStatRollsMax = 3
-
-



Else - Actions
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




HSS_ItemNewLvl Greater than or equal to 800
-
-



Then - Actions
-




Set VariableSet HSS_ItemNewStatRollsMax = 4
-
-



Else - Actions
-
-


Set VariableSet HSS_ItemNewIntRoll = 1
-


Set VariableSet HSS_ItemNewStatRollsMin = 1
-


For each (Integer HSS_ItemNewIntRoll) from HSS_ItemNewStatRollsMin to HSS_ItemNewStatRollsMax, do (Actions)
-



Loop - Actions
-




-------- Calculate the stats given to the item --------
-




Set VariableSet HSS_ItemNewStat = (HSS_ItemNewStatsBase + ((HSS_ItemNewLvl x HSS_ItemNewLvlAdd) + (HSS_ItemNewStatsFact x HSS_ItemNewStatsFactAdd)))
-




Set VariableSet HSS_ItemNewStatsMin = ((HSS_ItemNewStat x (100 - HSS_ItemNewRollPerc)) / 100)
-




Set VariableSet HSS_ItemNewStatsMax = ((HSS_ItemNewStat x (100 + HSS_ItemNewRollPerc)) / 100)
-




Set VariableSet HSS_ItemNewStatNew = (Random integer number between HSS_ItemNewStatsMin and HSS_ItemNewStatsMax)
-




-------- Choose a random stat between those that exist --------
-




Set VariableSet HSS_ItemNewTempIndex = (Random integer number between 1 and HSS_KeyMaxTypes)
-




-------- Only Add stat if >0 --------
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






HSS_ItemNewStatNew Greater than or equal to 1
-
-





Then - Actions
-






Set VariableSet HSS_ItemNewStatLoad = (Load HSS_ItemNewTempIndex of HSS_ItemNewIntCV from HSS_ItemHashtable.)
-






Set VariableSet HSS_ItemNewStatSave = (HSS_ItemNewStatNew + HSS_ItemNewStatLoad)
-






Hashtable - Save HSS_ItemNewStatSave as HSS_ItemNewTempIndex of HSS_ItemNewIntCV in HSS_ItemHashtable.
-
-





Else - Actions
-
-
-
-


Set VariableSet HSS_ItemNewDesc = Stats:
-


Set VariableSet HSS_LoadChildKey = 1
-


For each (Integer HSS_LoadChildKey) from 1 to HSS_KeyMaxTypes, do (Actions)
-



Loop - Actions
-




Set VariableSet HSS_LoadParentKey = HSS_ItemNewIntCV
-




Set VariableSet HSS_LoadValue = (Load HSS_LoadChildKey of HSS_LoadParentKey from HSS_ItemHashtable.)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






HSS_LoadValue Greater than or equal to 1
-
-





Then - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeySTR
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Strength
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeyAGI
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Agility
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeyINT
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Intelligence
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeyPOT
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Potency
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeyREA
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Reach
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeyPER
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Persistance
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeyMUL
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Multiplicity
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








HSS_LoadChildKey Equal to HSS_KeyMAG
-
-







Then - Actions
-








Set VariableSet HSS_ItemNewStatString = Magnitude
-








Set VariableSet HSS_ItemNewDesc = (HSS_ItemNewDesc + ((|n + (HSS_ItemNewStatString + : )) + (String(HSS_LoadValue))))
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-


Item - Set Description of HSS_ItemNew to HSS_ItemNewDesc
-


Item - Set Extended Tooltip of HSS_ItemNew to HSS_ItemNewDesc
-
-
-
HSS Item Stat Inventory Calculator
-

Events
-


Unit - A unit Acquires an item
-


Unit - A unit Loses an item
-
-

Conditions
-

Actions
-


-------- Reset Item Stat Calculator --------
-


Set VariableSet HSS_ItemIntRoll = 1
-


For each (Integer HSS_ItemIntRoll) from 1 to HSS_KeyMaxTypes, do (Actions)
-



Loop - Actions
-




Set VariableSet HSS_ItemStatInvCalculator[HSS_ItemIntRoll] = 0
-
-
-


-------- Checks entire inventory size for items --------
-


Set VariableSet HSS_ItemHero = (Hero manipulating item)
-


Set VariableSet HSS_StatHeroCV = (Custom value of HSS_ItemHero)
-


Set VariableSet HSS_ItemInvMax = (Size of inventory for HSS_ItemHero)
-


Set VariableSet HSS_ItemInvSlot = 1
-


For each (Integer HSS_ItemInvSlot) from 1 to HSS_ItemInvMax, do (Actions)
-



Loop - Actions
-




-------- Checks one item at a time --------
-




Set VariableSet HSS_Item = (Item carried by HSS_ItemHero in slot HSS_ItemInvSlot)
-




Set VariableSet HSS_ItemCV = (Custom value of HSS_Item)
-




Set VariableSet HSS_LoadParentKey = HSS_ItemCV
-




Set VariableSet HSS_LoadChildKey = 1
-




For each (Integer HSS_LoadChildKey) from 1 to HSS_KeyMaxTypes, do (Actions)
-





Loop - Actions
-






-------- Checks one stat at a time for each item. Each individual stat is added for a total stored in an array with the path equal to the given stat key. --------
-






Set VariableSet HSS_LoadValue = (Load HSS_LoadChildKey of HSS_LoadParentKey from HSS_ItemHashtable.)
-






Set VariableSet HSS_ItemStatInvCalculator[HSS_LoadChildKey] = (HSS_ItemStatInvCalculator[HSS_LoadChildKey] + HSS_LoadValue)
-
-
-
-
-


-------- Save to hashtable for the individual units inventory --------
-


Set VariableSet HSS_SaveParentKey = HSS_StatHeroCV
-


Set VariableSet HSS_SaveChildKey = 1
-


For each (Integer HSS_SaveChildKey) from 1 to HSS_KeyMaxTypes, do (Actions)
-



Loop - Actions
-




Hashtable - Save HSS_ItemStatInvCalculator[HSS_SaveChildKey] as HSS_SaveChildKey of HSS_SaveParentKey in HSS_ItemInvHashtable.
-




Game - Display to (All players) the text: (String(HSS_ItemStatInvCalculator[HSS_SaveChildKey]))
-
-
-


-------- Run Calculator --------
-


Set VariableSet HSS_StatHero = HSS_ItemHero
-


Set VariableSet HSS_StatCalculator = 1.00
-
-
-
HSS Stat Calculator
-

Events
-


Game - HSS_StatCalculator becomes Equal to 1.00
-
-

Conditions
-

Actions
-


-------- Reset load values --------
-


Set VariableSet HSS_LoadChildKey = 1
-


For each (Integer HSS_LoadChildKey) from 1 to HSS_KeyMaxTypes, do (Actions)
-



Loop - Actions
-




Set VariableSet HSS_LoadValueTotal[HSS_LoadChildKey] = 0
-
-
-


-------- Load values from all stat hashtables in an array --------
-


Set VariableSet HSS_LoadParentKey = (Custom value of HSS_StatHero)
-


Set VariableSet HSS_LoadChildKey = 1
-


For each (Integer HSS_LoadChildKey) from 1 to HSS_KeyMaxTypes, do (Actions)
-



Loop - Actions
-




Set VariableSet HSS_LoadValue = (Load HSS_LoadChildKey of HSS_LoadParentKey from HSS_ItemInvHashtable.)
-




Set VariableSet HSS_LoadValueTotal[HSS_LoadChildKey] = (HSS_LoadValueTotal[HSS_LoadChildKey] + HSS_LoadValue)
-
-
-


-------- Set stats equal to the stored values in the array --------
-


Set VariableSet HSS_KeySTRValue[HSS_LoadParentKey] = HSS_LoadValueTotal[HSS_KeySTR]
-


Set VariableSet HSS_KeyAGIValue[HSS_LoadParentKey] = HSS_LoadValueTotal[HSS_KeyAGI]
-


Set VariableSet HSS_KeyINTValue[HSS_LoadParentKey] = HSS_LoadValueTotal[HSS_KeyINT]
-


Set VariableSet HSS_KeyREAValue[HSS_LoadParentKey] = HSS_LoadValueTotal[HSS_KeyREA]
-


Set VariableSet HSS_KeyPOTValue[HSS_LoadParentKey] = HSS_LoadValueTotal[HSS_KeyPOT]
-


Set VariableSet HSS_KeyMULValue[HSS_LoadParentKey] = HSS_LoadValueTotal[HSS_KeyMUL]
-


Set VariableSet HSS_KeyMAGValue[HSS_LoadParentKey] = HSS_LoadValueTotal[HSS_KeyMAG]
-


Hero - Modify Strength of HSS_StatHero: Set to HSS_KeySTRValue[HSS_LoadParentKey].
-


Hero - Modify Agility of HSS_StatHero: Set to HSS_KeyAGIValue[HSS_LoadParentKey].
-


Hero - Modify Intelligence of HSS_StatHero: Set to HSS_KeyINTValue[HSS_LoadParentKey].
-
-




