Pyrogasm
There are some who would use any excuse to ban me.
- Reaction score
- 134
You gave up on the spell... because it lags?
If you hadn't told us, we would have had no idea.I actually made a holy spell recently but it's for my hero in the rpg I'm making. Can I post it here or is using it in the map prohibited although the map isn't even near publishing?
If you hadn't told us, we would have had no idea.
//****************************************************************************************************|
// Field of Sin |
// by |
// ~Gals~ |
//****************************************************************************************************|
// To Implement: |
// |
// 1. Copy the dummy unit "DummyClapper" into your map. |
// 2. Copy the spell "Field of Sin" into your map. |
// 3. Copy the dummy spell "Dummy Clap" into your map. |
// 4. Copy the buff "Field of Sin" into your map. |
// 5. Copy this trigger into your map. |
// 6. Copy the model "HolySpiral.mdx" and "Nebula.mdx" into your map (Export and Import). |
// 7. *Optional* Copy the icon "BTN_CR_Rebirth.blp" and "DISBTN_CR_Rebirth.blp" into your map. |
// |
// Credits to: |
// |
// 1.Crazyrussian for the spell's icon. |
// 2.WILL's nebula model. |
// 3.Daxtreme's implementing method <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" /> |
//-----------------------------------------------------------------------------------------------------
globals
unit Caster
group UnitInRange
trigger SlowTrg
trigger EndTrg
trigger Sudden
trigger Effe
lightning array CLightning
lightning array CLightningz
timer TimeEnd
integer Rotate = 0
integer Count = 0
location CastLoc
endglobals
//------------------------------------------All Constant functions------------------------------------//
constant function RawBuff takes nothing returns integer
return 039;B000039; //rawcode of SlowingBuff
endfunction
constant function RawFoS takes nothing returns integer
return 039;A000039; //rawcode of Field of Sin
endfunction
constant function RawLight takes nothing returns string
return "HWSB" //rawcode of the healing lightning
endfunction
constant function DummyID takes nothing returns integer
return 039;h001039; //rawcode of the dummyclapper
endfunction
constant function DummyClap takes nothing returns integer
return 039;A001039; //rawcode of the dummyclap
endfunction
constant function duration takes nothing returns integer
return 15 //duration of the spell takes
endfunction
constant function Mulx takes nothing returns integer
return 5 //How much damage dealt and hp heal? (Level of Ability * <Value>)
endfunction
constant function Rad takes nothing returns integer
return 500 //Radius of the spell
endfunction
constant function WantSurrucEffe takes nothing returns boolean
return true //Do you want the effect that appear when the casting of the spell?
endfunction
constant function WantAngelEffe takes nothing returns boolean
return true //Do you want the angel effect at the end of the spell?
endfunction
constant function EffePerio takes nothing returns real
return 0.05 //How fast you want the triangle to spin? (The less number you put, the faster it spins)
endfunction
//-----------------------------------------End of all CONSTANT FUNCTION------------------------------------//
//---------------------------------User Defined Function-------------------------------------//
function GetLoc takes location source1, real dist1, real angle1 returns location
local real x2 = GetLocationX(source1) + dist1 * Cos(angle1 * bj_DEGTORAD)
local real y2 = GetLocationY(source1) + dist1 * Sin(angle1 * bj_DEGTORAD)
return Location(x2, y2)
endfunction
//---------------------------------User Defined Function End---------------------------------//
//-----------------------------------------------Trigger SlowTrg Start----------------------------------------------//
function SlowCond takes nothing returns boolean //the condition of picking units
return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0==true
endfunction //Picked unit is not a structure and it is Alive
function ForSlowCond takes nothing returns nothing
local unit cr //local a unit variable with name "cr"
if IsUnitInRangeLoc(GetEnumUnit(),CastLoc, Rad()) == true then //If the picked unit is within range of the caster then
if IsUnitAlly(GetEnumUnit(),GetOwningPlayer(Caster))==false then //If the unit is an enemy of the caster then
set cr = CreateUnit(GetOwningPlayer(Caster), DummyID(), GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()), 270) //Create a dummy and set it to the unit variable we localed just now (cr)
call UnitAddAbility(cr, DummyClap()) //Add dummyclap to cr
call SetUnitAbilityLevel(cr, DummyClap(), GetUnitAbilityLevel(Caster, RawFoS())) //Set the level of dummy clap equal to the level of Fields of Sin of the caster
call UnitApplyTimedLife(cr, 039;BTLF039;, 2) //We add 2 seconds expiration timer to cr (BTLF is the "Generic Expiration" time for the unit)
call IssueImmediateOrder(cr, "thunderclap") //Order cr to cast Dummyclap (Which is based on thunderclap ability)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl",GetEnumUnit(),"origin")) //Create an awesome special effect on the targeted unit
call UnitDamageTarget(Caster, GetEnumUnit(), GetUnitAbilityLevel(Caster,RawFoS())*Mulx(),true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) //Dealt damage to the targeted unit (Level of Field of Sin of the caster * 5)
elseif IsUnitAlly(GetEnumUnit(),GetOwningPlayer(Caster)) == true then //Else if the Unit is an ally of the caster then
call DestroyEffect(AddSpecialEffectTarget("HolySpiral.mdl",GetEnumUnit(),"overhead")) //Create an awesome special effect around
call SetUnitState(GetEnumUnit(),UNIT_STATE_LIFE,GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE)+(GetUnitAbilityLevel(Caster,RawFoS())*Mulx()))//Increase the hp of the ally (Regen Level of FOS of caster * 5 hp per 0.5 seconds)
endif //closing IF
elseif IsUnitInRangeLoc(GetEnumUnit(),CastLoc, Rad()) == false then //Else if the picked unit is Not within range of the caster then
call UnitRemoveAbility(GetEnumUnit(),RawBuff()) //Remove the Slowing buff from the picked unit
endif //closing another IF
set cr = null //Nulling cr because it is not used anymore
endfunction
function SlowAct takes nothing returns nothing //This is the main action of SlowTrg
set UnitInRange = CreateGroup() //We create a group with a name "UnitInRange"
call GroupEnumUnitsInRange(UnitInRange, GetLocationX(CastLoc), GetLocationY(CastLoc),1000, Condition(function SlowCond)) //We pick units into the last created group (Unit within 1000 range is being picked and it conditions are at Function SlowCond)
call ForGroup(UnitInRange, function ForSlowCond) //We starts the loop action of the group (Using function ForSlowCond)
call DestroyGroup(UnitInRange) //Destroy UnitInRange to prevent future leaks
endfunction
//-----------------------------------------------Trigger SlowTrg End----------------------------------------------//
//-----------------------------------------------Trigger EndTrg Start---------------------------------------------//
//This trigger is clearing all those messy things in the end...it triggers when the timer expired
function ForClearBuff takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),RawBuff())
endfunction
function EndTrgAct takes nothing returns nothing
local location circle
local integer loop1 = 1
local integer loop2 = 36 //localinzing variable
local group all = CreateGroup()
local integer start = 1
local integer end = 50
call DestroyTimer(TimeEnd) //Destroy the expired timer to prevent leaks
call GroupEnumUnitsInRange(all, GetLocationX(CastLoc), GetLocationY(CastLoc),2000, Condition(function SlowCond)) //pick every unit in 2000 range from the caster into group "all"....condition are using function SlowCond
call ForGroup(all, function ForClearBuff) //loop of the group starts (code from function ForClearBuff)
call DestroyLightning(CLightningz[1])
call DestroyLightning(CLightningz[2])
call DestroyLightning(CLightningz[3]) //Destroy all those create lightning
call DestroyLightning(CLightningz[4])
call DestroyLightning(CLightningz[5])
call DestroyLightning(CLightningz[6])
//-------------------------------Awesome Special Effects Starts-------------------------------------//
if WantAngelEffe() == true then
loop
exitwhen loop1>loop2
set circle = GetLoc(CastLoc, Rad(), loop1*10)
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",circle))
call RemoveLocation(circle)
set loop1 = loop1+1
endloop
endif
//-------------------------------Awesome Special Effects Ends-------------------------------------//
call RemoveLocation(CastLoc) //Remove location to prevent leaks (location removed is CastLoc)
loop
exitwhen start>end
call DestroyLightning(CLightning[start]) //Destroy the circle lightning
set start = start+1
endloop
call DisableTrigger(Effe) //Disable Trigger (Effe)
call DestroyTrigger(Effe) //Destroy Trigger (Effe)
call DestroyTrigger(GetTriggeringTrigger()) //Destroy Trigger (This trigger)
call DestroyTrigger(SlowTrg) //Destroy Trigger (SlowTrg)
call DestroyTrigger(Sudden) //Destroy Trigger (Sudden)
call DestroyGroup(all) //Destroy the group localed in this trigger (all)
set all = null //null it to prevent leaks
set circle = null //Nulling circle
endfunction
//-----------------------------------------------Trigger EndTrg End---------------------------------------------//
//-------------------------------------------------Trigger Effe Start---------------------------------------------------//
//This trigger is the system that makes the triangle inside the circles turns...it is hard to modify...it is not recomend to modify it
//JASS newbie might had trouble modifying this...though
function EffeAct takes nothing returns nothing
local location circle
local location circle2 //Localizing all variable
local integer loop1 = 1
local integer loop2 = 36
//==================Checking system Start================//
//(Better Not to modify this unless you know what you are doing)
set Count = Count +1 //These lines are a lightning checking system which prevent crashes between lightning effect
if Count >=2 then //Same as last line
call DestroyLightning(CLightningz[1])
call DestroyLightning(CLightningz[2])
call DestroyLightning(CLightningz[3])
call DestroyLightning(CLightningz[4])
call DestroyLightning(CLightningz[5])
call DestroyLightning(CLightningz[6])
set Count = 1
endif
//==================Checking system End=================//
//---------Triangle 1-----------//
set circle = GetLoc(CastLoc, Rad()-50, 45+Rotate) //Top Right Position
set circle2 = GetLoc(CastLoc, Rad()-50, 90+45+Rotate) //Top Left Position
set CLightningz[Count]=AddLightningEx(RawLight(), true, GetLocationX(circle), GetLocationY(circle), GetLocationZ(circle), GetLocationX(circle2), GetLocationY(circle2), GetLocationZ(circle2))
call RemoveLocation(circle)
call RemoveLocation(circle2)
set Count = Count +1
set circle = GetLoc(CastLoc, Rad()-50, 90+45+Rotate) //Top Left Postition
set circle2 = GetLoc(CastLoc, Rad()-50, 90+180+Rotate) //Bottom Position
set CLightningz[Count]=AddLightningEx(RawLight(), true, GetLocationX(circle), GetLocationY(circle), GetLocationZ(circle), GetLocationX(circle2), GetLocationY(circle2), GetLocationZ(circle2))
call RemoveLocation(circle)
call RemoveLocation(circle2)
set Count = Count +1
set circle = GetLoc(CastLoc, Rad()-50, 90+180+Rotate) //Bottom
set circle2 = GetLoc(CastLoc, Rad()-50, 45+Rotate) //Top Right
set CLightningz[Count]=AddLightningEx(RawLight(), true, GetLocationX(circle), GetLocationY(circle), GetLocationZ(circle), GetLocationX(circle2), GetLocationY(circle2), GetLocationZ(circle2))
call RemoveLocation(circle)
call RemoveLocation(circle2)
set Count = Count +1
//----------Triangle 1 End------//
//----------Triangle 2----------//
set circle = GetLoc(CastLoc,Rad()-50, 180+45-Rotate) //Bottom Left
set circle2 = GetLoc(CastLoc,Rad()-50, 270+45-Rotate) //Bottom Right
set CLightningz[Count]=AddLightningEx(RawLight(), true, GetLocationX(circle), GetLocationY(circle), GetLocationZ(circle), GetLocationX(circle2), GetLocationY(circle2), GetLocationZ(circle2))
call RemoveLocation(circle)
call RemoveLocation(circle2)
set Count = Count +1
set circle = GetLoc(CastLoc, Rad()-50, 270+45-Rotate) //Bottom Right
set circle2 = GetLoc(CastLoc, Rad()-50, 90-Rotate) //Top
set CLightningz[Count]=AddLightningEx(RawLight(), true, GetLocationX(circle), GetLocationY(circle), GetLocationZ(circle), GetLocationX(circle2), GetLocationY(circle2), GetLocationZ(circle2))
call RemoveLocation(circle)
call RemoveLocation(circle2)
set Count = Count +1
set circle = GetLoc(CastLoc,Rad()-50, 90-Rotate) //Top
set circle2 = GetLoc(CastLoc,Rad()-50, 180+45-Rotate) //Bottom Left
set CLightningz[Count]=AddLightningEx(RawLight(), true, GetLocationX(circle), GetLocationY(circle), GetLocationZ(circle), GetLocationX(circle2), GetLocationY(circle2), GetLocationZ(circle2))
call RemoveLocation(circle)
call RemoveLocation(circle2)
set Count = Count +1
//--------Triangle 2 End------------//
set Rotate = Rotate +10
endfunction
//-------------------------------------------------Trigger Effe End---------------------------------------------------//
//-----------------------Main Trigger Starts (This trigger's configuration)-------------------------//
function Trig_HolyFieldSet_Conditions takes nothing returns boolean // <------ The Condition of this Trigger
return GetSpellAbilityId() == RawFoS() //Ability being casted == Field of Sin
endfunction
function Trig_HolyFieldSet_Actions takes nothing returns nothing
local location circle
local location circle2 //Localizing all thoses variable
local integer loop1 =1
local integer loop2 =0
set Sudden = CreateTrigger()
set EndTrg = CreateTrigger() //Creating neccesaries trigger (Sudden,EndTrg,SlowTrg,Effe)
set SlowTrg = CreateTrigger()
set Effe = CreateTrigger()
set TimeEnd = CreateTimer() //Create a Timer
//================================Trigger Registration Start==================================//
call TriggerRegisterTimerEvent(Effe,EffePerio(),true) //Add event to Effe
call TriggerAddAction( Effe, function EffeAct ) //Add action function to Effe (EffeAct)
call DisableTrigger(Effe) //Disable this trigger
call TriggerRegisterAnyUnitEventBJ(Sudden, EVENT_PLAYER_UNIT_SPELL_ENDCAST) //Add event to Sudden(Unit finish casting a spell)
//When the unit suddenly moved ...stunned...or anything...it will straight cancel the action he was doing
call TriggerAddCondition(Sudden, Condition(function Trig_HolyFieldSet_Conditions))//Add condition to this trigger (Using the same condition as HolyFieldSet)
call TriggerAddAction(Sudden, function EndTrgAct) //Add action to Sudden (EndTrgAct)
call TriggerRegisterTimerEvent(SlowTrg,.5,true) //Add event to SlowTrg (Every 0.50 seconds)
call TriggerAddAction(SlowTrg, function SlowAct)//Add action to it (SlowAct)
call DisableTrigger(SlowTrg) //Disable this trigger
//================================Trigger Registration End==================================//
set Caster = GetSpellAbilityUnit() //set Caster = the ability caster
set CastLoc = GetUnitLoc(Caster) //set CastLoc = the position of the caster
//=================================Circle Creation Start=====================================//
set loop2 = 36 //the loop2 represent degree (i uses 10*loop2 later)
loop //We will start a loop
exitwhen loop1>loop2 //The exit condition of this loop (When loop1 is bigger than loop2
set circle = GetLoc(CastLoc, Rad(), loop1*10) //set circle to 1st position (CastLoc offset by x range towards loop1*10 degree
set circle2 = GetLoc(CastLoc, Rad(), (loop1*10)+10) //set circle2 to 2nd position (CastLoc offset by x range towards loop1*10+10 degree
set CLightning[loop1] = AddLightningEx(RawLight(), true, GetLocationX(circle), GetLocationY(circle), GetLocationZ(circle), GetLocationX(circle2), GetLocationY(circle2), GetLocationZ(circle2)) //We connection the 2 points by a lightning effect
if WantSurrucEffe() == true then
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Orc\\Reincarnation\\ReincarnationTarget.mdl",circle)) //we create a awesome special effect at the same time
endif
call RemoveLocation(circle) //Remove located location to prevent leaks (location being removed is circle)
call RemoveLocation(circle2)//same as last line...(location being removed is circle2)
set loop1 = loop1+1 //set loop1 = loop1+1...increase the integer of loop1 to make it reach the condition to exit this loop
endloop
//=================================Circle Creation End=======================================//
call EnableTrigger(SlowTrg) //enable SlowTrg
call EnableTrigger(Effe) //enable Effe
call TimerStart(TimeEnd, I2R(duration()), false, null) //Start Timer(Timer being started is TimeEnd and the duration is stated at top....the constant function area
call TriggerRegisterTimerExpireEvent(EndTrg, TimeEnd) //Add event to EndTrg (Event is when TimeEnd expired
call TriggerAddAction(EndTrg, function EndTrgAct) //Add action to EndTrg (EndTrgAct)
set circle = null //null circle...since we are not using it from now on
set circle2 = null //same as last line
endfunction
//-----------------------Main Trigger Ends (This trigger's configuration)-------------------------//
//===========================================================================
function InitTrig_FieldofSinSet takes nothing returns nothing
set gg_trg_FieldofSinSet = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_FieldofSinSet, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_FieldofSinSet, Condition( function Trig_HolyFieldSet_Conditions ) )
call TriggerAddAction( gg_trg_FieldofSinSet, function Trig_HolyFieldSet_Actions )
endfunction
The Spell said:— Chains of Solidarity
Links the caster and target unit together with a bond of immeasureable energy from their own life-forces. All units in the path of this link will constantly be healed for a small amount.
Level 1 - Heals 35 health per second, lasts 11 seconds.
Level 2 - Heals 50 health per second, lasts 12 seconds.
Level 3 - Heals 65 health per second, lasts 13 seconds.
//*****************************************************************************************\\
// Spell Name: Chains of Solidarity \\
// Spell Author: Pyrogasm \\
// \\
// Follows the JESP Standard \\
//*****************************************************************************************\\
constant function CoS_AbilityId takes nothing returns integer
return 039;A000039; //Rawcode of the spell itself
endfunction
constant function CoS_DummyUnitId takes nothing returns integer
return 039;h000039; //This unit MUST have a "cast backswing point" of 0.00
endfunction //And CANNOT have negative regeneration
constant function CoS_DummyLightningSpellId takes nothing returns integer
return 039;A001039; //The "CoS Dummy Lightning spell" determines the lightning effect
endfunction
constant function CoS_DummyBuffSpellId takes nothing returns integer
return 039;A002039; //The "CoS Dummy Buff Spell" spell
endfunction
constant function CoS_BuffId takes nothing returns integer
return 039;B000039; //The "Chains of Solidarity (Buff)" buff
endfunction
constant function CoS_CrowFormAbilityId takes nothing returns integer
return 039;Amrf039; //Medivh's Crow form ability; you don't need to change this rawcode unless
endfunction //you modified it in your map. If you have, copy it, reset the copied one,
//and use its rawcode here.
constant function CoS_BreakDistance takes integer Level returns real
return 1500.00 //If the two units are farther than this distance apart, the spell
endfunction //Will end.
constant function CoS_DummyFlyHeight takes integer Level returns real
return 30.00 //If you want the lightning effect on the caster to be higher or lower.
endfunction //It will always go directly to the target.
constant function CoS_Duration takes integer Level returns real
return 10.00 + (1.00*Level) //Duration of the lightning effect is changed in the Object Editor
endfunction
constant function CoS_HealthPerSecond takes integer Level returns real
return 20.00 + (15.00*Level) //In Health per Second
endfunction
constant function CoS_LineWidth takes integer Level returns real
return 145.00 //Distance from center to outer edge of line
endfunction
constant function CoS_CircleOptions takes integer Level returns integer
return 3 //0 = no circles; 1 = only around target; 2 = only around caster; 3 = around both
endfunction
constant function CoS_CircleRadius takes integer Level, integer WhichCircle returns real
if WhichCircle == 1 then //Radius of the circle(s) around the caster/target
return 75.00 //This might conceivably be the same as the LineWidth.
elseif WhichCircle == 2 then //To make it only affect the caster/target, simply put 10.00
return 75.00 //Or something.
endif
return 0.00 //Just a safety return; don't change this
endfunction
constant function CoS_MinHeight takes integer Level returns real
return 0.00 //No units below this height will be affected
endfunction
constant function CoS_MaxHeight takes integer Level returns real
return 500.00 //No units above this height will be affected
endfunction
constant function CoS_TimerInterval takes integer Level returns real
return 0.04 //Interval that the timer runs at; this affects the lightning effect
endfunction
constant function CoS_HealAllies takes integer Level returns boolean
return true
endfunction
constant function CoS_HealEnemies takes integer Level returns boolean
return false
endfunction
constant function CoS_HealOnCast takes integer Level returns boolean
return false
endfunction
constant function CoS_EffectPath takes nothing returns string
return "Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl"
endfunction
constant function CoS_EffectAttach takes nothing returns string
return "chest"
endfunction
constant function CoS_EffectInterval takes nothing returns real
return 0.48 //This should probably be a multiple of the timer interval
endfunction
//*****************************************************************************************\\
// Start External Functions \\
//*****************************************************************************************\\
//=============================
// Function by grim001
//=============================
function GroupEnumUnitsInQuad takes group g, real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4, real minHeight, real maxHeight, boolexpr f returns nothing
local real maxx
local real minx
local real maxy
local real miny
local unit u
local real ux
local real uy
if x1 >= x2 and x1 >= x3 and x1 >= x4 then
set maxx = x1
elseif x2 >= x1 and x2 >= x3 and x2 >= x4 then
set maxx = x2
elseif x3 >= x1 and x3 >= x2 and x3 >= x4 then
set maxx = x3
else
set maxx = x4
endif
if x1 <= x2 and x1 <= x3 and x1 <= x4 then
set minx = x1
elseif x2 <= x1 and x2 <= x3 and x2 <= x4 then
set minx = x2
elseif x3 <= x1 and x3 <= x2 and x3 <= x4 then
set minx = x3
else
set minx = x4
endif
if y1 >= y2 and y1 >= y3 and y1 >= y4 then
set maxy = y1
elseif y2 >= y1 and y2 >= y3 and y2 >= y4 then
set maxy = y2
elseif y3 >= y1 and y3 >= y2 and y3 >= y4 then
set maxy = y3
else
set maxy = y4
endif
if y1 <= y2 and y1 <= y3 and y1 <= y4 then
set miny = y1
elseif y2 <= y1 and y2 <= y3 and y2 <= y4 then
set miny = y2
elseif y3 <= y1 and y3 <= y2 and y3 <= y4 then
set miny = y3
else
set miny = y4
endif
call SetRect(udg_CoS_Rect, minx, miny, maxx, maxy)
call GroupEnumUnitsInRect(udg_CoS_Group, udg_CoS_Rect, f)
loop
set u = FirstOfGroup(udg_CoS_Group)
exitwhen u == null
call GroupRemoveUnit(udg_CoS_Group, u)
if GetUnitFlyHeight(u) <= maxHeight and GetUnitFlyHeight(u) >= minHeight then
set ux = GetUnitX(u)
set uy = GetUnitY(u)
if (uy - y1)*(x2 - x1) - (ux - x1)*(y2 - y1) <= 0. then
if (uy - y2)*(x3 - x2) - (ux - x2)*(y3 - y2) <= 0. then
if (uy - y3)*(x4 - x3) - (ux - x3)*(y4 - y3) <= 0. then
if (uy - y4)*(x1 - x4) - (ux - x4)*(y1 - y4) <= 0. then
call GroupAddUnit(g, u)
endif
endif
endif
endif
endif
endloop
endfunction
//*****************************************************************************************\\
// End External Functions \\
//*****************************************************************************************\\
function CoS_CastConditions takes nothing returns boolean
return GetSpellAbilityId() == CoS_AbilityId()
endfunction
function CoS_HealFilter takes nothing returns boolean
local unit U = GetFilterUnit()
local boolean Ally = bj_slotControlUsed[95] and IsUnitAlly(U, bj_forceRandomCurrentPick)
local boolean Enemy = bj_slotControlUsed[96] and IsUnitEnemy(U, bj_forceRandomCurrentPick)
set U = null
return Ally or Enemy
endfunction
function CoS_Callback takes nothing returns nothing
local timer T = GetExpiredTimer()
local string TTable = GetAttachmentTable(T)
local unit U = GetTableUnit(TTable, "CoS Caster")
local unit U2 = GetTableUnit(TTable, "CoS Target")
local integer Level = GetTableInt(TTable, "CoS Level")
local real X = GetUnitX(U)
local real Y = GetUnitY(U)
local real X2 = GetUnitX(U2)
local real Y2 = GetUnitY(U2)
local unit Dummy = GetTableUnit(TTable, "CoS Dummy")
local real Duration = CoS_Duration(Level)
local real TimerInterval = CoS_TimerInterval(Level)
local group G
local unit U3
local real HealAmount
local real Angle = CoS_BreakDistance(Level)
local real Width
local string EffectPath
local string EffectAttach
local real Elapsed = GetTableReal(TTable, "CoS Elapsed Time")
local boolean Effects
local integer CircleOptions
local group G2
local real Side1X
local real Side1Y
local real Side2X
local real Side2Y
local real RX1
local real RY1
local real RX2
local real RY2
local real RX3
local real RY3
local real RX4
local real RY4
if Elapsed > Duration or GetWidgetLife(U) < 0.406 or GetWidgetLife(U2) < 0.406 or (X-X2)*(X-X2)+(Y-Y2)*(Y-Y2) > Angle*Angle then
set Level = CoS_BuffId()
call RemoveUnit(Dummy)
call UnitRemoveAbility(U, Level)
call UnitRemoveAbility(U2, Level)
call PauseTimer(T)
call CleanAttachedVars(T)
call DestroyTimer(T)
else
call SetTableReal(TTable, "CoS Elapsed Time", Elapsed+TimerInterval)
set Width = CoS_LineWidth(Level)
set HealAmount = CoS_HealthPerSecond(Level)/(1.00/TimerInterval)
set CircleOptions = CoS_CircleOptions(Level)
set Effects = ModuloReal(Elapsed, CoS_EffectInterval()) <= TimerInterval
if Effects then
set EffectPath = CoS_EffectPath()
set EffectAttach = CoS_EffectAttach()
endif
call SetUnitX(Dummy, X)
call SetUnitY(Dummy, Y)
set Angle = Atan2((Y2-Y),(X2-X))
set Side1X = X2 - X
set Side1Y = Y2 - Y
set Side2X = Width*Cos(Angle-1.5708)
set Side2Y = Width*Sin(Angle-1.5708)
set RX4 = X + Side2X*0.5
set RY4 = Y + Side2Y*0.5
set RX3 = RX4 + Side1X
set RY3 = RY4 + Side1Y
set RX2 = RX3 - Side2X
set RY2 = RY3 - Side2Y
set RX1 = RX2 - Side1X
set RY1 = RY2 - Side1Y
set bj_slotControlUsed[95] = CoS_HealAllies(Level)
set bj_slotControlUsed[96] = CoS_HealEnemies(Level)
set bj_forceRandomCurrentPick = GetOwningPlayer(U)
set G = CreateGroup()
call GroupEnumUnitsInQuad(G, RX1, RY1, RX2, RY2, RX3, RY3, RX4, RY4, CoS_MinHeight(Level), CoS_MaxHeight(Level), Condition(function CoS_HealFilter))
if CircleOptions > 0 then
set G2 = CreateGroup()
set bj_groupAddGroupDest = G
if CircleOptions == 1 or CircleOptions == 3 then
call GroupEnumUnitsInRange(G2, X2, Y2, CoS_CircleRadius(Level, 1), Condition(function CoS_HealFilter))
call ForGroup(G2, function GroupAddGroupEnum)
call GroupClear(G2)
endif
if CircleOptions == 2 or CircleOptions == 3 then
call GroupEnumUnitsInRange(G2, X, Y, CoS_CircleRadius(Level, 2), Condition(function CoS_HealFilter))
call ForGroup(G2, function GroupAddGroupEnum)
endif
call DestroyGroup(G2)
set G2 = null
endif
loop
set U3 = FirstOfGroup(G)
exitwhen U3 == null
call SetWidgetLife(U3, GetWidgetLife(U3)+HealAmount)
if Effects then
call DestroyEffect(AddSpecialEffectTarget(EffectPath, U3, EffectAttach))
endif
call GroupRemoveUnit(G, U3)
endloop
call DestroyGroup(G)
set G = null
endif
set U = null
set U2 = null
set Dummy = null
endfunction
function CoS_Cast takes nothing returns nothing
local unit U = GetTriggerUnit()
local unit U2 = GetSpellTargetUnit()
local integer Level = GetUnitAbilityLevel(U, CoS_AbilityId())
local real X = GetUnitX(U)
local real Y = GetUnitY(U)
local real X2
local real Y2
local integer DummySpellId = CoS_DummyLightningSpellId()
local unit Dummy
local real Duration = CoS_Duration(Level)
local real TimerInterval = CoS_TimerInterval(Level)
local group G
local unit U3
local timer T = CreateTimer()
local string TTable = GetAttachmentTable(T)
local real HealAmount
local real Angle
local real Width
local string EffectPath
local string EffectAttach
local integer CircleOptions
local group G2
local real Side1X
local real Side1Y
local real Side2X
local real Side2Y
local real RX1
local real RY1
local real RX2
local real RY2
local real RX3
local real RY3
local real RX4
local real RY4
set bj_forceRandomCurrentPick = GetOwningPlayer(U)
set Dummy = CreateUnit(bj_forceRandomCurrentPick, CoS_DummyUnitId(), X, Y, 0.00)
call UnitAddAbility(Dummy, DummySpellId)
call SetUnitAbilityLevel(Dummy, DummySpellId, Level)
call IssueTargetOrder(Dummy, "fingerofdeath", U2)
call UnitApplyTimedLife(Dummy, 039;BTLF039;, Duration+TimerInterval)
call SetTableObject(TTable, "CoS Caster", U)
call SetTableObject(TTable, "CoS Target", U2)
call SetTableObject(TTable, "CoS Dummy", Dummy)
call SetTableInt(TTable, "CoS Level", Level)
set DummySpellId = CoS_CrowFormAbilityId()
call UnitAddAbility(Dummy, DummySpellId)
call UnitRemoveAbility(Dummy, DummySpellId)
call SetUnitFlyHeight(Dummy, CoS_DummyFlyHeight(Level), 10000.00)
set DummySpellId = CoS_DummyBuffSpellId()
set Dummy = CreateUnit(bj_forceRandomCurrentPick, CoS_DummyUnitId(), X, Y, 0.00)
call UnitAddAbility(Dummy, DummySpellId)
call SetUnitAbilityLevel(Dummy, DummySpellId, Level)
call IssueTargetOrder(Dummy, "unholyfrenzy", U)
call IssueTargetOrder(Dummy, "unholyfrenzy", U2)
call UnitApplyTimedLife(Dummy, 039;BTLF039;, 1.00)
if CoS_HealOnCast(Level) then
set HealAmount = CoS_HealthPerSecond(Level)/(1.00/TimerInterval)
set Width = CoS_LineWidth(Level)
set EffectPath = CoS_EffectPath()
set EffectAttach = CoS_EffectAttach()
set CircleOptions = CoS_CircleOptions(Level)
set X2 = GetUnitX(U2)
set Y2 = GetUnitY(U2)
set Angle = Atan2((Y2-Y),(X2-X))
set Side1X = X2 - X
set Side1Y = Y2 - Y
set Side2X = Width*Cos(Angle-1.5708)
set Side2Y = Width*Sin(Angle-1.5708)
set RX1 = X + Side2X*0.5
set RY1 = Y + Side2Y*0.5
set RX2 = RX1 + Side1X
set RY2 = RY1 + Side1Y
set RX3 = RX2 - Side2X
set RY3 = RY2 - Side2Y
set RX4 = RX3 - Side1X
set RY4 = RY3 - Side1Y
set bj_slotControlUsed[95] = CoS_HealAllies(Level)
set bj_slotControlUsed[96] = CoS_HealEnemies(Level)
set G = CreateGroup()
call GroupEnumUnitsInQuad(G, RX1, RY1, RX2, RY2, RX3, RY3, RX4, RY4, CoS_MinHeight(Level), CoS_MaxHeight(Level), Condition(function CoS_HealFilter))
if CircleOptions > 0 then
set G2 = CreateGroup()
set bj_groupAddGroupDest = G
if CircleOptions == 1 or CircleOptions == 3 then
call GroupEnumUnitsInRange(G2, X2, Y2, CoS_CircleRadius(Level, 1), Condition(function CoS_HealFilter))
call ForGroup(G2, function GroupAddGroupEnum)
call GroupClear(G2)
endif
if CircleOptions == 2 or CircleOptions == 3 then
call GroupEnumUnitsInRange(G2, X, Y, CoS_CircleRadius(Level, 2), Condition(function CoS_HealFilter))
call ForGroup(G2, function GroupAddGroupEnum)
endif
call DestroyGroup(G2)
set G2 = null
endif
loop
set U3 = FirstOfGroup(G)
exitwhen U3 == null
call SetWidgetLife(U3, GetWidgetLife(U3)+HealAmount)
call DestroyEffect(AddSpecialEffectTarget(EffectPath, U3, EffectAttach))
call GroupRemoveUnit(G, U3)
endloop
call DestroyGroup(G)
set G = null
endif
call TimerStart(T, TimerInterval, true, function CoS_Callback)
set U = null
set U2 = null
set Dummy = null
endfunction
function CoS_InitRect takes nothing returns nothing
local timer T = GetExpiredTimer() //For some reason, initializing in the InitTrig
set udg_CoS_Rect = Rect(0.00, 0.00, 0.00, 0.00) //Is broken...
call PauseTimer(T)
call DestroyTimer(T)
set T = null
endfunction
//===========================================================================
function InitTrig_Chains_of_Solidarity takes nothing returns nothing
set gg_trg_Chains_of_Solidarity = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Chains_of_Solidarity, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Chains_of_Solidarity, Condition(function CoS_CastConditions))
call TriggerAddAction(gg_trg_Chains_of_Solidarity, function CoS_Cast)
call Preload(CoS_EffectPath())
call TimerStart(CreateTimer(), 0.10, false, function CoS_InitRect)
endfunction
Sanctuary of Light
Gods hand is felt upon the earth, damaging the enemys of Sage and lowering their attack damage.
With the help of God's touch Sage opens 8 Seals of Purity creating a cleansing sanctuary where the men that fight alongside him will have their armor increased and will heal all units and damage all undead in the sanctuary on death.
In adition, if an enemy unit is slain in the sanctuary the killing unit will gain increased attack speed for a short duration. However, if a seal is destroyed, the godsent sanctuary will be vanquished. 1.5 seconds casting time
LvL 1 - 400 area of effect. 250 damage on summon, 5 point armor increase, lowers enemy attack damage by 20% and increases attack/movement speed by 40/25 on kill. Heals/damages 150/75 on death. Last 20 sec.
LvL 2 - 500 area of effect. 350 damage on summon, 10 point armor increase, lowers enemy attack damage by 30% and increases attack/movement speed by 50/35 on kill. Heals/damages 200/100 on death. Last 25 sec.
LvL 3 - 600 area of effect.450 damage on summon, 20 point armor increase, lowers enemy attack damage by 50% and increases attack/movement speed by 60/45 on kill. Heals/damages 250/125 on death. Last 30 sec.
Cooldown: 80/120/160