• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Convert AttackType/DamageType/WeaponType to integer

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,658
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.)
 
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.
Back
Top