Skip to content

How to add an ITM to a Kit upon level up and upgrade it at certain levels?

CorsymyrCorsymyr Member Posts: 146
OK I am new to Modding, and I am not a programmer, but I have a kit I am working on and I want to add a feature. Upon leveling up to 3 I want to add an ITM file to the Kit. Then again at 6, 9, and 15. I have the ITM files written and ready to go, the information for the ITM's is in the TP2 file. I can CLUA them in, but I want it to be automatic, with maybe a "Your weapon has improved" statement.

Any help would be very appreciated.

TIA.

Comments

  • FeatherFeather Member Posts: 20
    edited January 2013
    IF
    !HasItem("weapon1",Myself)
    CheckStatGT(Myself,3,LEVEL)
    Class(Myself,THIEF_ALL)
    THEN
    RESPONSE #100
    CreateItem("weapon1",0,0,0)
    FillSlot(SLOT_WEAPON)
    END

    --------------------------------------------
    IF
    HasItem("weapon1",Myself)
    CheckStatGT(Myself,6,LEVEL)
    Class(Myself,THIEF_ALL)
    THEN
    RESPONSE #100
    TakeItemReplace("weapon2","weapon1",Myself)
    END

    This is the basic script (i think) you would have to add - replace "weapon1" and "Thief_all" with the files you need.
    But then you still need to repeat this action for each level and make the items undropable (or find an other way to ensure that the trigger will run.

    I'm new to modding, too, so the script could be wrong :P.
  • CorsymyrCorsymyr Member Posts: 146
    Thanks @feather. Do I save this information in my TP2 file or do I create a BCS file and call it somehow?
  • FeatherFeather Member Posts: 20
    @Corsymyr:
    Sorry i forgot about that:
    DPLAYER2.BCS and DPLAYER3.BCS are the files that need the added lines :)
  • CorsymyrCorsymyr Member Posts: 146
    After looking at this in some detail, my fear is that once these BCS files are edited it will impact all characters that one creates; whereas I am only wanting it to impact the new Kit. Is there a IF statement I can add for class? How about adding the item at Character Creation, and just copying over it? It can be non-dropable as well.
  • CorianderCoriander Member Posts: 1,667
    edited January 2013
    You could create a spell that creates an inventory item (opcode #122) and apply it at level up using whatever CLAB 2DA your kit uses. Just make sure you set the timing to Instant/Permanent(9).

    Edit: You could also remove the old item using another effect on the spell. I think.
  • CorsymyrCorsymyr Member Posts: 146
    @Coriander - Thanks that is the path I ended up using. Since the Kit cannot cast, I made it an Innate (4) spell, but now the icon for it persists and is annoying. I can make endless weapons every 8 hrs. Is there a trigger for use once and delete?
  • CorianderCoriander Member Posts: 1,667
    @Corsymyr So you're granting the spell/ability to the kit instead of just applying it?
  • CorsymyrCorsymyr Member Posts: 146
    I guess so ... I can just apply it using the CLAB 2DA? Would you be so kind as to shoot an example of how? Sorry my competence in programming was writing AUTOEXEC.BAT and CONFIG.SYS files!
  • CorsymyrCorsymyr Member Posts: 146
    @Coriander Sorry for the bungle ... use AP_ instead of GA_. I got it and it works great!!! Thanks everyone!
  • CorianderCoriander Member Posts: 1,667
    @Corsymyr Have fun ;)
  • RequiemRequiem Member Posts: 187
    If you create new headers for each level you want to upgrade your weapon at you can use the same spell to create all of your different weapons, each header after the first one could have a remove item effect (opcode 112) to get rid of the old weapon before creating a new one, at least that is how i would do it
  • CorsymyrCorsymyr Member Posts: 146
    @Requiem @Coriander ... well that works ... I can create the items, remove the previous items, et cetera. Now here's the rub ... after 3 or so minutes the item just dissappears. Duration is set to 0, so I am confused. Is there a different duration setting like -1?
  • CorsymyrCorsymyr Member Posts: 146
    Looks like I got it ...

    thanks for all the help though!
Sign In or Register to comment.