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

How do we make evasion and critical strike castable?

Status
Not open for further replies.
Level 2
Joined
Mar 15, 2007
Messages
28
I'm trying to make evaion and critical strike castable on normal units, but I'm a noob on trigger,can any one teach me how to do it?
 
Level 12
Joined
Nov 5, 2007
Messages
730
its simple
  • Power Word Fortitude 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Evasion = (Units in (Playable map area))
      • Unit Group - Pick every unit in Evasion and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff EvasionBuff ) Equal to True
            • Then - Actions
              • Unit - Add Evasion(Dummy) to (Picked unit)
            • Else - Actions
              • Unit - Remove Evasion(Dummy) from (Picked unit)
Foe example,for evasion use the berserk spell.Change the berserk buff to EvasionBuff.Then use the item evasion spell as the Evasion(Dummy)
 
Level 12
Joined
Nov 5, 2007
Messages
730
There could be problems with that trigger,for example,it lasts 8 seconds,and if the unit dies in the meantime the ability doesnt remove properly.At least thats what occured to me when i was using it.
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
It's quite simple, it can be made like this too.

  • Cast Evasion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Evasion (Self)
    • Actions
      • Unit - Add Evasion to (Triggering unit)
      • Wait 20.00 seconds
      • Unit - Remove Evasion from (Triggering unit)
  • Cast Critical Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Critical Strike (Self)
    • Actions
      • Unit - Add Critical Strike to (Triggering unit)
      • Wait 20.00 seconds
      • Unit - Remove Critical Strike from (Triggering unit)
 
Level 5
Joined
Nov 14, 2007
Messages
161
i happen to be attempting the same thing, i got the evasion one to work fine so i know this way works. my critical strike one isnt but im sure its just me right now >.> (see edit at bottom)

if more then 1 person are going to play this map at a time, i suggest setting the triggering units to variables because if you have 2 people cast that spell in the given time limit, it will never remove the skill from the first to cast. look in the tutorial section for how to create and assign variables if you dont know. also on mine, i have the skill level up with higher evading chances so i had to put in a line to match the levels.

My variable Dummy_CE is my unit variable

  • Castable Evasion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Evasion (hero)
    • Actions
      • Set Dummy_CE = (Triggering unit)
      • Unit - Add Evasion (dummy) to Dummy_CE
      • Unit - Set level of Evasion (dummy) for Dummy_CE to (Level of Evasion (hero) for Dummy_CE)
      • Wait 30.00 seconds
      • Unit - Remove Evasion (dummy) from Dummy_CE
EDIT: i think i figured out y my castable crit strike wont work... i have both based off the same skill which i hear is a no-no in mapping.. name another instant cast type buff skill like berserk but not..
 
Last edited:

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
What if another casts the spell, the trigger will always remove the lasts variable used caster. That is global variable, not local! Triggering unit lives long by itself.

I think it need "Set Dummy_CE = (Triggering unit)" and Set "Dummy_CE = no unit" immediately. But I'm not totally sure about leaks and stuff.
 
Level 2
Joined
Mar 15, 2007
Messages
28
I've found out that you need to use different buff on different spell, if you use the same buff, the computer will be confused and the spell won't work properly.
 
Level 5
Joined
Nov 14, 2007
Messages
161
I've found out that you need to use different buff on different spell, if you use the same buff, the computer will be confused and the spell won't work properly.

yeah i figured that out as well.. what other skill do you have that has no channeling click to cast type much like berserk... but not. id like to have my crit chance be clickable because it would be closer to mimicking the game my map is based off.

so name another self buff that i can take the effects off. *thinks for a second* maybe frenzy... ill figure one out tomorrow and edit this if i get another working. night everyone.
 
Level 4
Joined
Feb 22, 2005
Messages
110
There are other options in addition to those, you could create a dummyunit and dummyspell with Drunken Haze modified to hit only one unit and give 100% miss chance.

Event:
Unit is Attacked

