ID:179490
 
mob/Warrior/verb
FlameSword()
if(usr.EleSword == "FlameSword")
view(6) << "The flames of [usr]'s sword die down."
usr.overlays -= 'FlameSword.dmi'
usr.overlays += 'Sword.dmi'
usr.EleSword = "Sword"
usr.EleSword2 = 0
if(usr.EleSword2 == 1)
view(6) << "The flames of [usr]'s sword die down."
usr.overlays -= 'FlameSword.dmi'
usr.overlays += 'Sword.dmi'
usr.EleSword = "Sword"
usr.EleSword2 = 0
else
view(6) << "[usr]'s sword ignites in flames!"
usr.overlays -= 'Sword.dmi'
usr.overlays += 'FlameSword.dmi'
usr.EleSword = "FlameSword"
usr.EleSword2 = 1

Thats my code, I can't get it to work right, I'm trying to get it so if you use the skill it ignites your current sword, but it also dies down if your EleSword stat is the certain one as well as if your EleSword2 stat is 1 which is my occupied number.
The trouble is that you have two if groups here. The else only goes with the second if, so when the first if block sets EleSword2 = 0, then the "if(usr.EleSword2 == 1)" is checked. EleSword2 = 0 at this point, so it goes to the else block and re-ignites the sword immediately after the first if block extinguished it.

Since the first and second if blocks do the same thing with different triggers, I'd just combine the if statements into one with the || operator. || means or. If usr.EleSword == "FlameSword" or usr.EleSword2 == 1 then we want to clear the effect. In DM code, that is written

if((usr.EleSword == "FlameSword") || (usr.EleSword2 == 1))

Why even bother with the EleSword2 var, if it's redundant data?