Komaqtion
You can change this now in User CP.
- Reaction score
- 469
Thanks kingking
scope Dummy initializer init
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//*************************************************************************************************************************//
//@@///////////////////////////////////////////Burning Hell, Made By Komaqtion///////////////////////////////////////////@@//
//@@ @@//
//@@ How to import: @@//
//@@ @@//
//@@ ¤ First copy the ability "Burning Hell" and the unit "Dummy" and change the ID's in the @@//
//@@ constants below to the new ones. Then you need to import Vexorian's dummy.mdx file from @@//
//@@ this map, or another, and change "Dummy" unit's model to this one. Then, of course, you @@//
//@@ need to import the triggers, which are in the categories "The Spell" and @@//
//@@ "Required Systems". Then you're free to change any of the given global constants to suit @@//
//@@ your needs. @@//
//@@ @@//
//@@ ¤ Credits to: @@//
//@@ * Vexorian, for the dummy.mdx file @@//
//@@ * Jesus4Lyf, for KeyTimers 2 @@//
//@@ * TriggerHappy187, for TimedHandles (kinngkingyyk3 changed some stuff though) @@//
//@@ @@//
//@@ Also, many thanks to all of the many helpfull people at TheHelper.net who has helped get @@//
//@@ this spell working! (kingkingyyk3 and WolfieNoCT especially <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" />) @@//
//@@ @@//
//@@ @@//
//@@ Note: This is my very first fully working, and quite good, spell made completely in JASS. @@//
//@@ So much feedback, and suggestions are very much welcome, and maybe some tips to make it @@//
//@@ even better would be nice <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /> @@//
//@@ @@//
//*************************************************************************************************************************//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
globals
// Effects! Change as you'd like <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" />\\
private constant string EFFECT_C = "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" // Effect on the caster!
private constant string EFFECT_1 = "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" // Effect 200 range from the caster!
private constant string EFFECT_2 = "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" // Effect at the end!
private constant string DUMMY_EFFECT = "Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl" // Effect on the moving dummy!
// ID's! Change to the ID's on your map <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" />\\
private constant integer SPELL_ID = 039;0000039; // ID of the spell!
private constant integer DUMMY_ID = 039;h000039; // ID of the dummy unit!
private constant integer LOCUST = 039;Aloc039; // ID of the "Locust" ability! (Might not need changing)
private constant integer BUFF_ID = 039;BTLF039; // ID of the expiration buff on the dummy!
// Other constant integers! Change at will <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" />\\
private constant integer DAMAGE_FACTOR = 1
private constant real RANGE_FACTOR = 15
private constant integer ANGLES = 17 // The number of agles the effects will show at! (360/ANGLES)
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL // Explains itself i think XD
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL // Same here <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" />
endglobals
globals
// Globals! Simply DON'T CHANGE!\\
private integer TempStructIndex
endglobals
private struct Data
unit array du [ANGLES]
unit cs
real array pointx [ANGLES]
real array pointy [ANGLES]
boolean b
player p
group g
integer lvl
static method create takes unit u returns Data
local Data a = Data.allocate()
set a.cs = u
set a.b = false
set a.p = GetOwningPlayer(u)
set a.g = CreateGroup()
set a.lvl = GetUnitAbilityLevel(a.cs,SPELL_ID)
return a
endmethod
endstruct
// Some more configurables that needed the struct!\\
// Damage functions!\\
private function Damage_Small takes nothing returns integer
return DAMAGE_FACTOR * 10
endfunction
private function Damage_Medium takes integer lv returns integer
return 50 + lv * DAMAGE_FACTOR * 50
endfunction
private function Damage_High takes integer lv returns integer
return lv * DAMAGE_FACTOR * 100
endfunction
// Range functions!\\
private function Range_Small takes nothing returns real
return RANGE_FACTOR * 5
endfunction
private function Range_Medium takes nothing returns real
return RANGE_FACTOR * 10
endfunction
private function Range_High takes nothing returns real
return RANGE_FACTOR * RANGE_FACTOR
endfunction
// End of Configuration!\\
private function Spell_Check takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function GroupEm takes nothing returns boolean
local Data a = TempStructIndex
return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), a.p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitInGroup(GetFilterUnit(),a.g) == false
endfunction
private function Smaller_GroupEm takes nothing returns boolean
local Data a = TempStructIndex
return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), a.p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false
endfunction
private function Callback takes nothing returns nothing
local Data a = EAE_GetData()
local integer i = 0
loop
exitwhen i ==16
call DestroyEffect(AddSpecialEffect(EFFECT_2,GetUnitX(a.du<i>),GetUnitY(a.du<i>)))
call RemoveUnit(a.du<i>)
set i = i+1
endloop
endfunction
private function Move_Dummy takes nothing returns boolean
local Data a = KT_GetData()
local real xd
local real yd
local integer i = 0
local unit temp
local group g
loop
exitwhen i==16
set g = CreateGroup()
set xd = GetUnitX(a.du<i>)
set yd = GetUnitY(a.du<i>)
set a.pointx<i> = xd+10*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
set a.pointy<i> = yd+10*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
set TempStructIndex = a
call GroupEnumUnitsInRange(g, a.pointx<i>, a.pointy<i>, Range_Small(), Condition(function Smaller_GroupEm))
loop
set temp = FirstOfGroup(g)
exitwhen temp == null
call UnitDamageTarget(a.cs, temp, Damage_Small(), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
call GroupAddUnit(a.g,temp)
call GroupRemoveUnit(g,temp)
endloop
call DestroyGroup(g)
call SetUnitX(a.du<i>,a.pointx<i>)
call SetUnitY(a.du<i>,a.pointy<i>)
set i = i+1
endloop
set temp = null
set g = null
return a.b
endfunction
private function Effects takes nothing returns nothing
local Data a = Data.create(GetTriggerUnit())
local real xu = GetUnitX(a.cs)
local real yu = GetUnitY(a.cs)
local integer i = 0
local group g
local unit temp
call DestroyEffect(AddSpecialEffect(EFFECT_C,xu,yu))
loop
exitwhen i>=16
set g = CreateGroup()
set a.pointx<i> = xu+200*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
set a.pointy<i> = yu+200*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect(EFFECT_1,a.pointx<i>,a.pointy<i>))
set TempStructIndex = a
call GroupEnumUnitsInRange(g, a.pointx<i>, a.pointy<i>,Range_Medium(), Condition(function GroupEm))
loop
set temp = FirstOfGroup(g)
exitwhen temp == null
call UnitDamageTarget(a.cs, temp, Damage_Medium(a.lvl), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
call GroupAddUnit(a.g,temp)
call GroupRemoveUnit(g,temp)
endloop
call DestroyGroup(g)
set a.du<i> = CreateUnit(a.p,DUMMY_ID,xu,yu,bj_RADTODEG*Atan2(a.pointy<i>-yu,a.pointx<i>-xu))
call UnitAddAbility(a.du<i>,LOCUST)
call EAE_Add(AddSpecialEffectTarget(DUMMY_EFFECT,a.du<i>,"origin"),2.5,null,0)
set i = i+1
endloop
call EAE_Add(null, 2.5, function Callback, a)
call KT_Add(function Move_Dummy,a,.05)
set temp = null
set g = null
call TriggerSleepAction(2.5)
set a.b = true
call GroupClear(a.g)
call DestroyGroup(a.g)
set temp = null
call a.destroy()
endfunction
private function init takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function Spell_Check))
call TriggerAddAction(t,function Effects)
endfunction
endscope
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>
library EAE requires KT
//A library designed for Burning Hell, By Komaqtion
//by kingking
//How to use?
//function EAE_Add takes effect e, real duration, code callback, integer data
//In order to access the data, Use EAE_GetData() to get the struct index in the callback function.
globals
private integer ReturnIndex
endglobals
private struct Data
effect e
integer data
trigger callback
endstruct
private function Destroy takes nothing returns boolean
local Data d = KT_GetData()
if d.e != null then
call DestroyEffect(d.e)
set d.e = null
endif
if d.callback != null then
set ReturnIndex = d.data
call TriggerExecute(d.callback)
call DestroyTrigger(d.callback)
set d.callback = null
endif
call d.destroy()
return true
endfunction
public function GetData takes nothing returns integer
return ReturnIndex
endfunction
public function Add takes effect e, real duration, code callback, integer data returns nothing
local Data d = Data.create()
if e != null then
set d.e = e
endif
if callback != null then
set d.data = data
set d.callback = CreateTrigger()
call TriggerAddAction(d.callback, callback)
endif
if e != null or callback != null then
call KT_Add(function Destroy, d, duration)
endif
endfunction
endlibrary
scope Dummy initializer init
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//***********************************************************************************************************//
//@@////////////////////////////////////Burning Hell, Made By Komaqtion////////////////////////////////////@@//
//@@ @@//
//@@ How to import: @@//
//@@ @@//
//@@ ¤ First copy the ability "Burning Hell" and the unit "Dummy" and change the ID's in the @@//
//@@ constants below to the new ones. Then you need to import Vexorian's dummy.mdx file from @@//
//@@ this map, or another, and change "Dummy" unit's model to this one. Then, of course, you @@//
//@@ need to import the triggers, which are in the categories "The Spell" and @@//
//@@ "Required Systems". Then you're free to change any of the given global constants to suit @@//
//@@ your needs. @@//
//@@ @@//
//@@ Requirements: @@//
//@@ ¤ This spell, of course ! @@//
//@@ ¤ Key Timers 2, made by Jesus4Luf <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /> @@//
//@@ ¤ The library made especially for this spell, EAE, made by kingkingyyk3!!! @@//
//@@ ¤ Vexorians, dummy.mdx ! @@//
//@@ @@//
//@@ ¤ Credits to: @@//
//@@ * Vexorian, for the dummy.mdx file @@//
//@@ * Jesus4Lyf, for KeyTimers 2 @@//
//@@ * TriggerHappy187, for TimedHandles (Even if this spell doesn't use it anymore XD) @@//
//@@ * Kingkingyyk3, for his wonderfull help on this spell, and for making EAE ! @@//
//@@ @@//
//@@ so, many thanks to all of the many helpfull people at TheHelper.net who has helped get @@//
//@@ is spell working! (kingkingyyk3 and WolfieNoCT especially <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" />) @@//
//@@ @@//
//@@ @@//
//@@ Note: This is my very first fully working, and quite good, spell made completely in JASS. @@//
//@@ So much feedback, and suggestions are very much welcome, and maybe some tips to make it @@//
//@@ even better would be nice <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /> @@//
//@@ @@//
//***********************************************************************************************************//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
globals
// Effects! Change as you'd like <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" />\\
private constant string EFFECT_C = "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" // Effect on the caster!
private constant string EFFECT_1 = "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" // Effect 200 range from the caster!
private constant string EFFECT_2 = "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" // Effect at the end!
private constant string DUMMY_EFFECT = "Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl" // Effect on the moving dummy!
// ID's! Change to the ID's on your map <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" />\\
private constant integer SPELL_ID = 039;0000039; // ID of the spell!
private constant integer DUMMY_ID = 039;h000039; // ID of the dummy unit!
private constant integer LOCUST = 039;Aloc039; // ID of the "Locust" ability! (Might not need changing)
private constant integer BUFF_ID = 039;BTLF039; // ID of the expiration buff on the dummy!
// Other constant integers! Change at will <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" />\\
private constant integer DAMAGE_FACTOR = 1
private constant real RANGE_FACTOR = 15
private constant integer ANGLES = 17 // The number of agles the effects will show at! (360/ANGLES)
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_NORMAL // Explains itself i think XD
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL // Same here <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" />
endglobals
globals
// Globals! Simply DON'T CHANGE!\\
private integer TempStructIndex
endglobals
private struct Data
unit array du [ANGLES]
unit cs
real array pointx [ANGLES]
real array pointy [ANGLES]
boolean b
player p
group g
integer lvl
static method create takes unit u returns Data
local Data a = Data.allocate()
set a.cs = u
set a.b = false
set a.p = GetOwningPlayer(u)
set a.g = CreateGroup()
set a.lvl = GetUnitAbilityLevel(a.cs,SPELL_ID)
return a
endmethod
endstruct
// Some more configurables that needed the struct!\\
// Damage functions!\\
private function Damage_Small takes nothing returns integer
return DAMAGE_FACTOR * 10
endfunction
private function Damage_Medium takes integer lv returns integer
return 50 + lv * DAMAGE_FACTOR * 50
endfunction
private function Damage_High takes integer lv returns integer
return lv * DAMAGE_FACTOR * 100
endfunction
// Range functions!\\
private function Range_Small takes nothing returns real
return RANGE_FACTOR * 5
endfunction
private function Range_Medium takes nothing returns real
return RANGE_FACTOR * 10
endfunction
private function Range_High takes nothing returns real
return RANGE_FACTOR * RANGE_FACTOR
endfunction
// End of Configuration!\\
private function Spell_Check takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function GroupEm takes nothing returns boolean
local Data a = TempStructIndex
return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), a.p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitInGroup(GetFilterUnit(),a.g) == false
endfunction
private function Smaller_GroupEm takes nothing returns boolean
local Data a = TempStructIndex
return GetWidgetLife(GetFilterUnit()) > 0.405 and IsUnitEnemy(GetFilterUnit(), a.p) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false
endfunction
private function Callback takes nothing returns nothing
local Data a = EAE_GetData()
local integer i = 0
local group g = CreateGroup()
local unit temp
loop
exitwhen i ==16
set a.pointx<i> = GetUnitX(a.du<i>)
set a.pointy<i> = GetUnitY(a.du<i>)
call DestroyEffect(AddSpecialEffect(EFFECT_2,a.pointx<i>,a.pointy<i>))
call GroupEnumUnitsInRange(g, a.pointx<i>, a.pointy<i>, Range_High(), Condition(function Smaller_GroupEm))
loop
set temp = FirstOfGroup(g)
exitwhen temp == null
call UnitDamageTarget(a.cs, temp, Damage_High(a.lvl), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
call GroupRemoveUnit(g,temp)
endloop
call RemoveUnit(a.du<i>)
set i = i+1
endloop
endfunction
private function Move_Dummy takes nothing returns boolean
local Data a = KT_GetData()
local real xd
local real yd
local integer i = 0
local unit temp
local group g
loop
exitwhen i==16
set g = CreateGroup()
set xd = GetUnitX(a.du<i>)
set yd = GetUnitY(a.du<i>)
set a.pointx<i> = xd+10*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
set a.pointy<i> = yd+10*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
set TempStructIndex = a
call GroupEnumUnitsInRange(g, a.pointx<i>, a.pointy<i>, Range_Small(), Condition(function Smaller_GroupEm))
loop
set temp = FirstOfGroup(g)
exitwhen temp == null
call UnitDamageTarget(a.cs, temp, Damage_Small(), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
call GroupAddUnit(a.g,temp)
call GroupRemoveUnit(g,temp)
endloop
call DestroyGroup(g)
call SetUnitX(a.du<i>,a.pointx<i>)
call SetUnitY(a.du<i>,a.pointy<i>)
set i = i+1
endloop
set temp = null
set g = null
return a.b
endfunction
private function Effects takes nothing returns nothing
local Data a = Data.create(GetTriggerUnit())
local real xu = GetUnitX(a.cs)
local real yu = GetUnitY(a.cs)
local integer i = 0
local group g
local unit temp
call DestroyEffect(AddSpecialEffect(EFFECT_C,xu,yu))
loop
exitwhen i>=16
set g = CreateGroup()
set a.pointx<i> = xu+200*Cos(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
set a.pointy<i> = yu+200*Sin(I2R(i*(360/(ANGLES-1)))*bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect(EFFECT_1,a.pointx<i>,a.pointy<i>))
set TempStructIndex = a
call GroupEnumUnitsInRange(g, a.pointx<i>, a.pointy<i>,Range_Medium(), Condition(function GroupEm))
loop
set temp = FirstOfGroup(g)
exitwhen temp == null
call UnitDamageTarget(a.cs, temp, Damage_Medium(a.lvl), true, false, ATTACK_TYPE, DAMAGE_TYPE, null)
call GroupAddUnit(a.g,temp)
call GroupRemoveUnit(g,temp)
endloop
call DestroyGroup(g)
set a.du<i> = CreateUnit(a.p,DUMMY_ID,xu,yu,bj_RADTODEG*Atan2(a.pointy<i>-yu,a.pointx<i>-xu))
call UnitAddAbility(a.du<i>,LOCUST)
call EAE_Add(AddSpecialEffectTarget(DUMMY_EFFECT,a.du<i>,"origin"),2.5,null,0)
set i = i+1
endloop
call EAE_Add(null, 2.5, function Callback, a)
call KT_Add(function Move_Dummy,a,.05)
set temp = null
set g = null
call TriggerSleepAction(2.5)
set a.b = true
call GroupClear(a.g)
call DestroyGroup(a.g)
set temp = null
call a.destroy()
endfunction
private function init takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function Spell_Check))
call TriggerAddAction(t,function Effects)
endfunction
endscope</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>