• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Help with spell power System

Status
Not open for further replies.
Level 5
Joined
Oct 20, 2019
Messages
60
Hello, i'm trying to do a simple spell power system for my map and i can't figure out how to solve my problem, so im hoping to get some help here =)

i can make an item increase or lower the spell power on a hero, making that hero do more spell damage with his abilitys BUT...

heres my issue, for some reason the system can't really keep up with how much spell power each hero with spell power items should have and finally creating absurb amounts of spell power on heroes with those items so that they eventually one shot enemy targets with thier spells

i would really appreciate some help =)

Here's how it looks

SpellPowerInteger = no array
SpellPowerUnit = array 10
SpellPowerValue = Real array 10
SpellPowerZero = Real no array

  • SP Acquire
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set VariableSet SpellPowerInteger = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet SpellPowerUnit[SpellPowerInteger] = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type Common Spellstaff) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 6.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |c007d7d7dUncommon Spellstaff|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 12.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |c006969FFRare Spellstaff|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 18.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |cFFBE00FEEpic Spellstaff|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 24.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type Common Battlestaff) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 6.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |c007d7d7dUncommon Battlestaff|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 12.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |c006969FFRare Battlestaff|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 18.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |cFFBE00FEEpic Battlestaff|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 24.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type Common Book of Death) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 12.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |c007d7d7dUncommon Book of Death|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 24.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |c006969FFRare Book of Death|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 36.00))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SpellPowerUnit[SpellPowerInteger] has an item of type |cFFBE00FEEpic Book of Death|r) Equal to True
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] + (SpellPowerZero + 48.00))
        • Else - Actions

  • SP Lose
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Set VariableSet SpellPowerInteger = (Player number of (Owner of (Triggering unit)))
      • Set VariableSet SpellPowerUnit[SpellPowerInteger] = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Common Spellstaff
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 6.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c007d7d7dUncommon Spellstaff|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 12.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c006969FFRare Spellstaff|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 18.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cFFBE00FEEpic Spellstaff|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 24.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Common Battlestaff
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 6.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c007d7d7dUncommon Battlestaff|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 12.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c006969FFRare Battlestaff|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 18.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cFFBE00FEEpic Battlestaff|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 24.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Common Book of Death
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 12.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c007d7d7dUncommon Book of Death|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 24.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c006969FFRare Book of Death|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 36.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |cFFBE00FEEpic Book of Death|r
        • Then - Actions
          • Set VariableSet SpellPowerValue[SpellPowerInteger] = (SpellPowerValue[SpellPowerInteger] - 48.00)
        • Else - Actions

  • SP Damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (DamageEventSource has an item of type Common Spellstaff) Equal to True
              • (DamageEventSource has an item of type |c007d7d7dUncommon Spellstaff|r) Equal to True
              • (DamageEventSource has an item of type |c006969FFRare Spellstaff|r) Equal to True
              • (DamageEventSource has an item of type |cFFBE00FEEpic Spellstaff|r) Equal to True
              • (DamageEventSource has an item of type Common Battlestaff) Equal to True
              • (DamageEventSource has an item of type |c007d7d7dUncommon Battlestaff|r) Equal to True
              • (DamageEventSource has an item of type |c006969FFRare Battlestaff|r) Equal to True
              • (DamageEventSource has an item of type |cFFBE00FEEpic Battlestaff|r) Equal to True
              • (DamageEventSource has an item of type Common Book of Death) Equal to True
              • (DamageEventSource has an item of type |c007d7d7dUncommon Book of Death|r) Equal to True
              • (DamageEventSource has an item of type |c006969FFRare Book of Death|r) Equal to True
              • (DamageEventSource has an item of type |cFFBE00FEEpic Book of Death|r) Equal to True
        • Then - Actions
          • Set VariableSet DamageEventAmount = (DamageEventAmount + SpellPowerValue[SpellPowerInteger])
        • Else - Actions
 
Level 5
Joined
Oct 20, 2019
Messages
60
Rather than pasting triggers, I included a test map so you can check it out in "action". However, I didn't bloat it with Damage Engine, that's something you can do yourself in your map.

Thank you very much for the help, i think i got the hang of it, atleast with the gain and lose SP

but i have 2 questions

1. what do i do with the Check trigger? i dont really know what it does or if i need it
do i keep it, change it or delete it?

2. how do i put those numbers into the Damage Detect system so it increases the spell damage?

before i had it like this

  • Set VariableSet DamageEventAmount = (DamageEventAmount + SpellPowerValue[SpellPowerInteger])
 
Level 5
Joined
Jul 31, 2020
Messages
103
Thank you very much for the help, i think i got the hang of it, atleast with the gain and lose SP

but i have 2 questions

1. what do i do with the Check trigger? i dont really know what it does or if i need it
do i keep it, change it or delete it?

2. how do i put those numbers into the Damage Detect system so it increases the spell damage?

before i had it like this

  • Set VariableSet DamageEventAmount = (DamageEventAmount + SpellPowerValue[SpellPowerInteger])

  • Damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • IsDamageSpell Equal to True
    • Actions
      • Custom script: set udg_DamageEventAmount = udg_DamageEventAmount + LoadReal(udg_SPHash, GetHandleId(udg_DamageEventSource), 1)
Edit: Check does what the test map says when it loads, prints out the current spell power of selected units if you post .sp in the chat. You can delete it.
 
Status
Not open for further replies.
Top