• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] GUI Streak System

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2012
Messages
101
  • Spree
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- // The time for the next kill system of a player to reset --------
      • Set SPREE_NEXT_KILL_MAXIMUM_TIMER = 5
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // The sound for next kill system --------
      • Set SPREE_NEXT_KILL_SOUND[2] = Double_Kill <gen>
      • Set SPREE_NEXT_KILL_SOUND[3] = triple_kill <gen>
      • Set SPREE_NEXT_KILL_SOUND[4] = UltraKill <gen>
      • Set SPREE_NEXT_KILL_SOUND[5] = Rampage <gen>
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // The sound of the streak system --------
      • Set SPREE_SOUND[1] = firstblood <gen>
      • Set SPREE_SOUND[3] = Killing_Spree <gen>
      • Set SPREE_SOUND[4] = Dominating <gen>
      • Set SPREE_SOUND[5] = MegaKill <gen>
      • Set SPREE_SOUND[6] = Unstoppable <gen>
      • Set SPREE_SOUND[7] = WhickedSick <gen>
      • Set SPREE_SOUND[8] = MonsterKill <gen>
      • Set SPREE_SOUND[9] = GodLike <gen>
      • Set SPREE_SOUND[10] = HolyShit <gen>
      • Set SPREE_SOUND[11] = Ownage <gen>
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • Set Playername[1] = (|c00ff0303 + ((Name of Player 1 (Red)) + |r))
      • Set Playername[2] = (|c000042ff + ((Name of Player 2 (Blue)) + |r))
      • Set Playername[3] = (|c001ce6b9 + ((Name of Player 3 (Teal)) + |r))
      • Set Playername[4] = (|c00540081 + ((Name of Player 4 (Purple)) + |r))
      • Set Playername[5] = (|c00fffc01 + ((Name of Player 5 (Yellow)) + |r))
      • Set Playername[6] = (|c00feba0e + ((Name of Player 6 (Orange)) + |r))
      • Set Playername[7] = (|c0020c000 + ((Name of Player 7 (Green)) + |r))
      • Set Playername[8] = (|c00e55bb0 + ((Name of Player 8 (Pink)) + |r))

  • Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] = (SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] + 1)
      • Set SPREE_INTEGER[(Player number of (Owner of (Triggering unit)))] = 0
      • Set SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] = (SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] + 1)
      • Set SPREE_TIMER[(Player number of (Owner of (Killing unit)))] = SPREE_NEXT_KILL_MAXIMUM_TIMER
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Make_Kill Equal to True
        • Then - Actions
          • Set Kill_Points[(Player number of (Owner of (Killing unit)))] = (Kill_Points[(Player number of (Owner of (Killing unit)))] + 1)
          • Set Killing_Spree[(Player number of (Owner of (Killing unit)))] = (Killing_Spree[(Player number of (Owner of (Killing unit)))] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • First_Blood Equal to False
          • (Owner of (Killing unit)) Not equal to Neutral Hostile
          • (Owner of (Killing unit)) Not equal to (Owner of (Dying unit))
          • ((Dying unit) is A Hero) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has drawn |c00ff0000First Blood|r)
          • Sound - Play firstblood <gen>
          • Set First_Blood = True
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== STREAK! ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 3: Killingspree --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 1
        • Then - Actions
          • Do nothing
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 3
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |cff0000FFKilling Spree|r!)
          • Sound - Play SPREE_SOUND[3]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 4: Dominating --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 4
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00ff9900Dominating|r!)
          • Sound - Play SPREE_SOUND[4]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 5: Mega Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 5
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |c00ff33ffMega Kill|r!)
          • Sound - Play SPREE_SOUND[5]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 6: Dominating --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 6
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00990000Unstoppable|r!)
          • Sound - Play SPREE_SOUND[6]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 7: Wicked Sick --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 7
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c009933ffWicked Sick|r!)
          • Sound - Play SPREE_SOUND[7]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 8: Monster Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 8
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |c0099ff33Monster Kill|r!)
          • Sound - Play SPREE_SOUND[8]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 9: Unreal --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 9
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00000066God Like|r!)
          • Sound - Play SPREE_SOUND[9]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 10: Holy Shit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 10
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00ffff00Holy Shit|r!)
          • Sound - Play SPREE_SOUND[10]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 11: Unstoppable --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Greater than or equal to 11
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00990000OWNAGE|r!)
          • Sound - Play SPREE_SOUND[11]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== NEXT KILL! ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 2: Double Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Equal to 2
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |cffE8B57DDouble Kill|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[2]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 3: Triple Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Equal to 3
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |cff0000FFTripple Kill|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[3]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 4: Ultra Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Equal to 4
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has an |c009999ffUltra Kill|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[4]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 5: Rampage --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Greater than or equal to 5
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is on a |c00ff6600Rampage|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[5]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------

  • Next Kill
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set SPREE_TIMER[(Integer A)] = (SPREE_TIMER[(Integer A)] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SPREE_TIMER[(Integer A)] Equal to 0
            • Then - Actions
              • Set SPREE_NEXT_KILL[(Integer A)] = 0
            • Else - Actions
This is taken from http://www.hiveworkshop.com/forums/...-1-1-a-186817/?prev=search=streak&d=list&r=20 and I edited because I didn't like it.
There are more sounds in Import Manager like butcher or combowhore.
You can change the timer between kills:
  • Set SPREE_NEXT_KILL_MAXIMUM_TIMER = 5
 

Attachments

  • Streak.w3x
    325.2 KB · Views: 89

Deleted member 219079

D

Deleted member 219079

Download [v1.0.1]: View attachment killStreak (jondrean).w3x

If you happen to have newgen we with jasshelper, use this:
JASS:
library killStreak /*v1.0.3*/ initializer init requires optional streakAddon
    globals
        private sound array SOUNDS_SPREE
        private sound array SOUNDS_STREAK
        private real array STREAK_TIME
        private integer array KILL_STREAK
        private integer array KILL_SPREE
        private string array SPREE_STR
        private string array STREAK_STR
        private string array SPREE_EXPRESSION
        private string array STREAK_EXPRESSION
        private timer TIMER = CreateTimer()
        public boolean FIRST_BLOOD = false //set this to true if you don't want to display first blood
            //use " set killStreak_FIRST_BLOOD = false " in GUI to reset first blood trigger
                //configuration
            private constant real STREAK_TIMEOUT = 25 //streak timeout in seconds
            private constant boolean SHOW_SPREE = true //whether you display "<pl> is on <spree>"
            private constant boolean SHOW_STREAK = true //whether you display "<pl> is on <streak>"
            private constant boolean SHOW_FT = true //whether you want floating texts to be shown
            private constant integer CD_ON_MAX_SPREE = 2 //how many kills before repeating the max index
            private constant integer CD_ON_MAX_STREAK = 2 //how many kills before repeating the max index
            private constant integer MAXSPREE = 19 //type your maximum spree here
            private constant integer MAXSTREAK = 5 //type your maximum streak here
            private constant boolean SHOW_KILLED = false //whether you want the killed player's name to be shown
    endglobals
    private function timerStep takes nothing returns real
        return 0.5
    endfunction
    private function notMaxSpree takes integer i returns boolean
        return i < MAXSPREE+CD_ON_MAX_SPREE
    endfunction
    private function notMaxStreak takes integer i returns boolean
        return i < MAXSTREAK+CD_ON_MAX_STREAK
    endfunction
    private function validSpree takes integer i returns boolean
        return SOUNDS_SPREE[i]!=null and i!=1
    endfunction
    private function validStreak takes integer id, integer i returns boolean
        return (STREAK_TIME[id]>0 and SOUNDS_STREAK[i]!=null)
    endfunction
    private function GetBigger takes real r1, real r2 returns real
        if r1 > r2 then
            return r1
        endif
        return r2
    endfunction
    private function streakStep takes nothing returns nothing
        local integer i = 0
        local boolean b = true
        loop
            if STREAK_TIME[i]>0 then
                set STREAK_TIME[i] = GetBigger(0,STREAK_TIME[i] - timerStep())
                if STREAK_TIME[i]==0 then
                    set KILL_STREAK[i]=0
                        else
                    set b = false
                endif
            endif
            exitwhen i == 11
            set i = i +1
        endloop
        if b == true then
            call PauseTimer(TIMER)
        endif
    endfunction
    private function checkDeath takes nothing returns boolean
        local player target = GetOwningPlayer(GetTriggerUnit())
        local player killer = GetOwningPlayer(GetKillingUnit())
        local integer killerId = GetPlayerId(killer)
        local boolean b = true //no killed's name shown yet
        if IsPlayerEnemy(target,killer) and IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) then
            if notMaxSpree(KILL_SPREE[killerId]) then
                set KILL_SPREE[killerId] = KILL_SPREE[killerId]+1
            else
                set KILL_SPREE[killerId] = MAXSPREE
            endif
            set KILL_SPREE[GetPlayerId(target)] = 0
            set KILL_STREAK[GetPlayerId(target)] = 0
            set STREAK_TIME[GetPlayerId(target)] = 0
            //first blood
            if not FIRST_BLOOD then
                set FIRST_BLOOD = true
                call StartSound(SOUNDS_SPREE[1])
                static if LIBRARY_streakAddon and SHOW_FT then
                    call streakAddon_SpawnText_Adv(GetKillingUnit(),SPREE_STR[1],4,1,null)
                endif
                static if SHOW_SPREE then
                    if SHOW_KILLED and b then
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[1]+SPREE_STR[1]/*
                            */+"  |c00999999( Killed |r"+streakAddon_GetPlayerNameColored(target)+" |c00999999)|r")
                            set b = false
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[1]+SPREE_STR[1]/*
                            */+"  |c00999999( Killed |r"+GetPlayerName(target)+" |c00999999)|r")
                            set b = false
                        endif
                    else
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[1]+SPREE_STR[1])
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[1]+SPREE_STR[1])
                        endif
                    endif
                endif
            endif
            //  kill spree
            if validSpree(KILL_SPREE[killerId]) then
                call StartSound(SOUNDS_SPREE[KILL_SPREE[killerId]])
                static if LIBRARY_streakAddon and SHOW_FT then
                    call streakAddon_SpawnText_Adv(GetKillingUnit(),SPREE_STR[KILL_SPREE[killerId]],4,1,null)
                endif
                static if SHOW_SPREE then
                    if SHOW_KILLED and b then
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]]/*
                            */+"  |c00999999( Killed |r"+streakAddon_GetPlayerNameColored(target)+" |c00999999)|r")
                            set b = false
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]]/*
                            */+"  |c00999999( Killed |r"+GetPlayerName(target)+" |c00999999)|r")
                            set b = false
                        endif
                    else
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]])
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]])
                        endif
                    endif
                endif
            endif
            // kill streak
            if notMaxStreak(KILL_STREAK[killerId]) then
                    set KILL_STREAK[killerId]=KILL_STREAK[killerId]+1
                else
                    set KILL_STREAK[killerId] = MAXSTREAK
            endif
            if validStreak(killerId,KILL_STREAK[killerId]) then
                call StartSound(SOUNDS_STREAK[KILL_STREAK[killerId]])
                static if LIBRARY_streakAddon and SHOW_FT then
                    call streakAddon_SpawnText_Adv(GetKillingUnit(),STREAK_STR[KILL_STREAK[killerId]],4,-1,null)
                endif
                static if SHOW_STREAK then
                    if SHOW_KILLED and b then
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]]/*
                            */+"  |c00999999( Killed |r"+streakAddon_GetPlayerNameColored(target)+" |c00999999)|r")
                            set b = false
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]]/*
                            */+"  |c00999999( Killed |r"+GetPlayerName(target)+" |c00999999)|r")
                            set b = false
                        endif
                    else
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]])
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]])
                        endif
                    endif
                endif
            endif
            set STREAK_TIME[killerId] = STREAK_TIMEOUT
            call TimerStart( TIMER, timerStep(), true, function streakStep)
        endif
        set target = null
        set killer = null
        return false
    endfunction
    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        set SPREE_STR[1] = "|c00ff3333First Blood!|r" //dedicated for first blood
        set SPREE_STR[3] = "|c006666ffKilling Spree!|r"
        set SPREE_STR[5] = "|c00ff00ffDominating!|r"
        set SPREE_STR[7] = "|c00660099Mega Kill!|r"
        set SPREE_STR[9] = "|c00cccc00Unstoppable!|r"
        set SPREE_STR[11] = "|c0033cc00Whicked Sick!|r"
        set SPREE_STR[13] = "|c00cc6600Monsterkill!|r"
        set SPREE_STR[15] = "|c0033ffffGODLIKE|r"
        set SPREE_STR[17] = "|c00cc0033HOLY SHIT|r"
        set SPREE_STR[19] = "|c00993300OWNAGE!|r"
        set SPREE_EXPRESSION[1] = " has " //dedicated for first blood
        set SPREE_EXPRESSION[3] = " is on a "
        set SPREE_EXPRESSION[5] = " is "
        set SPREE_EXPRESSION[7] = " performed "
        set SPREE_EXPRESSION[9] = " is "
        set SPREE_EXPRESSION[11] = " is "
        set SPREE_EXPRESSION[13] = " performed "
        set SPREE_EXPRESSION[15] = " is "
        set SPREE_EXPRESSION[17] = " is "
        set SPREE_EXPRESSION[19] = " is on "
        set SOUNDS_SPREE[1] = gg_snd_firstblood //dedicated for first blood
        set SOUNDS_SPREE[3] = gg_snd_Killing_Spree
        set SOUNDS_SPREE[5] = gg_snd_Dominating
        set SOUNDS_SPREE[7] = gg_snd_MegaKill
        set SOUNDS_SPREE[9] = gg_snd_Unstoppable
        set SOUNDS_SPREE[11] = gg_snd_WhickedSick
        set SOUNDS_SPREE[13] = gg_snd_MonsterKill
        set SOUNDS_SPREE[15] = gg_snd_GodLike
        set SOUNDS_SPREE[17] = gg_snd_HolyShit
        set SOUNDS_SPREE[19] = gg_snd_Ownage
        set SOUNDS_STREAK[2] = gg_snd_Double_Kill
        set SOUNDS_STREAK[3] = gg_snd_triple_kill
        set SOUNDS_STREAK[4] = gg_snd_UltraKill
        set SOUNDS_STREAK[5] = gg_snd_Combowhore
        set STREAK_STR[2] = "|c00ff6633Double Kill!|r"
        set STREAK_STR[3] = "|c000066ffTriple Kill!|r"
        set STREAK_STR[4] = "|c009900ccUltra Kill!|r"
        set STREAK_STR[5] = "|c0000ff66Combowhore!|r"
        set STREAK_EXPRESSION[2] = " has "
        set STREAK_EXPRESSION[3] = " has "
        set STREAK_EXPRESSION[4] = " has "
        set STREAK_EXPRESSION[5] = " is "
        call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
        call TriggerAddCondition( t, function checkDeath )
        set t = null
    endfunction
