- Joined
- May 4, 2007
- Messages
- 2,260
Hi again. I have a problem with my spell which i will post now:
The objective of the spell is:
- level 1: Every time the hero attacks, he has 5% chance to gain 3 additional ability stats. Lasts for 5 seconds.
- level 2: Every time the hero attacks, he has 7% chance to gain 6 additional ability stats. Lasts for 10 seconds.
- level 3: Every time the hero attacks, he has 10% chance to gain 9 additional ability stats. Lasts for 15 seconds.
I used as much formulas as i could and used the texttag properly ( i think, i tried to do the same thing PurplePoot told in my last post about tags)
I also tried to removed all BJ's, but in this case i couldn't do so, i have at least 2 BJ's that change the hero stats and i don't understand how to change them.
Anyway, the problem is that my spell DOES NOT work ... and i don't know why .... can some1 please tell me what is wrong ?
The JassCrasft program i use points no errors ...
JASS:
function SpeedThurst_Conds takes nothing returns boolean
return GetSpellAbilityId () == 'AHbh'
endfunction
//=======================================================
function SpeedThurst_Acts takes nothing returns nothing
local unit attacker = GetAttacker()
local effect e = AddSpecialEffectTarget("origin", attacker, "Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl")
local integer stats
local integer Time = 5*GetUnitAbilityLevel( attacker, 'AHbh' )
local texttag Bonus = CreateTextTag()
if GetUnitAbilityLevel( GetAttacker(), 'AHbh' ) == 1 and 5 >= GetRandomInt(1, 100) then
set stats = 3
elseif GetUnitAbilityLevel( GetAttacker(), 'AHbh' ) == 2 and 7 >= GetRandomInt(1, 100) then
set stats = 6
elseif GetUnitAbilityLevel( GetAttacker(), 'AHbh' ) == 3 and 10 >= GetRandomInt(1, 100) then
set stats = 9
endif
call SetTextTagText(Bonus, "+" + "stats", .023 )
call SetTextTagPosUnit( Bonus, attacker, 0 )
call SetTextTagColor( Bonus, 10, 100, 100, 255 )
call ModifyHeroStat( bj_HEROSTAT_AGI, attacker, bj_MODIFYMETHOD_ADD, stats )
call SetTextTagPermanent(Bonus, false)
call SetTextTagVelocity( Bonus, 0, .0277 )
call TriggerSleepAction(2.00)
call DestroyTextTag(Bonus)
call DestroyEffect(e)
call TriggerSleepAction( Time )
call ModifyHeroStat( bj_HEROSTAT_AGI, attacker, bj_MODIFYMETHOD_SUB, stats )
set attacker = null
set e = null
set Bonus = null
set e = null
endfunction
//===========================================================================
function InitTrig_Speed_Thurst takes nothing returns nothing
local trigger SpeedThurst = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( SpeedThurst, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( SpeedThurst, Condition( function SpeedThurst_Conds ) )
call TriggerAddAction( SpeedThurst, function SpeedThurst_Acts )
endfunction
The objective of the spell is:
- level 1: Every time the hero attacks, he has 5% chance to gain 3 additional ability stats. Lasts for 5 seconds.
- level 2: Every time the hero attacks, he has 7% chance to gain 6 additional ability stats. Lasts for 10 seconds.
- level 3: Every time the hero attacks, he has 10% chance to gain 9 additional ability stats. Lasts for 15 seconds.
I used as much formulas as i could and used the texttag properly ( i think, i tried to do the same thing PurplePoot told in my last post about tags)
I also tried to removed all BJ's, but in this case i couldn't do so, i have at least 2 BJ's that change the hero stats and i don't understand how to change them.
Anyway, the problem is that my spell DOES NOT work ... and i don't know why .... can some1 please tell me what is wrong ?
The JassCrasft program i use points no errors ...