Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: need help with Animate Dead spell...



Hwei Sheng TEOH wrote:
> 
> I'm still experimenting with the Animate Dead spell I mentioned some time
> ago... I need some help in actually coding it, though.
> 
> 1) I still can't decide whether to make the resultant monster (usually a
>    zombie) a pet or a golem. Any suggestions?

    If you make it a pet, like Command Undead does, it will basically follow
you around, but you won't have direct control.  Golems must be precisely
controlled, but you can only have one, and only as long as you concentrate
on it.  I'd go with a pet in this case.


>    Also, the code is rather messy at this point because the golem code and the
>    pet-summoning code just doesn't do quite what I need. I suppose I'll have
>    to live with this until 0.96.* comes along. Or did I miss something that
>    I could use?

    Well, if you hold off for a bit, you can take a look at my
animate_weapon code and see if that's any closer to what you need.  I
haven't seen any objections to it yet, so I think it's got a consensus, and
I've tested it pretty thoroughly.  I'll work it into the CVS tree so you can
check it out.


> 2) I made the spell requires the use of special "zombie potions" that work
>    as some sort of sacrifice, the same way the weapon improvement scrolls
>    work. I did this partly because this is bound to one of my quests, and it
>    fits with the story. It's also because I thought it would be interesting
>    to use the potions to create undead of varying power:
>    - there is a minimum number of potions required for a particular body part
>      to be animated, which is chosen carefully considering what kind of
>      monster would result.
>    - adding more potions than the minimum will cause the resultant monster
>      to be stronger, but also more likely to rebel (ie. created uncharmed).
>      This is to add a risk factor into the spell, just to make things a little
>      more interesting.
>    The difficulty I'm facing is how exactly to calculate whether the monster
>    would rebel -- this should be based on both the magic level of the caster
>    as well as the number of zombie potions used. Any suggestions how the
>    probability of rebelling should be calculated?

    I recently had the same problem coming up with a way to make the
"mental" attacks I'm experimenting with require a contest between the caster
and the victim, based on their relative levels and certain bonuses.  Here's
the formula I cameup with, maybe some variation of it will work for you:

  attack = (SK_level(attacker) + path_level_mod(attacker, spellnum))
    * (attacker->stats.Int*attacker->stats.Int) / 100;
  defense = SK_level(defender) * (defender->stats.Int*defender->stats.Int) /
100
    *((defender->protected & attacktype)? 2 : 1)
    /((defender->vulnerable & attacktype)? 2 : 1)
    *(QUERY_FLAG(defender,FLAG_UNDEAD)? 4 : 1);

    In your case, you'd probably want "defense" to be some factor of the
number of potions beyond the required minimum.  And the bonuses would have
to be less extreme.  Maybe something like this:
  attack = SK_level(attacker) + path_level_mod(attacker, spellnum)
    + turn_bonus(attacker->stats.Wis);
  defense = creature_arch->clone.level + (potions - minimum)*(potions -
minimum);

  result = RANDOM()%(attack>defense?attack:defense) - 
    (defense - (attack<defense?attack:defense)/2);

    If result is positive, it's a success, if negative, failure.  And yes, I
know the example formula is a bit extreme, but so are the results.  Negative
results are likely to turn your attack back on you.  That's why there's an
undead factor in defense, even though undead are already immune.

-- 
            -Dave Noelle,                 
            -the Villa Straylight,  http://www.straylight.org
Coalition Against Unsolicited Commercial Email  ==  http://www.cauce.com

Disclaimer: Disciples of E(vi)L may receive guidance in alt.religion.emacs.
GNU Emacs is The One True Editor.  The $PATH to redemption is /util/gnu/bin.
U.C.L.A. doesn't share my opinions; even Emacs can't make life that good.

Quote of the Day:
"The fastest way to accelerate a Macintosh is 9.8 m/s^2"
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to ]