• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Disabling Attack (based on item existense)

Status
Not open for further replies.
Level 8
Joined
Mar 26, 2009
Messages
301
1-) I need a simple way to disable attack ability of an unit if certain item(s) is/are not present in unit's inventory. (Prefably any other method than: "If item does not exist -> Activate Trigger X (Trigger X causes unit to stop when ordered to attack)

2-) Is it possible to modify base attack damage of an unit with GUI Trigger System ?(without Jass)

3-) Also off topic; how do we detect a unit that has made an attack (ranged)
I need the moment when projectile is launched, it doesn't have to hit it's target

Well I have some things in my mind to acomplish these things but I am not sure if they are efficent, so that's why I am asking for help =) What are your suggestions?
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
1) Silence ability can be edited to remove unit's attack - change field in object editor: Data - Attacks prevented. So set silence duration to about 2 seconds,AoE to ~5.00 and something like:
  • Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type YourUnits) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has an item of type Weapon) Equal to False
            • Then - Actions
              • Set Loc = (Position of (Picked unit))
              • Unit - Create 1 Dummy for Neutral Hostile at Loc facing Default building facing degrees
              • Unit - Order (Last created unit) to Neutral Dark Ranger - Silence Loc
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation(udg_Loc)
            • Else - Actions
2) You can give your unit Damage tomes,items with ability Item Permanent Damage Gain to increase damage. For decreasing,you can try using negative values for gaining,i'm not sure if it will work though.

3) You will most probably need custom attack system.
 
Level 10
Joined
Jul 12, 2009
Messages
321
1-) I need a simple way to disable attack ability of an unit if certain item(s) is/are not present in unit's inventory.
Make the unit not have any attacks enabled by default, and give the item(s) an orb ability that enables attack 1.

2-) Is it possible to modify base attack damage of an unit with GUI Trigger System ?(without Jass)
Yes, see Garfield's post.

3-) Also off topic; how do we detect a unit that has made an attack (ranged)
I need the moment when projectile is launched, it doesn't have to hit it's target
Without a full custom attack system, this is impractical to do. I know of two ways, both with limitations.
 
Status
Not open for further replies.
Top