HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

My first trigger spell :)

06-03-2006, 03:28 AM#1
darkwulfv
Trigger:
Lightning Bolt spell
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Lightning bolt
Collapse Actions
Unit - Pause (Triggering unit)
Special Effect - Create a special effect at (Target point of ability being cast) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Lightning
Special Effect - Destroy (Last created special effect)
Unit - Unpause (Triggering unit)

Does this look about right to you guys? I didn't use JASS (obviously) So I hope this would work. Do buildings fall under "units" (a unit begins...) I really hope this works, becuase if it does I'll feel all warm and fuzzy inside (much like an infernal )
06-03-2006, 03:56 AM#2
MysticGeneral
Uhhh, did you post on BOTH General Development AND Triggers & Scripts?

It should work. It leaks and doesn't do anything to fancy except create a special effect and damage a unit. You can just modify an ability to do the exact same thing.
06-03-2006, 04:00 AM#3
darkwulfv
Yes, I posted on both by accident. I didn;t know how to delete the one in GD so I left a note on the 2 for Tim. Wait, it leaks? Is that a bad thing?
06-03-2006, 04:12 AM#4
harshateja
Everytime someone casts this spell, its another thing for the processor to be bogged down with. So yes, its a bad thing. Save the sfx target location and then at the end of the trigger:

call RemoveLocation(YourLocation)
06-03-2006, 04:16 AM#5
darkwulfv
??? I'm sry, but I'm not exactly sure what you mean. Could you please either show me or tell me the general area int he trigger editor to find this? (And how do I save the SFX's target location?) And why would it be call? This is GUI not JASS (I think you may have just gotten mixed up)
06-03-2006, 04:22 AM#6
Ignitedstar
I think he's talking about custom script.
06-03-2006, 04:25 AM#7
MysticGeneral
It's a very slight leak. I wouldn't worry about it too much. Anyways, what I also see is that if the unit does not cast that spell instantly, he could issue the order to stop, then cast the spell again and repeat. This will result in being able to spam the effect.
06-03-2006, 04:27 AM#8
darkwulfv
O boy... I'm not too much of a JASS fan... Nor am I very good at it. Can anyone just tell me how to save the SFX location and then destroy it? (or whatever I need to do) in GUI? If I MUST, I'll do it in JASS, but I'd rather not, becuase I'd probably cause huge problems.

@MysticGeneral. I've heard of that possibilty, but the chances of anyone doing that is pretty slim. DOes the same happen if the spell is cast but the unit dies before the effect takes place? Is there a way to set like a timer on the ability so that other than cooldown, it cannot be cast within like 2 seconds of it's first casting? (this spell has a 2 minute countdown). Hold on. Brain hatch idea! If I set a timer so that from the second the trigger activates, a timer is set equal to the cooldown of the ability, stating that It cannot be cast again until the timer is done. That way, if someone should try to spam the effect, it couldnt be done becuase they'd have to wait for the timer to run out, about 122 seconds.
06-03-2006, 04:29 AM#9
harshateja
Trigger:
Melee Initialization
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Lightning Bolt
Collapse Actions
Unit - Pause (Casting unit)
Custom script: call DestroyEffect(AddSpecialEffectTarget("Doodads\\Cinematic\\Lightningbolt\\Lightningbolt.mdl" ,GetSpellTargetUnit(),"origin"))
Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Lightning
Unit - Unpause (Casting unit)

Should work....


To avoid the spam problem...which is really easy to do by the way (hotkey + esc), use Unit starts the effect of an ability instead of begins casting.
06-03-2006, 04:30 AM#10
TaintedReality
I wouldn't worry about it. If you really want to know (and yes it requires JASS):

http://www.wc3campaigns.net/showthread.php?t=80072

Grats on your first triggered spell.
06-03-2006, 04:32 AM#11
MysticGeneral
Quote:
DOes the same happen if the spell is cast but the unit dies before the effect takes place?

I am not sure. I would logically say yes, though. Also keep in mind that the pause/unpause unit you have there would be barely noticeable, if at all.

P.S. Congrats.
06-03-2006, 04:35 AM#12
darkwulfv
Thanks for the grats Tainted. This is basic, but for me this is like comleting a 100 line JASS script. O wait, I've got an idea here to solve my problem of the unit dies before the spell takes place. Is it possible to make it so that the unit cannot be attacked for a short period of time, or something like that? (prefereably somthing that stops the unit from dieing except from spells for that split second of trigger)
06-03-2006, 04:36 AM#13
harshateja
Quote:
Originally Posted by darkwulfv
O wait, I've got an idea here to solve my problem of the unit dies before the spell takes place. Is it possible to make it so that the unit cannot be attacked for a short period of time, or something like that? (prefereably somthing that stops the unit from dieing except from spells for that split second of trigger)

Read my post above.
06-03-2006, 04:39 AM#14
MysticGeneral
Harshateja changed the event, darkwulfv. I'm not sure if his prevents people from being able to spam it.

You can just simply change it to "A unit finishes casting an ability"
06-03-2006, 04:42 AM#15
darkwulfv
...Hmmmm. Harshateja's seems logical. So do I change it to "A unit starts the effect of an ability" or "A unit finishes casting an ability" Will they both work? Not to sound like a noob or nothin', but Harshateja, what idd you mean by (hotkey+esc) Whats the hotkey?
@mysticgeneral about the pause/unpause It was so that the tower didn't attack while the spell was taking place. I wasn't sure how long the spell would take.