endlibrary
JASS:
library streakAddon
    globals
        private texttag ST_RETURNED
    endglobals
    
    public function GetPlayerNameColored takes player pl returns string
        if GetPlayerId(pl)==0 then
            return "|c00ff0000" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==1 then
            return "|c000033ff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==2 then
            return "|c0000ffff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==3 then
            return "|c009900cc" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==4 then
            return "|c00ffff00" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==5 then
            return "|c00ff6600" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==6 then
            return "|c0033ff00" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==7 then
            return "|c00ff33ff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==8 then
            return "|c00999999" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==9 then
            return "|c0099ccff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==10 then
            return "|c00023a02" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==11 then
            return "|c00663300" + GetPlayerName(pl) + "|r"
        endif
        return GetPlayerName(pl)
    endfunction
    
    public function SpawnText_Simple takes unit u, string str returns texttag
        set ST_RETURNED = CreateTextTag()
        call SetTextTagText(ST_RETURNED, "|cffffcc00"  + str + "|r", 0.023)
        call SetTextTagPos ( ST_RETURNED,GetUnitX(u), GetUnitY(u), 100)
        call SetTextTagVisibility ( ST_RETURNED, true)
        call SetTextTagPermanent (ST_RETURNED, false)
        call SetTextTagLifespan ( ST_RETURNED, 3.5)
        call SetTextTagFadepoint ( ST_RETURNED, 2)
        call SetTextTagVelocity (ST_RETURNED, 0, 0.01775)
        if GetLocalPlayer() != GetOwningPlayer(u) then
            call SetTextTagVisibility(ST_RETURNED, false)
        else
            call SetTextTagVisibility(ST_RETURNED, true)
        endif
        return ST_RETURNED
    endfunction
    
    public function SpawnText_Adv takes unit u, string str, real time, real angle, string color returns texttag
        set ST_RETURNED = CreateTextTag()
        if color=="red" then
            call SetTextTagText ( ST_RETURNED, "|c00ff0000" + str + "|r", 0.023)
        elseif color=="yellow" then
            call SetTextTagText ( ST_RETURNED, "|cffffcc00" + str + "|r", 0.023)
        elseif color=="green" then
            call SetTextTagText ( ST_RETURNED, "|c0000cc00" + str + "|r", 0.023)
        elseif color=="blue" then
            call SetTextTagText ( ST_RETURNED, "|c000033ff" + str + "|r", 0.023)
        else
            call SetTextTagText ( ST_RETURNED, str, 0.023)
        endif
        call SetTextTagPos ( ST_RETURNED,GetUnitX(u), GetUnitY(u), 100)
        call SetTextTagVisibility ( ST_RETURNED, true)
        call SetTextTagPermanent (ST_RETURNED, false)
        call SetTextTagLifespan ( ST_RETURNED, time)
        call SetTextTagFadepoint ( ST_RETURNED, time-1.5)
        call SetTextTagVelocity (ST_RETURNED, 0, angle*0.01775)
        if GetLocalPlayer() != GetOwningPlayer(u) then
            call SetTextTagVisibility(ST_RETURNED, false)
        else
            call SetTextTagVisibility(ST_RETURNED, true)
        endif
        return ST_RETURNED
    endfunction
