• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Help me! JAWS are eating me.

Status
Not open for further replies.
JASS:
                if udg_TempInteger == 4 then
                set udg_TempInteger = S2I(SubString(s, 1, 1))
                call UnitAddAbility( u, 'A04S' )
                call SetUnitAbilityLevel( u, 'A04S', i )
                set udg_TempInteger = S2I(SubString(u, 2, 2))
                if udg_TempInteger > 0 then
                    call UnitAddAbility( u, 'A04R' )
                    call SetUnitAbilityLevel( u, 'A04R', i )
                else
                    call UnitRemoveAbility( u, 'A04R' )
                endif
                set udg_TempInteger = S2I(SubString(u, 3, 3))
                if udg_TempInteger > 0 then
                    call UnitAddAbility( u, 'A04Q' )
                    call SetUnitAbilityLevel( u, 'A04Q', i )
                else
                    call UnitRemoveAbility(u, 'A04Q' )
                endif
                set udg_TempInteger = S2I(SubString(s, 4, 4))
                if udg_TempInteger > 0 then
                    call UnitAddAbility( u, 'A04P' )
                    call SetUnitAbilityLevel( u, 'A04P', i )
                else
                    call UnitRemoveAbility(u, 'A04P' )
                endif
    endif

Have you found my missing endblock? It's around here somewhere.
 
JASS:
                @if udg_TempInteger == 4 then@ //i guess this is the missing one
                set udg_TempInteger = S2I(SubString(s, 1, 1))
                call UnitAddAbility( u, 'A04S' )
                call SetUnitAbilityLevel( u, 'A04S', i )
                set udg_TempInteger = S2I(SubString(u, 2, 2))
                if udg_TempInteger > 0 then
                    call UnitAddAbility( u, 'A04R' )
                    call SetUnitAbilityLevel( u, 'A04R', i )
                else
                    call UnitRemoveAbility( u, 'A04R' )
                endif
                set udg_TempInteger = S2I(SubString(u, 3, 3))
                if udg_TempInteger > 0 then
                    call UnitAddAbility( u, 'A04Q' )
                    call SetUnitAbilityLevel( u, 'A04Q', i )
                else
                    call UnitRemoveAbility(u, 'A04Q' )
                endif
                set udg_TempInteger = S2I(SubString(s, 4, 4))
                if udg_TempInteger > 0 then
                    call UnitAddAbility( u, 'A04P' )
                    call SetUnitAbilityLevel( u, 'A04P', i )
                else
                    call UnitRemoveAbility(u, 'A04P' )
                endif
    endif
 
JASS:
                @if i == 4 then@ //i guess this is the missing one
                set i = S2I(SubString(s, 1, 1))
                call UnitAddAbility( u, 'A04S' )
                call SetUnitAbilityLevel( u, 'A04S', i )
                set i = S2I(SubString(u, 2, 2))
                if i > 0 then
                    call UnitAddAbility( u, 'A04R' )
                    call SetUnitAbilityLevel( u, 'A04R', i )
                else
                    call UnitRemoveAbility( u, 'A04R' )
                endif
                set i = S2I(SubString(u, 3, 3))
                if i > 0 then
                    call UnitAddAbility( u, 'A04Q' )
                    call SetUnitAbilityLevel( u, 'A04Q', i )
                else
                    call UnitRemoveAbility(u, 'A04Q' )
                endif
                set i = S2I(SubString(s, 4, 4))
                if i > 0 then
                    call UnitAddAbility( u, 'A04P' )
                    call SetUnitAbilityLevel( u, 'A04P', i )
                else
                    call UnitRemoveAbility(u, 'A04P' )
                endif
    endif
 
Now that you mentioned it, please add speed increment! And that line damage will be director's cut.
Ooh I hope there's no argument limit, but in a boolean, can you make line sfx scale with area increment?

And also boolean to filter structures or not. Line sfx size.
If there is an argument limit, then can you do it like KB3D does? Not really hash but that epic config.
 
