Rommel
New Member
- Reaction score
- 13
-Hi friends...I spent 18 hours without sleeping last night to learn Jass. I read all great tutorials of Vexorain, Daelin, Wyrmlord, DarkWolf...and i found JASS Very interesting
-Well, yes, firstly i have to convert GUI to JASS for learning, and try to research and optimize it....but later on, when my knowledge is better, i will try to write my own code. I also thank you all friends for your help.
-Here is the list of my next spells..But i should introduce they abit, right...so you can imagine how they work and see if my code is going right.
-Lay on Hands:
A holy light that can heal a friendly unit or deal half damage to a target foe.
-And the code:
-Holy Incantation:
Passive - An aura that gives friendly nearby units a damage shield, which returns a percentage of a melee attacker's damage back to it.
-And the code for Conversion (For multiple conditions, we use "and", right? So i added this line at the end of the Condition Function: and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO :
-Judicial Chop:
The Paladin focus his holy strength to jolt a hot light stream at a target enemy unit, causing damage and ministun.
-Sacred Strength:
Passive - The Paladin channels divine power to gain bonus Strength. Also adds more points to Lay on Hands, gives extra damage VS Undead to Judicial Chop, completely immune to Disease and has a chance to convert Undead creatures to your side on attacks under the effect of Holy Incantation
-And the Code for Extra damage for Judicial Chop(I make the game wait 0.5 sec before triggering damage and creating floating text because the caster need a small time to cast his spell or i should use event "A unit finish casting a spell" ?):
-The Code for Extra Strength and bonus point to Lay on Hands:
Well, i saved it, the map report no bug, but except Lay on Hands i see it clearly works...The other i am not sure, and the Conversion action still does not work, hix.
I attach the map here, so if you have time, can you take a look at it? Also, if my spells have any typo or grammar error, i hope you could help me fix :lol:
At this corner is a group of Undead for testing:
And i want to bother you one more thing, how to create a game message like Blizzard's one, like this:
I will play here around to waiting for answerm hix
-Well, yes, firstly i have to convert GUI to JASS for learning, and try to research and optimize it....but later on, when my knowledge is better, i will try to write my own code. I also thank you all friends for your help.
-Here is the list of my next spells..But i should introduce they abit, right...so you can imagine how they work and see if my code is going right.
-Lay on Hands:
A holy light that can heal a friendly unit or deal half damage to a target foe.
-And the code:
JASS:
function Trig_Lay_on_Hands_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A003039;
endfunction
function Trig_Lay_on_Hands_Actions takes nothing returns nothing
local unit Caster_LOH = GetTriggerUnit()
local integer Int_LOH = GetUnitAbilityLevel(Caster_LOH, 039;A003039;)
local unit Target_LOH = GetSpellTargetUnit()
call TriggerSleepAction(0.50)
if IsUnitAlly(Target_LOH, GetOwningPlayer(Caster_LOH))then
call SetUnitState(Target_LOH, UNIT_STATE_LIFE, GetUnitState(Target_LOH, UNIT_STATE_LIFE) + (Int_LOH * 80. + udg_Bonus_LOH))
else
call UnitDamageTargetBJ(Caster_LOH, Target_LOH, (80. * Int_LOH + udg_Bonus_LOH), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
endif
set Caster_LOH = null
set Target_LOH = null
endfunction
//===========================================================================
function InitTrig_Lay_on_Hands takes nothing returns nothing
set gg_trg_Lay_on_Hands = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lay_on_Hands, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Lay_on_Hands, Condition( function Trig_Lay_on_Hands_Conditions ) )
call TriggerAddAction( gg_trg_Lay_on_Hands, function Trig_Lay_on_Hands_Actions )
endfunction
-Holy Incantation:
Passive - An aura that gives friendly nearby units a damage shield, which returns a percentage of a melee attacker's damage back to it.
-And the code for Conversion (For multiple conditions, we use "and", right? So i added this line at the end of the Condition Function: and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO :
JASS:
constant function Conversion_SpellId takes nothing returns integer
return 039;A007039;
endfunction
constant function Conversion_BuffId takes nothing returns integer
return 039;AeAh039;
endfunction
constant function Conversion_Dum takes nothing returns integer
return 039;A004039;
endfunction
function Trig_Conversion_Conditions takes nothing returns boolean
return GetUnitTypeId(GetAttacker()) ==039;Hpal039; and IsUnitType(GetTriggerUnit(), UNIT_TYPE_UNDEAD) and GetUnitAbilityLevel(GetAttacker(), Conversion_SpellId()) >=1 and GetUnitAbilityLevel(GetAttacker(), Conversion_BuffId()) >0 and not IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO )
endfunction
function Trig_Conversion_Actions takes nothing returns nothing
local unit c = GetAttacker()
local unit t = GetTriggerUnit()
local integer ir = GetRandomInt(1,100)
local integer ic = 2 * GetUnitAbilityLevel(c, Conversion_SpellId())
if ir <= ic then
call SetUnitAnimation(c, "attack")
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl", t, "origin"))
call SetUnitOwner(t, GetOwningPlayer(c), true)
call UnitAddAbility(t, Conversion_Dum())
endif
set c = null
set t = null
endfunction
function InitTrig_Conversion takes nothing returns nothing
call TriggerRegisterAnyUnitEventBJ(gg_trg_Conversion, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Conversion, Condition(function Trig_Conversion_Conditions))
call TriggerAddAction(gg_trg_Conversion, function Trig_Conversion_Actions)
endfunction
-Judicial Chop:
The Paladin focus his holy strength to jolt a hot light stream at a target enemy unit, causing damage and ministun.
-Sacred Strength:
Passive - The Paladin channels divine power to gain bonus Strength. Also adds more points to Lay on Hands, gives extra damage VS Undead to Judicial Chop, completely immune to Disease and has a chance to convert Undead creatures to your side on attacks under the effect of Holy Incantation
-And the Code for Extra damage for Judicial Chop(I make the game wait 0.5 sec before triggering damage and creating floating text because the caster need a small time to cast his spell or i should use event "A unit finish casting a spell" ?):
JASS:
function Trig_Judicial_Chop_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;AHtb039;
endfunction
function Trig_Judicial_Chop_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local integer i = 100 * GetUnitAbilityLevel(c, 039;A007039;)
call TriggerSleepAction(0.50)
call UnitDamageTargetBJ(c, t, i, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL)
call CreateTextTagUnitBJ( ( "+" + I2S(i) ), t, 0, 10, 100, 0.00, 0.00, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 40.00, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 3.00 )
set c = null
set t = null
endfunction
//===========================================================================
function InitTrig_Judicial_Chop takes nothing returns nothing
set gg_trg_Judicial_Chop = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Judicial_Chop, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Judicial_Chop, Condition( function Trig_Judicial_Chop_Conditions ) )
call TriggerAddAction( gg_trg_Judicial_Chop, function Trig_Judicial_Chop_Actions )
endfunction
-The Code for Extra Strength and bonus point to Lay on Hands:
JASS:
function Trig_Sacred_Strength_Conditions takes nothing returns boolean
return GetLearnedSkillBJ() == 039;A007039;and GetUnitTypeId(GetTriggerUnit()) == 039;Hpal039;
endfunction
function Trig_Sacred_Strength_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 039;A007039;)
set udg_Bonus_LOH = 3 * i
if i == 1 then
call UnitAddAbility(c, 039;A008039;)
elseif i ==2 then
call UnitRemoveAbility(c, 039;A008039;)
call UnitAddAbility(c, 039;A009039;)
elseif i == 3 then
call UnitRemoveAbility(c, 039;A009039;)
call UnitAddAbility(c, 039;A00A039;)
endif
set c = null
endfunction
//===========================================================================
function InitTrig_Sacred_Strength takes nothing returns nothing
set gg_trg_Sacred_Strength = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Sacred_Strength, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_Sacred_Strength, Condition( function Trig_Sacred_Strength_Conditions ) )
call TriggerAddAction( gg_trg_Sacred_Strength, function Trig_Sacred_Strength_Actions )
endfunction
Well, i saved it, the map report no bug, but except Lay on Hands i see it clearly works...The other i am not sure, and the Conversion action still does not work, hix.
I attach the map here, so if you have time, can you take a look at it? Also, if my spells have any typo or grammar error, i hope you could help me fix :lol:
At this corner is a group of Undead for testing:
And i want to bother you one more thing, how to create a game message like Blizzard's one, like this:
I will play here around to waiting for answerm hix