Jump to content

Thief/ Monk scripts


Guest Nerevarine

Recommended Posts

Guest Nerevarine

Hi all, needed some help here. Does anyone knows how to do a script for a monk to have the thief abilities, disarm traps, pickpocket and unlocking? I choose the monk as I like their unarmed fighing which is quite cool.

 

I tried the below scripts (taken from a forum source), but it can't seem to work:

IF

HotKey(E)

THEN

RESPONSE #100

PickLock([ANYTHING])

Unlock([ANYTHING])

END

 

IF

HotKey(D)

THEN

RESPONSE #100

PickPockets([ANYONE])

END

 

IF

HotKey(L)

THEN

RESPONSE #100

RemoveTraps([ANYTHING])

END

 

 

Any help/ comments would be greatly appreciated. =D

Link to comment

I don't know if it's possible to give them all of the abilities, I remember using hide in shadows with a cleric at some point but never any of the other abilities. It might be easier to take a thief and emulate unarmed strike.

Link to comment
Guest Guest
I don't know if it's possible to give them all of the abilities, I remember using hide in shadows with a cleric at some point but never any of the other abilities. It might be easier to take a thief and emulate unarmed strike.

Hmm.. ok so how do I go about if I want to emulate the unarmed strike, another reason I choose the monk and opt for scripting a thief ability in it, is I like the kicking animations.

Actually for unlocking, I can just use the knock spell for my monk, detect traps/ stealth is already in, so the main problem is disarming traps.

Link to comment

I suppose you could change your avatar to monk and then apply the unarmed strike as a magical weapon or give yourself an unremovable weapon that uses unarmed animations and then change it with levels (I'm not sure if you can change the actual unarmed strikes but in essence it should work the same way). I guess the best way would be to try. Either that or wait for someone with more experience in that field, I've never really tried anything like that. :(

Link to comment
Guest Guest

I tried to change my avatar to a monk, and equip with the fist3.itm or something, but my character cant seems to kill anything (they would just be unconsicous just like the normal punching). I guess this really needs someone with more experience in this.

Link to comment

I've been doing a little work on some hotkey thief actions for my party script.

Here's the basic script I'm using and then I'll tell you what you can try that might help you out.

 

This is for finding and removing traps. I have weidu based variables in here as I create that information on the fly during install. However, that's beside the point.

IF
 HotKey(%F%)
 ActionListEmpty()
 !See([ENEMY])
 Class(Myself,THIEF_ALL)
 AreaCheck("%area%")
 Detect("%trigger%")
 !Disarmed("%trigger%")
 Range("%trigger%",30)
THEN
 RESPONSE #100
RemoveTraps("%trigger%")
FindTraps()
Continue()
END

If you want to use this script on your monk, you need to make a few changes to allow him to do so.

1) Create your monk in game.

2) Export your monk.

3) Modify your monk by using whatever program you are comfortable using when modifiying creature files. Give your monk some realistic stats in the various thief actions.

4) Modify the above script a little. Change the line Class(Myself,THIEF_ALL)to say Or(2)

Class(Myself,THIEF_ALL)

CheckStatGT(Myself,30,TRAPS) I just put the 30 in for the sake of having a number, but whatever number you put there you're monk must have a greater number inorder to find and remove traps.

NOTE: on using the above script block. %trigger% is an actual container, trap or door name. %area% is the file name of the area where the container, trap or door is located.

 

You can also use it to set up the pick lock. Just change all instances relating to traps to the equivalents for locks. You don't need the unlock() that you have below. PickLock() will set off any scripts that call guards so you may want to through in a Hide() right after in the actions.

 

Give it a try and let us know if it works. I don't even know if it works. This is just my best educated guess at the moment. Well, the code works. I don't know about the modifications to the monk working with the script....

Link to comment

Shouldn't this be done for every single trap in the game to have any effect? As far as I know there's no general Object trigger like LastTrapSpotted, so that would be a lot of copy pasting, not to mention the ammount of time needed to run through the entire script that way.

Link to comment
Shouldn't this be done for every single trap in the game to have any effect? As far as I know there's no general Object trigger like LastTrapSpotted, so that would be a lot of copy pasting, not to mention the ammount of time needed to run through the entire script that way.
Yes, it does need to be done for every trap in the game.

