• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] [System] Custom Unit Stats System

Status
Not open for further replies.
Level 9
Joined
Aug 7, 2009
Messages
380
Hello,
I have triggers like these:

  • CS Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_CS_Hashtable = InitHashtable()
      • Set CS_ItemType = Crown of Kings +5
      • Set CS_CritDamage = 0.00
      • Set CS_BlockChance = 100.00
      • Set CS_EvasionChance = 0.00
      • Set CS_BlockDamage = 30.00
      • Trigger - Run CS Save <gen> (ignoring conditions)
  • CS Save
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_CS_Key = udg_CS_ItemType
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Hashtable - Save CS_EvasionChance as CS_PlusUp of CS_Key in CS_Hashtable
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Hashtable - Save CS_BlockDamage as CS_PlusUp of CS_Key in CS_Hashtable
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Hashtable - Save CS_BlockChance as CS_PlusUp of CS_Key in CS_Hashtable
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Hashtable - Save CS_CritChance as CS_PlusUp of CS_Key in CS_Hashtable
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Hashtable - Save CS_CritDamage as CS_PlusUp of CS_Key in CS_Hashtable
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Hashtable - Save CS_SpellPower as CS_PlusUp of CS_Key in CS_Hashtable
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Hashtable - Save CS_SpellCritChance as CS_PlusUp of CS_Key in CS_Hashtable
      • Set CS_PlusUp = 0
      • Set CS_SpellPower = 0.00
      • Set CS_SpellCritChance = 0.00
      • Set CS_CritDamage = 0.00
      • Set CS_CritChance = 0.00
      • Set CS_BlockChance = 0.00
      • Set CS_EvasionChance = 0.00
      • Set CS_BlockDamage = 0.00
  • CS Get
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_CS_Key = GetHandleId(udg_CS_Unit)
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Set CSC_EvasionChance = (Load CS_PlusUp of CS_Key from CS_Hashtable)
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Set CS_BlockDamage = (Load CS_PlusUp of CS_Key from CS_Hashtable)
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Set CSC_BlockChance = (Load CS_PlusUp of CS_Key from CS_Hashtable)
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Set CSC_CritChance = (Load CS_PlusUp of CS_Key from CS_Hashtable)
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Set CSC_CritDamage = (Load CS_PlusUp of CS_Key from CS_Hashtable)
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Set CSC_SpellPower = (Load CS_PlusUp of CS_Key from CS_Hashtable)
      • Set CS_PlusUp = (CS_PlusUp + 1)
      • Set CSC_SpellCritChance = (Load CS_PlusUp of CS_Key from CS_Hashtable)
      • Set CS_PlusUp = 0
  • Block
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set CS_Unit = DamageEventTarget
      • Trigger - Run CS Get <gen> (ignoring conditions)
      • Set DMGS_BlockChance = CSC_BlockChance
      • Set DMGS_BlockDamage = CSC_BlockDamage
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random percentage) Less than or equal to (<=) DMGS_BlockChance
          • Then - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • DMGS_BlockDamage Less than (<) DamageEventAmount
              • Then - Actions
                • Set DMGS_BlockEvent = 1.00
                • Set DamageEventAmount = (DamageEventAmount - DMGS_BlockDamage)
              • Else - Actions
                • Set DamageEventAmount = 0.00
            • Set DMGS_BlockEvent = 2.00
          • Else - Actions
I'm wondering why my Crit Chance, Crit Damage, Evasion Chance,etc... all worked out except the block chance and block damage (after picking up the item). And of course, i have DamageModification system.
Hopefully someone can help me out.
Credits and rep shall come
 
Status
Not open for further replies.
Top