Trigger Problems

xmkiller

New Member
Reaction score
6
To get right to the point; I had used IKilledKEnny's and Chocobo's tutorials to make this and altered it slightly. Everything works perfectly fine except for a slight thing I had added.
I want this certain unit to get mana for doing damage which works fine but the mana doesnt stack. Meaning that when it hits a unit and gets 13 mana and if he hits the unit again and get 18 mana, the units mana will not be 13+18 = 31 but instead replacing the old mana into the new one resulting in 18.

I've tryed everything I can think of so im asking you guys now. :)

Code:
Init Dmg Detect
    Events
        Map initialization
        Unit - A unit enters (Entire map)
    Conditions
    Actions
        Set TempInt = (TempInt + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TempInt Equal to 1
            Then - Actions
                Custom script:   set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
                    Loop - Actions
                        Player - Disable Passives -Warrior- for (Owner of (Picked unit))
                        Trigger - Add to Show Damages <gen> the event (Unit - (Picked unit) Takes damage)
            Else - Actions
                Trigger - Add to Show Damages <gen> the event (Unit - (Triggering unit) Takes damage)



Code:
Show Damages
    Events
    Conditions
    Actions
        Set TempLoc = (Position of (Triggering unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Damage source) has buff Critical Strike ) Equal to True
            Then - Actions
                -------- Equipment --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                    Then - Actions
                    Else - Actions
                -------- Specialize --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                    Then - Actions
                    Else - Actions
                Set RandomInt = (Random real number between 2.00 and 2.50)
                Set CriticalMultiplier = RandomInt
                Set RandomReal = (Random real number between 0.00 and 100.00)
                Set CriticalPercentage = ((Real((Agility of (Damage source) (Include bonuses)))) / ((Real((Hero level of (Damage source)))) + CritChance[(Player number of (Owner of (Damage source)))]))
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RandomReal Less than CriticalPercentage
            Then - Actions
                Set DamageDealt = ((Damage taken) x CriticalMultiplier)
                Trigger - Turn off (This trigger)
                Unit - Cause (Damage source) to damage (Triggering unit), dealing (DamageDealt - 0.00) damage of attack type Chaos and damage type Universal
                Trigger - Turn on (This trigger)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Damage source) has buff Rage ) Equal to True
                    Then - Actions
                        Set RageConvers = (((Real((Level of (Damage source)))) x (Real((Level of (Triggering unit))))) / 2.00)
                        Set RageRegainHit = (DamageDealt / RageConvers)
                        Unit - Set mana of (Damage source) to (((Mana of (Damage source)) + RageRegainHit) / 4.00)
                        -------- test --------
                        Game - Display to (All players) the text: ((String(((RageRegainHit x 1.00) / 4.00))) + Crit)
                    Else - Actions
                        Do nothing
                Floating Text - Create floating text that reads ((TempColor[(Player number of (Owner of (Damage source)))] + (String((Integer(DamageDealt))))) + !) above (Triggering unit) with Z offset (Random real number between -30.00 and 30.00), using font size 9.20, color (90.00%, 90.00%, 90.00%), and 0.00% transparency
                Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 60.00 degrees
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
            Else - Actions
                Set DamageDealt = (Damage taken)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Damage source) has buff Rage ) Equal to True
                    Then - Actions
                        Set RageConvers = (((Real((Level of (Damage source)))) x (Real((Level of (Triggering unit))))) / 2.00)
                        Set RageRegainHit = (DamageDealt / RageConvers)
                        Unit - Set mana of (Damage source) to (((Mana of (Damage source)) + RageRegainHit) / 4.00)
                        Game - Display to (All players) the text: ((String(((RageRegainHit x 1.00) / 4.00))) + Crit)
                    Else - Actions
                        Do nothing
                Floating Text - Create floating text that reads ((TempColor[(Player number of (Owner of (Damage source)))] + (String((Integer((Damage taken)))))) + |r) above (Triggering unit) with Z offset (Random real number between -30.00 and 30.00), using font size 8.40, color (90.00%, 90.00%, 90.00%), and 0.00% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Set the velocity of (Last created floating text) to 60.00 towards (Random real number between 0.00 and 150.00) degrees
                Floating Text - Change the lifespan of (Last created floating text) to 1.80 seconds
                Floating Text - Change the fading age of (Last created floating text) to 1.20 seconds
 

Romek

Super Moderator
Reaction score
964
Code:
                        Unit - Set mana of (Damage source) to (((Mana of (Damage source)) + RageRegainHit) / 4.00)

Damage source could be "attacking unit", or "triggering unit".

...could work

i think Chocobo or IKilledKEnny will answer your question the best :p
 

xmkiller

New Member
Reaction score
6
Hm.. It does work though, it gives the mana to the correct unit but the mana doesn't add it replaces.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Code:
Unit - Set mana of (Damage source) to (((Mana of (Damage source)) + (Mana of (Damage source) + RageRegainHit) / 4.00)

Maybe like this? That code probably doesn't have the right number of brackets because I just copy and pasted that bit but you could try it.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Did you change it for both of the code line occurences? You have two parts where the mana should be altered did you change for both of them?
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
It gets confusing for me beause your using variables in other variables so if I read it I have to refer to like 3 other variables, can you explain how the new mana value is worked out?
 

xmkiller

New Member
Reaction score
6
Yeah, I seperated the values because It was alot to put into a variable without going into jass. :/



RageRegainHit = (((Damage Dealt / Level of Damage Source x Level of Triggering Unit) /2) /4)
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top