Data Career Class Info PHP Script

A forum for development and discussion on third party tools such as the Quest Designer

Moderator: Project Admin

Data Career Class Info PHP Script

Postby Christopher » Thu Dec 04, 2014 1:33 pm

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 21 times
The structure looks like this:
structure.png
structure.png (4.94 KiB) Viewed 5256 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
We cannot solve our problems with the same thinking we used when we created them.
Christopher
DOL Visitor
 
Posts: 9
Joined: Thu Dec 04, 2014 12:58 pm
Location: Cologne

Re: Data Career Class Info PHP Script

Postby Graveen » Thu Dec 04, 2014 7:50 pm

Hello,

Welcome and thank you !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Data Career Class Info PHP Script

Postby Leodagan » Thu Dec 04, 2014 11:27 pm

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 ?)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Data Career Class Info PHP Script

Postby Christopher » Fri Dec 05, 2014 7:43 am

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
We cannot solve our problems with the same thinking we used when we created them.
Christopher
DOL Visitor
 
Posts: 9
Joined: Thu Dec 04, 2014 12:58 pm
Location: Cologne

Re: Data Career Class Info PHP Script

Postby Graveen » Fri Dec 05, 2014 8:15 am

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
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Data Career Class Info PHP Script

Postby Leodagan » Fri Dec 05, 2014 8:45 am

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 ;)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Data Career Class Info PHP Script

Postby Leodagan » Fri Dec 05, 2014 12:53 pm

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 :)
Last edited by Leodagan on Fri Dec 05, 2014 1:19 pm, edited 1 time in total.
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Data Career Class Info PHP Script

Postby Graveen » Fri Dec 05, 2014 1:12 pm

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...
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Data Career Class Info PHP Script

Postby Leodagan » Fri Dec 05, 2014 1:22 pm

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" :)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Data Career Class Info PHP Script

Postby Graveen » Fri Dec 05, 2014 4:36 pm

Yes you should, but the key is to understand the differences between centralized/decentralized VCS. It worths the effort !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Data Career Class Info PHP Script

Postby Leodagan » Sun Dec 07, 2014 3:36 pm

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 ;)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Data Career Class Info PHP Script

Postby Christopher » Mon Dec 08, 2014 8:37 am

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 ! ;)
We cannot solve our problems with the same thinking we used when we created them.
Christopher
DOL Visitor
 
Posts: 9
Joined: Thu Dec 04, 2014 12:58 pm
Location: Cologne


Return to “%s” Third Party Tools

Who is online

Users browsing this forum: No registered users and 1 guest