Sessional's Spell Aids --> Cool Shapes!
3 posters
Clan MapZ :: World Editor :: Systems
Page 1 of 1
Sessional's Spell Aids --> Cool Shapes!
To use these spell aids, copy and paste them into the header file.
To use these spells in GUI use the Custom Script action and use any of the following lines of code:
Any shapes or suggestions, just ask. This Spell Aid system is incomplete, and I will continue to work on it, as long as people find it useful.
To use these spells in GUI use the Custom Script action and use any of the following lines of code:
- Code:
call ArchimedeanGraph(100, 4)
call ButterflyGraph(.14, 6, 500)
call VaseGraph(8, 1000)
call CircleGraph()
- Code:
//###########################WARNING!!######################################\\
//#### Modifying this code may cause undesired errors and results, please ##\\
//#### for your own good, do not modify this code unless you understand ##\\
//#### jass and can figure out how the formulas work. ##\\
//#############################CHANGELOG####################################\\
//#### March 17 : Production Started March 18 : Added Vase Artwork ##\\
//#### March 19 : Added Circle Artwork ##\\
//##########################################################################\\
//#### Basic Spell Functions ####\\
function SpellDamageGroup takes group DamagedGroup, real Damage returns nothing
local group DG = DamagedGroup
local real D = Damage
local unit CU
loop
exitwhen CountUnitsInGroup(DG) < 1
set CU = GroupPickRandomUnit(DG)
call UnitDamageTarget(CU, null, D, false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, null)
call GroupRemoveUnit(DG, CU)
endloop
call DestroyGroup(DG)
endfunction
//#### Archimedean Functions ####\\
function ArchimedeanGraph takes integer RelativeRange, integer Revolutions returns nothing
local real Radian = 57.29
local integer M = RelativeRange
local integer R = Revolutions
local integer J = 1
local integer K
local real X
local real Y
loop
exitwhen J > (R * 360)
set K = ((J / R2I(Radian)) * (M / R))
set X = (SinBJ(I2R(J)) * I2R(K))
set Y = (CosBJ(I2R(J)) * I2R(K))
call CreateNUnitsAtLoc(1, 'h001', GetOwningPlayer(GetTriggerUnit()), OffsetLocation(GetUnitLoc(GetTriggerUnit()), X, Y), bj_UNIT_FACING)
set J = J + 1
endloop
endfunction
//#### Butterfly Functions ####\\
function ButterflyGraph takes real RelativeRange, integer WingLines, real MaxRange returns nothing
local real Radian = 57.29
local real M = RelativeRange
local integer S = WingLines
local integer J = 1
local integer K
local real X
local real Y
local location LastUnitPoint
local location CastPoint = GetUnitLoc(GetTriggerUnit())
local real LastUnitRange
local real Z = MaxRange
loop
exitwhen J > (S * 360)
set K = ((J / R2I(Radian)) * (R2I(M)+S))
set X = (TanBJ(I2R(J)) * I2R(K))
set Y = (SinBJ(I2R(J)) * I2R(K))
call CreateNUnitsAtLoc(1, 'h001', GetOwningPlayer(GetTriggerUnit()), OffsetLocation(CastPoint, X, Y), bj_UNIT_FACING)
set LastUnitPoint = GetUnitLoc(GetLastCreatedUnit())
set LastUnitRange = DistanceBetweenPoints(CastPoint, LastUnitPoint)
if (LastUnitRange > Z) then
call RemoveUnit(GetLastCreatedUnit())
endif
set J = J + 1
endloop
endfunction
//#### Vase ####\\
function VaseGraph takes integer Lines, real MaxDistance returns nothing
local real Radian = 57.29
local real M = 26
local integer S = (Lines/2)
local integer J = 1
local integer K
local real X
local real Y
local real Z = MaxDistance
local location LastUnitPoint
local location CastPoint = GetUnitLoc(GetTriggerUnit())
local real LastUnitRange
loop
exitwhen J > (S * 360)
set K = ((J / R2I(Radian)) * (R2I(M)+S))
set X = (CosBJ(I2R(J)) * I2R(K))
set Y = (TanBJ(I2R(J)) * I2R(K))
call CreateNUnitsAtLoc(1, 'h001', GetOwningPlayer(GetTriggerUnit()), OffsetLocation(CastPoint, X, Y), bj_UNIT_FACING)
set LastUnitPoint = GetUnitLoc(GetLastCreatedUnit())
set LastUnitRange = DistanceBetweenPoints(CastPoint, LastUnitPoint)
if (LastUnitRange > Z) then
call RemoveUnit(GetLastCreatedUnit())
endif
set J = J + 1
endloop
endfunction
//#### Circle ####\\
function CircleGraph takes nothing returns nothing
local integer R = 400
local integer R2 = 80
local integer J = 1
local integer J2 = 1
local real X2
local real Y2
local real X
local real Y
local real N = 1
local unit LastUnit
local unit CastUnit = GetTriggerUnit()
loop
exitwhen J > (360)
set X = (SinBJ(I2R(J)) * I2R(R))
set Y = (CosBJ(I2R(J)) * I2R(R))
call CreateNUnitsAtLoc(1, 'h001', GetOwningPlayer(GetTriggerUnit()), OffsetLocation(GetUnitLoc(CastUnit), X, Y), bj_UNIT_FACING)
set LastUnit = GetLastCreatedUnit()
if (N > 19) then
loop
exitwhen J2 > (361)
set X2 = (SinBJ(I2R(J2)) * I2R(R2))
set Y2 = (CosBJ(I2R(J2)) * I2R(R2))
call CreateNUnitsAtLoc(1, 'h001', GetOwningPlayer(GetTriggerUnit()), OffsetLocation(GetUnitLoc(LastUnit), X2, Y2), bj_UNIT_FACING)
set J2 = J2 + 6
endloop
set J2 = 1
set N = 0
endif
set J = J + 1
set N = N + 1
endloop
endfunction
Any shapes or suggestions, just ask. This Spell Aid system is incomplete, and I will continue to work on it, as long as people find it useful.
Re: Sessional's Spell Aids --> Cool Shapes!
Yeah, Jass lets me have some fun with triggers.
>>With the custom script lines, feel free to change the numbers. Some numbers might cause the engine to lag, so be careful with what you do. Also, more likely then not, I'll update the circle to make it changeable without knowing jass.
>>With the custom script lines, feel free to change the numbers. Some numbers might cause the engine to lag, so be careful with what you do. Also, more likely then not, I'll update the circle to make it changeable without knowing jass.
Re: Sessional's Spell Aids --> Cool Shapes!
Nice , i wish i could write jass i can only edit it but im learning
Re: Sessional's Spell Aids --> Cool Shapes!
Just a pointer, best way to start is simple. Jass is a language that I found easier to learn from taking someone else project, and morphing it to do something different.
Clan MapZ :: World Editor :: Systems
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|