How Give Unit Buff & Debuff After Casting A Spell

Griffen25

New Member
Reaction score
1
Hello All, thank you for taking the time to help somebody out, any information will be much appreciated =]

ok, now 'The Problem' is i have a unit "Drunken Wood Chopper", basically i want this unit to cast a spell (Drink), and gain the buff Beserk (orc), and the debuff Curse (Undead).

I have tried editing spells to award these buffs but it gets messy and the end result is always the same, i was hoping that somebody could suggest a code to Help. I usually operate upon the lines of...

Code:
Drink[SIZE="1"];[/SIZE]
[U]Events[/U]
Unit - A unit Begins casting an ability
[U]Conditions
Action[/U]
[B]If [/B]((Ability being cast) Equal to Drink) [B]then[/B] do ([COLOR="Red"][SIZE="3"]???[/SIZE][/COLOR]) [B]else do[/B] (Do nothing)

I Was Hoping that somebody could help me fill in the gaps, because i was unable to find an action that works something along the lines of
Actions
"Unit - Add Buff (Beserk)"
"Unit - Add Buff (Curse )"


Thank You =]
 

Frozenwind

System maker
Reaction score
99
Create a dummy and force them to cast a spell on your unit, this will add a buff.

As for remove buff:
unit - remove specific buff.

frozenwind.
 

Griffen25

New Member
Reaction score
1
Attempt #1

Thank You For your input :)

Create a dummy and force them to cast a spell on your unit, this will add a buff.

As for remove buff:
unit - remove specific buff.

I will try this right away!
*15min later*
Can you please elaborate a little about the dummy? i'm a little unsure about how to do this, i know it has something to do with 'arrays' but i'm not sure how to make them cast the spell and how to properly set up the array
 

Builder Bob

Live free or don't
Reaction score
249
You don't need to use arrays to use dummies.

Just make a copy of any unit in the object editor.
Set model to None.mdl (manually)
Set shadow to none
Add the ability Locust (to make it unselectable and untargetable)

Add the ability you want it to cast either in the object editor or in the trigger, and make it cast it on your unit.
On the next line in the same trigger, add a few seconds expiration timer to the dummy unit so it will be destroyed after it has cast the spell, but not right away.

Hope that makes it somewhat clearer
 

Griffen25

New Member
Reaction score
1
thank you, i feel as though i am almost there,
i have created the invisble unit,
however i am unclear about how to make the invisible unit unselectable
but more importantly, i am unsure about how to make him cast spells like beserk who when activated target the caster by default.
thank you deerly for your assistance! =]
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
In the unit's list of abilities in the object editor add the ability "Locust" to the dummy unit.
 

Frozenwind

System maker
Reaction score
99
thank you, i feel as though i am almost there,
i have created the invisble unit,
however i am unclear about how to make the invisible unit unselectable
but more importantly, i am unsure about how to make him cast spells like beserk who when activated target the caster by default.
thank you deerly for your assistance! =]

Think like this:
What does beserk give...?
Attackspeed bonus... You take more damage... Movementspeed increase...
There isn't any spell which can target an unit with those things....
So 2 options:
  • Add 2/3 effects using an ability (add an ability to your unit instead of buffing), and the 3rd effect will be your buff.
  • Force your unit to cast beserk (not always possible since this interupts his order)

frozenwind.
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
you could use bloodlust if you dont need the damage taken increase
 

Oreo_clan

New Member
Reaction score
4
thank you, i feel as though i am almost there,
i have created the invisble unit,
however i am unclear about how to make the invisible unit unselectable
but more importantly, i am unsure about how to make him cast spells like beserk who when activated target the caster by default.
thank you deerly for your assistance! =]


He already told you.

Don't make the unit invisible.

Go to unit model and change whatever the model is to .mdl in the bottom part of the selection where there is text in there that you can modify. And remove whatever shadow it has. This already makes it "invisible". The problem with using invisibility is that if the unit is paused, the invisibility wears off if I think.

Next, go to Spell Animation Backswing and change it to 0.000. Do the same for the Spell Animation Cast Point. It should be called something like that. It's near the to under I think Animation - Backswing and Animation - Cast Point.

