Question about triggered spells.

M

Masterfrog

Guest
When doing a triggered spell, well, for example something like:

E: A unit starts the even of an ability
C: Ability being cast = <my spell>
A: If
target of ability being cast is undead
then
make casting unit do 500 damage to target of ability being cast
else
do nothing

That is a spell that would only affect undead. But even if it targeted something that wasn't undead, it would still deduct the mana cost, right? How to make a spell cancel, so it doesn't cost mana if it's not the right target (because the spell wouldn't do anything then)?
 

0cossin77

Yes, I am awesome.
Reaction score
17
Its been awhile, but in the "targets allowed" under the spell options in the object editor, i think its called, only select undead. Then it wont even let you target anything other than undead.
 
F

FullMetalBoy

Guest
Im not sure how to do this in trigger. But u can make a spell that only damage undead with the ability human/holy light in object editor.

The ability target type: Set unable target allies unit.

But since holy light only deal half damage to undead. So make the damage double.

u want: 250 damage
Set to : 500 damage

or u can set your spell only for targeting undead in object editor.
 
M

Masterfrog

Guest
Yes, I know all this. That spell was only an example. I know that what I want is doable with trigger, just now exactly how, and I really need it. I have alot of races in my (too many to to change unit class., you can only cahnge 4 unit class.es anyway). I can make another example where I'll be more specific.

Here is a detailed trigger of how a spell might look like. And that part will surely work. However what I need is an action to put in Else that will cancel the spell before it is cast so it does not deduct any mana from the casting unit.

Code:
Untitled Trigger 004
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Banish
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Name of (Triggering unit)), 11, 15)) Equal to Human
            Then - Actions
                Unit - Kill (Target unit of ability being cast)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Name of (Triggering unit)), 11, 16)) Equal to Undead
            Then - Actions
                Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Substring((Name of (Triggering unit)), 11, 13)) Equal to Orc
            Then - Actions
                Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Normal
            Else - Actions
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
You can add the mana back, with "Unit - Set mana to value".
Though this won't help with cooldowns for example.

Or try with "begins casting" and order it to "stop" if the target isn't valid.
 
M

Masterfrog

Guest
actually it seems I would have to both order him to stop (this makes the animation and special effect not being played) and add the mana. But there's still the cooldown thing. All I can find is Unit - Reset ability Cooldowns, but this affect all of the abilities, so that's no good. Do you think removing then adding the spell again instantly would work?
 

Battlemapsta

I am the Conduit of Change
Reaction score
101
Can't you just use something like..

Conditions
And - All (Conditions) are true
Conditions
(Ability being cast) Equal to Firebolt
((Targeted unit) is Undead) Equal to True

Or have I misread you?
 
M

Masterfrog

Guest
Yes, because that is a classification, and as I then would need a classification for all my races that would make it... 1...5... 9! 9 classifications and possibly more, and you can make as most 4 custom classifications. And besides, the system I use now isn't that bad. Once I've set up one condition for each race, I can just copepaste them.
 
P

Pacos33s

Guest
Re: Question about triggered spells

I did what I think you're trying with a charged spell, so try this:

E-Unit begins casting a spell
C-And
-Ability being cast is <your ability>
A-If/Then/Else
If - Target of ability is not equal to undead
Then - Order unit to stop
Else - Do nothing

What it does with mine is that the unit stops casting (no mana lost and no cooldown used) if the condition is true, but lets the cast continue if it's not true.

PS: Mine is an instant cast spell and uses integers to see if the unit has a "Charge" variable active, but I threw that out and put your undead thing.
 
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
    +1
  • 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