unit Caster, real X1/2, real Y1/2, real Damage, integer FunctionInt(*), str Line Sfx, Bool LineSfx scales with area, real Area, real Speed, real Area inc per interval, real speed inc per interval, Dummy, bool HitAlly, bool HitEnemy, bool HitCaster, bool HitStructures, Dmg/Atk Type, bool Dummy scales with area, real interval (per speed apply), bool Dummymoves along, str target unit sfx, bool hit unit more than once, bool dummy killatend.

*I need it for the damage mod to detect damage type. No need to do anything with it.

Thanks.
 
Can you write this in lJASS tags please ?
And for each argument explain what they does like this :
- unit caster -> The damager
- real x1 -> The x of the start position
- real y1 -> The y of the start position
- real x2 -> The x of the end position
- real y2 -> The y of the end position
- real dmg -> The damage of the missile
- integer functionInt -> Didn't understand
- string LineSfx -> The effect during the line
- boolean LineSfxScale -> Didn't understand
- real area -> The area of effect
- real Speed -> The speed in unit/second
- real Area inc per interval -> The increment of the area of effect per interval
- real speed inc per interval -> The speed of the missile per interval
- dummy ??
- boolean hitAlly -> Hit ally
- boolean hitEnemy -> Hit enemy
- boolean hitCaster -> Hit the caster
- boolean hitStructures -> Hit the structures
- attacktype a_type -> The attack type
- damagetype d_type -> The damage type
- boolean Dummy scale -> ?
- real interval ->
- boolean DummyMovesAlong -> ?
- string target unit sfx -> For the dummy ?
- boolean hitUnitMoreThanOnce -> With which interval ?
- boolean killatend -> Ok.
 
JASS:
unit dummy ->// possibly moved along the line damage to show that units are damaged. Different from Line SFX since Line SFX is repetitive, and dummy moves(or not)

integer functionInt ->// I'll do this part, just please add it as an argument

real interval->// the interval between each line's movement, for example is 0.03

boolean hitunitmorethanonce ->// ^interval

string targetsfx ->// on units hit
boolean dummy scale - >// If the dummy scales with the area increment
boolean linesfxscale - >// if line sfx scales with area increment

boolean dummy moves along ->// If the dummy is moved along the line damage, or has a 'moving' animation and stays at caster pos.(example: firebreaths)
 
Not to rush, but how's it going?

And I don't know why, but my libraries don't work.

JASS:
library HeroGrowth initializer AddTrigger requires AddProperties
    globals
        public integer array HeroType
        public integer HeroIndex
        public integer array ManaPerLevel
        public integer array HealthPerLevel
        //PlayerSpecific variables
        public integer array ManaStored
        public integer array HealthStored
        //External use
        public integer LvlInt
        public string LvlStr
    endglobals
    
    private function Init takes nothing returns boolean
        //Aeromancer
        set HeroType[HeroIndex] = 'H00K'
        set ManaPerLevel[HeroIndex] = 26
        set HealthPerLevel[HeroIndex] = 40
        set HeroIndex = HeroIndex + 1
        //Angel of Justice
        set HeroType[HeroIndex] = 'H012'
        set ManaPerLevel[HeroIndex] = 10
        set HealthPerLevel[HeroIndex] = 50
        set HeroIndex = HeroIndex + 1
        //Berserker
        set HeroType[HeroIndex] = 'H00N'
        set ManaPerLevel[HeroIndex] = 22
        set HealthPerLevel[HeroIndex] = 45
        set HeroIndex = HeroIndex + 1
        //return null
        //Null isn't a boolean bro !
        return false
    endfunction
    
    public function LevelingBonuses takes nothing returns boolean
        local integer a = -1
        local integer b = GetPlayerId(GetOwningPlayer(GetLevelingUnit()))
        loop
        set a = a + 1
        exitwhen a > HeroIndex
        if HeroType[HeroIndex] == GetUnitTypeId(GetLevelingUnit()) then
            set ManaStored[b] = ManaStored[b] + ManaPerLevel[a]
            set HealthStored[b] = HealthStored[b] + HealthPerLevel[a]
            set LvlStr = I2S(ManaStored[b])
            set LvlStr = I2S(HealthStored[b])
            set LvlInt = StringLength(LvlStr)
            call AddHealth(LvlStr, LvlInt, GetLevelingUnit())
        endif
        endloop
        return false
    endfunction
    
    private function AddTrigger takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterTimerEvent(t, 0.00, false)
        call TriggerAddCondition( t, Condition( function Init))
        set t = null
        set t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_HERO_LEVEL)
        call TriggerAddCondition( t, Condition( function LevelingBonuses))
        set t = null
    endfunction
endlibrary

JASS:
library AddProperties
    
    function AddHealth takes string s, integer i, unit u returns nothing
    call UnitRemoveAbility(u, 'A04P')
    call UnitRemoveAbility(u, 'A04Q')
    call UnitRemoveAbility(u, 'A04R')
    call UnitRemoveAbility(u, 'A04S')
    if i == 1 then
        set i = S2I(s)
        call UnitAddAbility(u,  'A04P' )
        call SetUnitAbilityLevel(u, 'A04P', i )
    else
        if i == 2 then
            set i = S2I(SubString(s, 1, 1))
            call UnitAddAbility( u, 'A04Q' )
            call SetUnitAbilityLevel(u, 'A04Q', i )
            set i = S2I(SubString(s, 2, 2))
            if i > 0 then
                call UnitAddAbility(u, 'A04P' )
                call SetUnitAbilityLevel(u, 'A04P', i )
            else
                call UnitRemoveAbility( u, 'A04P' )
            endif
        else
            if i == 3 then
                set i = S2I(SubString(s, 1, 1))
                call UnitAddAbility( u, 'A04R' )
                call SetUnitAbilityLevel( u, 'A04R', i )
                set i = S2I(SubString(s, 2, 2))
                if i > 0 then
                    call UnitAddAbility( u, 'A04Q' )
                    call SetUnitAbilityLevel( u, 'A04Q', i )
                else
                    call UnitRemoveAbility( u, 'A04Q' )
                endif
                set i = S2I(SubString(s, 3, 3))
                if i > 0 then
                    call UnitAddAbility( u, 'A04P' )
                    call SetUnitAbilityLevel( u, 'A04P', i )
                else
                    call UnitRemoveAbility(u, 'A04P' )
                endif
            else
                if i == 4 then
                    set i = S2I(SubString(s, 1, 1))
                    call UnitAddAbility( u, 'A04S' )
                    call SetUnitAbilityLevel( u, 'A04S', i )
                    set i = S2I(SubString(s, 2, 2))
                    if i > 0 then
                        call UnitAddAbility( u, 'A04R' )
                        call SetUnitAbilityLevel( u, 'A04R', i )
                    else
                        call UnitRemoveAbility( u, 'A04R' )
                    endif
                    set i = S2I(SubString(s, 3, 3))
                    if i > 0 then
                    call UnitAddAbility( u, 'A04Q' )
                    call SetUnitAbilityLevel( u, 'A04Q', i )
                    else
                    call UnitRemoveAbility(u, 'A04Q' )
                    endif
                    set i = S2I(SubString(s, 4, 4))
                    if i > 0 then
                    call UnitAddAbility( u, 'A04P' )
                    call SetUnitAbilityLevel( u, 'A04P', i )
                    else
                    call UnitRemoveAbility(u, 'A04P' )
                    endif
                endif
            endif
        endif
    endif
