Jump to content

Preventing an existing script block from firing


Kish

Recommended Posts

I need a way to prevent an already-existing unmodded script block from firing. That is, I need

 

IF

Global("TelwynSpawn","GLOBAL",0)

OR(5)

Class(Player1,CLERIC)

Class(Player1,FIGHTER_CLERIC)

Class(Player1,CLERIC_MAGE)

Class(Player1,CLERIC_THIEF)

Class(Player1,FIGHTER_MAGE_CLERIC)

Alignment(Player1,MASK_GENEUTRAL)

THEN

RESPONSE #100

SetGlobal("TelwynSpawn","GLOBAL",1)

CreateCreature("SCTELWYN",[705.711],4) // Guardian Telwyn

END

 

not to go off. I could add something that automatically sets TelwynSpawn to 1 and recode everything currently dependent on TelwynSpawn, but I'm hoping there's a simpler way. Ideal would be a way to add False() to the conditions for the script block, and I'm nearly certain I once knew a way to do something like that, I just can't quite remember it now.

Link to comment

You are right, using False() is the easiest way to do it.

 

Just look for a trigger which is unique in the script and use it in your search-and-replace operation. For example

COPY_EXISTING ~existingscript.bcs~ ~override~
DECOMPILE_AND_PATCH BEGIN
	REPLACE_TEXTUALLY CASE_INSENSITIVE
		~\(Global("TelwynSpawn","GLOBAL",0)\)~ ~False() \1~
END
BUT_ONLY

will add the False() trigger right before Global("TelwynSpawn","GLOBAL",0).

Link to comment

Archived

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

×
×
  • Create New...