home *** CD-ROM | disk | FTP | other *** search
- // * Date Created: Mar 21, 2000.
- // * Brent Knowles
- // *Ranger Script: combines hiding and ranged attack abilities
- // * A ranged weapon script. Attempts to stay out of melee ranged with opponents,
- // * Although will switch to melee weapons if needed.
-
-
- // *move away and hide
- IF
- HPPercentLT(Myself,50)
- See(NearestEnemyOf(Myself))
- !StateCheck(Myself,STATE_INVISIBLE)
- THEN
- RESPONSE #100
- RunAwayFrom(NearestEnemyOf(Myself),75)
- Hide()
- END
-
- IF
- Delay(30)
- !StateCheck(Myself,STATE_INVISIBLE)
- THEN
- RESPONSE #100
- Hide()
- END
-
- //*Defense*
- IF
- ActionListEmpty()
- See(NearestEnemyOf(Myself))
- HaveSpell(CLERIC_ARMOR_OF_FAITH)
- CheckStatGT(Myself,3,ARMORCLASS)
- HPGT(LastSeenBy(Myself),20)
- THEN
- RESPONSE #100
- Spell(Myself,CLERIC_ARMOR_OF_FAITH)
- END
-
- IF
- ActionListEmpty()
- See(NearestEnemyOf(Myself))
- HaveSpell(CLERIC_BLESS)
- HPGT(LastSeenBy(Myself),20)
- !StateCheck(LastSeenBy(Myself),STATE_BLESS)
- THEN
- RESPONSE #100
- Spell(Myself,CLERIC_BLESS)
- END
- //*Charm Animals*
- IF
- ActionListEmpty()
- See(NearestEnemyOfType([0.ANIMAL]))
- HaveSpell(RANGER_CHARM_ANIMAL)
- THEN
- RESPONSE #100
- Spell(LastSeenBy(Myself),RANGER_CHARM_ANIMAL)
- END
-
- //*Heal*
- IF
- ActionListEmpty()
- HPPercentLT(MostDamagedOf(),50)
- !StateCheck(MostDamagedOf(),STATE_INVISIBLE)
- HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS)
- THEN
- RESPONSE #100
- Spell(MostDamagedOf(),CLERIC_CURE_MEDIUM_WOUNDS)
- END
-
- IF
- ActionListEmpty()
- HPPercentLT(MostDamagedOf(),80)
- !StateCheck(MostDamagedOf(),STATE_INVISIBLE)
- HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
- THEN
- RESPONSE #100
- Spell(MostDamagedOf(),CLERIC_CURE_LIGHT_WOUNDS)
- END
-
- //*Heal Self*
-
- IF
- ActionListEmpty()
- HPPercentLT(Myself,50)
- HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS)
- THEN
- RESPONSE #100
- Spell(Myself,CLERIC_CURE_MEDIUM_WOUNDS)
- END
-
- IF
- ActionListEmpty()
- HPPercentLT(Myself,80)
- HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
- THEN
- RESPONSE #100
- Spell(Myself,CLERIC_CURE_LIGHT_WOUNDS)
- END
-
- //*Use Healing Potions*
- IF
- HasItem("POTN08",Myself)
- HPPercentLT(Myself,80)
- THEN
- RESPONSE #100
- UseItem("POTN08,Myself)
- END
-
- IF
- HasItem("POTN52",Myself)
- HPPercentLT(Myself,50)
- THEN
- RESPONSE #100
- UseItem("POTN52,Myself)
- END
-
- //*combat*
- IF
- ActionListEmpty()
- AttackedBy([ANYONE],DEFAULT)
- Range(LastAttackerOf(Myself),4)
- THEN
- RESPONSE #100
- EquipMostDamagingMelee()
- AttackReevaluate(LastAttackerOf(Myself),30)
- END
-
- IF
- ActionListEmpty()
- See(NearestEnemyOf(Myself))
- !Range(NearestEnemyOf(Myself),4)
- Range(NearestEnemyOf(Myself),10)
- THEN
- RESPONSE #100
- RunAwayFrom(NearestEnemyOf(Myself),45)
- END
-
- IF
- ActionListEmpty()
- See(NearestEnemyOf(Myself))
- !Range(NearestEnemyOf(Myself),10)
- THEN
- RESPONSE #100
- EquipRanged()
- AttackReevaluate(NearestEnemyOf(Myself),30)
- END
-
- IF
- ActionListEmpty()
- See(NearestEnemyOf(Myself))
- Range(NearestEnemyOf(Myself),4)
- THEN
- RESPONSE #100
- EquipMostDamagingMelee()
- AttackReevaluate(NearestEnemyOf(Myself),30)
- END
-
- IF
- ActionListEmpty()
- See(NearestEnemyOf(Myself))
- !Range(NearestEnemyOf(Myself),4)
- THEN
- RESPONSE #100
- EquipRanged()
- EquipMostDamagingMelee()
- AttackReevaluate(NearestEnemyOf(Myself),30)
- END