I'm not prepared yet to post a test map, as I think the code can be improved, and i haven't yet worked on terrain or whatever for a test map...
i am using the system and it works great...but seeing as the code can probably be improved, i want to post that here, and get some input on that. then i can make a test map and submit it if things look good.
trigger called initial lighting day
trigger called night and day
an example trigger:
oh wow, almost forgot this one...
it has other unrelated stuff in it, but it's a very important trigger that helps prevent bugs in the system...
the textmacro in this trigger can probably be used elsewhere in the other triggers, but it's sortof more critical here...doesn't make much of a difference, but it is a lot more pleasing to the eye using this textmacro ifnight and ifday...
as you can see right now my system is currently using libraries and such like xepreload or even taf which is my map's special library...
i think i can definitely improve on my system but i don't really know where to start...
oh and here's a snippet from a crazy trigger i've been working on combining many spells into one event spell effect trigger...it might not be a good idea but whatever...as you can see it's a simple dummy cast thing if and only if the spell is being cast at a proper time of day...think like night stalker and using one of his spells that has a greater impact at night time...
well with my system you can do it for a day time dude too...not just night time...that's the entire point of this day and night system.
i know things are a big mess right now...so please, some experts come along and clean it up for me, ok? you will of course be credited with helping if you do so...i know i'm not an expert programming and i know my place.
i mean...looking over my post...it seems to me like...i'm making a request for this bunch of code i wrote to be transformed into a system...or at least have someone explain to me how to do that, which would be preferable.
i am using the system and it works great...but seeing as the code can probably be improved, i want to post that here, and get some input on that. then i can make a test map and submit it if things look good.
trigger called initial lighting day
JASS:
//this is according to how long the day is...
//because it starts at 13 and war3 automarically has dusk at 18
//and there's nothing you can do about that...
//instead of bothering with war3's imperfect midnight...
//this system uses only dusk and dawn...when it's dawn, it's dawn
//and to make matters simple, at game start it is dawn...that's what this trigger does
//it sets the game start time to dawn.
//you can change the sound if you like to whatever you want.
//go to sound editor, find a sound you want, use it, and give it
//a variable name, my variable names were thelightiswithus and thenightbeckons
//edit:
//actually now that i think about it this is the best way i can think of, to start it
//at 13...because 23 is 5 from 18 as is 13. and at 24 the game goes to 0
//you can of course change your numbers to like 23.5 and 12.5 if you want...
//that's up to you. or you can make the day shorter! haha.
//of course you can also change the speed of the day too, so making the days
//ten hours long isn't so bad, you can choose to make the day longer.
//i believe you have to use the map's gameplay constants to do that.
function Trig_initialweatherday_Actions takes nothing returns nothing
set bj_dawnSound = gg_snd_thelightiswithus//this is my custom dawn sound
set bj_duskSound = gg_snd_thenightbeckons//this is my custom dusk/sunset sound
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 13.00)
endfunction
//===========================================================================
function InitTrig_initiallightingday takes nothing returns nothing
set gg_trg_initiallightingday = CreateTrigger( )
call TriggerAddAction( gg_trg_initiallightingday, function Trig_initialweatherday_Actions )
endfunction
trigger called night and day
JASS:
//I'm submitting this system in hopes that people will recommend how it can be improved, but also because
//nobody tried to make a system like this and i think it's very useful.
scope customdayandnightsystem initializer I
globals
private trigger t3 = CreateTrigger()//daydawnabilitychanges
private trigger t2 = CreateTrigger()//nightfallabilitychanges
private trigger t1 = CreateTrigger()//clockadjustment
//these auras are just set aside for when i need them, they have nothing to do with the
// custom day and night system
constant integer TerrorAura =039;A047039;
constant integer BrillianceAura =039;A03D039;
constant integer EnduranceAura =039;A03E039;
constant integer WarDrumsAura =039;A03I039;
constant integer UnholyAura=039;A03F039;
constant integer VampiricAura =039;A03G039;
constant integer SlowAura=039;A03H039;
constant integer GeneralAuraDummy =039;AGnA039;
//these are the ability and buff codes that the day and night system uses
//your abilities will probably be different, as may be your ability replacing actions...
constant integer DestroyEnergyDummy =039;A00Q039;
constant integer DestroyMagicDummy =039;A00P039;
constant integer DestroyEnergy =039;A00S039;
constant integer DestroyMagic =039;A00N039;
constant integer DispelMagicNormal=039;A00O039;
constant integer HeightenedAgilityOFFDAY=039;A006039;
constant integer HeightenedAgilityOFFNIGHT=039;A005039;
constant integer HeightenedAgilityONDAY=039;A004039;
constant integer HeightenedAgilityONNIGHT=039;A002039;
constant integer HeightenedAgilityDUMMYDAY =039;A00D039;
constant integer HeightenedAgilityDUMMYNIGHT =039;A00E039;
constant integer TimeOfDayAgilityItem =039;A00I039;
constant integer DayStrikeDummy =039;A00F039;
constant integer NightStrikeDummy=039;A00B039;
constant integer ColdStrikeNIGHT=039;A008039;
constant integer HeatStrikeDAY =039;A00A039;
constant integer NightStrikeDAY=039;A007039;
constant integer DayStrikeNIGHT =039;A009039;
constant integer NIGHTWALK=039;B000039;
constant integer DAYWALK =039;B001039;
constant integer ColdStorm =039;A00K039;
constant integer AvengingFlames =039;A00M039;
//UNUSED?//i'm not sure what these are for but i guess i don't trigger them, but somewhere
//they have something to do with the abilities in the day and night system...
constant integer DAYAGILITY=039;B002039;
constant integer NIGHTAGILITY =039;B003039;
endglobals
//textmacro time
//! textmacro RemoveUnitsFromGroup takes UNIT, GROUP
loop
set $UNIT$ = FirstOfGroup($GROUP$)
exitwhen $UNIT$ == null
call GroupRemoveUnit($GROUP$, PickedUnit)
endloop
//! endtextmacro
//! textmacro groupup takes prefix
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function $prefix$filter))
call ForGroup(g, function $prefix$act )
//! endtextmacro
//! textmacro groupupd takes prefix
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function $prefix$filter))
call ForGroup(g, function $prefix$actd )
//! endtextmacro
//this section will probably look different for you
//feel free rename the functions and variables and whatever
//basically, these are the functions called when night time comes.
private function agilnfilter takes nothing returns boolean
return ( GetUnitAbilityLevel( GetFilterUnit(), HeightenedAgilityDUMMYNIGHT) > 0 )
endfunction
private function agilnact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), HeightenedAgilityOFFNIGHT)
call UnitAddAbility(GetEnumUnit(), HeightenedAgilityONNIGHT)
call SetUnitAbilityLevel(GetEnumUnit(), HeightenedAgilityONNIGHT, GetUnitAbilityLevel(GetEnumUnit(),HeightenedAgilityDUMMYNIGHT) )
call UnitAddAbility(GetEnumUnit(), TimeOfDayAgilityItem)
call SetUnitAbilityLevel(GetEnumUnit(), TimeOfDayAgilityItem, GetUnitAbilityLevel(GetEnumUnit(),HeightenedAgilityDUMMYNIGHT) )
endfunction
private function nsfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),NightStrikeDummy) > 0 )
endfunction
private function nsact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), NightStrikeDAY )
call UnitAddAbility(GetEnumUnit(), ColdStrikeNIGHT )
call SetUnitAbilityLevel(GetEnumUnit(), ColdStrikeNIGHT, GetUnitAbilityLevel(GetEnumUnit(),NightStrikeDummy) )
endfunction
private function agildfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),HeightenedAgilityDUMMYDAY) > 0 )
endfunction
private function agildact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), HeightenedAgilityONDAY )
call UnitAddAbility(GetEnumUnit(), HeightenedAgilityOFFDAY )
call SetUnitAbilityLevel(GetEnumUnit(), HeightenedAgilityOFFDAY, GetUnitAbilityLevel(GetEnumUnit(),HeightenedAgilityDUMMYDAY) )
call UnitRemoveAbility(GetEnumUnit(), TimeOfDayAgilityItem )
endfunction
private function dsfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),DayStrikeDummy) > 0 )
endfunction
private function dsact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), HeatStrikeDAY )
call UnitAddAbility(GetEnumUnit(), DayStrikeNIGHT )
call SetUnitAbilityLevel(GetEnumUnit(), DayStrikeNIGHT, GetUnitAbilityLevel(GetEnumUnit(),DayStrikeDummy) )
endfunction
private function dmfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),DestroyMagicDummy) > 0 )
endfunction
private function dmact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), DestroyMagic )
call UnitAddAbility(GetEnumUnit(), DispelMagicNormal )
call SetUnitAbilityLevel(GetEnumUnit(), DispelMagicNormal, GetUnitAbilityLevel(GetEnumUnit(),DestroyMagicDummy) )
endfunction
private function defilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),DestroyEnergyDummy) > 0 )
endfunction
private function deact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), DispelMagicNormal )
call UnitAddAbility(GetEnumUnit(), DestroyEnergy )
call SetUnitAbilityLevel(GetEnumUnit(), DestroyEnergy, GetUnitAbilityLevel(GetEnumUnit(),DestroyEnergyDummy) )
endfunction
//now we have the text macro, again, the names of the textmacro takes
//may probably look different for you...the only difference between
//these textmacro and the others is that they're calling the opposite functions
private function A takes nothing returns boolean
local group g = CreateGroup()
local unit PickedUnit = null
//Eithyr deserves credit for the textmacro RemoveUnitsFromGroup...
//i did not at that time understand textmacro
//i made the other textmacro after i found out how to make them
//Jesus4Lyf taught me textmacro, thanks.
//also this system is really retarded if you do not use
//preloading for your spells and abilities.
//! runtextmacro groupup("agiln")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupup("agild")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupup("ns")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupup("ds")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupup("dm")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupup("de")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
set g = null
return false
endfunction
//this section will probably look different for you
//feel free rename the functions and variables and whatever
//basically, these are the functions called when day time comes.
private function agilnactd takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), HeightenedAgilityONNIGHT )
call UnitAddAbility(GetEnumUnit(), HeightenedAgilityOFFNIGHT )
call SetUnitAbilityLevel(GetEnumUnit(), HeightenedAgilityOFFNIGHT, GetUnitAbilityLevel(GetEnumUnit(),HeightenedAgilityDUMMYNIGHT) )
call UnitRemoveAbility(GetEnumUnit(), TimeOfDayAgilityItem )
endfunction
private function nsactd takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), ColdStrikeNIGHT )
call UnitAddAbility(GetEnumUnit(), NightStrikeDAY )
call SetUnitAbilityLevel(GetEnumUnit(), NightStrikeDAY, GetUnitAbilityLevel(GetEnumUnit(),NightStrikeDummy) )
endfunction
private function dsactd takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), DayStrikeNIGHT )
call UnitAddAbility(GetEnumUnit(), HeatStrikeDAY )
call SetUnitAbilityLevel(GetEnumUnit(), HeatStrikeDAY, GetUnitAbilityLevel(GetEnumUnit(),DayStrikeDummy) )
endfunction
private function agildactd takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), HeightenedAgilityOFFDAY )
call UnitAddAbility(GetEnumUnit(), HeightenedAgilityONDAY )
call SetUnitAbilityLevel(GetEnumUnit(), HeightenedAgilityONDAY, GetUnitAbilityLevel(GetEnumUnit(),HeightenedAgilityDUMMYDAY) )
call UnitAddAbility(GetEnumUnit(), TimeOfDayAgilityItem )
call SetUnitAbilityLevel(GetEnumUnit(), TimeOfDayAgilityItem, GetUnitAbilityLevel(GetEnumUnit(),HeightenedAgilityDUMMYDAY) )
endfunction
private function dmactd takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), DispelMagicNormal )
call UnitAddAbility(GetEnumUnit(), DestroyMagic )
call SetUnitAbilityLevel(GetEnumUnit(), DestroyMagic, GetUnitAbilityLevel(GetEnumUnit(),DestroyMagicDummy) )
endfunction
private function deactd takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), DestroyEnergy )
call UnitAddAbility(GetEnumUnit(), DispelMagicNormal )
call SetUnitAbilityLevel(GetEnumUnit(), DispelMagicNormal, GetUnitAbilityLevel(GetEnumUnit(),DestroyEnergyDummy) )
endfunction
//now we have the text macro, again, the names of the textmacro takes
//may probably look different for you...the only difference between
//these textmacro and the others is that they're calling the opposite functions
private function a takes nothing returns boolean
local group g = CreateGroup()
local unit PickedUnit = null
//Eithyr deserves credit for the textmacro RemoveUnitsFromGroup...
//i did not at that time understand textmacro
//i made the other textmacro after i found out how to make them
//Jesus4Lyf taught me textmacro, thanks.
//also this system is really retarded if you do not use
//preloading for your spells and abilities.
//! runtextmacro groupupd("agiln")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupupd("agild")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupupd("ns")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupupd("ds")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupupd("dm")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
//! runtextmacro groupupd("de")
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
set g = null
return false
endfunction
//see this one was called groupupd d meaning daytime version
//the other one is for nighttime.
//this function keeps it all together. without it, custom day and night system is not possible
private function b takes nothing returns boolean
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 13.00)//this 13.00 is dawn, the first minute of the day
call StartSound(bj_dawnSound)//it's not really dawn without this sound...
return false
endfunction
//===========================================================================
private function I takes nothing returns nothing
call TriggerRegisterGameStateEventTimeOfDay( t1, GREATER_THAN_OR_EQUAL, 23.00 )//this is also dawn
call TriggerAddCondition( t1, Condition( function b ) )//this calls the function that keeps it all together
call TriggerRegisterGameStateEventTimeOfDay( t2, GREATER_THAN_OR_EQUAL, 18.00 )//this is dusk/sunset
call TriggerAddCondition( t2, Condition( function A ) )//calling night time conditions because it's night
call TriggerRegisterGameStateEventTimeOfDay( t3, LESS_THAN, 18.00 )//this is before dusk/sunset
call TriggerAddCondition( t3, Condition( function a ) )//calling day time conditions because it's day
endfunction
endscope
an example trigger:
JASS:
//this is just an example of something you can do to enhance an ability if you wish...
//it's not a super awesome spell or anything...it's just checking for time of day and acting accordingly...
//of course you'll notice it's doing it by checking the ability, because the ability is swapped
//according to the time of day...it's all kindof complicated...hopefully the constant integer names
//help things to make more sense...
function Trig_strike_Actions takes nothing returns nothing
if GetUnitAbilityLevel(GetAttacker(), NIGHTWALK) >= 1 then
call UnitDamageTarget( GetAttacker(), GetTriggerUnit(), ( ( GetUnitMoveSpeed(GetAttacker()) - GetUnitMoveSpeed(GetTriggerUnit()) ) * I2R(GetUnitAbilityLevel(GetAttacker(),NightStrikeDummy)) ), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
else
if GetUnitAbilityLevel(GetAttacker(), DAYWALK) >= 1 then
call UnitDamageTarget( GetAttacker(), GetTriggerUnit(), ( ( GetUnitMoveSpeed(GetAttacker()) - GetUnitMoveSpeed(GetTriggerUnit()) ) * I2R(GetUnitAbilityLevel(GetAttacker(),DayStrikeDummy)) ), false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
endif
endif
endfunction
//===========================================================================
function InitTrig_strike takes nothing returns nothing
set gg_trg_strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_strike, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( gg_trg_strike, function Trig_strike_Actions )
endfunction
//i might have to rewrite these spells with a different event...
//event unit damaged might do damage after windwalk disappears instead of before...
//another idea is to rewrite how much damage is done to creeps or heroes in order to
//balance things...one shotting all the creeps seems kindof unfair...?
//another thing to look at is if they are doing damage properly when not in windwalk mode...
//another idea is to give creeps additional hp, towers too...
oh wow, almost forgot this one...
it has other unrelated stuff in it, but it's a very important trigger that helps prevent bugs in the system...
the textmacro in this trigger can probably be used elsewhere in the other triggers, but it's sortof more critical here...doesn't make much of a difference, but it is a lot more pleasing to the eye using this textmacro ifnight and ifday...
JASS:
scope spellsEPHS initializer I
//! textmacro ifnight
if GetFloatGameState(GAME_STATE_TIME_OF_DAY) >= 18.00 then
//! endtextmacro
//! textmacro ifday
if GetFloatGameState(GAME_STATE_TIME_OF_DAY) < 18.00 then
//! endtextmacro
private function A takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetLearnedSkill()
local integer ii= 0
if i == NightStrikeDummy then
//! runtextmacro ifnight()
call UnitRemoveAbility(u, NightStrikeDAY)
call UnitAddAbility(u, ColdStrikeNIGHT)
call SetUnitAbilityLevel(u, ColdStrikeNIGHT, GetUnitAbilityLevel(u,i) )
else
call UnitRemoveAbility(u, ColdStrikeNIGHT)
call UnitAddAbility(u, NightStrikeDAY)
call SetUnitAbilityLevel( u, NightStrikeDAY, GetUnitAbilityLevel(u,i) )
call SetUnitAbilityLevel( u, NightStrikeDAY, GetUnitAbilityLevel(u,i) )
endif
elseif i == HeightenedAgilityDUMMYNIGHT then
//! runtextmacro ifnight()
call UnitRemoveAbility(u, HeightenedAgilityOFFNIGHT)
call UnitAddAbility(u, HeightenedAgilityONNIGHT)
call SetUnitAbilityLevel( u,HeightenedAgilityONNIGHT, GetUnitAbilityLevel(u,i) )
call UnitAddAbility(u, TimeOfDayAgilityItem)
call SetUnitAbilityLevel( u,TimeOfDayAgilityItem, GetUnitAbilityLevel(u,i) )
else
call UnitRemoveAbility(u, TimeOfDayAgilityItem)
call UnitRemoveAbility(u, HeightenedAgilityONNIGHT)
call UnitAddAbility(u, HeightenedAgilityOFFNIGHT)
call SetUnitAbilityLevel(u, HeightenedAgilityOFFNIGHT, GetUnitAbilityLevel(u,i) )
endif
elseif i == DestroyEnergyDummy then
//! runtextmacro ifnight()
call UnitRemoveAbility(u, DispelMagicNormal)
call UnitAddAbility(u, DestroyEnergy)
call SetUnitAbilityLevel(u, DestroyEnergy, GetUnitAbilityLevel(u,i) )
else
call UnitRemoveAbility(u, DestroyEnergy)
call UnitAddAbility(u, DispelMagicNormal)
call SetUnitAbilityLevel(u, DispelMagicNormal, GetUnitAbilityLevel(u,i) )
endif
elseif i == DayStrikeDummy then
//! runtextmacro ifday()
call UnitRemoveAbility(u, DayStrikeNIGHT)
call UnitAddAbility(u, HeatStrikeDAY)
call SetUnitAbilityLevel(u, HeatStrikeDAY, GetUnitAbilityLevel(u,i) )
else
call UnitRemoveAbility(u, HeatStrikeDAY)
call UnitAddAbility(u, DayStrikeNIGHT)
call SetUnitAbilityLevel( u, DayStrikeNIGHT, GetUnitAbilityLevel(u,i) )
endif
elseif i == HeightenedAgilityDUMMYDAY then
//! runtextmacro ifday()
call UnitRemoveAbility(u, HeightenedAgilityOFFDAY)
call UnitAddAbility(u, HeightenedAgilityONDAY)
call SetUnitAbilityLevel( u,HeightenedAgilityONDAY, GetUnitAbilityLevel(u,i) )
call UnitAddAbility(u, TimeOfDayAgilityItem)
call SetUnitAbilityLevel( u,TimeOfDayAgilityItem, GetUnitAbilityLevel(u,i) )
else
call UnitRemoveAbility(u, TimeOfDayAgilityItem)
call UnitRemoveAbility(u, HeightenedAgilityONDAY)
call UnitAddAbility(u, HeightenedAgilityOFFDAY)
call SetUnitAbilityLevel(u, HeightenedAgilityOFFDAY, GetUnitAbilityLevel(u,i) )
endif
elseif i == DestroyMagicDummy then
//! runtextmacro ifday()
call UnitRemoveAbility(u, DispelMagicNormal)
call UnitAddAbility(u, DestroyMagic)
call SetUnitAbilityLevel(u, DestroyMagic, GetUnitAbilityLevel(u,i) )
else
call UnitRemoveAbility(u, DestroyMagic)
call UnitAddAbility(u, DispelMagicNormal)
call SetUnitAbilityLevel(u, DispelMagicNormal, GetUnitAbilityLevel(u,i) )
endif
elseif i == 039;A011039; then//cntrlmgc
call UnitAddAbility(u, 039;A010039;)//spllstl
call SetUnitAbilityLevel(u, 039;A010039;, GetUnitAbilityLevel(u,i) )
elseif i == 039;A01H039; then//unholyaura(sinister)
call SetUnitAbilityLevel(u, 039;A01I039;, (GetUnitAbilityLevel(u,i)+1) )//raisedead
elseif i == 039;A04R039; then//fieryfury
call AddPlayerTechResearched(GetOwningPlayer(u),039;R00B039;,1)//lavalordatkspdbns
endif
set u = null
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
local integer index = 2
loop
call TriggerRegisterPlayerUnitEvent( t, Player(index),EVENT_PLAYER_HERO_SKILL, Filter(function FilterDebug) )
set index = index + 1
exitwhen index == 11
endloop
call TriggerAddAction( t, function A )
// set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)
call XE_PreloadAbility( 039;A01H039;)
call XE_PreloadAbility( 039;A011039;)
call XE_PreloadAbility( DestroyMagicDummy)
call XE_PreloadAbility( HeightenedAgilityDUMMYDAY)
call XE_PreloadAbility( DayStrikeDummy)
call XE_PreloadAbility( DestroyEnergyDummy)
call XE_PreloadAbility( HeightenedAgilityDUMMYNIGHT)
call XE_PreloadAbility( NightStrikeDummy)
call XE_PreloadAbility( ColdStrikeNIGHT)
call XE_PreloadAbility( NightStrikeDAY)
call XE_PreloadAbility( HeightenedAgilityONNIGHT)
call XE_PreloadAbility( TimeOfDayAgilityItem)
call XE_PreloadAbility( HeightenedAgilityOFFNIGHT)
call XE_PreloadAbility( DispelMagicNormal)
call XE_PreloadAbility( DestroyEnergy)
call XE_PreloadAbility( DayStrikeNIGHT)
call XE_PreloadAbility( HeatStrikeDAY)
call XE_PreloadAbility( HeightenedAgilityOFFDAY)
call XE_PreloadAbility( HeightenedAgilityONDAY)
call XE_PreloadAbility( DestroyMagic)
call XE_PreloadAbility( 039;A010039;)
call XE_PreloadAbility( 039;A01I039;)
call XE_PreloadAbility( 039;A04R039;)
call XE_PreloadAbility( 039;R00B039;)
call XE_PreloadAbility( 039;A06H039;)
call XE_PreloadAbility( 039;A066039;)
// call KillUnit(bj_lastCreatedUnit)
endfunction
endscope
as you can see right now my system is currently using libraries and such like xepreload or even taf which is my map's special library...
i think i can definitely improve on my system but i don't really know where to start...
oh and here's a snippet from a crazy trigger i've been working on combining many spells into one event spell effect trigger...it might not be a good idea but whatever...as you can see it's a simple dummy cast thing if and only if the spell is being cast at a proper time of day...think like night stalker and using one of his spells that has a greater impact at night time...
well with my system you can do it for a day time dude too...not just night time...that's the entire point of this day and night system.
JASS:
//flame storm speedup effect
//made by SanKakU so please give credits if you use this spell in your map
else
if i == AvengingFlames then
if GetFloatGameState(GAME_STATE_TIME_OF_DAY) < 18.00 then
set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 039;e000039;, ux, uy, 270.00)
call UnitAddAbility(u, 039;A00Z039;)
call SetUnitAbilityLevel(u, 039;A00Z039;, GetUnitAbilityLevel(GetSpellAbilityUnit(),AvengingFlames))
call UnitApplyTimedLife(u, 039;BTLF039;, 5.0)
endif
else
//coldstorm slow effect
//made by SanKakU so please give credits if you use this spell in your map
if i == ColdStorm then
if GetFloatGameState(GAME_STATE_TIME_OF_DAY) >= 18.00 then
set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 039;e000039;, ux, uy, 270.00)
call UnitAddAbility(u, 039;A00Y039;)
call SetUnitAbilityLevel(u, 039;A00Y039;, GetUnitAbilityLevel(GetSpellAbilityUnit(),ColdStorm))
call UnitApplyTimedLife(u, 039;BTLF039;, 5.0)
endif
else
i know things are a big mess right now...so please, some experts come along and clean it up for me, ok? you will of course be credited with helping if you do so...i know i'm not an expert programming and i know my place.
i mean...looking over my post...it seems to me like...i'm making a request for this bunch of code i wrote to be transformed into a system...or at least have someone explain to me how to do that, which would be preferable.