HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to trigger bash

10-10-2004, 09:49 PM#1
JoSanchez55
(Stupid blizzard made magic immunity immune against bash and screwed my map up!)
I need to trigger bash, but it has to work on all units, even if they are spell immune. Heres my situation:

There are 2 types of towers, that i want to have a 15% chance to bash ANY unit, spell immune or not, for 1 second. The trigger must be able to work on an infinite number of units at the same time. (It cannot lose targets and leave the unit stunned forever.) It also must work in online-play. (10 players and 2 comps to be exact)

Any help is appreciated, and i give rep. You can either post the script or upload a map with a working example.
10-10-2004, 09:51 PM#2
Gandalf2349
First of all, you'd make a local variable to store the stunned unit in.

Second, can't you change the gameplay constants to stop that?
10-10-2004, 09:53 PM#3
JoSanchez55
Quote:
Originally Posted by Gandalf2349
First of all, you'd make a local variable to store the stunned unit in.

Second, can't you change the gameplay constants to stop that?

Gameplay - Magic Immunes Resist Damage
Gameplay - Magic Immunes Resist Leech
Gameplay - Magic Immunes Resist Thorns
Gameplay - Magic Immunes Resist Ultimates

Nope! and i have also tried adding the bash effect to skills that work on immunes, such as critical strike. This works on non-immunes but not on immunes.
10-10-2004, 10:02 PM#4
Gandalf2349
Add this to your actions:

Code:
Variables
 -tempBashUnit as Unit

Code:
Actions
 -Custom Script: local unit udg_tempBashUnit
 -Add bash to tempBashUnit however you have been.
 -Wait however long you have been
 -Remove Bash from tempBashUnit however you have been

that should work. Have fun.
10-10-2004, 10:07 PM#5
JoSanchez55
Quote:
Originally Posted by Gandalf2349
Add this to your actions:
that should work. Have fun.

Im stupid and i can't really understand that. Could you please give an exact code - or upload a map with it? And explain variable types. Sorry im in a hurry during this post im late.
10-10-2004, 10:19 PM#6
Milkman
The thing that is weird is since bash doesn't work on theese units, you can't add bash. Thus, remove magic immunity, add stunned status in any way u wish, (for example, have a caster cast bash on the unit. Search the forums for dummy caster usage or the like if you don't know how) then readd magic immunity and tada!
You'll still have to use the custom script: local unit udg_UNIT_TO_BASHED which will have to be a global aswell.
10-11-2004, 12:37 AM#7
JoSanchez55
Certain things cannot have magic immunity removed from them, and also i WANT these units to be immune to everything EXCEPT bash. I couldnt temproaraly remove magic immunity off of a avatar-unit. Removing, Changing, and Dummy casters will not work in my situation because:

A: I cannot temporarly remove magic immunity from certain units such as avatar.
B: There are no gameplay constants or targets i can set to allow the bash to work.
C: Dummy casters will not work because these units are IMMUNE to magic.

I just need a trigger-based system that will work flawlessly.
10-11-2004, 01:26 AM#8
Luzif3r
cos it got time i try to help you. first of all you need a script i found over at the jass vault:
http://kattana.users.whitehat.dk/viewfunc.php?id=86

insert it into your map and set up a trigger like i did in this map. as you can read the function has one bug left, but it is the best available.

please notice: im not teh-master-uber-triggerer. this solution might be far from perfect but it works. and i hope you know basic triggers and some jass.
10-11-2004, 02:23 AM#9
JoSanchez55
Quote:
Originally Posted by Luzif3r
cos it got time i try to help you. first of all you need a script i found over at the jass vault:
http://kattana.users.whitehat.dk/viewfunc.php?id=86

insert it into your map and set up a trigger like i did in this map. as you can read the function has one bug left, but it is the best available.

please notice: im not teh-master-uber-triggerer. this solution might be far from perfect but it works. and i hope you know basic triggers and some jass.

So confused here. The map you posted had 3 triggers that were almost nothing, and were in german or something. When i use the JASS do i just paste it into a custom script trigger?

And i know more than basic triggering, but nothing about jass. Although im sure i can learn!
10-11-2004, 03:45 AM#10
Rafael Br
You only need that JASS function, and this trigger:
Event - A unit is attacked
Condition - Level of Bash for attacking unit equal to 1
Actions - If (Randon number betwen 1 and 100) Is less than or equal to 15 then
Unit - Damage attacked unit by (The bash extra damage)
Custom script: call StunUnit(GetAttacker(), 1.00) - The 1.00 is the stun time
Else - Do nothing

What this trigger does is that is triggers bash, so, just make your bash skill to do absolutly nothing, (Remove it's damage and duration), the 1.00 is the stunt time, just replace it with the time that you wish.I don't have WE now, so, the funcions may be not like the way they are.
10-11-2004, 03:51 AM#11
JoSanchez55
Quote:
Originally Posted by Rafael Br
You only need that JASS function, and this trigger:
Event - A unit is attacked
Condition - Level of Bash for attacking unit equal to 1
Actions - If (Randon number betwen 1 and 100) Is less than or equal to 15 then
Unit - Damage attacked unit by (The bash extra damage)
Custom script: call StunUnit(GetAttacker(), 1.00) - The 1.00 is the stun time
Else - Do nothing

Okay, that makes sense for me, but how do i use the JASS function?
10-11-2004, 04:14 AM#12
Rafael Br
I alredy used it on the trigger, I called it on the custom script call StunUnit(GetAttacker(), 1.00)
Just copy the function to the custom script section of the map.Actually that function can simmulate a stun, if you want to use it for any other reason, use a custom script, like:
call StunUnit(udg_Unit, 1.00)
udg_Unit is a unit variable, created normaly, but it's name is only "Unit" the udg_ is needed to be preifxed, because you are using a global variable, and as said before the 1.00 is the stun duration.
10-12-2004, 12:38 AM#13
Gandalf2349
How about this:
10-12-2004, 05:20 AM#14
JoSanchez55
Quote:
Originally Posted by Gandalf2349
How about this:

Very cool, i understand it completely and can edit it to fit my map. One question however: Will it work with multiple units and not leave any stunned permanently?
10-14-2004, 04:19 AM#15
Guest
It will work with multiple units and will not permanently stun any unit...

but it will also (if I understand it right) not be able to stun any unit multiple times in succession. A unit couldn't get re-stunned if it was hit with bash while stunned.

You could probably fix this if you used handle variables or sth, tho.

Does pause unit preserve commands? o.0 Or would the unit just stop after being unpaused...

Hey, what about just casting a mini-inferno variant at the target? ^ ^ ...or is there no way to remove the sfx >.> ...n/m. Inferno stun doesn't affect magic immune either >.<

(yes it does, I just had required level set to 1!)