Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Wait. WHAT?8hrs every day doesn't matter if it is Saturday/Sunday.
Oh look another offtopic!
endif or a endloopfunction InitialDeath_Actions takes nothing returns nothing
function InitialDeath_Actions takes nothing returns nothing
local real f
local real r
if ( GetUnitTypeId(GetTriggerUnit()) == 'H001' ) or ( GetUnitTypeId(GetTriggerUnit()) == 'H000' ) then
set f = GetUnitX(GetTriggerUnit())
set r = GetUnitY(GetTriggerUnit())
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", f, r ))
endif
if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A03K') > 0 ) then
set udg_A = 1
loop
exitwhen udg_A > udg_GB_Index
if ( GetTriggerUnit() == udg_GB_Caster[udg_A] ) and ( GetTriggerUnit() == udg_GB_Target[udg_A] ) then
set udg_TempReals[0] = GetUnitX(GetTriggerUnit())
set udg_TempReals[1] = GetUnitY(GetTriggerUnit())
set udg_TempTag = CreateTextTag()
call SetTextTagText(udg_TempTag, ( udg_PlayerColor[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnit()))] + ( udg_PlayerName[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + ( " has won " + ( I2S(( 6 + ( 3 * GetUnitAbilityLevel(udg_GB_Caster[udg_A], 'A01W') ) )) + " Vitality!|r" ) ) ) ), 0.00)
call SetTextTagPos(udg_TempTag, f, r, 0.00)
call SetTextTagColor(udg_TempTag, PercentTo255(100.00), PercentTo255(100.00), PercentTo255(100.00), PercentTo255(100.0-100.00))
call SetTextTagVelocityBJ( udg_TempTag, 124.00, 90 )
call SetTextTagSuspended( udg_TempTag, false )
call SetTextTagPermanent( udg_TempTag, false )
call SetTextTagLifespan( udg_TempTag, 3.00 )
call SetTextTagFadepoint( udg_TempTag, 1.50 )
call SetHeroStr(GetKillingUnit(), ( 6 + ( 3 * GetUnitAbilityLevel(udg_GB_Caster[udg_A], 'A01W') ) ), true )
set udg_GB_Duration[udg_A] = 0.00
call UnitRemoveAbility(GetKillingUnit(), 'B019' )
call UnitRemoveAbility(GetTriggerUnit(), 'B019' )
else
endif
set udg_A = udg_A + 1
endloop
else
endif
if ( GetTriggerPlayer() == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) then
else
endif
endfunction
Don't use useless BJ like Percent to 255 and SettextTagVelocityBJ or GetConvertedPlayerId
library InitialDeath
function InitialDeath_Actions takes nothing returns nothing
local real f
local real r
local unit u
if ( GetUnitTypeId(GetTriggerUnit()) == 'H001' ) or ( GetUnitTypeId(GetTriggerUnit()) == 'H000' ) then
set u = GetTriggerUnit()
set f = GetUnitX(u)
set r = GetUnitY(u)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", f, r ))
endif
if ( GetUnitAbilityLevel(u, 'A03K') > 0 ) then
set udg_A = 1
loop
exitwhen udg_A > udg_GB_Index
if ( u == udg_GB_Caster[udg_A] ) or ( u == udg_GB_Target[udg_A] ) then
set udg_TempReals[0] = GetUnitX(u)
set udg_TempReals[1] = GetUnitY(u)
set udg_TempTag = CreateTextTag()
call SetTextTagText(udg_TempTag, ( udg_PlayerColor[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] + ( udg_PlayerName[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + ( " has won " + ( I2S(( 6 + ( 3 * GetUnitAbilityLevel(udg_GB_Caster[udg_A], 'A01W') ) )) + " Vitality!|r" ) ) ) ), 0.00)
call SetTextTagPos(udg_TempTag, f, r, 0.00)
call SetTextTagColor(udg_TempTag, 255.00, 255.00, 255.00, 0.00)
call SetTextTagVelocityBJ( udg_TempTag, 124.00, 90 )
call SetTextTagSuspended( udg_TempTag, false )
call SetTextTagPermanent( udg_TempTag, false )
call SetTextTagLifespan( udg_TempTag, 3.00 )
call SetTextTagFadepoint( udg_TempTag, 1.50 )
call SetHeroStr(GetKillingUnit(), ( 6 + ( 3 * GetUnitAbilityLevel(udg_GB_Caster[udg_A], 'A01W') ) ), true )
set udg_GB_Duration[udg_A] = 0.00
call UnitRemoveAbility(GetKillingUnit(), 'B019' )
call UnitRemoveAbility(u, 'B019' )
else
endif
set udg_A = udg_A + 1
endloop
else
endif
if ( GetTriggerPlayer() == Player(12) ) then
//Neutral Stuff
else
endif
set u = null
endfunction
//===========================================================================
private function AddEventID takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( t, function InitialDeath_Actions )
set t = null
endfunction
endlibrary
i remember fixing an unexpected takes in KB3D but i can't remember how...library YourLibraryName initializer init
private function DoingSomething takes nothing returns nothing
//DO
//Your
//Stuff
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
//....
set t = null
endfunction
endlibrary
Try rewriting the library, and not CnP or looking what have done and doing the same, just erase, and repeat, you have a backup if you need to
library LineDamage
globals
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_MAGIC
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_MAGIC
endglobals
struct LineDamage extends array
private static group G
private static rect R
static method add takes real x1, real y1, real x2, real y2, real dmg, unit caster, boolean hitAlly, boolean hitCaster returns nothing
local unit u
local player p = GetOwningPlayer(caster)
set R = Rect(x1, y1, x2, y2)
call GroupEnumUnitsInRect(G, R, null)
if not hitCaster then
call GroupRemoveUnit(G, caster)
endif
loop
set u = FirstOfGroup(G)
exitwhen u == null
call GroupRemoveUnit(G,u)
if hitAlly or IsUnitEnemy(u, p) then
call UnitDamageTarget(caster, u, dmg, true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
endif
endloop
set p = null
call RemoveRect(R)
set R = null
endmethod
private static method onInit takes nothing returns nothing
set G = CreateGroup()
endmethod
endstruct
endlibrary
call LineDamage.add(x1, y1, x2, y2, damage, caster, hitally, hitcaster)
A
|----------------------------------------|
| |
|----------------------------------------|B
library LineDamage
struct LineDamage extends array
private static group G
private static rect R
static method add takes real x1, real y1, real x2, real y2, real dmg, unit caster, boolean hitAlly, boolean hitCaster, attacktype a_type, damagetype d_type returns nothing
local unit u
local player p = GetOwningPlayer(caster)
set R = Rect(x1, y1, x2, y2)
call GroupEnumUnitsInRect(G, R, null)
if not hitCaster then
call GroupRemoveUnit(G, caster)
endif
loop
set u = FirstOfGroup(G)
exitwhen u == null
call GroupRemoveUnit(G,u)
if hitAlly or IsUnitEnemy(u, p) then
call UnitDamageTarget(caster, u, dmg, true, false, a_type, d_type, null)
endif
endloop
set p = null
call RemoveRect(R)
set R = null
endmethod
private static method onInit takes nothing returns nothing
set G = CreateGroup()
endmethod
endstruct
endlibrary
call LineDamage.add(x1,y1,x2,y2,dmg,caster,hitAlly,hitCaster,a_type,d_type)call LineDamage.add(x1, y1, x2, y2, caster, dummy, line_sfx, hitAlly)