| 08-22-2003, 06:09 PM | #1 |
You can only set a ability or a variable to ability being casted. I would like to use set - ability learned by hero and set integer to level of ability being learned. How can I do this, jass or changes in the trigger-file? |
| 08-22-2003, 06:17 PM | #2 |
Use Hero Skill Comparison, not Ability Comparison. One note of caution: (Event Response - Learned Skill Level) is buggy. At level 1, it returns a value of 1, but for every level above that, it returns one less than it should. Your best bet would probably be to just increase a variable by 1 rather than set it equal to Learned Skill Level. If you're going to have Tomes of Retraining, just have them set all skill variables/custom value of unit for that hero to 0. |
| 08-22-2003, 08:49 PM | #3 |
there is no action that can set a variable to ability/skill being learned. But is it posible with jass or something els as i asked before |
| 08-22-2003, 10:18 PM | #4 | |
I think this is what you want. The code is from a map I'm working on, and I use this to track the upgrade level of a hero skill. Note that DrugPack is Integer Array of 16 places (max num of players). Quote:
|
| 08-23-2003, 03:06 AM | #5 |
Yes, you need to convert to jass, the function you'd use is GetLearnedSkillBJ() |
| 08-23-2003, 12:05 PM | #6 |
k thanks, I'll get into jass as I know php I don't think it will be hard learning a new language.:D |
| 08-23-2003, 12:14 PM | #7 |
You can write that out all in the gui. You only need to change one value in the jass. Code:
Untitled Trigger 001
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Human Archmage - Blizzard
Actions
Set SkillLevel = (SkillLevel + 1)
It should look like this: You will need to change the value in red to the code for your spell(press ctrl+D to see this) Code:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == '[color=RED]AHbz[/color]' ) ) then
return false
endif
return true
endfunction
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
set udg_SkillLevel = ( udg_SkillLevel + 1 )
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction |
