• 🏆 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!

Add dmg and def via trigger

Status
Not open for further replies.
Level 12
Joined
Mar 24, 2011
Messages
1,082
I want to make an ability which gives dmg(agi*3) and defence(str/10) and sets the ms to 0 based on "avatar" or "metamorphosis"

I was thinking for 2 trigers: 1st - when the unit starts the effect of the ability to add the dmg,def and set the ms to 0
2nd - when the unit finishes casting the ability to return the dmg,def and ms to normal

But then there are 2 problems which ocur in my mind:
1st - How to add dmg and def to a unit via trigger. Will it add to the base dmg or will it be "added" dmg
2nd - What will happen of the unit gains str/agi while the avatar is in use?
I mean if the hero has 100 str/agi and starts the ability it will gain 300 dmg and 50 def. But what will happen if the unit gets more agi/str while under avatar and what will happen when it finishes.
edit//3 - will starts the effect... and finishes casting... work on "avatar"

Can someone tell me if I am whrong and show how would the trigger/s look.

Tnx and sorry for gramar.

PS:Curently i have no acces to WE
PS2:Grammar or gramar :p ?
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
I want to make an ability which gives dmg(agi*3) and defence(str/10) and sets the ms to 0 based on "avatar" or "metamorphosis"

I was thinking for 2 trigers: 1st - when the unit starts the effect of the ability to add the dmg,def and set the ms to 0
2nd - when the unit finishes casting the ability to return the dmg,def and ms to normal

But then there are 2 problems which ocur in my mind:
1st - How to add dmg and def to a unit via trigger. Will it add to the base dmg or will it be "added" dmg
2nd - What will happen of the unit gains str/agi while the avatar is in use?
I mean if the hero has 100 str/agi and starts the ability it will gain 300 dmg and 50 def. But what will happen if the unit gets more agi/str while under avatar and what will happen when it finishes.
edit//3 - will starts the effect... and finishes casting... work on "avatar"

Can someone tell me if I am whrong and show how would the trigger/s look.

Tnx and sorry for gramar.

PS:Curently i have no acces to WE
PS2:Grammar or gramar :p ?

1. make 4 ability based on claw (item ability - item damage bonus (+1))
1st ability with lv10, at level 1 = 0 dmg, at lv2 = 1 dmg, at lv3 = 2dmg... at lv10=9 dmg
2nd ability with lv10, at level 1 = 0 dmg, at lv2 = 10 dmg, at lv3 = 20dmg... at lv10=90 dmg
3rd with lv10, at level 1 = 0 dmg, at lv2 = 100 dmg, at lv3 = 200dmg... at lv10=900 dmg
4th with lv10, at level 1 = 0 dmg, at lv2 = 1000 dmg, at lv3 = 2000dmg... at lv10=9000 dmg

add all 4 ability and just change the ability levels as u want, max bonus damage what u can do is 9999

this visible at unit portrait like base damage+9999
(example if u have 31 agi then u must add 93 damage, its mean level the 2nd ability to level 10 and 1st ability to level)

have easier methode, USE Gui Damage engine then u can set easily something like this

  • Set DamageEventAmount = (DamageEventAmount + (DamageEventAmount x ((Real((Agility of DamageEventSource (Exclude bonuses)))) x 3.00)))
but this u cant see where show damage, so dont visible near hero portrait

About def u mean armor? maybe u can use similiar methode

2. nothing, that str or agi stay because avatar dont transform your unit to another unit, every stat/buff/item/ability level stay after avatar effect too
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I will use the first method but I can't think of an equation how to set the ability levels.

I came up with AGI*3 = XYZP
so for the first ability i need value "P"+1
for second i need value "Z"+1
for third i need value "Y"+1
for fourth i need value "X"+1

But I dont know how to isolate those values with WE.

ps:I will have acces to WE after 3-4 hours.
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
I will use the first method but I can't think of an equation how to set the ability levels.

I came up with AGI*3 = XYZP
so for the first ability i need value "P"+1
for second i need value "Z"+1
for third i need value "Y"+1
for fourth i need value "X"+1

But I dont know how to isolate those values with WE.

ps:I will have acces to WE after 3-4 hours.

lets say this agi*3 = 3527

