• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Trigger help(light spell deal 2x dmg to HERO type defense)

Status
Not open for further replies.
Level 1
Joined
Jun 5, 2008
Messages
151
Hi I have a question if it is possible to make a trigger for each spell that will make thunder spell deal 2x more damage to "low"-"medium" or other type of armor/defense?

of course...w3 dont know that lighting spell...is "lighting" type...i have to do it all in triggers ;) something like:

Events
Unit- casting a spell

Conditions

ABIlity being cast = lighting spell

Actions

DEAL 2x damage to "low" type armor
Deal 1.5 damage to "medium" type armor


etc...I hope you understand what i mean...it is something like normal attack..

When i have 10-10 damage "hero" type" and i deal 2x damage to "low" armor type... so i will hit for 20... I want to do same thing but with spells ;) I know that i have to make each trigger to each spell...but i cant help it lol
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Hmm is it possible that you mean somehow this:
1) Click in the editor [Terrain Editor [ F3 ]] on Advanced

2) Click on Gameplay Constants...

3) In the new window search for ( I hope you got an english editor ):
Combat - Damage bonus table - Spells

4) If yes, don't forget to mark "Use Custom Gameplay Constants" in the left corner.

Greetings
~ The Bomb King > Dr. Boom
 
Level 1
Joined
Jun 5, 2008
Messages
151
I am not using English editor ;( but i will try to find this lol


it isnt what i want ;D...it is what i already did ;) and it works only on "normal" attacks...i need to do it with triggers...

lets say i have few spells:

SPELL1
SPELL2
SPELL3
SPELL4
SPELL5

and lets say my target have defense type "medium"

SPELL1 deal 2x dmg
SPELL2 deal 1x dmg
SPELL3 deal 1x dmg
SPELL4 deal 0.5x dmg
SPELL5 deal 1.5 dmg

It is how it must work...but SPELLS will always deal 1x dmg...because there is no reduction or anything..
 
Last edited:
Dr. Boom already gave you the solution :)
That table thing will actually cause the damage received by Spells to be reduced, when hitting against Small or Medium armor.
Go to Combat - Damage bonus table - Spells, go to the first field (Small armor, the one you call "Low"), and set it to 1.5. Then, go to Medium armor and set it to 2.

The action in your trigger would be:
  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 500.00 damage of attack type Spells and damage type Normal
This will automatically embrace the changes of the Gameplay Constants; it will do 500*1.5 for Small armor and 500*2 for Medium armor respectively.
 
Level 1
Joined
Jun 5, 2008
Messages
151
hmm so I have to use this trigger to all spells i need? also...which field is for spell reduction? ...because I want to make other type of spells too..

Fire
Grass
Water
Electric
Ground

it is possible to make it work with all those spells? all of them will deal different damage to different armor type...

If this is possible then please tell me how ;) After you do this i will have another question...;) I hope it is possible ^_^ then it would be great lol
 
Hm, no, you would then to retain the values to 1.00 and make a unit-type comparison. For example, an orc grunt would have medium armor, so making the Unit-type comparison for the Orc Grunt, you'd know that it's a unit with medium armor.
You can do this:
  • Actions
    • -------- Medium Armored Units --------
    • Set Units[1] = Grunt
    • Set Units[2] = Shadow Hunter
    • Set Units[3] = Druid of the Talon (Night Elf Form)
    • -------- Low Armored Units --------
    • Set Units[4] = Kodo Beast
    • Set Units[5] = Dragonhawk Rider
    • Set Units[6] = Meat Wagon
  • Go
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to X
    • Actions
      • -------- BaseDamage variable is a Real variable and it will be the damage you want to deal. --------
      • Set BaseDamage = 310.00
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Units[(Integer A)]
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (BaseDamage x 1.50) damage of attack type Spells and damage type Normal
            • Else - Actions
              • For each (Integer B) from 4 to 6, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Target unit of ability being cast)) Equal to Units[(Integer B)]
                    • Then - Actions
                      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (BaseDamage x 2.00) damage of attack type Spells and damage type Normal
                    • Else - Actions
This is an example; adjust the triggers to the values you want and do this for each element. To make a check of the elements, simply use an Ability comparison, to check what ability is the corresponding element, to deal the corresponding amount of damage to the target.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
There is no real way to get the armor type of a unit via triggers without creating your own system to do so.

For this I would advise using hashtables as you can then use the integer of the raw data type of the unit to get its armor type in the form of an integer. You can then use this in a multiple selection (if, elseif, else, endif) to get the damage it should deal. However you will have to add all unit types to the system at map initialization so you can see why it is irritating to do.
 
Level 1
Joined
Jun 5, 2008
Messages
151
hmm i dont understand it all...in my map there will be alot of different monsters...probably over 100 different...but only about 6 types of armors...

