Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Improvement: spells.dat #131

Open
Goldbishop opened this issue Dec 9, 2020 · 2 comments
Open

File Improvement: spells.dat #131

Goldbishop opened this issue Dec 9, 2020 · 2 comments

Comments

@Goldbishop
Copy link

Stats:
code file: src\spell_parser.cpp
header file: src\db.h
data file: etc\spells.dat

For in-game object data creation, these should be standardized into a delimited file format and imported into a STRUCT. Once imported, save into a Spell Stack for index referencing; effectively SpellInfo[idx] = SPELL_STRUCT

Race values should be bit-masked, so instead of

race human  = 0
race elf  = 0
race dwarf  = 0
race halfling  = 0
race gnome  = 0
race half-orc  = 0
race half-ogre  = 0
race half-elf  = 0
race brownie  = 0
race groll  = 0
race darkelf  = 0

you would end up with:

enum RACE{
  HUMAN 	= 0x0001, // 000000000001
  ELF 		= 0x0002, // 000000000010
  DWARF 	= 0x0004, // 000000000100
  HALFLING 	= 0x0008, // 000000001000
  GNOME 	= 0x0016, // 000000010000
  HALFORC	= 0x0032, // 000000100000
  HALFOGRE	= 0x0064, // 000001000000
  HALFELF	= 0x0128, // 000010000000
  BROWNIE	= 0x0256, // 000100000000
  GROLL		= 0x0512, // 001000000000
  DARKELF	= 0x1024, // 010000000000
  // ALWAYS KEEP LAST, increment as necessary
  UNKNOWN	= 0x2048  // 100000000000
}

Existing Example:

index  = 3
name  =  detection sphere
realm  = 1
sphere  = 0
auto train  = 0
minpos  = 0
mana  = 0
turns  = 0
targets  = 0
mediums  = 0
check  = 0
offensive  = 0
fumble  = 0
race human  = 0
race elf  = 0
race dwarf  = 0
race halfling  = 0
race gnome  = 0
race half-orc  = 0
race half-ogre  = 0
race half-elf  = 0
race brownie  = 0
race groll  = 0
race darkelf  = 0
attack clothes  =  90  0 50
attack sleather  =  90  0 50
attack hleather  =  90  0 50
attack chain  =  90  0 50
attack plate  =  90  0 50 

Proposed Result

# IDX~Name~Realm~Sphere~Train~MinPos~Mana~Turns~Targets~Mediums~Check~Offensive~Fumble~Race~AtkCloth~AtkSLeather~AtkHLeather~AtkChain~AtkPlate!
3~detection~1~0~0~0~0~0~0~0~0~0~0~00000000000~90*0*50~90*0*50~90*0*50~90*0*50~90*0*50!

@chrisspanton
Copy link
Collaborator

Hey @Goldbishop - thanks for submitting the issue! I dont disagree, its a good approach.

If you haven't already, please dont hesitate to fork the repo, build an environment, and make the PR once tested.

@Seifert69
Copy link
Owner

Seifert69 commented Dec 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants