ScryMUD: Example Social

If you want to make your own social, you can edit this one and email the results to an IMM (ask on the MUD for an email address).

Basically, you will want to change the stuff in double quotes, but you may not want to change all of it. Try this social on ScryMUD and see if you can correlate this code with what actually happens on the MUD.

I might can answer some questions for you, but if you are just clueless, well, try your best and email it to me, I'll try to fix it up....

Also, make sure your social you have in mind is not already coded up.


void grin(int i_th, const String* vict, critter& pc, room& rm) {
   String buf(100);
   Cell cll(rm.CRITTERS);
critter* ptr;

if (vict->Strlen()) {
critter* crit_ptr =
have_crit_named(rm.CRITTERS, i_th, vict, pc.SEE_BIT, rm);

if (!crit_ptr)
show("You don't see that person.\n", pc);
else if (pc.POS > POS_SIT)
show("You are not in a position to do that.\n", pc);
else if (crit_ptr == &pc) {
show("You grin at yourself.\n", pc);
Sprintf(buf, "grins at %s.\n", get_hisself_herself(pc));
emote(buf, pc, rm, TRUE);
}//if targ and agg is same
else {
Sprintf(buf, "You grin mischieviously at %S.\n",
name_of_crit(*crit_ptr, pc.SEE_BIT));
show(buf, pc);
Sprintf(buf, "%S grins mischieviously at you!\n",
name_of_crit(pc, crit_ptr->SEE_BIT));
buf.Cap();
show(buf, *crit_ptr);

while ((ptr = cll.next())) {
if ((ptr != &pc) && (ptr != crit_ptr)) {
Sprintf(buf, "%S grins at %S.\n",
name_of_crit(pc, ptr->SEE_BIT),
name_of_crit(*crit_ptr, ptr->SEE_BIT));
buf.Cap();
show(buf, *ptr);
}//if
}//while
}//else
}//if a victim
else {
show("You grin widely!\n", pc);
emote("grins at the thought.", pc, rm, TRUE);
}//else
}//grin


Ben Greear
Last modified: Mon Sep 27 18:45:04 MST 1999