HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

On/off autocast triggers

12-18-2006, 10:16 PM#1
Raydude
How do I use trigger to make a spell turned on no matter what because i made an archer have multishot ( original was barrage ) and barrage will be turned off if i use a spell like cold arrow. I want cold arrow (no mana uses) to be turned on forever so that you cant use multi shot always and multi shot can only be turned on by turning auto casting another ability (searing arrow that uses mana). It's like this, if i auto cast searing arrows (Activate Multi-Shot) it'll multi shot and when all mana is drained, it auto casts the cold arrow (force shots) to turn off multi shot. The only trigger i used for this ability is ...
Events
Unit - Legolas 0318 <gen> Learns a skill

Conditions
(Level of Multi Shot for (Triggering unit)) Equal to 1

Actions
Unit - Add Activate/deactivate Multi-shot to (Triggering unit)
Unit - Add Force Shots to (Triggering unit)

Thank you if you can help.

Lightning Strike
Oh yeah, i also need help with an abiltiy trigger. It's a AOE attack that sends bolts of lighting on top of units (like starfall) and deals random damage to units. Duration is 20 second.

Chain Attack
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Chain Weapon
Actions
Region - Center Shockwave skill <gen> on (Position of Aragorn 0090 <gen>)
Unit - Create 1 Flying Machine for Neutral Passive at ((Center of Shockwave skill <gen>) offset by 150.00 towards 0.00 degrees) facing Default building facing degrees
Wait 0.10 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 45.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 90.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 135.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 180.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 225.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 270.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 315.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 360.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 0.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 45.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 90.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 135.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 180.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 225.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 270.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 315.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 360.00 degrees)
Wait 0.20 seconds
Unit - Order (Last created unit) to Move To ((Center of Shockwave skill <gen>) offset by 150.00 towards 0.00 degrees)
Wait 0.20 seconds
Unit - Kill (Last created unit)
I made it so this unit spins around the caster and has immolation and will attack all units around it and the model of it is a glaive. It's a flying unit and the height of it has been set so it hits the chest of all units. The problem is that everytime i move the caster when this is in place, the unit is bugged and stops all of the sudden. It's just floating there killing units as it walks past it. Then when i cast the ability again it kills the unit. I thought it's cause of the centering of the region so i made another trigger that's every 0.01 second it centers the region the on the caster but it made it worse.

Thank you again.
12-19-2006, 02:58 AM#2
wyrmlord
Question: Why not just do a loop instead of making a new action at each degree offset? Also, 360 degrees is the same as 0 degrees. Also, is more than one unit using this spell at once? If so, there's a problem. Also, is a new unit being created during the duration of the spell? If so, the trigger will refer to that unit instead of the unit that you want to move. I would suggest having a variable for the unit you want to move and refer to that instead of (Last Created Unit). Also, try exploiting a trick to make the variable act as a local variable.
Trigger:
Custom script: local unit udg_VariableName
So let's say the name of the variable you are using is TheUnit, you would do:
Trigger:
Custom script: local unit udg_TheUnit
You would place that code as the first action in the trigger. Try those suggestions out and see if it helps.
12-19-2006, 04:36 AM#3
Wyvernoid
If I understood what you set, you want to turn an autocast on/off by triggers? That is in fact easy, look for the "Order String - Turn On" and "Order String - Turn Off", then write a trigger based on "Unit - Issue Immediate Order" like "Unit - Order {UNIT} to Order({STRING YOU LOOKED FOR})". Or you can use JASS, write call IssueImmediateOrder({UNITVAR}, {THE STRING}).
12-19-2006, 07:59 AM#4
Xlightscreen
mmm i believe you would have to create a entire new spell in order to get a cold arrow/multishot combo.
12-19-2006, 11:24 AM#5
Anitarf
Quote:
Originally Posted by Xlightscreen
mmm i believe you would have to create a entire new spell in order to get a cold arrow/multishot combo.
Great reading comprehension, that wasn't what he was trying to do at all.

For Lightning Strike, try using starfall or monsoon.

For chain attack, that trigger is very ugly. I suggest you redo it. Make a periodic trigger that moves glaives around their units, and another trigger taht creates a glaive when the spell is cast. You would need a unit group to store all the glaives, and a way to store what unit each glaive is rotating around. If you have only one such unit in the map at a time (like a single hero that can cast this spell), then it's easy, just store him to a unit variable and rotate all the glaives around him, otherwise my suggestion would be to use functions H2I() and I2U() to store the caster to the custom value of the glaive.

In the rotating trigger, you would just need to get the angle between the center unit and the glaive and then increase that angle.
12-19-2006, 09:39 PM#6
Raydude
http://www.wc3campaigns.net/showthre...ight=multishot
The multishot ability was based off this. I didnt understand the part about the orb effect. Does orb effect refer to an ability or and item??

The chain attack is ugly, i know, and it's just 1 hero using that ability. The chain attack is suppose to rotate around the unit and increases the distance away from the caster. The trigger i used in the top was just a model, i wanted to see if it would work and it didnt and i need help on it. If possible, i'd like a Event-Condition-Action trigger to help me.

P.S. I don't use JASS

EDIT
For the lightning strike, i was gonna make it a global attack for a nice touch on the map. The ability would hit random units at different places. The attack would deal 500 dmg and when it hits the unit, it makes a huge light effect like a real lightning. The ability would hit like 25 units per minute in a region. When i did this the game crashed.