Jump to content


Photo

Learning mage spells without gaining XP


  • Please log in to reply
8 replies to this topic

#1 vilkacis

vilkacis

    Rashemen REPRESENT! Word to yo hamsta!

  • Modder
  • 1571 posts

Posted 12 April 2009 - 06:21 PM

Is there a way to teach a character new mage spells without having them gain XP for it as if they had scribed a scroll? I'm trying to make an item that allows a certain spell to be used while it's held, and the fact that an item you can repeatedly click for 9k XP a pop is more broken than any spell it could possibly hope to teach is kind of ruining my fun. <_<

I'm using opcode 147 "learn spell". Attempts so far include teaching the spell directly on equip as well as doing it through an EFF or SPL, all with the same result.

#2 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 13 April 2009 - 07:18 AM

You mean, it adds a new spell into spellbook while equipped? Does it work, btw? I thought that, once learnt, a spell won't fade away without manual erasing.

Try the 106th opcode 'modify XP', though it will net false messages about xp gained. To avoid that, you can edit xpbonus.2da to eliminate natural bonuses, then adjust every scroll so it will grant the required amount via the same 106. Can be done with a macro of about 50 LOCs, I think.

Otherwise, well, nothing comes to mind. Only to skip the memorizing part, which, as I get it, is not an option.

Retired from modding.


#3 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 13 April 2009 - 08:33 AM

Well, it's a "HLA spell", so why not use the same principle, learn 10th level spell, with +0 XP. ^_^

Deactivated account. The user today is known as The Imp.


#4 vilkacis

vilkacis

    Rashemen REPRESENT! Word to yo hamsta!

  • Modder
  • 1571 posts

Posted 13 April 2009 - 09:03 AM

You mean, it adds a new spell into spellbook while equipped? Does it work, btw? I thought that, once learnt, a spell won't fade away without manual erasing.

Yes. It does seem work, though not in a simple and clean manner ("learn spell effective while equipped" is useless).

The item has:
Learn spell (Dragon's Breath for testing purposes)
Use EFF on condition (REMOVE, every second)
Protection from spell (UNLEARN, while equipped)
Cast spell (UNLEARN, delayed, 1)

The spell UNLEARN simply removes Dragon's Breath, and the REMOVE eff applies it with a few seconds' delay. So, even when the item is removed, there is always an UNLEARN spell counting down to take effect. (The delayed Cast Spell: UNLEARN is there in case the item is equipped and unequipped while the game is paused, which doesn't trigger the Use EFF.)

It would need more testing before I can say how reliable this is, though...


Try the 106th opcode 'modify XP', though it will net false messages about xp gained. To avoid that, you can edit xpbonus.2da to eliminate natural bonuses, then adjust every scroll so it will grant the required amount via the same 106. Can be done with a macro of about 50 LOCs, I think.

Otherwise, well, nothing comes to mind. Only to skip the memorizing part, which, as I get it, is not an option.

Argh. I am getting used to the fact that making the infinity engine do anything you want it to requires messy hax solutions, but that is ridiculous. Guess I'll just have to settle for a once-per-day use or something. Thanks, though.


Jarno: how? I am using a HLA spell to test this, but it still counts as a 9th-level spell and adds 9k XP every time.

#5 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 13 April 2009 - 09:41 AM

Jarno, I do believe that HLA spells are learnt via AP_SPLNAME, not any kind of opcode. So, not our case.

Retired from modding.


#6 Adul

Adul
  • Member
  • 61 posts

Posted 16 April 2009 - 03:17 AM

Did you try using opcode 171 instead of 147? Last time I've tried, 171 didn't give any XP.

#7 vilkacis

vilkacis

    Rashemen REPRESENT! Word to yo hamsta!

  • Modder
  • 1571 posts

Posted 16 April 2009 - 09:41 AM

I think I tried it, but it turned out to only grant "abilities", not "spells", which is not what I'm after.

#8 Adul

Adul
  • Member
  • 61 posts

Posted 16 April 2009 - 10:56 AM

Actually, I needed this with my new kit, and using 171 to add spells to your spellbook works perfectly.

It seems like the opcode used doesn't matter when determining whether the added SPL file will be treated as a wizard spell, priest spell or an innate ability. It is the value of the 'spell type' property inside your SPL file that determines that.

#9 vilkacis

vilkacis

    Rashemen REPRESENT! Word to yo hamsta!

  • Modder
  • 1571 posts

Posted 17 April 2009 - 11:19 AM

Huh. That is convenient. I'll give it another shot, then.