- Joined
- Mar 14, 2008
- Messages
- 5
There are some questions I haven't been able to solve on my own, so I'd like to ask for some assistance with them.
1. I'm making a bodyguard/enforcer sort of summon unit and want to give it an ability where the "master" Hero is damaged and it "takes the bullet", so to speak. Meaning that damage is "deducted" from the "master" and put on the summon. Is there any way to detect damage value dealt without creating a variable for every single enemy Unit Type?
2. With regards to the bodyguard/enforcer summon just mentioned, I want to add a "racket" passive ability where gold is instantly returned to the controlling player upon buying an item. This would, in theory, simulate a discount. I can't find an Integer comparison condition for cost of item, though. What can I do about this that doesn't involve using variables to track costs inefficiently?
3. I'm trying to make an "Omnislash" based off Tinki3's version, but it's bugging out. The Hero attacks only twice before he stops, even when there's clearly more than enough targets to hit. Below is my code; I use array variables with "player number of owner of triggering unit" to simulate MUI, but I don't know if that's causing the problem. Advice would be appreciated.
5. Is there any way to detect when a unit is not moving? I would like to work that into an ability, but I'm not sure what I need to enable this.
All preferably in GUI if possible please.
Thanks in advance.
1. I'm making a bodyguard/enforcer sort of summon unit and want to give it an ability where the "master" Hero is damaged and it "takes the bullet", so to speak. Meaning that damage is "deducted" from the "master" and put on the summon. Is there any way to detect damage value dealt without creating a variable for every single enemy Unit Type?
2. With regards to the bodyguard/enforcer summon just mentioned, I want to add a "racket" passive ability where gold is instantly returned to the controlling player upon buying an item. This would, in theory, simulate a discount. I can't find an Integer comparison condition for cost of item, though. What can I do about this that doesn't involve using variables to track costs inefficiently?
3. I'm trying to make an "Omnislash" based off Tinki3's version, but it's bugging out. The Hero attacks only twice before he stops, even when there's clearly more than enough targets to hit. Below is my code; I use array variables with "player number of owner of triggering unit" to simulate MUI, but I don't know if that's causing the problem. Advice would be appreciated.
-
OmniThing
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Anbarum Ex Deus
-
Actions
- Set ADE_User[(Player number of (Owner of (Triggering unit)))] = (Casting unit)
- Set ADE_target[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
- Set ADE_targetloc[(Player number of (Owner of (Triggering unit)))] = (Position of ADE_target[(Player number of (Owner of (Triggering unit)))])
- Set ADE_loops[(Player number of (Owner of (Triggering unit)))] = (1 + ((Level of Anbarum Ex Deus for ADE_User[(Player number of (Owner of (Triggering unit)))]) x 7))
- Unit - Make ADE_User[(Player number of (Owner of (Triggering unit)))] Invulnerable
- Animation - Change ADE_User[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
- Selection - Remove ADE_User[(Player number of (Owner of (Triggering unit)))] from selection
- Unit - Move ADE_User[(Player number of (Owner of (Triggering unit)))] instantly to ADE_targetloc[(Player number of (Owner of (Triggering unit)))]
- Custom script: call RemoveLocation(udg_ADE_targetloc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Animation - Play ADE_User[(Player number of (Owner of (Triggering unit)))]'s attack animation
- Unit - Cause ADE_User[(Player number of (Owner of (Triggering unit)))] to damage ADE_target[(Player number of (Owner of (Triggering unit)))], dealing (Real((Random integer number between ((Agility of ADE_User[(Player number of (Owner of (Triggering unit)))] (Include bonuses)) + 2) and ((Agility of ADE_User[(Player number of (Owner of (Triggering unit)))] (Include bonuses)) + 16)))) damage of attack type Chaos and damage type Divine
- Special Effect - Create a special effect attached to the chest of ADE_User[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
- Special Effect - Destroy (Last created special effect)
-
For each (Integer A) from 1 to ADE_loops[(Player number of (Owner of (Triggering unit)))], do (Actions)
-
Loop - Actions
- Wait 0.30 game-time seconds
- Set ADE_User_CurrentLoc[(Player number of (Owner of (Triggering unit)))] = (Position of ADE_User[(Player number of (Owner of (Triggering unit)))])
- Set ADE_newgrp[(Player number of (Owner of (Triggering unit)))] = (Units within 1024.00 of ADE_User_CurrentLoc[(Player number of (Owner of (Triggering unit)))] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Player((Player number of (Owner of (Triggering unit)))))) Equal t
- Set ADE_newgrp_rand[(Player number of (Owner of (Triggering unit)))] = (Random 1 units from ADE_newgrp[(Player number of (Owner of (Triggering unit)))])
- Custom script: call RemoveLocation(udg_ADE_User_CurrentLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in ADE_newgrp[(Player number of (Owner of (Triggering unit)))]) Greater than 0
-
Then - Actions
-
Unit Group - Pick every unit in ADE_newgrp_rand[(Player number of (Owner of (Triggering unit)))] and do (Actions)
-
Loop - Actions
- Set ADE_Picked[(Player number of (Owner of (Triggering unit)))] = (Picked unit)
- Set ADE_PickedLoc[(Player number of (Owner of (Triggering unit)))] = (Position of ADE_Picked[(Player number of (Owner of (Triggering unit)))])
- Selection - Remove ADE_User[(Player number of (Owner of (Triggering unit)))] from selection
- Unit - Move ADE_User[(Player number of (Owner of (Triggering unit)))] instantly to ADE_PickedLoc[(Player number of (Owner of (Triggering unit)))]
- Custom script: call RemoveLocation(udg_ADE_PickedLoc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Animation - Play ADE_User[(Player number of (Owner of (Triggering unit)))]'s attack animation
- Unit - Cause ADE_User[(Player number of (Owner of (Triggering unit)))] to damage ADE_Picked[(Player number of (Owner of (Triggering unit)))], dealing (Real((Random integer number between ((Agility of ADE_User[(Player number of (Owner of (Triggering unit)))] (Include bonuses)) + 2) and ((Agility of ADE_User[(Player number of (Owner of (Triggering unit)))] (Include bonuses)) + 24)))) damage of attack type Chaos and damage type Divine
- Special Effect - Create a special effect attached to the chest of ADE_User[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
- Special Effect - Destroy (Last created special effect)
-
Loop - Actions
- Custom script: call DestroyGroup(udg_ADE_newgrp[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Custom script: call DestroyGroup(udg_ADE_newgrp_rand[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
-
Unit Group - Pick every unit in ADE_newgrp_rand[(Player number of (Owner of (Triggering unit)))] and do (Actions)
-
Else - Actions
- Custom script: call DestroyGroup(udg_ADE_newgrp[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Custom script: call DestroyGroup(udg_ADE_newgrp_rand[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
- Selection - Add ADE_User[(Player number of (Owner of (Triggering unit)))] to selection for (Owner of (Triggering unit))
- Animation - Change ADE_User[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
- Unit - Make ADE_User[(Player number of (Owner of (Triggering unit)))] Vulnerable
-
If - Conditions
-
Loop - Actions
- Selection - Add ADE_User[(Player number of (Owner of (Triggering unit)))] to selection for (Owner of (Triggering unit))
- Animation - Change ADE_User[(Player number of (Owner of (Triggering unit)))]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
- Unit - Make ADE_User[(Player number of (Owner of (Triggering unit)))] Vulnerable
-
Events
5. Is there any way to detect when a unit is not moving? I would like to work that into an ability, but I'm not sure what I need to enable this.
All preferably in GUI if possible please.
Thanks in advance.
Last edited: