Vital Jam fix
Posted: Sun Jun 01, 2008 7:31 pm
Small (and temporary?) fix for stamina stuff:
in extrafunctions.cpp, find:
and replace it with
Simple solution, guess there is a better one but it works anyway.
in extrafunctions.cpp, find:
- case 312://Food
- {
- useitem->usescript = 1;
- useitem->usetype = UseList.Index[useitem->itemnum]->useeffect[0];
- useitem->usevalue = UseList.Index[useitem->itemnum]->useeffect[1];
- }
and replace it with
- case 312://Food
- {
- if( useitem->itemnum>55 && useitem->itemnum<61)//If it is Vital Jam
- {
- int restore = 0;
- if( useitem->itemnum==56 )//Vital Jam +1
- {
- restore = 100;
- }
- else
- if( useitem->itemnum==57 )//Vital Jam +2
- {
- restore = 200;
- }
- else
- if( useitem->itemnum==58 )//Vital Jam +5
- {
- restore = 500;
- }
- else
- if( useitem->itemnum==59 )//Vital Jam +10
- {
- restore = 1000;
- }
- else
- if( useitem->itemnum==60 )//Vital Jam +20
- {
- restore = 2000;
- }
- if((thisclient->CharInfo->stamina) + restore >= 5000)//In case the maximum stamina gets exceeded
- {
- thisclient->CharInfo->stamina = 5000;
- }
- else
- {
- thisclient->CharInfo->stamina += restore;//And restore!
- }
- }
- useitem->usescript = 1;
- useitem->usetype = UseList.Index[useitem->itemnum]->useeffect[0];
- useitem->usevalue = UseList.Index[useitem->itemnum]->useeffect[1];
- }
Simple solution, guess there is a better one but it works anyway.