1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

AI Script for Cleric and Druid

Discussion in 'Icewind Dale (Classic)' started by Tsumari, Jul 1, 2001.

  1. Tsumari Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Jul 1, 2001
    Messages:
    7
    Likes Received:
    0
    This cleric script can do the following:

    Assist allies who are injured by using hold person on the attacker (checks to make sure it works first)

    Checks to heal allies based on their current HP. Each heal spell has a different threshold, so if my party member needs a little heal, he gets a little heal. As damage increases, the cleric resorts to stronger spells.

    As with the mage script, you will need the compiler to use this.

    I use this script for my druid and Cleric, it works handily.

    Note: The web board does not support tab, so my script will appear deformed. I have no idea if it will work when copied and pasted directly from this message. To work around that problem, click the edit icon on my message and copy it directly from the text box, which supports the tabs.

    SCRIPT:

    IF
    HPPercentLT(MostDamagedOf(GroupOf(Myself)),80)
    General(NearestEnemyOf(MostDamagedOf(GroupOf(Myself))),HUMANOID)
    HPGT(NearestEnemyOf(MostDamagedOf(GroupOf(Myself))),30)
    HaveSpell(CLERIC_HOLD_PERSON)
    THEN
    RESPONSE #100
    Spell(NearestEnemyOf(MostDamagedOf(GroupOf(Myself))),CLERIC_HOLD_PERSON)
    END

    IF
    HPPercentLT(MostDamagedOf(GroupOf(Myself)),80)
    HaveSpell(CLERIC_HEAL)
    THEN
    RESPONSE #100
    Spell(MostDamagedOf(GroupOf(Myself)),CLERIC_HEAL)
    END

    IF
    HPPercentLT(MostDamagedOf(GroupOf(Myself)),70)
    HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS)
    THEN
    RESPONSE #100
    Spell(MostDamagedOf(GroupOf(Myself)),CLERIC_CURE_CRITICAL_WOUNDS)
    END

    IF
    HPPercentLT(MostDamagedOf(GroupOf(Myself)),60)
    HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS)
    THEN
    RESPONSE #100
    Spell(MostDamagedOf(GroupOf(Myself)),CLERIC_CURE_SERIOUS_WOUNDS)
    END

    IF
    HPPercentLT(MostDamagedOf(GroupOf(Myself)),70)
    HaveSpell(CLERIC_CURE_MODERATE_WOUNDS)
    THEN
    RESPONSE #100
    Spell(MostDamagedOf(GroupOf(Myself)),CLERIC_CURE_MODERATE_WOUNDS)
    END

    IF
    HPPercentLT(MostDamagedOf(GroupOf(Myself)),80)
    HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
    THEN
    RESPONSE #100
    Spell(MostDamagedOf(GroupOf(Myself)),CLERIC_CURE_LIGHT_WOUNDS)
    END

    IF
    HPPercentLT(MostDamagedOf(GroupOf(Myself)),60)
    HaveSpell(CLERIC_AID)
    THEN
    RESPONSE #100
    Spell(MostDamagedOf(GroupOf(Myself)),CLERIC_AID)
    END

    IF
    General(NearestEnemyOf(Myself),Humanoid)
    Havespell(CLERIC_CHARM_PERSON_OR_MAMMAL)
    HPGT(NearestEnemyOf(Myself),40)
    THEN
    RESPONSE #100
    Spell(NearestEnemyOf(Myself),CLERIC_CHARM_PERSON_OR_MAMMAL)
    END

    IF
    See(NearestEnemyOf(Myself))
    !Range(NearestEnemyOf(Myself),4)
    THEN
    RESPONSE #100
    EquipRanged()
    AttackReevaluate(NearestEnemyOf(Myself),30)
    END

    IF
    See(NearestEnemyOf(Myself))
    Range(NearestEnemyOf(Myself),4)
    THEN
    RESPONSE #100
    EquipMostDamagingMelee()
    AttackReevaluate(NearestEnemyOf(Myself),30)
    END


    ---End Script

    I also have some questions about scripting methods. Specifically, regarding object type variables.

    Regard the following script:

    IF
    !State([ALLY],STATE_DISEASED)
    HaveSpell(CLERIC_CURE_DISEASE)
    THEN
    RESPONSE #100
    Spell([ALLY],CLERIC_CURE_DISEASE)
    END

    Does this actually heal the ally that has State_Disease set to true, or does it randomly pick another ally? The alternative script would involve using Player1, player2, etc as object types and takes up much more space/cpu power, I presume. While I wait on a response or two I'll experiment and playtest.

    Tsumari

    [This message has been edited by Tsumari (edited July 01, 2001).]
     
  2. DrowKiller Gems: 1/31
    Latest gem: Turquoise


    Joined:
    May 25, 2009
    Messages:
    10
    Likes Received:
    0
    I'm about to try compiling and using this script now. Many thanks for posting it.

    I actually can't believe that this thread doesn't have any replies. I'm finding that my Cleric Scripts (Defensive in particular) doesn't seem to work, and I've been trying very hard to learn to compile my own to no avail.
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.