/************************************************************** * Award Snippet v2... * * This one has everything from experience to questpoints... * * unlike my previous one... If your interested in if this * * works or not, I can prove it to you if you log onto * * teno.d2g.com:5000... If you have any problems, or you * * just want to critisize my work... you can contact me by * * Email : mikky999@attbi.com * * AIM : Mikado Rose 999 * * ICQ : 72807381 * * MUD : teno.d2g.com:5000 * *************************************************************/ /******************************************************* * * * This should be easy enough to add, but, as I said, * * if you have any problems, I will be more than happy * * to help you, contact me with the above information * * * ******************************************************* * * * I reworked it, so you don't have to add half as * * much as you did in the old snippet... but, you can * * still do it the tedious way if you want. Also, for * * the less experienced coders... I have added the * * interp.c/h information needed at the bottom... but * * if you know how already, do it now. * * * ******************************************************* * * * And yes, this does use Lopes color code... and * * Vassago's Quest Code... so, if you dont have either * * take out the color calls, or comment out the qps * * stuff... otherwise... It SHOULD be easy to add... * * * ******************************************************/ // In act_wiz.c, add this at the bottom. void do_award(CHAR_DATA *ch, char *argument) { CHAR_DATA *victim; char buf [MAX_STRING_LENGTH]; char arg1 [MAX_STRING_LENGTH]; char arg2 [MAX_STRING_LENGTH]; char arg3 [MAX_STRING_LENGTH]; int value; argument = one_argument(argument, arg1); argument = one_argument(argument, arg2); argument = one_argument(argument, arg3); if ( arg1[0] == '\0' || arg2[0] == '\0' || arg3[0] == '\0' || !is_number( arg3 ) ) { send_to_char( "{GS{gynta{Gx{y: {Yaward {y<{Ychar{y> <{Ytype{y> <{Yvalue{y>.{x\n\r", ch); send_to_char( "{GT{gype{Gs a{gr{Ge{y: {Wplatinum{w, {Wexperience{w,{x\n\r",ch); send_to_char( " {Wpractice{w,{W train{w, {Wqps{w, {Wiqps{x\n\r",ch); send_to_char( "{wFor more information, type {W'{DHELP AWARD{W'{w.{x\n\r",ch); return; } if (( victim = get_char_world ( ch, arg1 ) ) == NULL ) { send_to_char( "{RCannot find {rtarget {Rplayer{R.{x\n\r", ch); return; } if ( IS_NPC( victim ) ) { send_to_char( "{RNot on {rNPC's{R!{x\n\r", ch); return; } if ( ch == victim ) { send_to_char( "{RSorry, no awarding {ryourself{R!{x", ch ); return; } if (IS_IMMORTAL(victim) || victim->level >= LEVEL_IMMORTAL) { send_to_char( "{RImmortals cannot be {rawarded{R!{x\n\r", ch ); return; } if (is_name(arg2, "platinum")) { value = atoi( arg3 ); if (value < -1000 || value > 1000 ) { send_to_char( "{wAcceptable values are between {D-1000 {wand {W1000{w.{x\n\r", ch ); return; } if (value == 0 ) { send_to_char( "{WThat is fairly trivial, isn't it?{x\n\r", ch ); return; } victim->platinum += value; sprintf( buf,"{cYou have awarded {B%s{C %d {cplatinum.{x\n\r", victim->name, value ); send_to_char(buf, ch); if ( value > 0 ) { sprintf( buf,"{CYou have been awarded {c%d {Cplatinum!!{x\n\r", value ); send_to_char( buf, victim ); } else { sprintf( buf,"{cYou have been penalized {C%d {cplatinum!!{x.\n\r", value ); send_to_char( buf, victim ); return; } } else if (is_name(arg2, "experience") ) { value = atoi( arg3 ); if (value < -10000 || value > 10000 ) { send_to_char( "{wAcceptable values are between {D-5000 {wand {W5000{w.{x\n\r", ch ); return; } if (value == 0 ) { send_to_char( "{WThat is fairly trivial, isn't it?{x\n\r", ch ); return; } gain_exp(victim, value); sprintf( buf,"{cYou have awarded {B%s {C%d{c experience points.{x\n\r", victim->name, value); send_to_char(buf, ch); if ( value > 0 ) { sprintf( buf,"{CYou have been awarded {c%d {Cexperience points.{x\n\r", value ); send_to_char( buf, victim ); } else { sprintf( buf,"{cYou have been penalized {C%d {cexperience points.{x\n\r", value ); send_to_char( buf, victim ); return; } } else if (is_name(arg2, "qps" ) ) { value = atoi( arg3 ); if (value < -5000 || value > 5000 ) { send_to_char( "{wAcceptable values are between {D-5000 {wand {W5000{w.{x\n\r", ch ); return; } if (value == 0 ) { send_to_char( "{WThat is fairly trivial, isn't it?{x\n\r", ch ); return; } victim->questpoints += value; sprintf( buf,"{cYou have awarded {B%s {C%d {cquest points.{x\n\r", victim->name, value); send_to_char(buf, ch); if ( value > 0 ) { sprintf( buf,"{CYou have been awarded{c %d {Cquest points.{x\n\r", value ); send_to_char( buf, victim ); } else { sprintf( buf,"{cYou have been penalized {C%d{c quest points!{x\n\r", value ); send_to_char( buf, victim ); return; } } else if (is_name(arg2, "iqps" ) ) { value = atoi( arg3 ); if (value < -5 || value > 5 ) { send_to_char( "{wAcceptable values are between {D-5 {wand {W5{w.{x\n\r", ch ); return; } if (value == 0 ) { send_to_char( "{WThat is fairly trivial, isn't it?{x\n\r", ch ); return; } victim->qps += value; sprintf( buf,"{cYou have awarded {B%s {C%d {cImm quest points.{x\n\r", victim->name, value); send_to_char(buf, ch); if ( value > 0 ) { sprintf( buf,"{CYou have been awarded{c %d {CImm quest points.{x\n\r", value ); send_to_char( buf, victim ); } else { sprintf( buf,"{cYou have been penalized {C%d{c Imm quest points!{x\n\r", value ); send_to_char( buf, victim ); return; } } else if (is_name(arg2, "prac practice" ) ) { value = atoi( arg3 ); if (value < -20 || value > 20 ) { send_to_char( "{wAcceptable values are between {D-50 {wand {W50{w.{x\n\r", ch ); return; } if (value == 0 ) { send_to_char( "{WThat is fairly trivial, isn't it?{x\n\r", ch ); return; } victim->practice += value; sprintf( buf,"{cYou have awarded {B%s {C%d {cpractices.{x\n\r", victim->name, value); send_to_char(buf, ch); if (value == 0 ) { send_to_char( "{WThat is fairly trivial, isn't it?{x\n\r", ch ); return; } victim->practice += value; sprintf( buf,"{cYou have awarded {B%s {C%d {cpractices.{x\n\r", victim->name, value); send_to_char(buf, ch); if ( value > 0 ) { sprintf( buf,"{CYou have been awarded {c%d {Cpractices.{x\n\r", value ); send_to_char( buf, victim ); } else { sprintf( buf,"{RYou have been penalized %d prac(s).{x\n\r", value ); send_to_char( buf, victim ); return; } } else if (is_name(arg2, "train" ) ) { value = atoi( arg3 ); if (value < -20 || value > 20 ) { send_to_char( "{wAcceptable values are between {D-5000 {wand {W5000{w.{x\n\r", ch ); return; } if (value == 0 ) { send_to_char( "{WThats fairly trivial, isn't it?{x\n\r", ch ); return; } victim->train += value; sprintf( buf,"{cYou have awarded{B %s {C%d {ctrains.{x\n\r", victim->name, value); send_to_char(buf, ch); if ( value > 0 ) { sprintf( buf,"{CYou have been awarded {c%d {Ctrains.{x\n\r", value ); send_to_char( buf, victim ); } else { sprintf( buf,"{cYou have been penalized{C %d {ctrains.{x\n\r", value ); send_to_char( buf, victim ); return; } } return; } // In interp.c, under the immortal commands, add : { "award", do_award, POS_DEAD, L6, 1, LOG_ALWAYS, 0 }, // In interp.h, under autostore, add this: DECLARE_DO_FUN( do_award ); //That should be it... If there is anything I missed... check the next release!