Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2010-12-05 (original capture). Home · Forum · All archived topics · Downloads

Author Topic: Values of Variables  (Read 41 times)

Jhonam

  • Level 7 Expert
  • Posts: 634
Values of Variables
« on: November 27, 2010, 10:03:49 PM »
How can I set the variable value is not in the form of a chance, but as the exact value: for example - on the first level of skill damage of 10% at the second level - damage to 30% on the third level - damage of 50%.
Or respawn - at the first level - 1 times in the second level - 2 times and so on.
Is it possible to do so?
« Last Edit: November 27, 2010, 10:06:15 PM by Jhonam »


Muse

  • Russian
  • Watchdog
  • Level 7 Expert
  • Posts: 597
  • The lord of drunken bears, 102 lvl.
Re: Values of Variables
« Reply #1 on: November 28, 2010, 06:12:33 AM »
Code: [Select]
preload = "es_xset wcs_rand 0;es_xmath wcs_rand float"

1st understanding
setting1 = "es_xrand wcs_rand 1 10|es_xrand wcs_rand 1 30|es_xrand wcs_rand 1 50"

cmd1 = "es_xmath wcs_rand / 100;es_math wcs_rand * event_var(dmg_health)"

or

cmd1 = "if (wcs_chance <= wcs_rand) then ..."

2nd understanding

setting1 = "es_xset wcs_rand 10|es_xset wcs_rand 30|es_xset wcs_rand 50"

cmd1 = "es_xmath wcs_rand / 100;es_math wcs_rand * event_var(dmg_health)"

or

cmd1 = "if (wcs_chance <= wcs_rand) then ..."