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

Convert AttackType/DamageType/WeaponType to integer

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hi all.

There are these functions:
JASS:
ConvertAttackType()
ConvertDamageType()
ConvertWeaponType()

Which all return an integer that represents the attack/damage/weapon -type but how the hell do I reverse that same function?

How do I recieve the Integer from the type?

(Sorry if this is supposed to be in the Trigger section.)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
First of all... if you look at how many damage types there are... I am too lazy to do that :D

But next to that. It would be something like this if I am not mistaken:
JASS:
function ConvertAttackTypeReverse takes attacktype at returns integer
    if at == ATTACK_TYPE_NORMAL then
        return integer1
    elseif at == ATTACK_TYPE_MELEE then
        return integer2
    elseif at == ATTACK_TYPE_PIERCE then
        return integer3
    elseif at == ATTACK_TYPE_SIEGE then
        return integer4
    elseif at == ATTACK_TYPE_MAGIC then
        return integer5
    elseif at == ATTACK_TYPE_CHAOS then
        return integer6
    elseif at == ATTACK_TYPE_HERO then
        return integer7
    endif
endfunction

The problem is, how do I know what the integers are?
 
Status
Not open for further replies.
Top