You can make a check in OnEquipScript and OnUnequipScript events, where you check if is equiped any kind of card and unequip in proper conditions.
Example:
OnEquipScript: <"
if (card_check >= 2) {
message strcharinfo(PC_NAME), "You can't equip more than 2 of this kind of cards";
unequip(EQI_HAND_R);
}
card_check += 1;
end;
">
OnUnequipScript: <"
card_check -= 1;
end;
">
In that script, when card is equiped will add +1 to card_check variable and -1 when unequiped. If card_check variable is more or equal to 2, it will bring a message and unequip the weapon (in the assmption that card is equiped on a weapon).
You can create groups of cards to have several conditions by creatin a new and different variable for every card group. However, the hard part is to make the proper unequip command to unequip the right gear, mostly because accesoryes can be equiped on two slots and assassins can equip weapons on both hands. To make it easy you can use nude() command so it will unequip everything, but remember to clear all the vars when that happen.