• 🏆 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!

[JASS] Need help localising two variables

Status
Not open for further replies.
The overall goal of this tigger is to deal damage to a unit when a spell is casted , that gives a buff , but damage isnt dealt until the unit recevies the buff. This spell will have more then one spell activating the trigger by different heroes with different stats , which could be casting at the same time. So in order to make it work i think i need to make the target_unit and Temp_integer in my GUI trigger to a jass local variable so target_unit and Temp_intgeger arent lost when two or more spells are casted or are waiting for the buff from the spell.

SOLVED
 
Last edited:
Level 13
Joined
Sep 13, 2010
Messages
550
re

Hi!

Try out this:
Initialization:

  • AbilIni
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Abilities[1] = YourAbil
      • Set Buffs[1] = YourBuff
Spell event

  • RegistSpell
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • Custom script: local unit Tempu = GetSpellTargetUnit()
        • Do Multiple ActionsFor each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Abilities[(Integer A)] Equal to (==) (Ability being cast)
              • Then - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Triggering unit) has buff Buffs[(Integer A)]) Equal to (==) True
                  • Then - Actions
                    • Unit - Cause (Casting unit) to damage (Tempu), dealing 150.00 damage of attack type Spells and damage type Normal
                    • -------- without JNGP --------
                    • Custom script: call UnitDamageTarget( GetSpellAbilityUnit() , Tempu , 150 , true , false , ATTACK_TYPE_MAGIC , DAMAGE_TYPE_NORMAL , WEAPON_TYPE_WHOKNOWS )
                  • Else - Actions
              • Else - Actions
      • Custom script: set Tempu = null
or

  • RegistSpell2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • Set Tempu = (Targeted unit)
        • Do Multiple ActionsFor each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Abilities[(Integer A)] Equal to (==) (Ability being cast)
              • Then - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Triggering unit) has buff Buffs[(Integer A)]) Equal to (==) True
                  • Then - Actions
                    • Unit - Cause (Casting unit) to damage Tempu, dealing 150.00 damage of attack type Spells and damage type Normal
                  • Else - Actions
              • Else - Actions
      • Set Tempu = No unit
Greetings
Geries
 
Status
Not open for further replies.
Top