Scripting Help

Discussions and questions about the CS and mods for Morrowind
Locked
Parshath20
Layman
Layman
Posts: 2
Joined: Mon Mar 30, 2009 6:03 pm

Scripting Help

Post by Parshath20 »

Here's my issue:

I have an NPC placed in the non-GOTY edition of Morrowind and I want him to do a ForceGreeting on the PC ONLY when the PC is not wearing any clothes. Basically a warning from afar to put some clothes on. I've gone through several scripting tutorials and have not figured out how to implement the PC clothing modifier into a script.

I've used the script from the Orc Lugrub Gro-Ugdum in the Gnisis Eggmine as a template and it worked for the ForceGreeting, timer function, and StartCombat but I want my NPC to only do the ForceGreeting and only to naked PCs.

Any help would be appreciated. Thanks.
User avatar
Kestral
Grand Master
Grand Master
Posts: 2970
Joined: Thu Oct 16, 2008 12:41 am
ES Games: All of them (ESO is not ES)
Platform: PC
Status: [&@%!]

Post by Kestral »

Here we go-

Delete all default greetings.
Make two new ones.

This one is the standard, wearing clothes greeting, and result:

Code: Select all

Goodbye


This one is the one in which the NPC will attack you.

Code: Select all

Function/Variable
Function PC Clothing Modifier <= 0
NotID crassius curio = 0 
NotLocal NoLore = 0
The result (TEXT BOX) should be:

Code: Select all

ModFight 100
Goodbye
If that doesn't work, try:

Code: Select all

StartCombat
Goodbye

That finishes it for the Dialogue.

The script:

Code: Select all

begin ZZZ_ATTACKNOCLOTH
short DoOnce
float timer

if ( CellChanged == 1 )
	Set doOnce to 0
	Set timer to 0
	Return
endif

if ( doOnce == 0 )
	if ( GetDistance Player < 400 )
		Set doOnce to 1
		ForceGreeting
		Set timer to 0
	endif
endif
Locked