• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

"Stop Leveling" Trigger

Status
Not open for further replies.
Level 10
Joined
Sep 1, 2013
Messages
773
So I have noticed in different campaigns, that your hero's level stops at a certain point (to prevent you from being overpowered), but how can I do that?
Sorry for the nooby question, I really don't know a lot about triggers.
 
Two Solutions

GUI
  • Level Cap
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Hero level of (Triggering unit)) Greater than or equal to Level_Cap
    • Actions
      • Hero - Disable experience gain for (Triggering unit)
JASS
JASS:
function Level_Cap takes nothing returns nothing
    local unit Hero=GetTriggerUnit()
    call SuspendHeroXP(Hero,GetHeroLevel(Hero)>=udg_Level_Cap)
    set Hero=null
endfunction

function InitTrig_Level_Cap takes nothing returns nothing
    set gg_trg_Level_Cap=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Level_Cap,EVENT_PLAYER_HERO_LEVEL) // This line could be made better depending on the map used in it.
    call TriggerAddCondition(gg_trg_Level_Cap,Filter(function Level_Cap))
endfunction
 
Status
Not open for further replies.
Top