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

[JASS] Dark Conversion, how to target Commoner?

Status
Not open for further replies.
Level 14
Joined
Jul 26, 2008
Messages
1,009
So I'm duplicating the Dark Conversion effect. What I want to do is simply kill the unit and create a new unit in it's place. However, the spell should work like Dark Conversion and only target Commoner.

The only problem is, how do I check to make sure the unit is a commoner? There is no UNIT_TYPE_COMMONER, and common.j doesn't list a commoner classification. I suppose I could always do an If IsUnit() against rawcodes, but if I was to do Orc it would be ungodly long.

What are some viable solutions? Sure I could use a dummy spell with Dark Conversion, but I'd like to avoid filling up the object editor.
 
Level 11
Joined
Feb 14, 2009
Messages
884
Actually, the solution is a loooot simpler than that. All you have to do is to change the units' race to "Creep" (or neutral passive, maybe). "Commoner" is another name for the creep race.
 
Level 11
Joined
Feb 14, 2009
Messages
884
I don't have JASScraft installed, so I'm not really sure, but I believe there is a race check function.
 
Status
Not open for further replies.
Top