So...it is possible for him to be in leopard form most of the time, and being able to polymorph back into his human form that lasts for a few hours before he is polymorphed back. It is possible for him to be unable to interact verbally with other NPC's and the PC while in leopard form.
Yes, to both.
How would it work when you first encounter him? Would he always be human when you first meet him (until he joins the party, which would start the polymorph cycle), or would he possibly polymorph back into leopard form even before you get the chance to meet him? The second option is more in the spirit of the theme, not to mention the interesting dialogue the PC would have with the leopard. Perhaps requiring Cernd and/or Minsc to get him to join then.
Yes, it's possible to do it the second way, no matter whether you opt to follow Miloch's suggestion or mine. And don't forget that Jahiera is also a druid, or that Valygar is also a ranger. Neither really shows much inclination to commune with animals, however, so if you wanted to limit help of that kind to Cernd and/or Minsc, you could do that. You could also make it possible for any PC or
NPC with a druid/ranger class/kit to speak with him in leopard form. Entirely up to you.
I will make this one small suggestion, however. It might seem fun from a certain perspective to add that element of realism, but when you're sitting there staring at a complex dialogue file and trying to figure out what went wrong, it won't seem so fun. Doing things the easy way might, at times, seem like you're sacrificing truth for convenience, and perhaps you are. Whether you ultimately decide to simplify or not will depend on a balance between the amount of time you want to devote to the project, your coding knowledge, and your desire to inconvenience players as little as necessary. Where the balance lies is up to you to discover.
Another important thing to ask is whether or not the polymorph cycle can be removed/disabled altogether? Later in the game, I might want to include the option to let him have his wish, which is to be fully human again, without the leopard thing.
If you go the variable route, you could do that very easily by simply creating a "stop variable" in the dialogue where he loses his curse. You wouldn't need to create another variable for this purpose. Supppose you're using ##Leopard=0 for his human form before the timer gets set, ##Leopard=1 for his human form with his change timer set, ##Leopard=2 for his leopard form before the change timer is set (one game day before he can change back into a human again), and ##Leopard=3 for leopard form with his change timer set. Now, as long as he's human (##Leopard=0 or 1) when the talk that keeps him human occurs, you could advance ##Leopard to something outside that range, like ##Leopard=9, and the timer for him to change back into a leopard.
This is hard to explain without examples. Since it's easier for me to explain using the variable/timer method, I'll use that route. It should be possible to remove a spell from a creature during the course of the game, whether by changing his kit or just removing the spell, but I never got into spell modding beyond the most basic applications (item creation, portrait changes, that kind of thing), so if you opted to go that route, somebody else would have to explain how to remove the spells.
Anyway, let's start with his regular script. If you wanted to have him change into a leopard involuntarily if his timer expires once he's talked to but before he's actually recruited, you'd put this in the area script where you want him to spawn.
IF
Exists("##MyDV") // ## is your prefix, here and elsewhere, MyDV is your NPC's death variable ('script name' in NI)
Global("##MyNPCTalkedTo","ARxxxx",1) // set this the first time he speaks to the party, ARxxxx is the area
Global("##Leopard","GLOBAL",0)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobalTimer("##LeopardTime","GLOBAL",THREE_HOURS)
SetGlobal("##Leopard","GLOBAL",1)
END
IF
GlobalTimerExpired("##LeopardTime","GLOBAL")
Global("##Leopard","GLOBAL",1)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
ApplySpell("##MyDV",##LEP1) // Check syntax, ##LEP1 changes him to a leopard
SetGlobal("##Leopard","GLOBAL",2)
END
IF
Exists("##MyDV") // ## is your prefix, here and elsewhere, MyDV is your NPC's death variable ('script name' in NI)
Global("##MyNPCTalkedTo","ARxxxx",1) // set this the first time he speaks to the party, ARxxxx is the area
Global("##Leopard","GLOBAL",2)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobalTimer("##LeopardTime","GLOBAL",ONE_DAY)
SetGlobal("##Leopard","GLOBAL",3)
END
IF
GlobalTimerExpired("##LeopardTime","GLOBAL")
Global("##Leopard","GLOBAL",3)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
ApplySpell("##MyDV",##LEP2) // Check syntax, ##LEP2 changes him back into a human
SetGlobal("##Leopard","GLOBAL",0)
END
Easy enough?
So let's move on to his override script. Let's call it ##MyNPCS.baf
IF
InParty(Myself) // ## is your prefix, here and elsewhere, MyDV is your NPC's death variable ('script name' in NI)
Global("##Leopard","GLOBAL",0)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobalTimer("##LeopardTime","GLOBAL",THREE_HOURS)
SetGlobal("##Leopard","GLOBAL",1)
END
IF
GlobalTimerExpired("##LeopardTime","GLOBAL")
Global("##Leopard","GLOBAL",1)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
ApplySpell(Myself,##LEP1) // Check syntax, ##LEP1 changes him to a leopard
SetGlobal("##Leopard","GLOBAL",2)
END
IF
InParty(Myself) // ## is your prefix, here and elsewhere, MyDV is your NPC's death variable ('script name' in NI)
Global("##Leopard","GLOBAL",2)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobalTimer("##LeopardTime","GLOBAL",ONE_DAY)
SetGlobal("##Leopard","GLOBAL",3)
END
IF
GlobalTimerExpired("##LeopardTime","GLOBAL")
Global("##Leopard","GLOBAL",3)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
ApplySpell(Myself,##LEP2) // Check syntax, ##LEP2 changes him back into a human
SetGlobal("##Leopard","GLOBAL",0)
END
So, what happens if he's kicked out? Wouldn't he stay in whatever form he was last in? Not if you didn't want him to.
You're going to have to send him somewhere. I don't know if he'd really want to go back to the Guarded Compound to hang out, but if he's going to be changing back and forth between a leopard and a human, he's going to have to go someplace safe, yet someplace he could potentially buy supplies, while human. So let's say he goes to the Umar Hills. That's AR1100. I'll leave it to you to find the coordinates.
You'd put this in the area script for the Umar Hills, AR1100.bcs
IF
Exists("##MyDV") // ## is your prefix, here and elsewhere, MyDV is your NPC's death variable ('script name' in NI)
!InParty("##MyDV") // he's already been in the party once, but now he's not
Global("##Leopard","GLOBAL",0)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobalTimer("##LeopardTime","GLOBAL",THREE_HOURS)
SetGlobal("##Leopard","GLOBAL",1)
END
IF
GlobalTimerExpired("##LeopardTime","GLOBAL")
Global("##Leopard","GLOBAL",1)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
ApplySpell("##MyDV",##LEP1) // Check syntax, ##LEP1 changes him to a leopard
SetGlobal("##Leopard","GLOBAL",2)
END
IF
Exists("##MyDV") // ## is your prefix, here and elsewhere, MyDV is your NPC's death variable ('script name' in NI)
!InParty("##MyDV") // he's alredy been in the party once, but now he's not
Global("##Leopard","GLOBAL",2)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobalTimer("##LeopardTime","GLOBAL",ONE_DAY)
SetGlobal("##Leopard","GLOBAL",3)
END
IF
GlobalTimerExpired("##LeopardTime","GLOBAL")
Global("##Leopard","GLOBAL",3)
!StateCheck("##MyDV",CD_STATE_NOTVALID)
THEN
RESPONSE #100
ApplySpell("##MyDV",##LEP2) // Check syntax, ##LEP2 changes him back into a human
SetGlobal("##Leopard","GLOBAL",0)
END
So, how about disabling that shape change? That will be the easiest thing I've had to explain so far. This is the dialogue state where the curse is removed. It will be somewhere in somebody's dialogue file. Since we're using a global variable for this, it won't matter whose dialogue file or where. It could even be in
ToB, since variables are carried over.
IF ~~ over_at_last
SAY ~At last, I am free of that curse, now and forever.~
IF ~~ THEN DO ~SetGlobal("##Leopard","GLOBAL",9)~ EXIT
END
And that's it. You never have to think about spell durations or timers expiring or anything else with regards to shape change ever again. And the spell will be simple, too, since all you're going to have to do is make the ##LEP1 change his animation to a leopard and make ##LEP2 remove the animation change. Just be sure to set the timing mode to 9-permanent after death, or he'll change back to a human if he dies or if somebody uses CTRL-R on him. And you'll probably want to set it for no dispell/bypass resistance, too. You'll see all about that when you actually make the spell.
Okay, my brain has fried for now, so I'll serve it with some chips later today. I'll get working on dialogue as you suggest. I can do that, at least. I have my trusty Quill Of Rapid Writing +2 ready. Now all I need to do is write stuff that makes sense. One little mistake turns Aerie into an ogre. Oh wait, she is.
That sense of humor will serve you well.
NPC modding has its ups and downs, and a wide variety of headaches. Get the basics down first, and the rest will come later.
Edited by berelinde, 18 February 2010 - 07:02 AM.