Immolation
Member
- Reaction score
- 20
Electrical Discharge
Gives a chance to release lightning bolts upon damaging an enemy. A single enemy cannot be hit often.
GUI/vJASS= vJASS
Leakless?= Yes.
Lagless= Yes.
MUI/MPI?= MUI
Requires: AIDS, DummyCaster, Event, T32, Lightning and Damage.
Changelog:
v1.10a:
-Improved preload function.
-Improved code.
v1.10:
-Revamped code.
-Now uses Lightning and T32 to handle lightnings.
-Uses DummyCaster instead of recreating dummies.
-Added more options for customizing the spell.
v1.00:
-Initial release.
Code:GUI/vJASS= vJASS
Leakless?= Yes.
Lagless= Yes.
MUI/MPI?= MUI
Requires: AIDS, DummyCaster, Event, T32, Lightning and Damage.
Changelog:
v1.10a:
-Improved preload function.
-Improved code.
v1.10:
-Revamped code.
-Now uses Lightning and T32 to handle lightnings.
-Uses DummyCaster instead of recreating dummies.
-Added more options for customizing the spell.
v1.00:
-Initial release.
JASS:
scope ElectricalDischarge initializer Init
//-------------------------------------------------------------
// Electrical Discharge by Immolation
//-------------------------------------------------------------
// Description:
//---------------------------
//Gives a chance to release lightning bolts upon damaging an enemy.
//A single enemy cannot be hit often.
// What do I need to import it in my map?
//---------------------------
// You need to download JASS NewGen, available at the following links:
//
// -http://www.thehelper.net/forums/showthread.php?t=73936
// -http://www.wc3c.net/showthread.php?t=90999
//
//Install it and then read the following paragraph.
// How do I put it in my map?
//---------------------------
// 1. Copy:
// a. Copy the buff found in the Buff tab in the Object Editor.
// b. Copy the Abilities found in the Abilities tab in the Object Editor.
// c. Copy all the triggers found in the folder where this trigger is located.
// Check the Damage and DummyCaster triggers for implementation instructions about those systems.
// 2. Press CTRL + D while in Abilities section in Object Editor to find out the rawcode of:
// a. The "Electrical Discharge" ability. Change the SPELL_ID to the rawcode that you find(it's 'A000' in this map).
// b. The "Static Remnant(Electrical Discharge)" ability. Change the BUFFSPELL_ID to the rawcode that you find(it's 'A001' in this map).
// c. The "Static Remnant" buff. Change the BUFF_ID to the rawcode that you find(it's 'B000' in this map).
// 3. You have succesfully imported the spell <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" />
// Changelog:
//---------------------------
//v1.10a:
//-Improved preload function.
//-Improved code.
//v1.10:
//-Revamped code.
//-Now uses Lightning and T32 to handle lightnings.
//-Uses DummyCaster instead of recreating dummies.
//-Added more options for customizing the spell.
// v1.00
// -Public release.
//---------------------------
// TheHelper.net
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// LIST OF CONFIGURABLES
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//About Configurables:
//Units won't get hit by this spell more than once every X seconds. The amount of time
//in which the units will not get hit by this spell is a buff applied through the
//Static Remnant(Electrical Discharge) spell. Set the duration there.
globals
//Rawcodes
private constant integer SPELL_ID = 039;A000039;
private constant integer BUFFSPELL_ID = 039;A001039;
private constant integer BUFF_ID = 039;B000039;
//Other stuff:
private constant boolean EFFECT_ON_HIT = true //Create effects on damaged units?
private constant string EFFECT_NAME = "Abilities\\Weapons\\Bolt\\BoltImpact.mdl" //Which effect?
private constant string EFFECT_ATTACHMENT = "origin" //Where to attach the effect?
//Lightning settings:
private constant string LIGHTNING_EFFECT = "CLPB" //See the Lightning trigger for a complete list of lightning effects.
private constant real LIGHTNING_DURATION = 1.00
//Preload:
private constant boolean PRELOAD = true //Removes lag when first casting the spell.
endglobals
private function ChanceToFire takes integer level returns integer
return 17 + (level * 3)
endfunction
private function Damage takes integer level returns real
return 15.00 + (level * 5.00)
endfunction
private function Targets takes integer level returns integer
return R2I(2.50 + level * 0.51)
endfunction
private function Range takes integer level returns real
return 500.00
endfunction
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
globals
private group g = CreateGroup()
endglobals
private function PreloadSpell takes nothing returns nothing
call UnitAddAbility(DUMMY, SPELL_ID)
call UnitRemoveAbility(DUMMY, SPELL_ID)
call UnitAddAbility(DUMMY, BUFFSPELL_ID)
call UnitRemoveAbility(DUMMY, BUFFSPELL_ID)
call Preload(EFFECT_NAME)
endfunction
private function GroupFilter takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetEventDamageSource()), GetOwningPlayer(GetFilterUnit())) == true and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0 /*
*/ and GetUnitTypeId(GetFilterUnit()) != DUMMY_TYPE and GetUnitAbilityLevel(GetFilterUnit(), BUFF_ID) == 0
endfunction
private function Main takes nothing returns boolean
local unit caster = GetEventDamageSource()
local unit damaged
local real x
local real y
local integer level = GetUnitAbilityLevel(caster, SPELL_ID)
local integer loopStart
local unit target
if GetRandomInt(1, 100) <= 100 then
set loopStart = 0
set damaged = GetTriggerUnit()
set x = GetUnitX(damaged)
set y = GetUnitY(damaged)
if level > 0 and IsPlayerEnemy(GetOwningPlayer(caster), GetOwningPlayer(damaged)) == true then
if EFFECT_ON_HIT == true then
call DestroyEffect(AddSpecialEffectTarget(EFFECT_NAME, damaged, EFFECT_ATTACHMENT))
endif
call UnitAddAbility(DUMMY, BUFFSPELL_ID)
call SetUnitAbilityLevel(DUMMY, BUFFSPELL_ID, level)
call IssueTargetOrder(DUMMY, "cripple", damaged)
call UnitRemoveAbility(DUMMY, BUFFSPELL_ID) //Prevents conflict with other spells with the same orderstring.
call GroupEnumUnitsInRange(g, x, y, Range(level), Condition(function GroupFilter))
loop
set target = FirstOfGroup(g)
exitwhen target == null or loopStart == Targets(level)
if EFFECT_ON_HIT == true then
call DestroyEffect(AddSpecialEffectTarget(EFFECT_NAME, target, EFFECT_ATTACHMENT))
endif
call UnitAddAbility(DUMMY, BUFFSPELL_ID)
call SetUnitAbilityLevel(DUMMY, BUFFSPELL_ID, level)
call IssueTargetOrder(DUMMY, "cripple", target)
call UnitRemoveAbility(DUMMY, BUFFSPELL_ID) //Prevents conflict with other spells with the same orderstring.
call Damage_EnableEvent(false)
call Damage_Spell(caster, target, Damage(level))
call Damage_EnableEvent(true)
call Lightning_UnitUnit(LIGHTNING_EFFECT, damaged, target, 1.00, true)
set loopStart = loopStart + 1
call GroupRemoveUnit(g, target)
endloop
endif
set target = null
set damaged = null
endif
return false
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call Damage_RegisterEvent(t)
call TriggerAddCondition(t, Condition(function Main))
if PRELOAD == true then
call PreloadSpell()
endif
endfunction
endscope
I know it's simple, but I find it a good alternative to standard old boring splash.
(And this has got more eye-candy! Yummy.)
Need feedback
Edit by Flare: Screenshot put in SPOILER tags (it was stretching the page)