• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Attack Damages

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
... can you give me a GUI alternative?

I know how to create a simple damage detection system, but I don't have an idea of how to detect if the damage is physical or not. Just a simple code in GUI will do, please.

a easy way (same time hard way if u use alot default warcraft 3 damage dealer ability)

-rework blizzard spells to your own, its mean instead useing warcraft 3 firebolt/blizzard you make your own (because then u must trigger the damage with trigger for abilities, this have more positive factor too, because example damage could be lv/stat depend too)

-implent the gui damage engine system by bribe in spell section
(http://www.hiveworkshop.com/forums/...01016/?prev=search=damage&d=list&r=20&u=bribe)


-set DamageEventType at every trigger ability on your map before trigger the damage
something like:
  • Set DamageEventType = 1
  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing ((Real(((Intelligence of (Triggering unit) (Include bonuses)) x 10))) + ((Real((Level of (Ability being cast) for (Triggering unit)))) x 5.00)) damage of attack type Spells and damage type Normal
  • //in this example trigger unit to deal int * 10 + ability level * 5 spell damage to ability target
note: you can set any number to DamageEventType just not 0

-at SetDamageTrigger (what is in bribe dds) just check the DamageEventType value, and if it is 0 then it was autoattack

You can also use this event
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
and input conditions (range or melee or whatever)
and then actions.
The Unit - A unit Is attacked event refers only to units that are attacked.
No spell or buff damage.

and sure this not running if you missed on target?
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
There is also another way that I used to use as an alternative in the past, back in the days I am too stubborn to use any damage engine.

Basically you will need 2 triggers for registering units on the map so that you can run the Unit - Damaged trigger later. When a unit is attacked you will run a 0.3 - 0.4s timer and when it expires check if the attacked unit has taken damage > 2 or not, if yes then it has taken physical damage. The method itself is pretty self-explanatory so I don't post any examplary trigger.

Remember, this method is one of the most stupid ways ever to overcome your issue. It is just like walking to a place instead of catching a taxi (using a damage engine as shadowvzs pointed out).
 
Level 10
Joined
Jun 6, 2007
Messages
392
The method I've used is to give all units a buff placer ability (for example slow poison). Then use a damage detection system (for example Bribe's damage engine)to detect the damage:

  • Events
    • DamegeEvent becomes 1.00
  • Conditions
  • Actions
    • if DamageEventTarget has a buff (custom buff) then
      • //damage is physical, you can do the corresponding actions here
      • //don't forget to remove the buff
    • else
      • //damage is magical, do corresponding actions

Note that with this method you can't use buff placers or orb effects in your map. However, there aren't many of them and you can trigger them.
 
Status
Not open for further replies.
Top