endlibrary

Changelog:
1.0.1
-leak fixes
-first blood changed
1.0.2
-bug fixes
-first blood text effect added
-cd on max added
-toggle for text effect added
1.0.3
-added ability to show target's name
 
Last edited by a moderator:
Level 3
Joined
Feb 28, 2013
Messages
30
  • Spree
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- // The time for the next kill system of a player to reset --------
      • Set SPREE_NEXT_KILL_MAXIMUM_TIMER = 5
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // The sound for next kill system --------
      • Set SPREE_NEXT_KILL_SOUND[2] = Double_Kill <gen>
      • Set SPREE_NEXT_KILL_SOUND[3] = triple_kill <gen>
      • Set SPREE_NEXT_KILL_SOUND[4] = UltraKill <gen>
      • Set SPREE_NEXT_KILL_SOUND[5] = Rampage <gen>
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // The sound of the streak system --------
      • Set SPREE_SOUND[1] = firstblood <gen>
      • Set SPREE_SOUND[3] = Killing_Spree <gen>
      • Set SPREE_SOUND[4] = Dominating <gen>
      • Set SPREE_SOUND[5] = MegaKill <gen>
      • Set SPREE_SOUND[6] = Unstoppable <gen>
      • Set SPREE_SOUND[7] = WhickedSick <gen>
      • Set SPREE_SOUND[8] = MonsterKill <gen>
      • Set SPREE_SOUND[9] = GodLike <gen>
      • Set SPREE_SOUND[10] = HolyShit <gen>
      • Set SPREE_SOUND[11] = Ownage <gen>
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • Set Playername[1] = (|c00ff0303 + ((Name of Player 1 (Red)) + |r))
      • Set Playername[2] = (|c000042ff + ((Name of Player 2 (Blue)) + |r))
      • Set Playername[3] = (|c001ce6b9 + ((Name of Player 3 (Teal)) + |r))
      • Set Playername[4] = (|c00540081 + ((Name of Player 4 (Purple)) + |r))
      • Set Playername[5] = (|c00fffc01 + ((Name of Player 5 (Yellow)) + |r))
      • Set Playername[6] = (|c00feba0e + ((Name of Player 6 (Orange)) + |r))
      • Set Playername[7] = (|c0020c000 + ((Name of Player 7 (Green)) + |r))
      • Set Playername[8] = (|c00e55bb0 + ((Name of Player 8 (Pink)) + |r))

  • Die
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) is an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] = (SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] + 1)
      • Set SPREE_INTEGER[(Player number of (Owner of (Triggering unit)))] = 0
      • Set SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] = (SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] + 1)
      • Set SPREE_TIMER[(Player number of (Owner of (Killing unit)))] = SPREE_NEXT_KILL_MAXIMUM_TIMER
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Make_Kill Equal to True
        • Then - Actions
          • Set Kill_Points[(Player number of (Owner of (Killing unit)))] = (Kill_Points[(Player number of (Owner of (Killing unit)))] + 1)
          • Set Killing_Spree[(Player number of (Owner of (Killing unit)))] = (Killing_Spree[(Player number of (Owner of (Killing unit)))] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • First_Blood Equal to False
          • (Owner of (Killing unit)) Not equal to Neutral Hostile
          • (Owner of (Killing unit)) Not equal to (Owner of (Dying unit))
          • ((Dying unit) is A Hero) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has drawn |c00ff0000First Blood|r)
          • Sound - Play firstblood <gen>
          • Set First_Blood = True
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== STREAK! ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 3: Killingspree --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 1
        • Then - Actions
          • Do nothing
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 3
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |cff0000FFKilling Spree|r!)
          • Sound - Play SPREE_SOUND[3]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 4: Dominating --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 4
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00ff9900Dominating|r!)
          • Sound - Play SPREE_SOUND[4]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 5: Mega Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 5
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |c00ff33ffMega Kill|r!)
          • Sound - Play SPREE_SOUND[5]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 6: Dominating --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 6
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00990000Unstoppable|r!)
          • Sound - Play SPREE_SOUND[6]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 7: Wicked Sick --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 7
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c009933ffWicked Sick|r!)
          • Sound - Play SPREE_SOUND[7]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 8: Monster Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 8
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |c0099ff33Monster Kill|r!)
          • Sound - Play SPREE_SOUND[8]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 9: Unreal --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 9
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00000066God Like|r!)
          • Sound - Play SPREE_SOUND[9]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 10: Holy Shit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Equal to 10
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00ffff00Holy Shit|r!)
          • Sound - Play SPREE_SOUND[10]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 11: Unstoppable --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_INTEGER[(Player number of (Owner of (Killing unit)))] Greater than or equal to 11
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is |c00990000OWNAGE|r!)
          • Sound - Play SPREE_SOUND[11]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== NEXT KILL! ===== ===== ===== ===== ===== --------
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 2: Double Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Equal to 2
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |cffE8B57DDouble Kill|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[2]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 3: Triple Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Equal to 3
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has a |cff0000FFTripple Kill|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[3]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 4: Ultra Kill --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Equal to 4
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + has an |c009999ffUltra Kill|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[4]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------
      • -------- // 5: Rampage --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SPREE_NEXT_KILL[(Player number of (Owner of (Killing unit)))] Greater than or equal to 5
        • Then - Actions
          • Game - Display to (All players) the text: (Playername[(Player number of (Owner of (Killing unit)))] + is on a |c00ff6600Rampage|r!)
          • Sound - Play SPREE_NEXT_KILL_SOUND[5]
        • Else - Actions
      • -------- // ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== --------

  • Next Kill
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set SPREE_TIMER[(Integer A)] = (SPREE_TIMER[(Integer A)] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SPREE_TIMER[(Integer A)] Equal to 0
            • Then - Actions
              • Set SPREE_NEXT_KILL[(Integer A)] = 0
            • Else - Actions
This is taken from http://www.hiveworkshop.com/forums/...-1-1-a-186817/?prev=search=streak&d=list&r=20 and I edited because I didn't like it.
There are more sounds in Import Manager like butcher or combowhore.
You can change the timer between kills:
  • Set SPREE_NEXT_KILL_MAXIMUM_TIMER = 5



Thanks budz.. +rep! :)
 
