//////////////////////////////////////////////////////////////////////// // Mage combat block //////////////////////////////////////////////////////////////////////// DEFAULT TRIGGER(GlobalTimerNotExpired("castspell","LOCALS")) IF TRIGGER TriggerBlock(Easiest) THEN DO Action(Literal) Wait(1) END /////////////////////////////////////////////////// //// If attacked by an unseen foe, mill around //// in confusion. You never know, you might //// bump into them! ////////////////////////////////////////////////// IF Allegiance(Myself,ENEMY) OR(12) AttackedBy([GOODCUTOFF.0.0.0.0.SUMMONED],DEFAULT) AttackedBy([PC],DEFAULT) AttackedBy([FAMILIAR],DEFAULT) AttackedBy([ALLY],DEFAULT) AttackedBy([CONTROLLED],DEFAULT) AttackedBy([CHARMED],DEFAULT) SpellCastOnMe([GOODCUTOFF.0.0.0.0.SUMMONED],0) SpellCastOnMe([PC],0) SpellCastOnMe([FAMILIAR],0) SpellCastOnMe([ALLY],0) SpellCastOnMe([CONTROLLED],0) SpellCastOnMe([CHARMED],0) !GlobalTimerNotExpired("whatthe","LOCALS") !See(NearestEnemyOf(Myself)) THEN RESPONSE #100 SetGlobalTimer("whatthe","LOCALS",12) Continue() END IF !See(NearestEnemyOf(Myself)) !Heard([ANYONE],404) GlobalTimerNotExpired("whatthe","LOCALS") THEN RESPONSE #100 RandomWalkContinuous() END ///////////////////////////////////////////////////////////////// /// Designated mages go to melee ///////////////////////////////////////////////////////////////// IF See(NearestEnemyOf(Myself)) RequireBlock(MageMelees) OR(2) Range(NearestEnemyOf(Myself),5) !HasItem("dw#move0",Myself) THEN RESPONSE #100 AttackReevaluate(NearestEnemyOf(Myself),30) END ///////////////////////////////////////////////////////////////// /// General ///////////////////////////////////////////////////////////////// IF TRIGGER IgnoreBlock(IsLich|IsPartyAlly) RequireBlock(EnhancedEdition) OR(4) !Heard([ANYONE],404) General(Myself,UNDEAD) Race(Myself,DEMONIC) Race(Myself,RAKSHASA) TargetBlock(EnemiesInOrderShort) Range(scstarget,8) !GlobalTimerNotExpired("teleportfield","LOCALS") TriggerBlock(Enemy|Helpless|HaveSomeSpellsLeft) !HasItem("dw#move0",Myself) !HasItem("ghoult",Myself) !HasItem("msword",Myself) OR(2) Gender(Myself,ILLUSIONARY) !HasItem("dw#melf",Myself) OR(2) Gender(Myself,ILLUSIONARY) !HasItem("dw#eneb",Myself) THEN DO RunAwayFromNoLeaveArea(scstarget,60) END IF TRIGGER IgnoreBlock(IsLich|IsPartyAlly) IgnoreBlock(EnhancedEdition) OR(4) !Heard([ANYONE],404) General(Myself,UNDEAD) Race(Myself,DEMONIC) Race(Myself,RAKSHASA) TargetBlock(EnemiesInOrderShort) Range(scstarget,8) !GlobalTimerNotExpired("teleportfield","LOCALS") TriggerBlock(Enemy|Helpless|HaveSomeSpellsLeft) !HasItem("dw#move0",Myself) !HasItem("ghoult",Myself) !HasItem("msword",Myself) OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#melf",Myself) StateCheck(Myself,STATE_INVISIBLE) OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#eneb",Myself) StateCheck(Myself,STATE_INVISIBLE) THEN DO RandomWalkContinuous() END IF TRIGGER RequireBlock(IsLich) IgnoreBlock(IsPartyAlly) IgnoreBlock(EnhancedEdition) TargetBlock(EnemiesInOrderShort) !GlobalTimerNotExpired("teleportfield","LOCALS") TriggerBlock(Enemy|Helpless|HaveSomeSpellsLeft) !HasItem("dw#move0",Myself) !HasItem("ghoult",Myself) !HasItem("msword",Myself) OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#melf",Myself) StateCheck(Myself,STATE_INVISIBLE) OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#eneb",Myself) StateCheck(Myself,STATE_INVISIBLE) THEN DO RandomWalkContinuous() END IF TRIGGER IgnoreBlock(IsPartyAlly) See(NearestEnemyOf(Myself)) Range(NearestEnemyOf(Myself),15) TriggerBlock(EasyPlus|HaveSomeSpellsLeft) !GlobalTimerNotExpired("teleportfield","LOCALS") !CheckSpellState(Myself,TIME_STOP) !HasItem("dw#move0",Myself) !HasItem("ghoult",Myself) !HasItem("msword",Myself) OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#melf",Myself) StateCheck(Myself,STATE_INVISIBLE) OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#eneb",Myself) StateCheck(Myself,STATE_INVISIBLE) THEN DO Action(Literal) RandomWalk() END IF TRIGGER See(NearestEnemyOf(Myself)) TargetBlock(EnemiesInOrderShort) !Range(scstarget,15) TriggerBlock(Enemy|Helpless|HaveSomeSpellsLeft) GlobalTimerNotExpired("teleportfield","LOCALS") OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#melf",Myself) StateCheck(Myself,STATE_INVISIBLE) OR(3) Gender(Myself,ILLUSIONARY) !HasItem("dw#eneb",Myself) StateCheck(Myself,STATE_INVISIBLE) THEN DO Action(Literal) Wait(1) END // in timestops, don't use missiles or melee (a little cheesy, and also it wastes time) IF See(NearestEnemyOf(Myself)) OR(2) Global("FIN_TIME_STOP_RUNNING","GLOBAL",1) CheckSpellState(Myself,TIME_STOP) THEN RESPONSE #100 Wait(1) END DEFAULT TRIGGER(!StateCheck(Myself,STATE_INVISIBLE)GlobalTimerNotExpired("castspell","LOCALS")) // if you have Mordenkainen's Force Blade running, use it IF TRIGGER RequireBlock(IsIWDArcane) SSLBoolean(MORDENKAINENS_SWORD_IWD) HasItem("msword",Myself) TargetBlock(EnemiesInOrderShort) TriggerBlock(Enemy|Helpless|Plus2Safe) THEN DO Action(Attack) END // if you have Ghoul Touch running, use it IF TRIGGER SSLBoolean(WIZARD_GHOUL_TOUCH) HasItem("ghoult",Myself) TargetBlock(EnemiesInOrderShort) TriggerBlock(MR100|Hold|Enemy|Helpless|PlusUnknownSafe) !CheckStatLT(scstarget,0,SAVEVSSPELL) Range(scstarget,10) THEN DO Action(Attack) END IF TRIGGER RequireBlock(Demivrgvs) SSLBoolean(WIZARD_SHOCKING_GRASP) HasItem("sgrasp",Myself) TargetBlock(EnemiesInOrderShort) TriggerBlock(Enemy|Helpless|PlusUnknownSafe) Range(scstarget,10) THEN DO Action(Attack) END //////////////////////////////////////////////////////////////////////// // core missile combat block //////////////////////////////////////////////////////////////////////// BEGIN LOOP(NeverMelee||True) BEGIN LOOP(MyWeaponStrength||Unknown) INCLUDE FILE(%scsroot%/genai/ssl/shoot.ssl) END LOOP END LOOP DEFAULT TRIGGER(GlobalTimerNotExpired("castspell","LOCALS")) IF TRIGGER See(NearestEnemyOf(Myself)) TriggerBlock(HaveNoSpellsLeft) OR(2) Range(NearestEnemyOf(Myself),5) !HasItem("dw#move0",Myself) THEN DO Action(Literal) AttackReevaluate(NearestEnemyOf(Myself),30) END