Author Topic: Nilthiri  (Read 18278 times)

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 859
  • Dreaming of a red Xmas
    • The Gibberlings Three
Nilthiri
« on: November 18, 2006, 08:34:48 AM »
Nilthiri. :(

Unfortunately, both Fixpack and UB working on Nilthiri cause her to be unkillable. That aside, UB does have some slight bugs in its implementation here: Nilthiri is assigned scripts to force her to fall down and be killed by fire/acid, like other trolls. However, she isn't assigned an item to prevent her from dying, so it's improbable that she'll fall down and play dead. If it does happen and the party doesn't finish her off, she'll pop back up blue-circled and may try to re-initiate dialogue. edit: I stand corrected. UB adds scripting to make her hostile and skip trying to initiate dialogue, but there's still a brief hesitation when she's blue-circled. I'd suggest replacing the existing code:

Code: [Select]
COPY_EXISTING ~DRSHNL01.CRE~ ~override/DRSHNL01.CRE~ /* Nilthiri */
WRITE_ASCII   ~0x248~ ~DRSHNL01~                     /* Assigns the appropriate script */
WRITE_LONG    ~0x250~ 0x00000000

EXTEND_TOP ~DRSHNL01.bcs~ ~ub/misc/u!nilthi.baf~     /* Fixes Nilthiri's script */

COMPILE ~ub/misc/DRSHNL02.baf~

with this, lifted and modified from Fixpack:

Code: [Select]
ACTION_IF NOT FILE_EXISTS_IN_GAME ~cdbehbla.pro~ THEN BEGIN // if Fixpack isn't installed

  // restore Nith's attack script, pt 1: false() out stuff that'll break
  COPY_EXISTING ~drshnl01.bcs~ ~override~
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~HPLT(Myself,10)~ ~False()~
    COMPILE_BAF_TO_BCS
    BUT_ONLY_IF_IT_CHANGES
 
  // new troll scripts to transform to dead versions at low HP
  COPY_EXISTING ~troll01.bcs~ ~override/drshnl02.bcs~
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~ChangeAnimationNoEffect("TROLL02")~ ~ChangeAnimationNoEffect("%DEST_RES%")~
    COMPILE_BAF_TO_BCS
 
  // new troll scripts to transform from dead to alive after time expires
  COPY_EXISTING ~troll02.bcs~ ~override/drshnl03.bcs~
    DECOMPILE_BCS_TO_BAF
      REPLACE_TEXTUALLY ~ReallyForceSpell(Myself,TROLL_CHANGE)~ ~ReallyForceSpellRES("%DEST_RES%",Myself)~
    COMPILE_BAF_TO_BCS
   
  // create 'dead' or 'knocked down' versions of 'special' trolls
  COPY_EXISTING ~drshnl01.cre~ ~override/drshnl02.cre~
    WRITE_SHORT  0x24    1            // current HP
    WRITE_SHORT  0x46   10            // natural AC
    WRITE_SHORT  0x48   10            // effective AC
    WRITE_BYTE   0x5a  100            // resist cold
    WRITE_BYTE   0x5b  100            // resist electricity
    WRITE_BYTE   0x5f  100            // resist magic cold
    WRITE_BYTE   0x60  100            // resist slashing
    WRITE_BYTE   0x61  100            // resist crushing
    WRITE_BYTE   0x62  100            // resist piercing
    WRITE_BYTE   0x63  100            // resist missile
    WRITE_BYTE   0x23c   9            // dexterity
    WRITE_BYTE   0x270 255            // enemy
    WRITE_ASCII  0x248 ~drshnl03~
    WRITE_ASCII  0x250 ~~ #32         // blanks all other script references
    // item changes
    READ_LONG 0x2bc "itm_off"
    READ_LONG 0x2c0 "itm_num"
    FOR (index = 0 ; index < itm_num ; index = index + 1) BEGIN
      READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item"
      PATCH_IF (
                 ("%item%" STRING_COMPARE_CASE "monhp1" = 0) OR   // so they can die
                 ("%item%" STRING_COMPARE_CASE "trollreg" = 0) OR // can't regenerate
                 ("%item%" STRING_COMPARE_CASE "trollspi" = 0)    // makes dead spirit troll invisible
               ) BEGIN
        WRITE_ASCII ("%itm_off%" + (0x14 * "%index%")) ~trolldie~
      END
    END
   
  // add monhp1 item to trolls to prevent death; assign script to force transformation to dead form at low HP
  COPY_EXISTING ~drshnl01.cre~ ~override~
    ADD_CRE_ITEM ~monhp1~ #0 #0 #0 ~NONE~ ~AMULET~
    WRITE_ASCII 0x248 ~drshnl02~
    WRITE_ASCII 0x258 ~drshnl01~ // restore Nith's attack script, pt 2: assign script
   
  // one-off change for Nilthiri to prevent repeating dialogue after regenerating
  COPY_EXISTING ~drshnl01.cre~ ~override/drshnl03.cre~
    WRITE_ASCII 0x250 ~~ #8 // no approach and speak script
    WRITE_BYTE  0x270 255   // enemy
    WRITE_ASCII 0x2cc ~~ #8 // no dialogue file
   
  // spells to transform trolls back from dead to alive
  COPY_EXISTING ~spin955.spl~ ~override/drshnl03.spl~
    READ_LONG  0x64 "abil_off"
    READ_SHORT 0x68 "abil_num"
    READ_LONG  0x6a "fx_off"
    FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
      READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
      READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
      FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
        READ_SHORT ("%fx_off%" +        (("%abil_fx_idx%" + "%index2%") * 0x30)) "opcode"
        READ_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "eff_file"
        PATCH_IF (("%opcode%" = 151) AND ("%eff_file%" STRING_COMPARE_CASE "troll01" = 0)) BEGIN
          WRITE_EVALUATED_ASCII ("%fx_off%" + 0x14 + (("%abil_fx_idx%" + "%index2%") * 0x30)) "%DEST_RES%" #8
        END
      END
    END

END

It's definitely longer as it was written for multiple trolls, but it'll work just dandy. If Fixpack is detected it won't change anything.
« Last Edit: November 18, 2006, 09:35:47 AM by CamDawg »
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: Nilthiri
« Reply #1 on: July 18, 2007, 07:28:00 PM »
Added.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: