Jump to content


Photo

Adding innate abilities by level


  • Please log in to reply
2 replies to this topic

#1 ottomadenedamotto

ottomadenedamotto
  • Member
  • 30 posts

Posted 09 September 2010 - 01:12 PM

So, I've been looking through the tutorials to find a solution, but no luck yet. I'd like to give my NPC the Blade's Offensive Spin (GA_spcl521) once per day at level 5, 15, 25, and 35. Is there a way to do this that doesn't involve making an entirely new kit for the character and gives the ability at those levels (not all at once when they join?)

#2 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 09 September 2010 - 11:41 PM

So, I've been looking through the tutorials to find a solution, but no luck yet. I'd like to give my NPC the Blade's Offensive Spin (GA_spcl521) once per day at level 5, 15, 25, and 35. Is there a way to do this that doesn't involve making an entirely new kit for the character and gives the ability at those levels (not all at once when they join?)

Can be done, you just have to script it... you can use the same script that you use to make the character to have dialog with the PC, for example, you just have to add to it(append)... the GA_spcl521 is actually the "kit bonus" that allows the character to gain the ability, not the actual spell that is gained which is the "spcl521.spl". Now, to be able to add the script system that does this, you first have to assign a script to the character, the .cre file can have 5 scripts, like shown in here(the off sets 0x0248 ... 0x0268). Theres NPC tutorials that define how to do this in WeiDU mod(WeiDU readme), theacefer's is good example... it would also be preferable if you have your own prefix for the moding ...

Now then you need to append to that script something a like this kind of structure:
IF
    Global("ottomadens_addon","GLOBAL",0)
    LevelGT(Myself,4)
  THEN
    RESPONSE #100
      SetGlobal("ottomadens_addon","GLOBAL",1)
      AddSpecialAbility("spcl521")
  END

IF
    Global("ottomadens_addon","GLOBAL",1)
    LevelGT(Myself,14)
  THEN
    RESPONSE #100
      SetGlobal("ottomadens_addon","GLOBAL",2)
      AddSpecialAbility("spcl521")
  END

IF
    Global("ottomadens_addon","GLOBAL",2)
    LevelGT(Myself,24)
  THEN
    RESPONSE #100
      SetGlobal("ottomadens_addon","GLOBAL",3)
      AddSpecialAbility("spcl521")
  END
IF
    Global("ottomadens_addon","GLOBAL",3)
    LevelGT(Myself,34)
  THEN
    RESPONSE #100
      SetGlobal("ottomadens_addon","GLOBAL",4)
      AddSpecialAbility("spcl521")
  END
Yeah, the "ottomadens_addon" global can be whatever you wish, as long as it's less than ~32 letters/marks long, the quote marks not included... or I could be wrong on the AddSpecialAbility("spcl521")... as I haven't tried this myself to be certain. But still you should get the point.
Edit: Spellcheck, check.

Edited by Jarno Mikkola, 10 September 2010 - 02:30 PM.

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


#3 ottomadenedamotto

ottomadenedamotto
  • Member
  • 30 posts

Posted 10 September 2010 - 12:53 PM

Great!  Thanks a bunch.