Skip to main content

A collection of Diablo 2 utilities.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydiablo-0.0.3.tar.gz (146.5 kB view details)

Uploaded Source

Built Distribution

pydiablo-0.0.3-py3-none-any.whl (153.5 kB view details)

Uploaded Python 3

File details

Details for the file pydiablo-0.0.3.tar.gz.

File metadata

  • Download URL: pydiablo-0.0.3.tar.gz
  • Upload date:
  • Size: 146.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pydiablo-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a3d275e373560ce91143b36765ab5c450c8b909d70bc3825116edc1b0d6b32c5
MD5 0f7dca5fa95d2631ef868b83a6f87944
BLAKE2b-256 c340626979e67ff536f3303da22deb276669a9f73889e9291a53db2f0246e4a9

See more details on using hashes here.

File details

Details for the file pydiablo-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pydiablo-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 153.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pydiablo-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e731dcfc54ff7c192a3f8869b09054c6d14f11572c6ef3fb18a938f0d47927
MD5 38074f96de04366afd0c26e6f9a64d6a
BLAKE2b-256 ac39a73c665a5b864c3b1b487700e26f10b46e960350d2d0562ca681a19ac992

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page