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

Request: Triggers help needed on RPG map :)

Status
Not open for further replies.
Level 4
Joined
Jul 27, 2008
Messages
38
So i'm making RPG map & i need help on few things. I'm used to most of the triggers on WEU & normal map editor, but i can't make anything complicated.

1. Item system that u can equip only 2 weapons at same time or shield or 1 two-handed weapon. 1 necklace, 1 armor, 1 boots and so on, would be nice if there would be like 4-5 item type-classes.
If u had already equipped armor & u would pick up that it would go on backbag or something, not sure yet ( Warcraft III Spells - BagCE2.0+AtrSA1.1+SSA1.5 vC (thanks forweaaddar, gona maybe gona use this & give credit ofc))

2. Dodge system, agility is same as % to dodge. (there might be that kind thing already in the editor (heard from a friend))

3. Damage reduction system, so that boots & armor reduces damage taken like 1 from every attack (ofc stacking with like armor +2 & boots +1 = 3 damage reducted)

4. Shield system, if shield is equipped u will get chance to parry attacks, chance to parry would be like str x 2 for example (i could modify it later on to get it more clever :) )

5. I have always been wondering is there a simple trigger to do something on every attack (if there is not give me way to make it the hard way)

6. How to make "good" chance to drop item, made my self that kind that interger chances every 0.01 sec +1 & when it's 100 it will be set to 0. if it's under 20 monster will drop this item etc. (trigger didn't work well, but it was good idea ;P)

Thanks for reading this & i'm very pleased if u help me. ofc u'll get credit in my map for help :)
 
Level 10
Joined
Jun 21, 2007
Messages
643
for the dodge one you can use a simple trigger

  • Events:
    • A unit is attacked
  • Conditions:
    • int comp - ability - level of ability (dodge) for attacked unit greater than 0
  • Actions:
    • set (intDODGE_rand_temp) = random number between 1 and 100
    • if/then/else
      • Conditions:
        • intDODGE_rand_temp less than or equal to hero - property agility of (attacked unit)
      • then actions:
        • //dodge the hit
        • add dodge fx maybe and unit health = health + event response damage taken
      • else actions:
        • do nuthin
        • //take the hit
something along those lines would do it :) Thats all in GUI so its easier to understand, I can write it up in JASS if you'd prefer.

Regards,
MadCD
 
for the dodge one you can use a simple trigger

  • Events:
  • A unit is attacked
  • Conditions:
  • int comp - ability - level of ability (dodge) for attacked unit greater than 0
  • Actions:
  • set (intDODGE_rand_temp) = random number between 1 and 100
  • if:
  • conditions:
  • intDODGE_rand_temp less than or equal to hero - property agility of (attacked unit)
  • then:
  • //dodge the hit
  • add dodge fx maybe and unit health = health + event response damage taken
  • else:
  • do nuthin
  • //take the hit
something along those lines would do it :) Thats all in GUI so its easier to understand, I can write it up in JASS if you'd prefer.

Regards,
MadCD

You trigger looks rather confusing.
 
Level 10
Joined
Jun 21, 2007
Messages
643
ok...

To start with you got an event to see if the unit is attacked. Then we check to see if the unit has the dodge ability. I'm assuming its an ability. Next up we assign a random number between 1 and 100 this provides our random factor for % chance. We then see if the number is greater than our hero's agility (chance to dodge) if it is we give the hero back the health he lost from the hit. Otherwise we just let him take it.

Make more sense?
 
Level 4
Joined
Jul 27, 2008
Messages
38
Dodge hard to make :/.

Just found out that u can do the chance to dmg reduction also with mountain giant's hardened skin, thanks The_Silent again :).

I'm going to test that agi dodge thingy madcd, seems kinda tricky :p.

I might also make unti skill to dodge, but how to make it so that it the chance to dodge becomes better every level, so that u don't have to use hero skill point and so on...

& i would like that like thing that u have better chance to dodge to lvl 1 monster than lvl 20 monster.

formula:

agi * hero lvl / unit lvl = dodge chance

example:

40% * 5 / 6 = 33,33% chance to dodge

but it might be too complicated, or what u think :)?
 
Last edited:
  • Events
    • Unit - A Unit is Attacked
  • Conditions
    • (Level of [Dodge] for(Attacked Unit)) Greater Than 0
  • Actions
    • Set [Integer] = (Random intinger number between 1 and 100)
    • If (All conditions are true) then do (then action) else do (Else action)
      • If - Conditions
        • ((Attacking Unit) is a Hero) Equal to True
      • Then - Actions:
        • Set [Integer2] = (((Level of [Dodge] for attacked unit)) x 10*) + ((Agillity of (Attacked Unit) (Exclude Bonuses) - ((Agillity of (attacking unit) (Exclude Bonuses) x 2))))
      • Else - Action:
        • Set [Integer2] = (((Level of [Dodge] for attacked unit)) x 10*) + ((Agillity of (Attacked Unit) (Exclude Bonuses) - ((Level of (Attacking Unit)) x 4)
  • If (All conditions are true) then do (then action) else do (Else action)
    • If - Conditions:
      • [Integer] Less than or Equal to [Integer2]
    • Then - Actions:
      • Floating Text - Create Floating text that reads [U]MISS[/U] at (posistion of (Attacked unit) with Z offset 75.00, using font size 10.00, using color (100.00%, 0.00%, 0.00%), and 0.00% transparecy.
      • Dloating Text - Change the Life Spawn of (Last created floating text) to 3.00 seconds.
      • Unit - Set life of (Attacked Unit) to ((Life of (attacked uniy)) + ((Damage taken) x 0.50))
    • Else - Action:
      • Do Nothing
Here is an example, if the hero is against anouther hero, thats agility that does the difference, else it unit level.
 
Level 4
Joined
Jul 27, 2008
Messages
38
Working somehow

I tested u'rs code & coded my little different version of it...

i got some problems on doing it & i'm not sure does it work correctly, i probalby maid mistake on integers, and i didn't find damage taken or damage done from previous attack, so if miss happens, it still it takes dmg. So tell me path of the damage taken if there is one & thank u for u'r help :).

I added my dodge system right here, working somehow ^^.
 

Attachments

  • dodge.w3x
    13.1 KB · Views: 51
Level 4
Joined
Jul 27, 2008
Messages
38
Thanks madcd, still damage taken doesn't work, even if it misses it still takes dmg, i think i know the reason. It's cause trigger happens before the attack, u can stop attacking when miss text is coming & it won't attack so, probalby need to make wait 0.25 (or something like that) command there & if attacking is interrupted do nothing.

i'll think i'm gona make drop chance like this 1-50 different type items that can drop from monster, random 1-1000, if it's 1 make this item on position of dying unit, if it's over 51 nothing happens.
 
Status
Not open for further replies.
Top