Next, in the abilities section go to the L area and look for "Locust". It automatically makes a unit unselectable and invurnerable. I forgot if setting the unit model to .mdl makes it invurnerable, but whatever, do this anyway.

Next, make the "Drink" spell based off of "Beserk" (this is the simplest way but probably only saves 30-60 seconds). Modify the numbers to what you want them to be.

Next, make a "Drunk Miss Effect" spell based off of "Curse". Modify the numbers to what you want them to be. (NOTE: Your duration (secs) should be the same for "Drink" and "Drunk Miss Effect" or else one effect will outlast the other.)

Now, you can add "Drunk Miss Effect" to your new dummy unit if you aren't going to have too many dummy spells. If you do, don't add it and use the trigger editor to add it.

Now for the triggered part. If you followed all the instructions above, you should have everything set up.

Now, I'm not going to waste time to copy and paste the whole thing for you, so I'm just going to outline what you have to do.

Create a variable: [Temp_Point] - Stores point on map (location)

-Events - Unit STARTS THE EFFECT OF AN ABILITY <---- Very important, otherwise they can stop casting before the ability's effect takes place and end up with the "Drunk" effect without the beserk effect. But since Beserk's casting can't be stopped by ordering him to do something else, you will be fine in 99% of cases. The last 1% is if they order the unit to stop before the effect goes off.

-Conditions - Ability being cast is "Drunk"

-Actions - Set [Temp_Point] to location of [Triggering Unit]
-Actions - Create [Dummy Unit] for [neutral passive] at [Temp_Point] facing...
-Actions - Give ability [Drunk Miss Effect] to [last created unit]
-Actions - Order [last created unit] to order targeting unit [Banshee - Curse] [Triggering Unit] <----It's something like that, I forgot the specific thing for it, it might be "Undead- Curse"

You can do 2 things for this next one, I will list them both.
*-Actions - Kill [last created unit]
*-Actions - Add expiration timer to [last created unit] for [0.01] seconds

-Actions - Custom Script: call RemoveLocation(udg_Temp_Point) <----It must say "call RemoveLocation(udg_Temp_Point)" EXACTLY! This will remove the leak caused by leaving the variable Temp_Point around. Of course, don't type in the ". Basically this reduces lag that could be caused by running this trigger hundreds of times.

That should cover it. If you still have problems... I'll look it over. If there's nothing wrong with this setup, figure it out yourself because this has so much explaination that you would have to be blind or an idiot to not understand it.

And for you to have gone the way you did, is kind of stupid to start with... Just had to say it... Even for a beginner, it was... Yeah... You get the point...

Custom Script: call RemoveLocation(udg_point)

:p
 

vypur85

Hibernate
Reaction score
803
Just Hide last created unit =.=. No need all the locust thing (unless it is really necessary, but in your case, i think hiding would be enough).

Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to YourAbility
    Actions
        Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
        Unit - Add Unholy Frenzy to (Last created unit)
        Unit - Set level of Unholy Frenzy for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
        Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Triggering unit)
        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        [B]Unit - Hide (Last created unit)[/B]

This will give the buff. The Footman will be your dummy. As for the dummy ability (the Unholy Frenzy) use Bloodlust instead if you want to increase attack speed and movement speed (but not damage taken, there is no targetting spell for this).
 

Griffen25

New Member
Reaction score
1
Sucess! but could use some fine-tuning

Thank you very much Oreo_clan, much appreciated advice, i decided to use your idea with a slight twist, i found a small problem. Once i had everything set up i noticed that my target was only receiving the Debuff (Curse) & not the buff (Berserk). I figured this was because a neutral creep can not cast a buff upon an enemy,
I decided to make the trigger for my spell the berserk spell (renamed 'Drink') and once the game detected that this was casting it would create a dummy unit and curse the target.

This is exactly what i wanted, however i am unable to fine tune the whole mechanism. Once the unit has received both the buff & debuff, i would like to enter in my own custom text, rather then "This unit has been cursed it has a chance to miss attacks". However if this is not possible, its no fatal problem.

Secondly i have encountered a minor problem with the custom script you have supplied me with. i was wondering if u might have an answer as to why i am being fed this error message?. (In attachment)

Thank you very much for your support and most of all patient.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top