Illusion ability like Dota's PL

kelogsloops

You can change this now in User CP.
Reaction score
45
Okay so I made an ability and based it off Brilliance Aura. the ability gives the hero passive armor piercing which was a second ability i added through triggering and that works, but most of all, this ability allows the hero to create illusions passively with X chance of occuring, like PL's illusion spell.

This is my coding

Trigger:
  • Crystalline Focus Add
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Crystalline Focus X
    • Actions
      • Unit - Add Crystalline Focus to (Triggering unit)
      • Unit - Set level of Crystalline Focus for (Triggering unit) to (Level of Crystalline Focus X for (Triggering unit))


Trigger:
  • Make Illusion
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 1
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 2
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 3
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 4
      • (Random integer number between 1 and 100) Less than or equal to (25 x (Level of Crystalline Focus for (Attacking unit)))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in IllusionNumber) Less than or equal to 6
        • Then - Actions
          • Set Temp_loc = (Position of (Attacking unit))
          • Unit - Create 1 Dummy Test Visible for (Owner of (Attacking unit)) at Temp_loc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to IllusionNumber
          • Hero - Create Wand of Illusion and give it to (Last created unit)
          • Set item = (Last created item)
          • Hero - Order (Last created unit) to use item on (Attacking unit)
          • Unit - Add a 10.01 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Temp_loc)
          • Wait 10.01 seconds
          • Unit Group - Remove (Last created unit) from IllusionNumber
        • Else - Actions
          • Do nothing


The thing is, i want it to limit to 6 illusions. Each illusion lasts for 10 seconds and an invisible dummy has a generic timer of 10 seconds, so that each dummy 'acts' as a number in the unit group for the illusion since i can't add an illusion to the unit group. It starts off fine, except that it maxes at 7 illusions for some strange reason, then when those all die, it makes 6 or 5 illusions max i think, and then it stops working.
 

ultimate11

Active Member
Reaction score
25
Trigger:
  • Spell
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Crystalline Focus for (Attacking unit)) Greater than or equal to 1
      • (Random integer number between 1 and 100) Less than or equal to ((Level of Crystalline Focus for (Attacking unit)) x 25)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • count[(Player number of (Owner of (Attacking unit)))] Less than 7
        • Then - Actions
          • Set count[(Player number of (Owner of (Attacking unit)))] = (count[(Player number of (Owner of (Attacking unit)))] + 1)
          • Set Point = (Position of (Attacking unit))
          • Unit - Create 1 Footman for (Owner of (Attacking unit)) at Point facing Default building facing degrees
          • Unit - Add a 0.40 second Generic expiration timer to (Last created unit)
          • Unit - Turn collision for (Last created unit) Off
          • Hero - Create Wand of Illusion and give it to (Attacking unit)
          • Hero - Order (Last created unit) to use (Last created item) on (Attacking unit)
          • Custom script: call RemoveLocation(udg_Point)
        • Else - Actions

Trigger:
  • Rule
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is an illusion) Equal to True
    • Actions
      • Set count[(Player number of (Owner of (Triggering unit)))] = (count[(Player number of (Owner of (Triggering unit)))] - 1)


is a quite fast trigger is based to work for many heroes not only for one.You can also add a custom value to illisions...making more easy for you to recognize them to second trigger.It should work fine.

Regards
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Okay so I made an ability and based it off Brilliance Aura. the ability gives the hero passive armor piercing which was a second ability i added through triggering and that works, but most of all, this ability allows the hero to create illusions passively with X chance of occuring, like PL's illusion spell.

This is my coding

Trigger:
  • Crystalline Focus Add
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Crystalline Focus X
    • Actions
      • Unit - Add Crystalline Focus to (Triggering unit)
      • Unit - Set level of Crystalline Focus for (Triggering unit) to (Level of Crystalline Focus X for (Triggering unit))


Trigger:
  • Make Illusion
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 1
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 2
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 3
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 4
      • (Random integer number between 1 and 100) Less than or equal to (25 x (Level of Crystalline Focus for (Attacking unit)))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in IllusionNumber) Less than or equal to 6
        • Then - Actions
          • Set Temp_loc = (Position of (Attacking unit))
          • Unit - Create 1 Dummy Test Visible for (Owner of (Attacking unit)) at Temp_loc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to IllusionNumber
          • Hero - Create Wand of Illusion and give it to (Last created unit)
          • Set item = (Last created item)
          • Hero - Order (Last created unit) to use item on (Attacking unit)
          • Unit - Add a 10.01 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Temp_loc)
          • Wait 10.01 seconds
          • Unit Group - Remove (Last created unit) from IllusionNumber
        • Else - Actions
          • Do nothing


The thing is, i want it to limit to 6 illusions. Each illusion lasts for 10 seconds and an invisible dummy has a generic timer of 10 seconds, so that each dummy 'acts' as a number in the unit group for the illusion since i can't add an illusion to the unit group. It starts off fine, except that it maxes at 7 illusions for some strange reason, then when those all die, it makes 6 or 5 illusions max i think, and then it stops working.

As pointed out the reason this doesn't work is because of the wait, that is screwy. What you want to do is eliminate the wait, but you can do it simply by using a trigger such as:

Trigger:
  • Crystalline Focus Add
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Crystalline Focus X
    • Actions
      • Unit - Add Crystalline Focus to (Triggering unit)
      • Unit - Set level of Crystalline Focus for (Triggering unit) to (Level of Crystalline Focus X for (Triggering unit))


Trigger:
  • Make Illusion
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 1
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 2
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 3
          • (Level of Crystalline Focus for (Attacking unit)) Equal to 4
      • (Random integer number between 1 and 100) Less than or equal to (25 x (Level of Crystalline Focus for (Attacking unit)))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GroupCount) Less than or equal to 6
        • Then - Actions
          • Set Temp_loc = (Position of (Attacking unit))
          • Unit - Create 1 Dummy Test Visible for (Owner of (Attacking unit)) at Temp_loc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to IllusionNumber
          • Set GroupCount = GroupCount + 1
          • Hero - Create Wand of Illusion and give it to (Last created unit)
          • Set item = (Last created item)
          • Hero - Order (Last created unit) to use item on (Attacking unit)
          • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Temp_loc)
        • Else - Actions
          • Do nothing


Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in IllusionNumber) Equal to True
    • Actions
      • Set GroupCount = ((Number of units in IllusionNumber) - 1)


That should work, also i would advise you to download the GDD damage detection, as this can be abused to make illusions, because the event unit is attacked is unreliable.
 

ultimate11

Active Member
Reaction score
25
GDD is use to detect a damage and is good.It`s true unit attacked event recognize when event its start but dont recognize when it`s finished.
I think that my trigger is simpliest to use.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
GDD is use to detect a damage and is good.It`s true unit attacked event recognize when event its start but dont recognize when it`s finished.
I think that my trigger is simpliest to use.

It's simple yes, but what if there is an item that makes illusions? Then the count will go down even if those illusions are not the part of the original spell. Even worse, what if the hero has multiple illusion spells, then all of them will be affected. In this way only this group is considered.
 

Ayanami

칼리
Reaction score
288
Just to simplify the above trigger:

Trigger:
  • Crystalline Focus Add
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Crystalline Focus X
    • Actions
      • Unit - Add Crystalline Focus to (Triggering unit)
      • Unit - Set level of Crystalline Focus for (Triggering unit) to (Level of Crystalline Focus X for (Triggering unit))


Trigger:
  • Make Illusion
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Crystalline Focus for (Attacking unit)) Greater than 0
      • (Random integer number between 1 and 100) Less than or equal to (25 x (Level of Crystalline Focus for (Attacking unit)))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GroupCount) Less than or equal to 6
        • Then - Actions
          • Set Temp_loc = (Position of (Attacking unit))
          • Unit - Create 1 Dummy Test Visible for (Owner of (Attacking unit)) at Temp_loc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to IllusionNumber
          • Set GroupCount = GroupCount + 1
          • Custom Script: call IssueTargetOrderById(GetLastCreatedUnit(), 852274, GetAttacker())
          • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Temp_loc)
        • Else - Actions


Trigger:
  • Illusion Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in IllusionNumber) Equal to True
    • Actions
      • Set GroupCount = ((Number of units in IllusionNumber) - 1)


You don't need to create the wand of illusion and give it to the dummy unit. Simply, change the "Item - Illusion" ability into a unit ability and give it to the dummy.

As mentioned above, this doesn't detect a proper attack dealt. To detect a proper attack, you'd need to use a damage detection system (GDD) coupled with a Buff Placer.
 

ultimate11

Active Member
Reaction score
25
It's simple yes, but what if there is an item that makes illusions? Then the count will go down even if those illusions are not the part of the original spell. Even worse, what if the hero has multiple illusion spells, then all of them will be affected. In this way only this group is considered.

I say it.He can set a specific custom value to that illusions,and in second trigger when an ilusion die to add an extra condition like
Trigger:
  • cutom value of triggering unit egual to 10
for exemple
 

Ayanami

칼리
Reaction score
288
I say it.He can set a specific custom value to that illusions,and in second trigger when an ilusion die to add an extra condition like
Trigger:
  • cutom value of triggering unit egual to 10
for exemple

Just a simple Unit group will suffice. However, that will work too. But, it might clash with other units with the same Custom Value, especially when Custom Value is used elsewhere.
 

ultimate11

Active Member
Reaction score
25
Just a simple Unit group will suffice. However, that will work too. But, it might clash with other units with the same Custom Value, especially when Custom Value is used elsewhere.

it`s less prosible but we are right both of us.he can choose what he want :thup:
 

kelogsloops

You can change this now in User CP.
Reaction score
45
OH SORRY for hte slow reply. Umm. i'm reading through all the triggers but big question, how do you make a unit use an item ability thats been turned into a unit ability e.g. item illusion int oa unit ability? i mean, in the 'Issue Unit an Order to a Unit' or something, whre is it?
 

Ayanami

칼리
Reaction score
288
OH SORRY for hte slow reply. Umm. i'm reading through all the triggers but big question, how do you make a unit use an item ability thats been turned into a unit ability e.g. item illusion int oa unit ability? i mean, in the 'Issue Unit an Order to a Unit' or something, whre is it?

You can do it in JASS, like stated above. This is for "Item - Illusion"

Trigger:
  • Actions
    • Custom Script: call IssueTargetOrderById(udg_MyCastingUnit, 852274, udg_MyTargetUnit)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top