No, it doesn't really take that long for the script to run through and do what needs to be done.

 

I build the code for my hotkey actions during install, so I don't have to do a bunch of typing. I still have bugs in other parts of my script, but what I described above works without a hitch. When I feel it's bug free, I plan to release it upon the world! ;)

 

I suppose, I could be nice and share that part of the tp2 code though. :(

Then all the original poster would need to do is modify their monk's thief ability stats.

 

So here it is with some modification.

1) I don't know the script you would want to add it to so I'm changing all instances of my script name to dplayer2 and dplayer3 that would allow this feature to be used with any other script available.

2) I also replaced my @TRA-NUM with the actual text strings (so I would only have to include one file for now)

3) It's all ready to run as a component in a mod.

4) To run it as a standalone:

A) Create subdir in game dir "AB_ThiefScript"

B) Add the following before the BEGIN at the very top BACKUP ~AB_ThiefScript/backup~

AUTHOR ~plainab @ forums of G3, PocketPlane & TeamBG~.

C) Save it as AB_ThiefScript.TP2

D) Copy the EXE of any other mod and rename it as Setup-AB_ThiefScript.exe

 

Enjoy!

EDIT: I recently moved this into it's own component and found things that needed to be adjusted. Since what I had posted before wouldn't work the way it was. I'm replacing it with this newer code. Also, removed the FindTraps() action as that wasn't really needed. With a specific trap named within the DetectTrap trigger, the FindTrap() action seemed redundant. Plus it's only use was to display unneeded text in the text box.

//----------------
// Hotkey Ability: Remove Traps
//----------------
BEGIN ~Hotkey Ability: Remove Traps~ //@28
// REQUIRE_COMPONENT ~ABpartyscript.tp2~ ~0~ ~Main MOD Component Required~
OUTER_SPRINT ie_file ~ar~
ACTION_IF (FILE_EXISTS_IN_GAME ~FW2600.are~) THEN BEGIN
OUTER_SPRINT ie_file ~fw~
END
<<<<<<<< inlined/thief_hotkey.baf
IF
 HotKey(%F2%)
 ActionListEmpty()
 !See([ENEMY])
 Or(2)
  Class(Myself,THIEF_ALL)
  CheckStatGT(Myself,30,TRAPS)
 AreaCheck("%area%")
 Detect("%trigger%")
 !Disarmed("%trigger%")
THEN
 RESPONSE #100
RemoveTraps("%trigger%")
Continue()
END
>>>>>>>>
PRINT ~Do you wish to reassign the Hotkey for finding and removing traps?
Current hotkey is (F)
[1] YES  [2] NO~//@16
ACTION_READLN ~hk~
OUTER_WHILE ((%hk% != 1) AND (%hk% != 2)) BEGIN
PRINT ~Invalid Response. Please try again.~//@5
PRINT ~Do you wish to reassign the Hotkey for finding and removing traps?
Current hotkey is (F)
[1] YES  [2] NO~//@16
ACTION_READLN ~hk~
END
OUTER_SPRINT F2 ~F~
ACTION_IF (%hk% = 1) THEN BEGIN
PRINT ~Please Enter the new hotkey and press ENTER~//@17
ACTION_READLN ~F2~
OUTER_WHILE !(~%F2%~ STRING_COMPARE_REGEXP ~[A-Z]~ =0) BEGIN
 PRINT ~Invalid Response. Please try again.~//@5
 PRINT ~Please Enter the new hotkey and press ENTER~//@17
 ACTION_READLN ~F2~
END
END
PRINT ~Please be patient.  This will take a few moments~//@27
OUTER_PATCH ~this_is_not_a_variable~ BEGIN
FOR ("i1" = 0x0; "i1" < 0x100; "i1" += 0x1) BEGIN
 WRITE_BYTE 0x0 "i1"
 READ_ASCII 0x0 ~c~ (0x1)
 SPRINT EVALUATE_BUFFER ~0t%i1%~ ~%c%~
