// ______________________________________________________________________ // // File : ralf.baf // Purpose : Universal controlable script // Time-stamp: // DO NOT EDIT: This script is generated from ralf.m4 // ______________________________________________________________________ // // Control-Keys: // // J = Yell for help // D = Change active NPCs to melee-mode // F = Change active NPCs to ranged-mode // C = Set leader-mode for active NPC // S = Toggle follow-mode // G = Change "yell-for-help"-level // P = Drop everything // V = Spread party // // ______________________________________________________________________ // // Main features: // // * Leader/follow mode: // // All character with active follow-mode follow the current // leader. They only do this if they are 20 steps away // _and_ outside of screen. // // * EquipRanged()/melee mode: // // If NPC is in ranged-mode he runs away from close enemies // and attacks them with ranged weapons. In both modes // NPC switches to melee weapons if enemy gets too close. // // * NPC communication: // // NPCs shout if they are HURT/POISONED/UNDER_ATTACK or // ATTACKING. The other NPCs react on these calls. // // - HURT: // // )',UNBREAK(49,`Depending on',shift(shift(shift(`49',`Depending',`on',`"yell-for-help"-level',`they',`call',`for',`help',`at',`75%/50%/25%',`or',`never.',`They',`only',`yell',`for',`help',`if',`they',`dont',`see',`an',`enemy.',`If',`they',`have',`potions',`they',`use',`them.'))))'),) // - POISONED: // // [...] // // - UNDER_ATTACK: // // [...] // // - ATTACKING: // // [...] // // ______________________________________________________________________ // // Hotkeys: // ====================================================================== // yell for help IF HotKey(J) THEN RESPONSE #100 Shout(HURT) DisplayStringHead(Myself,1453) SetGlobal("rsL_HealState","LOCALS",1) StartTimer(1003,5) Continue() END // ====================================================================== // drop all items IF HotKey(P) THEN RESPONSE #100 DropInventory() RandomWalk() Continue() END // ====================================================================== // switch to melee-mode IF HotKey(D) THEN RESPONSE #100 EquipMostDamagingMelee() SetGlobal("rsL_MeleeAttack","LOCALS",1) Continue() END // ====================================================================== // switch to ranged-mode IF HotKey(F) THEN RESPONSE #100 EquipRanged() SetGlobal("rsL_MeleeAttack","LOCALS",0) Continue() END // ====================================================================== // set myself as leader IF HotKey(C) InPartySlot(Myself,0) !Global("rsG_FollowMe","GLOBAL",1) THEN RESPONSE #100 DisplayStringHead(Myself,835) SetGlobal("rsG_FollowMe","GLOBAL",1) END IF HotKey(C) InPartySlot(Myself,1) !Global("rsG_FollowMe","GLOBAL",2) THEN RESPONSE #100 DisplayStringHead(Myself,835) SetGlobal("rsG_FollowMe","GLOBAL",2) END IF HotKey(C) InPartySlot(Myself,2) !Global("rsG_FollowMe","GLOBAL",3) THEN RESPONSE #100 DisplayStringHead(Myself,835) SetGlobal("rsG_FollowMe","GLOBAL",3) END IF HotKey(C) InPartySlot(Myself,3) !Global("rsG_FollowMe","GLOBAL",4) THEN RESPONSE #100 DisplayStringHead(Myself,835) SetGlobal("rsG_FollowMe","GLOBAL",4) END IF HotKey(C) InPartySlot(Myself,4) !Global("rsG_FollowMe","GLOBAL",5) THEN RESPONSE #100 DisplayStringHead(Myself,835) SetGlobal("rsG_FollowMe","GLOBAL",5) END IF HotKey(C) InPartySlot(Myself,5) !Global("rsG_FollowMe","GLOBAL",6) THEN RESPONSE #100 DisplayStringHead(Myself,835) SetGlobal("rsG_FollowMe","GLOBAL",6) END // ====================================================================== // autocenter on myself IF HotKey(U) InPartySlot(Myself,0) !Global("rsG_CenterMe","GLOBAL",1) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",1) END IF HotKey(U) InPartySlot(Myself,1) !Global("rsG_CenterMe","GLOBAL",2) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",2) END IF HotKey(U) InPartySlot(Myself,2) !Global("rsG_CenterMe","GLOBAL",3) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",3) END IF HotKey(U) InPartySlot(Myself,3) !Global("rsG_CenterMe","GLOBAL",4) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",4) END IF HotKey(U) InPartySlot(Myself,4) !Global("rsG_CenterMe","GLOBAL",5) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",5) END IF HotKey(U) InPartySlot(Myself,5) !Global("rsG_CenterMe","GLOBAL",6) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",6) END IF HotKey(U) InPartySlot(Myself,0) Global("rsG_CenterMe","GLOBAL",1) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",99) END IF HotKey(U) InPartySlot(Myself,1) Global("rsG_CenterMe","GLOBAL",2) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",99) END IF HotKey(U) InPartySlot(Myself,2) Global("rsG_CenterMe","GLOBAL",3) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",99) END IF HotKey(U) InPartySlot(Myself,3) Global("rsG_CenterMe","GLOBAL",4) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",99) END IF HotKey(U) InPartySlot(Myself,4) Global("rsG_CenterMe","GLOBAL",5) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",99) END IF HotKey(U) InPartySlot(Myself,5) Global("rsG_CenterMe","GLOBAL",6) THEN RESPONSE #100 SetGlobal("rsG_CenterMe","GLOBAL",99) END IF InPartySlot(Myself,0) Global("rsG_CenterMe","GLOBAL",1) THEN RESPONSE #100 MoveViewObject(Myself,0) END IF InPartySlot(Myself,1) Global("rsG_CenterMe","GLOBAL",2) THEN RESPONSE #100 MoveViewObject(Myself,0) END IF InPartySlot(Myself,2) Global("rsG_CenterMe","GLOBAL",3) THEN RESPONSE #100 MoveViewObject(Myself,0) END IF InPartySlot(Myself,3) Global("rsG_CenterMe","GLOBAL",4) THEN RESPONSE #100 MoveViewObject(Myself,0) END IF InPartySlot(Myself,4) Global("rsG_CenterMe","GLOBAL",5) THEN RESPONSE #100 MoveViewObject(Myself,0) END IF InPartySlot(Myself,5) Global("rsG_CenterMe","GLOBAL",6) THEN RESPONSE #100 MoveViewObject(Myself,0) END // ====================================================================== // turn off leader IF HotKey(C) !Global("rsG_FollowMe","GLOBAL",0) THEN RESPONSE #100 DisplayStringHead(Myself,836) SetGlobal("rsG_FollowMe","GLOBAL",0) END // ====================================================================== // toggle follow mode IF HotKey(S) Global("rsL_AutoFollow","LOCALS",0) THEN RESPONSE #100 DisplayStringHead(Myself,835) SetGlobal("rsL_AutoFollow","LOCALS",1) END IF HotKey(S) Global("rsL_AutoFollow","LOCALS",1) THEN RESPONSE #100 DisplayStringHead(Myself,836) SetGlobal("rsL_AutoFollow","LOCALS",0) END // ====================================================================== // set pain tolerance IF HotKey(G) Global("rsL_PainTolerance","LOCALS",0) THEN RESPONSE #100 DisplayStringHead(Myself,833) SetGlobal("rsL_PainTolerance","LOCALS",1) END IF HotKey(G) Global("rsL_PainTolerance","LOCALS",1) THEN RESPONSE #100 DisplayStringHead(Myself,832) SetGlobal("rsL_PainTolerance","LOCALS",2) END IF HotKey(G) Global("rsL_PainTolerance","LOCALS",2) THEN RESPONSE #100 DisplayStringHead(Myself,831) SetGlobal("rsL_PainTolerance","LOCALS",3) END IF HotKey(G) Global("rsL_PainTolerance","LOCALS",3) THEN RESPONSE #100 DisplayStringHead(Myself,830) SetGlobal("rsL_PainTolerance","LOCALS",0) END // ====================================================================== // spread party to explore area // ---------------------------------------------------------------------- // start spread-party-mode IF HotKey(V) Global("rsG_SpreadParty","GLOBAL",0) InPartySlot(Myself,0) THEN RESPONSE #100 SetGlobal("rsG_SpreadParty","GLOBAL",1) StartTimer(1002,15) DisplayStringHead(Myself,10070) END // ---------------------------------------------------------------------- // stop spread-party-mode IF HotKey(V) Global("rsG_SpreadParty","GLOBAL",1) InPartySlot(Myself,0) THEN RESPONSE #100 SetGlobal("rsG_SpreadParty","GLOBAL",0) DisplayStringHead(Myself,15924) END IF Global("rsG_SpreadParty","GLOBAL",1) TimerExpired(1002) THEN RESPONSE #100 SetGlobal("rsG_SpreadParty","GLOBAL",0) DisplayStringHead(Myself,15924) END // ---------------------------------------------------------------------- // run around IF ActionListEmpty() Global("rsG_SpreadParty","GLOBAL",1) THEN RESPONSE #100 RunAwayFrom(SecondNearest([PC]),30) DisplayStringHead(Myself,16470) END // ______________________________________________________________________ // // unpoison/heal // ====================================================================== // unpoison myself IF ActionListEmpty() OR(2) HitBy([ANYONE],POISON) StateCheck(Myself,STATE_POISONED) //ENDOR HasItem("POTN20",Myself) THEN RESPONSE #100 UseItem("POTN20",Myself) END IF ActionListEmpty() OR(2) HitBy([ANYONE],POISON) StateCheck(Myself,STATE_POISONED) //ENDOR HasItem("POTN17",Myself) THEN RESPONSE #100 UseItem("POTN17",Myself) END IF ActionListEmpty() OR(2) HitBy([ANYONE],POISON) StateCheck(Myself,STATE_POISONED) //ENDOR HaveSpell(CLERIC_NEUTRALIZE_POISON) THEN RESPONSE #100 Spell(Myself,CLERIC_NEUTRALIZE_POISON) END IF ActionListEmpty() OR(2) HitBy([ANYONE],POISON) StateCheck(Myself,STATE_POISONED) //ENDOR HaveSpell(INNATE_SLOW_POISON) THEN RESPONSE #100 Spell(Myself,INNATE_SLOW_POISON) END IF ActionListEmpty() OR(2) HitBy([ANYONE],POISON) StateCheck(Myself,STATE_POISONED) //ENDOR HaveSpell(CLERIC_SLOW_POISON) THEN RESPONSE #100 Spell(Myself,CLERIC_SLOW_POISON) END // ====================================================================== // heal myself with potions etc. IF ActionListEmpty() HPPercentLT(Myself,60) HasItem("POTN08",Myself) THEN RESPONSE #100 UseItem("POTN08",Myself) END IF ActionListEmpty() HPPercentLT(Myself,60) HasItem("IPOTN08",Myself) THEN RESPONSE #100 UseItem("IPOTN08",Myself) END IF ActionListEmpty() HPPercentLT(Myself,45) HasItem("POTN52",Myself) THEN RESPONSE #100 UseItem("POTN52",Myself) END IF ActionListEmpty() HPPercentLT(Myself,45) HasItem("TTPOT",Myself) THEN RESPONSE #100 UseItem("TTPOT",Myself) END // ====================================================================== // simulate death IF HPPercentLT(Myself,10) See([ENEMY]) !HitBy([ANYONE],POISON) !StateCheck(Myself,STATE_POISONED) THEN RESPONSE #100 Shout(HURT) DisplayStringHead(Myself,1453) SetGlobal("rsL_HealState","LOCALS",1) StartTimer(1003,5) PlayDead(15000) END // ______________________________________________________________________ // // help others // ====================================================================== // unpoison others // ---------------------------------------------------------------------- // cast CLERIC_NEUTRALIZE_POISON to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2001) HaveSpell(CLERIC_NEUTRALIZE_POISON) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_NEUTRALIZE_POISON) GiveOrder(LastCommandedBy(Myself),2003) END IF ActionListEmpty() ReceivedOrder([PC],2001) HaveSpell(CLERIC_NEUTRALIZE_POISON) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_NEUTRALIZE_POISON) GiveOrder(LastCommandedBy(Myself),2003) END // ---------------------------------------------------------------------- // say i could cast CLERIC_NEUTRALIZE_POISON to help IF ActionListEmpty() Heard([PC],POISONED) HaveSpell(CLERIC_NEUTRALIZE_POISON) THEN RESPONSE #100 Shout(CAN_UNPOISON) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast INNATE_SLOW_POISON to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2001) HaveSpell(INNATE_SLOW_POISON) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_SLOW_POISON) GiveOrder(LastCommandedBy(Myself),2003) END IF ActionListEmpty() ReceivedOrder([PC],2001) HaveSpell(INNATE_SLOW_POISON) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_SLOW_POISON) GiveOrder(LastCommandedBy(Myself),2003) END // ---------------------------------------------------------------------- // say i could cast INNATE_SLOW_POISON to help IF ActionListEmpty() Heard([PC],POISONED) HaveSpell(INNATE_SLOW_POISON) THEN RESPONSE #100 Shout(CAN_UNPOISON) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast CLERIC_SLOW_POISON to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2001) HaveSpell(CLERIC_SLOW_POISON) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_SLOW_POISON) GiveOrder(LastCommandedBy(Myself),2003) END IF ActionListEmpty() ReceivedOrder([PC],2001) HaveSpell(CLERIC_SLOW_POISON) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_SLOW_POISON) GiveOrder(LastCommandedBy(Myself),2003) END // ---------------------------------------------------------------------- // say i could cast CLERIC_SLOW_POISON to help IF ActionListEmpty() Heard([PC],POISONED) HaveSpell(CLERIC_SLOW_POISON) THEN RESPONSE #100 Shout(CAN_UNPOISON) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // give "POTN20" to help (only if enemy is visible) IF ActionListEmpty() See([ENEMY]) ReceivedOrder([PC],2001) HasItem("POTN20",Myself) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) GiveItem("POTN20",LastCommandedBy(Myself)) GiveOrder(LastCommandedBy(Myself),2003) END // ---------------------------------------------------------------------- // say i could give item "POTN20" to help IF ActionListEmpty() See([ENEMY]) Heard([PC],POISONED) HasItem("POTN20",Myself) THEN RESPONSE #100 Shout(CAN_UNPOISON) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // give "POTN17" to help (only if enemy is visible) IF ActionListEmpty() See([ENEMY]) ReceivedOrder([PC],2001) HasItem("POTN17",Myself) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) GiveItem("POTN17",LastCommandedBy(Myself)) GiveOrder(LastCommandedBy(Myself),2003) END // ---------------------------------------------------------------------- // say i could give item "POTN17" to help IF ActionListEmpty() See([ENEMY]) Heard([PC],POISONED) HasItem("POTN17",Myself) THEN RESPONSE #100 Shout(CAN_UNPOISON) DisplayStringHead(Myself,12110) END // ====================================================================== // heal others // ---------------------------------------------------------------------- // cast CLERIC_HEAL to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_HEAL) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_HEAL) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_HEAL) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_HEAL) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast CLERIC_HEAL to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(CLERIC_HEAL) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast INNATE_LAYHANDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_LAYHANDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_LAYHANDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_LAYHANDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_LAYHANDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast INNATE_LAYHANDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(INNATE_LAYHANDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast INNATE_CURE_LIGHT_WOUNDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_CURE_LIGHT_WOUNDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_CURE_LIGHT_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_CURE_LIGHT_WOUNDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_CURE_LIGHT_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast INNATE_CURE_LIGHT_WOUNDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(INNATE_CURE_LIGHT_WOUNDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast PALADIN_LAY_ON_HANDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(PALADIN_LAY_ON_HANDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),PALADIN_LAY_ON_HANDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(PALADIN_LAY_ON_HANDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),PALADIN_LAY_ON_HANDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast PALADIN_LAY_ON_HANDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(PALADIN_LAY_ON_HANDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast MONK_LAY_ON_HANDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(MONK_LAY_ON_HANDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),MONK_LAY_ON_HANDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(MONK_LAY_ON_HANDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),MONK_LAY_ON_HANDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast MONK_LAY_ON_HANDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(MONK_LAY_ON_HANDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast CLERIC_CURE_CRITICAL_WOUNDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_CRITICAL_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_CRITICAL_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast CLERIC_CURE_CRITICAL_WOUNDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast CLERIC_CURE_SERIOUS_WOUNDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_SERIOUS_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_SERIOUS_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast CLERIC_CURE_SERIOUS_WOUNDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast CLERIC_CURE_MEDIUM_WOUNDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_MEDIUM_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_MEDIUM_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast CLERIC_CURE_MEDIUM_WOUNDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(CLERIC_CURE_MEDIUM_WOUNDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast CLERIC_CURE_LIGHT_WOUNDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_LIGHT_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_CURE_LIGHT_WOUNDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast CLERIC_CURE_LIGHT_WOUNDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast CLERIC_AID to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_AID) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_AID) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(CLERIC_AID) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),CLERIC_AID) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast CLERIC_AID to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(CLERIC_AID) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast INNATE_LAYHANDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_LAYHANDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_LAYHANDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_LAYHANDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_LAYHANDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast INNATE_LAYHANDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(INNATE_LAYHANDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // cast INNATE_LAYHANDS to help and send ack IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_LAYHANDS) See([ENEMY]) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_LAYHANDS) GiveOrder(LastCommandedBy(Myself),2002) END IF ActionListEmpty() ReceivedOrder([PC],2000) HaveSpell(INNATE_LAYHANDS) THEN RESPONSE #100 DisplayStringHead(Myself,14178) Spell(LastCommandedBy(Myself),INNATE_LAYHANDS) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could cast INNATE_LAYHANDS to help IF ActionListEmpty() Heard([PC],HURT) HaveSpell(INNATE_LAYHANDS) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // give "POTN08" to help (only if enemy is visible) IF ActionListEmpty() See([ENEMY]) ReceivedOrder([PC],2000) HasItem("POTN08",Myself) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) GiveItem("POTN08",LastCommandedBy(Myself)) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could give item "POTN08" to help IF ActionListEmpty() See([ENEMY]) Heard([PC],HURT) HasItem("POTN08",Myself) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // give "IPOTN08" to help (only if enemy is visible) IF ActionListEmpty() See([ENEMY]) ReceivedOrder([PC],2000) HasItem("IPOTN08",Myself) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) GiveItem("IPOTN08",LastCommandedBy(Myself)) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could give item "IPOTN08" to help IF ActionListEmpty() See([ENEMY]) Heard([PC],HURT) HasItem("IPOTN08",Myself) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // give "POTN52" to help (only if enemy is visible) IF ActionListEmpty() See([ENEMY]) ReceivedOrder([PC],2000) HasItem("POTN52",Myself) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) GiveItem("POTN52",LastCommandedBy(Myself)) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could give item "POTN52" to help IF ActionListEmpty() See([ENEMY]) Heard([PC],HURT) HasItem("POTN52",Myself) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ---------------------------------------------------------------------- // give "TTPOT" to help (only if enemy is visible) IF ActionListEmpty() See([ENEMY]) ReceivedOrder([PC],2000) HasItem("TTPOT",Myself) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(Myself),15) DisplayStringHead(Myself,14178) GiveItem("TTPOT",LastCommandedBy(Myself)) GiveOrder(LastCommandedBy(Myself),2002) END // ---------------------------------------------------------------------- // say i could give item "TTPOT" to help IF ActionListEmpty() See([ENEMY]) Heard([PC],HURT) HasItem("TTPOT",Myself) THEN RESPONSE #100 Shout(CAN_HEAL) DisplayStringHead(Myself,12110) END // ====================================================================== // wait for help // ---------------------------------------------------------------------- // anyone CAN_UNPOISON? give him the order to do so IF ActionListEmpty() Global("rsL_UnpoisonState","LOCALS",1) Heard([PC],CAN_UNPOISON) THEN RESPONSE #100 SetGlobal("rsL_UnpoisonState","LOCALS",2) GiveOrder(LastHeardBy(Myself),2001) StartTimer(1001,3) MoveToObject(LastHeardBy(Myself)) END // ---------------------------------------------------------------------- // nobody answered - try again IF ActionListEmpty() Global("rsL_UnpoisonState","LOCALS",1) TimerExpired(1003) THEN RESPONSE #100 Shout(POISONED) DisplayStringHead(Myself,1453) SetGlobal("rsL_UnpoisonState","LOCALS",1) StartTimer(1003,5) END // ---------------------------------------------------------------------- // i requested UNPOISON - and got ack IF ActionListEmpty() Global("rsL_UnpoisonState","LOCALS",2) ReceivedOrder([PC],2003) THEN RESPONSE #100 DisplayStringHead(Myself,14022) SetGlobal("rsL_UnpoisonState","LOCALS",0) END // ---------------------------------------------------------------------- // i requested UNPOISON - but ack timed out IF ActionListEmpty() Global("rsL_UnpoisonState","LOCALS",2) TimerExpired(1001) THEN RESPONSE #100 Shout(POISONED) DisplayStringHead(Myself,1453) SetGlobal("rsL_UnpoisonState","LOCALS",1) StartTimer(1003,5) END // ---------------------------------------------------------------------- // anyone CAN_HEAL? give him the order to do so IF ActionListEmpty() Global("rsL_HealState","LOCALS",1) Heard([PC],CAN_HEAL) THEN RESPONSE #100 SetGlobal("rsL_HealState","LOCALS",2) GiveOrder(LastHeardBy(Myself),2000) StartTimer(1000,3) MoveToObject(LastHeardBy(Myself)) END // ---------------------------------------------------------------------- // nobody answered - try again IF ActionListEmpty() Global("rsL_HealState","LOCALS",1) TimerExpired(1003) THEN RESPONSE #100 Shout(HURT) DisplayStringHead(Myself,1453) SetGlobal("rsL_HealState","LOCALS",1) StartTimer(1003,5) END // ---------------------------------------------------------------------- // i requested HEAL - and got ack IF ActionListEmpty() Global("rsL_HealState","LOCALS",2) ReceivedOrder([PC],2002) THEN RESPONSE #100 DisplayStringHead(Myself,14022) SetGlobal("rsL_HealState","LOCALS",0) END // ---------------------------------------------------------------------- // i requested HEAL - but ack timed out IF ActionListEmpty() Global("rsL_HealState","LOCALS",2) TimerExpired(1000) THEN RESPONSE #100 Shout(HURT) DisplayStringHead(Myself,1453) SetGlobal("rsL_HealState","LOCALS",1) StartTimer(1003,5) END // ====================================================================== // yell for help // ---------------------------------------------------------------------- // yell for unpoison IF ActionListEmpty() OR(2) HitBy([ANYONE],POISON) StateCheck(Myself,STATE_POISONED) //ENDOR THEN RESPONSE #100 Shout(POISONED) DisplayStringHead(Myself,1453) SetGlobal("rsL_UnpoisonState","LOCALS",1) StartTimer(1003,5) END // ---------------------------------------------------------------------- // check hitpoints and yell for help if needed IF ActionListEmpty() Global("rsL_PainTolerance","LOCALS",1) Global("rsL_HealState","LOCALS",0) HPPercentGT(Myself,0) HPPercentLT(Myself,25) THEN RESPONSE #100 Shout(HURT) DisplayStringHead(Myself,1453) SetGlobal("rsL_HealState","LOCALS",1) StartTimer(1003,5) END IF ActionListEmpty() Global("rsL_PainTolerance","LOCALS",2) Global("rsL_HealState","LOCALS",0) HPPercentGT(Myself,0) HPPercentLT(Myself,50) THEN RESPONSE #100 Shout(HURT) DisplayStringHead(Myself,1453) SetGlobal("rsL_HealState","LOCALS",1) StartTimer(1003,5) END IF ActionListEmpty() Global("rsL_PainTolerance","LOCALS",3) Global("rsL_HealState","LOCALS",0) HPPercentGT(Myself,0) HPPercentLT(Myself,75) THEN RESPONSE #100 Shout(HURT) DisplayStringHead(Myself,1453) SetGlobal("rsL_HealState","LOCALS",1) StartTimer(1003,5) END // ______________________________________________________________________ // // follow my leader IF Global("rsL_AutoFollow","LOCALS",1) Global("rsG_FollowMe","GLOBAL",1) !Range(Player1,20) !OnScreen(Myself) !InPartySlot(Myself,0) THEN RESPONSE #100 MoveToObject(Player1) END IF Global("rsL_AutoFollow","LOCALS",1) Global("rsG_FollowMe","GLOBAL",2) !Range(Player2,20) !OnScreen(Myself) !InPartySlot(Myself,1) THEN RESPONSE #100 MoveToObject(Player2) END IF Global("rsL_AutoFollow","LOCALS",1) Global("rsG_FollowMe","GLOBAL",3) !Range(Player3,20) !OnScreen(Myself) !InPartySlot(Myself,2) THEN RESPONSE #100 MoveToObject(Player3) END IF Global("rsL_AutoFollow","LOCALS",1) Global("rsG_FollowMe","GLOBAL",4) !Range(Player4,20) !OnScreen(Myself) !InPartySlot(Myself,3) THEN RESPONSE #100 MoveToObject(Player4) END IF Global("rsL_AutoFollow","LOCALS",1) Global("rsG_FollowMe","GLOBAL",5) !Range(Player5,20) !OnScreen(Myself) !InPartySlot(Myself,4) THEN RESPONSE #100 MoveToObject(Player5) END IF Global("rsL_AutoFollow","LOCALS",1) Global("rsG_FollowMe","GLOBAL",6) !Range(Player6,20) !OnScreen(Myself) !InPartySlot(Myself,5) THEN RESPONSE #100 MoveToObject(Player6) END // ______________________________________________________________________ // // combat // ====================================================================== // run away from party members attacking me (charmed?) IF ActionListEmpty() AttackedBy([ANYONE],DEFAULT) InParty(LastAttackerOf(Myself)) THEN RESPONSE #100 RunAwayFrom(LastAttackerOf(Myself),30) END // ====================================================================== // defend myself // i am damaged IF AttackedBy([ANYONE],DEFAULT) !StateCheck(LastAttackerOf(Myself),STATE_PANIC) Exists(LastAttackerOf(Myself)) !InParty(LastAttackerOf(Myself)) GlobalGT("rsL_HealState","LOCALS",0) Range(LastAttackerOf(Myself),6) THEN RESPONSE #100 Shout(UNDER_ATTACK) RunAwayFrom(LastAttackerOf(Myself),30) EquipRanged() Attack(LastAttackerOf(Myself)) END // melee-attack in melee-mode IF ActionListEmpty() AttackedBy([ANYONE],DEFAULT) !StateCheck(LastAttackerOf(Myself),STATE_PANIC) Exists(LastAttackerOf(Myself)) !InParty(LastAttackerOf(Myself)) Global("rsL_MeleeAttack","LOCALS",1) Range(LastAttackerOf(Myself),10) THEN RESPONSE #100 Shout(UNDER_ATTACK) EquipMostDamagingMelee() Attack(LastAttackerOf(Myself)) END // ranged-attack in melee-mode IF ActionListEmpty() AttackedBy([ANYONE],DEFAULT) !StateCheck(LastAttackerOf(Myself),STATE_PANIC) Exists(LastAttackerOf(Myself)) !InParty(LastAttackerOf(Myself)) Global("rsL_MeleeAttack","LOCALS",1) THEN RESPONSE #100 Shout(UNDER_ATTACK) EquipRanged() Attack(LastAttackerOf(Myself)) END // melee-attack in ranged-mode IF ActionListEmpty() AttackedBy([ANYONE],DEFAULT) !StateCheck(LastAttackerOf(Myself),STATE_PANIC) Exists(LastAttackerOf(Myself)) !InParty(LastAttackerOf(Myself)) Global("rsL_MeleeAttack","LOCALS",0) Range(LastAttackerOf(Myself),3) THEN RESPONSE #100 Shout(UNDER_ATTACK) EquipMostDamagingMelee() Attack(LastAttackerOf(Myself)) END // keep-distance in ranged-mode IF ActionListEmpty() AttackedBy([ANYONE],DEFAULT) !StateCheck(LastAttackerOf(Myself),STATE_PANIC) Exists(LastAttackerOf(Myself)) !InParty(LastAttackerOf(Myself)) Global("rsL_MeleeAttack","LOCALS",0) Range(LastAttackerOf(Myself),10) THEN RESPONSE #100 Shout(UNDER_ATTACK) RunAwayFrom(LastAttackerOf(Myself),15) EquipRanged() Attack(LastAttackerOf(Myself)) END // ranged-attack in ranged-mode IF ActionListEmpty() AttackedBy([ANYONE],DEFAULT) !StateCheck(LastAttackerOf(Myself),STATE_PANIC) Exists(LastAttackerOf(Myself)) !InParty(LastAttackerOf(Myself)) Global("rsL_MeleeAttack","LOCALS",0) THEN RESPONSE #100 Shout(UNDER_ATTACK) EquipRanged() Attack(LastAttackerOf(Myself)) END // hide in shadows if combat starts IF ActionListEmpty() Heard([PC],UNDER_ATTACK) !StateCheck(LastAttackerOf(LastHeardBy(Myself)),STATE_PANIC) Exists(LastAttackerOf(LastHeardBy(Myself))) !InParty(LastAttackerOf(LastHeardBy(Myself))) !See([ENEMY]) !StateCheck(Myself,STATE_INVISIBLE) THEN RESPONSE #100 Hide() END IF ActionListEmpty() Heard([PC],ATTACKING) !StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC) Exists(NearestEnemyOf(LastHeardBy(Myself))) !InParty(NearestEnemyOf(LastHeardBy(Myself))) !See([ENEMY]) !StateCheck(Myself,STATE_INVISIBLE) THEN RESPONSE #100 Hide() END // ====================================================================== // defend friends who are attacked (attack their attackers) // i am damaged IF Heard([PC],UNDER_ATTACK) !StateCheck(LastAttackerOf(LastHeardBy(Myself)),STATE_PANIC) Exists(LastAttackerOf(LastHeardBy(Myself))) !InParty(LastAttackerOf(LastHeardBy(Myself))) GlobalGT("rsL_HealState","LOCALS",0) Range(LastAttackerOf(LastHeardBy(Myself)),6) THEN RESPONSE #100 RunAwayFrom(LastAttackerOf(LastHeardBy(Myself)),30) EquipRanged() Attack(LastAttackerOf(LastHeardBy(Myself))) END // melee-attack in melee-mode IF ActionListEmpty() Heard([PC],UNDER_ATTACK) !StateCheck(LastAttackerOf(LastHeardBy(Myself)),STATE_PANIC) Exists(LastAttackerOf(LastHeardBy(Myself))) !InParty(LastAttackerOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",1) Range(LastAttackerOf(LastHeardBy(Myself)),10) THEN RESPONSE #100 EquipMostDamagingMelee() Attack(LastAttackerOf(LastHeardBy(Myself))) END // ranged-attack in melee-mode IF ActionListEmpty() Heard([PC],UNDER_ATTACK) !StateCheck(LastAttackerOf(LastHeardBy(Myself)),STATE_PANIC) Exists(LastAttackerOf(LastHeardBy(Myself))) !InParty(LastAttackerOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",1) THEN RESPONSE #100 EquipRanged() Attack(LastAttackerOf(LastHeardBy(Myself))) END // melee-attack in ranged-mode IF ActionListEmpty() Heard([PC],UNDER_ATTACK) !StateCheck(LastAttackerOf(LastHeardBy(Myself)),STATE_PANIC) Exists(LastAttackerOf(LastHeardBy(Myself))) !InParty(LastAttackerOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",0) Range(LastAttackerOf(LastHeardBy(Myself)),3) THEN RESPONSE #100 EquipMostDamagingMelee() Attack(LastAttackerOf(LastHeardBy(Myself))) END // keep-distance in ranged-mode IF ActionListEmpty() Heard([PC],UNDER_ATTACK) !StateCheck(LastAttackerOf(LastHeardBy(Myself)),STATE_PANIC) Exists(LastAttackerOf(LastHeardBy(Myself))) !InParty(LastAttackerOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",0) Range(LastAttackerOf(LastHeardBy(Myself)),10) THEN RESPONSE #100 RunAwayFrom(LastAttackerOf(LastHeardBy(Myself)),15) EquipRanged() Attack(LastAttackerOf(LastHeardBy(Myself))) END // ranged-attack in ranged-mode IF ActionListEmpty() Heard([PC],UNDER_ATTACK) !StateCheck(LastAttackerOf(LastHeardBy(Myself)),STATE_PANIC) Exists(LastAttackerOf(LastHeardBy(Myself))) !InParty(LastAttackerOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",0) THEN RESPONSE #100 EquipRanged() Attack(LastAttackerOf(LastHeardBy(Myself))) END // ====================================================================== // coordinate with friends who are attacking (attack their nearest enemy) // i am damaged IF Heard([PC],ATTACKING) !StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC) Exists(NearestEnemyOf(LastHeardBy(Myself))) !InParty(NearestEnemyOf(LastHeardBy(Myself))) GlobalGT("rsL_HealState","LOCALS",0) Range(NearestEnemyOf(LastHeardBy(Myself)),6) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(LastHeardBy(Myself)),30) EquipRanged() Attack(NearestEnemyOf(LastHeardBy(Myself))) END // melee-attack in melee-mode IF ActionListEmpty() Heard([PC],ATTACKING) !StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC) Exists(NearestEnemyOf(LastHeardBy(Myself))) !InParty(NearestEnemyOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",1) Range(NearestEnemyOf(LastHeardBy(Myself)),10) THEN RESPONSE #100 EquipMostDamagingMelee() Attack(NearestEnemyOf(LastHeardBy(Myself))) END // ranged-attack in melee-mode IF ActionListEmpty() Heard([PC],ATTACKING) !StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC) Exists(NearestEnemyOf(LastHeardBy(Myself))) !InParty(NearestEnemyOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",1) THEN RESPONSE #100 EquipRanged() Attack(NearestEnemyOf(LastHeardBy(Myself))) END // melee-attack in ranged-mode IF ActionListEmpty() Heard([PC],ATTACKING) !StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC) Exists(NearestEnemyOf(LastHeardBy(Myself))) !InParty(NearestEnemyOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",0) Range(NearestEnemyOf(LastHeardBy(Myself)),3) THEN RESPONSE #100 EquipMostDamagingMelee() Attack(NearestEnemyOf(LastHeardBy(Myself))) END // keep-distance in ranged-mode IF ActionListEmpty() Heard([PC],ATTACKING) !StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC) Exists(NearestEnemyOf(LastHeardBy(Myself))) !InParty(NearestEnemyOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",0) Range(NearestEnemyOf(LastHeardBy(Myself)),10) THEN RESPONSE #100 RunAwayFrom(NearestEnemyOf(LastHeardBy(Myself)),15) EquipRanged() Attack(NearestEnemyOf(LastHeardBy(Myself))) END // ranged-attack in ranged-mode IF ActionListEmpty() Heard([PC],ATTACKING) !StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC) Exists(NearestEnemyOf(LastHeardBy(Myself))) !InParty(NearestEnemyOf(LastHeardBy(Myself))) Global("rsL_MeleeAttack","LOCALS",0) THEN RESPONSE #100 EquipRanged() Attack(NearestEnemyOf(LastHeardBy(Myself))) END // ====================================================================== // attack nearest/second nearest visible targets and tell friends to coordinate // i am damaged IF See(NearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) GlobalGT("rsL_HealState","LOCALS",0) Range(LastSeenBy(Myself),6) THEN RESPONSE #100 Shout(ATTACKING) RunAwayFrom(LastSeenBy(Myself),30) EquipRanged() Attack(LastSeenBy(Myself)) END // melee-attack in melee-mode IF ActionListEmpty() See(NearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",1) Range(LastSeenBy(Myself),10) THEN RESPONSE #100 Shout(ATTACKING) EquipMostDamagingMelee() Attack(LastSeenBy(Myself)) END // ranged-attack in melee-mode IF ActionListEmpty() See(NearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",1) THEN RESPONSE #100 Shout(ATTACKING) EquipRanged() Attack(LastSeenBy(Myself)) END // melee-attack in ranged-mode IF ActionListEmpty() See(NearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",0) Range(LastSeenBy(Myself),3) THEN RESPONSE #100 Shout(ATTACKING) EquipMostDamagingMelee() Attack(LastSeenBy(Myself)) END // keep-distance in ranged-mode IF ActionListEmpty() See(NearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",0) Range(LastSeenBy(Myself),10) THEN RESPONSE #100 Shout(ATTACKING) RunAwayFrom(LastSeenBy(Myself),15) EquipRanged() Attack(LastSeenBy(Myself)) END // ranged-attack in ranged-mode IF ActionListEmpty() See(NearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",0) THEN RESPONSE #100 Shout(ATTACKING) EquipRanged() Attack(LastSeenBy(Myself)) END // i am damaged IF See(SecondNearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) GlobalGT("rsL_HealState","LOCALS",0) Range(LastSeenBy(Myself),6) THEN RESPONSE #100 Shout(ATTACKING) RunAwayFrom(LastSeenBy(Myself),30) EquipRanged() Attack(LastSeenBy(Myself)) END // melee-attack in melee-mode IF ActionListEmpty() See(SecondNearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",1) Range(LastSeenBy(Myself),10) THEN RESPONSE #100 Shout(ATTACKING) EquipMostDamagingMelee() Attack(LastSeenBy(Myself)) END // ranged-attack in melee-mode IF ActionListEmpty() See(SecondNearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",1) THEN RESPONSE #100 Shout(ATTACKING) EquipRanged() Attack(LastSeenBy(Myself)) END // melee-attack in ranged-mode IF ActionListEmpty() See(SecondNearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",0) Range(LastSeenBy(Myself),3) THEN RESPONSE #100 Shout(ATTACKING) EquipMostDamagingMelee() Attack(LastSeenBy(Myself)) END // keep-distance in ranged-mode IF ActionListEmpty() See(SecondNearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",0) Range(LastSeenBy(Myself),10) THEN RESPONSE #100 Shout(ATTACKING) RunAwayFrom(LastSeenBy(Myself),15) EquipRanged() Attack(LastSeenBy(Myself)) END // ranged-attack in ranged-mode IF ActionListEmpty() See(SecondNearestEnemyOf(Myself)) !StateCheck(LastSeenBy(Myself),STATE_PANIC) Exists(LastSeenBy(Myself)) !InParty(LastSeenBy(Myself)) Global("rsL_MeleeAttack","LOCALS",0) THEN RESPONSE #100 Shout(ATTACKING) EquipRanged() Attack(LastSeenBy(Myself)) END // ______________________________________________________________________ // // if not in combat do special actions // ====================================================================== // search for traps IF ActionListEmpty() OR(3) Class(Myself,THIEF) Class(Myself,FIGHTER_THIEF) Class(Myself,MAGE_THIEF) //ENDOR !ModalState(DETECTTRAPS) THEN RESPONSE #100 FindTraps() END // ====================================================================== // eat berries IF ActionListEmpty() !See([ENEMY]) HPPercentLT(Myself,95) HasItem("GBERRY",Myself) THEN RESPONSE #100 UseItem("GBERRY",Myself) END // ====================================================================== // make berries IF ActionListEmpty() !See([ENEMY]) !HasItem("GBERRY",Myself) HaveSpell(CLERIC_GOOD_BERRIES) THEN RESPONSE #100 Spell(Myself,CLERIC_GOOD_BERRIES) END // ______________________________________________________________________ // // end of ralf.baf