Hey readers..
I'm currently still learning stuff with Jass..
I tried to do something that's a bit harder for me, however I got a bit stuck.
I wanted to make a system that allows me to heal a target with a special effect and floating text with just one line of text.
Something like this:
Call HealTarget(GetTriggerUnit(), GetSpellTargetUnit(), amount, true)
the true means if it's crittable or not.
I made something like this, but I don't know how to finish it.. because it's currently missing the unit's and real's that are needed for the function after "takes".
This is probably horrible jass, and i know this might be 50% of the trigger.. But I'm kinda stuck on what to do now. I don't know which things I have to add, however I know there are some things missing.
Could anyone give me some hints or examples?
thanks.
I'm currently still learning stuff with Jass..
I tried to do something that's a bit harder for me, however I got a bit stuck.
I wanted to make a system that allows me to heal a target with a special effect and floating text with just one line of text.
Something like this:
Call HealTarget(GetTriggerUnit(), GetSpellTargetUnit(), amount, true)
the true means if it's crittable or not.
I made something like this, but I don't know how to finish it.. because it's currently missing the unit's and real's that are needed for the function after "takes".
JASS:
function HealUnit takes unit healer, unit target, real amount, boolean critcheck returns nothing
if udg_HeroCritChance[GetPlayerId(GetOwningPlayer(healer))] <= GetRandomInt(1, 100) and critcheck == true then
////(The line here checked if the spell is a crit AND if the spell is able to crit)
call SetUnitLifeBJ(target, (GetUnitStateSwap(UNIT_STATE_LIFE, target)+amount*2))
call CreateTextTagUnitBJ(I2S(R2I(amount*2.00)), t, 0, 9.50, 0.00, 100.00, 0.00, 0)
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false)
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.10)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 0.65)
call AddSpecialEffectLocBJ(GetUnitLoc(target), "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ())
else
call SetUnitLifeBJ(target, (GetUnitStateSwap(UNIT_STATE_LIFE, target)+amount))
call CreateTextTagUnitBJ(I2S(R2I(amount)), amount, 0, 8.50, 0.00, 75.00, 0.00, 0)
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false)
call SetTextTagVelocityBJ(GetLastCreatedTextTag(), 64, 55)
call SetTextTagLifespanBJ(GetLastCreatedTextTag(), 1.10)
call SetTextTagFadepointBJ(GetLastCreatedTextTag(), 0.65)
call AddSpecialEffectLocBJ(GetUnitLoc(target), "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ())
endif
endfunction
This is probably horrible jass, and i know this might be 50% of the trigger.. But I'm kinda stuck on what to do now. I don't know which things I have to add, however I know there are some things missing.
Could anyone give me some hints or examples?
thanks.