JASS:
function Trig_JassExp_Actions takes nothing returns nothing
local player ow = Player ( PLAYER_NEUTRAL_AGGRESIVE )
local unit dy = GetDyingUnit ()
local unit he
local real x = GetUnitX ( dy )
local real y = GetUnitY ( dy )
local real rd = 1024.00
local hl
local ml = GetUnitLevel ( dy )
local integer xp = ( 10 * ml )
local group hg = CreateGroup ()
call GroupEnumUnitsInRange ( hg, x, y, rd, null )
loop
set he = FirstOfGroup ( hg )
set hl = GetUnitLevel ( he )
exitwhen he == null
if IsUnitEnemy ( he, ow ) == true then
call AddHeroXP ( he, xp, true )
endif
set hl = 0
call GroupRemoveUnit ( hg, he )
endloop
call DestroyGroup ( hg )
set ow = null
set rd = 0
set x = 0
set y = 0
set hg = null
set he = null
set dy = null
set xp = 0
set ml = 0
endfunction
//=====
function InitTrig_JassExp takes nothing returns nothing
local trigger JassExpT = CreateTrigger ()
call TriggerRegisterAnyUnitEventBJ ( JassExpT, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction ( JassExpT, function Trig_JassExp_Actions )
endfunction
Hero level 2 kills creep level 1 gains 10 xp (that works)
hero level 5 kills creep level 1 gains 0 xp.
there should be a maximum level and minimum level to the hero vs the creep to get a level.
Any Help Appreciated hope i didn't confuse you
Last edited: