• 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.

"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