Can a sword have different variants? For example, variant 2 for a red sword graphic?
game:set_ability("sword", 2)
Yes, you can do that. Make another sword and call it "sword2" and change the graphics to red swords. The sword will be at level 2. That means it will inflict more damage.
sword2 counts as the second variant in game:set_ability("sword", 2)
You will need to create other names with a "2" after it. Follow the error messages. It will mentions names like "sword_stars2."
(http://forum.solarus-games.org/index.php?action=dlattach;topic=929.0;attach=496)
Your second option would be to just change the sprite. Make a new animation called, "red_sword."
http://www.solarus-games.org/doc/latest/lua_api_hero.html#lua_api_hero_set_sword_sprite_id
hero:set_sword_sprite_id("red_sword")
Thanks again Zefk! The sword variant change is working.