• 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.

[Trigger] Skill problem

Status
Not open for further replies.
Level 7
Joined
Nov 19, 2007
Messages
253
Hi all,
so i was playing my map and i saw that one skill isn't working properly. skill works like this: Unit is attacked, attacker have 30% chance to increase all of his stats by 1 for 20 seconds, it adds stats but it sometimes subtracks too much of stats. Can someone help me with this?
  • Avatar aura
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Attacking unit) has buff Avatar Aura ) Equal to True
          • ((Attacking unit) is an illusion) Equal to False
    • Actions
      • Set AaAttacker = (Attacking unit)
      • Set AaChanse = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (AaAttacker is A Hero) Equal to True
              • AaChanse Less than or equal to 30
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of AaAttacker using Abilities\Spells\Human\Avatar\AvatarCaster.mdl
          • Set AaSpecialEffect = (Last created special effect)
          • Hero - Modify Strength of AaAttacker: Add 1
          • Hero - Modify Agility of AaAttacker: Add 1
          • Hero - Modify Intelligence of AaAttacker: Add 1
          • Special Effect - Destroy AaSpecialEffect
          • Wait 20.00 seconds
          • Hero - Modify Strength of AaAttacker: Subtract 1
          • Hero - Modify Agility of AaAttacker: Subtract 1
          • Hero - Modify Intelligence of AaAttacker: Subtract 1
        • Else - Actions
          • Do nothing
Can someone tell me whats wrong and/or can tell me how to fix this.
 
Level 7
Joined
Nov 19, 2007
Messages
253
Can anyone make me jass trigger then pls? never tried jass before and don't know how to make jass trigger or maybe someone can link me some tutorials and tools with jass?
 
you can remove the integer variable AaChanse and just use the condition Random Integer Between 1 and 100 less than or equal to 30, well thats 1 less line and you only use that variable once so I guess it would be faster (1 function call rather than 1 function call and 1 variable call). And also remove the DO-Nothing because it does nothing, it just takes up space there.
 
Level 7
Joined
Nov 19, 2007
Messages
253
just do Edit - Convert to custom text

then where you see this line

set udg_AaAttacker = GetAttackingUnit()
change to
local unit AaAttacker = GetAttackingUnit()

then any line that uses udg_AaAttacker just remove the udg_ infront of it.

+rep
I done this but now i can't test my map now why?

you can remove the integer variable AaChanse and just use the condition Random Integer Between 1 and 100 less than or equal to 30, well thats 1 less line and you only use that variable once so I guess it would be faster (1 function call rather than 1 function call and 1 variable call). And also remove the DO-Nothing because it does nothing, it just takes up space there.

Well I don't think that this could fix my problem. and about removing integer I dont think that this could change anything and do nothing well i never use this and i dont know how that get in there but i don't think could change anything
 
+rep
I done this but now i can't test my map now why?



Well I don't think that this could fix my problem. and about removing integer I dont think that this could change anything and do nothing well i never use this and i dont know how that get in there but i don't think could change anything

well maybe its just a matter of simplification and reducing the number of lines. are you using JNGP?
 
First of all what is "JNGP" and second no i don't think i'm using that.

JASS NEWGEN PACK has a modified version of the editor and some more.. the editor it comes with is NewGenWE. so I think you don't have TESH too. NewGenWE comes with TESH which has a sytax checker that points out errors in your script...

if your script has errors you cannot open the map in Warcraft....

you can find JNGP in the tools section, the syntax checker of TESH is useful especially when you're just starting out in JASS and vJASS. and also I think NewGenWE still don't have a good support for GUI hashtables just for the info...
 
Level 7
Joined
Nov 19, 2007
Messages
253
Well im usint normal WE which is in my warcraft folder i didn't downloaded any other tools.

EDIT: I think I found that JNGP..
 
Status
Not open for further replies.
Top