- Joined
- Aug 21, 2005
- Messages
- 3,699
I don't know if it has been done in another map yet, but I want a detecting system in my map...
Since I'm so stupid, I don't see another way to do this than in the following way: (please tell me if you have a better idea, or see some bugs in it)
Trigger 1
Events: Unit - A unit Learns a skill
Conditions: And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Assassin
(Learned Hero Skill) Equal to Orc Blademaster - Wind Walk (
"Detect Traps" spell is a custom spell --> windwalk with no stats, no duration)
Actions: Set Variable: Set DetectTraps = (Learned skill level) (integer variable)
Trigger 2
Events: Unit - A unit Begins casting an ability
Conditions: (Ability being cast) Equal to Detect Traps
Actions:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DetectDeadlylightningtraps Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 25) Less than or equal to DetectTraps
Then - Actions
Special Effect - Create a special effect at (Position of Traps 0146 <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
Wait 5.00 seconds
Special Effect - Destroy (Last created special effect)
Else - Actions
Do nothing
Else - Actions
Do nothing
Detectdeadlylightningtraps is a boolean that becomes true when a unit enters a certain region near the actual deadly lightning trap. It will become false when you leave that region.
Now my questions:
1) Is this detect traps system acceptable or is it really like "cursing against God" for you guys
2) Since I'm planning to make alot of traps in my map (well alot = more than 30...), this enter & leave region to be able to detect the trap is quite annoying...
I was thinking of making a neutral invissible unit at the place of the trap, so when you come within 400 of that unit, the variable will become true too.
2 problems: 1: It will still be annoying like the regions, since I'll have to do this for every specific trap. I'm going to make deadly lightning traps, but also normal lightning traps, freezing ice traps, etc. If I'd make a new unit for every TYPE of trap, and if I could say that when a unit comes within 400 of that unit TYPE, It would be ALOT easier... But I don't know how to do that event...
Problem 2: I don't know how I can make the variable (deadlylightningtraps) go false again, since there is no such event like "a unit leaves the trapunit within range of 400, if you understand what I'm trying to say...
Maybe saying "A unit comes within -400 of unit" would help this, but I don't know if warcraft III will understand that "-400" means that he does not come withing 400 of that unit...
please help me? Thank you
Since I'm so stupid, I don't see another way to do this than in the following way: (please tell me if you have a better idea, or see some bugs in it)
Trigger 1
Events: Unit - A unit Learns a skill
Conditions: And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Assassin
(Learned Hero Skill) Equal to Orc Blademaster - Wind Walk (
"Detect Traps" spell is a custom spell --> windwalk with no stats, no duration)
Actions: Set Variable: Set DetectTraps = (Learned skill level) (integer variable)
Trigger 2
Events: Unit - A unit Begins casting an ability
Conditions: (Ability being cast) Equal to Detect Traps
Actions:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DetectDeadlylightningtraps Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 25) Less than or equal to DetectTraps
Then - Actions
Special Effect - Create a special effect at (Position of Traps 0146 <gen>) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
Wait 5.00 seconds
Special Effect - Destroy (Last created special effect)
Else - Actions
Do nothing
Else - Actions
Do nothing
Detectdeadlylightningtraps is a boolean that becomes true when a unit enters a certain region near the actual deadly lightning trap. It will become false when you leave that region.
Now my questions:
1) Is this detect traps system acceptable or is it really like "cursing against God" for you guys
2) Since I'm planning to make alot of traps in my map (well alot = more than 30...), this enter & leave region to be able to detect the trap is quite annoying...
I was thinking of making a neutral invissible unit at the place of the trap, so when you come within 400 of that unit, the variable will become true too.
2 problems: 1: It will still be annoying like the regions, since I'll have to do this for every specific trap. I'm going to make deadly lightning traps, but also normal lightning traps, freezing ice traps, etc. If I'd make a new unit for every TYPE of trap, and if I could say that when a unit comes within 400 of that unit TYPE, It would be ALOT easier... But I don't know how to do that event...
Problem 2: I don't know how I can make the variable (deadlylightningtraps) go false again, since there is no such event like "a unit leaves the trapunit within range of 400, if you understand what I'm trying to say...
Maybe saying "A unit comes within -400 of unit" would help this, but I don't know if warcraft III will understand that "-400" means that he does not come withing 400 of that unit...
please help me? Thank you