## Calc Functions based on Class

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

ectorzage
Posts: 9
Joined: Sat Feb 09, 2019 4:52 am

### Calc Functions based on Class

Hello,

So I am trying to recreate the elixirs from the original diablo. I have gotten it to where the potions can be consumed and do raise the stats. Strength and Dexterity are working just fine, but Vitality and Energy are proving problematic. I have identified the need for maxhp, maxmana, maxstamina, but cannot figure out the syntax. Here is what I could come up with:

Life per Vitality

Stamina per Vitality
[class]=='assassin'?1.25:1

Mana per Energy

Anyone have the silver bullet? I guess I just need to know how to incorporate class into the calculations.

Necrolis
Throne
Posts: 9067
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:

### Re: Calc Functions based on Class

Unfortunately the formula parser doesn't provide a way to know if the target is a specific class; you need to do it based on a specific skill or stat value. Also important to note is that it only does integer math, so no decimals are supported, in this case its not an issue as those three stats work in 256ths.

Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

mmpx222
Posts: 147
Joined: Sat Apr 26, 2014 9:19 am

### Re: Calc Functions based on Class

You could make a dummy stat (class_type_stat). Then create 7 innate passive skills for each class that provide different amounts of the dummy stat. Then you could use a formula like:

Code: Select all

``````stat('class_type_stat'.accr) == 4 ? 120 : 0
``````
However, the formula could become too long and easily exceed the 256 char limit. I suggest adding one dummy stat per effect (elixir_maxhp_factor, elixir_maxmana_factor, ...) and making the class-specific innate passives provide different amounts of each dummy stat.
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files