Quote from: Tervadh on July 20, 2008, 08:13:19 PMEh, sorry for the late response... e-mail notifications only work half the time it seems.
What Sikret said is accurate. There is in fact already a spell to apply drunkenness in the game (spwish33) though as a wish spell I think this makes everyone drunk, so you may want your own version. The script could be as simple as:
IFI'm sure someone's come up with something more sophisticated by now.
Global("mydrunk","GLOBAL",0)
CheckStatLT(LastTalkedToBy(),50,INTOXICATION)
THEN
RESPONSE #100
SetGlobal("mydrunk","GLOBAL",1)
ApplySpellRES("SPWISH33",LastTalkedToBy())
END
You can use the same opcode on an item, to make (for example) a bottle of wine that increases drunkenness when consumed.

Quote from: Sir_Carnifex on June 24, 2008, 09:58:53 PMAlright, I may be wrong, but it looks like that script only checks to see if the player is intoxicated. If it checks out, then it initiates the dialogue. I'm trying to do something a little different. Namely, have a character who is NOT drunk get set to intoxicated AFTER a dialogue. I don't see any SetStat action, so I assume that I have to do something with all that gibberish Tervadh mentioned.Eh, sorry for the late response... e-mail notifications only work half the time it seems.
. The script could be as simple as:IF
Global("mydrunk","GLOBAL",0)
CheckStatLT(LastTalkedToBy(),50,INTOXICATION)
THEN
RESPONSE #100
SetGlobal("mydrunk","GLOBAL",1)
ApplySpellRES("SPWISH33",LastTalkedToBy())
ENDI'm sure someone's come up with something more sophisticated by now.Quote from: Sikret on June 25, 2008, 06:12:39 AMThe method to do it is very easy. You make a custom spell which applies the intoxication effect and then forcecast it on the creature in the dialogue file or in a script (deending on the situation).Easy is a very relative word.
If you want, I can do it for you. Just send me your prefix (in order to name the new spell correctly to make sure that it won't cause conflicts with other mods) and the dialogue file in which you want to apply the effect (you can send them to me via PM if you want).

Quote#94 (0x05E) Stat: Drunkenness Modifier [94]Parameter #1: Statistic Modifier
Parameter #2: Type
Description:
Applies the modifier value specified by the 'Statistic Modifier' field in the style specified by the 'Type' field.
Known values for 'Type' are:
0 Cumulative Modifier -> Skill = Skill + 'Statistic Modifier' value
1 Flat Value Modifier -> Skill = 'Statistic Modifier' value
2 Percentage Modifier -> Skill = (Skill * 'Statistic Modifier' value) / 100

Quote from: Tervadh on June 22, 2008, 02:41:19 PMAlright, back to the intoxication thing. I have to admit that when I look at this explanation, then the stats, then the set spell, then the opcodes, I'm sure if anyone were looking at me, he'd see question marks floating above my head. So would it be too much to ask for a demonstration of HOW to use these to set a character to be drunk after a dialogue? Thanks!Quote from: Sir_Carnifex on June 22, 2008, 04:05:59 AMThe second question is:It's a stat (stats.ids) not a state (state.ids). So you can do a StatCheck and then apply a Drunkenness modifier (opcode #94) via spell, etc.
How do I go about setting a character's state to intoxicated? I couldn't find any specific state for that. The only thing I could find was the wish spell.
Quote from: Sir_Carnifex on June 22, 2008, 10:43:27 PMAnother Edit. I forgot to answer Moongaze. Sorry 'bout that!Quote from: Moongaze"The next in the series" being the next part of the same banter, or an entirely new banter block that needs to fire after the current one being finished? In the latter case, I tend not to use APPEND and EXTERN if it only involves my NPC and a Bioware NPC... and I'd set a timer if I don't want the internal banter engine to randomly choose when to fire the follow-up to the previous dialogue.It's a new banter block. I do use APPEND and EXTERN because of the complicated nature of what I'm doing. Well, it's complicated for me anyway! Maybe once I get more experience, I'll learn simpler ways to do these things. For now, go with what works.
Oh, and the second dialogue uses the J.DLG, so the banter timer doesn't come into play.
Quote from: Tervadh on June 22, 2008, 02:41:19 PMI'll take a look and see what I can do. ThanksQuote from: Sir_Carnifex on June 22, 2008, 04:05:59 AMThe second question is:It's a stat (stats.ids) not a state (state.ids). So you can do a StatCheck and then apply a Drunkenness modifier (opcode #94) via spell, etc.
How do I go about setting a character's state to intoxicated? I couldn't find any specific state for that. The only thing I could find was the wish spell.
APPEND BKORGAN
IF ~InParty("CXHalbo")
See("CXHalbo")
!Dead("CXHalbo")
!StateCheck("CXHalbo",STATE_SLEEPING)
Global("KorganHalbo1","GLOBAL",0)~ THEN BEGIN KorganHalboTalkDwarf1
SAY ~Blah Blah.~
IF ~~ THEN DO ~SetGlobal("KorganHalbo1","GLOBAL",1)~ GOTO KorganHalboTalkDwarf1.01
END
END
APPEND BKORGAN
IF ~~ THEN BEGIN KorganHalboTalkDwarf1.01
SAY ~Blah Blah.~
IF ~~ THEN EXTERN BCXHALBO KorganHalboTalkDwarf1.1
END
ENDQuote from: Moongaze"The next in the series" being the next part of the same banter, or an entirely new banter block that needs to fire after the current one being finished? In the latter case, I tend not to use APPEND and EXTERN if it only involves my NPC and a Bioware NPC... and I'd set a timer if I don't want the internal banter engine to randomly choose when to fire the follow-up to the previous dialogue.It's a new banter block. I do use APPEND and EXTERN because of the complicated nature of what I'm doing. Well, it's complicated for me anyway! Maybe once I get more experience, I'll learn simpler ways to do these things. For now, go with what works.

Quote from: Sir_Carnifex on June 22, 2008, 04:05:59 AMThe second question is:It's a stat (stats.ids) not a state (state.ids). So you can do a StatCheck and then apply a Drunkenness modifier (opcode #94) via spell, etc.
How do I go about setting a character's state to intoxicated? I couldn't find any specific state for that. The only thing I could find was the wish spell.