END
END
COPY_EXISTING_REGEXP GLOB ~^%ie_file%.*\.are$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x11b) THEN BEGIN
 SPRINT area ~%SOURCE_RES%~
 READ_SHORT 0x5a "tc"
 READ_LONG  0x5c "to"
 READ_LONG  0x70 "co"
 READ_SHORT 0x74 "cc"
 READ_LONG  0xa4 "dc"
 READ_LONG  0xa8 "do"
 FOR ("i1" = 0x00; "i1" < ("tc" * 0xc4); "i1" += 0xc4) BEGIN
  SPRINT ~trigger~ ~~
  READ_SHORT ("to" + "i1" + 0x68) "trap_detect"
  READ_SHORT ("to" + "i1" + 0x6a) "trap_disarm"
  READ_SHORT ("to" + "i1" + 0x6c) "trapped"
  READ_SHORT ("to" + "i1" + 0x20) trig_type
  READ_LONG ("to" + "i1" + 0x60) flag
  PATCH_IF ( (%trig_type% = 0)
	  AND ("trap_detect" < 0x64)
	  AND ("trap_disarm" < 0x64)
	  AND ((%flag% BAND 0b1000) = 0b1000)
	  AND (("trapped" & 0x01) = 0x01) ) THEN BEGIN
FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
 READ_BYTE ("to" + "i1" + "i2") "char"
 PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
  SET "i2" = 0x20
 END
 ELSE
 PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
  READ_ASCII ("to" + "i1" + 0x00) ~trigger~ ("i2")
  INNER_ACTION BEGIN
			OUTER_FOR (dp=2;dp<4;dp+=1) BEGIN
		EXTEND_BOTTOM ~dplayer%dp%.bcs~ ~inlined/thief_hotkey.baf~
	EVALUATE_BUFFER
			END
  END
  SET "i2" = 0x20
 END
END
  END
 END
 FOR ("i1" = 0x00; "i1" < ("cc" * 0xc0); "i1" += 0xc0) BEGIN
  SPRINT ~trigger~ ~~
  READ_SHORT ("co" + "i1" + 0x2c) "trap_detect"
  READ_SHORT ("co" + "i1" + 0x2e) "trap_disarm"
  READ_SHORT ("co" + "i1" + 0x30) "trapped"
  PATCH_IF ( ("trap_detect" < 0x64)
	  AND ("trap_disarm" < 0x64)
	  AND (("trapped" & 0x01) = 0x01)) THEN BEGIN
FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
 READ_BYTE ("co" + "i1" + "i2") "char"
 PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
  SET "i2" = 0x20
 END
 ELSE
 PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
  READ_ASCII ("co" + "i1" + 0x00) ~trigger~ ("i2")
  INNER_ACTION BEGIN
			OUTER_FOR (dp=2;dp<4;dp+=1) BEGIN
		EXTEND_BOTTOM ~dplayer%dp%.bcs~ ~inlined/thief_hotkey.baf~
	EVALUATE_BUFFER
			END
  END
  SET "i2" = 0x20
 END
END
  END
 END
 FOR ("i1" = 0x00; "i1" < ("dc" * 0xc8); "i1" += 0xc8) BEGIN
  SPRINT ~trigger~ ~~
  READ_SHORT ("do" + "i1" + 0x6c) "trap_detect"
  READ_SHORT ("do" + "i1" + 0x6e) "trap_disarm"
  READ_SHORT ("do" + "i1" + 0x70) "trapped"
  READ_LONG ("do" + "i1" + 0x28) "flag"
  PATCH_IF ( ("trap_detect" < 0x64)
	  AND ("trap_disarm" < 0x64)
	  AND ((%flag% BAND 0b1000) = 0b1000)
	  AND (("trapped" & 0x01) = 0x01)) THEN BEGIN
FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
 READ_BYTE ("do" + "i1" + "i2") "char"
 PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
  SET "i2" = 0x20
 END
 ELSE
 PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
  READ_ASCII ("do" + "i1" + 0x00) ~trigger~ ("i2")
  INNER_ACTION BEGIN
			OUTER_FOR (dp=2;dp<4;dp+=1) BEGIN
		EXTEND_BOTTOM ~dplayer%dp%.bcs~ ~inlined/thief_hotkey.baf~
	EVALUATE_BUFFER
			END
  END
  SET "i2" = 0x20
 END
END
  END
 END
END
BUT_ONLY_IF_IT_CHANGES

Oh, and Nythrun helped me get the clean container names so part of the thanks should head that way too.

Link to comment

Archived

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

×
×
  • Create New...