I thought I had posted it... finally got it going the right way.
Code:
/* Add flare damage effects */
int get_flare_affect(struct obj_data *wielded) {
if (!wielded) return 0;
if (wielded && IS_SET_AR(GET_OBJ_AFFECT(wielded), AFF_FIREFLARE)) return AFF_FIREFLARE;
if (wielded && IS_SET_AR(GET_OBJ_AFFECT(wielded), AFF_COLDFLARE)) return AFF_COLDFLARE;
if (wielded && IS_SET_AR(GET_OBJ_AFFECT(wielded), AFF_SHOCKFLARE)) return AFF_SHOCKFLARE;
return 0;
}
int flare = get_flare_affect(wielded);
switch (flare) {
case AFF_FIREFLARE:
if (rand_number(1, 101) <= GET_LEVEL(ch) + 25) {
int dam_mod = rand_number(10, 25);
dam += dam_mod;
send_to_char(ch, "\trYour weapon flares with \tRsearing fire\tr doing %d extra damage!\tn\r\n", dam_mod);
}
break;
case AFF_COLDFLARE:
if (rand_number(1, 101) <= GET_LEVEL(ch) + 25) {
int dam_mod = rand_number(10, 25);
dam += dam_mod;
send_to_char(ch, "\tbYour weapon flares with \tBBone Chilling Cold\tb doing %d extra damage!\tn\r\n", dam_mod);
}
break;
case AFF_SHOCKFLARE:
if (rand_number(1, 101) <= GET_LEVEL(ch) + 25) {
int dam_mod = rand_number(10, 25);
dam += dam_mod;
send_to_char(ch, "\tbYour weapon flares with a \tCSearing Lightning Strike\tc doing %d extra damage!\tn\r\n",
dam_mod);
}
break;
default:
break; /* No flare */
}
/* Bane Effects Bramage */
int get_bane_affect(struct obj_data *wielded, struct char_data *victim) {
if (!wielded) return 0;
if (wielded && IS_SET_AR(GET_OBJ_AFFECT(wielded), AFF_UNDEAD_BANE) && strcmp(npc_races[(int)GET_CLASS(victim)], "Undead") == 0) return AFF_UNDEAD_BANE;
if (wielded && IS_SET_AR(GET_OBJ_AFFECT(wielded), AFF_DEMON_BANE) && strcmp(npc_races[(int)GET_CLASS(victim)], "Demon") == 0) return AFF_UNDEAD_BANE;
if (wielded && IS_SET_AR(GET_OBJ_AFFECT(wielded), AFF_DRAGON_BANE) && strcmp(npc_races[(int)GET_CLASS(victim)], "Dragon") == 0) return AFF_UNDEAD_BANE;
return 0;
}
int bane = get_bane_affect(wielded, victim);
switch (bane) {
case AFF_UNDEAD_BANE:
if (rand_number(1, 101) <= GET_LEVEL(ch) + 25) {
dam *= 2;
send_to_char(ch, "\tbYour Undead Bane Weapon does %d damage!\tn\r\n", dam);
}
break;
case AFF_DEMON_BANE:
if (rand_number(1, 101) <= GET_LEVEL(ch) + 25) {
dam *= 3;
send_to_char(ch, "\tbYour Demon Bane Weapon does %d damage!\tn\r\n", dam);
}
break;
case AFF_DRAGON_BANE:
if (rand_number(1, 101) <= GET_LEVEL(ch) + 25) {
dam *= 3;
send_to_char(ch, "\tbYour Dragon Bane Weapon does %d damage!\tn\r\n", dam);
}
break;
default:
break; /* No Bane */
}
This is working. I mainly had to just make the switch/case for both as they didn't have the same calls.
Big problem was making sure that it called the object affect not the affect on the player.
Putting the check on the player caused it to not flare right in a dual wield situation so this takes care of dual wield. The code is pretty much exactly the same for Dual Wield function but it has dwielded instead of wielded to make sure of the check looking at the dual wielded weapon.
It aint perfect, I aint no real coder but I try.