HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Enrage, casting question

07-13-2005, 02:16 AM#1
Kam
I want to make Enrage so it's not a ranged ability, but like Bloodlust, so it just casts once you click the icon. I tried setting the cast range to 0 and using a different spell as the base template, but it obviously has to do with the JASS code. If you would point me to the line and tell me what to change, I would be greatful.
-Kam
07-13-2005, 05:25 AM#2
uberfoop
wait, could you explain this better? If you just mean you want a bloodlust that targets yourself, then either use berserk (if you dont want autocast) or the quilbeasts berserkish thing (if you want it autocast)\
im sure thats not wut u emean cuz its so simple, but pls explain better~
07-13-2005, 05:14 PM#3
Kam
I want the spell to just cast once you click the icon, like bloodlust, or divine shield, or Feral Spirit. I don't want it to be a targetable ability.
07-13-2005, 07:28 PM#4
uberfoop
just use a dummy ability and have a trigger that creates a dummy caster to cast it. note: bloodlust dosnt cast when you click the icon, your thinking of berserk.

anyway, just use a non-targetable ability and take away all its values (some you need to set to .01 or itll mess up, but you probably know that)

and then do something liek:

events:
a unit begins the effect of an ability

conditions:
ability being cast equal to dummy ability

actions:
unit-create 1 dummy unit at (where you want the dummy unit to be) Note: im not sure how it works but things like this might create leaks, but youll have to figure those out yourself.
set last created unit=dummyunitvariable

after that, make youre casting actions. for example, if you wanted it to randomly cast stormbolt, the next actions on the list would be like:

unit-order dummyunitvariable to cast storm bolt on random unit owned by enemy of casting player blah blah blah...

then put a wait in to let the dummy unit cast the ability... and then you destroy the dummy unit (yay, death to the dummy unit empire!!! so, of course, the next action would be like

unit-remove dummyunitvariable from the game






basically, to put this short, create a dummy unit, set it as a variable (well, you dont have to if theres no waits uin your trigger, but i like to anyway), order the dummy unit to cast the ability, and wait for the ability to cast, and destroy the dummy.
i could (probably) write up a basic (most likely leaky) trigger for an ability if u still dont get it, just say wut ability and wut u want it to cast on.
07-13-2005, 08:13 PM#5
Kam
Wow, that was detailed. Too bad I'm not really good with triggers as of yet. Actually I was hoping Vex would tell me what line of the ability I have to change. It's in one of his spell packs, I was hoping there would be a line of code somewhere that dealt with this, but I will attempt what you said. Thanks.
07-20-2005, 03:55 AM#6
Switch33
You can also do
Custom Script: Set udg_(Variable name of dummyunit, with _ instead of spaces)

This helps prevent memory leaks.