Conditions:
Attacked unit has EvasionBuff equal to true

Actions:
If Random number between 1 and 100 greater than or equal to 35(Or whatever miss chance you want)
Create 1 Dummycaster for owner of Attacked unit at position of Attacking unit
Add MissAttack to last created unit
Order last created unit to drunkenhaze Attacking Unit
Apply 2 seconds generic expiration timer to last created unit.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
There could be problems with that trigger,for example,it lasts 8 seconds,and if the unit dies in the meantime the ability doesnt remove properly.At least thats what occured to me when i was using it.
Bad example... if the unit is dead, then it doesn't matter whether or not it has the ability, yes?

Oh, and don't use globals through waits if avoidable. (Just use (Triggering Unit) past the wait in this case)
 
Level 5
Joined
Nov 14, 2007
Messages
161
Bad example... if the unit is dead, then it doesn't matter whether or not it has the ability, yes?
so your saying if the unit dies, he still has the buff when he resurects/revives? if thats the case cant i just add a trigger that removes all buffs on hero is being revived? or at least removes the buffs like this one?

Oh, and don't use globals through waits if avoidable. (Just use (Triggering Unit) past the wait in this case)
is there a way to use locals in gui or do i have to figure out some jass to finish this and properly make it MUI?
 
Level 12
Joined
Nov 5, 2007
Messages
730
Bad example... if the unit is dead, then it doesn't matter whether or not it has the ability, yes?

Oh, and don't use globals through waits if avoidable. (Just use (Triggering Unit) past the wait in this case)

yes but if its a hero?in my map heroes died,and revived 30 seconds later with that ablility

anyways this way works fine,although im not sure if it causes lags...
 
Level 5
Joined
Nov 14, 2007
Messages
161
There's a local trick, name them the same thing as a global (udg_name) and then you can reference them normally.

so would my trigger change to:
  • Castable Evasion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Evasion (hero)
    • Actions
      • Set udg_Dummy_CE = (Triggering unit)
      • Unit - Add Evasion (dummy) to udg_Dummy_CE
      • Unit - Set level of Evasion (dummy) for udg_Dummy_CE to (Level of Evasion (hero) for udg_Dummy_CE)
      • Wait 30.00 seconds
      • Unit - Remove Evasion (dummy) from udg_Dummy_CE
if this is correct let me know. by the way, nice local trick =P
 
Level 5
Joined
Nov 14, 2007
Messages
161
alright thx again PurplePoot works for unit. i dont know if its just me messing up but does this work for a point variable as well? i have:
  • w00t
    • Actions
      • Custom script: local point udg_Point_BS
      • Set Point_BS = (Position of (target unit of ability being cast))
      • --------other stuff--------
      • Custom script: call RemoveLocation(udg_Point_BS)
i get the error on the local point udg_Point_BS part.


*side note* reminds me of my programming class that i failed due to me being in the hospital for a month and the teacher was horrific, about 3/4 the class dropped him.
 
Last edited:
Level 11
Joined
Aug 25, 2006
Messages
971
Theres no such thing as a point. Its actually called a location. They renamed several things. Like did you know unit types/ability types/lightning types/(Any other 'type' is actually stored as an integer? I thought that was pretty weird (about 1.5 years ago) when I first got into JASS. Now I understand mountains more then I did then.

Anyway, It should be
JASS:
local location udg_Point_BS

The clue was in RemoveLocation
 
Level 5
Joined
Nov 14, 2007
Messages
161
The clue was in RemoveLocation

should have seen that one.. i did try doing a "region" variable with no success =P

woot finally saves with no error =P thx all.

and Kaell, sorry for taking over your thread, i hope your question was answered as well ^_^
 
Level 5
Joined
Nov 14, 2007
Messages
161
There is a region type too, but let's not go there - it's more of a collection of rects.

ganna guess the 4 corner points.. but i didnt go there so dont worry about responding, i'll learn some basic JASS at some point in time... =P thx again.
 
Status
Not open for further replies.
Top