HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggers to recognize learning spell or spell level?

11-28-2003, 07:19 PM#1
AZN-Enigma
How do I create a trigger to recognize what the level of a custom spell is being cast? or when a hero learns a custom skill? So I can change the spell triggers for the new level.
11-28-2003, 07:21 PM#2
Hunter0000
You have to add to an integer value every time the spell is learned. This is the only way to record that data.
11-28-2003, 07:29 PM#3
Ligature
I think you want Event - a unit learns a skill...
11-29-2003, 05:12 AM#4
AZN-Enigma
yeah the problem is its a custom ability its not listed. In the conditioning ability comparison it only list the default hero abilities so wat do i do if its a custom ability?
11-29-2003, 05:17 AM#5
Hunter0000
use the acnolament for the skill the custom is based off of.
11-29-2003, 05:21 AM#6
FerretDruid
That's pretty easy to do, you'll just need to use a little JASS.
Code:
YourSpell Level Variable
    Events
        Unit - A unit owned by Player 1 (Red) Learns a skill
    Conditions
    Actions
        Custom script:   if ( not ( GetLearnedSkillBJ() == '****' ) ) then
        Custom script:   return false
        Custom script:   endif
        Set YourSpellLevel = (Learned skill level)

Your spell ID needs to go where **** is, there are multiple ways to get the spell ID for your custom spell. The way I do it is just make a temporary trigger and put your spell in it anywhere, like make a condition that says Ability being cast Equal to (YourSpell) - and then highlight the temporary trigger and convert the whole thing to custom text (with the Edit menu tab). You should see a line in the new trigger that says "if ( not ( GetSpellAbilityId() == 'A003' ) ) then" or similar, that 'A003' will be your spell ID.
11-29-2003, 10:31 AM#7
AZN-Enigma
*Sweeeet* Thx Ferret it works!