HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Custom Spell

03-10-2006, 06:22 AM#1
The_AwaKening
I'm making a blink strike attack. I edited blink to have certain targets allowed. So far I haven't been able to find a way to add in an order to attack without triggering it. Before I trigger it, I thought I would see if anyone else had a different idea.
03-10-2006, 01:43 PM#2
emjlr3
jsut trigger the whole thind, base it off liek channel, and just trigger the rest, should work better
03-10-2006, 01:48 PM#3
The_AwaKening
Agreed, I just figured out anyway that when setting targets on blink, it still will blink to non unit location.
03-10-2006, 03:29 PM#4
The_AwaKening
Well, I triggered the whole thing but based the spell off of sleep "maybe mistake". I removed every buff in the spell and turned off the string for sleep in it. The trigger fires but the targeted unit is put to sleep still and set invulnerable.
Here is my trigger
Collapse JASS:
function Trig_Blink_Strike_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 1093677892
endfunction

function Trig_Blink_Strike_Actions takes nothing returns nothing
local real dist
local real dmg
local unit caster=GetSpellAbilityUnit()
local unit t=GetSpellTargetUnit()
local string sfx="Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"
local string sfxloc="chest"
    set dmg=75.00*I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), caster))
    set dist=50
    call TriggerSleepAction(.01)
    call DestroyEffect(AddSpecialEffectTargetUnitBJ(sfxloc,caster,sfx))
    call SetUnitPositionLocFacingBJ(caster,PolarProjectionBJ(GetUnitLoc(t),dist,GetRandomReal(0,360)),AngleBetweenPoints(GetUnitLoc(t),GetUnitLoc(caster)))
    call SetUnitAnimation( caster, "Attack" )
    call UnitDamageTarget(caster,t,dmg,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
    set caster=null
    set t=null
    set sfx=null
    set sfxloc=null
endfunction

//===========================================================================
function InitTrig_Blink_Strike takes nothing returns nothing
    set gg_trg_Blink_Strike = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Blink_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Blink_Strike, Condition( function Trig_Blink_Strike_Conditions ) )
    call TriggerAddAction( gg_trg_Blink_Strike, function Trig_Blink_Strike_Actions )
endfunction
03-10-2006, 03:40 PM#5
Immoralis
use the channle abiity like m said, it wont disrupt
03-10-2006, 03:59 PM#6
The_AwaKening
Ok, stupid question, but define channel abilities for me please. I've never understood what abilities classify as what.
03-10-2006, 07:32 PM#7
emjlr3
channel is an ability itself, use it

and for you coding,strings dont need to be set to variables

and you ve got a location leak with the PolarProjection

and are using 4 bjs, PolarPrjection, AngleBetweenPoints, AddSpecialEffectLocBJ, SetUnitPositionLocFacingBJ

also, i dont think strings need to be set to null, they're leak can not be removed if I am not mistaken
03-11-2006, 12:25 PM#8
Drakim
Quote:
Originally Posted by The_AwaKening
Ok, stupid question, but define channel abilities for me please. I've never understood what abilities classify as what.

channel is an abillity....as in "channel"
the great thing about it is that it has a bunch of options on how it works, (as in unit- or groundtarget, or you could set it to instant like warstomp.)
the best thing about channel however is the possibility for having multiply spells based on channel on the same hero. you just have to change the orderID for every new channel-Ability.

the downside of channel is that you can't use "issue order" to make a unit use it (i think)