Exide
I am amazingly focused right now!
- Reaction score
- 448
> And does this spell feel in any way "holy" to you?
Nope.
Nope.
//==== Init Trigger Holy Bonds ====
function InitTrig_Holy_Bonds takes nothing returns nothing
set gg_trg_Holy_Bonds= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Holy_Bonds,EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_Holy_Bonds, Condition(function Trig_Holy_Bonds_Conditions))
call TriggerAddAction(gg_trg_Holy_Bonds, function Trig_Holy_Bonds_Actions)
endfunction
//*****************************************************************
//*****************************************************************
//* Sun Ritual *
//* *
//* by *
//* *
//* Daxtreme *
//* *
//*****************************************************************
//*****************************************************************
//
// To Implement:
//
// 1. Copy the dummy unit "Dummy" into your map.
// 2. Copy the unit "Sun" into your map.
// 3. Copy the spell "Sun Ritual" into your map.
// 4. Copy the dummy spell "Sun Ritual Dummy" into your map.
// 5. Copy the buff "Sun Ritual" into your map.
// 6. Copy the spell "Spell Book" into your map.
// 7. Copy the spell "Sun Ritual Debuff" into your map.
// 8. Copy the code found in the map header into your map.
// 9. Copy this trigger into your map.
// 10. Copy the sounds "FlameStrikeTargetWaveNonLoop1" and "HolyBolt" into your map.
// 11. Copy the model "TheHolyBomb.mdx" into your map (Export and Import).
// 12. *Optional* Copy the icon "BTNHeroMasamuneDate_2" into your map.
//
// Credits to:
//
// 1. KaTTaNa for the Local Handle Variables system.
// 2. JetFangInferno for TheHolyBomb model.
// 3. meneldor for the spell's icon.
//
//*****************************************************************
//=================================================================
// Configuration Header
//=================================================================
constant function Sun_Ritual_SpellId takes nothing returns integer
return 039;A002039;
//
// The Spell's raw code.
//
endfunction
constant function Sun_Ritual_DummySpellId takes nothing returns integer
return 039;A001039;
//
// The Blast's raw code.
//
endfunction
constant function Sun_Ritual_Buff_Id takes nothing returns integer
return 039;B000039;
//
// The buff's raw code.
//
endfunction
constant function Sun_Ritual_SpellBook_Id takes nothing returns integer
return 039;A000039;
//
// The SpellBook's raw code.
//
endfunction
constant function Sun_Ritual_TrackingDebuff_Id takes nothing returns integer
return 039;A003039;
//
// The Tracking Ability's raw code.
//
endfunction
constant function Sun_Ritual_DummyId takes nothing returns integer
return 039;h000039;
//
// The "Dummy" unit's raw code.
//
endfunction
constant function Sun_Ritual_SunId takes nothing returns integer
return 039;e000039;
//
// The "Sun" unit's raw code.
//
endfunction
function Sun_Ritual_LoopTimes takes integer level returns real
return 100. + I2R(level) * 0.00
//
// The number of times it calls a blast.
//
endfunction
constant function Sun_Ritual_EffectPath takes nothing returns string
return "war3mapImported\\TheHolyBomb.mdx"
//
// The blast's effect string path. This is an imported model.
//
endfunction
constant function Sun_Ritual_LightningEffect takes nothing returns string
return "HWPB"
//
// The Lightning effect's code name. It is currently Healing Wave's.
//
endfunction
//=================================================================
// End of Configuration Header
//=================================================================
function Sun_Ritual_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Sun_Ritual_SpellId()
endfunction
function Sun_Ritual_Loop takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit wisp = GetHandleUnit(t, "wisp")
local unit cast = GetHandleUnit(t, "cast")
local player p = GetOwningPlayer(cast)
local player p2
local integer lvl = GetUnitAbilityLevel(cast, Sun_Ritual_SpellId())
local real x = GetUnitX(wisp)
local real y = GetUnitY(wisp)
local real z = GetUnitFlyHeight(wisp)
local real x2 = GetRandomReal(x - 500.00, x + 500.00)
local real y2 = GetRandomReal(y - 500.00, y + 500.00)
local real count = GetHandleReal(t, "count")
local unit u = CreateUnit(p, Sun_Ritual_DummyId(), x2, y2, 270.00)
local unit targ
local lightning light = GetHandleLightning(t, "light")
local effect e = GetHandleEffect(t, "e")
local group g
local integer i = lvl * 2
local integer trackinglvl = 0
// Stop anything started/initiated in the previous loop (0.05 second ago).
call StopSound(gg_snd_HolyBolt, false, true)
call DestroyEffect(e)
call DestroyLightning(light)
// Clean if it's over.
if count == Sun_Ritual_LoopTimes(lvl) then
call PauseTimer(t)
call FlushHandleLocals(t)
call DestroyTimer(t)
set t = null
set wisp = null
set cast = null
set p = null
set p2 = null
set u = null
set light = null
set e = null
return
endif
// Proceed with the Stats reduction.
set g = CreateGroup()
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, null)
loop
set targ = FirstOfGroup(g)
exitwhen targ == null
set trackinglvl = GetUnitAbilityLevel(targ, Sun_Ritual_TrackingDebuff_Id())
if GetUnitAbilityLevel(targ, Sun_Ritual_Buff_Id()) > 0 and IsUnitType(targ, UNIT_TYPE_HERO) == true and trackinglvl == 0 then
call SetHeroAgi(targ, GetHeroAgi(targ, false) - i, true )
call SetHeroInt(targ, GetHeroInt(targ, false) - i, true )
call SetHeroStr(targ, GetHeroStr(targ, false) - i, true )
call UnitAddAbility(targ, Sun_Ritual_SpellBook_Id())
call SetUnitAbilityLevel(targ, Sun_Ritual_TrackingDebuff_Id(), lvl)
call SetPlayerAbilityAvailable(p2, Sun_Ritual_SpellBook_Id(), false)
elseif trackinglvl > 0 then
call SetHeroAgi(targ, GetHeroAgi(targ, false) - (i - trackinglvl * 2), true )
call SetHeroInt(targ, GetHeroInt(targ, false) - (i - trackinglvl * 2), true )
call SetHeroStr(targ, GetHeroStr(targ, false) - (i - trackinglvl * 2), true )
call SetUnitAbilityLevel(targ, Sun_Ritual_TrackingDebuff_Id(), lvl)
endif
if GetHeroAgi(targ, true) < 1 then
call SetHeroAgi(targ, 1, true)
endif
if GetHeroInt(targ, true) < 1 then
call SetHeroInt(targ, 1, true)
endif
if GetHeroStr(targ, true) < 1 then
call SetHeroStr(targ, 1, true)
endif
call GroupRemoveUnit(g, targ)
endloop
// Create things specific to this loop (Every 0.05 second): sound, effect, lightning, explosion, etc., and store them.
call SetSoundPosition(gg_snd_HolyBolt, x, y, 0.)
call SetSoundVolumeBJ(gg_snd_HolyBolt, PercentToInt(100, 127))
call PlaySoundBJ(gg_snd_HolyBolt)
set light = AddLightningEx(Sun_Ritual_LightningEffect(), true, x, y, z + 400., x2, y2, 0)
set e = AddSpecialEffect(Sun_Ritual_EffectPath(), x2, y2)
call UnitAddAbility(u, Sun_Ritual_DummySpellId())
call SetUnitAbilityLevel(u, Sun_Ritual_DummySpellId(), lvl)
call UnitApplyTimedLife(u, 039;BTLF039;, 2.00)
call IssueImmediateOrder(u, "thunderclap")
call SetHandleHandle(t, "e", e)
call SetHandleHandle(t, "light", light)
call SetHandleReal(t, "count", count + 1.)
// Clean.
call DestroyGroup(g)
set t = null
set e = null
set light = null
set wisp = null
set cast = null
set p = null
set p2 = null
set u = null
set g = null
set targ = null
endfunction
function Sun_Ritual_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit cast = GetTriggerUnit()
local player p = GetOwningPlayer(cast)
local location loc = GetSpellTargetLoc()
// Create the "Sun".
local unit wisp = CreateUnitAtLoc(Player(4), Sun_Ritual_SunId(), loc, 270.00)
// Initialization and Storing
call PlaySoundAtPointBJ( gg_snd_FlameStrikeTargetWaveNonLoop1, 100, loc, 0 )
call SetUnitAnimation( wisp, "birth" )
call UnitApplyTimedLife(wisp, 039;BTLF039;, 5.00)
call SetHandleHandle(t, "cast", cast)
call SetHandleHandle(t, "wisp", wisp)
call TimerStart(t, 0.05, true, function Sun_Ritual_Loop)
call RemoveLocation(loc)
set t = null
set cast = null
set p = null
set loc = null
set wisp = null
endfunction
//===========================================================================
function InitTrig_Sun_Ritual takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Sun_Ritual_Conditions ))
call TriggerAddAction( t, function Sun_Ritual_Actions )
call Preload(Sun_Ritual_EffectPath())
set t = null
endfunction
The other thing is that the units lose the buff that says they have reduced stats when they die. You can fix this by creating a new ability based off of "Slow Aura (Tornado)", placing it in a disabled spellbook, and then giving it to each unit that should be affected instead of doing whatever you do to get the buff on now.
You could even give it 4 levels to detect what level the unit has already had cast on it and then (as you said you will do) make it so that higher level casts affect units with a lower-level buff on them. Rather simple.
And yes, I meant an AoE target.