Sure. I just had the use script check if the player has a specific card equipped when you use the item. So, if you use a fire elemental resistance potion, I have it check if the player has a pasana card in their armor when they use it. Looks like this:
12118,Resist_Fire,Fireproof Potion,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(getequipcardid(EQI_ARMOR,0) == 4099) { sc_start4 SC_ELEMENTALCHANGE,180000,2,Ele_Fire,1,0; } else { sc_start4 SC_ELEMENTALCHANGE,180000,1,Ele_Fire,1,0; } },{},{}
12119,Resist_Water,Coldproof Potion,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(getequipcardid(EQI_ARMOR,0) == 4089) { sc_start4 SC_ELEMENTALCHANGE,180000,2,Ele_Water,1,0; } else { sc_start4 SC_ELEMENTALCHANGE,180000,1,Ele_Water,1,0; } },{},{}
12120,Resist_Earth,Earthproof Potion,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(getequipcardid(EQI_ARMOR,0) == 4101) { sc_start4 SC_ELEMENTALCHANGE,180000,2,Ele_Earth,1,0; } else { sc_start4 SC_ELEMENTALCHANGE,180000,1,Ele_Earth,1,0; } },{},{}
12121,Resist_Wind,Thunderproof Potion,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if(getequipcardid(EQI_ARMOR,0) == 4098) { sc_start4 SC_ELEMENTALCHANGE,180000,2,Ele_Wind,1,0; } else { sc_start4 SC_ELEMENTALCHANGE,180000,1,Ele_Wind,1,0; } },{},{}
For those thinking it might be exploitable for people to wear a fire armor, use a potion and then armor switch to get the benefit without the drawback of losing the armor card, I have added in pc.c:
status_change_end(&sd->bl, SC_ELEMENTALCHANGE, INVALID_TIMER);
under:
if (sd->status.inventory[n].equip & EQP_ARMOR) {