Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Creating custom effects for weapons

Is it possible to add an effect to a weapon that only applies if the weapon is wielded by a specific class or kit? Other classes can use the weapon, but only the specific class or kit would gain the extra effect. For example, a holy avenger that is usable by all classes as a longsword +2, but in the hands of a paladin, it becomes a +5 weapon with additional effects.

Further, is it possible to level restrict this effect (i.e. user must be 8th level or higher?

Comments

  • TressetTresset Member, Moderator Posts: 7,740
    Long story short... No.

    As far as restrictions go you could try playing around with the new Restrict Item (319) opcode, but I doubt it would work out for you.

  • Balsak_the_SweatyBalsak_the_Sweaty Member Posts: 9
    edited March 2015
    Hmmm, I thought you could. I've been poring over the rogue rebalancing mod to see how they limited the THAC0 bonus to thieves only for the revised short sword of backstabbing and might have figured out how they did it. They have the class restriction set to '5' or '4' for classes and kits, respectively. And then you need to select the desired ones from the identifier files.

  • AquadrizztAquadrizzt Member Posts: 958
    This is actually quite possible. Basic enchantment bonus stuff is very easy; more unique effects would depend on the effect, targetting, etc. What did you have in mind?

  • TressetTresset Member, Moderator Posts: 7,740
    (one of these days I will learn to not say stupid things that I don't know about anyway...)

  • Balsak_the_SweatyBalsak_the_Sweaty Member Posts: 9
    I'm developing a kit based on the Hammer of Moradin prestige class and would like to add a flag that would ultimately allow them to treat all hammers as throwing and returning. I'd like to restrict that change to the kit and ideally to level restrict the effect as well.

  • subtledoctorsubtledoctor Member Posts: 11,460
    edited March 2015
    At risk of repeating Tresset's post, I think there are some limitations here. (FWIW I haven't inspected the RR Sword of 'Stabbing very closely.)

    It pays to use clear terminology with this stuff. Items have "abilities." Abilities can be stuff like melee IR ranged attacks, or they can be spell-like abilities that trigger "effects." Effects are stuff you see in Spell effect opcodes.

    It strikes me that, within an item ability, you can make certain effects level-dependent and maybe class/kit dependent. But to allow anyone to throw a hammer, you would have to add a new item ability, for ranged use. I don't think you can have two separate item abilities, and only allow one of them to appear for certain kits.

    BUT there is probably a workaround (there usually is in these games). Amateur modder that I am, here is what I would do:

    1) Make copies of every hammer in the game, and give the copies a ranged-use item ability. Check out the code for "2-handed Bastard Swords" in BG2Tweaks for insight in how to do this. It's not too intense, and it would work for all hammers - including any mod-added items installed before your mod. Cool. :)

    2) Instead of using the item abilities button like BG2Tweaks does, give all normal hammers an equipping effect that runs through an .EFF targeting your kit, which removes the normal hammer and adds the new throwable one to the weapon slot.

    3) Give all of your new throwable hammers an equipping effect that uses a bunch of .EFFs targeting everyone except your new kit, which remove the throwable hammer and add the old melee-only one to the weapon slot.

    The effect should be seamless enough that you won't notice it in-game. It will seem like a single item, throwable only by your kit.

    (Creative idea by the way!)

Sign In or Register to comment.