Jump to content


Removing Special Abilities


  • Please log in to reply
6 replies to this topic

#1 -Moonfruit-

-Moonfruit-
  • Guest

Posted 04 August 2003 - 08:35 AM

I was wondering if there is any way to remove a character's special ability via script.

What I mean is this: I've appended SPELL.IDS with two custom spells (say SPIN111 SPECIAL_A and SPIN112 SPECIAL_B)

Now I have coded something like this:

IF
Level(Myself,10)
Global("SpecialA","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("SpecialA","LOCALS",1)
AddSpecialAbility("SPIN111")
END

IF
Level(Myself,11)
Global("SpecialB","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("SpecialB","LOCALS",1)
RemoveSpell("SPIN111")
AddSpecialAbility("SPIN112")
END

The problem is that it doesn't remove the old spell. Any suggestions?

Thanx

#2 Kwiat_W

Kwiat_W
  • Modder
  • 290 posts

Posted 04 August 2003 - 11:24 AM

Create new spell with effect "Remove spell" and set it to be cast when NPC gain a level.

icon11.gif W_GUI - a GUI replacement for Baldur's Gate 2/TUTU/BGT/CA
icon11.gif W_PackMule - Your own pack mule for Baldur's Gate 2/Tutu/BGT/CA, BGEE and BG2:EE

icon11.gif Psionics Unleashed - play as a Psion, mod for Baldur's Gate 2/Tutu/BGT/CA

 


#3 Kwiat_W

Kwiat_W
  • Modder
  • 290 posts

Posted 04 August 2003 - 01:39 PM

Or you may add this to your script:

If
LevelGT(Myself,10)
Then
RESPONSE #100
RemoveSpell("SPIN111")
END

The problem with your script is that action "RemoveSpell" removes the spell from the list of memorized spells, not from the list of known spells, so when you are rested it will be available again.
Using LevelGT and not checking Global varible will make you to forget the spell immediately after resting.


(After some time I start to think that I may be wrong in both cases. But if I'm wrong then probably someone will correct me soon)

Edited by Kwiat_W, 04 August 2003 - 01:54 PM.

icon11.gif W_GUI - a GUI replacement for Baldur's Gate 2/TUTU/BGT/CA
icon11.gif W_PackMule - Your own pack mule for Baldur's Gate 2/Tutu/BGT/CA, BGEE and BG2:EE

icon11.gif Psionics Unleashed - play as a Psion, mod for Baldur's Gate 2/Tutu/BGT/CA

 


#4 -Moonfruit-

-Moonfruit-
  • Guest

Posted 05 August 2003 - 07:41 AM

When I try to use the RemoveSpell command now, my entire game just freezes. Strange :huh:

I was thinking along the lines of using the same coding that is used when the PC loses his/her Bhaalspawn powers, but I am as of yet unable to locate that specific spell or script.

#5 Andyr

Andyr

    HERR RASENKOPF

  • Member
  • 2318 posts

Posted 05 August 2003 - 09:16 AM

Oh, I've definitely seen that spell in NI- it's called Loses all Bhaalpowers or something, so I'm sure the search would pick it up.

I'll have a closer look tomorrow if you want. B)
"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"

#6 Azrii

Azrii

    Iltha Windspear

  • Member
  • 65 posts

Posted 05 August 2003 - 09:05 PM

Moonfruit Posted: Aug 5 2003, 05:41 PM

...loses his/her Bhaalspawn powers...


;) It is in cut41I.bcs. The relevant command is:
ReallyForceSpell(Player1,LOSE_ALL)

SPIN838.spl is the paarticular spell.

Edited by Azrii, 06 August 2003 - 01:05 AM.

Minister of disinformation
Iltha Windspear
Working on Iltha Windspear Expansion. At left is Iltha, not me! I'm a guy. Who's Azrii you ask? She's the one who taught me it's a lot easier to fly with a basic storyline in hand as opposed to relying on my 'intuitive and ingenious' imagination.

#7 -Moonfruit-

-Moonfruit-
  • Guest

Posted 06 August 2003 - 09:27 AM

Yup, thanks. I did manage to find the file and am busy extending my script and spell files as needed.

I'll test it out later this week.