New potions

Discussion in 'General Modification' started by Pebz, Jul 5, 2004.

Remove all ads!
  1. Pebz

    Pebz Member

    Joined:
    Jun 8, 2004
    Messages:
    17
    Likes Received:
    0
    I've added most of the potions from the srd so that they can be made with brew potion (should make the feat more worthwhile)

    Here is the list:

    cat's grace (works)
    endure elements (has no effect, neither do scrolls or wands... I'll leave it in incase someone fixes this)
    mage armor (works)
    magic fang (works)
    protection from evil (works)
    protection from good (works)
    protection from chaos (works)
    protection from law (works)
    remove fear (works)
    sanctuary (works)
    shield of faith (works)
    barkskin (works)
    bear's endurance (works)
    blur (works)
    delay poison (works)
    fox's cunning (works)
    lesser restoration (works if you have cast the spell prior to using the potion, heals same ability as you picked for the spell, otherwise restores 0 points of chaotic evil(!!!))
    owl's wisdom (works)
    protection from arrows (works)
    remove paralysis (works)
    gaseous form (works)
    greater magic fang (works)
    magic circle against evil (works)
    magic circle against good (works)
    magic circle against chaos (works)
    magic circle against law (works)
    rage (infinite duration)
    remove blindness/deafness no effect, spell doesn't work either
    remove curse (no effect, spell doesn't work either, only the break enchantment spell can remove curses)
    remove disease (couldn't test, what carries diseases besides rats?)
    good hope (works)
    resist energy (same as endure elements, I assume it is because you have to pick a element)
    invisibility to undead (works)
    invisibility to animals (works)

    Did i miss anything? Please give feedback on any errors.

    The zip below contains a .txt file with all the lines that need to be added (just copy the lines and paste them, notepad works well for this)
     

    Attached Files:

  2. mjck7

    mjck7 Member

    Joined:
    Oct 5, 2003
    Messages:
    31
    Likes Received:
    0
    Cool beans! Thanks!!!:D
     
  3. zhuge

    zhuge Established Member Veteran

    Joined:
    Sep 27, 2003
    Messages:
    484
    Likes Received:
    0
    As you have stated these potions which require selection from a secondary menu cannot be used unless the same spell was first cast from memory. Known bug which Steve Moret probably won't fix in the near future as the correction may be quite lengthy/ make saved games invalid.

    Not so sure about these. Does rage when casted from spellbook/memory also have infinite duration?
    Anyway I think we have enough potions to get by. If we really have problems implementing some of them, we can just skip them instead.
     
  4. Pebz

    Pebz Member

    Joined:
    Jun 8, 2004
    Messages:
    17
    Likes Received:
    0
    I've managed to add "potion of resist energy (fire)", so I could do this with the rest of the potions that require selection from a radial menu. I had to make a new .py file for it, but it seems to work fine (besides duration).

    Duration of potions really puzzles me ... some potions (same for scrolls/wands I think) seem to have correct duration (caster level * given time or fixed duration) while others are way off (even though they are correct in the .py files). Is duration stated any other places besides the .py files?

    Yes, Rage cast from the spellbook/memory is also infinite (duration is supposed to be concentration + 1 round/level. I wonder how that works... perhaps it doesn't wear off until you fail a concentration check + 1 round/level? Never noticed any enraged characters that make concentration checks).
     
  5. zhuge

    zhuge Established Member Veteran

    Joined:
    Sep 27, 2003
    Messages:
    484
    Likes Received:
    0
    AFAIK, Concentration + 1 round/level means while you are concentrating, the spell is maintained. But once you stop concentrating it will last 1 round/level.

    The current implementation of Rage is spell.duration = 0 in the .py file. So when cast it appears as duration 0/0 when you click the tab. Unless the caster stops concentrating, the spell lasts forever. Tested hitting the caster with friendly fire which does invoke a Concentration check, failure of which did indeed cancel the Rage spell. If the caster tries to cast another spell, he also makes a concentration check (tried with Mage Armor upon himself). Tried again with casting Bull's Strength on another party member while concentrating on Rage and the Rage disappear immediately.

    Tried putting spell.duration = 1 * spell.caster_level in the .py file.
    This resulted in the Rage spell tab showing 9/9 (my Sorc was level 9 when casting Rage). As expected when the Sorc maintains concentration, the duration does not fall.
    However once the Sorc stopped concentrating, the Rage effect immediately vanished without lasting an additional 9 rounds.

    So using spell.duration = 1 * spell.caster_level is no different from spell.duration = 0 for spells requiring concentration.

    I'll try to see if I can manage a cheap hack but I can't guarantee anything.


    Regarding spell duration in general, usually I believe it does follow the .py file but there may be instances where it is hardcoded in the exe which makes altering it impossible. Could you state the particular spells which have bugged durations/do not follow the .py duration.


    Potion of resist energy (fire) sounds really good. Could you post the new .py file (zipped) for it as an example.
     
    Last edited: Jul 7, 2004
  6. Pebz

    Pebz Member

    Joined:
    Jun 8, 2004
    Messages:
    17
    Likes Received:
    0
    Actually I don't think it has something to do with the .py files, because the duration is correct as far as the .py files are concerned, but the caster level is calculated strangely (blur, for example, seems to be caster level: 1 even if the creator is level 9 or so)

    As for potion of resist energy (fire):

    Add {733}{potion_of_resist_energy_fire}, {5733}{Potion of Resist Energy Fire} and
    {20733}{}//potion_of_resist_energy_fire to spell_enum.mes

    Add {733}{Potion of Resist Energy Fire} and {5733}{Potion of Resist Energy Fire} to spell.mes

    Replace 'Resist Energy' class_sorcerer 2 with 'Potion of Resist Energy Fire' class_cleric 2 for the Resist energy potion in protos.tab

    The zip contains the .py and the .txt file

    I basically just copied the .py and .txt files from the original resist energy (the files are named resist elements) and altered one thing in the .py file:

    spell_arg = spell.spell_get_menu_arg( RADIAL_MENU_PARAM_MIN_SETTING )

    to

    spell_arg = 4 (which refers to Resist Elements-fire)
     

    Attached Files:

  7. zhuge

    zhuge Established Member Veteran

    Joined:
    Sep 27, 2003
    Messages:
    484
    Likes Received:
    0
    Tried using the Scroll of Blur. Casted it using my Sorc and it lasts 30 rounds as expected.
    The spell duration is 10 * spell.caster_level.

    spell.caster_level for spells cast from scrolls, wands and potions (I think) is determined by the minimum level needed to make such a scroll/wand/potion.
    Since Blur is a level 2 spell for Wizards. A Wizard would have to be at least level 3 to make such a scroll. Therefore the minimum level is 3 which is also spell.caster_level.
     
  8. Pebz

    Pebz Member

    Joined:
    Jun 8, 2004
    Messages:
    17
    Likes Received:
    0
    Yes, according to the srd, it is minimum caster level required to make the potion, but not all potions follow this rule (the +stat and protection from alignment potions, amongst a few others, use the current caster level * 1 min)

    Resist energy potion has 3 min duration, so it is correct after all.
     
  9. zhuge

    zhuge Established Member Veteran

    Joined:
    Sep 27, 2003
    Messages:
    484
    Likes Received:
    0
    Yes, I believe you're right on that one. There are some exceptions which funnily uses current caster level. I wonder if putting spell.duration = "constant" might work.
    "constant" = minimum caster level required to make the potion

    In other words try spell.duration = 30 or 50 and see if it works or if the exe doesn't read that line at all.
     
  10. Pebz

    Pebz Member

    Joined:
    Jun 8, 2004
    Messages:
    17
    Likes Received:
    0
    That works, but any change in the .py file also affects the spell when cast from memory/spellbook.

    I could, however, make a new .py file for each potion that doesn't work correctly (might do that for scrolls/wands as well). Would appreciate some help on finding all the "broken" scrolls/wands :)

    The DC would remain the same though. I wonder if there is a way to set a fixed caster level (I tried spell.caster_level = 3, no effect)
     
  11. zhuge

    zhuge Established Member Veteran

    Joined:
    Sep 27, 2003
    Messages:
    484
    Likes Received:
    0
    Regarding DC, we could try spell.dc = 13 (instead of spell.caster_level = 3).

    You'll see that it is coded that way for Spell712 - Javelin of Lightning.py. (spell.dc = 14)
    Also for Spell437 - Slay Living.py there's a line which goes:
    if target.obj.saving_throw_spell( spell.dc, D20_Save_Fortitude, D20STD_F_NONE, spell.caster, spell.id ):

    So it appears spell.dc may be one of the parameters transferred as input when the function for the spell is called in the exe.

    For spells which do not have spell.dc specified, we may need to try and transfer it as a parameter by including it in the: target_item.obj.condition_add_with_args command

    It might not work though since the exe might decide to recalculate spell.dc for potions/wands/scrolls anyway, but I think we should give it a shot anyway.



    It's going to be a ton of work reworking all the spells (making new .py files for those which do not have correct duration), not to mention testing each and every one to see if they are correct. OddHat did some really good work on it previously but we didn't make much progress then. Anyway I'll try and help test which spells are involved. Could you post which spells you have tested which are already Ok, to avoid double work.

    I think we might end up solving more than we originally thought possible, so that's good. :)
     
  12. Morpheus

    Morpheus Mindflayer Veteran

    Joined:
    Nov 11, 2003
    Messages:
    539
    Likes Received:
    1
    Could someone who downloaded the zip files in this thread please re-upload them? The ones here are corrupted (as a result of the hacker attack that caused a server crash) ...
     
Our Host!