lh2705
Just another Helper
- Reaction score
- 111
Hello
It's been a very long time..
My first spellpack I made with GUI and converted to JASS with locals.
The spells are very simple spells, but they look nice
1. Lightning Blast - Fires a bolt of lightning from the sky to every unit in the area. Each bolt bounces as well
2. Earth Shock - No Image... Basic Stun and Silence after that.
3. Energize - % Chance on attack to charge the shaman up with electrical energy gaining bonus attack speed and movement speed.
4. Enchant Lightning - Have to be honest, not what I had in mind for an Ultimate..Seems too simple..But oh well..Ran out of ideas anyways..
Comments are welcome
Edit2, Pictures now in spoilers as Flare suggested.
Edit3, All spells done with converted to proper JASS
Edit4, Post updated with codes
Edit5, Forgot to take away the BJs in Enchant Lightning, Constant Functions added into all spells
It's been a very long time..
My first spellpack I made with GUI and converted to JASS with locals.
The spells are very simple spells, but they look nice
1. Lightning Blast - Fires a bolt of lightning from the sky to every unit in the area. Each bolt bounces as well
JASS:
constant function Lightning_Blast_Rawcode takes nothing returns integer
return 039;A007039; //Raw code of the "Lightning Blast" ability
endfunction
constant function Lightning_Blast_Dummy_Unit_Rawcode takes nothing returns integer
return 039;h002039; //Raw code for the dummy unit used
endfunction
constant function Lightning_Blast_Dummy_Ability_Rawcode takes nothing returns integer
return 039;A005039; //Raw code for the "Dummy Lightning Blast" ability
endfunction
constant function Lightning_Blast_AoE_Base takes nothing returns real
return 250.00 //Base of the Area of Effect value , This value should be (the level 1 AoE value - the increment AoE)
endfunction //Example , If Level 1 has a 300 AoE and each level increases the AoE by 50, this value should be 250.
constant function Lightning_Blast_AoE_Increment takes nothing returns real
return 50.00 //Increment of Area of Effect per level
endfunction
function Trig_Lightning_Blast_Locals_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Lightning_Blast_Rawcode()
endfunction
function Lightning_Blast_Condition takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE) > 0
endfunction
function Trig_Lightning_Blast_Locals_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local unit Target
local real TargetX
local real TargetY
local unit Dummy
local location TargetPoint = GetSpellTargetLoc()
local group TargetGroup = CreateGroup()
call GroupEnumUnitsInRangeOfLoc(TargetGroup, TargetPoint, Lightning_Blast_AoE_Base() + ( Lightning_Blast_AoE_Increment() * I2R(GetUnitAbilityLevel(Caster, Lightning_Blast_Rawcode())) ),Condition(function Lightning_Blast_Condition))
loop
set Target = FirstOfGroup(TargetGroup)
call GroupRemoveUnit(TargetGroup,Target)
exitwhen Target == null
set TargetX = GetUnitX(Target)
set TargetY = GetUnitY(Target)
set Dummy = CreateUnit(GetOwningPlayer(Caster), Lightning_Blast_Dummy_Unit_Rawcode(), TargetX, TargetY, 270.)
call UnitApplyTimedLife( Dummy, 039;BTLF039;, 3. )
call UnitAddAbility(Dummy, Lightning_Blast_Dummy_Ability_Rawcode())
call SetUnitAbilityLevel(Dummy, Lightning_Blast_Dummy_Ability_Rawcode(), GetUnitAbilityLevel(Caster, Lightning_Blast_Rawcode()) )
call IssueTargetOrder(Dummy, "chainlightning", Target)
endloop
call DestroyGroup(TargetGroup)
call RemoveLocation(TargetPoint)
set Caster = null
set Target = null
set Dummy = null
set TargetPoint = null
set TargetGroup = null
endfunction
//===========================================================================
function InitTrig_Lightning_Blast_Locals takes nothing returns nothing
set gg_trg_Lightning_Blast_Locals = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lightning_Blast_Locals, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Lightning_Blast_Locals, Condition( function Trig_Lightning_Blast_Locals_Conditions ) )
call TriggerAddAction( gg_trg_Lightning_Blast_Locals, function Trig_Lightning_Blast_Locals_Actions )
endfunction
2. Earth Shock - No Image... Basic Stun and Silence after that.
JASS:
constant function Earth_Shock_Rawcode takes nothing returns integer
return 039;A004039; //Raw code of the "Earth Shock" ability
endfunction
constant function Earth_Shock_Dummy_Unit_Rawcode takes nothing returns integer
return 039;h002039; //Raw code for the dummy unit used
endfunction
constant function Earth_Shock_Dummy_Ability_Rawcode takes nothing returns integer
return 039;A006039; //Raw code for the "Dummy Earth Shock" ability
endfunction
function Trig_Earth_Shock_Locals_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Earth_Shock_Rawcode()
endfunction
function Trig_Earth_Shock_Locals_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local real CasterX = GetUnitX(Caster)
local real CasterY = GetUnitY(Caster)
local unit Dummy
call PolledWait( ( 1.00 + ( 1.00 * I2R(GetUnitAbilityLevel(Caster,Earth_Shock_Rawcode())) ) ) )
set Dummy = CreateUnit(GetOwningPlayer(Caster),Earth_Shock_Dummy_Unit_Rawcode(),CasterX,CasterY,270.)
call UnitApplyTimedLife(Dummy,039;BTLF039;,3.)
call UnitAddAbility(Dummy,Earth_Shock_Dummy_Ability_Rawcode())
call SetUnitAbilityLevel(Dummy, Earth_Shock_Dummy_Ability_Rawcode(),GetUnitAbilityLevel(Caster,Earth_Shock_Rawcode()))
call IssuePointOrder(Dummy,"silence",CasterX,CasterY)
set Caster = null
set Dummy = null
endfunction
//===========================================================================
function InitTrig_Earth_Shock_Locals takes nothing returns nothing
set gg_trg_Earth_Shock_Locals = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Earth_Shock_Locals, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Earth_Shock_Locals, Condition( function Trig_Earth_Shock_Locals_Conditions ) )
call TriggerAddAction( gg_trg_Earth_Shock_Locals, function Trig_Earth_Shock_Locals_Actions )
endfunction
3. Energize - % Chance on attack to charge the shaman up with electrical energy gaining bonus attack speed and movement speed.
JASS:
constant function Energize_Main_Ability_ID takes nothing returns integer
return 039;A003039; //Raw code of the "Energize" ability
endfunction
constant function Energize_Dummy_Unit_ID takes nothing returns integer
return 039;h002039; //Raw code for the dummy unit used
endfunction
constant function Energize_Dummy_Ability_ID takes nothing returns integer
return 039;A000039; //Raw code for the "Dummy Energize" ability
endfunction
constant function Energize_Triggering_Chance_Base takes nothing returns integer
return 15 //Base of the chance to trigger value , This value should be (the level 1 % chance to trigger - the increment chance)
endfunction //Example , If Level 1 has a 20% chance to trigger and each level increases the chance by 5%, this value should be 15.
constant function Energize_Triggering_Chance_Increment takes nothing returns integer
return 5 //Increment of chance to trigger per level
endfunction
function Trig_Energize_Locals_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),Energize_Main_Ability_ID()) != 0
endfunction
function Trig_Energize_Locals_Actions takes nothing returns nothing
local unit Attacker = GetAttacker()
local real AttackerX = GetUnitX(Attacker)
local real AttackerY = GetUnitY(Attacker)
local unit Dummy
if GetRandomInt(1, 100) <= ( Energize_Triggering_Chance_Base() + ( Energize_Triggering_Chance_Increment() * GetUnitAbilityLevel(GetAttacker(),Energize_Main_Ability_ID()) ) ) then
set Dummy = CreateUnit(GetOwningPlayer(Attacker),Energize_Dummy_Unit_ID(),AttackerX,AttackerY, 270.)
call UnitApplyTimedLife(Dummy,039;BTLF039;,2.)
call UnitAddAbility(Dummy,Energize_Dummy_Ability_ID())
call SetUnitAbilityLevel(Dummy, Energize_Dummy_Ability_ID(),GetUnitAbilityLevel(Attacker,Energize_Main_Ability_ID()))
call IssueTargetOrder(Dummy,"bloodlust",Attacker)
endif
set Attacker = null
set Dummy = null
endfunction
//===========================================================================
function InitTrig_Energize_Locals takes nothing returns nothing
set gg_trg_Energize_Locals = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Energize_Locals, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Energize_Locals, Condition( function Trig_Energize_Locals_Conditions ) )
call TriggerAddAction( gg_trg_Energize_Locals, function Trig_Energize_Locals_Actions )
endfunction
JASS:
constant function Energize_Buff_Rawcode takes nothing returns integer
return 039;B000039; //Buff Rawcode of Energize Ability
endfunction
constant function Effect_Model takes nothing returns string
return "Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl" //Model path of effect attached
endfunction
constant function Effect_Attachment_Point takes nothing returns string
return "hand,right" //Effect attachment point
endfunction
function AbilityCheck takes nothing returns boolean
return GetUnitAbilityLevel(GetFilterUnit(),Energize_Buff_Rawcode())>0
endfunction
function Trig_EnergizeEfx_Locals_Actions takes nothing returns nothing
local unit Unit
local group UnitGroup = CreateGroup()
call GroupEnumUnitsInRect(UnitGroup,GetWorldBounds(),Condition(function AbilityCheck))
loop
set Unit = FirstOfGroup(UnitGroup)
exitwhen Unit == null
call DestroyEffect(AddSpecialEffectTarget(Effect_Model(),Unit,Effect_Attachment_Point()))
call GroupRemoveUnit(UnitGroup, Unit)
endloop
call DestroyGroup(UnitGroup)
set UnitGroup = null
set Unit = null
endfunction
//===========================================================================
function InitTrig_EnergizeEfx_Locals takes nothing returns nothing
set gg_trg_EnergizeEfx_Locals = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_EnergizeEfx_Locals, 0.20 )
call TriggerAddAction( gg_trg_EnergizeEfx_Locals, function Trig_EnergizeEfx_Locals_Actions )
endfunction
4. Enchant Lightning - Have to be honest, not what I had in mind for an Ultimate..Seems too simple..But oh well..Ran out of ideas anyways..
JASS:
constant function Enchant_Lightning_Buff_Rawcode takes nothing returns integer
return 039;B001039; //Raw code of the "Enchant Lightning" buff
endfunction
constant function Enchant_Lightning_Dummy_Unit_Rawcode takes nothing returns integer
return 039;h001039; //Raw code of the dummy used
endfunction
constant function Enchant_Lightning_Dummy_Purge_Rawcode takes nothing returns integer
return 039;A009039; //Raw code of the "Dummy Purge" ability
endfunction
constant function Enchant_Lightning_Dummy_Lightning_Rawcode takes nothing returns integer
return 039;A00A039; //Raw code of the "Dummy Purge" ability
endfunction
constant function Enchant_Lightning_Triggering_Chance takes nothing returns integer
return 50 //% Chance to Trigger Lightning
endfunction
function Trig_Enchant_Lightning_Locals_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),Enchant_Lightning_Buff_Rawcode())>0
endfunction
function Trig_Enchant_Lightning_Locals_Actions takes nothing returns nothing
local unit Caster = GetAttacker()
local real CasterX = GetUnitX(Caster)
local real CasterY = GetUnitY(Caster)
local real Angle = GetUnitFacing(Caster)
local unit Target = GetTriggerUnit()
local unit Dummy
local unit Dummy2
set Dummy = CreateUnit( GetOwningPlayer(Caster),Enchant_Lightning_Dummy_Unit_Rawcode(),CasterX,CasterY,Angle )
call UnitApplyTimedLife( Dummy, 039;BTLF039;, 2. )
call UnitAddAbility( Dummy, Enchant_Lightning_Dummy_Purge_Rawcode() )
call IssueTargetOrder( Dummy,"purge",Target )
if GetRandomInt(1, 100) <= Enchant_Lightning_Triggering_Chance() then
set Dummy2 = CreateUnit( GetOwningPlayer(Caster),Enchant_Lightning_Dummy_Unit_Rawcode(),CasterX,CasterY,Angle )
call UnitApplyTimedLife( Dummy2, 039;BTLF039;, 2. )
call UnitAddAbility( Dummy2,Enchant_Lightning_Dummy_Lightning_Rawcode() )
call IssueTargetOrder( Dummy2,"chainlightning",Target )
endif
set Caster = null
set Target = null
set Dummy = null
set Dummy2 = null
endfunction
//===========================================================================
function InitTrig_Enchant_Lightning_Locals takes nothing returns nothing
set gg_trg_Enchant_Lightning_Locals = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Enchant_Lightning_Locals, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Enchant_Lightning_Locals, Condition( function Trig_Enchant_Lightning_Locals_Conditions ) )
call TriggerAddAction( gg_trg_Enchant_Lightning_Locals, function Trig_Enchant_Lightning_Locals_Actions )
endfunction
Comments are welcome
Edit2, Pictures now in spoilers as Flare suggested.
Edit3, All spells done with converted to proper JASS
Edit4, Post updated with codes
Edit5, Forgot to take away the BJs in Enchant Lightning, Constant Functions added into all spells