- Joined
- Apr 24, 2012
- Messages
- 5,099
PFT..
Waiting for HC 7 XD
Can't wait to see the competitors' spells
Waiting for HC 7 XD
Can't wait to see the competitors' spells
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Quoted For Truth.PFT..
Waiting for HC 7 XD
SaviorAuraTriggerConfiguration

Events


Map initialization

Conditions

Actions


-------- set the ability that will be the basis for the aura --------


-------- - --------


Set SA_A_PassiveAbility = Savior's Aura (Container)


Set SA_A_ActiveAbility = Savior's Aura (Active)


-------- - --------


-------- set the buff that the ability will emit --------


-------- - --------


Set SA_BF_Buff = Savior's Aura


-------- - --------


-------- if set to true, the amount healed will be based on the percentage of strength of the hero --------


-------- if set to false, the number will directly heal units --------


-------- please note that 20% is 20.00 and not 0.2 --------


-------- - --------


Set SA_B_UseStat = True


-------- - --------


Set SA_R_Heal[1] = 30.00


Set SA_R_Heal[2] = 60.00


Set SA_R_Heal[3] = 90.00


Set SA_R_Heal[4] = 120.00


-------- - --------


-------- special effects configurables --------


-------- attachment point --------


-------- - --------


Set SA_S_Attach = origin


-------- - --------


-------- special effects attached to unit --------


-------- - --------


Set SA_S_SFX = Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl


-------- - --------


-------- if true, it will heal structures only if they have the buff from the aura --------


-------- - --------


Set SA_B_HealStructures = False


-------- - --------


-------- if true, it will heal magic immunes only if they have the buff from the aura --------


-------- - --------


Set SA_B_HealImmune = False


-------- - --------


-------- Area of effect of the aura --------


-------- - --------


Set SA_R_AoE[1] = 500.00


Set SA_R_AoE[2] = 500.00


Set SA_R_AoE[3] = 500.00


Set SA_R_AoE[4] = 500.00


-------- - --------


-------- list abilities that unlearns all hero skills --------


-------- SA_A_Total is the total number of abilities that can unlearn the spell --------


-------- - --------


Set SA_I_Total = 1


-------- - --------


Set SA_A_Unlearn[1] = Tome of Retraining


-------- - --------


-------- Disable spellbook --------


-------- - --------


For each (Integer SA_I_TempInt) from 1 to 12, do (Actions)



Loop - Actions




-------- - --------




-------- Disable the spellbook --------




-------- - --------




Player - Disable SA_A_PassiveAbility for (Player(SA_I_TempInt))


Custom script: set bj_wantDestroyGroup=true


-------- - --------


-------- Check if any there are units that already learnt the ability --------


-------- - --------


Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)



Loop - Actions




-------- - --------




-------- add the picked unit into a variable --------




-------- - --------




Set SA_U_Picked = (Picked unit)




-------- - --------




-------- Check if the unit has leveled the ability --------




-------- - --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(Level of SA_A_ActiveAbility for SA_U_Picked) Greater than 0





Then - Actions






-------- - --------






-------- add the actual aura to the picked unit --------






-------- - --------






Unit - Add SA_A_PassiveAbility to SA_U_Picked





Else - Actions
SaviorAuraEffect

Events


Unit - A unit Is attacked

Conditions


(Level of SA_A_ActiveAbility for (Attacked unit)) Greater than 0


