• 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.

[Trigger] How to do % Spell depending to stats

Status
Not open for further replies.
Level 6
Joined
Mar 31, 2009
Messages
247
I need a detailed explanation about how to make a spell or skill by boosting of any stats (strength, agility or intelect) or depending of a stat.

Ex:
1- Thunder Clap: Slams the ground, dealing 100 damage + your total strength to nearby enemy land unit.

2- Cut Through: Cuts through target flesh make it bleed for 5 secs and take 75% of your total agility damage for sec.

3- Harm (passive): If the attacked target has less than 20% hit points, hero deals bonus damage equal to his total strength.

4- Berserk: Enter in trance and each attack made additional damage equal to 2+10% of agility on first attack, 4+20% of agility on second attack, 6+30% of agility on third attack, etc (stacks up to 5 times)

5- Force Field: Absorb 10% of total intelligence damage received.

P.S: Note that it are 4 different types of spells (1 AoE, 2 DoT, 4 Stackable, 5 Defensive) all works with a % of an stat and 1 passive skills.
 
Level 11
Joined
Nov 15, 2007
Messages
800
First, simple


  • TClap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set loc = (Position of (Triggering unit))
      • Set group = (Units within 300.00 of loc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is A ground unit) Equal to True))))
      • Unit Group - Pick every unit in group and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing (100.00 + (Real((Strength of (Triggering unit) (Include bonuses))))) damage of attack type Spells and damage type Normal)
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call DestroyGroup(udg_group)
Second requires use of an indexing system or hash table.

Third can be done simply or if you want it more accurate would require a damage detection system.

Fourth requires an indexing system/hash table and a damage detection system for accuracy.

Fifth requires a damage detection system.

The actual stats-boosted-by-accuracy thing is simple in itself though.
 
Level 6
Joined
Mar 31, 2009
Messages
247
Thanks soooo muuuuch for your time and explanations :)
I under stand 100% the first, but the others four hasn't any idea to make it :(
Can you make an example map with does skill/spells in it?

P.S: Have a new question too ...
How can I use only weapon/item damage?
Ex:
Take off base damage from units and heroes. They can only attack or make some damage by using spells or having items (like swords, etc) so can make damage, as in "World of Ancients - Desert Wind"
 
Level 11
Joined
Nov 15, 2007
Messages
800
Disable all attacks (Enabled attacks: None), and then create an ability based on Orb of Venom. Set the "Enabled attack index" field to 1 (and of course change the targets effected by the poison to none). Give all of your weapons this ability. Now your heroes will have no attack unless they have a weapon.

If you don't want their attributes to give bonus damage, you have to change "Damage from primary attribute" to 0 in gameplay constants. If they have 0 base damage and 0 damage gain from attributes, they will only benefit from direct +damage items/abilities.

Search the forums for hash tables, indexing system and damage detection system for the other abilities. You'll need to know how to use those to make your other spells.
 
Level 6
Joined
Mar 31, 2009
Messages
247
Thanks again Meticulous I'll try right now!!! :)
Please give me more tips with the other 4 skills because I don't know about hash table and damage detection. :(
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
I wrote the second spell you requested with a GUI timer attachement system.

Looks like this:

  • Bleed
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Bleed
    • Aktionen
      • -------- Create Timer: --------
      • Set AAT_Counter = 5
      • Set AAT_Timeout = 1.00
      • Set AAT_Trigger = Bleed2 <gen>
      • Custom script: call AAT_prepareTimer()
      • -------- Attach Data: --------
      • Set AAT_store_unit = (Triggering unit)
      • Custom script: call AAT_pushUnit()
      • Set AAT_store_unit = (Target unit of ability being cast)
      • Custom script: call AAT_pushUnit()
      • Set AAT_store_real = (0.75 x (Real((Beweglichkeit of (Triggering unit) (Einschließen bonuses)))))
      • Custom script: call AAT_pushReal()
      • -------- Start Timer: --------
      • Custom script: call AAT_startTimer()
  • Bleed2
    • Ereignisse
    • Bedingungen
    • Aktionen
      • -------- Read Data (reverse order): --------
      • Custom script: call AAT_popReal()
      • Set Bleed_Damage = AAT_store_real
      • Custom script: call AAT_popUnit()
      • Set Bleed_Target = AAT_store_unit
      • Custom script: call AAT_popUnit()
      • Set Bleed_Caster = AAT_store_unit
      • -------- Deal Damage: --------
      • Einheit - Cause Bleed_Caster to damage Bleed_Target, dealing Bleed_Damage damage of attack type Zaubersprüche and damage type Normal
      • -------- Release Timer: --------
      • Custom script: call AAT_deleteTimer()
(My Editor is in german, just open the testmap to view it in your language)
The trigger might look complicated and too long, but the system is a quite nice and efficient way to write mui spells with timers in GUI.

Spell + System is in the attached testmap. (Grunts for testing the bleed spell are in the corners)
 

Attachments

  • AAT_Bleed.w3x
    20.8 KB · Views: 62
Level 6
Joined
Mar 31, 2009
Messages
247
I've tested and it works! thanks (+rep)
Now I'm looking for two things:

1- A Talent Tree System
2- A LeaderBoard who show player's stadistics like dodge %, critical %, damage, etc.
 
Status
Not open for further replies.
Top