| 09-22-2004, 12:33 AM | #1 |
Ok, I have 67 triggers with 3 if thens in each trigger all in JASS cuz it was just faster to convert to jass then use replace in notepad :D but now I need to add a condition that says if hero has 7 abilities do nothing...so ummm, seeing as how I know very little about JASS, I dont know where to start o_O . So I guess that means I have to make like...201 more conditions :o bah, I dun wanna do that lol and I wouldnt know where to start in JASS...so I got to thinking...what if I just made 1 extra trigger that said Event - unit acquires item Condition - hero skills = 7 (dunno how to do this part yet) Action - run trigger 1-67 right now the current trigger w/o the hero skills = 7 looks like this.... Code:
function Trig_Death_Coil_Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00U' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A00Z', GetManipulatingUnit()) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Death_Coil_Func002C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00U' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A00Z', GetManipulatingUnit()) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Death_Coil_Func003C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00U' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A00Z', GetManipulatingUnit()) == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Death_Coil_Actions takes nothing returns nothing
if ( Trig_Death_Coil_Func001C() ) then
call UnitAddAbilityBJ( 'A00Z', GetManipulatingUnit() )
return
else
call DoNothing( )
endif
if ( Trig_Death_Coil_Func002C() ) then
call SetUnitAbilityLevelSwapped( 'A00Z', GetManipulatingUnit(), 2 )
return
else
call DoNothing( )
endif
if ( Trig_Death_Coil_Func003C() ) then
call SetUnitAbilityLevelSwapped( 'A00Z', GetManipulatingUnit(), 3 )
return
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Death_Coil takes nothing returns nothing
set gg_trg_Death_Coil = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Death_Coil, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( gg_trg_Death_Coil, function Trig_Death_Coil_Actions )
endfunctionmmmhmmm....so Im sorta a at road block here...any suggestions??? |
| 09-22-2004, 05:03 AM | #2 |
Well there is a easy way of count skills of the Hero, if they are skills that are learned: Events Unit - A unit Learns a skill Conditions (Learned skill level) Less than 2( if it is 2 or more, then the hero alredy have that skill) Actions Unit - Set the custom value of (Learning Hero) to ((Custom value of (Learning Hero)) + 1) By this way, the custom value of the hero would be the number of hero abillities that he have.For your condition, it would be like this: GetUnitUserData(GetManipulatingUnit()) >= 7 |
| 09-22-2004, 09:52 PM | #3 |
meh, if u read my post u would know the hero isnt "learning" the skill, it is being added to him by triggers. Any1 else got any ideas? thanks for trying tho, Rafael Br. |
| 09-22-2004, 10:22 PM | #4 |
I dont know the solution to your problem but could you come online in warcraft please?My map is releasing and I need someone to hel pme in the final test |
| 09-23-2004, 03:51 AM | #5 | |
Quote:
Returning to the problem, set the unit custom value to +1 when adding the abbility, then, you just have to check if his custom value is 7.That would make a lot of actions, but it would work. |
| 09-23-2004, 08:27 PM | #6 |
ok, so now I got... Event - unit acquires item Condition - custom point value of hero = 7 Action - run trigger 1-67 but how do I make a custom value of hero + 1 action in JASS? and bah, theres got to be an easier way to detect it...GRR why did I do it all in JASS |
| 09-23-2004, 09:36 PM | #7 |
Just stick the action into a trigger, and choose convert to custom text: Code:
call SetUnitUserData( GetTriggerUnit(), ( GetUnitUserData(GetTriggerUnit()) + 1 ) ) |
