HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

An Ability Help

11-18-2006, 06:50 AM#1
MasterTin
Hi, I am new to posting on this site, and I decided to make an account finally to ask a few questions regarding abilities (my weakness in editing).

I'm trying to make abilities for combat basics such as "Sidestepping", "Counter", "Parry", etc.

I made sidestepping based off of the evasion skill, I set the duration of the skill to 3 seconds, cooldown time to 10 seconds, and a 30% chance to evade.

Now the problem is that, the ability isnt a clickable and I would like to know how to make it so. I been in the dark at this for quite a while and want it done immediately.

All help is appreciated!
11-18-2006, 07:04 AM#2
Av3n
... Why don't you make an dummy spell like scount or morphing then trigger it when you use it to add your evasion ability.

-Av3n
11-18-2006, 07:15 AM#3
MasterTin
I don't quite get what you mean.
11-18-2006, 09:01 AM#4
Captain Griffen
Passive abilities cannot be made non-passive. However, you can trigger an effect to replicate it by adding a hidden ability.

Step 1 - Create a dummy ability (ie: one with the mana cost, icon, etc. you want, but does nothing), and add it to the hero.

Step 2 - Create the actual ability, in this case evasion with 30% chance.

Step 3 - Create a spell book ability, give it a random and otherwise unused orderid, and add in the evasion ability as the only ability.

Step 4 - On map init, make the spell book ability disabled (this step and the last one make no icon appear for the evasion ability when added).

Step 5 - Make a trigger which, upon casting the dummy ability, adds the spell book ability you made. Now save (why? because WE may crash with faulty JASS code; WEHelper doesn't, however). After that, call this custom script:

Trigger:
Custom script: call TimerAttach(CreateTimer(), 3., H2I(GetTriggerUnit()), function RemoveTimerSpellBookEx)

And add this to the custom script:

Collapse JASS:
function H2I takes handle h returns integer
    return h
    return 0
endfunction

function I2U takes integer i returns unit
    return i
    return null
endfunction

function TimerAttach takes timer t, real dur, real value, code func returns nothing
    call TimerStart(t, value, false, func)
    call PauseTimer(t)
    call TimerStart(t, dur, false, func)
endfunction

// Call ONLY on expired timer
function GetTimerInt takes timer t returns integer
    return R2I(TimerGetRemaining(t) + 0.5)
endfunction

function RemoveTimerSpellBookEx takes nothing returns nothing
    call UnitRemoveAbility(I2U(GetTimerInt(GetExpiredTimer())), 'A000')
    call DestroyTimer(GetExpiredTimer())
endfunction

Replace 'A000' with the ability code of the spellbook ability you made (look at the raw code data in the object editor, control-D I think is the toggle for it).