How to make a "link" ability

shinami

Redirect your complaints to the nearest wall
This is the ability i want to do.

Link Healing - Links to the target unit with SomeLightningEffect and heals him for x. If the healing unit or the healer is further than 500 range, the link will brake.

The healing part is not hard, the link is what i have no idea how to do, and the link braking. I want this to be a single target Activable,Deactivable skill.

So, any ideas?
 

saw792

Is known to say things. That is all.
Create the lightning effect and such as the ability is being channeled, then have a periodic trigger check if the target unit is within range. Making it MUI is more difficult... do you know JASS?
 

shinami

Redirect your complaints to the nearest wall
Create the lightning effect and such as the ability is being channeled, then have a periodic trigger check if the target unit is within range. Making it MUI is more difficult... do you know JASS?
Don't know jass, and the bolded part i didn't quite understand.

Could you explain it a bit more detailed?
 

saw792

Is known to say things. That is all.
Oh sorry... I assumed it was a channelling ability.
The best idea would be to base it off a single target dummy ability. When it is cast, create the lightning effect between the target unit and the caster (Lightning - Create lighting using... between...). Then remove the 'on' ability for the casting unit, and replace with the 'off' ability. You then need two methods of cancelling: When the caster casts the off ability and when the unit target unit is outside of 500 range (periodic trigger). This way would be single instance. If you want I could make you an MUI Jass version. Do you have Newgen?
 

Accname

2D-Graphics enthusiast
i could make you a not MUI version, you need 5 variables (lightning/Caster/Target/PointOfCaster/PointOfTarget) and 3 triggers:
Code:
Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to 'HealingLight' 
    Actions
        Set TargetUnits[1] = (Casting unit)
        Set TargetUnits[2] = (Target unit of ability being cast)
        Set TempPoint[1] = (Position of TargetUnits[1])
        Set TempPoint[2] = (Position of TargetUnits[2])
        Lightning - Create a lightning effect Healing Wave - Primary TempPoint[1] TempPoint[2]
        Set Lightning = (Last created lightning effect)
Code:
UnCast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to 'HealingLight' 
    Actions
        Lightning - Destroy Lightning
        Unit - Remove Healing Light buff from TargetUnits[2]
        Set TargetUnits[1] = No unit
        Set TargetUnits[2] = No unit
Code:
Effect
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set TempPoint[1] = (Position of TargetUnits[1])
        Set TempPoint[2] = (Position of TargetUnits[2])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        (TargetUnits[1] is alive) Equal to True
                        (TargetUnits[2] is alive) Equal to True
                        (Distance between TempPoint[1] and TempPoint[2]) Less than or equal to 500.00
                        (TargetUnits[2] has buff Healing Light) Equal to True
            Then - Actions
                Lightning - Move Lightning TempPoint[1] TempPoint[2]
                Unit - Set life of TargetUnits[2] to ((Life of TargetUnits[2]) + 50.00)
            Else - Actions
                Lightning - Destroy Lightning
                Unit - Remove Healing Light buff from TargetUnits[2]
                Set TargetUnits[1] = No unit
                Set TargetUnits[2] = No unit
        Custom script: call RemoveLocation (udg_TempPoint[2])
        Custom script: call RemoveLocation (udg_TempPoint[1])
'HealingLight' is your skill

i repeat this is not MUI!!!

Attached is a demo map for you to see how it looks.
 

vaziocs

New Member
This is the ability i want to do.

Link Healing - Links to the target unit with SomeLightningEffect and heals him for x. If the healing unit or the healer is further than 500 range, the link will brake.

The healing part is not hard, the link is what i have no idea how to do, and the link braking. I want this to be a single target Activable,Deactivable skill.

So, any ideas?
i think u can use the healing ability from the shadow hunter and just add and lightning effect.
 

shinami

Redirect your complaints to the nearest wall
Oh sorry... I assumed it was a channelling ability.
The best idea would be to base it off a single target dummy ability. When it is cast, create the lightning effect between the target unit and the caster (Lightning - Create lighting using... between...). Then remove the 'on' ability for the casting unit, and replace with the 'off' ability. You then need two methods of cancelling: When the caster casts the off ability and when the unit target unit is outside of 500 range (periodic trigger). This way would be single instance. If you want I could make you an MUI Jass version. Do you have Newgen?
Yeah, i do, if you can please do make. ;)
 

ThePlague

New Member
heres how you could do it in JASS, this will leak though make sure you null the locals

convert to custom text and paste function X_Actions above the actions for your trigger and paste the other part into the action function of your trigger

JASS:
function X_Actions takes unit Target, unit Caster returns nothing
local location CasterLoc=GetUnitLoc(Caster)
local location TargetLoc=GetUnitLoc(Target)
if (DistanceBetweenPoints(CasterLoc, TargetLoc) > 500) then
//actions you want to happen when the target is out of range
endif
endfunction

function Main_Trigger_Actions
local trigger X=CreateTrigger()
local unit Target=GetSpellTargetUnit()
local unit Caster=GetTriggerUnit()
    call TriggerRegisterTimerEventPeriodic( X, .10) 
    call TriggerAddAction( X, function X_Actions )
//actions for your spell
endfunction



if this doesnt solve your problem post your full trigger and i can help more
 
General chit-chat
Help Users
  • No one is chatting at the moment.

    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