Actually using Charisma

From: George Greer (greerga@circlemud.org)
Date: 10/15/01


I've been trying to make charisma do things beyond limit the number of
charmed followers you can have.  I have a formula that seems somewhat fair:

        sell_price = item_value * shop_adjust * (1 - (get_cha - 10) / 81)
        buy_price  = item_value * shop_adjust * (1 + (get_cha - 10) / 81)

Giving for various charisma values:

 3: .91358025
 4: .92592593
 5: .93827161
 6: .95061729
 7: .96296297
 8: .97530865
 9: .98765433
10: 1.00000000
11: 1.01234567
12: 1.02469135
13: 1.03703703
14: 1.04938271
15: 1.06172839
16: 1.07407407
17: 1.08641975
18: 1.09876543

~10% at the most either way, for both buying and selling.  Think it's too
much or too little?  Perhaps I should factor in the charisma of the
shopkeeper too...hmmm.

Other changes:

* Duration of charm spell changed from '24 * 18 / GET_INT(vict)' to
  '24 * 2 * GET_CHA(ch) / GET_INT(vict)'.  That should make it longer for
  CHA >= 10, and shorter for CHA <= 8.

* Charisma acting as a "leash" for charmed mobiles with memory.  I'm
  thinking of turning off the "charmed mobiles aren't aggressive" code
  and making it a function of the master's charisma as well.  That would
  imply that anybody charming a hostile mobile that failed to control it
  would be marked a player killer. ;)

Changes follow: (http://www.circlemud.org/~greerga/MOBrebellion.patch)

NOTE: Only parts relevant to Charisma changes shown.  See URL above for
full changes. It will deliberately not compile, see the "FIXME" below.
Nothing major, but look, don't touch.

Index: mobact.c
===================================================================
RCS file: /home/circledb/.cvs/circle/src/mobact.c,v
retrieving revision 1.16
diff -u -p -r1.16 mobact.c
--- mobact.c    2001/10/02 00:20:02     1.16
+++ mobact.c    2001/10/15 03:44:53
@@ -114,13 +114,45 @@ void mobile_activity(void)
       for (vict = world[IN_ROOM(ch)].people; vict && !found; vict = vict->next_in_room) {
        if (IS_NPC(vict) || !CAN_SEE(ch, vict) || PRF_FLAGGED(vict, PRF_NOHASSLE))
          continue;
-       for (names = MEMORY(ch); names && !found; names = names->next)
-         if (names->id == GET_IDNUM(vict)) {
-           found = TRUE;
-           act("'Hey!  You're the fiend that attacked me!!!', exclaims $n.",
-               FALSE, ch, 0, 0, TO_ROOM);
-           hit(ch, vict, TYPE_UNDEFINED);
-         }
+       for (names = MEMORY(ch); names && !found; names = names->next) {
+         if (names->id != GET_IDNUM(vict))
+            continue;
+
+          /* Sit. Down boy! HEEEEeeeel! */
+          if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master)
+FIXME: Add GET_INT(vict) modifier.
+            if (number(1, 20) <= GET_CHA(ch->master))
+              continue;
+
+
+          found = TRUE;
+          act("'Hey!  You're the fiend that attacked me!!!', exclaims $n.", FALSE, ch, 0, 0, TO_ROOM);
+          hit(ch, vict, TYPE_UNDEFINED);
+        }
+      }
+    }
+
+    /*
+     * Charmed Mob Rebellion
+     *
+     * In order to rebel, there need to be more charmed monsters
+     * than the person can feasibly control at a time.  Then the
+     * mobiles have a chance based on the charisma of their leader.
+     *
+     * 1-4 = 0, 5-7 = 1, 8-10 = 2, 11-13 = 3, 14-16 = 4, 17-19 = 5, etc.
+     */
+    if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && num_followers_charmed(ch->master) > (GET_CHA(ch->master) - 2) / 3) {
+      int thediesay = number(1, 20);
+
+      if (thediesay == 20 || thediesay > GET_CHA(ch->master)) {
+        struct char_data *vict;
+
+        /* We're rejecting their control; let's get revenge. */
+        if ((vict = get_char_room_vis(ch, GET_NAME(ch->master), NULL)) != NULL) {
+          stop_follower(ch);
+          if (!PRF_FLAGGED(ch->master, PRF_NOHASSLE))
+            hit(ch, vict, TYPE_UNDEFINED);
+        }
       }
     }

Index: spells.c
===================================================================
RCS file: /home/circledb/.cvs/circle/src/spells.c,v
retrieving revision 1.22
diff -u -p -r1.22 spells.c
--- spells.c    2001/10/02 00:20:02     1.22
+++ spells.c    2001/10/15 03:10:52
@@ -238,12 +238,9 @@ ASPELL(spell_charm)
     add_follower(victim, ch);

     af.type = SPELL_CHARM;
-
+    af.duration = 24 * 2 * GET_CHA(ch);
     if (GET_INT(victim))
-      af.duration = 24 * 18 / GET_INT(victim);
-    else
-      af.duration = 24 * 18;
-
+      af.duration /= GET_INT(victim);
     af.modifier = 0;
     af.location = 0;
     af.bitvector = AFF_CHARM;

I do need to add an "if (GET_CHA(ch))" check to the above though.

Hmm... I should just use CAN_SEE() instead of get_char_room_vis() since
'ch->master' is already a pointer to the character....

Maybe restrict the "revenge" to only aggressive mobiles?

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST