// ============================================================================ // Xyx's all-encompassing "one size fits all" script. // ---------------------------------------------------------------------------- // ToDo: // - xMinion: Nymph should not cast Mass Cure until after Hold Monster/Confusion/Domination. // - xMinion: Not all critters respond well to ActionListEmpty(). // // To check: // // Reconsider: // - Add "things you should know" section to ReadMe? // - HotKey mnemonics. // - Too late now? But is it ever truly? // - Pass and use potions even if we still have Cure Light Wounds? Would finish a lot quicker that way. // - Improved invisible healers won't heal themselves, even though they could. // - Add support for various daily use items: // - Blessed Bracers? BRAC23. Paladins only, and they have two abilities; Cure Serious Wounds and Resurrection. // - Runehammer +5? HAMM11. Mass Cure. // - Erinne Sling? SLING08/SLNG09. Creates +4 bullets. // - Do not check alacrity when moving to a heal target? // - Pro: Faster healing. // - Con: Increased risk of overhealing. // - Con: Main character may spend time walking instead of saying "Healed". // - Archers keep more distance from big critters? // - Giants? Ogres? Dragons? Nabassu/Tana'ri/Pit Fiends? Beholders? // ---------------------------------------------------------------------------- // Version 1.4-witweak: // - xMinion: Added Cerebus. This old dog has been taught many new tricks. // - xParty: (William Imm) - Try not to anger the Cowled Wizards with SCSII // componet "Allow the Cowled Wizards to detect spellcasting // in most indoor, above-ground areas in Athkatla" installed. // ============================================================================ // ============================================================================ // Notes. // ============================================================================ // // The Cowled Wizards: // // The following areas are patrolled by the Cowled Wizards: // AR0020: City Gates // AR0300: Docks // AR0400: Slums // AR0500: Bridge // AR0700: Waukeen's Promenade // AR0900: Temple // AR1000: Government // // Global "BribedCowled" gets set when a license is purchased, when you get // kicked out of the Planar Sphere (which is odd), or when the party becomes // public enemy #1 because Reputation dropped below 4 (because you'll be // attacked every 20 minutes anyway.) // // Timer "SpellsBad" runs for 5 minutes whenever a Cowled Wizard spawns (even // the dude that gives the warning). While this timer runs, spells may still // be cast without summoning additional Cowled ones. This is only important // while fighting the Cowled Wizards. // // Global "CowledWarning" gets incremented whenever you fight a wave of Cowled // Wizards. Once it reaches 7 (you fight Zallanora), they give up. // // (from William Imm) // With SCSII component "Allow the Cowled Wizards to detect spellcasting in most indoor, // above-ground areas in Athkatla", there are more areas added to the blacklist - mostly // indoor areas. // // ---------------------------------------------------------------------------- // // User control: // // Unmapped HotKeys by default (assuming Q = Quicksave and L = Quickload): // [B], [D], [E], [F], [K], [N], [S], [V] // // These scripts use keys: // [B]edtime (cast long duration prep spells) // [D]rink (set healing potion level) // [E]xorcise (turn undead mode) // [F]ix (heal) // [S]tyle // [N]o AI // [V]anish (stealth mode) // [K]illzone (set traps) // ============================================================================ // ============================================================================ // Bookkeeping. // ============================================================================ // Reset "daily use" item charges. This is unreliable but fairly harmless if // it messes up. IF PartyRested() THEN RESPONSE #100 //DisplayStringHead(Myself,12047) // "Sleep" // Reset item usage. SetGlobal("XyxGargoyleBootsUsed","LOCALS",0) SetGlobal("XyxGirdleOfFortitudeUsed","LOCALS",0) SetGlobal("XyxGlovesOfHealingUsed","LOCALS",0) SetGlobal("XyxPOPAPUsed","LOCALS",0) SetGlobal("XyxRingOfHumanInfluenceUsed","LOCALS",0) // Reset reminders. SetGlobal("XyxReminderMinorSequencerFlag","LOCALS",0) SetGlobal("XyxReminderSpellSequencerFlag","LOCALS",0) SetGlobal("XyxReminderSpellTriggerFlag","LOCALS",0) Continue() END // ============================================================================ // Invididual AI toggle. // // Cut off actions only. Do not cut off setting changes. // ============================================================================ // Turn AI off. IF HotKey(N) // [N]o AI Global("XyxAiOffFlag","LOCALS",0) THEN RESPONSE #100 DisplayStringHead(Myself,14671) // "AI off" SetGlobal("XyxAiOffFlag","LOCALS",1) END // Turn AI back on. IF HotKey(N) // [N]o AI Global("XyxAiOffFlag","LOCALS",1) THEN RESPONSE #100 DisplayStringHead(Myself,14669) // "AI on" SetGlobal("XyxAiOffFlag","LOCALS",0) Continue() END // Cut-off. IF Global("XyxAiOffFlag","LOCALS",1) // Not trying to change any settings? !HotKey(D) // [D]rink !HotKey(E) // [E]xorise !HotKey(S) // [S]tyle !HotKey(V) // [V]anish THEN RESPONSE #100 // Do nothing. END // Back-up cut-off in case Continue() was used (by, say, the bookkeeping // section.) IF Global("XyxAiOffFlag","LOCALS",1) // Not trying to change any settings? !HotKey(D) // [D]rink !HotKey(E) // [E]xorise !HotKey(S) // [S]tyle !HotKey(V) // [V]anish THEN RESPONSE #100 // Really do nothing. NoAction() END // ============================================================================ // [S]tyle // // Determines fighting style. // // 0: Soldier // Stand and shoot, switch to melee up close. // // 1: Guard // Stand and engage only close opponents in melee, do not attack at range // (for characters without ranged weapons, such as dual-wielders). // // 2: Archer // Shoot, backpedal when engaged in melee. // // 3: Bard // Sing, backpedal when engage in melee. Bards only. // ============================================================================ // Cycle to Guard style. IF HotKey(S) // [S]tyle GlobalLT("XyxStyleSetting","LOCALS",1) // Guard THEN RESPONSE #100 DisplayStringHead(Myself,12883) // "Guard" SetGlobal("XyxStyleSetting","LOCALS",1) // Guard END // Cycle Guard to Archer style. IF HotKey(S) // [S]tyle GlobalLT("XyxStyleSetting","LOCALS",2) // Archer THEN RESPONSE #100 DisplayStringHead(Myself,25157) // "Archer" SetGlobal("XyxStyleSetting","LOCALS",2) // Archer END // Bards can cycle to Bard style. IF HotKey(S) // [S]tyle GlobalLT("XyxStyleSetting","LOCALS",3) // Bard Class(Myself,BARD_ALL) THEN RESPONSE #100 DisplayStringHead(Myself,1083) // "Bard" SetGlobal("XyxStyleSetting","LOCALS",3) // Bard END // People with the Staff of the Magi can cycle to the special Staff of the Magi // style. IF HotKey(S) // [S]tyle GlobalLT("XyxStyleSetting","LOCALS",4) // Staff of the Magi HasItemEquiped("STAF11",Myself) // Staff of the Magi THEN RESPONSE #100 DisplayStringHead(Myself,7939) // "Staff of the Magi" SetGlobal("XyxStyleSetting","LOCALS",4) // Staff of the Magi END // Cycle back to Soldier style. IF HotKey(S) // [S]tyle // Cycle regardless of setting. If the script got this far, the setting is // irrelevant. THEN RESPONSE #100 DisplayStringHead(Myself,38556) // "Soldier" SetGlobal("XyxStyleSetting","LOCALS",0) // Soldier END // ============================================================================ // Protection. // // These are important enough to precede the modal actions. // ============================================================================ // Stoneskin IF // This is so important it may ignore ActionListEmpty(). HaveSpell(WIZARD_STONE_SKIN) // Need it? CheckStatLT(Myself,1,STONESKINS) // Can cast it? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREMAGE) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Cowled Wizards check. OR(68) // Not in an enforced area. !AreaCheck("AR0020") // City Gates !AreaCheck("AR0300") // Docks !AreaCheck("AR0400") // Slums !AreaCheck("AR0500") // Bridge !AreaCheck("AR0700") // Waukeen's Promenade !AreaCheck("AR0900") // Temple !AreaCheck("AR1000") // Government !AreaCheck("AR0021") !AreaCheck("AR0022") !AreaCheck("AR0313") !AreaCheck("AR0314") !AreaCheck("AR0318") !AreaCheck("AR0319") !AreaCheck("AR0325") !AreaCheck("AR0326") !AreaCheck("AR0330") !AreaCheck("AR0332") !AreaCheck("AR0333") !AreaCheck("AR0334") !AreaCheck("AR0335") !AreaCheck("AR0402") !AreaCheck("AR0403") !AreaCheck("AR0408") !AreaCheck("AR0409") !AreaCheck("AR0501") !AreaCheck("AR0504") !AreaCheck("AR0505") !AreaCheck("AR0506") !AreaCheck("AR0507") !AreaCheck("AR0508") !AreaCheck("AR0509") !AreaCheck("AR0510") !AreaCheck("AR0511") !AreaCheck("AR0512") !AreaCheck("AR0513") !AreaCheck("AR0514") !AreaCheck("AR0515") !AreaCheck("AR0522") !AreaCheck("AR0523") !AreaCheck("AR0525") !AreaCheck("AR0526") !AreaCheck("AR0527") !AreaCheck("AR0528") !AreaCheck("AR0529") !AreaCheck("AR0530") !AreaCheck("AR0531") !AreaCheck("AR0702") !AreaCheck("AR0703") !AreaCheck("AR0704") !AreaCheck("AR0706") !AreaCheck("AR0901") !AreaCheck("AR0902") !AreaCheck("AR0903") !AreaCheck("AR0904") !AreaCheck("AR0905") !AreaCheck("AR1000") !AreaCheck("AR1001") !AreaCheck("AR1002") !AreaCheck("AR1003") !AreaCheck("AR1004") !AreaCheck("AR1005") !AreaCheck("AR1006") !AreaCheck("AR1007") !AreaCheck("AR1009") !AreaCheck("AR1010") // Currently fighting Cowled Wizards (there's a 5 minute delay before more // enforcers will show up.) GlobalTimerNotExpired("SpellsBad","GLOBAL") // Paid the bribe. !Global("BribedCowled","GLOBAL",0) // Crushed the Cowled Wizards. GlobalGT("CowledWarning","GLOBAL",6) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,WIZARD_STONE_SKIN) END // ============================================================================ // Modal actions. // // Stuff like this depends on cutoffs. For this reason, most modal action // blocks equip a melee weapon before they start the modal action. // // Stealth > Turn Undead > Bardsong > Find Traps // // Finding traps is a nonessential activity, so it has no combat cutoff and // only happens at the end of the script. // ============================================================================ // ---------------------------------------------------------------------------- // Stealth ([V]anish) // // Characters in stealth mode try to stay hidden in shadows (and do nothing to // reveal their presence unless manually ordered.) // // This mode is only available to characters that have Hide In Shadows as a // class feature. It appears anyone can succeed at this if their Dexterity is // high enough, but it is annoying to watch them fail so often. And it would // be cheesy. // // The script allows characters that failed to hide to retry immediately. This // is somewhat cheesy because it could not be done manually, but since the game // ships with a script that does exactly this, we'll allow it. // // Leaving the shadows can take quite a while (up to 20 seconds), but if you // order a character to speak to him- or herself they'll be revealed instantly. // The script uses PlayerDialog(Myself) to simulate this. This would prompt // any additional player-created characters (not Player1) in a multiplayer game // to speak their "Why do you waste my time with idle banter?" line, popping up // the dialogue UI and requiring the player to press enter. To avoid this, the // script issues a SetDialogue("") first. // ---------------------------------------------------------------------------- // Start sneaking. IF HotKey(V) // [V]anish Global("XyxStealthFlag","LOCALS",0) // Can sneak? // // Could CheckStatGT(Myself,HIDEINSHADOWS,0), but Dexterity bonuses may cause // non-sneakers to have nonzero values there as well. OR(3) Class(Myself,MONK) Class(Myself,RANGER_ALL) Class(Myself,THIEF_ALL) THEN RESPONSE #100 DisplayStringHead(Myself,4968) // "Stealth" SetGlobal("XyxStealthFlag","LOCALS",1) // Clear any timers that might interfere with stealth. SetGlobalTimer("XyxCheckHealingDoneTimer","LOCALS",0) // Weapon switching aborts modal actions, so grab what we'll need now. SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() Hide() END // Stop sneaking. IF HotKey(V) // [V]anish Global("XyxStealthFlag","LOCALS",1) THEN RESPONSE #100 DisplayStringHead(Myself,14045) // "Visible" SetGlobal("XyxStealthFlag","LOCALS",0) SetDialogue("") PlayerDialogue(Myself) Continue() END // Resume sneaking. IF // Do check. Not doing so would help hide quicker but would also snap shut // containers. ActionListEmpty() Global("XyxStealthFlag","LOCALS",1) // Not already sneaking? !ModalState(STEALTH) // Can't hide in front of enemies. !Detect([EVILCUTOFF]) // Not waiting to be healed (invisibility makes it impossible). OR(2) !GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") HPPercent(Myself,100) OR(2) !GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !StateCheck(Myself,STATE_POISONED) // Prevent a slight annoyance; do not hide before saying "Healed". If the // main character is in stealth mode and is the last to be made whole, say // "Healed" before hiding. Just wait for the timer to be turned off. // // Either we're not healing or we're still busy, but either way we didn't just // finish. OR(7) !GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !HPPercent(Player1,100) !HPPercent(Player2,100) !HPPercent(Player3,100) !HPPercent(Player4,100) !HPPercent(Player5,100) !HPPercent(Player6,100) // Don't bother while setting traps (cut down on spam). !GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") THEN RESPONSE #100 // Weapon switching aborts modal actions, so grab what we'll need now. SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() Hide() END // Keep sneaking. // // This essentially only cuts off combat sections, since the rest is cut off by // the combat sections anyway. IF Global("XyxStealthFlag","LOCALS",1) // Don't check the modal state here. If the character is "Leaving Shadows" // the modal state is off, but the character is still invisible and shouldn't // break stealth. // // Stop bothering when revealed. StateCheck(Myself,STATE_INVISIBLE) // Only in combat. Detect([EVILCUTOFF]) THEN RESPONSE #100 // Do nothing. END // ---------------------------------------------------------------------------- // The Staff of the Magi // // The staff benefits tremendously from scripting, but not everything is as it // should be. // // Switching to the staff can be troublesome: // - EquipMostDamagingMelee() will not equip the Staff of the Magi if a better // beatstick is available, such as the Staff of Rynn or the Staff of the Ram. // - EquipItem("STAF11") seems to be broken. Perhaps it would move an item to // an appropriate slot, but it will not switch weapons. // // The staff itself is also unsuitable for backstabbing. It may serve as a // backstabbing aid in enabling a smooth escape, but the script will not be // able to assist as long as a more damaging alternative is available. // // For these reasons, the staff is not a suitable stealth mode alternative and // has been incorporated into the fighting styles. The staff user mostly wants // to remain invisible anyway, making any other fighting styles fairly // irrelevant. // // In the case the player wishes to combine the staff style and stealth mode // anyway, make sure to hide in shadows when possible and only use the staff // when hiding is not possible. If the Staff of the Magi is not the most // damaging melee weapon (because of, say, the Staff of the Ram), the script // can still Hide In Shadows but will get stuck on the staff part. // // Actions not allowed in "staff mode": // - Attack. It breaks invisibility. If you want your Wizard bashing people, // set them to Guard mode. They should still be invisible most of the time. // - Switch weapons. // // Everything else is allowed and in many cases even encouraged: // - Look for traps. (Go, Immy!) // - Turn undead. (Go, Aerie!) // - Battle Song. (Go, Haerry!) // - Cast Stoneskin. If it's needed, it's needed, and it's probably needed // because something could see through the invisibility. // // (William Imm) - do you think that you want to modify this in case the invisiblity // power from the staff gets removed by a mod? // ---------------------------------------------------------------------------- // Resume invisibility. IF ActionListEmpty() Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi // Not already invisible? !StateCheck(Myself,STATE_INVISIBLE) // Still have staff? HasItemEquiped("STAF11",Myself) // Staff of the Magi // Not waiting to be healed (invisibility makes it impossible). OR(2) !GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") HPPercent(Myself,100) OR(2) !GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !StateCheck(Myself,STATE_POISONED) // Not holding a magically created weapon? !HasItem("MELFMET",Myself) // Melf's Minute Meteors !HasItem("ENEBLADE",Myself) // Energy Blades // Check for some crappy stuff as well to avoid randomly pissing off players. !HasItem("BLAKBLAD",Myself) // Black Blade of Disaster !HasItem("CRITICAL",Myself) // Cause Critical Wounds !HasItem("FBLADE",Myself) // Flame Blade !HasItem("HARM",Myself) // Harm !HasItem("SERIOUS",Myself) // Cause Serious Wounds !HasItem("SLAYLIVE",Myself) // Slay Living !HasItem("SORB",Myself) // Sol's Searing Orb // Don't bother while setting traps (cut down on spam). !GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") THEN RESPONSE #100 //DisplayStringHead(Myself,7939) // "Staff of the Magi" // Hopefully, this will equip the staff. SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() END // ---------------------------------------------------------------------------- // Turn Undead ([E]xorcise undead...) // // Focus almost exclusively on turning undead. Turn undead rather than // attacking. // // Turning undead appears to have a range of 12, and only happens at 6 second // intervals. These intervals do not seem to be related to the time at which // the Cleric starts turning. // // There does not seem to be any reason to "warm up" the turning attempt when // undead are still far away, other than making sure the script has indeed // picked up on the need to turn by the time the undead come in range. To make // sure the Cleric starts turning in time, the script uses a range of 15 // instead of 12. // // Clerics stop turning undead when it is no longer needed. Evil Cleric will // keep trying to control any undead they turn, Good Clerics stop once no // hostile undead remain (to try and not accidentally chunk any Skeleton // Warriors they may have animated). // ---------------------------------------------------------------------------- // Start turning. IF HotKey(E) // [E]xorcise // Can I turn undead? OR(2) Class(Myself,CLERIC_ALL) Class(Myself,PALADIN_ALL) // Note: Kit(Myself,INQUISITOR) fails if compiled in Near Infinity. !Kit(Myself,16) // Inquisitor Global("XyxTurnUndeadFlag","LOCALS",0) THEN RESPONSE #100 VerbalConstant(Myself,BATTLE_CRY) // Battle cry 1 DisplayStringHead(Myself,50702) // "Turning Undead" SetGlobal("XyxTurnUndeadFlag","LOCALS",1) // Weapon switching aborts modal actions, so grab what we'll need now. SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() // The power of Christ compels you! Turn() END // Stop turning. IF HotKey(E) // [E]xorcise Global("XyxTurnUndeadFlag","LOCALS",1) THEN RESPONSE #100 VerbalConstant(Myself,SELECT_ACTION) // Action 1 DisplayStringHead(Myself,50703) // "Stopped Turning Undead" SetGlobal("XyxTurnUndeadFlag","LOCALS",0) Continue() END // Resume turning. IF ActionListEmpty() Global("XyxTurnUndeadFlag","LOCALS",1) !ModalState(TURNUNDEAD) // There are undead near, and they're either hostile or controlled. OR(2) Range([EVILCUTOFF.UNDEAD],15) Range([CONTROLLED.UNDEAD],15) // They're either hostile, or we're Evil. OR(2) Range([EVILCUTOFF.UNDEAD],15) Alignment(Myself,MASK_EVIL) THEN RESPONSE #100 // Weapon switching aborts modal actions, so grab what we'll need now. SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() // The power of Christ compels you! Turn() END // Stop turning when it is no longer needed (to cut back on text spam). IF ActionListEmpty() // Do not interfere with manual turning undead. Global("XyxTurnUndeadFlag","LOCALS",1) ModalState(TURNUNDEAD) !Range([EVILCUTOFF.UNDEAD],15) // Either no controlled undead near, or we're not Evil. OR(2) !Range([CONTROLLED.UNDEAD],15) !Alignment(Myself,MASK_EVIL) THEN RESPONSE #100 // NoAction() doesn't cut it here. ClearActions(Myself) Continue() END // Keep turning. // // This essentially only cuts off combat sections, since the rest is cut off by // the combat sections anyway. IF Global("XyxTurnUndeadFlag","LOCALS",1) ModalState(TURNUNDEAD) // There are undead near, and they're either hostile or controlled. OR(2) Range([EVILCUTOFF.UNDEAD],15) Range([CONTROLLED.UNDEAD],15) // They're either hostile, or we're Evil. OR(2) Range([EVILCUTOFF.UNDEAD],15) Alignment(Myself,MASK_EVIL) THEN RESPONSE #100 // Do nothing. END // ---------------------------------------------------------------------------- // Bardsong. // ---------------------------------------------------------------------------- // Resume singing. IF ActionListEmpty() Global("XyxStyleSetting","LOCALS",3) // Bard !ModalState(BATTLESONG) // Only in combat. Cut down on text spam. Don't turn it off automatically // the way Turn Undead is cancelled, though. Detect([EVILCUTOFF]) THEN RESPONSE #100 // Weapon switching aborts modal actions, so grab what we'll need now. SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() // Start singing. BattleSong() END // Stop singing when it is no longer needed (to cut back on text spam). IF ActionListEmpty() // Do not interfere with manual singing. Global("XyxStyleSetting","LOCALS",3) // Bard ModalState(BATTLESONG) !Detect([EVILCUTOFF]) THEN RESPONSE #100 // NoAction() doesn't cut it here. ClearActions(Myself) Continue() END // Keep singing. // // This essentially only cuts off combat sections, since the rest is cut off by // the combat sections anyway. IF Global("XyxStyleSetting","LOCALS",3) // Bard ModalState(BATTLESONG) // Only in combat. Detect([EVILCUTOFF]) THEN RESPONSE #100 // Keep singing. END // ============================================================================ // Melee defense. // // Ranged attackers suffer -8 to hit when firing at point blank (range 4.) // // Melee attacks made on characters holding a ranged weapon gain +4 to hit and // damage. // ============================================================================ // If helping out, we just found our man. Stop moving in. IF Exists(NearestEnemyOf()) GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") THEN RESPONSE #100 // Stop the timer. SetGlobalTimer("XyxHelpingTimer","LOCALS",0) Continue() END // If threatened in melee, switch to a melee weapon. IF // This is so important that it occasionally gets to interrupt. OR(2) Global("XyxSwitchedToRangedFlag","LOCALS",1) ActionListEmpty() // Too close for comfort? Range(NearestEnemyOf(),4) // Sneakers shouldn't shout and are assumed to have a melee weapon equipped // anyway. Global("XyxStealthFlag","LOCALS",0) // Staff of the Magi users shouldn't shout and already have their staff. !Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi THEN RESPONSE #100 //DisplayStringHead(Myself,49764) // "Defend me!" //DisplayStringHead(NearestEnemyOf(),10070) // "Target" // Get Guards to join in. SetGlobalTimer("XyxMeleeTimer","GLOBAL",6) SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() Continue() END // If threatened in melee and we couldn't get away, warn about it. IF ActionListEmpty() // Ranged? OR(3) Global("XyxStyleSetting","LOCALS",2) // Archer HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades // Couldn't get away despite several attempts? !GlobalTimerExpired("XyxRunAwayTimer","LOCALS") GlobalGT("XyxRunAwayCounter","LOCALS",1) Range(NearestEnemyOf(),4) THEN RESPONSE #100 DisplayStringHead(Myself,71549) // "Help!!" // Don't warn about it too often; reset the counter. SetGlobal("XyxRunAwayCounter","LOCALS",0) Continue() END // Archers and anyone unable to switch to a melee weapon keep their distance. IF // This is so important that it occasionally gets to interrupt. OR(2) Global("XyxSwitchedToRangedFlag","LOCALS",1) ActionListEmpty() // Ranged? OR(3) Global("XyxStyleSetting","LOCALS",2) // Archer HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades // Too close for comfort? Range(NearestEnemyOf(),4) THEN RESPONSE #100 // Keep track of our attempts. IncrementGlobal("XyxRunAwayCounter","LOCALS",1) SetGlobalTimer("XyxRunAwayTimer","LOCALS",6) //DisplayStringHead(Myself,61691) // "Aaah! Run!" // Running away for 16 is enough to ruin the attacker's initiative round, // running away for 27 is enough to occasionally get an attack in. Probably // depends on Speed Factor. RunAwayFrom(NearestEnemyOf(),16) END // Soldiers and Guards switch to melee at medium range, or whenever someone // else is engaged in melee. IF ActionListEmpty() // Melee fighter? OR(2) Global("XyxStyleSetting","LOCALS",0) // Soldier Global("XyxStyleSetting","LOCALS",1) // Guard OR(2) // Close enough? Range(NearestEnemyOf(),10) // The party is already engaged in melee? GlobalTimerNotExpired("XyxMeleeTimer","GLOBAL") THEN RESPONSE #100 //DisplayStringHead(Myself,15529) // "Melee" SetGlobal("XyxSwitchedToRangedFlag","LOCALS",0) EquipMostDamagingMelee() Continue() END // ============================================================================ // Combat spells. // // Aggressive use on vulnerable targets. These spells are all expendable, and // the script is good at recognizing a sweet chance. // ============================================================================ // Ring of Human Influence (Charm Person) // // The ring does not alert the Cowled Wizards. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Can use? HasItemEquiped("RING30",Myself) // Ring of Human Influence GlobalLT("XyxRingOfHumanInfluenceUsed","LOCALS",1) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Don't cast this unless there are at least two enemies. Otherwise the other // characters will almost certainly attack the target and ruin the charm. If // there are other enemies, then hopefully the nearest will be attacked first. NumCreatureGT([EVILCUTOFF],1) // Target the furthest one. This one is most likely to still be unmolested. See(TenthNearest([EVILCUTOFF.HUMANOID])) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) // Pristine critters only. HPPercent(LastSeenBy(),100) !StateCheck(LastSeenBy(),STATE_CHARMED) !StateCheck(LastSeenBy(),STATE_CONFUSED) !StateCheck(LastSeenBy(),STATE_FEEBLEMINDED) !StateCheck(LastSeenBy(),STATE_HELPLESS) !StateCheck(LastSeenBy(),STATE_PANIC) !StateCheck(LastSeenBy(),STATE_SLEEPING) !StateCheck(LastSeenBy(),STATE_SLOWED) !StateCheck(LastSeenBy(),STATE_STUNNED) // Not immune. !Race(LastSeenBy(),TROLL) !Race(LastSeenBy(),RAKSHASA) !Race(LastSeenBy(),DEMONIC) // Actually a bit of a threat. OR(4) CheckStatGT(LastSeenBy(),999,XPVALUE) Class(LastSeenBy(),CLERIC_ALL) Class(LastSeenBy(),MAGE_ALL) HPGT(LastSeenBy(),50) // Vulnerable: CheckStatLT(LastSeenBy(),33,RESISTMAGIC) CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) // At least two of the following apply: // - No magic resistance. // - Really bad save. // - There are at least 3 of them. // - More than 100 hit points. OR(3) //CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),13,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) //CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),13,SAVEVSSPELL) //NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),13,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) //HPGT(LastSeenBy(),100) THEN RESPONSE #100 // Let others know we're stuck in. //DisplayStringHead(Myself,71549) // "Help!!" Help() DisplayString(Myself,7711) // "Ring of Human Influence" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) UseItem("RING30",LastSeenBy()) // Ring of Human Influence END // Charm Animal (Ranger innate) IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Can cast? HaveSpell(RANGER_CHARM_ANIMAL) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Try to target the second one. It is more likely to still be unmolested. See(SecondNearest([EVILCUTOFF.ANIMAL])) // Not too far? This has touch range only. Range(LastSeenBy(),10) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) // Pristine critters only. HPPercent(LastSeenBy(),100) !StateCheck(LastSeenBy(),STATE_CHARMED) !StateCheck(LastSeenBy(),STATE_CONFUSED) !StateCheck(LastSeenBy(),STATE_FEEBLEMINDED) !StateCheck(LastSeenBy(),STATE_HELPLESS) !StateCheck(LastSeenBy(),STATE_PANIC) !StateCheck(LastSeenBy(),STATE_SLEEPING) !StateCheck(LastSeenBy(),STATE_SLOWED) !StateCheck(LastSeenBy(),STATE_STUNNED) // Vulnerable: CheckStatLT(LastSeenBy(),33,RESISTMAGIC) CheckStatGT(LastSeenBy(),7,SAVEVSSPELL) !Race(LastSeenBy(),DRAGON) !HasBounceEffects(LastSeenBy()) // Guenwhyvar is immune to charm (undetectable Signature), but Rangers should // not fight Drizzt. THEN RESPONSE #100 // Let others know we're stuck in. //DisplayStringHead(Myself,71549) // "Help!!" Help() //DisplayStringHead(Myself,20678) // "Charm Animal" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),RANGER_CHARM_ANIMAL) END // Charm Person or Mammal IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Can cast? HaveSpell(CLERIC_CHARM_PERSON) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !StateCheck(Myself,STATE_POISONED) // Don't cast this unless there are at least two enemies. Otherwise the other // characters will almost certainly attack the target and ruin the charm. If // there are other enemies, then hopefully the nearest will be attacked first. NumCreatureGT([EVILCUTOFF],1) // Target the furthest one. This one is most likely to still be unmolested. OR(2) See(TenthNearest([EVILCUTOFF.ANIMAL])) // Prefer humanoids. See(TenthNearest([EVILCUTOFF.HUMANOID])) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) // Pristine critters only. HPPercent(LastSeenBy(),100) !StateCheck(LastSeenBy(),STATE_CHARMED) !StateCheck(LastSeenBy(),STATE_CONFUSED) !StateCheck(LastSeenBy(),STATE_FEEBLEMINDED) !StateCheck(LastSeenBy(),STATE_HELPLESS) !StateCheck(LastSeenBy(),STATE_PANIC) !StateCheck(LastSeenBy(),STATE_SLEEPING) !StateCheck(LastSeenBy(),STATE_SLOWED) !StateCheck(LastSeenBy(),STATE_STUNNED) // Not immune. !Race(LastSeenBy(),TROLL) !Race(LastSeenBy(),RAKSHASA) !Race(LastSeenBy(),DEMONIC) !Race(LastSeenBy(),DRAGON) // Awkward Guenwhyvar check: OR(3) !Race(LastSeenBy(),CAT) !Class(LastSeenBy(),CAT) !Gender(LastSeenBy(),SUMMONED) // Actually a little bit of a threat. OR(4) CheckStatGT(LastSeenBy(),399,XPVALUE) Class(LastSeenBy(),CLERIC_ALL) Class(LastSeenBy(),MAGE_ALL) HPGT(LastSeenBy(),50) // Vulnerable: CheckStatLT(LastSeenBy(),33,RESISTMAGIC) CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) // At least two of the following apply: // - No magic resistance. // - Really bad save. // - There are at least 3 of them. // - More than 100 hit points. OR(3) //CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),13,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) //CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),13,SAVEVSSPELL) //NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),13,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) //HPGT(LastSeenBy(),100) THEN RESPONSE #100 // Let others know we're stuck in. //DisplayStringHead(Myself,71549) // "Help!!" Help() //DisplayStringHead(Myself,12099) // "Charm Person or Mammal" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_CHARM_PERSON) END // Hold Person IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Can cast? HaveSpell(CLERIC_HOLD_PERSON) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !StateCheck(Myself,STATE_POISONED) // Target second nearest in the hopes of catching a group. //See(SecondNearestEnemyOf()) See(SecondNearest([EVILCUTOFF.HUMANOID])) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) General(LastSeenBy(Myself),HUMANOID) !StateCheck(LastSeenBy(),STATE_CHARMED) !StateCheck(LastSeenBy(),STATE_CONFUSED) !StateCheck(LastSeenBy(),STATE_FEEBLEMINDED) !StateCheck(LastSeenBy(),STATE_HELPLESS) !StateCheck(LastSeenBy(),STATE_PANIC) !StateCheck(LastSeenBy(),STATE_SLEEPING) !StateCheck(LastSeenBy(),STATE_SLOWED) !StateCheck(LastSeenBy(),STATE_STUNNED) !Race(LastSeenBy(),KUO-TOA) !Race(LastSeenBy(),TROLL) !Race(LastSeenBy(),RAKSHASA) !Race(LastSeenBy(),DEMONIC) // Actually a little bit of a threat. OR(4) CheckStatGT(LastSeenBy(),99,XPVALUE) Class(LastSeenBy(),CLERIC_ALL) Class(LastSeenBy(),MAGE_ALL) HPGT(LastSeenBy(),50) // Vulnerable: CheckStatLT(LastSeenBy(),33,RESISTMAGIC) CheckStatGT(LastSeenBy(),7,SAVEVSSPELL) // At least two of the following apply: // - No magic resistance. // - Really bad save. // - There are at least 3 of them. // - More than 100 hit points. OR(3) //CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) //CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) //NumCreatureGT([EVILCUTOFF],2) HPGT(LastSeenBy(),100) OR(3) CheckStat(LastSeenBy(),0,RESISTMAGIC) CheckStatGT(LastSeenBy(),10,SAVEVSSPELL) NumCreatureGT([EVILCUTOFF],2) //HPGT(LastSeenBy(),100) THEN RESPONSE #100 // Let others know we're stuck in. //DisplayStringHead(Myself,71549) // "Help!!" Help() //DisplayStringHead(Myself,12049) // "Hold Person" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_HOLD_PERSON) END // ============================================================================ // Combat. // ============================================================================ // ---------------------------------------------------------------------------- // Switch to ranged. // ---------------------------------------------------------------------------- // Replenish Melf's Minute Meteors. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") HaveSpell(WIZARD_MELF_METEOR) // Is it safe? !Range(NearestEnemyOf(),4) // Prefer ranged? OR(2) Global("XyxStyleSetting","LOCALS",2) // Archer !Range(NearestEnemyOf(),10) // Not trying to stay invisible? !Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi // Not already holding a magically created weapon? !HasItem("MELFMET",Myself) // Melf's Minute Meteors !HasItem("ENEBLADE",Myself) // Energy Blades // Check for some crappy stuff as well to avoid randomly pissing off players. !HasItem("BLAKBLAD",Myself) // Black Blade of Disaster !HasItem("CRITICAL",Myself) // Cause Critical Wounds !HasItem("FBLADE",Myself) // Flame Blade !HasItem("HARM",Myself) // Harm !HasItem("SERIOUS",Myself) // Cause Serious Wounds !HasItem("SLAYLIVE",Myself) // Slay Living !HasItem("SORB",Myself) // Sol's Searing Orb // Can cast it? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREMAGE) CheckStat(Myself,0,SURGEMOD) !StateCheck(Myself,STATE_POISONED) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Cowled Wizards check. OR(68) // Not in an enforced area. !AreaCheck("AR0020") // City Gates !AreaCheck("AR0300") // Docks !AreaCheck("AR0400") // Slums !AreaCheck("AR0500") // Bridge !AreaCheck("AR0700") // Waukeen's Promenade !AreaCheck("AR0900") // Temple !AreaCheck("AR1000") // Government !AreaCheck("AR0021") !AreaCheck("AR0022") !AreaCheck("AR0313") !AreaCheck("AR0314") !AreaCheck("AR0318") !AreaCheck("AR0319") !AreaCheck("AR0325") !AreaCheck("AR0326") !AreaCheck("AR0330") !AreaCheck("AR0332") !AreaCheck("AR0333") !AreaCheck("AR0334") !AreaCheck("AR0335") !AreaCheck("AR0402") !AreaCheck("AR0403") !AreaCheck("AR0408") !AreaCheck("AR0409") !AreaCheck("AR0501") !AreaCheck("AR0504") !AreaCheck("AR0505") !AreaCheck("AR0506") !AreaCheck("AR0507") !AreaCheck("AR0508") !AreaCheck("AR0509") !AreaCheck("AR0510") !AreaCheck("AR0511") !AreaCheck("AR0512") !AreaCheck("AR0513") !AreaCheck("AR0514") !AreaCheck("AR0515") !AreaCheck("AR0522") !AreaCheck("AR0523") !AreaCheck("AR0525") !AreaCheck("AR0526") !AreaCheck("AR0527") !AreaCheck("AR0528") !AreaCheck("AR0529") !AreaCheck("AR0530") !AreaCheck("AR0531") !AreaCheck("AR0702") !AreaCheck("AR0703") !AreaCheck("AR0704") !AreaCheck("AR0706") !AreaCheck("AR0901") !AreaCheck("AR0902") !AreaCheck("AR0903") !AreaCheck("AR0904") !AreaCheck("AR0905") !AreaCheck("AR1000") !AreaCheck("AR1001") !AreaCheck("AR1002") !AreaCheck("AR1003") !AreaCheck("AR1004") !AreaCheck("AR1005") !AreaCheck("AR1006") !AreaCheck("AR1007") !AreaCheck("AR1009") !AreaCheck("AR1010") // Currently fighting Cowled Wizards (there's a 5 minute delay before more // enforcers will show up.) GlobalTimerNotExpired("SpellsBad","GLOBAL") // Paid the bribe. !Global("BribedCowled","GLOBAL",0) // Crushed the Cowled Wizards. GlobalGT("CowledWarning","GLOBAL",6) THEN RESPONSE #100 //DisplayStringHead(Myself,685) // "RANGED :" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,WIZARD_MELF_METEOR) END // Soldiers switch to ranged if the target is moderately far away. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") Global("XyxStyleSetting","LOCALS",0) // Soldier Exists(NearestEnemyOf()) !Range(NearestEnemyOf(),10) // The party is not already engaged in melee? !GlobalTimerNotExpired("XyxMeleeTimer","GLOBAL") THEN RESPONSE #100 //DisplayStringHead(Myself,685) // "RANGED :" SetGlobal("XyxSwitchedToRangedFlag","LOCALS",1) SetGlobal("XyxRunAwayCounter","LOCALS",0) EquipRanged() Continue() END // Archers switch to ranged if the target isn't right next to them. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") Global("XyxStyleSetting","LOCALS",2) // Archer Exists(NearestEnemyOf()) !Range(NearestEnemyOf(),4) THEN RESPONSE #100 //DisplayStringHead(Myself,685) // "RANGED :" SetGlobal("XyxSwitchedToRangedFlag","LOCALS",1) SetGlobal("XyxRunAwayCounter","LOCALS",0) EquipRanged() Continue() END // ---------------------------------------------------------------------------- // Fussy combat targeting. // ---------------------------------------------------------------------------- // Melee fighters just go for the nearest. Ranged attackers try to pick off // the wounded. // // Injury levels: // 100% Uninjured // 76-99% Slightly Injured // 51-75% Injured // 26-50% Badly Injured // 1-25% Near Death // Start with simply the nearest. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") See(NearestEnemyOf()) !StateCheck(Player1,STATE_CHARMED) See(NearestEnemyOf(Player1)) False() THEN RESPONSE #100 END // ---------------------------------------------------------------------------- // Upgrade to the nearest target that isn't disabled. // // Some states don't have to be checked: // - STATE_SLEEPING: Sleeping foes wake up quickly. Better to get the hits in // while we can. // - STATE_FEEBLEMINDED: A bit of a rarity. // ---------------------------------------------------------------------------- // Second. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Current target is disabled. OR(3) StateCheck(LastSeenBy(),STATE_HELPLESS) StateCheck(LastSeenBy(),STATE_STUNNED) StateCheck(LastSeenBy(),STATE_PANIC) // New target is not disabled. !StateCheck(SecondNearestEnemyOf(),STATE_HELPLESS) !StateCheck(SecondNearestEnemyOf(),STATE_STUNNED) !StateCheck(SecondNearestEnemyOf(),STATE_PANIC) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(SecondNearestEnemyOf(),100,RESISTMISSILE) // Target. See(SecondNearestEnemyOf()) False() THEN RESPONSE #100 END // Third. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Current target is disabled. OR(3) StateCheck(LastSeenBy(),STATE_HELPLESS) StateCheck(LastSeenBy(),STATE_STUNNED) StateCheck(LastSeenBy(),STATE_PANIC) // New target is not disabled. !StateCheck(ThirdNearestEnemyOf(),STATE_HELPLESS) !StateCheck(ThirdNearestEnemyOf(),STATE_STUNNED) !StateCheck(ThirdNearestEnemyOf(),STATE_PANIC) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(ThirdNearestEnemyOf(),100,RESISTMISSILE) // Target. See(ThirdNearestEnemyOf()) False() THEN RESPONSE #100 END // Fourth. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Current target is disabled. OR(3) StateCheck(LastSeenBy(),STATE_HELPLESS) StateCheck(LastSeenBy(),STATE_STUNNED) StateCheck(LastSeenBy(),STATE_PANIC) // New target is not disabled. !StateCheck(FourthNearestEnemyOf(),STATE_HELPLESS) !StateCheck(FourthNearestEnemyOf(),STATE_STUNNED) !StateCheck(FourthNearestEnemyOf(),STATE_PANIC) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(FourthNearestEnemyOf(),100,RESISTMISSILE) // Target. See(FourthNearestEnemyOf()) False() THEN RESPONSE #100 END // Fifth. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Current target is disabled. OR(3) StateCheck(LastSeenBy(),STATE_HELPLESS) StateCheck(LastSeenBy(),STATE_STUNNED) StateCheck(LastSeenBy(),STATE_PANIC) // New target is not disabled. !StateCheck(FifthNearestEnemyOf(),STATE_HELPLESS) !StateCheck(FifthNearestEnemyOf(),STATE_STUNNED) !StateCheck(FifthNearestEnemyOf(),STATE_PANIC) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(FifthNearestEnemyOf(),100,RESISTMISSILE) // Target. See(FifthNearestEnemyOf()) False() THEN RESPONSE #100 END // Sixth. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // Current target is disabled. OR(3) StateCheck(LastSeenBy(),STATE_HELPLESS) StateCheck(LastSeenBy(),STATE_STUNNED) StateCheck(LastSeenBy(),STATE_PANIC) // New target is not disabled. !StateCheck(SixthNearestEnemyOf(),STATE_HELPLESS) !StateCheck(SixthNearestEnemyOf(),STATE_STUNNED) !StateCheck(SixthNearestEnemyOf(),STATE_PANIC) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(SixthNearestEnemyOf(),100,RESISTMISSILE) // Target. See(SixthNearestEnemyOf()) False() THEN RESPONSE #100 END // ---------------------------------------------------------------------------- // Upgrade to a more damaged target, provided it is still in range. // ---------------------------------------------------------------------------- // Second. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // In range? OR(5) Global("XyxStyleSetting","LOCALS",0) // Soldier Global("XyxStyleSetting","LOCALS",2) // Archer HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades Range(SecondNearestEnemyOf(),6) // Live target? !StateCheck(SecondNearestEnemyOf(),STATE_HELPLESS) !StateCheck(SecondNearestEnemyOf(),STATE_STUNNED) !StateCheck(SecondNearestEnemyOf(),STATE_PANIC) // More damaged? HPPercentLT(SecondNearestEnemyOf(),100) OR(2) !HPPercentLT(LastSeenBy(),100) HPPercentLT(SecondNearestEnemyOf(),75) OR(2) !HPPercentLT(LastSeenBy(),75) HPPercentLT(SecondNearestEnemyOf(),50) OR(2) !HPPercentLT(LastSeenBy(),50) HPPercentLT(SecondNearestEnemyOf(),25) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(SecondNearestEnemyOf(),100,RESISTMISSILE) // Target. See(SecondNearestEnemyOf()) False() THEN RESPONSE #100 END // Third. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // In range? OR(5) Global("XyxStyleSetting","LOCALS",0) // Soldier Global("XyxStyleSetting","LOCALS",2) // Archer HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades Range(ThirdNearestEnemyOf(),6) // Live target? !StateCheck(ThirdNearestEnemyOf(),STATE_HELPLESS) !StateCheck(ThirdNearestEnemyOf(),STATE_STUNNED) !StateCheck(ThirdNearestEnemyOf(),STATE_PANIC) // More damaged? HPPercentLT(ThirdNearestEnemyOf(),100) OR(2) !HPPercentLT(LastSeenBy(),100) HPPercentLT(ThirdNearestEnemyOf(),75) OR(2) !HPPercentLT(LastSeenBy(),75) HPPercentLT(ThirdNearestEnemyOf(),50) OR(2) !HPPercentLT(LastSeenBy(),50) HPPercentLT(ThirdNearestEnemyOf(),25) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(ThirdNearestEnemyOf(),100,RESISTMISSILE) // Target. See(ThirdNearestEnemyOf()) False() THEN RESPONSE #100 END // Fourth. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // In range? OR(5) Global("XyxStyleSetting","LOCALS",0) // Soldier Global("XyxStyleSetting","LOCALS",2) // Archer HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades Range(FourthNearestEnemyOf(),6) // Live target? !StateCheck(FourthNearestEnemyOf(),STATE_HELPLESS) !StateCheck(FourthNearestEnemyOf(),STATE_STUNNED) !StateCheck(FourthNearestEnemyOf(),STATE_PANIC) // More damaged? HPPercentLT(FourthNearestEnemyOf(),100) OR(2) !HPPercentLT(LastSeenBy(),100) HPPercentLT(FourthNearestEnemyOf(),75) OR(2) !HPPercentLT(LastSeenBy(),75) HPPercentLT(FourthNearestEnemyOf(),50) OR(2) !HPPercentLT(LastSeenBy(),50) HPPercentLT(FourthNearestEnemyOf(),25) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(FourthNearestEnemyOf(),100,RESISTMISSILE) // Target. See(FourthNearestEnemyOf()) False() THEN RESPONSE #100 END // Fifth. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // In range? OR(5) Global("XyxStyleSetting","LOCALS",0) // Soldier Global("XyxStyleSetting","LOCALS",2) // Archer HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades Range(FifthNearestEnemyOf(),6) // Live target? !StateCheck(FifthNearestEnemyOf(),STATE_HELPLESS) !StateCheck(FifthNearestEnemyOf(),STATE_STUNNED) !StateCheck(FifthNearestEnemyOf(),STATE_PANIC) // More damaged? HPPercentLT(FifthNearestEnemyOf(),100) OR(2) !HPPercentLT(LastSeenBy(),100) HPPercentLT(FifthNearestEnemyOf(),75) OR(2) !HPPercentLT(LastSeenBy(),75) HPPercentLT(FifthNearestEnemyOf(),50) OR(2) !HPPercentLT(LastSeenBy(),50) HPPercentLT(FifthNearestEnemyOf(),25) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(FifthNearestEnemyOf(),100,RESISTMISSILE) // Target. See(FifthNearestEnemyOf()) False() THEN RESPONSE #100 END // Sixth. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // In range? OR(5) Global("XyxStyleSetting","LOCALS",0) // Soldier Global("XyxStyleSetting","LOCALS",2) // Archer HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades Range(SixthNearestEnemyOf(),6) // Live target? !StateCheck(SixthNearestEnemyOf(),STATE_HELPLESS) !StateCheck(SixthNearestEnemyOf(),STATE_STUNNED) !StateCheck(SixthNearestEnemyOf(),STATE_PANIC) // More damaged? HPPercentLT(SixthNearestEnemyOf(),100) OR(2) !HPPercentLT(LastSeenBy(),100) HPPercentLT(SixthNearestEnemyOf(),75) OR(2) !HPPercentLT(LastSeenBy(),75) HPPercentLT(SixthNearestEnemyOf(),50) OR(2) !HPPercentLT(LastSeenBy(),50) HPPercentLT(SixthNearestEnemyOf(),25) // Archers skip targets that are immune. OR(2) // Not an archer. !Global("XyxStyleSetting","LOCALS",2) // Archer // Not immune. CheckStatLT(SixthNearestEnemyOf(),100,RESISTMISSILE) // Target. See(SixthNearestEnemyOf()) False() THEN RESPONSE #100 END // If there are more than 6 enemies... whatever. // ---------------------------------------------------------------------------- // Haer'Dalis Special (also available to other Blades, and to entangled people) // // Haerry can't hit anything beyond the reach of his blade if he's in Defensive // Spin. Unfortunately, Defensive Spin is rather difficult to detect. The // script assumes it is active if the following conditions are all met: // - Blade. // - Blurred. // // A popular exploit is to give Haerry Free Action, allowing him to move about // even while in Defensive Spin. Free Action cannot be detected separately, so // the script checks for items that bestow it. // // Slight problems may arise if Haerry casts Blur or gets Free Action from a // non-permanent source, but this is still preferable to having him try to move // while in Defensive Spin. // // Pretty much everything that applies to Defensive Spin also applies to // Entangle. // // If entangled or in Defensive Spin and nearest enemy is in melee range, // attack nearest enemy to make sure we're not trying to reach an enemy that's // out of range. // // If entangled or in Defensive Spin and nearest enemy is out of melee range, // switch to ranged to make sure we can reach our target. // ---------------------------------------------------------------------------- // Melee fighters in Defensive Spin target the nearest enemy. IF ActionListEmpty() // Note: This must be compiled in Near Infinity. Kit(Myself,BLADE) // Probably in Defensive Spin? Could also be Blur... StateCheck(Myself,STATE_BLUR) // Want to melee? !Global("XyxStyleSetting","LOCALS",2) // Archer !HasItem("MELFMET",Myself) // Melf's Minute Meteors // No Free Action? (At least, not from an item...) !HasItemEquiped("RING09",Myself) // Ring of Free Action !HasItemEquipedReal("BLUN30",Myself) // Flail of Ages +5 !HasItemEquipedReal("SPER12",Myself) // Ixil's Spike +6 !HasItemEquipedReal("SW2H13",Myself) // Spider's Bane // Anything in melee range? Range(NearestEnemyOf(),4) // Simply target the nearest. See(NearestEnemyOf()) False() THEN RESPONSE #100 END // Defensive Spinners switch to ranged if nobody is near. IF ActionListEmpty() // Note: This must be compiled in Near Infinity. Kit(Myself,BLADE) // Probably in Defensive Spin? Could also be Blur... StateCheck(Myself,STATE_BLUR) // Not a Guard (in which case, don't interfere)? !Global("XyxStyleSetting","LOCALS",1) // Guard // No Free Action? (At least, not from an item...) !HasItemEquiped("RING09",Myself) // Ring of Free Action !HasItemEquipedReal("BLUN30",Myself) // Flail of Ages +5 !HasItemEquipedReal("SPER12",Myself) // Ixil's Spike +6 !HasItemEquipedReal("SW2H13",Myself) // Spider's Bane // The nearest enemy is out of melee range? Exists(NearestEnemyOf()) !Range(NearestEnemyOf(),4) THEN RESPONSE #100 SetGlobal("XyxSwitchedToRangedFlag","LOCALS",1) EquipRanged() Continue() END // Entangled melee fighters target the nearest enemy. // // Don't have to check for Free Action; couldn't be entangled if that was the // case. IF ActionListEmpty() // Entangled? CheckStat(Myself,1,ENTANGLE) // Want to melee? !Global("XyxStyleSetting","LOCALS",2) // Archer !HasItem("MELFMET",Myself) // Melf's Minute Meteors // Anything in melee range? Range(NearestEnemyOf(),4) // Simply target the nearest. See(NearestEnemyOf()) False() THEN RESPONSE #100 END // Entangled people switch to ranged if nobody is near. IF ActionListEmpty() // Entangled? CheckStat(Myself,1,ENTANGLE) // Not a Guard (in which case, don't interfere)? !Global("XyxStyleSetting","LOCALS",1) // Guard // The nearest enemy is out of melee range? Exists(NearestEnemyOf()) !Range(NearestEnemyOf(),4) THEN RESPONSE #100 SetGlobal("XyxSwitchedToRangedFlag","LOCALS",1) EquipRanged() Continue() END // ---------------------------------------------------------------------------- // Attack. // // Attack even if we could have guessed that the target is immune. Otherwise // the player would not hear the "my weapon is useless!" cries, and would not // understand why the character is not attacking. // ---------------------------------------------------------------------------- // Call for help and attack. IF // Helping archers are allowed to interrupt. OR(2) ActionListEmpty() Global("XyxStyleSetting","LOCALS",2) // Archer OR(2) ActionListEmpty() GlobalTimerNotExpired("XyxHelpingTimer","LOCALS") // One last series of checks to make sure LastSeenBy() is set to an enemy. Allegiance(LastSeenBy(),EVILCUTOFF) !Allegiance(LastSeenBy(),GOODCUTOFF) !InParty(LastSeenBy()) // Can't use Detect() here; it would override LastSeenBy(). Exists(NearestEnemyOf()) // Guards stay put unless... OR(5) // Not a Guard. !Global("XyxStyleSetting","LOCALS",1) // Guard // Party is engaged in melee anyway. GlobalTimerNotExpired("XyxMeleeTimer","GLOBAL") // In range anyway. Range(LastSeenBy(),10) HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades // Staff of the Magi users should not reveal themselves. OR(3) // Not in staff style. !Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi // Can't use staff anyway. HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades THEN RESPONSE #100 // Let others know we're attacking. //DisplayStringHead(Myself,71549) // "Help!!" Help() // Hit 'em! //DisplayStringHead(Myself,50712) // "Attack!! Attack!!" //DisplayStringHead(LastSeenBy(),10070) // "Target" AttackOneRound(LastSeenBy()) END // ---------------------------------------------------------------------------- // Help out others. // // Rather than stand around while party members are being beat up, if no enemy // is in sight but another party member is being attacked, join in. // ---------------------------------------------------------------------------- // Go over and help out. IF ActionListEmpty() Help([PC]) // I am not simply a Guard staying put? No need to use Detect() here. !Exists(NearestEnemyOf()) // There's no point in sneakers coming over. They stop as soon as they lay // eyes on the enemy. They should stay put and make sure they stay hidden. Global("XyxStealthFlag","LOCALS",0) // Staff of the Magi users should not reveal themselves. OR(3) !Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi HasItem("MELFMET",Myself) // Melf's Minute Meteors HasItem("ENEBLADE",Myself) // Energy Blades THEN RESPONSE #100 //DisplayStringHead(Myself,49769) // "I shall help thee!" //DisplayStringHead(LastHelp(),10070) // "Target" SetGlobalTimer("XyxHelpingTimer","LOCALS",6) MoveToObject(LastHelp()) END // Guards occasionally warn that they're guarding. IF ActionListEmpty() // If we're a Guard and got this far, it is safe to assume we're guarding. Global("XyxStyleSetting","LOCALS",1) // Guard // Not the first second of combat? !CombatCounter(0) // Not warned recently? !GlobalTimerNotExpired("XyxGuardWarningTimer","LOCALS") // There ARE enemies? No need to use Detect() here. Exists(NearestEnemyOf()) // Just not nearby? !Range(NearestEnemyOf(),10) THEN RESPONSE #100 DisplayStringHead(Myself,50890) // "No! Stay back!" //DisplayStringHead(Myself,26525) // "Back off and keep your distance." // Don't warn again for some time. SetGlobalTimer("XyxGuardWarningTimer","LOCALS",12) Continue() END // ============================================================================ // Cure poison // // Nothing as complex as the healing potion business; just find someone // poisoned and cure them. // // Notes: // - Don't wait until ordered; it's urgent, and the potions and spells are // expendable. // - Wait until combat is over. First kill the thing that is poisoning us. // - Cure poison before healing, since otherwise more healing will be needed. // - Could have used GiveOrder() to prevent over-curing, but paralyzed people // probably don't have their script running to give the order anyway. // - Regarding invisibility: // - CANNOT cast spells on others if they're (improved) invisible. // - CAN cast spells on self if invisible. // - CAN give potions to invisible people. // - If curing self, prefer methods that cannot be disrupted by the poison; do // not try spells unless there are no items available. // ============================================================================ // ---------------------------------------------------------------------------- // Targeted cure poison stuff. // // Note: This block is a performance hog, and there's no way to improve that // without removing the HasItem() checks. // ---------------------------------------------------------------------------- // Look for someone poisoned. IF ActionListEmpty() !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Try self first. OR(2) // Can't select? !See(Myself) // Not poisoned? !StateCheck(Myself,STATE_POISONED) // Check the rest of the party. Stop as soon as we find someone. OR(5) // Can't select? !See(Player1) // Not poisoned? !StateCheck(Player1,STATE_POISONED) // Not targetable? StateCheck(Player1,STATE_IMPROVEDINVISIBILITY) // They can take care of it themselves? HasItem("POTN20",Player1) // Antidote HasItem("POTN17",Player1) // Elixir of Health // Try someone else. OR(5) !See(Player2) !StateCheck(Player2,STATE_POISONED) StateCheck(Player2,STATE_IMPROVEDINVISIBILITY) HasItem("POTN20",Player2) // Antidote HasItem("POTN17",Player2) // Elixir of Health OR(5) !See(Player3) !StateCheck(Player3,STATE_POISONED) StateCheck(Player3,STATE_IMPROVEDINVISIBILITY) HasItem("POTN20",Player3) // Antidote HasItem("POTN17",Player3) // Elixir of Health OR(5) !See(Player4) !StateCheck(Player4,STATE_POISONED) StateCheck(Player4,STATE_IMPROVEDINVISIBILITY) HasItem("POTN20",Player4) // Antidote HasItem("POTN17",Player4) // Elixir of Health OR(5) !See(Player5) !StateCheck(Player5,STATE_POISONED) StateCheck(Player5,STATE_IMPROVEDINVISIBILITY) HasItem("POTN20",Player5) // Antidote HasItem("POTN17",Player5) // Elixir of Health OR(5) !See(Player6) !StateCheck(Player6,STATE_POISONED) StateCheck(Player6,STATE_IMPROVEDINVISIBILITY) HasItem("POTN20",Player6) // Antidote HasItem("POTN17",Player6) // Elixir of Health // Don't actually go through with it. This is just a targeting routine. False() THEN RESPONSE #100 END // Neutralize Poison IF ActionListEmpty() StateCheck(LastSeenBy(),STATE_POISONED) // Can cast? HaveSpell(CLERIC_NEUTRALIZE_POISON) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) // No safer alternative needed or available? OR(2) !StateCheck(Myself,STATE_POISONED) !HasItem("POTN20",Myself) // Antidote OR(2) !StateCheck(Myself,STATE_POISONED) !HasItem("POTN17",Myself) // Elixir of Health THEN RESPONSE #100 //DisplayStringHead(Myself,12115) // "Neutralize Poison" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_NEUTRALIZE_POISON) END // Slow Poison IF ActionListEmpty() StateCheck(LastSeenBy(),STATE_POISONED) // Can cast? HaveSpell(CLERIC_SLOW_POISON) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) OR(2) !StateCheck(Myself,STATE_POISONED) !HasItem("POTN20",Myself) // Antidote OR(2) !StateCheck(Myself,STATE_POISONED) !HasItem("POTN17",Myself) // Elixir of Health THEN RESPONSE #100 //DisplayStringHead(Myself,12112) // "Slow Poison" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_SLOW_POISON) END // Slow Poison (Bhaalpower) IF ActionListEmpty() StateCheck(LastSeenBy(),STATE_POISONED) // Can cast? HaveSpell(3102) // Slow Poison (Bhaalpower) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) OR(2) !StateCheck(Myself,STATE_POISONED) !HasItem("POTN20",Myself) // Antidote OR(2) !StateCheck(Myself,STATE_POISONED) !HasItem("POTN17",Myself) // Elixir of Health THEN RESPONSE #100 //DisplayStringHead(Myself,12115) // "Slow Poison" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),3102) // Slow Poison (Bhaalpower) END // Periapt of Proof Against Poison: Worn (don't take it off!) IF ActionListEmpty() StateCheck(LastSeenBy(),STATE_POISONED) // Can use? HasItemEquiped("AMUL22",Myself) // Periapt of Proof Against Poison GlobalLT("XyxPOPAPUsed","LOCALS",1) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 DisplayString(Myself,8044) // "Periapt of Proof Against Poison" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) IncrementGlobal("XyxPOPAPUsed","LOCALS",1) UseItem("AMUL22",LastSeenBy()) // Periapt of Proof Against Poison END // Periapt of Proof Against Poison: In backpack or bag. IF ActionListEmpty() StateCheck(LastSeenBy(),STATE_POISONED) // Can use? HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalLT("XyxPOPAPUsed","LOCALS",1) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 DisplayString(Myself,8044) // "Periapt of Proof Against Poison" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) IncrementGlobal("XyxPOPAPUsed","LOCALS",1) // Take it out of the Bag of Holding, if necessary. GiveItem("AMUL22",Myself) // Periapt of Proof Against Poison UseItem("AMUL22",LastSeenBy()) // Periapt of Proof Against Poison END // Gloves of Healing: In backpack or bag (assume they're never worn.) // // Note: Unusable by Cleric, Mage, Druid. Nice little undocumented feature... IF ActionListEmpty() StateCheck(LastSeenBy(),STATE_POISONED) // Can use? HasItem("BRAC20",Myself) // Gloves of Healing GlobalLT("XyxGlovesOfHealingUsed","LOCALS",1) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 DisplayString(Myself,7986) // "Gloves of Healing" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) IncrementGlobal("XyxGlovesOfHealingUsed","LOCALS",1) // Take it out of the Bag of Holding, if necessary. //GiveItem("BRAC20",Myself) // Gloves of Healing UseItem("BRAC20",LastSeenBy()) // Gloves of Healing END // ---------------------------------------------------------------------------- // Drink cure poison potions. // ---------------------------------------------------------------------------- // Drink Antidote. IF ActionListEmpty() // Need it? StateCheck(Myself,STATE_POISONED) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Have it? HasItem("POTN20",Myself) // Antidote THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) // Take it out of a container, if necessary. GiveItem("POTN20",Myself) // Antidote //DisplayStringHead(Myself,46150) // "quaffs a potion" DisplayString(Myself,7029) // "Antidote" UseItem("POTN20",Myself) // Antidote END // Drink Elixir of Health. IF ActionListEmpty() // Need it? StateCheck(Myself,STATE_POISONED) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Have it? HasItem("POTN17",Myself) // Elixir of Health THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) // Take it out of a container, if necessary. GiveItem("POTN17",Myself) // Elixir of Health //DisplayStringHead(Myself,46150) // "quaffs a potion" DisplayString(Myself,7011) // "Elixir of Health" UseItem("POTN17",Myself) // Elixir of Health END // ---------------------------------------------------------------------------- // Pass cure poison potions. // ---------------------------------------------------------------------------- // Pass Antidote. IF ActionListEmpty() // Needs it? StateCheck(Player1,STATE_POISONED) // We have a potion but they don't? HasItem("POTN20",Myself) // Antidote !HasItem("POTN20",Player1) // Antidote !HasItem("POTN17",Player1) // Elixir of Health // Could pass? Range(Player1,30) // Don't have any more economic solutions? !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 // Pass a potion. //DisplayStringHead(Myself,7029) // "Antidote" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player1,10070) // "Target" GiveItem("POTN20",Player1) // Antidote END IF ActionListEmpty() StateCheck(Player2,STATE_POISONED) HasItem("POTN20",Myself) // Antidote !HasItem("POTN20",Player2) // Antidote !HasItem("POTN17",Player2) // Elixir of Health Range(Player2,30) !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7029) // "Antidote" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player2,10070) // "Target" GiveItem("POTN20",Player2) // Antidote END IF ActionListEmpty() StateCheck(Player3,STATE_POISONED) HasItem("POTN20",Myself) // Antidote !HasItem("POTN20",Player3) // Antidote !HasItem("POTN17",Player3) // Elixir of Health Range(Player3,30) !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7029) // "Antidote" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player3,10070) // "Target" GiveItem("POTN20",Player3) // Antidote END IF ActionListEmpty() StateCheck(Player4,STATE_POISONED) HasItem("POTN20",Myself) // Antidote !HasItem("POTN20",Player4) // Antidote !HasItem("POTN17",Player4) // Elixir of Health Range(Player4,30) !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7029) // "Antidote" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player4,10070) // "Target" GiveItem("POTN20",Player4) // Antidote END IF ActionListEmpty() StateCheck(Player5,STATE_POISONED) HasItem("POTN20",Myself) // Antidote !HasItem("POTN20",Player5) // Antidote !HasItem("POTN17",Player5) // Elixir of Health Range(Player5,30) !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7029) // "Antidote" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player5,10070) // "Target" GiveItem("POTN20",Player5) // Antidote END IF ActionListEmpty() StateCheck(Player6,STATE_POISONED) HasItem("POTN20",Myself) // Antidote !HasItem("POTN20",Player6) // Antidote !HasItem("POTN17",Player6) // Elixir of Health Range(Player6,30) !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7029) // "Antidote" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player6,10070) // "Target" GiveItem("POTN20",Player6) // Antidote END // Pass Elixir of Health. IF ActionListEmpty() // Needs it? StateCheck(Player1,STATE_POISONED) // We have a potion but they don't? HasItem("POTN17",Myself) // Elixir of Health !HasItem("POTN20",Player1) // Antidote !HasItem("POTN17",Player1) // Elixir of Health !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 // Pass a potion. //DisplayStringHead(Myself,7011) // "Elixir of Health" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player1,10070) // "Target" GiveItem("POTN17",Player1) // Elixir of Health END IF ActionListEmpty() StateCheck(Player2,STATE_POISONED) HasItem("POTN17",Myself) // Elixir of Health !HasItem("POTN20",Player2) // Antidote !HasItem("POTN17",Player2) // Elixir of Health !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7011) // "Elixir of Health" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player2,10070) // "Target" GiveItem("POTN17",Player2) // Elixir of Health END IF ActionListEmpty() StateCheck(Player3,STATE_POISONED) HasItem("POTN17",Myself) // Elixir of Health !HasItem("POTN20",Player3) // Antidote !HasItem("POTN17",Player3) // Elixir of Health !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7011) // "Elixir of Health" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player3,10070) // "Target" GiveItem("POTN17",Player3) // Elixir of Health END IF ActionListEmpty() StateCheck(Player4,STATE_POISONED) HasItem("POTN17",Myself) // Elixir of Health !HasItem("POTN20",Player4) // Antidote !HasItem("POTN17",Player4) // Elixir of Health !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7011) // "Elixir of Health" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player4,10070) // "Target" GiveItem("POTN17",Player4) // Elixir of Health END IF ActionListEmpty() StateCheck(Player5,STATE_POISONED) HasItem("POTN17",Myself) // Elixir of Health !HasItem("POTN20",Player5) // Antidote !HasItem("POTN17",Player5) // Elixir of Health !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7011) // "Elixir of Health" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player5,10070) // "Target" GiveItem("POTN17",Player5) // Elixir of Health END IF ActionListEmpty() StateCheck(Player6,STATE_POISONED) HasItem("POTN17",Myself) // Elixir of Health !HasItem("POTN20",Player6) // Antidote !HasItem("POTN17",Player6) // Elixir of Health !HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) OR(2) !HasItem("AMUL22",Myself) // Periapt of Proof Against Poison GlobalGT("XyxPOPAPUsed","LOCALS",0) OR(2) !HasItem("BRAC20",Myself) // Gloves of Healing GlobalGT("XyxGlovesOfHealingUsed","LOCALS",0) THEN RESPONSE #100 //DisplayStringHead(Myself,7011) // "Elixir of Health" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player6,10070) // "Target" GiveItem("POTN17",Player6) // Elixir of Health END // ============================================================================ // Heal people: [F]ix damage. // // Cast healing spells for a few rounds. // ============================================================================ // ---------------------------------------------------------------------------- // Setup. // ---------------------------------------------------------------------------- // PC: If nobody is hurt, say so. IF HotKey(F) // [F]ix InPartySlot(Myself,0) // Everybody whole? HPPercent(Player1,100) OR(2) HPPercent(Player2,100) !Exists(Player2) OR(2) HPPercent(Player3,100) !Exists(Player3) OR(2) HPPercent(Player4,100) !Exists(Player4) OR(2) HPPercent(Player5,100) !Exists(Player5) OR(2) HPPercent(Player6,100) !Exists(Player6) THEN RESPONSE #100 DisplayStringHead(Myself,24156) // "We need nothing at this time." // Continue to the block below (for what it's worth.) Continue() END // If nobody is hurt, stop. IF HotKey(F) // [F]ix // Everybody whole? HPPercent(Player1,100) OR(2) HPPercent(Player2,100) !Exists(Player2) OR(2) HPPercent(Player3,100) !Exists(Player3) OR(2) HPPercent(Player4,100) !Exists(Player4) OR(2) HPPercent(Player5,100) !Exists(Player5) OR(2) HPPercent(Player6,100) !Exists(Player6) THEN RESPONSE #100 // Stop. Let the HotKey clear up before continuing. NoAction() END // PC: Ask for healing. IF HotKey(F) // [F]ix InPartySlot(Myself,0) THEN RESPONSE #100 VerbalConstant(Myself,HURT) // Hurt Continue() END // Even non-healers need to be able to keep checking this timer to see if // they're supposed to un-hide or something. IF HotKey(F) // [F]ix THEN RESPONSE #100 // Start checking. SetGlobalTimer("XyxCheckHealingDoneTimer","LOCALS",120) // Continue, but note that the timer will not yet be registered during // this script run. Continue() END // PC: If done healing, say so. IF ActionListEmpty() InPartySlot(Myself,0) GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") // Everybody whole? HPPercent(Player1,100) OR(2) HPPercent(Player2,100) !Exists(Player2) OR(2) HPPercent(Player3,100) !Exists(Player3) OR(2) HPPercent(Player4,100) !Exists(Player4) OR(2) HPPercent(Player5,100) !Exists(Player5) OR(2) HPPercent(Player6,100) !Exists(Player6) THEN RESPONSE #100 DisplayStringHead(Myself,14022) // "Healed" SetGlobalTimer("XyxCheckHealingDoneTimer","LOCALS",0) // Continue to the block below in case we're not just checking but also // healing. Continue() END // If done healing, stop. IF ActionListEmpty() GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Everybody whole? HPPercent(Player1,100) OR(2) HPPercent(Player2,100) !Exists(Player2) OR(2) HPPercent(Player3,100) !Exists(Player3) OR(2) HPPercent(Player4,100) !Exists(Player4) OR(2) HPPercent(Player5,100) !Exists(Player5) OR(2) HPPercent(Player6,100) !Exists(Player6) THEN RESPONSE #100 SetGlobalTimer("XyxHealTimer","LOCALS",0) SetGlobalTimer("XyxCheckHealingDoneTimer","LOCALS",0) // Stop. Let the script restart. END // Invisible people reveal themselves to receive healing. IF HotKey(F) // [F]ix // Invisible? StateCheck(Myself,STATE_INVISIBLE) // We can just become invisible again if we randomly break it? OR(2) Global("XyxStealthFlag","LOCALS",1) HasItemEquipedReal("STAF11",Myself) // Staff of the Magi // Can't break improved invisibility, so don't bother. !StateCheck(Myself,STATE_IMPROVEDINVISIBILITY) // Need healing? OR(2) HPPercentLT(Myself,100) StateCheck(Myself,STATE_POISONED) THEN RESPONSE #100 DisplayStringHead(Myself,4188) // "Leaving Shadows" SetDialogue("") PlayerDialogue(Myself) Continue() END // ---------------------------------------------------------------------------- // Warn of various conditions. // ---------------------------------------------------------------------------- // PC: Warn of invisibility. IF HotKey(F) // [F]ix InPartySlot(Myself,0) // Anyone hurt AND improved invisible? HPPercentLT(Player1,100) OR(2) StateCheck(Player1,STATE_INVISIBLE) StateCheck(Player1,STATE_IMPROVEDINVISIBILITY) // Don't warn about people hidden in shadows or holding the Staff of the Magi; // they're supposed to sort that out themselves. !Class(Player1,MONK) !Class(Player1,RANGER_ALL) !Class(Player1,THIEF_ALL) !HasItemEquipedReal("STAF11",Player1) // Staff of the Magi THEN RESPONSE #100 DisplayStringHead(Player1,46529) // "Spell Cancelled: Can not target spells on invisible or sanctuaried creatures." Continue() END IF HotKey(F) // [F]ix InPartySlot(Myself,0) HPPercentLT(Player2,100) OR(2) StateCheck(Player2,STATE_INVISIBLE) StateCheck(Player2,STATE_IMPROVEDINVISIBILITY) !Class(Player2,MONK) !Class(Player2,RANGER_ALL) !Class(Player2,THIEF_ALL) !HasItemEquipedReal("STAF11",Player2) // Staff of the Magi THEN RESPONSE #100 DisplayStringHead(Player2,46529) // "Spell Cancelled: Can not target spells on invisible or sanctuaried creatures." Continue() END IF HotKey(F) // [F]ix InPartySlot(Myself,0) HPPercentLT(Player3,100) OR(2) StateCheck(Player3,STATE_INVISIBLE) StateCheck(Player3,STATE_IMPROVEDINVISIBILITY) !Class(Player3,MONK) !Class(Player3,RANGER_ALL) !Class(Player3,THIEF_ALL) !HasItemEquipedReal("STAF11",Player3) // Staff of the Magi THEN RESPONSE #100 DisplayStringHead(Player3,46529) // "Spell Cancelled: Can not target spells on invisible or sanctuaried creatures." Continue() END IF HotKey(F) // [F]ix InPartySlot(Myself,0) HPPercentLT(Player4,100) OR(2) StateCheck(Player4,STATE_INVISIBLE) StateCheck(Player4,STATE_IMPROVEDINVISIBILITY) !Class(Player4,MONK) !Class(Player4,RANGER_ALL) !Class(Player4,THIEF_ALL) !HasItemEquipedReal("STAF11",Player4) // Staff of the Magi THEN RESPONSE #100 DisplayStringHead(Player4,46529) // "Spell Cancelled: Can not target spells on invisible or sanctuaried creatures." Continue() END IF HotKey(F) // [F]ix InPartySlot(Myself,0) HPPercentLT(Player5,100) OR(2) StateCheck(Player5,STATE_INVISIBLE) StateCheck(Player5,STATE_IMPROVEDINVISIBILITY) !Class(Player5,MONK) !Class(Player5,RANGER_ALL) !Class(Player5,THIEF_ALL) !HasItemEquipedReal("STAF11",Player5) // Staff of the Magi THEN RESPONSE #100 DisplayStringHead(Player5,46529) // "Spell Cancelled: Can not target spells on invisible or sanctuaried creatures." Continue() END IF HotKey(F) // [F]ix InPartySlot(Myself,0) HPPercentLT(Player6,100) OR(2) StateCheck(Player6,STATE_INVISIBLE) StateCheck(Player6,STATE_IMPROVEDINVISIBILITY) !Class(Player6,MONK) !Class(Player6,RANGER_ALL) !Class(Player6,THIEF_ALL) !HasItemEquipedReal("STAF11",Player6) // Staff of the Magi THEN RESPONSE #100 DisplayStringHead(Player6,46529) // "Spell Cancelled: Can not target spells on invisible or sanctuaried creatures." Continue() END // If not a healer, stop here. IF HotKey(F) // [F]ix // Not a healer? !Class(Myself,CLERIC_ALL) !Class(Myself,DRUID_ALL) !Class(Myself,MONK) OR(2) !Class(Myself,PALADIN_ALL) // Note: Kit(Myself,INQUISITOR) fails if compiled in Near Infinity. Kit(Myself,16) // Inquisitor !Class(Myself,RANGER_ALL) !Range("mazzy",0) // No potions either? OR(2) GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HasItem("POTN08",Myself) // Potion of Healing OR(2) GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HasItem("POTN52",Myself) // Potion of Extra Healing OR(2) GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HasItem("POTN55",Myself) // Potion of Superior Healing THEN RESPONSE #100 // Stop. Let the script restart. // // This should also un-hide sneakers. NoAction() END // If silenced, "say" so. IF HotKey(F) // [F]ix StateCheck(Myself,STATE_SILENCED) THEN RESPONSE #100 DisplayStringHead(Myself,14676) // "Silenced" // Stop. Let the HotKey clear up before continuing. END // If there's a chance of spell failure, say so. IF HotKey(F) // [F]ix CheckStatGT(Myself,0,SPELLFAILUREPRIEST) THEN RESPONSE #100 DisplayStringHead(Myself,8307) // "Spell Failure" // Stop. Let the HotKey clear up before continuing. END // If there's a chance of a wild surge, say so. IF HotKey(F) // [F]ix CheckStatGT(Myself,0,SURGEMOD) THEN RESPONSE #100 DisplayStringHead(Myself,58021) // "Wild Magic Zone" // Stop. Let the HotKey clear up before continuing. END // ---------------------------------------------------------------------------- // Wrap-up. // ---------------------------------------------------------------------------- // If out of healing spells even before we begin, say so. // // Note that there is a corner case where if the party is only slightly injured // and the priest only has Heal, the script will not report to be out of spells. // There won't be any healing done either, though, which might be a hint. IF HotKey(F) // [F]ix // Out of healing? !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) !HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) !HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) !HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS) !HaveSpell(CLERIC_MASS_CURE) !HaveSpell(CLERIC_HEAL) !HaveSpell(CLERIC_WONDROUS_RECALL) !HaveSpell(3101) // Cure Light Wounds (Bhaalpower) !HaveSpell(4211) // Lay On Hands (Paladin) // Mazzy can't use Lay On Hands on others. OR(2) !HaveSpell(3827) // Lay On Hands (Mazzy) HPPercent(Myself,100) // Monks can't use Lay On Hands on others. OR(2) !HaveSpell(4815) // Lay On Hands (Monk) HPPercent(Myself,100) // No potions or scrolls either? OR(2) GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HasItem("POTN08",Myself) // Potion of Healing OR(2) GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HasItem("POTN52",Myself) // Potion of Extra Healing OR(2) GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HasItem("POTN55",Myself) // Potion of Superior Healing // Not shapeshifted? Can't tell we're out of healing until we shift. !HaveSpellRES("SPIN122") // Shapeshifts Natural Form (Avenger) !HaveSpellRES("SPIN123") // Shapeshifts Natural Form (Druid) !HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) !HaveSpellRES("SPINHUM") // Shapeshifts Natural Form (Elemental Transformation) !HaveSpellRES("SPWI490") // Shapeshifts Natural Form (Polymorph Self) !HaveSpellRES("SPWI491") // Shapeshifts Natural Form (Cloak of the Sewers) THEN RESPONSE #100 DisplayStringHead(Myself,13649) // "You'll get nothing from me!" SetGlobalTimer("XyxHealTimer","LOCALS",0) // Stop. Let the HotKey clear up before continuing. END // If healing spells ran out, say so. IF ActionListEmpty() // Supposed to be healing? GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Out of healing? !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) !HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) !HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) !HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS) !HaveSpell(CLERIC_MASS_CURE) !HaveSpell(CLERIC_HEAL) !HaveSpell(CLERIC_WONDROUS_RECALL) !HaveSpell(3101) // Cure Light Wounds (Bhaalpower) !HaveSpell(4211) // Lay On Hands (Paladin) // Mazzy can't use Lay On Hands on others. OR(2) !HaveSpell(3827) // Lay On Hands (Mazzy) HPPercent(Myself,100) // Monks can't use Lay On Hands on others. OR(2) !HaveSpell(4815) // Lay On Hands (Monk) HPPercent(Myself,100) // No potions either? OR(2) GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HasItem("POTN08",Myself) // Potion of Healing OR(2) GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HasItem("POTN52",Myself) // Potion of Extra Healing OR(2) GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HasItem("POTN55",Myself) // Potion of Superior Healing // Not shapeshifted? Can't tell we're out of healing until we shift. !HaveSpellRES("SPIN122") // Shapeshifts Natural Form (Avenger) !HaveSpellRES("SPIN123") // Shapeshifts Natural Form (Druid) !HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) !HaveSpellRES("SPINHUM") // Shapeshifts Natural Form (Elemental Transformation) !HaveSpellRES("SPWI490") // Shapeshifts Natural Form (Polymorph Self) !HaveSpellRES("SPWI491") // Shapeshifts Natural Form (Cloak of the Sewers) THEN RESPONSE #100 DisplayStringHead(Myself,51079) // "That is all I can do for you." SetGlobalTimer("XyxHealTimer","LOCALS",0) // Stop. END // If we got this far, say that we'll do it and start doing it. IF HotKey(F) // [F]ix THEN RESPONSE #100 DisplayStringHead(Myself,12138) // "Healing" SetGlobalTimer("XyxHealTimer","LOCALS",120) // Reset warnings. SetGlobalTimer("XyxShapeshiftedWarningTimer","LOCALS",0) Continue() END // ---------------------------------------------------------------------------- // Figure out who's hurt. // // First try to find someone who has sustained any damage at all, then try to // "upgrade" to someone more in need of healing. // // Some notes about targeting... // - LastSeenBy targeting is prone to mess-ups and very hard to debug entirely. // - LastSeenBy targeting requires a script restart if Continue() is used... // - Nearest([PC]) returns Myself, but SecondNearest([PC]) does not return the // person standing next to me, making them impossible to target this way. // - Targeting Player1-6 does not require line-of-sight. // ---------------------------------------------------------------------------- // Look for someone with less than 100% hit points. IF ActionListEmpty() // We're supposed to be looking for someone to heal. // // Check both the hotkey and the timer. The timer isn't actually registered // until the script restarts, which takes a second. We want healing NOW! OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Is this person hurt? HPPercentLT(Player1,100) // Not untargetable? OR(2) !StateCheck(Player1,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,0) // Target. See(Player1) // Don't actually go through with it. This is just a targeting routine. False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player2,100) OR(2) !StateCheck(Player2,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,1) See(Player2) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player3,100) OR(2) !StateCheck(Player3,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,2) See(Player3) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player4,100) OR(2) !StateCheck(Player4,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,3) See(Player4) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player5,100) OR(2) !StateCheck(Player5,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,4) See(Player5) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player6,100) OR(2) !StateCheck(Player6,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,5) See(Player6) False() THEN RESPONSE #100 END // Look for someone with less than 90% hit points. IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player1,90) OR(2) !StateCheck(Player1,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,0) See(Player1) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player2,90) OR(2) !StateCheck(Player2,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,1) See(Player2) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player3,90) OR(2) !StateCheck(Player3,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,2) See(Player3) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player4,90) OR(2) !StateCheck(Player4,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,3) See(Player4) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player5,90) OR(2) !StateCheck(Player5,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,4) See(Player5) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player6,90) OR(2) !StateCheck(Player6,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,5) See(Player6) False() THEN RESPONSE #100 END // Look for someone with less than 90% hit points. IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player1,70) OR(2) !StateCheck(Player1,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,0) See(Player1) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player2,70) OR(2) !StateCheck(Player2,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,1) See(Player2) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player3,70) OR(2) !StateCheck(Player3,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,2) See(Player3) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player4,70) OR(2) !StateCheck(Player4,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,3) See(Player4) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player5,70) OR(2) !StateCheck(Player5,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,4) See(Player5) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player6,70) OR(2) !StateCheck(Player6,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,5) See(Player6) False() THEN RESPONSE #100 END // Look for someone with less than 90% hit points. IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player1,40) OR(2) !StateCheck(Player1,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,0) See(Player1) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player2,40) OR(2) !StateCheck(Player2,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,1) See(Player2) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player3,40) OR(2) !StateCheck(Player3,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,2) See(Player3) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player4,40) OR(2) !StateCheck(Player4,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,3) See(Player4) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player5,40) OR(2) !StateCheck(Player5,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,4) See(Player5) False() THEN RESPONSE #100 END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Player6,40) OR(2) !StateCheck(Player6,STATE_IMPROVEDINVISIBILITY) InPartySlot(Myself,5) See(Player6) False() THEN RESPONSE #100 END // When all's said and done, if I'm hurt myself, I'll heal myself. This cuts // down on "overkill" healing. IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(Myself,100) See(Myself) False() THEN RESPONSE #100 END // If we could not find a valid target, say so. IF HotKey(F) // [F]ix OR(3) // Target lost? !See(LastSeenBy()) // Couldn't see anyone with injuries? HPPercent(LastSeenBy(),100) // Wrong target? !InParty(LastSeenBy()) THEN RESPONSE #100 DisplayStringHead(Myself,24231) // "I fear I cannot. You will have to get someone else." //DisplayStringHead(LastSeenBy(),10070) // "Target" // Stop. END // ---------------------------------------------------------------------------- // Special case healing // // While ignoring the alacrity timer would be practical in that it would allow // the player to see who's going to do what, it would also increase the risk of // overhealing. // // Cast Heal before Mass Cure. It's annoying to see Mass Cure being followed // by Heal when Heal followed by Cure Light Wounds would have sufficed. // // Cast Mass Cure before moving in to cast targeted healing. // ---------------------------------------------------------------------------- // Heal (all Hit Points). // // Only for the really heavy duty cases. IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(CLERIC_HEAL) // Bad enough to warrant Heal? Must try to heal at least 50 hit points. // // 200+ hit points. HPPercentLT(LastSeenBy(),76) // 150-199 hit points. OR(2) CheckStatGT(LastSeenBy(),199,MAXHITPOINTS) HPPercentLT(LastSeenBy(),67) // 125-149 hit points. OR(2) CheckStatGT(LastSeenBy(),149,MAXHITPOINTS) HPPercentLT(LastSeenBy(),61) // 100-124 hit points. OR(2) CheckStatGT(LastSeenBy(),124,MAXHITPOINTS) HPPercentLT(LastSeenBy(),51) // 75-99 hit points. OR(2) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) // This is bad enough regardless. HPPercentLT(LastSeenBy(),34) // Can cast? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 //DisplayStringHead(Myself,1453) // "Heal" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_HEAL) END // Mass Cure // // Cast if there are two or more injured people. IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Can cast? HaveSpell(CLERIC_MASS_CURE) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // At least two injured? // // Check by seeing if there's at least one injured in each group that does // not include a specific person. OR(5) //HPPercentLT(Player1,100) HPPercentLT(Player2,100) HPPercentLT(Player3,100) HPPercentLT(Player4,100) HPPercentLT(Player5,100) HPPercentLT(Player6,100) OR(5) HPPercentLT(Player1,100) //HPPercentLT(Player2,100) HPPercentLT(Player3,100) HPPercentLT(Player4,100) HPPercentLT(Player5,100) HPPercentLT(Player6,100) OR(5) HPPercentLT(Player1,100) HPPercentLT(Player2,100) //HPPercentLT(Player3,100) HPPercentLT(Player4,100) HPPercentLT(Player5,100) HPPercentLT(Player6,100) OR(5) HPPercentLT(Player1,100) HPPercentLT(Player2,100) HPPercentLT(Player3,100) //HPPercentLT(Player4,100) HPPercentLT(Player5,100) HPPercentLT(Player6,100) OR(5) HPPercentLT(Player1,100) HPPercentLT(Player2,100) HPPercentLT(Player3,100) HPPercentLT(Player4,100) //HPPercentLT(Player5,100) HPPercentLT(Player6,100) OR(5) HPPercentLT(Player1,100) HPPercentLT(Player2,100) HPPercentLT(Player3,100) HPPercentLT(Player4,100) HPPercentLT(Player5,100) //HPPercentLT(Player6,100) THEN RESPONSE #100 //DisplayStringHead(Myself,7468) // "Mass Cure" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) // Just target self, assuming we're near others. Spell(Myself,CLERIC_MASS_CURE) END // Move to the heal target. This extra step is taken to give the healer a // second chance to avoid overhealing. IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Have close range healing? OR(7) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS) HaveSpell(CLERIC_HEAL) HaveSpell(3101) // Cure Light Wounds (Bhaalpower) HaveSpell(4211) // Lay On Hands (Paladin) // Out of healing range. This is the actual range at which the healer will // not take another step. !Range(LastSeenBy(),2) // Double-check valid target. See(LastSeenBy()) HPPercentLT(LastSeenBy(),100) InParty(LastSeenBy()) // Maybe this should not be checked, since it would save time to walk during // the alacrity cooldown, but it may lead to people taking their sweet time to // realize that the party is fully healed. // ToDo: //!GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") THEN RESPONSE #100 //DisplayStringHead(Myself,25621) // "I'll be on my way." //DisplayStringHead(LastSeenBy(),10070) // "Target" MoveToObject(LastSeenBy()) END // ---------------------------------------------------------------------------- // Targeted healing // ---------------------------------------------------------------------------- // Cure Critical Wounds (27 Hit Points). IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS) HPPercentLT(LastSeenBy(),100) // It's either bad enough (not healed by Cure Serious Wounds), or we have no // other healing spell anyway. OR(3) HPPercentLT(LastSeenBy(),84) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) !HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) OR(3) HPPercentLT(LastSeenBy(),84) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) !HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) OR(3) HPPercentLT(LastSeenBy(),84) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) OR(2) HPPercentLT(LastSeenBy(),92) !HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) OR(2) HPPercentLT(LastSeenBy(),92) !HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) OR(2) HPPercentLT(LastSeenBy(),92) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // Can cast? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 //DisplayStringHead(Myself,12116) // "Cure Critical Wounds" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_CURE_CRITICAL_WOUNDS) END // Cure Serious Wounds (17 Hit Points). IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) HPPercentLT(LastSeenBy(),100) // It's either bad enough (not healed by Cure Medium Wounds), or we have no // other healing spell anyway. OR(3) HPPercentLT(LastSeenBy(),86) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) !HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) OR(3) HPPercentLT(LastSeenBy(),86) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) OR(2) HPPercentLT(LastSeenBy(),94) !HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) OR(2) HPPercentLT(LastSeenBy(),94) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // Can cast? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 //DisplayStringHead(Myself,12114) // "Cure Serious Wounds" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_CURE_SERIOUS_WOUNDS) END // Cure Medium Wounds (14 Hit Points). IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) HPPercentLT(LastSeenBy(),100) // It's either bad enough (not healed by Cure Light Wounds), or we have no // other healing spell anyway. OR(3) HPPercentLT(LastSeenBy(),92) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) OR(2) HPPercentLT(LastSeenBy(),96) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // Can cast? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 //DisplayStringHead(Myself,3350) // "Cure Medium Wounds" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_CURE_MEDIUM_WOUNDS) END // Lay On Hands (Paladin, 2 hit points per level, max 68) // // Assume average of 32 (four Cure Light Wounds). IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(4211) // Lay On Hands (Paladin) // It's either bad, or we have no Cure Light Wounds left. OR(3) HPPercentLT(LastSeenBy(),69) CheckStatGT(LastSeenBy(),99,MAXHITPOINTS) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) OR(2) HPPercentLT(LastSeenBy(),85) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // Can cast? !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),4211) // Lay On Hands (Paladin) END // Mazzy Special // // Lay On Hands (Mazzy, 2 hit points per level, max 40, self only!) // // Mazzy has Fighter hit points and this is useful in a fight, so don't waste // it. Require at least a few hit points healed. IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(3827) // Lay On Hands (Mazzy) // Not a complete waste? HPPercentLT(Myself,95) // Can cast? !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Self only! Range(Myself,0) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,3827) // Lay On Hands (Mazzy) END // Lay On Hands (Monk, 2 hit points per level, max 40, self only!) // // This is useful in a fight, so don't waste it. Require at least a few hit // points healed. // // Make sure to do this before the Cure Light Wounds Bhaalpower. IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(4815) // Lay On Hands (Monk) // Not a complete waste? HPPercentLT(Myself,95) // Can cast? !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Self only! Range(Myself,0) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,4815) // Lay On Hands (Monk) END // Cure Light Wounds (8 Hit Points). IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // It's always "bad enough" for a Cure Light Wounds. HPPercentLT(LastSeenBy(),100) // Can cast? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 //DisplayStringHead(Myself,6620) // "Cure Light Wounds" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),CLERIC_CURE_LIGHT_WOUNDS) END // Cure Light Wounds (Bhaalpower, 8 hit points). IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(3101) // Cure Light Wounds (Bhaalpower) // It's always "bad enough" for a Cure Light Wounds. HPPercentLT(LastSeenBy(),100) // Can cast? !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(LastSeenBy(),3101) // Cure Light Wounds (Bhaalpower) END // Wondrous Recall // // If all else fails, see if we can recover some healing spells. IF ActionListEmpty() // Should cast? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HaveSpell(CLERIC_WONDROUS_RECALL) HPPercentLT(LastSeenBy(),100) // Can cast? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") THEN RESPONSE #100 //DisplayStringHead(Myself,38573) // "Wondrous Recall" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,CLERIC_WONDROUS_RECALL) END // Gloves of Healing: In backpack or bag (assume they're never worn.) IF ActionListEmpty() // Should use? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") HPPercentLT(LastSeenBy(),100) // Can use? HasItem("BRAC20",Myself) // Gloves of Healing GlobalLT("XyxGlovesOfHealingUsed","LOCALS",1) !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") OR(2) !StateCheck(LastSeenBy(),STATE_IMPROVEDINVISIBILITY) Range(LastSeenBy(),0) THEN RESPONSE #100 DisplayString(Myself,7986) // "Gloves of Healing" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) IncrementGlobal("XyxGlovesOfHealingUsed","LOCALS",1) // Take it out of the Bag of Holding, if necessary. //GiveItem("BRAC20",Myself) // Gloves of Healing UseItem("BRAC20",LastSeenBy()) // Gloves of Healing END // ============================================================================ // Healing potions // // This rather bloated section handles the drinking and passing of healing // potions when the party is ordered to heal. It has mostly been written for // the cute factor, but is actually quite nice to have later in the game. // // Notes: // - Do not start passing until we run out of Cure Light Wounds. // - Don't drink unless we're using at least half the potion. // - Drink the biggest potions first. That allows for topping off with smaller // potions. We're not overhealing much anyway. // - Can't drink potions from a Potion Case or Bag of Holding. Give potion to // ourself before drinking. // // Additional requirements: // - Pass potions to everyone that needs them, not just the most wounded party // member. // - Do hurry up about it. Hand out at least one potion every script run if // possible and needed. // - Do not get stuck on one person before passing to others. // - Do not wait for anyone's alacrity before passing, including our own. // // The only implementation that meets all these requirements requires at least // 18 blocks; Player1-6 for each type of potion. // // This section is archived here in case I ever need it again: // // Allowed to ask for a bigger potion? // OR(2) // GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING // !HasItem("POTN52",Myself) // Potion of Extra Healing // OR(2) // GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING // !HasItem("POTN55",Myself) // Potion of Superior Healing // ============================================================================ // ---------------------------------------------------------------------------- // [D]rink potions // // Set the maximum size of potion that will be used. // // This is a global setting. Only Player1 gets to set it. // ---------------------------------------------------------------------------- // Cycle Nothing to Potion of Healing. IF HotKey(D) // [D]rink InPartySlot(Myself,0) Global("XyxPotionLevel","GLOBAL",0) // NOTHING THEN RESPONSE #100 SetGlobal("XyxPotionLevel","GLOBAL",1) // HEALING DisplayStringHead(Myself,6990) // "Potion of Healing" END // Cycle Potion of Healing to Potion of Extra Healing. IF HotKey(D) // [D]rink InPartySlot(Myself,0) Global("XyxPotionLevel","GLOBAL",1) // HEALING THEN RESPONSE #100 SetGlobal("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING DisplayStringHead(Myself,18893) // "Potion of Extra Healing" END // Cycle Potion of Extra Healing to Potion of Superior Healing. IF HotKey(D) // [D]rink InPartySlot(Myself,0) Global("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING THEN RESPONSE #100 SetGlobal("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING DisplayStringHead(Myself,64945) // "Potion of Superior Healing" END // Cycle Potion of Superior Healing back to Nothing. IF HotKey(D) // [D]rink InPartySlot(Myself,0) Global("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING THEN RESPONSE #100 SetGlobal("XyxPotionLevel","GLOBAL",0) // NOTHING DisplayStringHead(Myself,15506) // "Nothing." END // ---------------------------------------------------------------------------- // Potion of Superior Healing (40 hit points) // ---------------------------------------------------------------------------- // Use Potion of Superior Healing. IF ActionListEmpty() // Should use? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING // Can use? !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") HasItem("POTN55",Myself) // Potion of Superior Healing HPPercentLT(Myself,91) OR(2) HPLT(Myself,31) CheckStatGT(Myself,50,MAXHITPOINTS) OR(2) HPLT(Myself,56) CheckStatGT(Myself,75,MAXHITPOINTS) OR(2) HPLT(Myself,81) CheckStatGT(Myself,100,MAXHITPOINTS) OR(2) HPLT(Myself,106) CheckStatGT(Myself,125,MAXHITPOINTS) OR(2) HPLT(Myself,131) CheckStatGT(Myself,150,MAXHITPOINTS) OR(2) HPLT(Myself,156) CheckStatGT(Myself,175,MAXHITPOINTS) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) // Take it out of a container, if necessary. GiveItem("POTN55",Myself) // "Potion of Superior Healing" //DisplayStringHead(Myself,46150) // "quaffs a potion" DisplayString(Myself,64945) // "Potion of Superior Healing" UseItem("POTN55",Myself) // "Potion of Superior Healing" END // Pass Potion of Superior Healing. IF ActionListEmpty() // Should pass? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING // Don't pass until we're out of healing spells. !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // Could pass? HasItem("POTN55",Myself) // Potion of Superior Healing Range(Player1,30) // Needs it? !HasItem("POTN55",Player1) // Potion of Superior Healing !HasItem("POTN52",Player1) // Potion of Extra Healing !HasItem("POTN08",Player1) // Potion of Healing HPPercentLT(Player1,91) OR(2) HPLT(Player1,31) CheckStatGT(Player1,50,MAXHITPOINTS) OR(2) HPLT(Player1,56) CheckStatGT(Player1,75,MAXHITPOINTS) OR(2) HPLT(Player1,81) CheckStatGT(Player1,100,MAXHITPOINTS) OR(2) HPLT(Player1,106) CheckStatGT(Player1,125,MAXHITPOINTS) OR(2) HPLT(Player1,131) CheckStatGT(Player1,150,MAXHITPOINTS) OR(2) HPLT(Player1,156) CheckStatGT(Player1,175,MAXHITPOINTS) THEN RESPONSE #100 // Pass a potion. //DisplayStringHead(Myself,64945) // "Potion of Superior Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player1,10070) // "Target" GiveItem("POTN55",Player1) // Potion of Superior Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN55",Myself) // Potion of Superior Healing Range(Player2,30) !HasItem("POTN55",Player2) // Potion of Superior Healing !HasItem("POTN52",Player2) // Potion of Extra Healing !HasItem("POTN08",Player2) // Potion of Healing HPPercentLT(Player2,91) OR(2) HPLT(Player2,31) CheckStatGT(Player2,50,MAXHITPOINTS) OR(2) HPLT(Player2,56) CheckStatGT(Player2,75,MAXHITPOINTS) OR(2) HPLT(Player2,81) CheckStatGT(Player2,100,MAXHITPOINTS) OR(2) HPLT(Player2,106) CheckStatGT(Player2,125,MAXHITPOINTS) OR(2) HPLT(Player2,131) CheckStatGT(Player2,150,MAXHITPOINTS) OR(2) HPLT(Player2,156) CheckStatGT(Player2,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,64945) // "Potion of Superior Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player2,10070) // "Target" GiveItem("POTN55",Player2) // Potion of Superior Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN55",Myself) // Potion of Superior Healing Range(Player3,30) !HasItem("POTN55",Player3) // Potion of Superior Healing !HasItem("POTN52",Player3) // Potion of Extra Healing !HasItem("POTN08",Player3) // Potion of Healing HPPercentLT(Player3,91) OR(2) HPLT(Player3,31) CheckStatGT(Player3,50,MAXHITPOINTS) OR(2) HPLT(Player3,56) CheckStatGT(Player3,75,MAXHITPOINTS) OR(2) HPLT(Player3,81) CheckStatGT(Player3,100,MAXHITPOINTS) OR(2) HPLT(Player3,106) CheckStatGT(Player3,125,MAXHITPOINTS) OR(2) HPLT(Player3,131) CheckStatGT(Player3,150,MAXHITPOINTS) OR(2) HPLT(Player3,156) CheckStatGT(Player3,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,64945) // "Potion of Superior Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player3,10070) // "Target" GiveItem("POTN55",Player3) // Potion of Superior Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN55",Myself) // Potion of Superior Healing Range(Player4,30) !HasItem("POTN55",Player4) // Potion of Superior Healing !HasItem("POTN52",Player4) // Potion of Extra Healing !HasItem("POTN08",Player4) // Potion of Healing HPPercentLT(Player4,91) OR(2) HPLT(Player4,31) CheckStatGT(Player4,50,MAXHITPOINTS) OR(2) HPLT(Player4,56) CheckStatGT(Player4,75,MAXHITPOINTS) OR(2) HPLT(Player4,81) CheckStatGT(Player4,100,MAXHITPOINTS) OR(2) HPLT(Player4,106) CheckStatGT(Player4,125,MAXHITPOINTS) OR(2) HPLT(Player4,131) CheckStatGT(Player4,150,MAXHITPOINTS) OR(2) HPLT(Player4,156) CheckStatGT(Player4,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,64945) // "Potion of Superior Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player4,10070) // "Target" GiveItem("POTN55",Player4) // Potion of Superior Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN55",Myself) // Potion of Superior Healing Range(Player5,30) !HasItem("POTN55",Player5) // Potion of Superior Healing !HasItem("POTN52",Player5) // Potion of Extra Healing !HasItem("POTN08",Player5) // Potion of Healing HPPercentLT(Player5,91) OR(2) HPLT(Player5,31) CheckStatGT(Player5,50,MAXHITPOINTS) OR(2) HPLT(Player5,56) CheckStatGT(Player5,75,MAXHITPOINTS) OR(2) HPLT(Player5,81) CheckStatGT(Player5,100,MAXHITPOINTS) OR(2) HPLT(Player5,106) CheckStatGT(Player5,125,MAXHITPOINTS) OR(2) HPLT(Player5,131) CheckStatGT(Player5,150,MAXHITPOINTS) OR(2) HPLT(Player5,156) CheckStatGT(Player5,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,64945) // "Potion of Superior Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player5,10070) // "Target" GiveItem("POTN55",Player5) // Potion of Superior Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",3) // SUPERIOR HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN55",Myself) // Potion of Superior Healing Range(Player6,30) !HasItem("POTN55",Player6) // Potion of Superior Healing !HasItem("POTN52",Player6) // Potion of Extra Healing !HasItem("POTN08",Player6) // Potion of Healing HPPercentLT(Player6,91) OR(2) HPLT(Player6,31) CheckStatGT(Player6,50,MAXHITPOINTS) OR(2) HPLT(Player6,56) CheckStatGT(Player6,75,MAXHITPOINTS) OR(2) HPLT(Player6,81) CheckStatGT(Player6,100,MAXHITPOINTS) OR(2) HPLT(Player6,106) CheckStatGT(Player6,125,MAXHITPOINTS) OR(2) HPLT(Player6,131) CheckStatGT(Player6,150,MAXHITPOINTS) OR(2) HPLT(Player6,156) CheckStatGT(Player6,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,64945) // "Potion of Superior Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player6,10070) // "Target" GiveItem("POTN55",Player6) // Potion of Superior Healing END // ---------------------------------------------------------------------------- // Potion of Extra Healing (27 hit points) // ---------------------------------------------------------------------------- // Use Potion of Extra Healing. IF ActionListEmpty() // Should use? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING // Can use? !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") HasItem("POTN52",Myself) // Potion of Extra Healing // Bad enough? HPPercentLT(Myself,94) OR(2) HPLT(Myself,37) CheckStatGT(Myself,50,MAXHITPOINTS) OR(2) HPLT(Myself,62) CheckStatGT(Myself,75,MAXHITPOINTS) OR(2) HPLT(Myself,87) CheckStatGT(Myself,100,MAXHITPOINTS) OR(2) HPLT(Myself,112) CheckStatGT(Myself,125,MAXHITPOINTS) OR(2) HPLT(Myself,127) CheckStatGT(Myself,150,MAXHITPOINTS) OR(2) HPLT(Myself,162) CheckStatGT(Myself,175,MAXHITPOINTS) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) // Take it out of a container, if necessary. GiveItem("POTN52",Myself) // Potion of Extra Healing //DisplayStringHead(Myself,46150) // "quaffs a potion" DisplayString(Myself,18893) // "Potion of Extra Healing" UseItem("POTN52",Myself) // Potion of Extra Healing END // Pass Potion of Extra Healing. IF ActionListEmpty() // Should pass? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING // Don't pass until we're out of healing spells. !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // Could pass? HasItem("POTN52",Myself) // Potion of Extra Healing Range(Player1,30) // Needs it? !HasItem("POTN52",Player1) // Potion of Extra Healing !HasItem("POTN08",Player1) // Potion of Healing HPPercentLT(Player1,94) OR(2) HPLT(Player1,37) CheckStatGT(Player1,50,MAXHITPOINTS) OR(2) HPLT(Player1,62) CheckStatGT(Player1,75,MAXHITPOINTS) OR(2) HPLT(Player1,87) CheckStatGT(Player1,100,MAXHITPOINTS) OR(2) HPLT(Player1,112) CheckStatGT(Player1,125,MAXHITPOINTS) OR(2) HPLT(Player1,127) CheckStatGT(Player1,150,MAXHITPOINTS) OR(2) HPLT(Player1,162) CheckStatGT(Player1,175,MAXHITPOINTS) THEN RESPONSE #100 // Pass a potion. //DisplayStringHead(Myself,18893) // "Potion of Extra Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player1,10070) // "Target" GiveItem("POTN52",Player1) // Potion of Extra Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN52",Myself) // Potion of Extra Healing Range(Player2,30) !HasItem("POTN52",Player2) // Potion of Extra Healing !HasItem("POTN08",Player2) // Potion of Healing HPPercentLT(Player2,94) OR(2) HPLT(Player2,37) CheckStatGT(Player2,50,MAXHITPOINTS) OR(2) HPLT(Player2,62) CheckStatGT(Player2,75,MAXHITPOINTS) OR(2) HPLT(Player2,87) CheckStatGT(Player2,100,MAXHITPOINTS) OR(2) HPLT(Player2,112) CheckStatGT(Player2,125,MAXHITPOINTS) OR(2) HPLT(Player2,127) CheckStatGT(Player2,150,MAXHITPOINTS) OR(2) HPLT(Player2,162) CheckStatGT(Player2,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,18893) // "Potion of Extra Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player2,10070) // "Target" GiveItem("POTN52",Player2) // Potion of Extra Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN52",Myself) // Potion of Extra Healing Range(Player3,30) !HasItem("POTN52",Player3) // Potion of Extra Healing !HasItem("POTN08",Player3) // Potion of Healing HPPercentLT(Player3,94) OR(2) HPLT(Player3,37) CheckStatGT(Player3,50,MAXHITPOINTS) OR(2) HPLT(Player3,62) CheckStatGT(Player3,75,MAXHITPOINTS) OR(2) HPLT(Player3,87) CheckStatGT(Player3,100,MAXHITPOINTS) OR(2) HPLT(Player3,112) CheckStatGT(Player3,125,MAXHITPOINTS) OR(2) HPLT(Player3,127) CheckStatGT(Player3,150,MAXHITPOINTS) OR(2) HPLT(Player3,162) CheckStatGT(Player3,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,18893) // "Potion of Extra Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player3,10070) // "Target" GiveItem("POTN52",Player3) // Potion of Extra Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN52",Myself) // Potion of Extra Healing Range(Player4,30) !HasItem("POTN52",Player4) // Potion of Extra Healing !HasItem("POTN08",Player4) // Potion of Healing HPPercentLT(Player4,94) OR(2) HPLT(Player4,37) CheckStatGT(Player4,50,MAXHITPOINTS) OR(2) HPLT(Player4,62) CheckStatGT(Player4,75,MAXHITPOINTS) OR(2) HPLT(Player4,87) CheckStatGT(Player4,100,MAXHITPOINTS) OR(2) HPLT(Player4,112) CheckStatGT(Player4,125,MAXHITPOINTS) OR(2) HPLT(Player4,127) CheckStatGT(Player4,150,MAXHITPOINTS) OR(2) HPLT(Player4,162) CheckStatGT(Player4,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,18893) // "Potion of Extra Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player4,10070) // "Target" GiveItem("POTN52",Player4) // Potion of Extra Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN52",Myself) // Potion of Extra Healing Range(Player5,30) !HasItem("POTN52",Player5) // Potion of Extra Healing !HasItem("POTN08",Player5) // Potion of Healing HPPercentLT(Player5,94) OR(2) HPLT(Player5,37) CheckStatGT(Player5,50,MAXHITPOINTS) OR(2) HPLT(Player5,62) CheckStatGT(Player5,75,MAXHITPOINTS) OR(2) HPLT(Player5,87) CheckStatGT(Player5,100,MAXHITPOINTS) OR(2) HPLT(Player5,112) CheckStatGT(Player5,125,MAXHITPOINTS) OR(2) HPLT(Player5,127) CheckStatGT(Player5,150,MAXHITPOINTS) OR(2) HPLT(Player5,162) CheckStatGT(Player5,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,18893) // "Potion of Extra Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player5,10070) // "Target" GiveItem("POTN52",Player5) // Potion of Extra Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",2) // EXTRA HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN52",Myself) // Potion of Extra Healing Range(Player6,30) !HasItem("POTN52",Player6) // Potion of Extra Healing !HasItem("POTN08",Player6) // Potion of Healing HPPercentLT(Player6,94) OR(2) HPLT(Player6,37) CheckStatGT(Player6,50,MAXHITPOINTS) OR(2) HPLT(Player6,62) CheckStatGT(Player6,75,MAXHITPOINTS) OR(2) HPLT(Player6,87) CheckStatGT(Player6,100,MAXHITPOINTS) OR(2) HPLT(Player6,112) CheckStatGT(Player6,125,MAXHITPOINTS) OR(2) HPLT(Player6,127) CheckStatGT(Player6,150,MAXHITPOINTS) OR(2) HPLT(Player6,162) CheckStatGT(Player6,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,18893) // "Potion of Extra Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player6,10070) // "Target" GiveItem("POTN52",Player6) // Potion of Extra Healing END // ---------------------------------------------------------------------------- // Potion of Healing (9 hit points) // ---------------------------------------------------------------------------- // Use Potion of Healing. IF ActionListEmpty() // Should use? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING // Can use? !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") HasItem("POTN08",Myself) // Potion of Healing // Bad enough? HPPercentLT(Myself,99) OR(2) HPLT(Myself,47) CheckStatGT(Myself,50,MAXHITPOINTS) OR(2) HPLT(Myself,72) CheckStatGT(Myself,75,MAXHITPOINTS) OR(2) HPLT(Myself,97) CheckStatGT(Myself,100,MAXHITPOINTS) OR(2) HPLT(Myself,122) CheckStatGT(Myself,125,MAXHITPOINTS) OR(2) HPLT(Myself,147) CheckStatGT(Myself,150,MAXHITPOINTS) OR(2) HPLT(Myself,172) CheckStatGT(Myself,175,MAXHITPOINTS) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) // Take it out of a container, if necessary. GiveItem("POTN08",Myself) // Potion of Healing //DisplayStringHead(Myself,46150) // "quaffs a potion" DisplayString(Myself,6990) // "Potion of Healing" UseItem("POTN08",Myself) // Potion of Healing END // Pass Potion of Healing. IF ActionListEmpty() // Should pass? OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING // Don't pass until we're out of healing spells. !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) // Could pass? HasItem("POTN08",Myself) // Potion of Healing Range(Player1,30) // Needs it? !HasItem("POTN08",Player1) // Potion of Healing HPPercentLT(Player1,99) OR(2) HPLT(Player1,47) CheckStatGT(Player1,50,MAXHITPOINTS) OR(2) HPLT(Player1,72) CheckStatGT(Player1,75,MAXHITPOINTS) OR(2) HPLT(Player1,97) CheckStatGT(Player1,100,MAXHITPOINTS) OR(2) HPLT(Player1,122) CheckStatGT(Player1,125,MAXHITPOINTS) OR(2) HPLT(Player1,147) CheckStatGT(Player1,150,MAXHITPOINTS) OR(2) HPLT(Player1,172) CheckStatGT(Player1,175,MAXHITPOINTS) THEN RESPONSE #100 // Pass a potion. //DisplayStringHead(Myself,6990) // "Potion of Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player1,10070) // "Target" GiveItem("POTN08",Player1) // Potion of Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN08",Myself) // Potion of Healing Range(Player2,30) !HasItem("POTN08",Player2) // Potion of Healing HPPercentLT(Player2,99) OR(2) HPLT(Player2,47) CheckStatGT(Player2,50,MAXHITPOINTS) OR(2) HPLT(Player2,72) CheckStatGT(Player2,75,MAXHITPOINTS) OR(2) HPLT(Player2,97) CheckStatGT(Player2,100,MAXHITPOINTS) OR(2) HPLT(Player2,122) CheckStatGT(Player2,125,MAXHITPOINTS) OR(2) HPLT(Player2,147) CheckStatGT(Player2,150,MAXHITPOINTS) OR(2) HPLT(Player2,172) CheckStatGT(Player2,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,6990) // "Potion of Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player2,10070) // "Target" GiveItem("POTN08",Player2) // Potion of Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN08",Myself) // Potion of Healing Range(Player3,30) !HasItem("POTN08",Player3) // Potion of Healing HPPercentLT(Player3,99) OR(2) HPLT(Player3,47) CheckStatGT(Player3,50,MAXHITPOINTS) OR(2) HPLT(Player3,72) CheckStatGT(Player3,75,MAXHITPOINTS) OR(2) HPLT(Player3,97) CheckStatGT(Player3,100,MAXHITPOINTS) OR(2) HPLT(Player3,122) CheckStatGT(Player3,125,MAXHITPOINTS) OR(2) HPLT(Player3,147) CheckStatGT(Player3,150,MAXHITPOINTS) OR(2) HPLT(Player3,172) CheckStatGT(Player3,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,6990) // "Potion of Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player3,10070) // "Target" GiveItem("POTN08",Player3) // Potion of Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN08",Myself) // Potion of Healing Range(Player4,30) !HasItem("POTN08",Player4) // Potion of Healing HPPercentLT(Player4,99) OR(2) HPLT(Player4,47) CheckStatGT(Player4,50,MAXHITPOINTS) OR(2) HPLT(Player4,72) CheckStatGT(Player4,75,MAXHITPOINTS) OR(2) HPLT(Player4,97) CheckStatGT(Player4,100,MAXHITPOINTS) OR(2) HPLT(Player4,122) CheckStatGT(Player4,125,MAXHITPOINTS) OR(2) HPLT(Player4,147) CheckStatGT(Player4,150,MAXHITPOINTS) OR(2) HPLT(Player4,172) CheckStatGT(Player4,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,6990) // "Potion of Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player4,10070) // "Target" GiveItem("POTN08",Player4) // Potion of Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN08",Myself) // Potion of Healing Range(Player5,30) !HasItem("POTN08",Player5) // Potion of Healing HPPercentLT(Player5,99) OR(2) HPLT(Player5,47) CheckStatGT(Player5,50,MAXHITPOINTS) OR(2) HPLT(Player5,72) CheckStatGT(Player5,75,MAXHITPOINTS) OR(2) HPLT(Player5,97) CheckStatGT(Player5,100,MAXHITPOINTS) OR(2) HPLT(Player5,122) CheckStatGT(Player5,125,MAXHITPOINTS) OR(2) HPLT(Player5,147) CheckStatGT(Player5,150,MAXHITPOINTS) OR(2) HPLT(Player5,172) CheckStatGT(Player5,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,6990) // "Potion of Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player5,10070) // "Target" GiveItem("POTN08",Player5) // Potion of Healing END IF ActionListEmpty() OR(2) HotKey(F) // [F]ix GlobalTimerNotExpired("XyxCheckHealingDoneTimer","LOCALS") !GlobalLT("XyxPotionLevel","GLOBAL",1) // HEALING !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) HasItem("POTN08",Myself) // Potion of Healing Range(Player6,30) !HasItem("POTN08",Player6) // Potion of Healing HPPercentLT(Player6,99) OR(2) HPLT(Player6,47) CheckStatGT(Player6,50,MAXHITPOINTS) OR(2) HPLT(Player6,72) CheckStatGT(Player6,75,MAXHITPOINTS) OR(2) HPLT(Player6,97) CheckStatGT(Player6,100,MAXHITPOINTS) OR(2) HPLT(Player6,122) CheckStatGT(Player6,125,MAXHITPOINTS) OR(2) HPLT(Player6,147) CheckStatGT(Player6,150,MAXHITPOINTS) OR(2) HPLT(Player6,172) CheckStatGT(Player6,175,MAXHITPOINTS) THEN RESPONSE #100 //DisplayStringHead(Myself,6990) // "Potion of Healing" //DisplayStringHead(Myself,72433) // "(Hey! I have the healing potions! I heal you!)" //DisplayStringHead(Player6,10070) // "Target" GiveItem("POTN08",Player6) // Potion of Healing END // ============================================================================ // Traps: [K]illzone // // Set 6 or so traps. // ============================================================================ // ---------------------------------------------------------------------------- // Setup. // ---------------------------------------------------------------------------- // If we cannot even begin, say so. IF HotKey(K) // [K]illzone Class(Myself,THIEF_ALL) // Out of traps? !HaveSpell(4412) // Set Snare !HaveSpell(4414) // Set Special Snare !HaveSpell(4910) // Set Spike Trap !HaveSpell(4911) // Set Exploding Trap !HaveSpell(4912) // Set Time Trap THEN RESPONSE #100 DisplayStringHead(Myself,13649) // "You'll get nothing from me!" // Restart the script. END // If we're done, say so. IF ActionListEmpty() // Was I placing traps? Class(Myself,THIEF_ALL) GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") // Done? Global("XyxTrapsToSetCounter","GLOBAL",0) THEN RESPONSE #100 DisplayStringHead(Myself,15441) // "I am ready." SetGlobalTimer("XyxSetTrapsTimer","LOCALS",0) SetGlobal("XyxTrapsToSetCounter","GLOBAL",0) // Restart the script. END // If we ran out, say so. IF ActionListEmpty() // Should I be placing traps? Class(Myself,THIEF_ALL) GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") GlobalGT("XyxTrapsToSetCounter","GLOBAL",0) // Out of traps? !HaveSpell(4412) // Set Snare !HaveSpell(4414) // Set Special Snare !HaveSpell(4910) // Set Spike Trap !HaveSpell(4911) // Set Exploding Trap !HaveSpell(4912) // Set Time Trap THEN RESPONSE #100 DisplayStringHead(Myself,51079) // "That is all I can do for you." // Reset the timer, but don't touch the global counter. SetGlobalTimer("XyxSetTrapsTimer","LOCALS",0) // Restart the script. END // Set a bunch of traps. // // We try to set 6 traps. However, the actual number of traps set depends on // several factors: // - If multiple people place a trap at once, the last one to execute his or // her script may reset the counter to 6 even after the others have // decremented the counter. // - Multiple people may try to place the last trap simultaneously. // - People can fail, and the script won't notice. // // Try to place one "tactical" trap (Time Trap, Exploding Trap or Special Snare, // in that order), and then as many "damage" traps as possible (first Spike // Traps, if available, then Snares). If insufficient traps of a certain type // are available, use whatever we have left. IF HotKey(K) // [K]illzone Class(Myself,THIEF_ALL) THEN RESPONSE #100 DisplayStringHead(Myself,36351) // "Set Snare" // Global counter so multiple people can set traps. //DisplayString(Myself,40739) // "My local is 6" SetGlobal("XyxTrapsToSetCounter","GLOBAL",6) // Local timer so if one person runs out of traps, another can still keep // going. SetGlobalTimer("XyxSetTrapsTimer","LOCALS",60) Continue() END // ---------------------------------------------------------------------------- // Tactical traps. // ---------------------------------------------------------------------------- // Special Snare (Bounty Hunter) IF ActionListEmpty() // Should place traps? Class(Myself,THIEF_ALL) OR(2) HotKey(K) // [K]illzone GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") OR(2) HotKey(K) // [K]illzone GlobalGT("XyxTrapsToSetCounter","GLOBAL",0) HaveSpell(4414) // Set Special Snare // Either we haven't set a tactical trap yet, or this is all we have left. OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4412) // Set Snare OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4910) // Set Spike Trap OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4911) // Set Exploding Trap OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4912) // Set Time Trap THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxSetSpecialTrapTimer","LOCALS",33) //DisplayStringHead(Myself,52927) // "Set Special Snare" Spell(Myself,4414) // Set Special Snare IncrementGlobal("XyxTrapsToSetCounter","GLOBAL",-1) END // Time Trap IF ActionListEmpty() // Should place traps? Class(Myself,THIEF_ALL) OR(2) HotKey(K) // [K]illzone GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") OR(2) HotKey(K) // [K]illzone GlobalGT("XyxTrapsToSetCounter","GLOBAL",0) HaveSpell(4912) // Set Time Trap // Either we haven't set a tactical trap yet, or this is all we have left. OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4412) // Set Snare OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4414) // Set Special Snare OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4910) // Set Spike Trap OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4911) // Set Exploding Trap THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxSetSpecialTrapTimer","LOCALS",33) //DisplayStringHead(Myself,63990) // "Set Time Trap" Spell(Myself,4912) // Set Time Trap IncrementGlobal("XyxTrapsToSetCounter","GLOBAL",-1) END // Exploding Trap IF ActionListEmpty() // Should place traps? Class(Myself,THIEF_ALL) OR(2) HotKey(K) // [K]illzone GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") OR(2) HotKey(K) // [K]illzone GlobalGT("XyxTrapsToSetCounter","GLOBAL",0) HaveSpell(4911) // Set Exploding Trap // Either we haven't set a tactical trap yet, or this is all we have left. OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4412) // Set Snare OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4414) // Set Special Snare OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4910) // Set Spike Trap OR(2) !GlobalTimerNotExpired("XyxSetSpecialTrapTimer","LOCALS") !HaveSpell(4912) // Set Time Trap THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxSetSpecialTrapTimer","LOCALS",33) //DisplayStringHead(Myself,63991) // "Set Exploding Trap" Spell(Myself,4911) // Set Exploding Trap IncrementGlobal("XyxTrapsToSetCounter","GLOBAL",-1) END // ---------------------------------------------------------------------------- // Damage traps. // ---------------------------------------------------------------------------- // Spike Trap IF ActionListEmpty() // Should place traps? Class(Myself,THIEF_ALL) OR(2) HotKey(K) // [K]illzone GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") OR(2) HotKey(K) // [K]illzone GlobalGT("XyxTrapsToSetCounter","GLOBAL",0) // Disregard the alacrity timer; we want to look busy. HaveSpell(4910) // Set Spike Trap THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) //DisplayStringHead(Myself,63989) // "Set Spike Trap" Spell(Myself,4910) // Set Spike Trap IncrementGlobal("XyxTrapsToSetCounter","GLOBAL",-1) END // Snare IF ActionListEmpty() // Should place traps? Class(Myself,THIEF_ALL) OR(2) HotKey(K) // [K]illzone GlobalTimerNotExpired("XyxSetTrapsTimer","LOCALS") OR(2) HotKey(K) // [K]illzone GlobalGT("XyxTrapsToSetCounter","GLOBAL",0) // Disregard the alacrity timer; we want to look busy. HaveSpell(4412) // Set Snare THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) //DisplayStringHead(Myself,36351) // "Set Snare" Spell(Myself,4412) // Set Snare IncrementGlobal("XyxTrapsToSetCounter","GLOBAL",-1) END // ============================================================================ // Noncombat stuff. // // None of this checks the alacrity timer. That way, you can tell someone is // trying to do something before they start by looking at their selection // reticle. // ============================================================================ // Girdle of Fortitude IF ActionListEmpty() // Have it? (doesn't have to be equipped) HasItem("BELT09",Myself) // Girdle of Fortitude // Can use? GlobalLT("XyxGirdleOfFortitudeUsed","LOCALS",1) // It's identified? (no cheating!) CheckStatLT(Myself,18,CON) PartyHasItemIdentified("BELT09") // Girdle of Fortitude // Do not check alacrity. THEN RESPONSE #100 DisplayString(Myself,7591) // "Girdle of Fortitude" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) IncrementGlobal("XyxGirdleOfFortitudeUsed","LOCALS",1) UseItem("BELT09",Myself) // Girdle of Fortitude END // Armor. IF ActionListEmpty() // Need it? !GlobalTimerNotExpired("XyxArmorTimer","LOCALS") // Can cast it? HaveSpell(WIZARD_ARMOR) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREMAGE) CheckStat(Myself,0,SURGEMOD) // Do not check alacrity. // Cowled Wizards check. OR(68) // Not in an enforced area. !AreaCheck("AR0020") // City Gates !AreaCheck("AR0300") // Docks !AreaCheck("AR0400") // Slums !AreaCheck("AR0500") // Bridge !AreaCheck("AR0700") // Waukeen's Promenade !AreaCheck("AR0900") // Temple !AreaCheck("AR1000") // Government !AreaCheck("AR0021") !AreaCheck("AR0022") !AreaCheck("AR0313") !AreaCheck("AR0314") !AreaCheck("AR0318") !AreaCheck("AR0319") !AreaCheck("AR0325") !AreaCheck("AR0326") !AreaCheck("AR0330") !AreaCheck("AR0332") !AreaCheck("AR0333") !AreaCheck("AR0334") !AreaCheck("AR0335") !AreaCheck("AR0402") !AreaCheck("AR0403") !AreaCheck("AR0408") !AreaCheck("AR0409") !AreaCheck("AR0501") !AreaCheck("AR0504") !AreaCheck("AR0505") !AreaCheck("AR0506") !AreaCheck("AR0507") !AreaCheck("AR0508") !AreaCheck("AR0509") !AreaCheck("AR0510") !AreaCheck("AR0511") !AreaCheck("AR0512") !AreaCheck("AR0513") !AreaCheck("AR0514") !AreaCheck("AR0515") !AreaCheck("AR0522") !AreaCheck("AR0523") !AreaCheck("AR0525") !AreaCheck("AR0526") !AreaCheck("AR0527") !AreaCheck("AR0528") !AreaCheck("AR0529") !AreaCheck("AR0530") !AreaCheck("AR0531") !AreaCheck("AR0702") !AreaCheck("AR0703") !AreaCheck("AR0704") !AreaCheck("AR0706") !AreaCheck("AR0901") !AreaCheck("AR0902") !AreaCheck("AR0903") !AreaCheck("AR0904") !AreaCheck("AR0905") !AreaCheck("AR1000") !AreaCheck("AR1001") !AreaCheck("AR1002") !AreaCheck("AR1003") !AreaCheck("AR1004") !AreaCheck("AR1005") !AreaCheck("AR1006") !AreaCheck("AR1007") !AreaCheck("AR1009") !AreaCheck("AR1010") // Currently fighting Cowled Wizards (there's a 5 minute delay before more // enforcers will show up.) GlobalTimerNotExpired("SpellsBad","GLOBAL") // Paid the bribe. !Global("BribedCowled","GLOBAL",0) // Crushed the Cowled Wizards. GlobalGT("CowledWarning","GLOBAL",6) THEN RESPONSE #100 //DisplayStringHead(Myself,11997) // "Armor" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) // Duration: 9 hours SetGlobalTimer("XyxArmorTimer","LOCALS",2700) Spell(Myself,WIZARD_ARMOR) END // Iron Skins // // Note that this spell has a casting time of 1 round, unlike Stoneskin, so it // is not very practical in the midst of battle. The risk of the script // casting it at an inopportune time and the spell being disrupted is too great. IF ActionListEmpty() // Need it? CheckStatLT(Myself,1,STONESKINS) // Can cast it? HaveSpell(CLERIC_IRONSKIN) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) // Do not check alacrity. // If prepping, let the prep block handle it instead. !GlobalTimerNotExpired("XyxPrepTimer","LOCALS") THEN RESPONSE #100 //DisplayStringHead(Myself,8270) // "Iron Skins" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,CLERIC_IRONSKIN) END // Wondrous Recall // // Druids have only two level 5 spells they REALLY should memorize. For // Clerics, things aren't as black and white. IF ActionListEmpty() HaveSpell(CLERIC_WONDROUS_RECALL) // Can cast Druid spells? OR(2) Class(Myself,DRUID_ALL) Class(Myself,RANGER_ALL) // Out of good level 5 Druid spells? !HaveSpell(CLERIC_IRONSKIN) !HaveSpell(CLERIC_INSECT_PLAGUE) // Can cast? !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) // Do not check alacrity. THEN RESPONSE #100 //DisplayStringHead(Myself,38573) // "Wondrous Recall" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,CLERIC_WONDROUS_RECALL) END // Gargoyle Boots (level 2 Stoneskin) // // Using the boots takes several seconds. Not worth it in combat. IF ActionListEmpty() // Need it? CheckStatLT(Myself,1,STONESKINS) // Have it? (doesn't have to be equipped) HasItem("BOOT12",Myself) // Gargoyle Boots // 2 charges per day. GlobalLT("XyxGargoyleBootsUsed","LOCALS",2) // If prepping, let the prep block handle it instead. !GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Do not check alacrity. THEN RESPONSE #100 DisplayString(Myself,65054) // "Gargoyle Boots" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) IncrementGlobal("XyxGargoyleBootsUsed","LOCALS",1) UseItem("BOOT12",Myself) // Gargoyle Boots END // Create Bruiser Mates. IF ActionListEmpty() // Only if we still bother lugging around the Flasher Launcher. HasItem("XBOW12",Myself) // Flasher Launcher // Can cast it? HaveSpell(3829) // Create Bruiser Mates (SPIN829) // Do not check alacrity. THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,3829) // Create Bruiser Mates (SPIN829) END // ============================================================================ // On-demand prep: [B]edtime for the night. // // Cast all spells with duration > 8 hours, in reverse order of duration. // // Ignore the alacrity timer so that we can see when we're done. // // All stoneskin related stuff (Stoneskin, Gargoyle Boots and Iron Skins) uses // the same timer so they won't overlap. // ============================================================================ // PC: Say we'll start prepping. IF HotKey(B) // [B]edtime InPartySlot(Myself,0) THEN RESPONSE #100 VerbalConstant(Myself,TIRED) // Tired // No "Head" string, just a text area one. DisplayString(Myself,58548) // "I wish to be prepared for anything." // Do the actual starting in the block below. Continue() END // Start prepping. IF HotKey(B) // [B]edtime THEN RESPONSE #100 // Reset reminders. SetGlobal("XyxReminderMinorSequencerFlag","LOCALS",0) SetGlobal("XyxReminderSpellSequencerFlag","LOCALS",0) SetGlobal("XyxReminderSpellTriggerFlag","LOCALS",0) // Reset warnings. SetGlobalTimer("XyxShapeshiftedWarningTimer","LOCALS",0) // Half a minute of prep should suffice. SetGlobalTimer("XyxPrepTimer","LOCALS",30) Continue() END // ---------------------------------------------------------------------------- // Reminders. // // Give reminders when... // - Whenever possible, but not in combat. // - Only once per day. // - Give 'em again when done preparing for [B]edtime. // ---------------------------------------------------------------------------- // Reminder: Minor Sequencer. IF ActionListEmpty() // Could cast? HaveSpell(WIZARD_MINOR_SEQUENCER) !HaveSpellRES("SpWi420D") // Haven't reminded yet? Global("XyxReminderMinorSequencerFlag","LOCALS",0) // Wait until the player is likely to notice. CombatCounter(0) THEN RESPONSE #100 SetGlobal("XyxReminderMinorSequencerFlag","LOCALS",1) DisplayStringHead(Myself,5013) // "Minor Sequencer" // Let the script restart. END // Reminder: Spell Sequencer. IF ActionListEmpty() // Could cast? HaveSpell(WIZARD_SPELL_SEQUENCER) !HaveSpellRES("SpWi710D") // Haven't reminded yet? Global("XyxReminderSpellSequencerFlag","LOCALS",0) // Wait until the player is likely to notice. CombatCounter(0) THEN RESPONSE #100 SetGlobal("XyxReminderSpellSequencerFlag","LOCALS",1) DisplayStringHead(Myself,25951) // "Spell Sequencer" // Let the script restart. END // Reminder: Spell Trigger. IF ActionListEmpty() // Could cast? HaveSpell(WIZARD_SPELL_TRIGGER) !HaveSpellRES("SpWi809D") // Haven't reminded yet? Global("XyxReminderSpellTriggerFlag","LOCALS",0) // Wait until the player is likely to notice. CombatCounter(0) THEN RESPONSE #100 SetGlobal("XyxReminderSpellTriggerFlag","LOCALS",1) DisplayStringHead(Myself,26243) // "Spell Trigger" // Let the script restart. END // ---------------------------------------------------------------------------- // Cast. // ---------------------------------------------------------------------------- // Armor (9 hours). IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") !GlobalTimerNotExpired("XyxPrepArmorTimer","LOCALS") // Can cast it? HaveSpell(WIZARD_ARMOR) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREMAGE) CheckStat(Myself,0,SURGEMOD) // Cowled Wizards check. OR(68) // Not in an enforced area. !AreaCheck("AR0020") // City Gates !AreaCheck("AR0300") // Docks !AreaCheck("AR0400") // Slums !AreaCheck("AR0500") // Bridge !AreaCheck("AR0700") // Waukeen's Promenade !AreaCheck("AR0900") // Temple !AreaCheck("AR1000") // Government !AreaCheck("AR0021") !AreaCheck("AR0022") !AreaCheck("AR0313") !AreaCheck("AR0314") !AreaCheck("AR0318") !AreaCheck("AR0319") !AreaCheck("AR0325") !AreaCheck("AR0326") !AreaCheck("AR0330") !AreaCheck("AR0332") !AreaCheck("AR0333") !AreaCheck("AR0334") !AreaCheck("AR0335") !AreaCheck("AR0402") !AreaCheck("AR0403") !AreaCheck("AR0408") !AreaCheck("AR0409") !AreaCheck("AR0501") !AreaCheck("AR0504") !AreaCheck("AR0505") !AreaCheck("AR0506") !AreaCheck("AR0507") !AreaCheck("AR0508") !AreaCheck("AR0509") !AreaCheck("AR0510") !AreaCheck("AR0511") !AreaCheck("AR0512") !AreaCheck("AR0513") !AreaCheck("AR0514") !AreaCheck("AR0515") !AreaCheck("AR0522") !AreaCheck("AR0523") !AreaCheck("AR0525") !AreaCheck("AR0526") !AreaCheck("AR0527") !AreaCheck("AR0528") !AreaCheck("AR0529") !AreaCheck("AR0530") !AreaCheck("AR0531") !AreaCheck("AR0702") !AreaCheck("AR0703") !AreaCheck("AR0704") !AreaCheck("AR0706") !AreaCheck("AR0901") !AreaCheck("AR0902") !AreaCheck("AR0903") !AreaCheck("AR0904") !AreaCheck("AR0905") !AreaCheck("AR1000") !AreaCheck("AR1001") !AreaCheck("AR1002") !AreaCheck("AR1003") !AreaCheck("AR1004") !AreaCheck("AR1005") !AreaCheck("AR1006") !AreaCheck("AR1007") !AreaCheck("AR1009") !AreaCheck("AR1010") // Currently fighting Cowled Wizards (there's a 5 minute delay before more // enforcers will show up.) GlobalTimerNotExpired("SpellsBad","GLOBAL") // Paid the bribe. !Global("BribedCowled","GLOBAL",0) // Crushed the Cowled Wizards. GlobalGT("CowledWarning","GLOBAL",6) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxPrepArmorTimer","LOCALS",30) // Duration: 9 hours SetGlobalTimer("XyxArmorTimer","LOCALS",2700) Spell(Myself,WIZARD_ARMOR) END // Melf's Minute Meteors (permanent). IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") !GlobalTimerNotExpired("XyxPrepMelfsMinuteMeteorsTimer","LOCALS") // Do not put away the Staff of the Magi if we're in staff style. !Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi // Can cast it? HaveSpell(WIZARD_MELF_METEOR) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREMAGE) CheckStat(Myself,0,SURGEMOD) // Cowled Wizards check. OR(68) // Not in an enforced area. !AreaCheck("AR0020") // City Gates !AreaCheck("AR0300") // Docks !AreaCheck("AR0400") // Slums !AreaCheck("AR0500") // Bridge !AreaCheck("AR0700") // Waukeen's Promenade !AreaCheck("AR0900") // Temple !AreaCheck("AR1000") // Government !AreaCheck("AR0021") !AreaCheck("AR0022") !AreaCheck("AR0313") !AreaCheck("AR0314") !AreaCheck("AR0318") !AreaCheck("AR0319") !AreaCheck("AR0325") !AreaCheck("AR0326") !AreaCheck("AR0330") !AreaCheck("AR0332") !AreaCheck("AR0333") !AreaCheck("AR0334") !AreaCheck("AR0335") !AreaCheck("AR0402") !AreaCheck("AR0403") !AreaCheck("AR0408") !AreaCheck("AR0409") !AreaCheck("AR0501") !AreaCheck("AR0504") !AreaCheck("AR0505") !AreaCheck("AR0506") !AreaCheck("AR0507") !AreaCheck("AR0508") !AreaCheck("AR0509") !AreaCheck("AR0510") !AreaCheck("AR0511") !AreaCheck("AR0512") !AreaCheck("AR0513") !AreaCheck("AR0514") !AreaCheck("AR0515") !AreaCheck("AR0522") !AreaCheck("AR0523") !AreaCheck("AR0525") !AreaCheck("AR0526") !AreaCheck("AR0527") !AreaCheck("AR0528") !AreaCheck("AR0529") !AreaCheck("AR0530") !AreaCheck("AR0531") !AreaCheck("AR0702") !AreaCheck("AR0703") !AreaCheck("AR0704") !AreaCheck("AR0706") !AreaCheck("AR0901") !AreaCheck("AR0902") !AreaCheck("AR0903") !AreaCheck("AR0904") !AreaCheck("AR0905") !AreaCheck("AR1000") !AreaCheck("AR1001") !AreaCheck("AR1002") !AreaCheck("AR1003") !AreaCheck("AR1004") !AreaCheck("AR1005") !AreaCheck("AR1006") !AreaCheck("AR1007") !AreaCheck("AR1009") !AreaCheck("AR1010") // Currently fighting Cowled Wizards (there's a 5 minute delay before more // enforcers will show up.) GlobalTimerNotExpired("SpellsBad","GLOBAL") // Paid the bribe. !Global("BribedCowled","GLOBAL",0) // Crushed the Cowled Wizards. GlobalGT("CowledWarning","GLOBAL",6) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxPrepMelfsMinuteMeteorsTimer","LOCALS",30) Spell(Myself,WIZARD_MELF_METEOR) END // Stoneskin (12 hours). IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") !GlobalTimerNotExpired("XyxPrepStoneskinTimer","LOCALS") // Can cast it? HaveSpell(WIZARD_STONE_SKIN) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREMAGE) CheckStat(Myself,0,SURGEMOD) // Cowled Wizards check. OR(68) // Not in an enforced area. !AreaCheck("AR0020") // City Gates !AreaCheck("AR0300") // Docks !AreaCheck("AR0400") // Slums !AreaCheck("AR0500") // Bridge !AreaCheck("AR0700") // Waukeen's Promenade !AreaCheck("AR0900") // Temple !AreaCheck("AR1000") // Government !AreaCheck("AR0021") !AreaCheck("AR0022") !AreaCheck("AR0313") !AreaCheck("AR0314") !AreaCheck("AR0318") !AreaCheck("AR0319") !AreaCheck("AR0325") !AreaCheck("AR0326") !AreaCheck("AR0330") !AreaCheck("AR0332") !AreaCheck("AR0333") !AreaCheck("AR0334") !AreaCheck("AR0335") !AreaCheck("AR0402") !AreaCheck("AR0403") !AreaCheck("AR0408") !AreaCheck("AR0409") !AreaCheck("AR0501") !AreaCheck("AR0504") !AreaCheck("AR0505") !AreaCheck("AR0506") !AreaCheck("AR0507") !AreaCheck("AR0508") !AreaCheck("AR0509") !AreaCheck("AR0510") !AreaCheck("AR0511") !AreaCheck("AR0512") !AreaCheck("AR0513") !AreaCheck("AR0514") !AreaCheck("AR0515") !AreaCheck("AR0522") !AreaCheck("AR0523") !AreaCheck("AR0525") !AreaCheck("AR0526") !AreaCheck("AR0527") !AreaCheck("AR0528") !AreaCheck("AR0529") !AreaCheck("AR0530") !AreaCheck("AR0531") !AreaCheck("AR0702") !AreaCheck("AR0703") !AreaCheck("AR0704") !AreaCheck("AR0706") !AreaCheck("AR0901") !AreaCheck("AR0902") !AreaCheck("AR0903") !AreaCheck("AR0904") !AreaCheck("AR0905") !AreaCheck("AR1000") !AreaCheck("AR1001") !AreaCheck("AR1002") !AreaCheck("AR1003") !AreaCheck("AR1004") !AreaCheck("AR1005") !AreaCheck("AR1006") !AreaCheck("AR1007") !AreaCheck("AR1009") !AreaCheck("AR1010") // Currently fighting Cowled Wizards (there's a 5 minute delay before more // enforcers will show up.) GlobalTimerNotExpired("SpellsBad","GLOBAL") // Paid the bribe. !Global("BribedCowled","GLOBAL",0) // Crushed the Cowled Wizards. GlobalGT("CowledWarning","GLOBAL",6) THEN RESPONSE #100 SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxPrepStoneskinTimer","LOCALS",30) Spell(Myself,WIZARD_STONE_SKIN) END // Iron Skins (12 hours). IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") !GlobalTimerNotExpired("XyxPrepStoneskinTimer","LOCALS") // Can cast it? HaveSpell(CLERIC_IRONSKIN) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) THEN RESPONSE #100 //DisplayStringHead(Myself,8270) // "Iron Skins" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxPrepStoneskinTimer","LOCALS",30) Spell(Myself,CLERIC_IRONSKIN) END // Wondrous Recall to get back Iron Skins if we didn't have any. IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Can cast Druid spells? OR(2) Class(Myself,DRUID_ALL) Class(Myself,RANGER_ALL) // Couldn't cast Iron Skins. !GlobalTimerNotExpired("XyxPrepStoneskinTimer","LOCALS") // Can get them back? HaveSpell(CLERIC_WONDROUS_RECALL) !StateCheck(Myself,STATE_SILENCED) CheckStat(Myself,0,SPELLFAILUREPRIEST) CheckStat(Myself,0,SURGEMOD) THEN RESPONSE #100 //DisplayStringHead(Myself,38573) // "Wondrous Recall" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) Spell(Myself,CLERIC_WONDROUS_RECALL) END // Gargoyle Boots (12 hours). IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") !GlobalTimerNotExpired("XyxPrepStoneskinsTimer","LOCALS") // Need it? CheckStatLT(Myself,2,STONESKINS) // Have it? (doesn't have to be equipped) HasItem("BOOT12",Myself) // Gargoyle Boots // 2 charges per day. GlobalLT("XyxGargoyleBootsUsed","LOCALS",2) THEN RESPONSE #100 DisplayString(Myself,65054) // "Gargoyle Boots" SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) SetGlobalTimer("XyxPrepStoneskinsTimer","LOCALS",30) IncrementGlobal("XyxGargoyleBootsUsed","LOCALS",1) UseItem("BOOT12",Myself) // Gargoyle Boots END // ---------------------------------------------------------------------------- // Feedback. // ---------------------------------------------------------------------------- // Message when done. IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Done? // Melf's Minute Meteors OR(3) GlobalTimerNotExpired("XyxPrepMelfsMinuteMeteorsTimer","LOCALS") !HaveSpell(WIZARD_MELF_METEOR) Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi // Stoneskin OR(2) GlobalTimerNotExpired("XyxPrepStoneskinTimer","LOCALS") !HaveSpell(WIZARD_STONE_SKIN) // Iron Skins OR(2) GlobalTimerNotExpired("XyxPrepStoneskinTimer","LOCALS") !HaveSpell(CLERIC_IRONSKIN) // Gargoyle Boots OR(3) CheckStatGT(Myself,1,STONESKINS) !HasItem("BOOT12",Myself) // Gargoyle Boots GlobalGT("XyxGargoyleBootsUsed","LOCALS",1) OR(2) GlobalTimerNotExpired("XyxPrepArmorTimer","LOCALS") !HaveSpell(WIZARD_ARMOR) // Don't have to shift back? !HaveSpellRES("SPIN122") // Shapeshifts Natural Form (Avenger) !HaveSpellRES("SPIN123") // Shapeshifts Natural Form (Druid) !HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) !HaveSpellRES("SPINHUM") // Shapeshifts Natural Form (Elemental Transformation) !HaveSpellRES("SPWI490") // Shapeshifts Natural Form (Polymorph Self) !HaveSpellRES("SPWI491") // Shapeshifts Natural Form (Cloak of the Sewers) THEN RESPONSE #100 DisplayStringHead(Myself,15441) // "I am ready." // Stop the timer. SetGlobalTimer("XyxPrepTimer","LOCALS",0) END // Message if the Cowled Wizards kept us from doing something. IF HotKey(B) // [B]edtime // Did I have plans? // // This double OR boils down to: // - Have either Stoneskin, Armor or Melf's Minute Meteors, and the intention to cast it? OR(3) HaveSpell(WIZARD_MELF_METEOR) HaveSpell(WIZARD_STONE_SKIN) HaveSpell(WIZARD_ARMOR) OR(3) // No need to cast Melf's Minute Meteors if we're in staff style. !Global("XyxStyleSetting","LOCALS",4) // Staff of the Magi HaveSpell(WIZARD_STONE_SKIN) HaveSpell(WIZARD_ARMOR) // Enforced area. // (William Imm) More areas added to blacklist. OR(65) AreaCheck("AR0020") // City Gates AreaCheck("AR0300") // Docks AreaCheck("AR0400") // Slums AreaCheck("AR0500") // Bridge AreaCheck("AR0700") // Waukeen's Promenade AreaCheck("AR0900") // Temple AreaCheck("AR1000") // Government AreaCheck("AR0021") AreaCheck("AR0022") AreaCheck("AR0313") AreaCheck("AR0314") AreaCheck("AR0318") AreaCheck("AR0319") AreaCheck("AR0325") AreaCheck("AR0326") AreaCheck("AR0330") AreaCheck("AR0332") AreaCheck("AR0333") AreaCheck("AR0334") AreaCheck("AR0335") AreaCheck("AR0402") AreaCheck("AR0403") AreaCheck("AR0408") AreaCheck("AR0409") AreaCheck("AR0501") AreaCheck("AR0504") AreaCheck("AR0505") AreaCheck("AR0506") AreaCheck("AR0507") AreaCheck("AR0508") AreaCheck("AR0509") AreaCheck("AR0510") AreaCheck("AR0511") AreaCheck("AR0512") AreaCheck("AR0513") AreaCheck("AR0514") AreaCheck("AR0515") AreaCheck("AR0522") AreaCheck("AR0523") AreaCheck("AR0525") AreaCheck("AR0526") AreaCheck("AR0527") AreaCheck("AR0528") AreaCheck("AR0529") AreaCheck("AR0530") AreaCheck("AR0531") AreaCheck("AR0702") AreaCheck("AR0703") AreaCheck("AR0704") AreaCheck("AR0706") AreaCheck("AR0901") AreaCheck("AR0902") AreaCheck("AR0903") AreaCheck("AR0904") AreaCheck("AR0905") AreaCheck("AR1000") AreaCheck("AR1001") AreaCheck("AR1002") AreaCheck("AR1003") AreaCheck("AR1004") AreaCheck("AR1005") AreaCheck("AR1006") AreaCheck("AR1007") AreaCheck("AR1009") AreaCheck("AR1010") // Not paid the bribe. Global("BribedCowled","GLOBAL",0) // Not crushed the Cowled Wizards. GlobalLT("CowledWarning","GLOBAL",7) THEN RESPONSE #100 DisplayStringHead(Myself,16930) // "The Cowled Wizards?" // Stop the timer. SetGlobalTimer("XyxPrepTimer","LOCALS",0) END // Message when not able to do everything for reasons other than Cowled Wizards. // Probably Silence or Spell Failure. IF OR(2) HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Don't have to shift back? !HaveSpellRES("SPIN122") // Shapeshifts Natural Form (Avenger) !HaveSpellRES("SPIN123") // Shapeshifts Natural Form (Druid) !HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) !HaveSpellRES("SPINHUM") // Shapeshifts Natural Form (Elemental Transformation) !HaveSpellRES("SPWI490") // Shapeshifts Natural Form (Polymorph Self) !HaveSpellRES("SPWI491") // Shapeshifts Natural Form (Cloak of the Sewers) THEN RESPONSE #100 DisplayStringHead(Myself,22076) // "I cannot do this." // Stop the timer. SetGlobalTimer("XyxPrepTimer","LOCALS",0) END // ============================================================================ // Cernd Special (also available to other Shapeshifters) // // Shapeshift to Natural Form to prep or heal, then shift back. // // There is no way to see whether Cernd has any spells left before he // shapeshifts, so we just give it a go anyway if he can still shift back. // // One way to double-check if Cernd is actually shapeshifted is this: // HasItem("BRBRP",Myself) // Bear paw // Unfortunately, this is not reliable because this item can be dispelled, even // with the Fixpack installed. // // There's no exact way of detecting the shape Cernd is in, but it's pretty // difficult to get Constitution 25 other than shapeshifting to Greater // Werewolf. // ============================================================================ // Shift to natural form and later back to Werewolf. IF ActionListEmpty() // Note: This must be compiled in Near Infinity. Kit(Myself,SHAPESHIFTER) OR(4) // Should heal? HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Should prep? HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Shapeshifted? HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) // Not already shifted? If we did, it probably won't help to shift again. !GlobalTimerNotExpired("XyxShapeshiftedTimer","LOCALS") // Not Constitution 25 almost certainly means not a Greater Werewolf, // therefore probably Werewolf. !CheckStat(Myself,25,CON) // Can shift back? HaveSpell(4643) // Shapeshifts Werewolf THEN RESPONSE #100 //DisplayStringHead(Myself,25173) // "Shapeshifter" //DisplayStringHead(Myself,22780) // "Werewolf" SetGlobalTimer("XyxShapeshiftToWerewolfTimer","LOCALS",120) // No further attempts are to be made while this timer runs. SetGlobalTimer("XyxShapeshiftedTimer","LOCALS",120) SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) //DisplayStringHead(Myself,11826) // "Shapeshifts Natural Form" SpellRES("SPIN124",Myself) // Shapeshifts Natural Form (Shapeshifter) END // Shift to natural form and later back to Greater Werewolf. IF ActionListEmpty() // Note: This must be compiled in Near Infinity. Kit(Myself,SHAPESHIFTER) OR(4) // Should heal? HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Should prep? HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Shapeshifted? HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) // Not already shifted? If we did, it probably won't help to shift again. !GlobalTimerNotExpired("XyxShapeshiftedTimer","LOCALS") // Constitution 25 almost certainly means a Greater Werewolf. CheckStat(Myself,25,CON) // Can shift back? HaveSpell(4644) // Shapeshifts Greater Werewolf THEN RESPONSE #100 //DisplayStringHead(Myself,25173) // "Shapeshifter" //DisplayStringHead(Myself,22782) // "Greater Werewolf" SetGlobalTimer("XyxShapeshiftToGreaterWerewTimer","LOCALS",120) // No further attempts are to be made while this timer runs. SetGlobalTimer("XyxShapeshiftedTimer","LOCALS",120) SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) //DisplayStringHead(Myself,11826) // "Shapeshifts Natural Form" SpellRES("SPIN124",Myself) // Shapeshifts Natural Form (Shapeshifter) END // Shift back: Werewolf. IF ActionListEmpty() // Was werewolf? GlobalTimerNotExpired("XyxShapeshiftToWerewolfTimer","LOCALS") HaveSpell(4643) // Shapeshifts Werewolf !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Done? !GlobalTimerNotExpired("XyxHealTimer","LOCALS") !GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Not already shapeshifted? !HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) THEN RESPONSE #100 // Note that we shifted back. SetGlobalTimer("XyxShapeshiftToWerewolfTimer","LOCALS",0) SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) //DisplayStringHead(Myself,52637) // "Shapeshifts Werewolf" Spell(Myself,4643) // Shapeshifts Werewolf END // Shift back: Greater Werewolf. IF ActionListEmpty() // Was Greater Werewolf? GlobalTimerNotExpired("XyxShapeshiftToGreaterWerewTimer","LOCALS") HaveSpell(4644) // Shapeshifts Greater Werewolf !GlobalTimerNotExpired("XyxAlacrityTimer","LOCALS") // Done? !GlobalTimerNotExpired("XyxHealTimer","LOCALS") !GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Not already shapeshifted? !HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) THEN RESPONSE #100 // Note that we shifted back. SetGlobalTimer("XyxShapeshiftToGreaterWerewTimer","LOCALS",0) SetGlobalTimer("XyxAlacrityTimer","LOCALS",6) //DisplayStringHead(Myself,52502) // "Shapeshifts Greater Werewolf" Spell(Myself,4644) // Shapeshifts Greater Werewolf END // If shapeshifted and unable to shift back and forth, warn about it. // // Note that if we're supposed to heal or prep, the timer already started, so // things should proceed normally from here if the player shapeshifts back // manually. // // This bit applies to anyone not in their natural form, not just Cernd. IF OR(4) // Should heal? HotKey(F) // [F]ix GlobalTimerNotExpired("XyxHealTimer","LOCALS") // Should prep? HotKey(B) // [B]edtime GlobalTimerNotExpired("XyxPrepTimer","LOCALS") // Shapeshifted? OR(6) HaveSpellRES("SPIN122") // Shapeshifts Natural Form (Avenger) HaveSpellRES("SPIN123") // Shapeshifts Natural Form (Druid) HaveSpellRES("SPIN124") // Shapeshifts Natural Form (Shapeshifter) HaveSpellRES("SPINHUM") // Shapeshifts Natural Form (Elemental Transformation) HaveSpellRES("SPWI490") // Shapeshifts Natural Form (Polymorph Self) HaveSpellRES("SPWI491") // Shapeshifts Natural Form (Cloak of the Sewers) // This one doesn't seem to go away, so don't warn about it. Shapechange is // of limited duration anyway, so it's not a big deal. //HaveSpellRES("SPIN151") // Shapeshifts Natural Form (Shapechange) // Not already warned about it? !GlobalTimerNotExpired("XyxShapeshiftedWarningTimer","LOCALS") THEN RESPONSE #100 DisplayStringHead(Myself,26356) // "Shapechange" SetGlobalTimer("XyxShapeshiftedWarningTimer","LOCALS",120) END // ============================================================================ // Find Traps. // // This block is way down here because it's not as important as combat, and // it's not a big deal if it gets interrupted. Also, unlike the others, this // one's "on" by default. // ============================================================================ // Resume detection. IF // Snaps containers shut otherwise. ActionListEmpty() // Can detect traps? // // Could CheckStatGT(Myself,TRAPS), but Dexterity bonuses may cause non- // trapfinders to have nonzero values there as well. OR(2) Class(Myself,MONK) Class(Myself,THIEF_ALL) !ModalState(DETECTTRAPS) // Not hidden sneakers. Even though doing both at the same time would often // be practical, constantly leaving shadows is annoying and potentially risky. // They can resume trapfinding if stealth fails, though (for instance when // invisible enemies are about.) OR(2) !ModalState(STEALTH) !StateCheck(Myself,STATE_INVISIBLE) THEN RESPONSE #100 FindTraps() END // ============================================================================ // Appendix. // ============================================================================ // ---------------------------------------------------------------------------- // Debug statements. // ---------------------------------------------------------------------------- IF False() THEN RESPONSE #100 DisplayStringHead(Myself,23168) // "The engine is running." DisplayStringHead(Myself,15441) // "I am ready." DisplayStringHead(LastSeenBy(),10070) // "Target" DisplayStringHead(Myself,15506) // "Nothing." DisplayStringHead(Myself,10262) // "Error" DisplayStringHead(Myself,3791) // "Certainly." DisplayStringHead(Myself,26991) // "Not at all." DisplayStringHead(Myself,22408) // "I am ." DisplayStringHead(Myself,11293) // ": Level " DisplayStringHead(Myself,73241) // "Yes sir!" DisplayStringHead(Myself,29108) // "Yes, ." DisplayStringHead(Myself,72808) // "I need healing!" DisplayStringHead(Myself,41242) // "I see." DisplayStringHead(Myself,685) // "RANGED :" DisplayStringHead(LastSeenBy(),14662) // "Poisoned" DisplayStringHead(Myself,28428) // "I will hear you. What is it you wish?" DisplayStringHead(Myself,56794) // "Yes, I hear you. Your thoughts are clear." DisplayStringHead(Myself,25621) // "I'll be on my way." DisplayStringHead(Myself,44267) // "I'm on my way, then." DisplayStringHead(Myself,33657) // "I will help you." DisplayStringHead(Myself,40734) // "My local is 1" DisplayStringHead(Myself,40735) // "My local is 2" DisplayStringHead(Myself,40736) // "My local is 3" DisplayStringHead(Myself,40737) // "My local is 4" DisplayStringHead(Myself,40738) // "My local is 5" DisplayStringHead(Myself,40739) // "My local is 6" // ...up to... DisplayStringHead(Myself,40763) // "My local is 30. I'm done." VerbalConstantHead(Myself,BATTLE_CRY) // Battle cry 1 VerbalConstantHead(Myself,10) // Battle cry 2 VerbalConstantHead(Myself,11) // Battle cry 3 VerbalConstantHead(Myself,DAMAGE) // Damage VerbalConstantHead(Myself,SELECT_COMMON) // Select 1 VerbalConstantHead(Myself,HURT) // Hurt VerbalConstantHead(Myself,27) // Select 2 VerbalConstantHead(Myself,28) // Select 3 VerbalConstantHead(Myself,29) // Select 4 VerbalConstantHead(Myself,30) // Select 5 VerbalConstantHead(Myself,31) // Select 6 VerbalConstantHead(Myself,SELECT_ACTION) // Action 1 VerbalConstantHead(Myself,33) // Action 2 //VerbalConstantHead(Myself,34)) // Action 3 //VerbalConstantHead(Myself,36)) // Action 5 //VerbalConstantHead(Myself,37)) // Action 6 //VerbalConstantHead(Myself,38)) // Action 7 VerbalConstantHead(Myself,63) // Rare select 1 VerbalConstantHead(Myself,64) // Rare select 2 VerbalConstantHead(Myself,65) // Critical hit VerbalConstantHead(Myself,66) // Critical miss VerbalConstantHead(Myself,70) // Hidden END // ---------------------------------------------------------------------------- // Target practice: // // GIBBER01 Gibberling // ORC05 Orog // ORC06 Orog (archer without bow, runs at 75%) // HOBCAP01 Hobgoblin Captain (runs if outnumbered) // KOBCOM01 Kobold Commando (stands and shoots) // NISHRU01 Nishruu // // Useful items: // // POTN48 Poison // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Documentation. // // Reliability of script execution: // - Script may occasionally execute when !ActionListEmpty(). // - Confirmed to happen during long move orders. // - Attack() can get hung up. // - Not confirmed whether the script even runs at all until the target is // dead. // - AttackReevaluate() seems equivalent to Attack(). // - The duration seems to be ignored. // - AttackOneRound() reports ActionListEmpty() every run. // // ActionListEmpty(): // - Not reported during long move orders. // - Not reported while looting containers. // // LastSeenBy(): // - Set by See() and Detect(), not by Exists() or Range(). // // Invisible creatures: // - See(), Detect(), Exists() and Range() all detect visible creatures in // sight radius only, with the following exceptions: // - Detect() will detect an invisible Myself, Player1 or [EVILCUTOFF], but // not NearestEnemyOf(). // - Exists() and Range() will detect an invisible Myself or Player1, and // will detect them out of sight radius. They will still not detect // invisible enemies or visible enemies out of sight radius. // - Note that even See(Myself) only works if you're not invisible. // // Communication: // - Shout() carries throughout the area. // - Help() carries slightly further than sight radius, probably range 40. // - Help() sticks around for 7-12 seconds. // // Continue(): // - Use of Continue() anywhere will cause subsequent empty RESPONSE blocks to // be treated as if they, too, had Continue(). // - Use NoAction() to stop. // - Continue() appears to cause all instances of LastSeenBy() to be set to the // last value set in the current script run. // // NoAction(): // - NoAction() is, apparently, not actually equivalent to no action. See // Continue(): // - NoAction() will not cancel modal actions. Use ClearActions() for that. // Use PlayerDialogue(Myself) to un-hide immediately. // // Update speed: // - LastSeenBy() is set in the current script run, but if Continue() is used, // it will always evaluate to the last value that gets set in the run. // - The values of SetGlobal() and SetGlobalTimer() are set in between script // runs. // - Help() is set in between script runs. // - Heard() is set in between script runs? // - Wait() and SmallWait() do not allow the script to update in the meantime. // // DRUID_ALL: // - It is not worth checking for enemy Druids. There are only a few of them, // and those come in groups. // // Range(): // - You can't get closer than range 8 to huge creatures like dragons. // - Range 4 is melee range. // - Anyone using a ranged weapon at this range suffers -8 to hit. // - Anyone attacking someone using a ranged weapon in melee gains +4 to hit // and damage. // // Melf's Minute Meteors: // - These count as ranged weapons, so they suffer -8 to hit at point blank and // hand out +4 to hit and damage to opponents in melee. They cannot be put // away. // - HasItem("MELFMET",Myself) works. HasItemEquiped(), HasItemEquipedReal() // do not work. // // SelectWeaponAbility(SLOT_WEAPON0,1): // - Haven't seen this produce any results. // // Controlled undead detection: // See([ALLY.UNDEAD]) // Summoned only. // See([CONTROLLED.UNDEAD]) // Controlled only. // See([CHARMED.UNDEAD]) // Nothing. // See([GOODBUTRED.UNDEAD]) // Nothing. // See([GOODCUTOFF.UNDEAD]) // Controlled and summoned. // See([NOTGOOD.UNDEAD]) // Unturned only. // See([NOTEVIL.UNDEAD]) // Controlled and summoned. // See([EVILCUTOFF.UNDEAD]) // Unturned only. // See([EVILBUTGREEN.UNDEAD]) // Nothing. // See([ENEMY.UNDEAD]) // Unturned only. // // Containers (Bag of Holding, Potion Case, etcetera): // - HasItem() works for stuff inside a container. // - GiveItem() works for stuff inside a container. // - UseItem() does NOT work for stuff inside a container. // - To use an item in a container, give it to yourself first. // // OutOfAmmo(): // - Always returns True, even with arrows in all three slots. // // InPartySlot(): // - Player1 is in slot 0, Player2 in slot 1, and so on. // - NOT to be confused with marching order. // // Compound states: // - State values are bit flags and can be added together to check many states // in one StateCheck(). // - To calculate the compound state value, simply add them together and make // sure the result is decimal, not octal. // - Compound states allow for !StateCheck() in an OR(). // - The following works: // StateCheck(Myself,4194320) // Untargetable (STATE_INVISIBLE + STATE_IMPROVEDINVISIBILITY) // - The following (found on the web) does not work: // StateCheck(LastSeenBy(),2148540461) // Compound "disabled" state // // Hide() // - Hiding does not necessarily break long move orders. // // EquipItem() // - Perhaps it would move an item to an appropriate slot, but it will not // switch weapons. // // Timers: // - Names cannot be longer than 32 characters. // // STATE_PANIC: // - This state seems to apply only to creatures that are affected by panic // inducing magic. Creatures that fail their Morale check are not in this // state. // // HasItemSlot(): // // Any empty backpack slots? // OR(16) // !HasItemSlot(Myself,SLOT_MISC3) // !HasItemSlot(Myself,SLOT_MISC4) // !HasItemSlot(Myself,SLOT_MISC5) // !HasItemSlot(Myself,SLOT_MISC6) // !HasItemSlot(Myself,SLOT_MISC7) // !HasItemSlot(Myself,SLOT_MISC8) // !HasItemSlot(Myself,SLOT_MISC9) // !HasItemSlot(Myself,SLOT_MISC10) // !HasItemSlot(Myself,SLOT_MISC11) // !HasItemSlot(Myself,SLOT_MISC12) // !HasItemSlot(Myself,SLOT_MISC13) // !HasItemSlot(Myself,SLOT_MISC14) // !HasItemSlot(Myself,SLOT_MISC15) // !HasItemSlot(Myself,SLOT_MISC16) // !HasItemSlot(Myself,SLOT_MISC17) // !HasItemSlot(Myself,SLOT_MISC18) // ---------------------------------------------------------------------------- // ============================================================================ // EOF // ============================================================================