Bribe's Spell System

Level 8
Joined
Jul 4, 2016
Messages
492
Code:
function EvoLoop takes nothing returns nothing
                local Table table = Tab[1]
                local integer u = GetUnitUserData(udg_Spell__Target)
                local Data d    = table[u]
                local real Size = 0
                local integer Alpha = 0
                local User p    = User.fromIndex(GetPlayerId(GetOwningPlayer(udg_Spell__Target)))
                local integer c = LoadInteger(udg_Spell__Hash,udg_Spell__Index,9)
             
                set c = c + 1
             
                call SaveInteger(udg_Spell__Hash,udg_Spell__Index,9,c)
             
             //   call DisplayTextToPlayer(Player(0),0,0,"Spell__Duration:" + R2S(udg_Spell__Duration))
             
                if udg_Spell__Duration == 0 then
                      set drugCount[u] = 0
                      call drugCount.remove(u)
                      call DisplayTextToPlayer(Player(0),0,0,"Evolution Ended")
                elseif d.IsEvil == 3 then
                      if c < 96 then
                         set Alpha = LoadInteger(udg_Spell__Hash,udg_Spell__Index,7)  - 3
                         set Size  = LoadReal(udg_Spell__Hash,udg_Spell__Index,8) + 0.01
                      endif
                      call EvoMutant(udg_Spell__Target,c,Alpha,Size,p)
                      call SaveInteger(udg_Spell__Hash,udg_Spell__Index,7,Alpha)
                      call SaveReal(udg_Spell__Hash,udg_Spell__Index,8,Size)
                    //  call DisplayTextToPlayer(Player(0),0,0,"Size:" + R2S(Size))
                      if c == 98 or c == 480 then
                        set Alpha = 0
                        loop
                                exitwhen Alpha > 6
                                call UnitAddItem(udg_Spell__Target,LoadItemHandle(udg_Spell__Hash,udg_Spell__Index,Alpha))
                                set Alpha = Alpha + 1
                        endloop
                     endif
                endif
             
                call DisplayTextToPlayer(Player(0),0,0,"Seconds:" +  R2S(GetRealGameTime()/1000))
         
    endfunction

    function EvoEffect takes nothing returns nothing
                local Table table   = Tab[1]
                local integer u     = GetUnitUserData(udg_Spell__Target)
                local Data d        = table[u]
                local integer Alpha = 0
                local real size     = 0
                local Table tex     = Tab[4]
                local TextTag t     = EvoTag(udg_Spell__Target,tex.string[27],30.0000, 8)
                local integer c     = 0
                local TimerLoop t3  = TimerLoop.create()
                local timer t2   
             
                set t3.text = t
                set t2 = NewTimerEx(t3)
             
                call TimerStart(t2,1,true,function TextLoop)
             
             
                if d.IsEvil == 3 then
                    set Alpha  = 255
                    call SaveInteger(udg_Spell__Hash,udg_Spell__Index,7,Alpha)
                    call SaveReal(udg_Spell__Hash,udg_Spell__Index,8,size)
                    set u = 0
                    loop
                         exitwhen u > 6
                         call SaveItemHandle(udg_Spell__Hash,udg_Spell__Index,u, UnitItemInSlot(udg_Spell__Target,u))
                         set u = u + 1
                    endloop
                endif
             
                call SaveInteger(udg_Spell__Hash,udg_Spell__Index,9,c)
             
              // call DisplayTextToPlayer(Player(0),0,0,"SPELL ACTIVATED")
             
                set t2 = null
                set udg_Spell__Time = 0.03125
                set udg_Spell__Duration = 15.00
    endfunction

Code:
function IntEvil takes nothing returns nothing
                local timer t = GetExpiredTimer()
                
                
                call RegisterSpellSystem('A0AE', function EvoEffect, function EvoLoop)
                call EvolutionSetup()
                call TimerStart(t,1.0, true, function EvoPoints)
                
                set t = null
    endfunction


[ATTACH type="full" alt="proxy.png"]379344[/ATTACH]

[ATTACH type="full" alt="proxy.png"]379345[/ATTACH]

Attachments

  • proxy.png
    proxy.png
    8.1 KB · Views: 6
  • proxy.png
    proxy.png
    33.1 KB · Views: 6
Last edited:
Top