Raise Dead Scroll not working?

Discussion in 'The Temple of Elemental Evil' started by maalri, Feb 18, 2006.

Remove all ads!
  1. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,627
    Likes Received:
    538
    I had a vague recollection that in some cases the original xp value was restored, but it looks lile that uses vars 753 instead (in the jaroo spell permanency fix). Maybe it's just for debug. It would be best to search the files to be sure (including dlg files).
     
  2. dolio

    dolio Established Member Supporter

    Joined:
    May 30, 2005
    Messages:
    356
    Likes Received:
    85
    I guess I haven't checked outside Temple+ stuff, but the only stuff there that mentions global 752 are resurrection spell scripts and the (unrelated) moat house thing.

    I see how the Jaroo thing works; it stores your XP in the dialogue, then resets it after raising to result in no XP lost. I don't really understand why, though, because by the book Reincarnate has the same penalty as Raise Dead.
     
  3. zertzax

    zertzax Established Member

    Joined:
    Feb 23, 2023
    Messages:
    107
    Likes Received:
    22
    "You dared to TOUCh my daughter. I'll kill you!"

    Mad Papa's can be ornery.
     
  4. Pygmy

    Pygmy Established Member Supporter

    Joined:
    Oct 8, 2010
    Messages:
    766
    Likes Received:
    83
    It's a bit more serious than that......
     
  5. dolio

    dolio Established Member Supporter

    Joined:
    May 30, 2005
    Messages:
    356
    Likes Received:
    85
    As far as I can tell, no other script refers to global 752. Just the spell scripts for raising and the one that would not be expecting the global to be set to the number of XP half way from one arbitrary level to the next.
     
  6. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    706
    Likes Received:
    112
    When I tidied up some of the spell code in Paladin's Cove, I removed that global 752, just to prevent confusion whenever I saw it in there. It didn't seem to be used anywhere else, except for the gnoll skeleton respawning, which was module specific.

    Anyways, while I was there digging around the code, I was able to shorten up that large grouping of if/then statements, making a little formula out of it. Since the XP's needed to gain a level have a specific mathematical progression. The XP's needed to gain a new level are equal to the XP's needed to gain the current level + (1000 times the current level).
    Code:
    xp_current_level, xp_previous_level = 0, 0
    for L in range (1, target_item.obj.stat_level_get(stat_level)+1):
            xp_previous_level = xp_current_level
            xp_current_level += (L-1)*1000
    xp_new = xp_current_level - ((xp_current_level - xp_previous_level) / 2)
    
    target_item.obj.stat_base_set(stat_experience, xp_new)
    target_item.obj.object_script_execute( target_item.obj, 18 )
    
    To be honest, the if/then statements are clearer to anyone casually reading the code. But I like solving little puzzles like this.
     
  7. OccasionallyGood

    OccasionallyGood Member

    Joined:
    Dec 19, 2021
    Messages:
    47
    Likes Received:
    15
    I think this is only needed for the spell permanency fix dialogue option which resets character state by killing and resurrecting. In this case storing current XP makes sense.
    Jaroo's Reincarnate actually works as expected, XP is lost as expected. At least with Temple+.
     
  8. Pygmy

    Pygmy Established Member Supporter

    Joined:
    Oct 8, 2010
    Messages:
    766
    Likes Received:
    83
    The total experience for level n is n/2 x (n-1) x 1000xps
     
  9. dolio

    dolio Established Member Supporter

    Joined:
    May 30, 2005
    Messages:
    356
    Likes Received:
    85
    Oh, okay. That makes sense. I didn't really look at the context. I guess I'll have to keep that in mind if I ever implement the version of Reincarnation that turns you into a random humanoid race. Maybe I can figure out how to make it use the St. Cuthbert resurrection in that case in Temple+, since that will automatically have no XP penalty.

    Okay. Good to know you came to the same conclusion.

    And yeah, there are more compact ways to calculate the right XP value. I think what that code was working around was that the vanilla code has a pre-calculated array of the cumulative XP numbers (I guess doing like 20 adds for this was too expensive in 2003 :)), and then it erroneously sets XP to
    Code:
    cumulative[i]/2
    So, half the total XP needed to get back to the right level, not half way between the two levels.
     
  10. Nightcanon

    Nightcanon Garrulous Halfling

    Joined:
    May 7, 2012
    Messages:
    490
    Likes Received:
    39
    Since this thread has apparently been resurrected without ill effects, I have a query that relates to a point raised here back in 2006: in my latest game, I made a Wizard character who specialized in Conjuration, with Evocation as one of opposition schools (actually a Rog1, Wiz 4, Unseen Seer 1, Arcane Trickster X, with a view to seeing how many D6 I could roll with a single attack). Somewhat to my surprise, this character still had perfect use of Evocation via items, including scrolls, wands, and staves. Is this correct? No points in UMD and in fact a negative CHA modifier too, so it wasn't that. I don't recall ever making a Specialist wizard in 3(.5)ed before, since one extra spell per day is weak in the context of 3rd Ed's very permissive rules for scribing scrolls compared to 2nd Ed, where the concept first appeared and was a significant boost.
     
  11. dolio

    dolio Established Member Supporter

    Joined:
    May 30, 2005
    Messages:
    356
    Likes Received:
    85
    No, it isn't correct.

    I'm not surprised the game isn't checking it properly, though.
     
Our Host!