ok.. I got the soulfeed in.
it works. it increases the itemvalue 4 on the weapon as it should.
now.. I want to have that affect the total damage output... this is what I have...
I stuck this in fight.c by the damage modifiers but when I soulfeed the weapon, it is not returning any extra damage. Should I stick this into another location in fight.c or is there something wrong with this code?
It compiles fine, no warnings and there is no crashing when fighting... it soulfeeds just fine and the weapon value[4] increases by incriments as it should.
What say you, oh grand masters of the code?
void do_soulfeed( CHAR_DATA* ch, const char* )
{
OBJ_DATA *obj;
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL )
{
send_to_char( "You must be holding the weapon you wish to feed.\r\n", ch );
return;
}
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) != NULL && ( obj->value[4] >= 4 ))
{
send_to_char( "You have fed this weapon as much as you can.\r\n", ch );
return;
}
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) != NULL && ( obj->value[4] <= 3 ))
{
if ( ch->pcdata->souls <= 1999)
{
send_to_char( "You do not have the souls\r\n", ch );
return;
}
else
obj->value[4] += 1;
ch->pcdata->souls -= 2000;
send_to_char( "The souls of the vanquished infuse into this weapon.\r\n", ch );
return;
}
}
it works. it increases the itemvalue 4 on the weapon as it should.
now.. I want to have that affect the total damage output... this is what I have...
//soul fed weapons bonus
OBJ_DATA *obj;
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) == NULL || ( obj->value[4] == 0))
dam = dam;
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) != NULL && ( obj->value[4] == 1))
dam = (dam * 1.5);
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) != NULL && ( obj->value[4] == 2))
dam = (dam * 2);
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) != NULL && ( obj->value[4] == 3))
dam = (dam * 2.5);
if( ( obj = get_eq_char( ch, WEAR_WIELD ) ) != NULL && ( obj->value[4] == 4))
dam = (dam * 3);
I stuck this in fight.c by the damage modifiers but when I soulfeed the weapon, it is not returning any extra damage. Should I stick this into another location in fight.c or is there something wrong with this code?
It compiles fine, no warnings and there is no crashing when fighting... it soulfeeds just fine and the weapon value[4] increases by incriments as it should.
What say you, oh grand masters of the code?