Jump to content

Help for my party custom script


DrAzTiK

Recommended Posts

Hello,

 

I try to tweak a bit Ease-of-use party AI. Especially I would like to put Clerric protection from evil instead of paladin's Protection from Evil.

 

So with near infinity I wrote this :

 

 

IF

HotKey(L)

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

!Global("ProEvilPaladin","LOCALS",1)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

HaveSpell(PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

SetGlobal("ProEvilPaladin","LOCALS",1)

SetGlobalTimer("ProEvilPaladinTimer","LOCALS",TWELVE_MINUTES)

END

 

IF

Global("ProEvilPaladin","LOCALS",1)

OR(2)

!HaveSpell("PROTECTION_FROM_EVIL") // Protection from Evil

GlobalTimerExpired("ProEvilPaladinTimer","LOCALS")

THEN

RESPONSE #100

SetGlobal("ProEvilPaladin","LOCALS",0)

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player1)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player1,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

Spell(Player1,PROTECTION_FROM_EVIL)

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player2)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player2,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

Spell(Player2,PROTECTION_FROM_EVIL)

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player3)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player3,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

Spell(Player3,PROTECTION_FROM_EVIL)

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player4)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player4,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

Spell(Player4,PROTECTION_FROM_EVIL)

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player5)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player5,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

Spell(Player5,PROTECTION_FROM_EVIL)

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player6)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player6,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

Spell(Player6,PROTECTION_FROM_EVIL)

END

 

 

 

But near infinity doesn't like this code and I am not allowed to save and override script.

 

Can someone tell me what could be the problem ?

Link to comment

Ok, in fact this new code is working good.

 

But the fact is that I would like a code witch work for arcane and divine version of protection from evil (level1). I mean by pressing only one Hotkey, ( in summury two hotkey in one)

 

IF

HotKey(L)

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

!Global("ProEvilPaladin","LOCALS",1)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

HaveSpellRES("SPPR107") // Protection from Evil

THEN

RESPONSE #100

SetGlobal("ProEvilPaladin","LOCALS",1)

SetGlobalTimer("ProEvilPaladinTimer","LOCALS",TWELVE_MINUTES)

END

 

IF

Global("ProEvilPaladin","LOCALS",1)

OR(2)

!HaveSpellRES("SPPR107") // Protection from Evil

GlobalTimerExpired("ProEvilPaladinTimer","LOCALS")

THEN

RESPONSE #100

SetGlobal("ProEvilPaladin","LOCALS",0)

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player1)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player1,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

SpellRES("SPPR107",Player1) // Protection from Evil

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player2)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player2,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

SpellRES("SPPR107",Player2) // Protection from Evil

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player3)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player3,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

SpellRES("SPPR107",Player3) // Protection from Evil

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player4)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player4,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

SpellRES("SPPR107",Player4) // Protection from Evil

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player5)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player5,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

SpellRES("SPPR107",Player5) // Protection from Evil

END

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player6)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player6,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

SpellRES("SPPR107",Player6) // Protection from Evil

END

Link to comment

Substitute the three prot_evil blocks in the SSL file with this:

 

IF
HotKey(Z)
ActionListEmpty()
CombatCounter(0)
!Global("DMWWBuff","LOCALS",0)
!Detect(NearestEnemyOf(Myself))
!Global("ProEvilPaladin","LOCALS",1)
 OR(2)
   !CheckStatGT(Myself,0,SPELLFAILUREMAGE)
   !CheckStatGT(Myself,0,SPELLFAILUREPRIEST)
 OR(3)
   !CheckStatGT(Myself,0,SPELLFAILUREMAGE)
   HaveSpell(CLERIC_PROTECT_FROM_EVIL)
   HaveSpellRES("spcl213")
 OR(2)
   HaveSpell(WIZARD_PROTECTION_FROM_EVIL)
   !CheckStatGT(Myself,0,SPELLFAILUREPRIEST)
 OR(3)
   HaveSpell(WIZARD_PROTECTION_FROM_EVIL)
   HaveSpell(CLERIC_PROTECT_FROM_EVIL)
   HaveSpellRES("spcl213")
THEN
RESPONSE #100
	SetGlobal("ProEvilPaladin","LOCALS",1)
	SetGlobalTimer("ProEvilPaladinTimer","LOCALS",60)
END

IF
Global("ProEvilPaladin","LOCALS",1)
 OR(3)
   GlobalTimerExpired("ProEvilPaladinTimer","LOCALS")
   !HaveSpellRES("spcl213")
   CheckStatGT(Myself,0,SPELLFAILUREPRIEST)
 OR(3)
   GlobalTimerExpired("ProEvilPaladinTimer","LOCALS")
   !HaveSpell(CLERIC_PROTECT_FROM_EVIL)
   CheckStatGT(Myself,0,SPELLFAILUREPRIEST)
 OR(3)
   GlobalTimerExpired("ProEvilPaladinTimer","LOCALS")
   !HaveSpell(WIZARD_PROTECTION_FROM_EVIL)
   CheckStatGT(Myself,0,SPELLFAILUREMAGE)
THEN
RESPONSE #100
	SetGlobal("ProEvilPaladin","LOCALS",0)
END

IF TRIGGER
  TargetBlock(PlayersInOrder)
  Global("ProEvilPaladin","LOCALS",1)
  !CheckStat(scstarget,1,PROTECTION_FROM_EVIL)
THEN DO
    Action(BuffRES,"spcl213",PRIEST)
    Action(Buff,CLERIC_PROTECT_FROM_EVIL,PRIEST)
    Action(Buff,WIZARD_PROTECTION_FROM_EVIL,MAGE)
END

 

Yes, there is a logic to the madness of the first block.

 

EDIT: improved my REFACTOR_BAF_TRIGGER, now the first block seems less insane.

Link to comment

Ty the_bigg

 

Sorry but I am not familiar with SSL. I prefer to go into 0dw#gen.bcs with near infinity.

 

I have copied/pasted yours 2 first block. And for the last I wrihte this :

 

IF

ActionListEmpty()

CombatCounter(0)

!Global("DMWWBuff","LOCALS",0)

!Detect(NearestEnemyOf(Myself))

Global("ProEvilPaladin","LOCALS",1)

See(Player1)

!CheckStatGT(Myself,0,SPELLFAILUREPRIEST)

!CheckStat(Player1,1,PROTECTION_FROM_EVIL)

THEN

RESPONSE #100

ApplySpellRES("wesalac",Myself) // Enchaînement

SpellRES("SPPR107",Player1) // Protection from Evil

SpellRES("SPWI113",Player1) // Protection from Evil

END

 

 

 

For each player.

 

Sound good (wizard and priest react to the hotkey) but the spell is applied twice on each character sometimes.

 

But I think I am not very kind of this way to cast spell. Most of the time, it wast resources Imo. (but surely I can wast some protection from evil in TOB lol)

 

I prefer to do it manually. (and configure hotkey with BGConfig)

 

Except this, I find most features of Ease-of-use party AI really wonderfull of course.

Link to comment

Is it THAT hard to open the SSL file in a text editor, blindly paste in my code, and reinstall scsii? Your code mostly works, but a cleric/mage (or a Paladin who memorized additional Protection From Evil in his cleric slots) will caste PfE from both sources on each character. Editing the SSL sources fixes the problem.

 

Also, scsii ease of use in general cannot really handle the case where more than one character has a type of resource, and ends up having both players use their resource on every target. I guess you could select each character, press X, and wait for it to finish casting before selecting the next character (again, with the caveat that characters who get PfE from more than one slot will cast the spell from both sources on every character unless you actually edit the SSL sources).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...