• 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] Backstab

Status
Not open for further replies.
Level 2
Joined
Dec 14, 2007
Messages
12
Hi,guys!
Can anyone explain me how to activate some trigger when unit is attacked from behind (rikimaru-like from dota) in GUI?:wscrolleyes:
:fp: THX
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Never played DoTA but I guess you mean something like this

  • Unknown
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Facing of (Attacking unit)) Less than ((Facing of (Triggering unit)) + 50.00)
          • (Facing of (Attacking unit)) Greater than ((Facing of (Triggering unit)) - 50.00)
    • Actions
      • Actions
 
Level 6
Joined
Nov 28, 2007
Messages
203
You don't need the "And - All (Conditions) are true" condition, because it's already set to all. "And - All---" is only needed inside the "Or" condition.
 
Level 2
Joined
Dec 14, 2007
Messages
12
BTW,do you know how to make spell that will toss bouncing shuriken dealing damage to units that will die after 5 sec?
 
Level 6
Joined
Nov 28, 2007
Messages
203
or.. w8, what do you mean? that the spell should automatically send bouncing shurikens when the enemies have around 5% hp? :)
 
Level 2
Joined
Dec 14, 2007
Messages
12
NO,I want my unit to toss a shuriken that will bounce around and deal damage BUT shuriken will die after 5 sec NOT units!!!!
 
Level 6
Joined
Nov 28, 2007
Messages
203
Ok, i can do it. (i think)
[Edit]: Umm.. do u want it as a "Use" spell or a automatic? (that it shoots every time the hero attacks)
[Edit2]: I can do both
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Lets say you cast the shuriken 100 range from you.

So you set a point at caster, a point 100 from caster toward facing of caster.

Now since its supposed to move 5 seconds you will set its speed to 100/5 so it will move 20 per second and thats realy slow, and will look pretty much crappy.
 
Level 6
Joined
Nov 28, 2007
Messages
203
i don't mean that it should only attack one target. it should bounce around on an unlimited number of targets for 5 seconds with a specific speed.
 
Level 2
Joined
Dec 14, 2007
Messages
12
ANOTHER PROBLEM
I've tried to make a spell that will trigger when unit is backstabed. It was supposed to make an illusion of attacking unit so I decided to create an example:

(First I have added a peasant 1 inventory slot so that he could carry wand and i've created a unit variable named dummy.)

backstab illusions
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to Footman
(Facing of (Attacking unit)) Less than ((Facing of (Triggering unit)) + 50.00)
(Facing of (Attacking unit)) Greater than ((Facing of (Triggering unit)) - 50.00)
Actions
Unit - Create 1 Peasant for Player 1 (Red) at (Position of (Attacking unit)) facing Default building facing degrees
Set dummy = (Last created unit)
Hero - Create Wand of Illusion and give it to dummy
Hero - Order dummy to use (Item carried by dummy in slot 1) on (Attacking unit)
Unit - Remove dummy from the game

Why this doesn't work or even better do you have a better idea?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
First of all you don't need the Dummy unit variable but whatever.

Now, does the "Peasent" have a model ? Is there any possiblity the illusion costs mana ? Is it possible the peasent just doesn't have enough time to cast ?

Check this points.
And you should make "create a peasent for (owner of (attacking unit)).
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Just check what I said.

In the dummy's moddel path type ".mdl", this will allow the unit to cast spells without turning around (because he has no model to turn around...).

You should check if the illusion spell costs mana (although I don't think there is a reason it should).

Change "Create Peasent for (player 1)" to "Create Peasent for (Owner of (triggering unit)).

Make a little wait beetwin the casting order of Dummy and the removal of him, and check if the spells takes time to cast or its 0.00 seconds of casting time.
 
Level 6
Joined
Nov 28, 2007
Messages
203
I've got some problems. About the time the shuriken bounces around, but i could make a dummy unit for it, but that will take some time..
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I think this should work.

[Warning]: this spell is not MUI !
If you want it MUI edit for your own proposes :)


Now before you read the trigger itself, a bit of explaining:

This trigger finds any unit with a buff that will be the cause of a shuriken hitting him.
The bonus of this, is, that the ability of the shuriken could be ANY ability.
I think the best ability though would be the Cluster Rockets since thats exacly what you need with a bit of edits.

You should make the ability your own buff and make it be for exacly 0.20 seconds (or whatever you want, just change it accordently [thats how you type that?] to the "Shuriken" event.

After finding a unit with the certain buff it picks a random unit within whatever range you want from him (I did 400 as you can see) and then sets him to be the next target, and then creates a dummy which will cast the ability again.


The good points of this are:

• You don't need to use waits which can cause a little "lags" beetwin the jumps.
• As I said before, you can use any ability you want.
• Making a damage system for this (if you don't use the normal ability damage) would be very easy since you can check if the unit has the certain buff.

The bad points of this are:

• Making this GUI would be a HECK of a job (maybe not hard... but long... very long)
• Without making it perfectly GUI you won't be able to check who owns the caster

And now the trigger itself:

  • Shuriken
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Acid Bomb) Equal to True
            • Then - Actions
              • Set Point[1] = (Position of (Picked unit))
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Random 1 units from (Units within 400.00 of Point[1])) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is alive) Equal to True
                    • Then - Actions
                      • Unit - Create 1 Dummy Unit for (Here you will need to implant your own system that will check who is the caster's owner, if you need help with it ill be glad to help but not now and it will probably be a very long trigger ^^) at Point[1] facing Default building facing degrees
                      • Custom script: call RemoveLocation(udg_Point[1])
                      • Set Point[1] = (Position of (Picked unit))
                      • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets Point[1]
                      • Custom script: call RemoveLocation(udg_Point[1])
                    • Else - Actions
            • Else - Actions
  • Shuriken Activation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ability
    • Actions
      • Trigger - Turn on Shuriken <gen>
      • Wait 5.00 seconds
      • Trigger - Turn off Shuriken <gen>

Disclaimer
: Im tired >.< , if there is any ciritcal mistake thats probably the cause.


[Edit]
just as a after thought, this would also target allies, so if you don't want it to, just add a condition so it would pick only enemys of ---, this would require your own player-checker system as is written at the start of this comment.


(lol this was like the longest comment I ever made... I really wish it was worth it and it would work ^^)

I really wish it works.
Would of tested myself but im going to sleep... nighty for all the hive :)
 
Last edited:
Status
Not open for further replies.
Top