Jump to content

Turn undead AI script? (Easy scripting for noobs)


Guest Sandor

Recommended Posts

As I mentioned before, I have been looking around for a AI script that can make a cleric turn undead when she sees it. I have tried fooling around with the scriptbuilder myself and downloading the eSeries (which didn't work because WeiDU wasn't updated or something)

So basically all I want is a simple script that makes Viconia turn all undead she sees and not start attacking it.

Also, I have been thinking about a thief-script that will make the thief only backstab when they're in stealthmode and otherwise use ranged weapons. Does anyone have any tips on how to make these scripts or know of a place where I can download them?

Link to comment

IF
 See(Enemy)
 General(NearestEnemyOf(Myself),4)
 OR(2)
   Class(CLERIC_ALL)
   Class(PALADIN_ALL)
THEN
 RESPONSE #100
ClearAllActions()
Turn()
END

 

Should do something along those lines, but compiling it and so on it up to you. :p

 

Icen

Link to comment
IF
 See(Enemy)
 General(NearestEnemyOf(Myself),4)
 OR(2)
   Class(CLERIC_ALL)
   Class(PALADIN_ALL)
THEN
 RESPONSE #100
ClearAllActions()
Turn()
END

 

Should do something along those lines, but compiling it and so on it up to you. :p

 

Icen

That doesn't work, I'm afraid. NearInfinity says 'Enemy' is an unknown symbol. And there's something wrong with those lines of "Class(CLERIC_ALL)" as well.

Link to comment
Also, I have been thinking about a thief-script that will make the thief only backstab when they're in stealthmode and otherwise use ranged weapons. Does anyone have any tips on how to make these scripts or know of a place where I can download them?
The following is the script blocks dealing with backstabing from eseries. Let's see if we can't modify it for what you want. I've cleared out all the comments to make it easier to read.
IF
 ActionListEmpty()
 OR(2)
 Class(Myself,THIEF_ALL)									  
 Kit(Myself,STALKER)											 
 CheckStatGT(Myself,1,BACKSTABDAMAGEMULTIPLIER)				 
 !CombatCounter(0)													  
 StateCheck(Myself,STATE_NOT_VISIBLE)					  
 Global("EK_BackStab","LOCALS",0)							  
 !InParty(LastSeenBy(Myself))									   
 !Allegiance(LastSeenBy(Myself),GOODCUTOFF)			 
 !General(LastSeenBy(Myself),UNDEAD)						 
 !Race(LastSeenBy(Myself),DRAGON)							 
 !Race(LastSeenBy(Myself),GOLEM)							   
 OR(2)
 !Kit(LastSeenBy(Myself),BARBARIAN)						 
 Class(LastSeenBy(Myself),SORCERER)					   
 Range(LastSeenBy(Myself),8)   
THEN
 RESPONSE #100
EquipMostDamagingMelee()	
SetGlobal("EK_BackStab","LOCALS",1)   
FollowObjectFormation(LastSeenBy(Myself),1,3)
DisplayStringHead(Myself,835)										  // "Follow mode on"
END

IF
 OR(2)
 Class(Myself,THIEF_ALL)
 Kit(Myself,STALKER)	   
 CheckStatGT(Myself,1,BACKSTABDAMAGEMULTIPLIER) 
 !CombatCounter(0)													 
 StateCheck(Myself,STATE_NOT_VISIBLE)					 
 Global("EK_Backstab","LOCALS",1)							  
 !InParty(LastSeenBy(Myself))									   
 !Allegiance(LastSeenBy(Myself),GOODCUTOFF)			 
 !General(LastSeenBy(Myself),UNDEAD)						 
 !Race(LastSeenBy(Myself),DRAGON)							 
 !Race(LastSeenBy(Myself),GOLEM)							   
 OR(2)
 !Kit(LastSeenBy(Myself),BARBARIAN)						 
 Class(LastSeenBy(Myself),SORCERER)					   
 Range(LastSeenBy(Myself),1)									   
THEN
 RESPONSE #100
DisplayStringHead(Myself,8549)										 // "Die you bastard!"
SetGlobal("EK_BackStab","LOCALS",0)					   
AttackOneRound(LastSeenBy(Myself))						
MoveToObject(StrongestOf(Myself))						   
END

IF
 !CombatCounter(0)		 
 Global("EK_BackStab","LOCALS",1)  
THEN
 RESPONSE #100
DisplayStringHead(Myself,30747)										// "Next time."
SetGlobal("EK_BackStab","LOCALS",0) 
Continue()										   
END

Nothing needs to be changed, this should work for you. Oh, you do need to append to the states.ids file. Here's the tp2 command from the eseries installation.

APPEND ~state.ids~ ~0x00400010 STATE_NOT_VISIBLE~   UNLESS ~0x00400010 STATE_NOT_VISIBLE~

Eseries did say that there needed to be an appended kit.ids, but there were no tp2 commands to append anything to kit.ids or to modify it in any way. So I would assume that you're safe using what you've got here.

Based on the above blocks your ranged weapons could be called with this block. You'll have to try it though. I make no guarantees, but it should work in theory. You may want to put this block before the backstab blocks.

IF
 ActionListEmpty()
 See([ENEMY])
 !CombatCounter(0)													  
 !StateCheck(Myself,STATE_NOT_VISIBLE)					  
 !InParty(LastSeenBy(Myself))									   
 !Allegiance(LastSeenBy(Myself),GOODCUTOFF)			 
 !Range(LastSeenBy(Myself),8)   
THEN
 RESPONSE #100
EquipRanged()	
Attack(LastSeenBy(Myself))
END

Link to comment

Guys, you are so awesome, I actually made an account on this forum, in case I have other bright ideas. (Like dual-classing Imoen at 7th level and training her magic abilities with all the scrolls from that High Hedge guy)

I'm having a little trouble understanding that thief-script plainab put up though... I understand it prevents the character from backstabbing dragons, undead and golems, but why do I need the kit.ids thing? The character that I need it for (Imoen, now a 7/8 Thief/Mage) doesn't have any kits...

Link to comment

Archived

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

×
×
  • Create New...