Assistance System by Vile. HELP

comparami

New Member
Reaction score
4
okay, the assistance system works perfectly, but, it only works for pre-placed heroes, meaning heroes in the map initially, not created by triggers or buildings.. so.. he suggested that we register the unit by doing this
Trigger:
  • Custom Script: call AssistanceSystem_Register(unit)


i tried doing so, by registering a sold unit when bought..
Trigger:
  • Hero Select
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • Custom script: call AssistanceSystem_Register (GetSoldUnit())


and once i save, an error message comes out saying "expected a function name" :confused:


EDIT:

THREAD CLOSED, i figured it out :D
 

comparami

New Member
Reaction score
4
yes, i copied it to my triggers, and i again, it works, i just need to register units that are created in the middle of the game, not pre-placed units.

Code:
//***************************************************************************
//* Assistance System
//*
//* Author: vile
//*
//* Requirements:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯
//* - The functions in the "Needed Functions" trigger
//* - Global unit variable array named: AssistanceTarget
//* - Global timer variable array named: AssistanceTimer
//* - Array sizes of both global vars set to 372 (Press CTRL+V)
//* - This trigger
//*
//* General Notes:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* Thank you for using my assistance system. This system was written
//* from scratch by me, and works flawlessly, as I have specifically
//* written it for my map, Age of Myths.
//* Feel free to spread this to as many maps as possible, but please
//* give me credits if you use it.
//* It is especially good for AOS type maps.
//* Below is the configuration section. This system supports
//* bounty sharing when heroes are dying. The gold share and bounty
//* can be configured below. It is completely triggered so you will
//* have to set your heroes bounty to 0 in the object editor.
//* This option is optional and you can set it below.
//*
//* NOTE: This assistance system only works on PRE PLACED UNITS!
//* That means only heroes that were placed on the map initially and
//* not created by a building or by a trigger.
//* If you want this to work on a created unit, just use the following:
//* Custom Script: call AssistanceSystem_Register(unit)
//*
//***************************************************************************
// Assistance System General Configuration Section
//***************************************************************************

constant function AssistanceSystem_SuicideMessage takes nothing returns string
    return "has commited suicide" //This message displays when you kill yourself.
endfunction

constant function AssistanceSystem_DeathMessage takes nothing returns string
    return "has been pwned" //This is the generic death message of a hero.
endfunction

constant function AssistanceSystem_AssistMessage takes nothing returns string
    return "Assists: " //This is the generic assistance message.
endfunction

constant function AssistanceSystem_ResetValue takes nothing returns real
    return 15. //How much time should pass until your assistance
               //doesnt count anymore? (Seconds)
endfunction

//***************************************************************************
// Assistance System Bounty Configuration Section
//***************************************************************************

constant function AssistanceSystem_ShareBounty takes nothing returns boolean
    return true //If shared bounty is on, when you kill a hero, a random bounty
                //gold amount that you can specify down below will be shared and
                //equally split among your assisters, if any.
                //The gold is split like this:
                //2 Assisters = gold is split by 2
                //3 Assisters = gold is split by 3
                //And so on.
                //IF THIS OPTION IS SET TO FALSE, YOU CAN IGNORE
                //THE REST OF THE CONFIGURATION BELOW!
endfunction

constant function AssistanceSystem_InitialRandom takes nothing returns integer
    return 100 //This is the initial minimum gold amount that the
               //killing hero gets for killing another hero.
               //The final amount is a random between this and the
               //EndingRandom value below. Then it is split amongst
               //assisters.
endfunction

constant function AssistanceSystem_EndingRandom takes nothing returns integer
    return 200 //The ending random amount value. The "maximum" value.
               //Note that if you want a permanent amount, just set
               //the two values to the same value.
endfunction

//***************************************************************************
// Assistance System code; don't touch it if you don't know jass.
//***************************************************************************

function AssistanceSystem_DeathCondition takes nothing returns boolean
    return IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true
endfunction

function AssistanceSystem_Reset takes nothing returns nothing
    local integer i = 0
    loop
        exitwhen i > 372 or GetExpiredTimer() == udg_AssistanceTimer[i]
        set i = i + 1
    endloop
    set udg_AssistanceTarget[i] = null
endfunction

function AssistanceSystem_Timer takes nothing returns nothing
    local unit attacked = GetTriggerUnit()
    local unit attacker = GetEventDamageSource()
    local player p1 = GetOwningPlayer(attacked)
    local player p2 = GetOwningPlayer(attacker)
    local integer id1 = GetPlayerId(p1)
    local integer id2 = GetPlayerId(p2)
    if IsUnitEnemy(attacker, p1) and id2 < 12 then
        loop
            exitwhen id2 > 372 or udg_AssistanceTarget[id2] == attacked or udg_AssistanceTarget[id2] == null
            set id2 = id2+20
        endloop
        if udg_AssistanceTarget[id2] == null then
            call TimerStart(udg_AssistanceTimer[id2], AssistanceSystem_ResetValue(), false, function AssistanceSystem_Reset)
            set udg_AssistanceTarget[id2] = attacked
        elseif udg_AssistanceTarget[id2] == attacked then
            call TimerStart(udg_AssistanceTimer[id2], AssistanceSystem_ResetValue(), false, function AssistanceSystem_Reset)
        endif
    endif
    set attacked = null
    set attacker = null
    set p1 = null
    set p2 = null
endfunction

function AssistanceSystem_DeathActions takes nothing returns nothing
    local player array assister
    local player array assistplayer
    local unit d = GetDyingUnit()
    local unit u = GetKillingUnit()
    local player pd = GetOwningPlayer(d)
    local player pu = GetOwningPlayer(u)
    local integer i = 0
    local integer i2 = 0
    local force f = CreateForce()
    local string array s
    local boolean array bg
    local integer gold = GetRandomInt(AssistanceSystem_InitialRandom(), AssistanceSystem_EndingRandom())
    local string losegold
    local boolean bounty = AssistanceSystem_ShareBounty()
    //Add players to a force to prevent a force leak
    //when messaging all players:
    loop
        exitwhen i > 11
        call ForceAddPlayer(f, Player(i))
        set i=i+1
    endloop
    set i=0
    if bounty == true then
        //If the the unit doesnt have the bounty gold to lose,
        //set the gold lost to its current gold:
        if GetPlayerState(pd, ConvertPlayerState(1)) <= gold then
            set gold = GetPlayerState(pd, ConvertPlayerState(1))
        endif
        set losegold = "-" + I2S(gold)
        //Display bounty only if the assister has more than 0 gold:
        set i=1
        loop
            exitwhen i>13
            set s[i] = "+" + I2S(gold)
            set s[i+1] = "+" + I2S(gold / i+1)
            set i=i+1
        endloop
    endif
    set i = 0
    set i2 = 0
    //Start setting the assisters:
    loop
        exitwhen i > 11
        loop
            exitwhen i2 > 372 or udg_AssistanceTarget[i2+i] == d
            set i2 = i2 + 20
        endloop
        if GetPlayerSlotState(Player(i)) != ConvertPlayerSlotState(0) and Player(i) != pu and udg_AssistanceTarget[i2+i] == d then
            set assistplayer[i] = Player(i)
            set udg_AssistanceTarget[i2+i] = null
            set udg_Assistance_Count[GetConvertedPlayerId(Player(i))] = ( udg_Assistance_Count[GetConvertedPlayerId(Player(i))] + 1 )
        endif
        set i = i + 1
        set i2 = 0
    endloop
    set i = 1
    set i2 = 0
    //Resort the assisters list so there wont be an empty
    //assister slot:
    loop
        exitwhen i > 11
        loop
            exitwhen assistplayer[i2] != null or i2 > 11
            set i2 = i2 + 1
        endloop
        if assistplayer[i2] != null then
            set assister[i] = assistplayer[i2]
            set assistplayer[i2] = null
        endif
        set i = i + 1
        set i2 = 0
    endloop
    set i = 1
    set i2 = 2
    loop
        exitwhen i > 11
        if assister[i] == null then
            loop
                exitwhen i2 > 11 or assister[i2] != null
                if assister[i2] != null then
                    set assister[i] = assister[i2]
                    set assister[i2] = null
                endif
                set i2 = i2 + 1
            endloop
        endif
        set i = i + 1
        set i2 = i + 2
    endloop
    set i = 1
    if d == u then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_SuicideMessage() + ".")
    elseif u == null and d != u then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + ".")
    elseif assister[1] == null and assister[2] == null and assister[3] == null and assister[4] == null and assister[5] == null and assister[6] == null and assister[7] == null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + "!")
    elseif assister[1] != null and assister[2] == null and assister[3] == null and assister[4] == null and assister[5] == null and assister[6] == null and assister[7] == null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + "!")
        if bg[1] and bounty then
            call FadingTextSingle(assister[1], s[2], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
            call SetPlayerState(assister[1], ConvertPlayerState(1), GetPlayerState(assister[1], ConvertPlayerState(1)) + gold / 2)
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] == null and assister[4] == null and assister[5] == null and assister[6] == null and assister[7] == null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + " and " + GetPlayerNameColored(assister[2]) + "!")
        if bg[2] and bounty then
            loop
                exitwhen i > 2
                call FadingTextSingle(assister[i], s[3], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 3)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] == null and assister[5] == null and assister[6] == null and assister[7] == null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", and " + GetPlayerNameColored(assister[3]) + "!")
        if bg[3] and bounty then
            loop
                exitwhen i > 3
                call FadingTextSingle(assister[i], s[4], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 4)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] == null and assister[6] == null and assister[7] == null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", and " + GetPlayerNameColored(assister[4]) + "!")
        if bg[4] and bounty then
            loop
                exitwhen i > 4
                call FadingTextSingle(assister[i], s[5], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 5)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] == null and assister[7] == null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", and " + GetPlayerNameColored(assister[5]) + "!")
        if bg[5] and bounty then
            loop
                exitwhen i > 5
                call FadingTextSingle(assister[i], s[6], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 6)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] != null and assister[7] == null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", " + GetPlayerNameColored(assister[5]) + ", and " + GetPlayerNameColored(assister[6]) + "!")
        if bg[6] and bounty then
            loop
                exitwhen i > 6
                call FadingTextSingle(assister[i], s[7], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 7)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] != null and assister[7] != null and assister[8] == null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", " + GetPlayerNameColored(assister[5]) + ", " + GetPlayerNameColored(assister[6]) + ", and " + GetPlayerNameColored(assister[7]) + "!")
        if bg[7] and bounty then
            loop
                exitwhen i > 7
                call FadingTextSingle(assister[i], s[8], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 8)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] != null and assister[7] != null and assister[8] != null and assister[9] == null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", " + GetPlayerNameColored(assister[5]) + ", " + GetPlayerNameColored(assister[6]) + ", " + GetPlayerNameColored(assister[7]) + ", and " + GetPlayerNameColored(assister[8]) + "!")
        if bg[8] and bounty then
            loop
                exitwhen i > 8
                call FadingTextSingle(assister[i], s[9], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 8)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] != null and assister[7] != null and assister[8] != null and assister[9] != null and assister[10] == null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", " + GetPlayerNameColored(assister[5]) + ", " + GetPlayerNameColored(assister[6]) + ", " + GetPlayerNameColored(assister[7]) + ", " + GetPlayerNameColored(assister[8]) + ", and " + GetPlayerNameColored(assister[9]) + "!")
        if bg[9] and bounty then
            loop
                exitwhen i > 9
                call FadingTextSingle(assister[i], s[10], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 8)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] != null and assister[7] != null and assister[8] != null and assister[9] != null and assister[10] != null and assister[11] == null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", " + GetPlayerNameColored(assister[5]) + ", " + GetPlayerNameColored(assister[6]) + ", " + GetPlayerNameColored(assister[7]) + ", " + GetPlayerNameColored(assister[8]) + ", " + GetPlayerNameColored(assister[9]) + ", and " + GetPlayerNameColored(assister[10]) + "!")
        if bg[10] and bounty then
            loop
                exitwhen i > 10
                call FadingTextSingle(assister[i], s[11], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 8)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] != null and assister[7] != null and assister[8] != null and assister[9] != null and assister[10] != null and assister[11] != null and assister[12] == null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", " + GetPlayerNameColored(assister[5]) + ", " + GetPlayerNameColored(assister[6]) + ", " + GetPlayerNameColored(assister[7]) + ", " + GetPlayerNameColored(assister[8]) + ", " + GetPlayerNameColored(assister[9]) + ", " + GetPlayerNameColored(assister[10]) + ", and " + GetPlayerNameColored(assister[11]) + "!")
        if bg[11] and bounty then
            loop
                exitwhen i > 11
                call FadingTextSingle(assister[i], s[12], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 8)
                set i = i + 1
            endloop
        endif
    elseif assister[1] != null and assister[2] != null and assister[3] != null and assister[4] != null and assister[5] != null and assister[6] != null and assister[7] != null and assister[8] != null and assister[9] != null and assister[10] != null and assister[11] != null and assister[12] != null then
        call DisplayTimedTextToForce(f, 10, GetPlayerNameColored(pd) + " " + AssistanceSystem_DeathMessage() + " by " + GetPlayerNameColored(pu) + " " + AssistanceSystem_AssistMessage() + " " + GetPlayerNameColored(assister[1]) + ", " + GetPlayerNameColored(assister[2]) + ", " + GetPlayerNameColored(assister[3]) + ", " + GetPlayerNameColored(assister[4]) + ", " + GetPlayerNameColored(assister[5]) + ", " + GetPlayerNameColored(assister[6]) + ", " + GetPlayerNameColored(assister[7]) + ", " + GetPlayerNameColored(assister[8]) + ", " + GetPlayerNameColored(assister[9]) + ", " + GetPlayerNameColored(assister[10]) + ", " + GetPlayerNameColored(assister[11]) + ", and " + GetPlayerNameColored(assister[12]) + "!")
        if bg[12] and bounty then
            loop
                exitwhen i > 12
                call FadingTextSingle(assister[i], s[13], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
                call SetPlayerState(assister[i], ConvertPlayerState(1), GetPlayerState(assister[i], ConvertPlayerState(1)) + gold / 8)
                set i = i + 1
            endloop
        endif
    endif
    if bounty and IsUnitEnemy(d, pu) and GetPlayerState(pd, ConvertPlayerState(1)) > 0 then
        call FadingTextSingle(pu, s[1], 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
        call FadingTextSingle(pd, losegold, 255, 220, 0, GetUnitX(d), GetUnitY(d), 0.03, 2, 5)
        call SetPlayerState(pu, ConvertPlayerState(1), GetPlayerState(pu, ConvertPlayerState(1)) + gold)
        call SetPlayerState(pd, ConvertPlayerState(1), GetPlayerState(pd, ConvertPlayerState(1)) - gold)
    endif
    set i=0
    call DestroyForce(f)
    set d=null
    set u=null
    set pd=null
    set pu=null
    set f=null
endfunction

function AssistanceSystem_Register takes unit u returns nothing
    call TriggerRegisterUnitEvent(gg_trg_AssistanceSystem, u, ConvertUnitEvent(52))
endfunction

function InitTrig_AssistanceSystem takes nothing returns nothing
    local rect r = GetWorldBounds()
    local group g = CreateGroup()
    local unit temp
    local trigger Death = CreateTrigger()
    set gg_trg_AssistanceSystem = CreateTrigger()
    call GroupEnumUnitsInRect(g, r, null)
    loop
        set temp=FirstOfGroup(g)
        exitwhen temp==null
        if IsUnitType(temp, UNIT_TYPE_HERO) then
            call TriggerRegisterUnitEvent(gg_trg_AssistanceSystem, temp, ConvertUnitEvent(52))
        endif
        call GroupRemoveUnit(g,temp)
        set temp=null
    endloop
    call DestroyGroup(g)
    call TriggerRegisterAnyUnitEventBJ(Death, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(Death, Condition(function AssistanceSystem_DeathCondition))
    call TriggerAddAction(Death, function AssistanceSystem_DeathActions)
    call RemoveRect(r)
    set g=null
    set r=null
    set Death=null
    call TriggerAddAction( gg_trg_AssistanceSystem, function AssistanceSystem_Timer)
endfunction

there it is.. didnt change anything except for this line i added to tally assists for my multiboard..

Code:
set udg_Assistance_Count[GetConvertedPlayerId(Player(i))] = ( udg_Assistance_Count[GetConvertedPlayerId(Player(i))] + 1 )
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top