endfunction

    function AddAquaStride takes string s, integer i, unit u returns nothing
    call UnitRemoveAbility(u, 'A051')
    call UnitRemoveAbility(u, 'A052')
    call UnitRemoveAbility(u, 'A053')
    call UnitRemoveAbility(u, 'A055')
    if i == 1 then
        set i = S2I(s)
        call UnitAddAbility(u,  'A051' )
        call SetUnitAbilityLevel(u, 'A051', i )
    else
        if i == 2 then
            set i = S2I(SubString(s, 1, 1))
            call UnitAddAbility( u, 'A052' )
            call SetUnitAbilityLevel(u, 'A052', i )
            set i = S2I(SubString(s, 2, 2))
            if i > 0 then
                call UnitAddAbility(u, 'A051' )
                call SetUnitAbilityLevel(u, 'A051', i )
            else
                call UnitRemoveAbility( u, 'A051' )
            endif
        else
            if i == 3 then
                set i = S2I(SubString(s, 1, 1))
                call UnitAddAbility( u, 'A053' )
                call SetUnitAbilityLevel( u, 'A053', i )
                set i = S2I(SubString(s, 2, 2))
                if i > 0 then
                    call UnitAddAbility( u, 'A052' )
                    call SetUnitAbilityLevel( u, 'A052', i )
                else
                    call UnitRemoveAbility( u, 'A052' )
                endif
                set i = S2I(SubString(s, 3, 3))
                if i > 0 then
                    call UnitAddAbility( u, 'A051' )
                    call SetUnitAbilityLevel( u, 'A051', i )
                else
                    call UnitRemoveAbility(u, 'A051' )
                endif
            else
                if i == 4 then
                    set i = S2I(SubString(s, 1, 1))
                    call UnitAddAbility( u, 'A055' )
                    call SetUnitAbilityLevel( u, 'A055', i )
                    set i = S2I(SubString(s, 2, 2))
                    if i > 0 then
                        call UnitAddAbility( u, 'A053' )
                        call SetUnitAbilityLevel( u, 'A053', i )
                    else
                        call UnitRemoveAbility( u, 'A053' )
                    endif
                    set i = S2I(SubString(s, 3, 3))
                    if i > 0 then
                    call UnitAddAbility( u, 'A052' )
                    call SetUnitAbilityLevel( u, 'A052', i )
                    else
                    call UnitRemoveAbility(u, 'A052' )
                    endif
                    set i = S2I(SubString(s, 4, 4))
                    if i > 0 then
                    call UnitAddAbility( u, 'A051' )
                    call SetUnitAbilityLevel( u, 'A051', i )
                    else
                    call UnitRemoveAbility(u, 'A051' )
                    endif
                endif
            endif
        endif
    endif
endfunction

endlibrary

JASS:
library SiegeWeapons initializer AddTrigger
    globals
    public integer array SiegeCounter
    endglobals
function SiegeSpawnC takes nothing returns boolean
    if udg_GameOver == false then
        return false
    endif
    return true
endfunction

function SiegeSpawn takes nothing returns nothing
    //Creeps Upgrades
    call SetPlayerTechResearched(Player(9), 'R000', ( GetPlayerTechCount(Player(9), 'R000', true ) ) )
    call SetPlayerTechResearched(Player(9), 'R001', ( GetPlayerTechCount(Player(9), 'R001', true ) ) )
    call SetPlayerTechResearched(Player(11), 'R000', ( GetPlayerTechCount(Player(11), 'R000', true ) ) )
    call SetPlayerTechResearched(Player(11), 'R001', ( GetPlayerTechCount(Player(11), 'R001', true ) ) )
    //Siege Upgrades
    if SiegeCounter[1] > 0 then
    call SetPlayerTechResearched(Player(9), 'R003', ( GetPlayerTechCount(Player(9), 'R003', true ) ) )
    call SetPlayerTechResearched(Player(9), 'R004', ( GetPlayerTechCount(Player(9), 'R004', true ) ) )
    if GetPlayerTechCount(Player(9), 'R003', true) > 4 and GetPlayerTechCount(Player(9), 'R004', true) > 4 then
    call CreateUnit( Player(9), 'h00V', 6275.00, 2900.00, GetRandomReal(0.00, 360.00) )
    else
    call CreateUnit( Player(9), 'h00A', 6275.00, 2900.00, GetRandomReal(0.00, 360.00) )
    endif
    call IssuePointOrder(bj_lastCreatedUnit, "attack", -4200.00, 2300.00) 
    endif
    if SiegeCounter[2] > 0 then
    call SetPlayerTechResearched(Player(11), 'R003', ( GetPlayerTechCount(Player(11), 'R003', true ) ) )
    call SetPlayerTechResearched(Player(11), 'R004', ( GetPlayerTechCount(Player(11), 'R004', true ) ) )
    if GetPlayerTechCount(Player(11), 'R003', true) > 4 and GetPlayerTechCount(Player(11), 'R004', true) > 4 then
    call CreateUnit( Player(11), 'h016', 2100.00, 1100.00, GetRandomReal(0.00, 360.00) )
    else
    call CreateUnit( Player(11), 'h00M', 2100.00, 1100.00, GetRandomReal(0.00, 360.00) )
    endif
    call IssuePointOrder(bj_lastCreatedUnit, "attack", 250.00, 1500.00) 
    endif
    // ------------------------------
endfunction

private function BuyItems takes nothing returns nothing
    if GetItemTypeId(GetManipulatedItem()) == 'I01J' then
        if IsPlayerAlly(GetOwningPlayer(GetManipulatingUnit()), Player(9)) then
        set SiegeCounter[1] = SiegeCounter[1] + 1
        else
        set SiegeCounter[2] = SiegeCounter[2] + 1
        endif
    else
        if GetItemTypeId(GetManipulatedItem()) == 'I01L' then
            if IsPlayerAlly(GetOwningPlayer(GetManipulatingUnit()), Player(9)) then
                call SetPlayerTechResearched(Player(9), 'R004', ( GetPlayerTechCount(Player(9), 'R004', true ) ) )
            else
                call SetPlayerTechResearched(Player(11), 'R004', ( GetPlayerTechCount(Player(11), 'R004', true ) ) )
            endif
        else
            if GetItemTypeId(GetManipulatedItem()) == 'I01K' then
                if IsPlayerAlly(GetOwningPlayer(GetManipulatingUnit()), Player(9)) then
                  call SetPlayerTechResearched(Player(9), 'R003', ( GetPlayerTechCount(Player(9), 'R003', true ) ) )
                else
                  call SetPlayerTechResearched(Player(11), 'R003', ( GetPlayerTechCount(Player(11), 'R003', true ) ) )
                endif
            endif
        endif
    endif
endfunction

private function AddTrigger takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterTimerExpireEvent( t, udg_SiegeTimer )
    call TriggerAddCondition( t, Condition( function SiegeSpawnC ) )
    call TriggerAddAction( t, function SiegeSpawn )
    set t = null
    set t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_PICKUP_ITEM)
    call TriggerAddAction(t, function BuyItems)
    set t = null
endfunction

endlibrary


No error, but just doesn't do what it's expected to in-game.
 
JASS:
library HeroGrowth// requires AddProperties
    globals
        public integer array HeroType
        public integer HeroIndex
        public integer array ManaPerLevel
        public integer array HealthPerLevel
        //PlayerSpecific variables
        public integer array ManaStored
        public integer array HealthStored
        //External use
        public integer LvlInt
        public string LvlStr
    endglobals
    
    private struct Init extends array
        static method LevelingBonuses takes nothing returns boolean
            local integer a = -1
            local integer b = GetPlayerId(GetOwningPlayer(GetLevelingUnit()))
            loop
                set a = a + 1
                exitwhen a > HeroIndex
                if HeroType[HeroIndex] == GetUnitTypeId(GetLevelingUnit()) then
                    set ManaStored[b] = ManaStored[b] + ManaPerLevel[a]
                    set HealthStored[b] = HealthStored[b] + HealthPerLevel[a]
                    set LvlStr = I2S(ManaStored[b])
                    set LvlStr = I2S(HealthStored[b])
                    set LvlInt = StringLength(LvlStr)
                    call AddHealth(LvlStr, LvlInt, GetLevelingUnit())
                endif
            endloop
            return false
        endmethod
        
        static method onInit takes nothing returns nothing
            local trigger t = CreateTrigger()
            call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_HERO_LEVEL)
            call TriggerAddCondition( t, Condition( function thistype.LevelingBonuses))
            //Aeromancer
            set HeroType[HeroIndex] = 'H00K'
            set ManaPerLevel[HeroIndex] = 26
            set HealthPerLevel[HeroIndex] = 40
            set HeroIndex = HeroIndex + 1
            //Angel of Justice
            set HeroType[HeroIndex] = 'H012'
            set ManaPerLevel[HeroIndex] = 10
            set HealthPerLevel[HeroIndex] = 50
            set HeroIndex = HeroIndex + 1
            //Berserker
            set HeroType[HeroIndex] = 'H00N'
            set ManaPerLevel[HeroIndex] = 22
            set HealthPerLevel[HeroIndex] = 45
            set HeroIndex = HeroIndex + 1
            set t = null
        endmethod
    endstruct
endlibrary

I don't think you needed to call LevelingBonuses from outside the library.
 
Status
Not open for further replies.
Back
Top