• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Night Spell

Status
Not open for further replies.
Level 12
Joined
Nov 5, 2007
Messages
730
Ok this one is pretty simple...I want to make an aura spell that only works at night,like the Night Stalker from DoTA's speed increase.I made a dummy spell that doesnt give any bonuses,and a speed bonus spell that works during the night.Now i dont know which triggers i should use to make the spells replace properly when the time shifts.Please help!
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Make the speed bonus spell (endurance aura??) have 2 levels, 1 having no speed bonus at all. Then make a trigger like this:
  • Speed Bonus
  • Events
    • Game - in-game time becomes 6 hours
  • Actions
    • Unit - Set level of "SpeedBonusSpell" on unit to 1
  • Speed Bonus activation
  • events
    • Game - In-game time becomes 18.00 hours
  • Actions
    • Unit - Set level of SpeedBonusSpell on unit to (level of Dummy spell + 1)
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
Clone a hero ability that doesn't appear, and use a trigger to add a unit type aura ability when you learn lv1 and level when you increase the levels.


What if you make it 4 levels (if the ability have 4 levels that is), the 4 first levels contains 0 value/empty, and the levels after 4 contains real values. This is only used to identify the aura level. Using 4+/- switch on triggers.
 
Level 8
Joined
Dec 16, 2007
Messages
252
There's also great threads on TheHelper.net.

The thread is on: http://www.thehelper.net/forums/showthread.php?t=63252&highlight=Night+Balanar+Dota&page=2




I posted his code down here:

(I didn't make it and I don't know if it work, you can look for yourself and see if it WOULD work)

Header:

JASS:
function Day takes nothing returns integer
  return 'A000' 
endfunction 

function Night takes nothing returns integer
  return 'A001' 
endfunction 

function Night_Abil takes nothing returns boolean
  return ( GetUnitAbilityLevelSwapped('A001', GetTriggerUnit()) > 0 ) 
endfunction 

function Day_Abil takes nothing returns boolean
  return ( GetUnitAbilityLevelSwapped('A000', GetTriggerUnit()) > 0 )
endfunction

function Invis takes nothing returns integer
  return 'A002'
endfunction

//================================================================

Check Night

JASS:
function CheckNight takes nothing returns boolean
    return GetBooleanOr( Day_Abil(), Night_Abil() )
endfunction

function Night_Action takes nothing returns nothing
    local unit Hunter GetTriggerUnit()
    call UnitRemoveAbilityBJ( Day(), Hunter )
    call UnitAddAbilityBJ( Night(), Hunter )
    set Hunter = null
endfunction



//===========================================================================
function InitTrig_Hunter_at_Night takes nothing returns nothing
    set gg_trg_Hunter_at_Night = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Hunter_at_Night, Condition( function CheckNight  ) )
    call TriggerRegisterGameStateEventTimeOfDay( gg_trg_Hunter_at_Night, GREATER_THAN_OR_EQUAL, 18.00 )
    call TriggerRegisterGameStateEventTimeOfDay( gg_trg_Hunter_at_Night, LESS_THAN_OR_EQUAL, 6.00 )
    call TriggerAddAction( gg_trg_Hunter_at_Night, function Night_Action )
endfunction


CheckDay
JASS:
function CheckDay takes nothing returns boolean
    return GetBooleanOr( Day_Abil(), Night_Abil() )
endfunction

function Day_Action takes nothing returns nothing
    local unit Hunter GetTriggerUnit()
    call UnitRemoveAbilityBJ( Night(), Hunter )
    call UnitAddAbilityBJ( Day(), Hunter )
    set Hunter = null
endfunction



//===========================================================================
function InitTrig_Hunter_at_Night_Day takes nothing returns nothing
    set gg_trg_Hunter_at_Night_Day = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Hunter_at_Night_Day, Condition( function CheckDay  ) )
    call TriggerRegisterGameStateEventTimeOfDay( gg_trg_Hunter_at_Night_Day, LESS_THAN_OR_EQUAL, 18.00 )
    call TriggerRegisterGameStateEventTimeOfDay( gg_trg_Hunter_at_Night_Day, GREATER_THAN_OR_EQUAL, 6.00 )
    call TriggerAddAction( gg_trg_Hunter_at_Night_Day, function Day_Action )
endfunction
 
Level 12
Joined
Nov 5, 2007
Messages
730
I cant do that,cause the spell is a hero spell...then it would have 2 times more levels than i wanted to,and i dont want that...Anyways,i found a somewhat simple way to do this,so its ok,thanks anyway :)
 
Level 12
Joined
Nov 5, 2007
Messages
730
The Hero gains increased attack and movement speeds at night.Multiple levels.During the day,the speeds go back to normal.

But i already made the spell a couple of days ago.Can a mod please close this thread so that people dont waste time trying to help with a solved problem?
 
Status
Not open for further replies.
Top