snmiglight
Active Member
- Reaction score
- 3
Hunter in the Night; are these leaking?
hi there.. it's me again asking questions...
almost a year ago, i tried to emulate dota's hunter in the night skill.
now i have these codes that i simply copied from somewhere.
here's the codes. are there any leaks or something here?
Night is a Boolean variable initially set to true
one more question: will periodically checking in every split seconds, say every 0.01 seconds causes lag? thanks in advanced again and more power.
hi there.. it's me again asking questions...
almost a year ago, i tried to emulate dota's hunter in the night skill.
now i have these codes that i simply copied from somewhere.
here's the codes. are there any leaks or something here?
Trigger:
- Nighttime
- Events
- Game - The in-game time of day becomes Greater than or equal to 18.00
- Game - The in-game time of day becomes Less than or equal to 5.59
- Conditions
- Actions
- Set Night = True
- Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Level of Hunter in the Night (Learning Skill) for (Matching unit)) Greater than 0))) and do (Actions)
- Loop - Actions
- Unit - Add Hunter in the Night (Night Skill) to (Picked unit)
- Unit - Remove Hunter in the Night (Day Skill) from (Picked unit)
- Unit - Remove Hunter in the Night [Daytime] buff from (Picked unit)
- Loop - Actions
- Events
Trigger:
- Daytime
- Events
- Game - The in-game time of day becomes Greater than or equal to 6.00
- Game - The in-game time of day becomes Less than or equal to 17.59
- Conditions
- Actions
- Set Night = False
- Events
Trigger:
- Set to Level
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Level of Hunter in the Night (Learning Skill) for (Matching unit)) Greater than 0))) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Night Equal to True
- Then - Actions
- Unit - Set level of Hunter in the Night (Night Skill) for (Picked unit) to (Level of Hunter in the Night (Learning Skill) for (Picked unit))
- Else - Actions
- Unit - Add Hunter in the Night (Day Skill) to (Picked unit)
- Unit - Remove Hunter in the Night (Night Skill) from (Picked unit)
- Unit - Remove Hunter in the Night [Nighttime] buff from (Picked unit)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Level of Hunter in the Night (Learning Skill) for (Matching unit)) Greater than 0))) and do (Actions)
- Events
Trigger:
- Learning
- Events
- Unit - A unit Learns a skill
- Conditions
- And - All (Conditions) are true
- Conditions
- (Level of Hunter in the Night (Learning Skill) for (Triggering unit)) Equal to 1
- (Learned Hero Skill) Equal to Hunter in the Night (Learning Skill)
- Conditions
- And - All (Conditions) are true
- Actions
- Unit - Add Hunter in the Night (Night Skill) to (Triggering unit)
- Unit - Remove Hunter in the Night (Day Skill) from (Picked unit)
- Unit - Remove Hunter in the Night [Daytime] buff from (Picked unit)
- Events
Night is a Boolean variable initially set to true
one more question: will periodically checking in every split seconds, say every 0.01 seconds causes lag? thanks in advanced again and more power.