Page 1 of 1

Data Career Class Info PHP Script

PostPosted: Thu Dec 04, 2014 1:33 pm
by Christopher
Hey,
I've just finished my work on a small php function that returns an associative array filled with the data of a specific class.
phpclassparser.zip
(1.98 KiB) Downloaded 54 times
The structure looks like this:
structure.png
structure.png (4.94 KiB) Viewed 12910 times
class: specializations[]
spezializations[]: keyname, levelacquired, spelllines[], styles[], abilities[]
spelllines[]: keyname, name, isbaseline, spelltypes[]
spelltypes[]: spells[]
spells[]: name, type, level, id, icon, description, power, casttime, damage, damagetype, duration, radius, value
styles[]: name, speclevelrequirement, icon, endurancecost, stealthrequirement, openingrequirementtype, attackresultrequirement, growthrate, bonustohit, bonustodefense
abilities[]: keyname, name, speclevel, abilitylevel, description, icon

Note that spells are grouped by their type

The usage could be like:
Connect to your database via
Code: Select all
$db_server = mysqli_connect(....)
and then you simply call
Code: Select all
$class = getclassdata($db_server, $class_id);
You can then easily access your data like
Code: Select all
foreach($class['specializations'] as $specialization) { echo $specialization['keyname']; foreach($specialization['abilities'] as $ability) { echo $ability['name']; } }
I hope you like it!
And yep - hey I'm the new one :) nice to be here. I really love this project already - played along with the source for some weeks now. I'm really impressed!

Christopher

Re: Data Career Class Info PHP Script

PostPosted: Thu Dec 04, 2014 7:50 pm
by Graveen
Hello,

Welcome and thank you !

Re: Data Career Class Info PHP Script

PostPosted: Thu Dec 04, 2014 11:27 pm
by Leodagan
Hello Christopher and Welcome !

You might be interested in this php script I provided as a quick and dirty "class skill display" :)

http://www.dolserver.net/viewtopic.php?f=69&t=22274

There is some workaround for spell grouping taking into account "PetSpell" (which links to subspell to have the real Type !) and other Spell grouping criteria (Target, Instant, AoE...)

If you'd like to improve it or anything I can put this on a coding platform (github ?)

Re: Data Career Class Info PHP Script

PostPosted: Fri Dec 05, 2014 7:43 am
by Christopher
Thank you guys!

Yes I really would love to take a look into your script. Even if it has a slightly different approach it's almost the same thing.
My aim was to provide a lightweight easy to access way to the data. I tried to download your archive, but it keeps telling me it is broken :-(
It would be awesome if you can put it on github - I could try to help you with the popup spell info based on css3 - or do you prefer javascript?

Have a nice day
Chris

Re: Data Career Class Info PHP Script

PostPosted: Fri Dec 05, 2014 8:15 am
by Graveen
Well, just a quick note for Leo, mine was also corrupt after DL, i didn't retry, but if we are experiencing similar issues... :D

Re: Data Career Class Info PHP Script

PostPosted: Fri Dec 05, 2014 8:45 am
by Leodagan
Well the archive was made quickly, and my Apache server tends to break downloads, so it's not a great way to share code.

I'll put this on github when I get back home ;)

Re: Data Career Class Info PHP Script

PostPosted: Fri Dec 05, 2014 12:53 pm
by Leodagan
Ok I'm not so used to Git :D

But here is the code : https://github.com/dol-leodagan/phpDOLc ... ree/master

I'm not uploading Sqlite DB to Git, I don't think Binaries will do any good inside a repository :)

Re: Data Career Class Info PHP Script

PostPosted: Fri Dec 05, 2014 1:12 pm
by Graveen
The more i use GIT the more i think pull request is really easing contributions.

SF is also proposing GIT support. And with GIT-SNV it would allow easy merging until everyone get sticked on GIT....

Well, well...

Re: Data Career Class Info PHP Script

PostPosted: Fri Dec 05, 2014 1:22 pm
by Leodagan
I should get some "how to" article for Git, it's really disturbing when coming from SVN / CVS

But at least it allows anyone to make fast and easy "forks" :)

Re: Data Career Class Info PHP Script

PostPosted: Fri Dec 05, 2014 4:36 pm
by Graveen
Yes you should, but the key is to understand the differences between centralized/decentralized VCS. It worths the effort !

Re: Data Career Class Info PHP Script

PostPosted: Sun Dec 07, 2014 3:36 pm
by Leodagan
It would be awesome if you can put it on github - I could try to help you with the popup spell info based on css3 - or do you prefer javascript?
Sorry I forgot to reply to this, I expect to bring pop-up using CSS, I hope I only need JS for "building" character tree from level and skillpoints...

If everything is well defined, Javascript will only have to Fade off the skills that aren't enabled depending on Level and Skill Train Level, it could only need some specific tag attribute to search them with Jquery ;)

Re: Data Career Class Info PHP Script

PostPosted: Mon Dec 08, 2014 8:37 am
by Christopher
yes, I guess thats the best way to do it. I have read through your code and found some good points I did not think of. Thank you for sharing ! ;)