modifying attribute points

jig7c

Stop reading me...-statement
Reaction score
123
i want it so that everytime a HERO kils a Neutral Hostile creep, the hero gains +2 to either Agi, Int, or Str, randomly picked and applied to hero's stats..

i could create a tome, but then the hero has to pick it up.. i don't want that...

how do i do it?
here is what i got so far?
i dont know if this is correct or not...

this is also my first JASS trigger, so i dont know if i did it correctly or not, most likely i didn't... but if someone can check up on it and let me know where i messed up, that would be great!

i know the conditions are not that good! but i dont' know how to write conditions, so i had to convert that from GUI!

using UnitProperties
JASS:
function Attribute_Conditions takes nothing returns boolean
    if ( not ( IsUnitEnemy(GetKillingUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) == true ) ) then
        return false
    endif
    if ( not ( IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    return true
endfunction

function Attribute_Actions takes nothing returns nothing
    local unit u //creating unit var for later use
    local integer i //creating integer for random attribute
    local texttag t = CreateTextTag () //floating text
    local integer a = 0 //attribute array start with 0
    local integer array Attribute //creating integer[array] for the attributes
    set Attribute[a+1] = bj_HEROSTAT_STR //setting array 1 to strenght
    set Attribute[a+2] = bj_HEROSTAT_AGI //setting array 2 to agility
    set Attribute[a+3] = bj_HEROSTAT_INT //setting array 3 to intellligence
    set u = GetKillingUnit //setting u to killing unit
    set i = Attribute[GetRandomInt(1,3)] //picking a random array to give bonus to
    //showing a floating text over killing unit, based on the bonus given!!
    //Strenght
    if (i == 1) then
    UnitModifyStr (u, 2) //adding the bonus
    set t = CreateTextTagUnitBJ(( "+2 Strenght", u, 0, 10, 100, 100, 100, 0 )
    call SetTextTagPermanent (t, false)
    call SetTextTagLifespan (t, 2.00)
    call SetTextTagVelocityBJ (t, 64, 90 )
    call SetTextTagFadepoint (t, 2.00 )
    endif
    //Agility
    if (i ==2) then
    UnitModifyAgi (u, 2) //adding the bonus
    set t = CreateTextTagUnitBJ(( "+2 Agility", u, 0, 10, 100, 100, 100, 0 )
    call SetTextTagPermanent (t, false)
    call SetTextTagLifespan (t, 2.00)
    call SetTextTagVelocityBJ (t, 64, 90 )
    call SetTextTagFadepoint (t, 2.00 )
    endif
    // Intelligence
    if (i ==3) then
    UnitModifyInt (u, 2) //adding the bonus
    set t = CreateTextTagUnitBJ(( "+2 Intelligence ", u, 0, 10, 100, 100, 100, 0 )
    call SetTextTagPermanent (t, false)
    call SetTextTagLifespan (t, 2.00)
    call SetTextTagVelocityBJ (t, 64, 90 )
    call SetTextTagFadepoint (t, 2.00 )
    endif
    set u = null //removing unit from var
endfunction

//===========================================================================
function InitTrig_Jass takes nothing returns nothing
    set t = CreateTrigger()
    call TriggerRegisterPlayerUnitEventSimple( t, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition(t, function Attribute_Conditions)
    call TriggerAddAction( t, function Attribute_Actions)
endfunction
 

Komaqtion

You can change this now in User CP.
Reaction score
469
This should work for you...

JASS:
function Attribute_Conditions takes nothing returns boolean
    return IsUnitEnemy(GetKillingUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) and IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO)
endfunction

function Attribute_Actions takes nothing returns nothing
    local unit u = GetKillingUnit()
    local integer i //creating integer for random attribute
    local texttag t = CreateTextTag () //floating text
    local integer a = 0 //attribute array start with 0
    local integer array Attribute //creating integer[array] for the attributes
    
    set Attribute[a+1] = bj_HEROSTAT_STR //setting array 1 to strenght
    set Attribute[a+2] = bj_HEROSTAT_AGI //setting array 2 to agility
    set Attribute[a+3] = bj_HEROSTAT_INT //setting array 3 to intellligence
    set i = Attribute[GetRandomInt(1,3)] //picking a random array to give bonus to
    //showing a floating text over killing unit, based on the bonus given!!
    
    //Strenght
    
    if (i == 1) then
        call UnitModifyStr(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 0, 10 )
        call SetTextTagText( t, "+2 Strength", 0.023 )
        call SetTextTagColor( t, 255, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif
    
    //Agility
    
    if (i == 2) then
        call UnitModifyAgi(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 0, 10 )
        call SetTextTagText( t, "+2 Agility", 0.023 )
        call SetTextTagColor( t, 255, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif
    
    // Intelligence
    
    if (i == 3) then
        call UnitModifyStr(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 0, 10 )
        call SetTextTagText( t, "+2 Intelligence", 0.023 )
        call SetTextTagColor( t, 255, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif

    set u = null //removing unit from var
endfunction

//===========================================================================
function InitTrig_Jass takes nothing returns nothing
    local trigger t = CreateTrigger()
    
    // set t = CreateTrigger() &lt;=== An error here, &quot;t&quot; was never declared, as above <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink    ;)" loading="lazy" data-shortname=";)" />
    
    call TriggerRegisterPlayerUnitEvent( t, Player( 12 ), EVENT_PLAYER_UNIT_DEATH, null )
    call TriggerAddCondition( t, function Attribute_Conditions )
    call TriggerAddAction( t, function Attribute_Actions )
endfunction
 

jig7c

Stop reading me...-statement
Reaction score
123
>komaqtion
would you say that my jass script is any good for it being my very first Jass script...
im so excited about this now!!

p.s. thanks for fixing it!

edit: i have modified the code again!
see if this is better than the previous post!
JASS:
function Attribute_Conditions takes nothing returns boolean
    return IsUnitEnemy(GetKillingUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) and IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO)
endfunction

function Attribute_Actions takes nothing returns nothing
    local unit u = GetKillingUnit()
    local integer i = GetRandomInt(1,4)//creating integer for random attribute
    local texttag t = CreateTextTag () //floating text
    //showing a floating text over killing unit, based on the bonus given!!
    
    //Strenght
    
    if (i == 1) then
        call UnitModifyStr(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 0, 10 )
        call SetTextTagText( t, &quot;+2 Strength&quot;, 0.023 )
        call SetTextTagColor( t, 255, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif
    
    //Agility
    
    if (i == 2) then
        call UnitModifyAgi(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 0, 10 )
        call SetTextTagText( t, &quot;+2 Agility&quot;, 0.023 )
        call SetTextTagColor( t, 255, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif
    
    // Intelligence
    
    if (i == 3) then
        call UnitModifyInt(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 0, 10 )
        call SetTextTagText( t, &quot;+2 Intelligence&quot;, 0.023 )
        call SetTextTagColor( t, 255, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif

    if (i == 4) then
        call UnitModifyStr (u, 1)
        call UnitModifyAgi (u, 1)
        call UnitModifyInt (u, 1)
        call SetTextTagPosUnit( t, u, 0, 10 )
        call SetTextTagText( t, &quot;+1 All Stats&quot;, 0.023 )
        call SetTextTagColor( t, 255, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif
    
    set u = null //removing unit from var
endfunction

//===========================================================================
function InitTrig_Attribute takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerUnitEvent( t, Player( 12 ), EVENT_PLAYER_UNIT_DEATH, null )
    call TriggerAddCondition( t, function Attribute_Conditions )
    call TriggerAddAction( t, function Attribute_Actions )
endfunction
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, sure ;)
That looks better too me ;)
(Not that much, but a little ;))
 

tooltiperror

Super Moderator
Reaction score
231
i want it so that everytime a HERO kils a Neutral Hostile creep, the hero gains +2 to either Agi, Int, or Str, randomly picked and applied to hero's stats..

i could create a tome, but then the hero has to pick it up.. i don't want that...

how do i do it?
here is what i got so far?
i dont know if this is correct or not...

this is also my first JASS trigger, so i dont know if i did it correctly or not, most likely i didn't... but if someone can check up on it and let me know where i messed up, that would be great!

i know the conditions are not that good! but i dont' know how to write conditions, so i had to convert that from GUI!

using UnitProperties
JASS:

function Attribute_Conditions takes nothing returns boolean
    if ( not ( IsUnitEnemy(GetKillingUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) == true ) ) then
        return false
    endif
    if ( not ( IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    return true
endfunction

function Attribute_Actions takes nothing returns nothing
    local unit u //creating unit var for later use
    local integer i //creating integer for random attribute
    local texttag t = CreateTextTag () //floating text
    local integer a = 0 //attribute array start with 0
    local integer array Attribute //creating integer[array] for the attributes
    set Attribute[a+1] = bj_HEROSTAT_STR //setting array 1 to strenght
    set Attribute[a+2] = bj_HEROSTAT_AGI //setting array 2 to agility
    set Attribute[a+3] = bj_HEROSTAT_INT //setting array 3 to intellligence
    set u = GetKillingUnit //setting u to killing unit
    set i = Attribute[GetRandomInt(1,3)] //picking a random array to give bonus to
    //showing a floating text over killing unit, based on the bonus given!!
    //Strenght
    if (i == 1) then
    UnitModifyStr (u, 2) //adding the bonus
    set t = CreateTextTagUnitBJ(( &quot;+2 Strenght&quot;, u, 0, 10, 100, 100, 100, 0 )
    call SetTextTagPermanent (t, false)
    call SetTextTagLifespan (t, 2.00)
    call SetTextTagVelocityBJ (t, 64, 90 )
    call SetTextTagFadepoint (t, 2.00 )
    endif
    //Agility
    if (i ==2) then
    UnitModifyAgi (u, 2) //adding the bonus
    set t = CreateTextTagUnitBJ(( &quot;+2 Agility&quot;, u, 0, 10, 100, 100, 100, 0 )
    call SetTextTagPermanent (t, false)
    call SetTextTagLifespan (t, 2.00)
    call SetTextTagVelocityBJ (t, 64, 90 )
    call SetTextTagFadepoint (t, 2.00 )
    endif
    // Intelligence
    if (i ==3) then
    UnitModifyInt (u, 2) //adding the bonus
    set t = CreateTextTagUnitBJ(( &quot;+2 Intelligence &quot;, u, 0, 10, 100, 100, 100, 0 )
    call SetTextTagPermanent (t, false)
    call SetTextTagLifespan (t, 2.00)
    call SetTextTagVelocityBJ (t, 64, 90 )
    call SetTextTagFadepoint (t, 2.00 )
    endif
    set u = null //removing unit from var
endfunction

//===========================================================================
function InitTrig_Jass takes nothing returns nothing
    set t = CreateTrigger()
    call TriggerRegisterPlayerUnitEventSimple( t, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition(t, function Attribute_Conditions)
    call TriggerAddAction( t, function Attribute_Actions)
endfunction

You used about 5 BJ's. You should really remove them.
 

jig7c

Stop reading me...-statement
Reaction score
123
>ToolTipError
>Laiev
look at this post and then tell me if this jass script is better than the one in the first one...

the BJs are removed...
 

tooltiperror

Super Moderator
Reaction score
231
Code:
function Attribute_Conditions takes nothing returns boolean
    return  IsUnitEnemy(GetKillingUnit(), 
endfunction
 

the Immortal

I know, I know...
Reaction score
51
You can shorten the code further by taking most of the TextTag-related functions out of the 'if's since they are the same for all cases.
Also, use elseif instead of endif .. if, since i cannot be both 1 and 2 for ex.
The texttag var should be nulled as well, afaik.

Final result should be something like this:
JASS:
function Attribute_Conditions takes nothing returns boolean
    return IsUnitEnemy(GetKillingUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) and IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO)
endfunction

function Attribute_Actions takes nothing returns nothing
    local unit u = GetKillingUnit()
    local integer i = GetRandomInt(1,4)//creating integer for random attribute
    local texttag t = CreateTextTag () //floating text

    //showing a floating text over killing unit, based on the bonus given!!

    if (i == 1) then        //Strength
        call UnitModifyStr(u, 2) //adding the bonus
        call SetTextTagText( t, &quot;+2 Strength&quot;, 0.023 )
    elseif (i == 2) then    //Agility
        call UnitModifyAgi(u, 2) //adding the bonus
        call SetTextTagText( t, &quot;+2 Agility&quot;, 0.023 )
    elseif (i == 3) then    // Intelligence
        call UnitModifyInt(u, 2) //adding the bonus
        call SetTextTagText( t, &quot;+2 Intelligence&quot;, 0.023 )
    elseif (i == 4) then    // All
        call UnitModifyStr (u, 1)
        call UnitModifyAgi (u, 1)
        call UnitModifyInt (u, 1)
        call SetTextTagText( t, &quot;+1 All Stats&quot;, 0.023 )
    endif
    
    call SetTextTagPosUnit( t, u, 0, 10 )
    call SetTextTagColor( t, 255, 255, 255, 0 )
    call SetTextTagPermanent (t, false)
    call SetTextTagLifespan (t, 2.00)
    call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
    call SetTextTagFadepoint (t, 2.00 )

    set t = null
    set u = null //removing unit from var
endfunction

//===========================================================================
function InitTrig_Attribute takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerUnitEvent( t, Player( 12 ), EVENT_PLAYER_UNIT_DEATH, null )
    call TriggerAddCondition( t, function Attribute_Conditions )
    call TriggerAddAction( t, function Attribute_Actions )
endfunction
 

Laiev

Hey Listen!!
Reaction score
188
you can make all the texttags a private function and just call it inside each other, just make 5 or 6 call in one.
 

jig7c

Stop reading me...-statement
Reaction score
123
i don't know how to use private/public constants/functions...

like i said, this is my very first jass script!
 

Laiev

Hey Listen!!
Reaction score
188
i don't know how to use private/public constants/functions...

like i said, this is my very first jass script!

private function is like... just that trigger will got, no matter what you do, you can't call that trigger, so you can use any name of that function..

public function is like... a normal function, but with a prefix of the library/scope name. example:

JASS:
scope hey
public function bye takes nothing returns nothing
endfunction
endscope


JASS:
function test takes nothing returns nothing
    call hey_bye
endfunction


hey = name of scope/library
bye = name of function

PS: this is just a example -.- noone need to fix it, kthx :rolleyes:

constant is what name say, constant, never change, the value will be ever that what you set/do.

just a add... private/public function just is allowed inside scope or library
 

jig7c

Stop reading me...-statement
Reaction score
123
here is my trigger, and it is still not working..
whats seem to be the problem...


JASS:
function Attribute_Conditions takes nothing returns boolean
    return IsUnitEnemy(GetKillingUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) and IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO)
endfunction

function Attribute_Actions takes nothing returns nothing
    local unit u = GetKillingUnit()
    local integer i = GetRandomInt(1,4)//creating integer for random attribute
    local texttag t = CreateTextTag () //floating text
    //showing a floating text over killing unit, based on the bonus given!!
    
    //Strenght
    
    if (i == 1) then
        call UnitModifyStr(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+2 Strength&quot;, 0.023 )
        call SetTextTagColor( t, 10, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    elseif (i == 2) then//Agility
        call UnitModifyAgi(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+2 Agility&quot;, 0.023 )
        call SetTextTagColor( t, 255, 10, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    elseif (i == 3) then  // Intelligence
        call UnitModifyInt(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+2 Intelligence&quot;, 0.023 )
        call SetTextTagColor( t, 255, 255, 10, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    elseif (i == 4) then //All Stats
        call UnitModifyStr (u, 1)
        call UnitModifyAgi (u, 1)
        call UnitModifyInt (u, 1)
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+1 All Stats&quot;, 0.023 )
        call SetTextTagColor( t, 200, 10, 50, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif
    
    set u = null //removing unit from var
    set t = null
endfunction

//===========================================================================
function Init takes nothing returns nothing
    local trigger k = CreateTrigger()
    call TriggerRegisterPlayerUnitEvent( k, Player( 12 ), EVENT_PLAYER_UNIT_DEATH, null )
    call TriggerAddCondition( k, Condition( function Attribute_Conditions) )
    call TriggerAddAction( k, function Attribute_Actions )
endfunction
 

Lehona

New Member
Reaction score
12
Your trigger is not initialized correctly - you need a scope (Or name the init-function: "InitTrig_<Triggername>" (iirc)). Do it like this:

JASS:
scope AttributeModifier initializer Init
function Attribute_Conditions takes nothing returns boolean
    return IsUnitEnemy(GetKillingUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE)) and IsUnitType(GetKillingUnit(), UNIT_TYPE_HERO)
endfunction

function Attribute_Actions takes nothing returns nothing
    local unit u = GetKillingUnit()
    local integer i = GetRandomInt(1,4)//creating integer for random attribute
    local texttag t = CreateTextTag () //floating text
    //showing a floating text over killing unit, based on the bonus given!!
    
    //Strenght
    
    if (i == 1) then
        call UnitModifyStr(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+2 Strength&quot;, 0.023 )
        call SetTextTagColor( t, 10, 255, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    elseif (i == 2) then//Agility
        call UnitModifyAgi(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+2 Agility&quot;, 0.023 )
        call SetTextTagColor( t, 255, 10, 255, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    elseif (i == 3) then  // Intelligence
        call UnitModifyInt(u, 2) //adding the bonus
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+2 Intelligence&quot;, 0.023 )
        call SetTextTagColor( t, 255, 255, 10, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    elseif (i == 4) then //All Stats
        call UnitModifyStr (u, 1)
        call UnitModifyAgi (u, 1)
        call UnitModifyInt (u, 1)
        call SetTextTagPosUnit( t, u, 10 )
        call SetTextTagText( t, &quot;+1 All Stats&quot;, 0.023 )
        call SetTextTagColor( t, 200, 10, 50, 0 )
        call SetTextTagPermanent (t, false)
        call SetTextTagLifespan (t, 2.00)
        call SetTextTagVelocity( t, 0.0355 * Cos( 90. * bj_DEGTORAD ), 0.0355 * Sin( 90. * bj_DEGTORAD ) )
        call SetTextTagFadepoint (t, 2.00 )
    endif
    
    set u = null //removing unit from var
    set t = null
endfunction

//===========================================================================
function Init takes nothing returns nothing
    local trigger k = CreateTrigger()
    call TriggerRegisterPlayerUnitEvent( k, Player( 12 ), EVENT_PLAYER_UNIT_DEATH, null )
    call TriggerAddCondition( k, Condition( function Attribute_Conditions) )
    call TriggerAddAction( k, function Attribute_Actions )
endfunction
endscope


(Didn't look over the code, though)
 

jig7c

Stop reading me...-statement
Reaction score
123
it says, when saving the map..

Unable to find initializer: Init

and the endscope line is highlighted..
 

Laiev

Hey Listen!!
Reaction score
188
update your jasshelper?

here just get syntax error of those call function "UnitModifyX" etc.
 
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