Level 3
Joined
Feb 28, 2013
Messages
30
Download [v1.0.1]: View attachment 135115

If you happen to have newgen we with jasshelper, use this:
JASS:
library killStreak /*v1.0.3*/ initializer init requires optional streakAddon
    globals
        private sound array SOUNDS_SPREE
        private sound array SOUNDS_STREAK
        private real array STREAK_TIME
        private integer array KILL_STREAK
        private integer array KILL_SPREE
        private string array SPREE_STR
        private string array STREAK_STR
        private string array SPREE_EXPRESSION
        private string array STREAK_EXPRESSION
        private timer TIMER = CreateTimer()
        public boolean FIRST_BLOOD = false //set this to true if you don't want to display first blood
            //use " set killStreak_FIRST_BLOOD = false " in GUI to reset first blood trigger
                //configuration
            private constant real STREAK_TIMEOUT = 25 //streak timeout in seconds
            private constant boolean SHOW_SPREE = true //whether you display "<pl> is on <spree>"
            private constant boolean SHOW_STREAK = true //whether you display "<pl> is on <streak>"
            private constant boolean SHOW_FT = true //whether you want floating texts to be shown
            private constant integer CD_ON_MAX_SPREE = 2 //how many kills before repeating the max index
            private constant integer CD_ON_MAX_STREAK = 2 //how many kills before repeating the max index
            private constant integer MAXSPREE = 19 //type your maximum spree here
            private constant integer MAXSTREAK = 5 //type your maximum streak here
            private constant boolean SHOW_KILLED = false //whether you want the killed player's name to be shown
    endglobals
    private function timerStep takes nothing returns real
        return 0.5
    endfunction
    private function notMaxSpree takes integer i returns boolean
        return i < MAXSPREE+CD_ON_MAX_SPREE
    endfunction
    private function notMaxStreak takes integer i returns boolean
        return i < MAXSTREAK+CD_ON_MAX_STREAK
    endfunction
    private function validSpree takes integer i returns boolean
        return SOUNDS_SPREE[i]!=null and i!=1
    endfunction
    private function validStreak takes integer id, integer i returns boolean
        return (STREAK_TIME[id]>0 and SOUNDS_STREAK[i]!=null)
    endfunction
    private function GetBigger takes real r1, real r2 returns real
        if r1 > r2 then
            return r1
        endif
        return r2
    endfunction
    private function streakStep takes nothing returns nothing
        local integer i = 0
        local boolean b = true
        loop
            if STREAK_TIME[i]>0 then
                set STREAK_TIME[i] = GetBigger(0,STREAK_TIME[i] - timerStep())
                if STREAK_TIME[i]==0 then
                    set KILL_STREAK[i]=0
                        else
                    set b = false
                endif
            endif
            exitwhen i == 11
            set i = i +1
        endloop
        if b == true then
            call PauseTimer(TIMER)
        endif
    endfunction
    private function checkDeath takes nothing returns boolean
        local player target = GetOwningPlayer(GetTriggerUnit())
        local player killer = GetOwningPlayer(GetKillingUnit())
        local integer killerId = GetPlayerId(killer)
        local boolean b = true //no killed's name shown yet
        if IsPlayerEnemy(target,killer) and IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) then
            if notMaxSpree(KILL_SPREE[killerId]) then
                set KILL_SPREE[killerId] = KILL_SPREE[killerId]+1
            else
                set KILL_SPREE[killerId] = MAXSPREE
            endif
            set KILL_SPREE[GetPlayerId(target)] = 0
            set KILL_STREAK[GetPlayerId(target)] = 0
            set STREAK_TIME[GetPlayerId(target)] = 0
            //first blood
            if not FIRST_BLOOD then
                set FIRST_BLOOD = true
                call StartSound(SOUNDS_SPREE[1])
                static if LIBRARY_streakAddon and SHOW_FT then
                    call streakAddon_SpawnText_Adv(GetKillingUnit(),SPREE_STR[1],4,1,null)
                endif
                static if SHOW_SPREE then
                    if SHOW_KILLED and b then
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[1]+SPREE_STR[1]/*
                            */+"  |c00999999( Killed |r"+streakAddon_GetPlayerNameColored(target)+" |c00999999)|r")
                            set b = false
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[1]+SPREE_STR[1]/*
                            */+"  |c00999999( Killed |r"+GetPlayerName(target)+" |c00999999)|r")
                            set b = false
                        endif
                    else
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[1]+SPREE_STR[1])
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[1]+SPREE_STR[1])
                        endif
                    endif
                endif
            endif
            //  kill spree
            if validSpree(KILL_SPREE[killerId]) then
                call StartSound(SOUNDS_SPREE[KILL_SPREE[killerId]])
                static if LIBRARY_streakAddon and SHOW_FT then
                    call streakAddon_SpawnText_Adv(GetKillingUnit(),SPREE_STR[KILL_SPREE[killerId]],4,1,null)
                endif
                static if SHOW_SPREE then
                    if SHOW_KILLED and b then
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]]/*
                            */+"  |c00999999( Killed |r"+streakAddon_GetPlayerNameColored(target)+" |c00999999)|r")
                            set b = false
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]]/*
                            */+"  |c00999999( Killed |r"+GetPlayerName(target)+" |c00999999)|r")
                            set b = false
                        endif
                    else
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]])
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+SPREE_EXPRESSION[KILL_SPREE[killerId]]+SPREE_STR[KILL_SPREE[killerId]])
                        endif
                    endif
                endif
            endif
            // kill streak
            if notMaxStreak(KILL_STREAK[killerId]) then
                    set KILL_STREAK[killerId]=KILL_STREAK[killerId]+1
                else
                    set KILL_STREAK[killerId] = MAXSTREAK
            endif
            if validStreak(killerId,KILL_STREAK[killerId]) then
                call StartSound(SOUNDS_STREAK[KILL_STREAK[killerId]])
                static if LIBRARY_streakAddon and SHOW_FT then
                    call streakAddon_SpawnText_Adv(GetKillingUnit(),STREAK_STR[KILL_STREAK[killerId]],4,-1,null)
                endif
                static if SHOW_STREAK then
                    if SHOW_KILLED and b then
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]]/*
                            */+"  |c00999999( Killed |r"+streakAddon_GetPlayerNameColored(target)+" |c00999999)|r")
                            set b = false
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]]/*
                            */+"  |c00999999( Killed |r"+GetPlayerName(target)+" |c00999999)|r")
                            set b = false
                        endif
                    else
                        static if LIBRARY_streakAddon then
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, streakAddon_GetPlayerNameColored(killer)+"|r"+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]])
                        else
                            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(killer)+STREAK_EXPRESSION[KILL_STREAK[killerId]]+STREAK_STR[KILL_STREAK[killerId]])
                        endif
                    endif
                endif
            endif
            set STREAK_TIME[killerId] = STREAK_TIMEOUT
            call TimerStart( TIMER, timerStep(), true, function streakStep)
        endif
        set target = null
        set killer = null
        return false
    endfunction
    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        set SPREE_STR[1] = "|c00ff3333First Blood!|r" //dedicated for first blood
        set SPREE_STR[3] = "|c006666ffKilling Spree!|r"
        set SPREE_STR[5] = "|c00ff00ffDominating!|r"
        set SPREE_STR[7] = "|c00660099Mega Kill!|r"
        set SPREE_STR[9] = "|c00cccc00Unstoppable!|r"
        set SPREE_STR[11] = "|c0033cc00Whicked Sick!|r"
        set SPREE_STR[13] = "|c00cc6600Monsterkill!|r"
        set SPREE_STR[15] = "|c0033ffffGODLIKE|r"
        set SPREE_STR[17] = "|c00cc0033HOLY SHIT|r"
        set SPREE_STR[19] = "|c00993300OWNAGE!|r"
        set SPREE_EXPRESSION[1] = " has " //dedicated for first blood
        set SPREE_EXPRESSION[3] = " is on a "
        set SPREE_EXPRESSION[5] = " is "
        set SPREE_EXPRESSION[7] = " performed "
        set SPREE_EXPRESSION[9] = " is "
        set SPREE_EXPRESSION[11] = " is "
        set SPREE_EXPRESSION[13] = " performed "
        set SPREE_EXPRESSION[15] = " is "
        set SPREE_EXPRESSION[17] = " is "
        set SPREE_EXPRESSION[19] = " is on "
        set SOUNDS_SPREE[1] = gg_snd_firstblood //dedicated for first blood
        set SOUNDS_SPREE[3] = gg_snd_Killing_Spree
        set SOUNDS_SPREE[5] = gg_snd_Dominating
        set SOUNDS_SPREE[7] = gg_snd_MegaKill
        set SOUNDS_SPREE[9] = gg_snd_Unstoppable
        set SOUNDS_SPREE[11] = gg_snd_WhickedSick
        set SOUNDS_SPREE[13] = gg_snd_MonsterKill
        set SOUNDS_SPREE[15] = gg_snd_GodLike
        set SOUNDS_SPREE[17] = gg_snd_HolyShit
        set SOUNDS_SPREE[19] = gg_snd_Ownage
        set SOUNDS_STREAK[2] = gg_snd_Double_Kill
        set SOUNDS_STREAK[3] = gg_snd_triple_kill
        set SOUNDS_STREAK[4] = gg_snd_UltraKill
        set SOUNDS_STREAK[5] = gg_snd_Combowhore
        set STREAK_STR[2] = "|c00ff6633Double Kill!|r"
        set STREAK_STR[3] = "|c000066ffTriple Kill!|r"
        set STREAK_STR[4] = "|c009900ccUltra Kill!|r"
        set STREAK_STR[5] = "|c0000ff66Combowhore!|r"
        set STREAK_EXPRESSION[2] = " has "
        set STREAK_EXPRESSION[3] = " has "
        set STREAK_EXPRESSION[4] = " has "
        set STREAK_EXPRESSION[5] = " is "
        call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
        call TriggerAddCondition( t, function checkDeath )
        set t = null
    endfunction
