//TESH.scrollpos=13
//TESH.alwaysfold=0
function TargetFilter takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), bj_groupEnumOwningPlayer) and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and (GetWidgetLife(GetFilterUnit())>0.405)
endfunction
function DamageEnemiesArea takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType, string sfx returns nothing
local group g = CreateGroup()
local boolexpr b = Condition(function TargetFilter)
local real x1
local real y1
local unit t
set bj_groupEnumOwningPlayer = GetOwningPlayer(whichUnit)
call GroupEnumUnitsInRange(g, x, y, radius, b)
call DestroyBoolExpr(b)
loop
set t = FirstOfGroup(g)
exitwhen t == null
call GroupRemoveUnit(g,t)
set x1 = GetUnitX(t)
set y1 = GetUnitY(t)
call DestroyEffect(AddSpecialEffect(sfx, x1, y1))
call UnitDamageTarget(whichUnit,t,amount,attack, ranged,attackType,damageType,weaponType)
endloop
call DestroyGroup(g)
set g = null
set b = null
set x = 0.00
set y = 0.00
endfunction
Name | Type | is_array | initial_value |
AIProcess | integer | Yes | |
Angle | real | No | |
AR_Cast_Number | integer | No | |
AR_Level | integer | Yes | |
AR_Target | location | Yes | |
AR_Target_Unit | unit | Yes | |
AT_AddDistanceLoop | real | Yes | |
AT_AllowCliffs | boolean | Yes | |
AT_AllowCliffsLoop | boolean | Yes | |
AT_AllowWater | boolean | Yes | |
AT_AllowWaterLoop | boolean | Yes | |
AT_AngleMove | real | Yes | |
AT_AngleMoveLoop | real | Yes | |
AT_AoE1Axe | real | Yes | |
AT_AoE1AxeLoop | real | Yes | |
AT_AoE2Axe | real | Yes | |
AT_AoE2AxeLoop | real | Yes | |
AT_AoE3Axe | real | Yes | |
AT_AoE3AxeLoop | real | Yes | |
AT_AxeLoop | unit | Yes | |
AT_AxePointLoop | unit | Yes | |
AT_AxeSpeedCurrent | real | Yes | |
AT_AxeSpeedCurrentLoop | real | Yes | |
AT_AxeSpeedDecreasement | real | Yes | |
AT_AxeSpeedDecreasementLoop | real | Yes | |
AT_AxeSpeedDefault | real | Yes | |
AT_AxeSpeedDefaultLoop | real | Yes | |
AT_BloodEffect | string | Yes | |
AT_BloodEffectLoop | string | Yes | |
AT_Caster | unit | Yes | |
AT_CasterLoop | unit | Yes | |
AT_Damages | real | Yes | |
AT_DamagesLoop | real | Yes | |
AT_DestroyTrees | boolean | Yes | |
AT_DestroyTreesLoop | boolean | Yes | |
AT_DistanceAxe | real | Yes | |
AT_DistanceAxeLoop | real | Yes | |
AT_Group | group | No | |
AT_GroupAxeLoop | group | No | |
AT_GroupLoop | group | Yes | |
AT_IntegerCasting | integer | Yes | |
AT_IntegerThrowingLoop | integer | Yes | |
AT_Level | integer | Yes | |
AT_NumberAxesRemaining | integer | Yes | |
AT_NumberAxesThrown | integer | Yes | |
AT_Return | boolean | Yes | |
AT_TempGroupLoop | group | No | |
AT_TempPoint | location | No | |
AT_TempPoint2 | location | No | |
AT_TempPoint3 | location | No | |
AT_TimerCasting | real | Yes | |
AT_TimerElapsedCasting | real | Yes | |
Avalanche_Caster | unit | Yes | |
Avalanche_Location | location | Yes | |
Avalanche_Max | integer | No | |
Avalanche_Stone_Caster | unit | Yes | |
Avalanche_Stone_Distance | real | Yes | |
Avalanche_Stone_Dummy | unit | Yes | |
Avalanche_Stone_Instance | integer | Yes | |
Avalanche_Stone_Max | integer | No | |
Beam_Return2 | integer | Yes | |
Caster | unit | No | |
CL_AbilityLevel | integer | Yes | |
CL_AOE | real | Yes | |
CL_Caster | unit | Yes | |
CL_Count | integer | Yes | |
CL_Damage | integer | Yes | |
CL_FirstTarget | boolean | Yes | |
CL_Group | group | Yes | |
CL_Loc | location | Yes | |
CL_Player | player | Yes | |
CL_Slashes | integer | Yes | |
CL_Special | effect | Yes | |
CL_Target | unit | Yes | |
CL_Victim | unit | Yes | |
Created | unit | Yes | |
CS_Angle | real | Yes | |
CS_Caster | unit | Yes | |
CS_Damage | real | Yes | |
CS_Distance | real | Yes | |
CS_SpellGroup | group | No | |
CS_SpellIndex | integer | No | |
CS_SpellPower | integer | Yes | |
CS_SpellRan | boolean | Yes | |
CS_TimeCompletion | real | Yes | |
CS_TimeInterval | real | Yes | |
DashCaster | unit | Yes | |
DashDamage | real | Yes | |
DashDistance | integer | Yes | |
DashGroup1 | group | No | |
DashGroup2 | group | No | |
DashGroup3 | group | No | |
DashInteger | integer | Yes | |
DashPoint3 | location | Yes | |
DashPoint4 | location | Yes | |
DashPoint5 | location | Yes | |
DashReal1 | real | Yes | |
DashReal2 | real | Yes | |
DashSpeed | real | Yes | |
DEBUG | boolean | No | |
DEBUG_Gold | integer | No | |
DEBUG_GoldN | integer | No | |
DefeatStrings | string | Yes | |
Distance | real | Yes | |
DP_Boolean | boolean | Yes | |
DP_Caster | unit | Yes | |
DP_Damage | real | Yes | |
DP_Dummy | unit | Yes | |
DP_Dummy2 | unit | Yes | |
DP_Duration | real | Yes | |
DP_Expired | real | Yes | |
DP_Group | group | Yes | |
DP_Index1 | integer | No | |
DP_Index2 | integer | No | |
DP_IndexLoop | integervar | No | |
DP_loop | integervar | No | |
DP_Player | player | Yes | |
DP_TargetPoint | location | Yes | |
DP_TempPoint | location | No | |
DummyUnits | unit | Yes | |
ESCaster | unit | No | |
ESCasterLoc | location | No | |
ESDummy | unit | Yes | |
ESDummyLoc | location | No | |
ESTimer | timer | No | |
ExtraStreak_Chcker | boolean | Yes | |
ExtraStreak_Kills | integer | Yes | |
ExtraStreak_Sounds | sound | Yes | |
ExtraStreak_Strings | string | Yes | |
ExtraStreak_Timer | integer | Yes | |
ExtraStreakInt | integervar | No | |
FlyingHeight | real | No | |
FSCaster | unit | Yes | |
FSCasterPoint | location | Yes | |
FSCount | integer | No | |
FSDistance | real | Yes | |
FSDummy | unit | Yes | |
FSDummyGroup | group | Yes | |
FSFace | real | Yes | |
FSFade | real | Yes | |
FSFadeC | real | Yes | |
FSFadeC2 | real | Yes | |
FSHas | boolean | Yes | |
FSIndex | integer | No | |
FSInteger | integervar | No | |
FSLastRecycled | integer | No | |
FSMax | integer | No | |
FSMaxDistance | real | Yes | |
FSMove | real | Yes | |
FSRecycledList | integer | Yes | |
FSTime | real | No | |
HandleID | integer | No | |
harvester | unit | No | |
Hashtable | hashtable | No | |
Hasis | hashtable | No | |
Heroes | unit | Yes | |
i | integervar | No | |
INIAI | integer | Yes | |
Integer | integer | Yes | |
Inter_B | integervar | No | |
Key | integer | No | |
Laughattacker | unit | No | |
Laughdummy | unit | No | |
Laughpoint | location | No | |
Laughunit | unit | No | |
Leap_Angle | real | Yes | |
Leap_Caster | unit | No | |
Leap_CasterLoc | location | No | |
Leap_CountMaxSize | integer | No | |
Leap_Counts | integer | No | |
Leap_CustomValue | integer | No | |
Leap_Distance | real | Yes | |
Leap_DistanceTravel | real | Yes | |
Leap_MoveGroup | group | No | |
Leap_Movement | location | No | |
Leap_UnitGroup | group | No | |
loc | location | No | |
LoopInteger | integervar | No | |
Max_Index | integer | No | |
MB_Board | multiboard | Yes | |
MB_Colours | string | Yes | |
MB_Heroes | unitcode | Yes | |
MB_HeroIcon | string | Yes | |
MB_Heroloop | integervar | No | |
MB_KillingGold | integer | No | |
MB_loop | integervar | No | |
MB_PlayerAssists | integer | Yes | |
MB_PlayerDeaths | integer | Yes | |
MB_PlayerGold | integer | Yes | |
MB_PlayerKills | integer | Yes | |
MB_Players | player | Yes | |
MB_String | string | Yes | |
MB_TotalHeroes | integer | No | |
MUI_1 | integer | No | |
MUI_2 | integer | Yes | |
MUI_3 | integervar | No | |
Names | string | Yes | |
NeutVar | location | No | |
Player_Colours | string | Yes | |
Player_Strings | string | Yes | |
PLAYERCon | integer | Yes | |
Point | location | Yes | |
Point1 | location | No | |
Point2 | location | No | |
PWAngle | real | Yes | |
PWCaster | unit | Yes | |
PWCasterPoint | location | Yes | |
PWCount | integer | No | |
PWDamage | real | Yes | |
PWDistance | real | Yes | |
PWDMGGroup | group | Yes | |
PWHas | boolean | Yes | |
PWIndex | integer | No | |
PWInteger | integervar | No | |
PWLastRecycled | integer | No | |
PWMax | integer | No | |
PWMaxDistance | real | Yes | |
PWPhoenix | unit | Yes | |
PWRecycledList | integer | Yes | |
PWTargetPoint | location | Yes | |
r | real | No | |
RandomInt | integer | Yes | |
randomintegerbangis | integer | No | |
randomintegerbutaw | integer | No | |
Rays | group | No | |
RepickInt | integer | Yes | |
Sabong | location | No | |
Saucer_Duration2 | integer | No | |
Saucer_Unit2 | unit | Yes | |
SaucerReturn2 | integer | Yes | |
SBAngle | real | Yes | |
SBCaster | unit | Yes | |
SBCasterPoint | location | Yes | |
SBChannelGroup | group | Yes | |
SBCount | integer | No | |
SBDistance | real | Yes | |
SBDummyGroup | group | Yes | |
SBEffectDelayer | integer | Yes | |
SBHas | boolean | Yes | |
SBIndex | integer | No | |
SBInteger | integervar | No | |
SBLastRecycled | integer | No | |
SBLevel | integer | Yes | |
SBMax | integer | No | |
SBMaxDistance | real | Yes | |
SBRecycledList | integer | Yes | |
SBScale | real | Yes | |
SBTargetPoint | location | Yes | |
SBTempGroup | group | No | |
SBTempPoint | location | No | |
SBTempPoint2 | location | No | |
SBTimer | real | Yes | |
Score | integer | Yes | |
Sfx | effect | Yes | |
SfxNumber | integer | No | |
ShipTimer2 | timer | Yes | |
ShipWarp2 | unit | Yes | |
spe1 | effect | No | |
spe2 | effect | No | |
SpecialEffect | effect | Yes | |
Streak_Kills | integer | Yes | |
Streak_Sounds | sound | Yes | |
Streak_Strings | string | Yes | |
telebangis1 | location | No | |
telebangis2 | location | No | |
telebangis3 | location | No | |
telebutaw1 | location | No | |
telebutaw2 | location | No | |
telebutaw3 | location | No | |
Temp | integer | No | |
TempGroup | group | No | |
TempInt | integer | No | |
TempKey | integer | No | |
TempLoc | location | No | |
TempLoc43 | location | No | |
TempLoc44 | location | No | |
TempNumber | integer | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempUnit | unit | No | |
Timer | integer | Yes | |
tips | integer | No | |
Tractor_Beam2 | unit | Yes | |
u | unit | No | |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
Unit | unit | Yes | |
UnitGroup | group | Yes | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No | |
UnitVarAttacked | unit | No | |
UnitVarAttacker | unit | No | |
VisionMod | fogmodifier | Yes |
//TESH.scrollpos=75
//TESH.alwaysfold=0
//***************************************************************************************************
//* ===================
//* Runing Destruction
//* ===================
//* Made by Shdow89
//*
//*
//* How to implement:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* 1. Copy the spell "Runing Destruction" to your map, along with it's buff.
//*
//* 2. Make a global variable of the type hashtable and name it Hasis
//*
//* 3. Copy the costum script section and paste it in your map.
//*
//* 4. Copy this trigger and Paste it in your map. Or you can just copy the code
//* make a trigger with a name Runing Destruction, convert it to costum text(JASS) and paste the code.
//*
//* 5. Change the rawcode of the spell and buff in this code, to the ones in your map, and use the spell.
//* Go down through constants and change what you like.
//*
//* Choosable/Effects:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* Go down through constant function and change to what you like. Units affected are:
//* Enemy Units, Non-Magic immune, Non-Structures and living. This can be changed in the
//* costum script section of the map.
//*
//* Editor's Word:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* My third JASS spell. I'm really proud of this one xD, and I enjoyed making it.
//* Have fun and alter what you want, just remember to give credits :).
//*
//* Spells Action:
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* The caster enters a destructive state. Whenever he's moving he deals damage to nearby
//* enemy units. Faster the caster is, more damage he will deal. In addition 1 % of caster's
//* movement speed is transfered into damage.
//*
//* Credits:
//* ¯¯¯¯¯¯¯¯
//* Daelin for his tutorial about DistanceBetweenPoints.
//* Deuterium for his continous comments and help :) (Hope you like this one :))
//* And you for dling the map :).
//*
//*
//*************************************************************************************************
constant function Runing_Destruction_ID takes nothing returns integer
return 'A00R' // Runing Destruction ability ID
endfunction
constant function Runing_Destruction_Buff_ID takes nothing returns integer
return 'B00B' // It's buff ID
endfunction
constant function Caster_SFX takes nothing returns string
return "Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl" // SFX for the caster
endfunction
constant function Target_SFX takes nothing returns string
return "Abilities\\Spells\\Other\\Volcano\\VolcanoMissile.mdl" // SFX for the target
endfunction
constant function Caster_SFX_Point takes nothing returns string
return "chest" // The attachment point for SFX for caster
endfunction
constant function Radius takes nothing returns real
return 400.00 // AOE of the spell
endfunction
constant function Timer_Loop takes nothing returns real
return 0.1 // How fast timer repeats
endfunction
constant function Damage_Per takes integer i returns real
return 0.2 * i // Damage, it's 20 % * level of the Runing Destruction
endfunction
constant function Speed_Damage takes nothing returns real
return 0.01 // extra damage from the movement speed it's 1 % now.
endfunction
//===========================================================================================
//Don't edit anything below this, if you are unsure.
//==============================================================================================
function Trig_Runing_Destruction_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Runing_Destruction_ID()
endfunction
function Runing_Destruction_Effect takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit butters = LoadUnitHandle(udg_Hasis, GetHandleId(t), 1)
local real snail = GetUnitMoveSpeed(butters)*Speed_Damage()
local real damage = 0.00
local real x = LoadReal(udg_Hasis, GetHandleId(t), 2)
local real y = LoadReal(udg_Hasis, GetHandleId(t), 3)
local integer i = LoadInteger(udg_Hasis, GetHandleId(t), 4)
local real x1 = GetUnitX(butters)
local real y1 = GetUnitY(butters)
if (GetUnitAbilityLevel(butters, Runing_Destruction_Buff_ID()) > 0) then
if x != x1 or y != y1 then
set damage = Damage_Per(i) * SquareRoot((x1-x)*(x1-x) + (y1-y)*(y1-y)) + snail
call DestroyEffect(AddSpecialEffectTarget(Caster_SFX(), butters, Caster_SFX_Point()))
call DamageEnemiesArea (butters, Radius(), x1, y1, damage, true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS, Target_SFX())
endif
call SaveReal(udg_Hasis, GetHandleId(t), 2, x1)
call SaveReal(udg_Hasis, GetHandleId(t), 3, y1)
else
call PauseTimer(t)
call DestroyTimer(t)
set butters = null
endif
endfunction
function Trig_Runing_Destruction_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit cartman = GetTriggerUnit()
local integer i = GetUnitAbilityLevel(cartman, Runing_Destruction_ID())
local real x = GetUnitX(cartman)
local real y = GetUnitY(cartman)
call SaveUnitHandle(udg_Hasis, GetHandleId(t), 1, cartman)
call SaveReal(udg_Hasis, GetHandleId(t), 2, x)
call SaveReal(udg_Hasis, GetHandleId(t), 3, y)
call SaveInteger(udg_Hasis, GetHandleId(t), 4, i)
call TimerStart(t, Timer_Loop(), true, function Runing_Destruction_Effect)
set cartman = null
endfunction
//==================================================================================================
function InitTrig_Runing_Destruction takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer guza
set guza = 0
loop
call TriggerRegisterPlayerUnitEvent(trig, Player(guza), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set guza = guza + 1
exitwhen guza == 16
endloop
call TriggerAddCondition(trig, Condition(function Trig_Runing_Destruction_Conditions))
call TriggerAddAction(trig, function Trig_Runing_Destruction_Actions)
call Preload(Caster_SFX())
call Preload(Target_SFX())
call PreloadStart()
set udg_Hasis = InitHashtable()
set trig = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope AstonishingBeam initializer GetStarted
globals
private constant integer SpellID = 'A014' // Insert the rawcode of the Astonishing Beam spell in the Object Editor (Ctrl+D)
private constant integer EffectID = 'A011' // Insert the rawcode of the AstonishingBeam_Effect buff in the Object Editor (Ctrl+D)
private constant string OrbModel = "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl" // Returns the path of the source model of the ray
private constant string ImpactModel = "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl" // Returns the path of the impact model of the ray
private constant string HitModel = "Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdl" // Returns the path of the effect displayed whenever the ray hits a unit
private constant string RayModel = "DRAM" // Returns the model of the ray (lightning), "CLPB" is the chain lightning, "DRAL" is the drain life lightning, "DRAM" is the drain mana lightning, "AFOD" returns the finger of death lightning, "HWPB" returns the healing wave lightning and "MBUR" the mana burn lightning.
private constant real Offset = 250 // Returns the length of the ray
private constant real FlyHeight = 300 // Returns height of the source
private constant real RiseTime = 1 // Returns the time until the ray's source is lifted
private constant real ImpactDamagePerLvl = 40 // Returns the damage dealt per level upon impact to the enemied units
endglobals
//!*******************************END OF THE SETTINGS*************************!\\
//**Do not modify anything below this line unless you know what you are doing**\\
//!***************************************************************************!\\
globals
private group PickGroup
private real interval = 0.9*RiseTime
private integer i = 0
private unit tempU
private player tempP
private group tempG
endglobals
//!***********************************
// Filter Function
private function GetFilter takes nothing returns boolean
set tempU = GetFilterUnit()
return GetWidgetLife(tempU)>0 and IsUnitEnemy(tempU,tempP) and IsUnitType(tempU,UNIT_TYPE_STRUCTURE)==false and IsUnitType(tempU,UNIT_TYPE_MAGIC_IMMUNE)==false
endfunction
//!***********************************
// Spell Condition
private function condition takes nothing returns boolean
return GetSpellAbilityId() == SpellID
endfunction
//!***********************************
// Main Part
private struct Spell
private unit caster
private unit orb
private real x
private real y
private real sinnumber
private real size
private real OffsetDegree
private integer state
private integer level
private lightning light
private group PickedGroup
private static Spell array indx
private static integer counter = 0
private static timer time = CreateTimer()
static method Execution takes nothing returns nothing
local Spell d
local location array l
set i = 0
loop
exitwhen i >= Spell.counter
set d = Spell.indx[i]
if d.state == 1 then
set d.sinnumber = d.sinnumber+interval
call SetUnitFlyHeight(d.orb,Sin(d.sinnumber*bj_DEGTORAD)*FlyHeight,0)
if d.sinnumber == 90 then
set d.state = 2
set l[1] = Location(d.x,d.y)
set l[2] = Location(PPX,PPY)
call PolarProjection(d.x,d.y,Offset,(d.size*100-d.OffsetDegree))
set d.light = AddLightningEx(RayModel,true,d.x,d.y,GetLocationZ(l[1])+FlyHeight,PPX,PPY,GetLocationZ(l[2]))
set d.size = d.size - 0.02
call SetUnitScale (d.orb,d.size,d.size,d.size)
endif
else
if d.state == 2 then
set l[1] = Location(d.x,d.y)
set l[2] = Location(PPX,PPY)
call PolarProjection(d.x,d.y,Offset,(d.size*100-d.OffsetDegree))
call MoveLightningEx(d.light,true,d.x,d.y,GetLocationZ(l[1])+FlyHeight,PPX,PPY,GetLocationZ(l[2]))
call DestroyEffect(AddSpecialEffect(ImpactModel,PPX,PPY))
set d.size = d.size - 0.02
if d.size <= 0 then
set d.state = 3
set d.size = 0
call DestroyLightning(d.light)
call RemoveUnit(d.orb)
endif
call SetUnitScale (d.orb,d.size,d.size,d.size)
set tempP = GetOwningPlayer(d.caster)
set tempG = d.PickedGroup
set PickGroup = CreateGroup()
call GroupEnumUnitsInRange(PickGroup,PPX,PPY,100,Condition(function GetFilter))
loop
set tempU = FirstOfGroup(PickGroup)
exitwhen tempU == null
if IsUnitInGroup(tempU,d.PickedGroup)==false then
call GroupAddUnit(d.PickedGroup,tempU)
call UnitDamageTarget(d.caster,tempU,ImpactDamagePerLvl*d.level,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
call DestroyEffect(AddSpecialEffect(HitModel,GetUnitX(tempU),GetUnitY(tempU)))
call CreateDummy (GetOwningPlayer(d.caster),"",PPX,PPY,0,0,1,100,100,100,0)
call UnitAddAbility(LastCreatedDummy,EffectID)
call SetUnitAbilityLevel(LastCreatedDummy,EffectID,d.level)
call IssueTargetOrder(LastCreatedDummy,"bloodlust",tempU)
call UnitApplyTimedLife(LastCreatedDummy,'BTLF',1)
endif
call GroupRemoveUnit(PickGroup,tempU)
endloop
call DestroyGroup(PickGroup)
else
if d.state == 3 then
call GroupClear(d.PickedGroup)
call DestroyGroup(d.PickedGroup)
set d.light = null
set d.orb = null
set d.caster = null
set d.PickedGroup = null
call d.destroy()
set Spell.counter = Spell.counter - 1
set Spell.indx[i] = d.indx[Spell.counter]
set i = i - 1
endif
endif
endif
set i = i + 1
endloop
set i = 0
call RemoveLocation(l[1])
call RemoveLocation(l[2])
set l[1] = null
set l[2] = null
if Spell.counter == 0 then
call PauseTimer(Spell.time)
endif
endmethod
static method GetValues takes unit c, unit orb, real x, real y, integer l returns nothing
local Spell d = Spell.allocate()
set d.caster = c
set d.orb = orb
set d.level = l
set d.x = x
set d.y = y
set d.state = 1
set d.sinnumber = 0
set d.size = 3.6
set d.OffsetDegree = GetRandomReal(0,360)
set d.PickedGroup = CreateGroup()
if Spell.counter == 0 then
call TimerStart(Spell.time,0.01,true, function Spell.Execution)
endif
set Spell.indx[Spell.counter] = d
set Spell.counter = Spell.counter + 1
endmethod
endstruct
private function Input takes nothing returns nothing
local unit t = GetSpellTargetUnit()
local unit c = GetTriggerUnit()
local location l = GetSpellTargetLoc()
set PPX = GetLocationX(l)
set PPY = GetLocationY(l)
call CreateDummy (GetOwningPlayer(c),OrbModel,PPX,PPY,0,0,3.6,50,50,100,0)
call Spell.GetValues(c,LastCreatedDummy,PPX,PPY,GetUnitAbilityLevel(c,SpellID))
call RemoveLocation(l)
set l = null
set c = null
set t = null
endfunction
private constant function NoFilterLeak takes nothing returns boolean
return true
endfunction
private function GetStarted takes nothing returns nothing
local trigger Trig = CreateTrigger()
local filterfunc ff = Filter(function NoFilterLeak)
loop
call TriggerRegisterPlayerUnitEvent(Trig, Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,ff)
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
set i = 0
call TriggerAddCondition(Trig, Condition(function condition))
call TriggerAddAction(Trig, function Input)
call Preload(OrbModel)
call Preload(ImpactModel)
call Preload(HitModel)
call PreloadStart()
call DestroyFilter(ff)
set ff =null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
library PGScript
globals
constant integer PGScriptDummyID = 'n007'
// Fill in the rawcode of the dummy unit in your map.
// You get the rawcode by pressing Ctrl+D in the Object Editor.
endglobals
//! DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING !\\
//!***********************************
// Dummy Creation Function
// call CreateDummy (owner (player), model path (string), x coordinate (real), y coordinate (real), facing (real), timed life, set 0 for unlimited (real))
globals
unit LastCreatedDummy
endglobals
function CreateDummy takes player p, string modelpath, real x, real y, real face, real dur, real size, real red, real green, real blue, real alpha returns nothing
set LastCreatedDummy = CreateUnit(p,PGScriptDummyID,x,y,face)
call AddSpecialEffectTarget (modelpath,LastCreatedDummy,"origin")
call UnitApplyTimedLife (LastCreatedDummy,'BTLF',dur)
call SetUnitScale (LastCreatedDummy,size,size,size)
if red != 100 or green != 100 or blue != 100 or alpha != 0 then
call SetUnitVertexColor(LastCreatedDummy,PercentTo255(red),PercentTo255(green),PercentTo255(blue),PercentTo255(100.0-alpha))
endif
call UnitAddAbility(LastCreatedDummy,'Arav')
call UnitRemoveAbility(LastCreatedDummy,'Arav')
endfunction
//!***********************************
// Polar Projection Function
// call PolarProjection (x, y, distance, angle)
globals
real PPX
real PPY
endglobals
function PolarProjection takes real rx, real ry, real dist, real angle returns nothing
set PPX = rx + dist * Cos(angle * bj_DEGTORAD)
set PPY = ry + dist * Sin(angle * bj_DEGTORAD)
endfunction
//!***********************************
// Get Angle Function
// call GetAngle (x1,y1,x2,y2)
function GetAngle takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG*Atan2(y2-y1,x2-x1)
endfunction
endlibrary