• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

blibk to enemy attack then blink back

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
Do a dummy spell using something like channel and then make:

  • Blink Strike
  • Events
  • Unit - Starts the effect of ability
  • Conditions
  • Ability Comparison ((Ability being cast) Equal to Blink Strike))
  • Actions
  • Set SpellCaster = (Position of (Casting unit))
  • Set SpellTarget = (Position of (Target of Ability being cast))
  • Unit - Move (Casting unit) Instantly to (SpellTarget)
  • Wait - Xs
  • Unit - Move (Casting unit) Instantly to (SpellCaster)
This is the basic thing, the rest is easy, you can make the unit do damage, play a nice sfx effect to show the teleport, make the unit play a attack animation... anything you want...
Also, don't forget to destroy the variable data with custom script.

Sorry, I can't do everything now because I'm using the TV as monitor and its really bad >.<

Edit: Lol, why you have so much rep only because joined forum?
 
Last edited:
Level 11
Joined
Apr 6, 2008
Messages
760
re

i have an old jass code for this... enjoy

JASS:
constant function Abil_id takes nothing returns integer
    return 'A000' //change this to your Ability id
endfunction

function BlinkStrike_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == Abil_id()
endfunction

function BlinkStrike_Action takes nothing returns nothing
    local unit c = GetTriggerUnit()
    local unit t = GetSpellTargetUnit()
    local real x
    local real y
    local real cx = GetUnitX(c)
    local real cy = GetUnitY(c)
    local real angle = GetRandomReal(1,360)
    local real facing = GetUnitFacing(c)
    local real dmg
    local integer lvl = GetUnitAbilityLevel(c,Abil_id())
    
    set dmg = 30*I2R(lvl)
    set x = (GetUnitX(t) - 75 * Cos(angle * bj_DEGTORAD))
    set y = (GetUnitY(t) - 75 * Sin(angle * bj_DEGTORAD))
    
    call PauseUnit(c,true)
    call SetUnitInvulnerable(c, true)
    call SetUnitVertexColor(c, 50,50,50,50)
    call SetUnitX(c,x)
    call SetUnitY(c,y)
    call SetUnitFacingTimed(c, angle, 0.)
    call SetUnitTimeScalePercent(c,250.)
    call SetUnitAnimation(c, "attack slam")
    call UnitDamageTarget(c,t,dmg,true,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",x,y))
    call PolledWait(.3)
    call SetUnitX(c,cx)
    call SetUnitY(c,cy)
    call SetUnitTimeScalePercent(c,0.)
    call SetUnitFacingTimed(c, facing, 100.)
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",cx,cy))
    call SetUnitAnimation(c, "stand")
    call SetUnitVertexColor(c, 255,255,255,255)
    call SetUnitInvulnerable(c,false)
    call PauseUnit(c,false)
    
    set c = null
    set t = null
endfunction

function InitTrig_BlinkStrike takes nothing returns nothing
    local trigger trig = CreateTrigger()
    local integer index = 0
        loop
            call TriggerRegisterPlayerUnitEvent(trig, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
            set index = index + 1
            exitwhen index == 16
        endloop
    set index = 0
    call TriggerAddAction( trig, function BlinkStrike_Action)
    call TriggerAddCondition( trig, Filter(function BlinkStrike_Conditions) )
endfunction
 
Last edited:
Level 12
Joined
Mar 23, 2008
Messages
942
If he don't even understand gui, I don't think he will understand jass...

I told you to do a custom spell using "Channel" as base...

This is the custom script:
  • Custom script: call RemoveLocation(udg_SpellCaster)
  • Custom script: call RemoveLocation(udg_SpellTarget)
 
Have you looked in "Custom Script"? ¬¬
Im good now i just copy and pasted the GUI trigger from the map that ciebron posted.How would i make like effects liek making the blink thing is it in the skill?

EDIT:Alright i got everything good i looked over the trigger you posted and compared the trigger in the map they are the same so i copied and pasted and theres something wrong with the custom scripts

[img=http://img329.imageshack.us/img329/7710/omgwtfsoclosehg5.th.png]
 
Last edited:
Level 12
Joined
Mar 23, 2008
Messages
942
You wrote wrong the name of the variable. maybe its not CasterPoint and TargetPoint.

(Also, some rep would be good xD, click
reputation.gif
in the left of this post, under my avatar)
 
Level 12
Joined
Mar 23, 2008
Messages
942
I will explain what the script does, so you can fix it:

Custom script: call RemoveLocation(udg_SpellTarget)

The first one: "Custom script:" its just a gui function that lets you use a custom script (d'oh)
call RemoveLocation(udg_x) will clean a variable of Point/location data, letting it blank, so that variable can be used again without leaks.
(udg_X) the X is the variable of location-type name, so if you are using mydogiswhite as the variable for this spell, just do (udg_mydogiswhite)
 
Status
Not open for further replies.
Top