- Joined
- May 4, 2007
- Messages
- 2,260
Hi, it is me again with some JASS problems (OOHH GOD, really ?? lol =P). Anyway, the problem is that JassCraft says it can't convert real to integer, making my spell fail ...
But question is, if it can be done in GUI why can't it be done in JASS !? Can some1 help me plz ?
Here is the spell:
I tried to apply as much knowledge as i could and i think i did everythong ok, except the real to integer conversion .. and i don't know how to solve this problem ..
The objective of the spell id to give 10%, 20% and 30% bonus to the agility of the hero, together with items if possible, during 4, 8, 12 seconds....
Help again plz .. =S
But question is, if it can be done in GUI why can't it be done in JASS !? Can some1 help me plz ?
Here is the spell:
JASS:
function SpeedLust_Conds takes nothing returns boolean
return GetSpellAbilityId() == 'A001'
endfunction
//===============================================================
function SpeedLust_Acts takes nothing returns nothing
local unit caster = GetTriggerUnit()
local effect e = AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl", caster, "origin")
local integer level = GetUnitAbilityLevel(caster, 'A001')
local texttag bonus = CreateTextTag()
call SetHeroAgi(caster,GetHeroAgi(caster, false) + GetHeroAgi(caster, false) * (0.10*level), true)
call SetTextTagText(bonus, "+" + I2S(GetHeroAgi(caster, false) * (0.10*level)), .023 )
call SetTextTagPosUnit( bonus, caster, 0 )
call SetTextTagColor( bonus, 0, 255, 0, 255 )
call SetTextTagPermanent(bonus, false)
call SetTextTagVelocity( bonus, 0, .0277 )
call TriggerSleepAction(2.00)
call DestroyTextTag(bonus)
call TriggerSleepAction( 4*level )
call SetHeroAgi(caster,GetHeroAgi(caster, false) - GetHeroAgi(caster, false) * (0.10*level), true)
call DestroyEffect(e)
set caster = null
set e = null
set bonus = null
endfunction
//===========================================================================
function InitTrig_Speed_Lust takes nothing returns nothing
local trigger SpeedLust = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( SpeedLust, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( SpeedLust, Condition( function SpeedLust_Conds ) )
call TriggerAddAction( SpeedLust, function SpeedLust_Acts )
endfunction
I tried to apply as much knowledge as i could and i think i did everythong ok, except the real to integer conversion .. and i don't know how to solve this problem ..
The objective of the spell id to give 10%, 20% and 30% bonus to the agility of the hero, together with items if possible, during 4, 8, 12 seconds....
Help again plz .. =S
Last edited: