Skip to main content

pydiablo

pydiablo is a Diablo 2 toolkit written in Python. The original goal was to calculate and simulate the time required to kill specific monsters using different builds and equipment. The library is still in early stages. It currently has an accurate monster stats parser and the beginnings of a weapon speed calculator.

usage

monster stats

import sys
import pydiablo as d2
# interesting monster_ids
# unraveler5: wave2 minions
# unraveler8/9: high exp dudes in WSK/throne
# bloodlord5: death lords in WSK/throne
# fallen5: wave1 minions
# dkfig2, dkmag2: act5 doom knights and oblivion knights
# venomlord: wave4
# baalhighpriest: wave3
# baalminion1: wave5
monster_id = 'doomknight1'
difficulty = d2.monster.HELL
# write the area table (if we want to choose a specific area)
d2.monster.Monster.levels.write_area_table(sys.stdout, monster_id, difficulty)
# with no specific area chosen, it defaults to highest level available
MonsterType = d2.monster.MinionMonster.create_monster_type(monster_id, difficulty)
print('========')
print('Class name: ' + MonsterType.__name__)
print('Areas: ' + str(MonsterType.mlvl_specific_area_names()))
print('Monster: ' + MonsterType.monster_name())
print('mlvl: ' + str(MonsterType.mlvl))
print('hp range: ' + str(MonsterType.base_hp()))
print('exp: ' + str(MonsterType.base_experience()))
print('block chance: ' + str(MonsterType.block_chance()))
print('defense: ' + str(MonsterType.base_defense()))
print('cold effect: ' + str(MonsterType.cold_effect()))
print('drain effect: ' + str(MonsterType.drain_effect()))
print('fire resist: ' + str(MonsterType.base_fire_resist()))
print('cold resist: ' + str(MonsterType.base_cold_resist()))
print('lightning resist: ' + str(MonsterType.base_lightning_resist()))
print('poison resist: ' + str(MonsterType.base_poison_resist()))
print('damage resist: ' + str(MonsterType.base_damage_resist()))
print('magic resist: ' + str(MonsterType.magic_resist()))

monster = MonsterType(player_count=8, rand=False)
print('==========')
print('max_life: ' + str(monster.max_life))
print('experience: ' + str(monster.experience()))

weapon speed

import sys
import pydiablo as d2

# write a few selected ias breakpoint tables
d2.char.write_bp_table(sys.stdout, d2.char.Amazon.strafe_duration, 'BOW', 100, 0, 10)
d2.char.write_bp_table(sys.stdout, d2.char.WolfDruid.fury_duration, 'STF', 100, 68, 10, WIAS=90)
d2.char.write_bp_table(sys.stdout, d2.char.Paladin.zeal_duration, '2HS', 100, 37, 10, WIAS=0)
d2.char.write_bp_table(sys.stdout, d2.char.Act2Merc.jab_duration, 'HTH', 100, 0, -10)

character data import

This feature is brand new, and there's not a lot of interesting stuff you can do with it yet.

from slashdiablo or nokka's d2s parser (https://github.com/nokka/d2s)

import pydiablo as d2

char_name = 'netease'
char = d2.char.chardata_from_slash(char_name)
# if you want to import another d2s file parsed by nokka's d2s
# char_json = ... # from d2s parser
# char = create_from_json(char_json)

#print some stuff
print(char.primary_weapon_stats)
print(char.secondary_weapon_stats)
print(char.off_weapon_stats)

license

See the LICENSE file for license details on source files contained in pydiablo. The files in data and data2 are derivative of Diablo 2 game data; the license in the LICENSE file does not apply.

Metadata

Release files for pydiablo 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydiablo 0.0.3
File Size Uploaded
pydiablo-0.0.3.tar.gz 146.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydiablo 0.0.3
File Interpreter ABI Platform
pydiablo-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 300.0 kB

Release files / pydiablo-0.0.3.tar.gz

Download URL pydiablo-0.0.3.tar.gz
Size 146.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a3d275e373560ce91143b36765ab5c450c8b909d70bc3825116edc1b0d6b32c5
BLAKE2b-256 checksum
How to use checksums
c340626979e67ff536f3303da22deb276669a9f73889e9291a53db2f0246e4a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6

Release files / pydiablo-0.0.3-py3-none-any.whl

Download URL pydiablo-0.0.3-py3-none-any.whl
Size 153.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3e731dcfc54ff7c192a3f8869b09054c6d14f11572c6ef3fb18a938f0d47927
BLAKE2b-256 checksum
How to use checksums
ac39a73c665a5b864c3b1b487700e26f10b46e960350d2d0562ca681a19ac992
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page