endlibrary
JASS:
library streakAddon
    globals
        private texttag ST_RETURNED
    endglobals
    
    public function GetPlayerNameColored takes player pl returns string
        if GetPlayerId(pl)==0 then
            return "|c00ff0000" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==1 then
            return "|c000033ff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==2 then
            return "|c0000ffff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==3 then
            return "|c009900cc" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==4 then
            return "|c00ffff00" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==5 then
            return "|c00ff6600" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==6 then
            return "|c0033ff00" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==7 then
            return "|c00ff33ff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==8 then
            return "|c00999999" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==9 then
            return "|c0099ccff" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==10 then
            return "|c00023a02" + GetPlayerName(pl) + "|r"
        elseif GetPlayerId(pl)==11 then
            return "|c00663300" + GetPlayerName(pl) + "|r"
        endif
        return GetPlayerName(pl)
    endfunction
    
    public function SpawnText_Simple takes unit u, string str returns texttag
        set ST_RETURNED = CreateTextTag()
        call SetTextTagText(ST_RETURNED, "|cffffcc00"  + str + "|r", 0.023)
        call SetTextTagPos ( ST_RETURNED,GetUnitX(u), GetUnitY(u), 100)
        call SetTextTagVisibility ( ST_RETURNED, true)
        call SetTextTagPermanent (ST_RETURNED, false)
        call SetTextTagLifespan ( ST_RETURNED, 3.5)
        call SetTextTagFadepoint ( ST_RETURNED, 2)
        call SetTextTagVelocity (ST_RETURNED, 0, 0.01775)
        if GetLocalPlayer() != GetOwningPlayer(u) then
            call SetTextTagVisibility(ST_RETURNED, false)
        else
            call SetTextTagVisibility(ST_RETURNED, true)
        endif
        return ST_RETURNED
    endfunction
    
    public function SpawnText_Adv takes unit u, string str, real time, real angle, string color returns texttag
        set ST_RETURNED = CreateTextTag()
        if color=="red" then
            call SetTextTagText ( ST_RETURNED, "|c00ff0000" + str + "|r", 0.023)
        elseif color=="yellow" then
            call SetTextTagText ( ST_RETURNED, "|cffffcc00" + str + "|r", 0.023)
        elseif color=="green" then
            call SetTextTagText ( ST_RETURNED, "|c0000cc00" + str + "|r", 0.023)
        elseif color=="blue" then
            call SetTextTagText ( ST_RETURNED, "|c000033ff" + str + "|r", 0.023)
        else
            call SetTextTagText ( ST_RETURNED, str, 0.023)
        endif
        call SetTextTagPos ( ST_RETURNED,GetUnitX(u), GetUnitY(u), 100)
        call SetTextTagVisibility ( ST_RETURNED, true)
        call SetTextTagPermanent (ST_RETURNED, false)
        call SetTextTagLifespan ( ST_RETURNED, time)
        call SetTextTagFadepoint ( ST_RETURNED, time-1.5)
        call SetTextTagVelocity (ST_RETURNED, 0, angle*0.01775)
        if GetLocalPlayer() != GetOwningPlayer(u) then
            call SetTextTagVisibility(ST_RETURNED, false)
        else
            call SetTextTagVisibility(ST_RETURNED, true)
        endif
        return ST_RETURNED
    endfunction
endlibrary

Changelog:
1.0.1
-leak fixes
-first blood changed
1.0.2
-bug fixes
-first blood text effect added
-cd on max added
-toggle for text effect added
1.0.3
-added ability to show target's name

I try this one too when i use jass.. thanks for your effort +rep :)
 

Deleted member 219079

D

Deleted member 219079

If you need guidance about JASS try this
I actually uploaded the system on hive (thanks for your idea!), here
 
Status
Not open for further replies.
Top