• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] My trigger for setting stats/level.

Status
Not open for further replies.
Hello, I am currently working on a system, can not be told as for certain reasons but i am able to show you the trigger.

  • Evolution test
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CurrentAgi[(Integer A)] Greater than CurrentStr[(Integer A)]) and (CurrentAgi[(Integer A)] Greater than CurrentInt[(Integer A)])
              • (Hero level of PlayerPet[(Integer A)]) Equal to 8
            • Then - Actions
              • Unit - Create 1 EvolutionTreeAgility[(Integer A)] for (Owner of PlayerPet[(Integer A)]) at (Position of (Triggering unit)) facing Default building facing degrees
              • Set NewPet[(Integer A)] = (Last created unit)
              • Hero - Set NewPet[(Integer A)] Hero-level to CurrentLevel[(Integer A)], Hide level-up graphics
              • Hero - Modify Strength of NewPet[(Integer A)]: Add (Strength of PlayerPet[(Integer A)] (Exclude bonuses))
              • Hero - Modify Agility of NewPet[(Integer A)]: Add (Agility of PlayerPet[(Integer A)] (Exclude bonuses))
              • Hero - Modify Intelligence of NewPet[(Integer A)]: Add (Intelligence of PlayerPet[(Integer A)] (Exclude bonuses))
              • Hero - Modify unspent skill points of NewPet[(Integer A)]: Set to 0 points
              • Unit - Remove PlayerPet[(Integer A)] from the game
              • Set PlayerPet[(Integer A)] = NewPet[(Integer A)]
              • Set NewPet[(Integer A)] = No unit
              • Trigger - Run New Unit Changes <gen> (checking conditions)
            • Else - Actions
And here is the trigger which declares it all.
  • Detection Of Stat
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StatPointsRemaining[(Integer A)] Equal to 0
            • Then - Actions
            • Else - Actions
              • Set StatPointsRemaining[(Integer A)] = (StatPointsRemaining[(Integer A)] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Increase |cffff0000Strength|r.
                • Then - Actions
                  • Set CurrentStr[(Integer A)] = (CurrentStr[(Integer A)] + 1)
                  • Set CurrentLevel[(Integer A)] = (Hero level of PlayerPet[(Integer A)])
                  • Hero - Modify Strength of (Casting unit): Set to CurrentStr[(Integer A)]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Increase |cff0000ffIntelligence|r.
                • Then - Actions
                  • Set CurrentInt[(Integer A)] = (CurrentInt[(Integer A)] + 1)
                  • Set CurrentLevel[(Integer A)] = (Hero level of PlayerPet[(Integer A)])
                  • Hero - Modify Intelligence of (Casting unit): Add 1
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Increase |cff008000Agility|r.
                • Then - Actions
                  • Set CurrentAgi[(Integer A)] = (CurrentAgi[(Integer A)] + 1)
                  • Set CurrentLevel[(Integer A)] = (Hero level of PlayerPet[(Integer A)])
                  • Hero - Modify Agility of (Casting unit): Set to CurrentAgi[(Integer A)]
                  • Trigger - Run Evolution test <gen> (checking conditions)
                • Else - Actions
This trigger is suppose to create the unit, set the stats and level, then remove old unit. I have two different ways, this way and replacing the old unit. However, neither of these work. Any suggestions.
 
Last edited:
Level 11
Joined
Sep 12, 2008
Messages
657
may i ask..
why the hell do you use a for loop integer a that has 1 count!?!
just put the frigging number "1"..
seriusly? integer a bugs, makes it totaly wrong..

second, are you sure you have all the if/then/elses right ingame?
(more agi then the str, and int..)
use unit starts the effect of an ability, not starts channeling.
use triggering unit over Casting unit,
why do you use 2 variables,
1 NewPet, and 1 PlayerPet, if they both will get same array?.. so much weird stuff..
 
may i ask..
why the hell do you use a for loop integer a that has 1 count!?!
just put the frigging number "1"..
seriusly? integer a bugs, makes it totaly wrong..

second, are you sure you have all the if/then/elses right ingame?
(more agi then the str, and int..)
use unit starts the effect of an ability, not starts channeling.
use triggering unit over Casting unit,
why do you use 2 variables,
1 NewPet, and 1 PlayerPet, if they both will get same array?.. so much weird stuff..

Sorry, i was doing tests, The old version has integers ranging from 1 to 12.
and i will try using those 2.
Once again i only started using those for testing, see if i could find out the problem. my old version worked but after putting a new increase stat system, it failed so i tryed a new way.
 
You are using an Integer A loop inside an Integer A loop. This causes bugs. For one of the triggers, use Integer B. Also, in Evolution test, you are creating a unit at "Position of Triggering Unit". This might bug as well. In the first trigger, you can make a unit variable like Temp_Unit, and set Temp_Unit = Triggering Unit, then in the second trigger, create the unit at "Position of Temp_Unit(instead of triggering unit)". The point location also leaks.

One more thing. Get rid of NewPet. Replace it with just 'Last Created Unit'. The only time you EVER need Unit variables are in MUI periodic spells/systems. This system is instant-cast, as in, as soon as you cast the ability(Increase |cff008000Agility|r in your case), the trigger fires and ends immediately.
 
Status
Not open for further replies.
Top