• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Physical (Autocast) Spell

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Hello.

I made a simple physical spell with the channel ability and a trigger. It works on magic-immune units (which is what it is supposed to do because its a physical spell). However one thing could be better, but i don't know if its possible.
I want an Autocastable physical spell. Most autocasts are magical spells like Curse, Slow, frost arrows and heal per example. (hate heal and frost arrows because they can't be detected with Starts the effect of an ability)

I think this isn't doable, but maybe someone know's I'm wrong?
 
Level 9
Joined
May 30, 2008
Messages
430
it's depend on what type of autocast you wonna. Any way one of the ways is to set the target when unit cast the spell for first time and after this to make loop evety x seconds to cast the spell at this target again. Other way is to make unit to cast the spell on attacked unit (THERE IS NO WAT TO MAKE CHANEL SPELLS TO WORK LIKE HEAL OR ARROWS)
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
it's depend on what type of autocast you wonna. Any way one of the ways is to set the target when unit cast the spell for first time and after this to make loop evety x seconds to cast the spell at this target again. Other way is to make unit to cast the spell on attacked unit (THERE IS NO WAT TO MAKE CHANEL SPELLS TO WORK LIKE HEAL OR ARROWS)

It doesn't have to be the channel spell. The Trigger can work with every spell ofc. But if I use the curse spell per example, you wont be able to cast it on magical immune units. So do you know of any spell thats autocast and able to be used on ENEMY magic immune units. (buffs are able to be used on friendly magic immune units.)
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Unit is attacked
unit type of attacking unit = xx
attacking unit has abil = yy
order attacking unit to cast abil on attacked unit.

Sorry for sudo code but I hope this helps, is there any reason this won't work?

This wont do it. Ofc it will work, but it's not what I'm looking for.

Vercas said:
Or use the parasite abillity!
When it's casted, to do the spell's functions!
I am using this parasite abillity on my map for a triggered healing spell and it works as an being cast event!
I try parasite. Never really used this spell, but maybe it's castable on magic immune yeah. I try it out, thanks for the tip.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Why isn't it what you're looking for? Can you be more specific please?

Well. I can imagine some times when this trigger would be very nasty.
1. A player isn't able to turn autocasting off or on.
2. This could interrupt orders you currently had. Example if you had Attack-Walk to a certain point, and this trigger activates. Your Attack-Walk order will be forgotten, and you will only cast the ability, and then auto attack anyone nearby.

I just want it to be autocast, think it wont work. That would be dissapointing ofc, but I don't think other solutions are there.

Thanks anyway!
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Of course you can add conditions to make this possible, but at that point you may as well just use Vercas' solution.

Thanks for taking the time to explain though :)

Yeah its possible, but.. hmm well think you need to see my map to get it;-)

Vercas said:
I actualy never tried Parasite to a magic immune unit
time for me to try that out!
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
OK, please notice me if it works or not, i need to know this too :wink:

Nope:(
Everything counts as a spell.
Things I tried:

- Bloodlust
- Inner Fire
- Frost Armor
- Heal
- Parasite
- Curse
- Faerie Fire

TeunCreemers said:
However I just thought of a way to make it work.
If a spell is able to target invulnerable units, it is able to target magic immune units too (i think). So if I make it able to target invulnerable units, and then trigger a detection boolean. If the unit is invulnerable, stop the spell. So REAL invulnerability will cancel the spell.
Nope this doesn't work either.
 
Level 21
Joined
Dec 9, 2007
Messages
3,096
Can you make the spell immunity thing a trigger? Remove the spell immuniti abillity!
And to use... A unit begins casting an abillity ; unit-type of target unit of abillity being cast equal to [your unit type], abillity being cast not equal to [your abillity list that can target immunes!][use this as many times as you need] ; actions: order casting unit to stop
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Can you make the spell immunity thing a trigger? Remove the spell immuniti abillity!
And to use... A unit begins casting an abillity ; unit-type of target unit of abillity being cast equal to [your unit type], abillity being cast not equal to [your abillity list that can target immunes!][use this as many times as you need] ; actions: order casting unit to stop

Yeah I thought if that too. But that is alot of work for only a few physical autocast spells, think i prefer to change the spell a bit then to an elemental spell instead of a physical spell. And else spells like Avatar will need a total change again.

Think I just change the spell to make it autocast, but non-targetable against magic immune units. Here's the spell btw:

[Q] - Big Crush
Builds 5 Rage

Instant Cast - melee range
A heavy blow that deals Level * 30 + 10 physical damage to the target.

JASS:
function BC_Conditions takes nothing returns boolean
    return (GetSpellAbilityId() == 'A00X')
endfunction

function BC_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit t = GetSpellTargetUnit()
    local real d = I2R(GetHeroLevel(u))
    call UnitDamageTargetEx(u, t, 10.00 + d*30.00, ATTACK_TYPE_HERO, DAMAGE_TYPE_ATTACK, true)
    if GetUnitAbilityLevel(u, 'A00Y') < 21 then
    call SetUnitAbilityLevel(u, 'A00Y', GetUnitAbilityLevel(u, 'A00Y') + 1)
    endif
    
set t = null
set u = null
endfunction

function InitTrig_Big_Crush takes nothing returns nothing
    set gg_trg_Big_Crush = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Big_Crush, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Big_Crush, Condition(function BC_Conditions))
    call TriggerAddAction(gg_trg_Big_Crush, function BC_Actions)
endfunction
 
Status
Not open for further replies.
Top