((Attacking unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True

Actions


-------- - --------


-------- Set the attacked unit --------


-------- - --------


Set SA_U_AtkUnit = (Attacked unit)


-------- - --------


-------- Determine the owner of the unit --------


-------- - --------


Set SA_PL_Player = (Owner of SA_U_AtkUnit)


-------- - --------


-------- set the level of the ability into a variable --------


-------- - --------


Set SA_I_Level = (Level of SA_A_ActiveAbility for SA_U_AtkUnit)


-------- - --------


-------- Checks on what value should be applied on the aura's healing effect --------


-------- - --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




SA_B_UseStat Equal to True



Then - Actions




-------- - --------




-------- if this is applied then the heal value is equal to a certain percentage of the attacked unit's strength --------




-------- - --------




Set SA_R_HealAmt = ((Real((Strength of SA_U_AtkUnit (Include bonuses)))) x (SA_R_Heal[SA_I_Level] x 0.01))



Else - Actions




-------- - --------




-------- if this is applied, then the heal amount is equal to the predefined value in the trigger configuration --------




-------- - --------




Set SA_R_HealAmt = SA_R_Heal[SA_I_Level]


-------- - --------


-------- sets the position of the attacked units into a variable --------


-------- - --------


Set SA_P_AtkPos = (Position of SA_U_AtkUnit)


-------- - --------


-------- selects the valid units that can be healed --------


-------- - --------


Set SA_UG_UnitGroup = (Units within SA_R_AoE[SA_I_Level] of SA_P_AtkPos matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of SA_PL_Player) Equal to True) and ((((Matching unit) is A structure) Equal to SA_B_HealStructures) and ((((Match


-------- - --------


-------- heals the picked units --------


-------- - --------


Unit Group - Pick every unit in SA_UG_UnitGroup and do (Actions)



Loop - Actions




-------- - --------




-------- sets the picked unit into a variable --------




-------- its ok to recycle this variable isn't it? --------




-------- - --------




Set SA_U_Picked = (Picked unit)




-------- - --------




-------- Heals the picked unit --------




-------- - --------




Unit - Set life of SA_U_Picked to ((Life of SA_U_Picked) + SA_R_HealAmt)




-------- - --------




-------- Add some visuals --------




-------- - --------




Special Effect - Create a special effect attached to the SA_S_Attach of SA_U_Picked using SA_S_SFX




-------- - --------




-------- destroy visuals to prevent leaks --------




-------- - --------




Special Effect - Destroy (Last created special effect)


-------- - --------


-------- Clean up --------


-------- - --------


-------- SA_UG_UnitGroup.Clear(); --------


-------- Clear the unit group --------


-------- - --------


Unit Group - Remove all units from SA_UG_UnitGroup


-------- - --------


-------- Destroy the instance of the unit group --------


-------- - --------


Custom script: call DestroyGroup(udg_SA_UG_UnitGroup)


-------- - --------


-------- Destroy the point --------


-------- - --------


Custom script: call RemoveLocation(udg_SA_P_AtkPos)


| Dark Circle By GywGod133 |
DESCRIPTION
|
TRIGGERS
|
SCREENSHOTSDark CircleDamage in enemy unitsHeal the nearby allied units |
| CREDITS |
Yes, you may use enhancing systems as long they don't do the major part of your coding job.Can I use Bribe's Is Unit Moving system?
^ye he is a cool spell

I mean I didn't recognize the name before lolHis thread in regard to JNPG 2.0.X is hard to miss![]()
Rules:I'll try to get an entry today. Just today I have time so I hope it can count as WIP and final entry...
This rule doesn't let space for an exception to combine WIP and final entry.Any submission must follow a Work In Progress (WiP), before it is published and labelled as the final piece.
I agree Tank made quite a nice spell however it shouldn't win due to size alone
Dat-C3 said:the amount of skill he has kind of makes the effort seem a bit lower. The only effort I saw was the idea and the creation, not the size. No offense or jealousy intended.
Dat-C3 said:You guys are forgetting the others entries which are well done as well.
Absolutely, it would be frustrating for everybody I think if that was a primary factor in winning regardless of which entry won
That's rather flattering, though I would say I did put a lot of effort into it, I pulled a double all-nighter to get it all done that fast XD
Indeed, as I've said earlier I think the contest is more evenly matched than some of you are giving credit for it being - some of those entries have some very cool and unique effects
When your tired you can sometimes slack on some area's of coding/triggering. Good to see that you did spend a lot of time and effort into it. He just needs to submit it twice then lol.Rules:
This rule doesn't let space for an exception to combine WIP and final entry.
IcemanBo
Contact me if you want to judge.
ConfigurablesJASS:constant integer AoL_AbilityId ='A000' // This is the spell's object id for the aura. constant integer AoL_PurgeId ='A001' // This is the object id for the purge aspect of the aura. constant integer AoL_LightningId ='A002' // This is the object id for the unempowered chain lightning aspect of the aura. constant integer AoL_EmpoweredId ='A003' // This is the object id for the empowered chain lightning aspect of the aura. constant integer AoL_Index =StringHash("Aspect of Lightning") // This is where I index auras to units. constant integer AoL_PurgeOrderId =852111 // This is the order id for "purge". constant integer AoL_LightningOrderId=852119 // This is the order id for "chainlightning". constant integer AoL_UnempowerOrderId=852544 // This is the order id for when a unit turns off autocasting for the aura. constant integer AoL_EmpowerOrderId =852543 // This is the order id for when a unit turns on the autocasting for the aura. constant real AoL_ManaUseage =25 // This is how much mana is drained each second to have the aura empowered. constant string AoL_LightningType ="CLSB" // The type of lightning the aura creates. constant string AoL_EmpoweredType ="AFOD" // The type of lightning the aura creates while empowered.
Aspect of LightningJASS://*************************************************************************** //* //* Aspect of Lightning. //* //*************************************************************************** //=========================================================================== // AoL_Tick // takes nothing // returns nothing // // Handles the periodic effect of Aspect of Lightning (defaulted at 1 second). // This is called internally by the aura system with Aura_Index set to the aura's id number. //=========================================================================== function AoL_Tick takes nothing returns nothing // ***** Local variables ***** local unit Caster =Aura_Caster[Aura_Index] // The owner of the aura. local unit Target =GroupPickRandomUnit(Aura_TargetsAdd[Aura_Index])// The potential target for the aura to zap. local real X =GetUnitX(Caster) // The x coordinate of the owner of the aura. local real Y =GetUnitY(Caster) // The y coordinate of the owner of the aura. local unit Dummy // The potential dummy caster to zap the potential target. local integer SpellId=AoL_LightningId // The zap spell's object id. local real Mana =GetUnitState(Caster,UNIT_STATE_MANA) // How much mana the owner of the aura has. local integer Number =25 // How many lightning bolts to create. local real Angle // The start point of the lightning bolt. local real Angle2 // The end point of the lightning bolt. local real Radius =Aura_Radius[Aura_Index] // The radius of the aura. // ***** Zap random target ***** if(Target!=null)then // If a target exists, zap it. // ***** Check empowered ***** if(AoL_Empowered[Aura_Index])then // Check the mana of the caster to see if we can be empowered. if(Mana>=AoL_ManaUseage)then set SpellId=AoL_EmpoweredId call SetUnitState(Caster,UNIT_STATE_MANA,Mana-AoL_ManaUseage) // ***** Create lightning pulse effect denoting the AoE of the aura ***** loop exitwhen Number==0 set Angle=GetRandomReal(0,TWO_PI) set Angle2=Angle+GetRandomReal(.5,1.5) call Bolt(AoL_EmpoweredType,X+Radius*Cos(Angle),Y+Radius*Sin(Angle),X+Radius*Cos(Angle2),Y+Radius*Sin(Angle2),GetRandomReal(0.5,1)) set Number=Number-1 endloop else // Not enough mana, unempower the aura. call IssueImmediateOrderById(Caster,AoL_UnempowerOrderId) endif endif set Dummy=CreateUnit(GetOwningPlayer(Caster),Cast_DummyId,X,Y,Atan2(GetUnitY(Target)-Y,GetUnitX(Target)-X)) call UnitAddAbility(Dummy,SpellId) call SetUnitAbilityLevel(Dummy,SpellId,GetUnitAbilityLevel(Caster,AoL_AbilityId)) call IssueTargetOrderById(Dummy,AoL_LightningOrderId,Target) call UnitApplyTimedLife(Dummy,'BTLF',1) set Dummy=null set Target=null endif // ***** Clean-up ***** set Caster=null endfunction //=========================================================================== // AoL_Update // takes nothing // returns nothing // // Updates the aura every Aura_TIMEOUT seconds. Called internally by the // aura system with Aura_Index set to the aura's id number. //=========================================================================== function AoL_Update takes nothing returns nothing local unit Caster=Aura_Caster[Aura_Index] local string LightningType=AoL_LightningType local real Angle=GetRandomReal(0,TWO_PI) local real Angle2=Angle+GetRandomReal(.5,1.5) local real X=GetUnitX(Caster) local real Y=GetUnitY(Caster) local real Radius=Aura_Radius[Aura_Index] if(AoL_Empowered[Aura_Index])then set LightningType=AoL_EmpoweredType endif call Bolt(LightningType,X+Radius*Cos(Angle),Y+Radius*Sin(Angle),X+Radius*Cos(Angle2),Y+Radius*Sin(Angle2),GetRandomReal(0.5,1)) set Caster=null endfunction //=========================================================================== // AoL_Enter // takes nothing // returns boolean - true means add the unit to the aura's targets, false means don't add the unit to the aura's targets. // // This is called in response to a unit entering the area of effect of the aura. // The trigger has the aura's id number stored in it. This aura filters based // on if the unit is allied. Only enemies are added. //=========================================================================== function AoL_Enter takes nothing returns boolean return not IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(Aura_Caster[LoadInteger(Hash,GetHandleId(GetTriggeringTrigger()),0)])) endfunction //=========================================================================== // AoL_Create // takes unit Unit - The unit to attach the aura to. // real Radius - How big the aura is. // returns integer - The aura id of the newly created aura. // // Creates a new instance of the Aspect of Lightning aura. // Attaches the aura to the unit via hashtable. //=========================================================================== function AoL_Create takes unit Unit,real Radius returns integer local integer AuraId=AS_Create(Unit,Radius,1,AoL_EnterFilter,AoL_TickFilter,AoL_UpdateFilter) set AoL_Empowered[AuraId]=false call SaveInteger(Hash,GetHandleId(Unit),AoL_Index,AuraId) return AuraId endfunction //=========================================================================== // AoL_SwitchState // takes nothing // returns nothing // // This switches the aura's empowered state from on to off and off to on // based on handling issued unit orders. This catches right-clicking // the aura's icon (autocast toggling). //=========================================================================== function AoL_SwitchState takes nothing returns nothing set AoL_Empowered[LoadInteger(Hash,GetHandleId(GetTriggerUnit()),AoL_Index)]=GetIssuedOrderId()==AoL_EmpowerOrderId endfunction //=========================================================================== // AoL_Cast // takes nothing // returns nothing // // Triggers when the owner of the aura activates the aura by left-clicking it (casting). // The triggering unit has the aura id number attached to it. //=========================================================================== function AoL_Cast takes nothing returns nothing // ***** Local variables ***** local unit Caster =GetTriggerUnit() // The owner of the aura that just activated it. local player Owner =GetTriggerPlayer() // The player that owns the aura's owner. local integer AuraId =LoadInteger(Hash,GetHandleId(Caster),AoL_Index)// The aura id the aura's owner is attached to. local integer Level =GetUnitAbilityLevel(Caster,AoL_AbilityId) // The level of the aura. local group GroupIterate=Aura_TargetsAdd[AuraId] // The group of targets to iterate over. local group GroupAdd =Aura_TargetsPtr[AuraId] // The new group of targets to add iterated targets to. local unit Unit // The current target. local unit Dummy // Dummy casters to cast 'Purge' on the iterated targets. // ***** Iterate over targets ***** loop // ***** Set-up loop ***** set Unit=FirstOfGroup(GroupIterate) exitwhen Unit==null // Exit once iterated group is empty. // ***** Swap the unit ***** call GroupRemoveUnit(GroupIterate,Unit) call GroupAddUnit(GroupAdd,Unit) // ***** Cast 'Purge' on the unit ***** set Dummy=CreateUnit(Owner,Cast_DummyId,GetUnitX(Unit),GetUnitY(Unit),0) call UnitAddAbility(Dummy,AoL_PurgeId) call SetUnitAbilityLevel(Dummy,AoL_PurgeId,Level) call IssueTargetOrderById(Dummy,AoL_PurgeOrderId,Unit) call UnitApplyTimedLife(Dummy,'BTLF',1) // ***** Clean-up loop ***** set Dummy=null set Unit=null endloop // ***** Swap unit groups ***** set Aura_TargetsAdd[AuraId]=GroupAdd set Aura_TargetsPtr[AuraId]=GroupIterate // ***** Clean-up ***** set GroupAdd=null set GroupIterate=null set Caster=null set Owner=null endfunction
WIPs By Order Posted
Updates
- Fixed documentation, and added a minor optimization.
- Inlined a function to gain a bit more performance and reduce the function count. Made the aura only consume mana when it actually has a target to cast an empowered chain lightning on.
- Added a list of all work in progress posts and concept idea posts relating to this final entry.
- Added screenshots and re-added the aura instances for the creeps and spawned units.
- Something must've changed, just in case last minute update; also, now more scary with only 666 lines of code.
Though many may deem it insane and out of the question, is a GUI configuration for a JASS entry frowned upon?
