Beetlebomb
New Member
- Reaction score
- 43
Hey guys, I'm going to give this whole JASS thing another go-- and this time I won't give up!
I got a couple simple questions I'd like to ask.
This is the Original GUI Version I'm trying to convert:
And this is the converted version:
Now here's what I've done so far. As you must know, there are tons of syntax errors I'm getting, but I don't know enough to figure out what I'm missing. I'm writing this on JassCraft as well if that helps any.
I created the Check function because I saw the SetUnitState had a BJ function called RMax something? I tried to manipulate and copy it, but...eh.
As usual, any attempts at helping me would be greatly apreciated! Thanks again guys!
I got a couple simple questions I'd like to ask.
This is the Original GUI Version I'm trying to convert:
Code:
Restore
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Unit - Set life of Sorceress 0000 <gen> to 100.00%
Unit - Set mana of Sorceress 0000 <gen> to 100.00%
Special Effect - Create a special effect attached to the origin of Sorceress 0000 <gen> using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Special Effect - Destroy (Last created special effect)
And this is the converted version:
JASS:
function Trig_Restore_Copy_Actions takes nothing returns nothing
call SetUnitLifePercentBJ( gg_unit_H000_0000, 100 )
call SetUnitManaPercentBJ( gg_unit_H000_0000, 100 )
call AddSpecialEffectTargetUnitBJ( "origin", gg_unit_H000_0000, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction
//===========================================================================
function InitTrig_Restore_Copy takes nothing returns nothing
set gg_trg_Restore_Copy = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Restore_Copy, Player(0) )
call TriggerAddAction( gg_trg_Restore_Copy, function Trig_Restore_Copy_Actions )
endfunction
Now here's what I've done so far. As you must know, there are tons of syntax errors I'm getting, but I don't know enough to figure out what I'm missing. I'm writing this on JassCraft as well if that helps any.
JASS:
function Check takes real a, real b returns real
if (a < b) then
return b
else
return a
endif
function Heal takes nothing returns nothing
local unit u = gg_unit_H000_0000
local real a = 0
local real b = 100
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE) * function Check(a, b) * 0.01)
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u, UNIT_STATE_MAX_MANA) * function Check(a, b) * 0.01)
call AddSpecialEffectLoc("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl", GetUnitLoc(u))
call DestroyEffect(return bj_lastCreatedEffect)
endfunction
//===========================================================================
function Restore takes nothing returns nothing
set Restore = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( Restore, Player(0) )
call TriggerAddAction( Restore, function Heal )
endfunction
I created the Check function because I saw the SetUnitState had a BJ function called RMax something? I tried to manipulate and copy it, but...eh.
As usual, any attempts at helping me would be greatly apreciated! Thanks again guys!