jig7c
Stop reading me...-statement
- Reaction score
- 123
bump!
it is still not working.. what am i missing?
neither is the attribute point being added, nor is the text coming up
it is still not working.. what am i missing?
neither is the attribute point being added, nor is the text coming up
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, "+2 Strength", 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, "+2 Agility", 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, "+2 Intelligence", 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, "+1 All Stats", 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 t = CreateTrigger()
call TriggerRegisterPlayerUnitEvent( t, Player( 12 ), EVENT_PLAYER_UNIT_DEATH, null )
call TriggerAddCondition( t, Condition( function Attribute_Conditions) )
call TriggerAddAction( t, function Attribute_Actions )
endfunction
endscope