• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Hero loses a spell!! why ?

Status
Not open for further replies.
Level 5
Joined
May 27, 2007
Messages
144
MY hero has 1 night passive ability. it works without any problem but when i use his ultimate (lvl6) ability (it is "metamorphosis") the spell disapears from hero. He dont have this spell anymore even when he ruturned to his normalunit. Why my hero loses his night passive ability after metamorphsis? PLs tell me what to do.
 
Level 3
Joined
Mar 27, 2007
Messages
23
Do you have the Ability on his alternate form also EX: Illidan's spells/abilities are Immolation ect and metamorphosis when he transforms Illidan's demon form also has those spells/abilities If you dont already have the ability in both units try that.
 
Level 5
Joined
May 27, 2007
Messages
144
yes i have. The problem is that my passive abilty is only nights active!!! So there are two abilities one is hero learing ability and the secondone is hero learned ability.
 
Level 5
Joined
May 2, 2007
Messages
141
Couldnt he just use a Unit to see if the unit is 'bob' or 'bobMetamoph' than add the ability to it.

Make a dummy unit call it 'nightspell store' then when ever Bob learns the spell/lvls it up do the same to the dummy. . . then when metamorph use trigger to add spell to BobMetamorph and set the spell lvl by checking the dummy?

Its just an idea, not sure if it'll work. . . but I think it will. . .
 
Level 3
Joined
Mar 27, 2007
Messages
23
try this

JASS:
function Trig_MetaFix_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'Replace with metamorphisis ID' ) ) then
        return false
    endif
    return true
endfunction

function Trig_MetaFix_Actions takes nothing returns nothing
    call UnitAddAbility( GetTriggerUnit(),'ReplacewithabilityID' )
endfunction

//===========================================================================
function InitTrig_MetaFix takes nothing returns nothing
    set gg_trg_MetaFix = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_MetaFix, EVENT_PLAYER_UNIT_SPELL_FINISH )
    call TriggerAddCondition( gg_trg_MetaFix, Condition( function Trig_MetaFix_Conditions ) )
    call TriggerAddAction( gg_trg_MetaFix, function Trig_MetaFix_Actions )
endfunction





//Replace 'replacewithabilityid' with the ability being lost leave the ' '
//Also name your trigger EXACTLY MetaFix or edit all where you see MetaFix with your triggers
//name. This should work, im new to jass so i dont know but try it and let me know
// to get an ability ID press Ctrl+D wile in the object editor in the ability section
 
Level 5
Joined
May 27, 2007
Messages
144
JASS:
function Trig_MetaFix_Conditions takes nothing returns boolean
  if ( not ( GetSpellAbilityId() == 'A00T' ) ) then
      return false  
  endif
  return true
endfunction 
function Trig_MetaFix_Actions takes nothing returns nothing
  call UnitAddAbility( GetTriggerUnit(),'A00R' )
  call UnitAddAbility( GetTriggerUnit(),'A009' )
endfunction

//===========================================================================

function InitTrig_MetaFix takes nothing returns nothing
  set gg_trg_MetaFix = CreateTrigger( )
  call TriggerRegisterAnyUnitEventBJ( gg_trg_MetaFix, EVENT_PLAYER_UNIT_SPELL_FINISH )
  call TriggerAddCondition( gg_trg_MetaFix, Condition( function Trig_MetaFix_Conditions ) )
  call TriggerAddAction( gg_trg_MetaFix, function Trig_MetaFix_Actions )
endfunction
i added a new line into your jass code and it works when i cast "metamorphosis" but when hero goes back to a "real" form he losses his spell again :confused:
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
JASS:
native UnitMakeAbilityPermanent     takes unit whichUnit, boolean permanent, integer abilityId returns boolean

and

JASS:
function Trig_MetaFix_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00T' ) ) then
        return false
    endif
    return true
endfunction

should be

JASS:
function Trig_MetaFix_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00T'
endfunction
 
Level 5
Joined
May 27, 2007
Messages
144
cant add this new code which starts native... !!! Why? the trigger will not work or be activeted with this new code!!! why ? pls help
 
Level 5
Joined
May 27, 2007
Messages
144
after metamorphose he can still learn his passiv but when he learned it he dont get it. he still loses his passiv.!!! maybe is somewhere in my jass script a mistake. im a noob mapmaker:) cant find!! Can someone make whole tigger for me? pls!!!
 
Last edited:
Level 3
Joined
Mar 27, 2007
Messages
23
JASS:
 function Trig_MetaFix_Conditions takes nothing returns boolean 
   if ( not ( GetSpellAbilityId() == 'A00T' ) ) 
   then  return false  
   endif  
   return true 
 endfunction
 
  
 function Trig_MetaFix_Actions takes nothing returns nothing  
    call UnitAddAbility( GetTriggerUnit(),'A00R' ) 
    call UnitAddAbility( GetTriggerUnit(),'A009' )
    call UnitMakeAbilityPermanent( GetTriggerUnit(),true,'A00R')
endfunction 
   //=========================================================================== 
   function InitTrig_MetaFix takes nothing returns nothing  
     set gg_trg_MetaFix = CreateTrigger( )  
     call TriggerRegisterAnyUnitEventBJ( gg_trg_MetaFix, EVENT_PLAYER_UNIT_SPELL_FINISH )  
     call TriggerAddCondition( gg_trg_MetaFix, Condition( function Trig_MetaFix_Conditions ) )  
     call TriggerAddAction( gg_trg_MetaFix, function Trig_MetaFix_Actions ) 
   endfunction

Try that
 
Level 5
Joined
May 27, 2007
Messages
144
He is still losing his passive ability after metamorphosis (when he is normal again) but now when he has his passiv on max lvl and cast metamorphose he has it in his new form after metamorphosis he is losing it. PLS help!!!!!

P.S. i think i must be second trigger which will be actived after metamorphosis.
 
Status
Not open for further replies.
Top