what about if i want to deal 2xagility+200 by using my spell? can i change base damage to deal 2x agility? and apply reductions too?


so this way you are telling me..how many armors "type" can i make using those "hastables" or whatever it is...? it is unlimited? :p Can you show how its work?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
You basically have to create a form of database. With the parent index being the unit type ID and then an integer for an offset (you could store other data via this method but lets say 1 is for armor type.

You then difine a list of integers for how the triggers should handle it.
like 1 = light armor
2 = heavy armor
3 = arcane armor

These are just mental notes so you remember what each stored number means.
You can then store these to each unit type using hashtables.

so to the unit type 'n000' you could attach 1 which means that unit has light armor.
Due to hashtables method of opperating, it will maintain high efficency even if you have 100 or 1000 unit types as apposed to systems described above.

To recall the armor type, you get the effected unit's type and load the armor value using that as the unit type index (its a recall not set). You then use some form of formula, another table this time with arrays or a multiple selection (if, elseif, else, endif) to get the right damage formula for that armor.

This would allow you to have more spell effecting armor types than the game physically has. However do remember they wont be clear in the normal UI the game has as you will have to show the standard armor types. You can use a multiboard to display this extended information if you want but if each armor type links to a real WC3 armor type then this is not a problem.

When damaging the unit, be aware that the damage type and other options affect how the damage is applied. Spell usually ignore armor (they get type reduction but no difference from a unit with 0 armor or 999 armor) however you can make them get reduced by armor, be affected by magic reducingg buffs or be unreducable (ignores armor type and ammount and any damage reduction abilities).
 
Level 1
Joined
Jun 5, 2008
Messages
151
hmm can you give a map? I dont understand it all...those (endif etc.) i dont know how to make custom script or anything like that... also i dont want armor reduction for spells...even if he have 1000 armor i want to deal normal damage....or 2x or 0.5 depending on armor type...

I dont understand how to make it lol...at least give me some hints...also do i need to use "variables"(i`m not sure i you know what i mean)? :O
 
Level 1
Joined
Jun 5, 2008
Messages
151
hmm i am not sure ;) this is not approved...also this person is globally ignored ;D well thanks anyway... there is something about those hastables...now i am 100% sure i dont understand how to make it ;D so if someone can give me a map with 1 spell...and i would like to check if it will deal 2x damage to enemy...and 0.5x damage to another enemy ;) if it would work i am think i could do rest by myself...
 
Level 1
Joined
Jun 5, 2008
Messages
151
ok thanks, I will check and if it is work as i want..and i will be able to add more type of armors then i will give all of you +rep ;)


its work nice...but those 2 peoples above told me that its possible to make alot more armors, i want to have something like 10 diffrent types of armors...


also your map i deal 15 to hero not 25...
 
Last edited:
Level 3
Joined
Dec 9, 2009
Messages
35
In UI you can see only 8 types of armor : Light, Medium, Heavy, Fort, Normal, Hero, Divine and Unarmored. It is impossible to see more then 8 armor types in UI but if is possible with triggers. To do this you can set variable ArmorType(it is string variable) to :
[trigger=Trigger]Trigger
Set ArmorType[1] = Heavy
Set ArmorType[2] = Cold
Set ArmorType[3] = Fire[/trigger]
and that for all armor types what you need. Then in object editor set unit-stats- Point Value to armor type of your unit. The when spell is casted
[trigger=Trigger]Untitled Trigger 001
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Some Spell
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ArmorType[(Point-value of (Target unit of ability being cast))] Equal to Heavy
Then - Actions
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 100.00 damage of attack type Spells and damage type Normal
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ArmorType[(Point-value of (Target unit of ability being cast))] Equal to Cold
Then - Actions
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 50.00 damage of attack type Spells and damage type Normal
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ArmorType[(Point-value of (Target unit of ability being cast))] Equal to Fire
Then - Actions
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 25.00 damage of attack type Spells and damage type Normal
Else - Actions[/trigger]
But in unit UI unit will have it nature armor type (not Fire or Cold). I hope you have understand this, also i have some ideas to increases number of armor type to unlimited. I am current working on it.
And it deal 15 to hero couse hero armor type have nature 30% reduction to spells.
 
Level 1
Joined
Jun 5, 2008
Messages
151
I understand this...but what do you mean by saying "nature" armor type...i dont want any reduction from spells...only from normal attack ;) but spells reduction 0.00...if it is possible ;) and i will check this trigger later thanks
 
Level 3
Joined
Dec 9, 2009
Messages
35
In warcraft 3 spell damage deal pure damage to all armor types, and 70% pure damage to hero armor type. If you need you can change this in Advanced-Gameplay Constants-Combat damage bonus table-Spells and change all to 1.
 
Status
Not open for further replies.
Top