• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Dark Conversion, how to target Commoner?

Status
Not open for further replies.
Level 13
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