-----ability1--ability2--ability3--ability 4
lv1 --- 0 dmg - 0dmg -- 0dmg --- 0dmg
lv2 --- 1 dmg - 10dmg - 100dmg -1000dmg
lv3 --- 2 dmg - 20dmg - 200dmg - 2000dmg
lv4 --- 3 dmg - 30dmg - 300dmg - 3000dmg
lv5 --- 4 dmg - 40dmg - 400dmg - 4000dmg
lv6 --- 5 dmg - 50dmg - 500dmg - 5000dmg
lv7 --- 6 dmg - 60dmg - 600dmg - 6000dmg
lv8 --- 7 dmg - 70dmg - 700dmg - 7000dmg
lv9 --- 8 dmg - 80dmg - 800dmg - 8000dmg
lv10 -- 9 dmg - 90dmg - 900dmg - 9000dmg

nr4=3527/1000=>=3

set ability4 to nr4+1(so to 4)

nr3=(3527-nr4*1000)/100=527*100=>=5

set ability lv 3 to nr3 + 1(so to 6)

nr2=(3527-nr4*1000-nr3*100)/10=>27/10=>=2

set ability 2 level to nr2+1(so to 3)

nr1 = 3527-nr4*1000-nr3*100-nr2*10=>7
set ability 1 level to nr1 + 1 (so to 8)

jass example
JASS:
    local integer i
    local integer n
    local integer a1
    local integer a2
    local integer a3
    local integer a4
        set a1 = udg_Abilities2[17]
        set a2 = udg_Abilities2[18]
        set a3 = udg_Abilities2[19]
        set a4 = udg_Abilities2[20]
        set i = GetHeroAgi(GetTriggerUnit,false)*3
        set n = i / 1000 + 1
        call SetUnitAbilityLevel( u, a4, n )
        set i = i - ( i / 1000 ) * 1000
        set n = i / 100 + 1
        call SetUnitAbilityLevel( u, a3, n )
        set i = i - ( i / 100 ) * 100
        set n = i / 10 + 1
        call SetUnitAbilityLevel( u, a2, n )
        set i = i - ( i / 10 ) * 10
        set n = i + 1
        call SetUnitAbilityLevel( u, a1, n )
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I came to the same thing a few hours... last night but today I thought
(using your example) 3527/1000 = 3.527 ~ 4
And then we have 1 extra level

So does the WE do not "round"(sory if wrong, used online dictionary) the x.5-9 values to the higher number ?

PS:Still no WE... so only thinking in theory.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I came to the same thing a few hours... last night but today I thought
(using your example) 3527/1000 = 3.527 ~ 4
And then we have 1 extra level

So does the WE do not "round"(sory if wrong, used online dictionary) the x.5-9 values to the higher number ?

PS:Still no WE... so only thinking in theory.

if we talk about interger then its rounded down allways => 9.9=9, 8.1=8 9.0=9,8.7=8

so since u dont need real for this calculation because player stat also integer (cant be 25.7 agi, no? :p) also *3 is integer, also dividing we divide with integer numbers, so it never will be x.y just x (so allways rounded down number)

also example in wait trigger, there u use real number so
  • Wait 2.12 seconds
but if u conmvert real to integer then back to real then it is 2 and not 2.12
  • Wait (Real((Integer(2.12)))) seconds
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Thank you. Now gona try it in WE.
ps:Thanks again.


EDIT2//It kinda fixed after saving the map lolz. Now works properly.//

Pffft I messed it somewhere. Heres the trigger.
Originaly it was only 1 "i" and 1 "n" as in shadowvzs's example but then i saw that it worked properly only with agi up to 33 and started messing with stuff.

"i" and "n" are integer variables (obvious as mentioned in shadowvzs's post)
  • Immobile Fortress
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Avatar N
    • Actions
      • Set i = ((Integer((Real((Agility of (Triggering unit) (Include bonuses)))))) x 3)
      • Set n = ((i / 1000) + 1)
      • Unit - Set level of 0-9000 for (Triggering unit) to n
      • Set i2 = (i - ((i / 1000) x 1000))
      • Set n2 = ((i2 / 100) + 1)
      • Unit - Set level of 0-900 for (Triggering unit) to n2
      • Set i3 = (i2 - ((i2 / 100) x 100))
      • Set n3 = ((i3 / 10) + 1)
      • Unit - Set level of 0-90 for (Triggering unit) to n3
      • Set i4 = (i3 - ((i3 / 10) x 10))
      • Set n4 = (i4 + 1)
      • Unit - Set level of 0-9 for (Triggering unit) to n4


The results from the test I made.
AGI -19-21-25-30-33-34-40-95-245-295-345-445
DMG-57-63-75-90-99- 2 -20-85- 35- 85- 35- 35

PS:I don't get why only 3rd and 4th spell works properly because they depednd on the previous ones.
 
Last edited:
Status
Not open for further replies.
Top