• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Life Drain Help

Status
Not open for further replies.
Level 4
Joined
Sep 21, 2004
Messages
110
No matter when i do i can't get life drain to be able to target allied units. Im using it so i can get lightning fx at a height. Is theer any possible way to get it to target allies?
 
Level 1
Joined
Jan 19, 2005
Messages
7
i'm still new but i think you could just open up abilitydata.slk file and add friend to the targ1 field for the particular source spell that your guy is using. Then add/overwrite the file to your map. That should make your spell able to target friend units as well as enemys.

I don't have Frozen thrown so i have to do everything the hard way lol...
 
Level 4
Joined
Sep 21, 2004
Messages
110
I already Tried allies. I tried allies, self, friendly, ground, just about everything, together and by themselves. Nothing works :cry:
 
Level 4
Joined
Sep 21, 2004
Messages
110
I already did that, set drian interval to 99999, set hp drained to .01, and set duration to 3600(max). I tried manually casting it but it says "Unable to target your own units", or "Must target an enemy unit". When did you use the life drain thing, because the 1.17 patch might be causing this.
 
Level 4
Joined
Aug 4, 2004
Messages
60
Scroll down the gameplay constants, at the end there is a field that check - Drain gives bonus life --> set it to true.

Note that in this way you can't drain a friendly target's life, but siphon life to it instead. If you want to drain friendlies, try to trigger.
 
Level 4
Joined
Sep 21, 2004
Messages
110
What observations? What i need it for is a channeled mind control spell. Is there any other unit-targetable
channel spell?
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
I don't like Channel for some reason. I still suggest Life Drain, just change the draining to 0.01 and time between drainings to 9999999 and that is all. Why doesn't it work? I suppose you still want to have it target enemy units. Ok, if you just would've left the timer to 0 then it wouldn't have worked and it would've told you that no target is valid.

~Daelin
 
Level 4
Joined
Sep 21, 2004
Messages
110
I told you, i already tried setting the life drained to 0.01, and drain itnerval to max, but it still says "Must target enemy unit". I don't like channel either because it pauses the caster, but i decided to use it any way and added this loop to the trigger.

JASS:
    loop
        exitwhen GetTriggerEvalCount(t)>0
        exitwhen ( IsUnitDeadBJ(target) == true )
        exitwhen ( DistanceBetweenPoints(GetUnitLoc(caster), GetUnitLoc(target)) > I2R(range) )
        call TriggerSleepAction(0.10)
    endloop

Then simply changed ownership and unpaused caster at the end.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Ok... I am still surprised that Life Drain doesn't work... Hmm, please try my Divine Intervention. You will see there that I used some Drain which is used by enemy Neutral Hostile to target the Paladin. Here is the link to Divine Intervention: http://www.wc3sear.ch/index.php?p=Spells&ID=733&sid=102cfb37a526a012f92cd7cd70abaa5f .And the Drain Spell, is called Caster Light . I guarantee it will work since as you can see, it worked for my spell. Just change the HP drained to 0.01, AoE, Range and Duration to whatever you want, and Drain Interval to 999999. That is all!
 
Level 4
Joined
Sep 21, 2004
Messages
110
The only reason yours works is because its an enemy targetting him. I need it to be able to target allies. Its ok though, i did it through trigegrs by pausing the caster and doing a loop which exited either when the timer ahd expired, or when the mind controlled unit dies, or when he caster dies,or when the unit goes out of range.
 
Level 4
Joined
Aug 4, 2004
Messages
60
I don't see why Channel doesn't work, neither do Life Drain and Siphon Mana.

-For Channel, there is a boolean field that says, disable other abilities, set this to false. There is a bit flag field that have a few options, toggle Visible, Unique Cast on. Channel was used by me in Omni Drain to simulate Life Drain, you may take a look.

-Life Drain: I'm sure in the Gameplay Constants there is a boolean field down at the bottom that has something to do with Life Drain able to target allies. Just toggle it.

-Siphon Mana: have you tried it?
 
Level 4
Joined
Sep 21, 2004
Messages
110
The problem with channel is 1:pauses caster 2:Doesnt stop channeling when the target enemy dies. But it's ok, i got it to work, but unfortunatly had to pause the caster. Heres the code:

JASS:
function Trig_Corruption_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A01B' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Corruption_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local player owner = GetOwningPlayer(target)
    local integer range = (( GetUnitAbilityLevelSwapped('A01B', caster) ) * 500)
    local trigger t = CreateTrigger()
    local integer level = ( GetUnitAbilityLevelSwapped('A01B', caster) )
    local integer x = 1
    local integer expire
    local effect fx

    call TriggerSleepAction(0.25)
    call PauseUnitBJ( true, caster )
    call SetUnitAnimation( caster, "spell looping" )
    call AddSpecialEffectTargetUnitBJ( "origin", caster, "Abilities\\Spells\\Orc\\Voodoo\\VoodooAura.mdl" )
    set fx = GetLastCreatedEffectBJ()
    call SetUnitOwner( target, GetOwningPlayer(caster), true )

    if (level == 1) then
        set expire = 30
    elseif (level == 2) then
        set expire = 40
    elseif (level == 3) then
        set expire = 50
    else
        set expire = 60
    endif

    loop
        exitwhen ( IsUnitDeadBJ(target) == true )
        exitwhen ( IsUnitDeadBJ(caster) == true )
        exitwhen ( DistanceBetweenPoints(GetUnitLoc(caster), GetUnitLoc(target)) > I2R(range) )
        exitwhen (x > expire)
        set x = x+1
        call TriggerSleepAction(0.10)
    endloop

    call SetUnitOwner( target, owner, true )
    call PauseUnitBJ( false, caster )
    call ResetUnitAnimation( caster )
    call DestroyEffectBJ( fx )
    set target = null
    set caster = null
    set t = null
    set fx = null
endfunction

//===========================================================================
function InitTrig_Corruption takes nothing returns nothing
    set gg_trg_Corruption = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Corruption, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Corruption, Condition( function Trig_Corruption_Conditions ) )
    call TriggerAddAction( gg_trg_Corruption, function Trig_Corruption_Actions )
endfunction

I had to time it with integers because times werent working for some reason.

Arcanister, i notice you requested a similar spell (cant remember name). Want me to post it?
 
Level 3
Joined
Jun 6, 2004
Messages
29
I'm having the same problem targeting an ally. Perhaps if you use a trigger to set either the caster or the target to an enemy, then cast the spell then change back it may work.
 
Status
Not open for further replies.
Top