Jump to content

ItemDB Script Translation Project


trickyloki3

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

ItemDB Script Translation Project
Project License: MIT
Project Site: https://github.com/trickyloki3/eAdb.Compiler3
Language: C
Project Alt Link: http://forum.ratemyserver.net/ro-graphic-coding-media/itemdb-translation-project/
Project Alt Link: http://hercules.ws/board/topic/7422-itemdb-script-translation-project/
 

Hi everyone,
 
I've developed a complete program that can translate item scripts (consisting of a subset of the scripting language) into English translations.

 

The program is developed to streamline item development and couple the item database with item client tables.

 

Please let me know how to improve the project.

 

Thank you!

 

Project Update
 * Support pet script and pet loyal script.
 * Support item combo bonus.
 * Support bonus minimization.
 * Simplified packages and boxes.
 * Support project integration; exit-free and memory-leak free.
 * Support for-loop (limited) w/ iterable set blocks.
 * Simplify complex expressions.
 * Support pre-renewal and renewal eAthena, rAthena, and Hercules databases.
 * Support flavour text and item attribute in final translation.
 * Support eAthena, rAthena, Hercules idnum2itemdesctable.txt format generation.
 * Support Hercules' bindonequip, buyingstore, delay, stack, and trade settings.
 * Support eAthena, rAthena, Hercules itemInfo.lua format generation.
 
Testing
 * Generated itemInfo.lua tested on client 20130807a.
 
Todo
 * Create Visual Studio project for compilation on Windows.
 * Create Autotools for compilation on Unix and Linux.
 * Write guides on how to use the stupid program.
Edited by trickyloki3
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  491
  • Reputation:   19
  • Joined:  11/19/11
  • Last Seen:  

Woaaa this is good project , You do not need to translate one by one  /ok 

hmm how to use this program sir?? need a compile ?? 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

awesomeeee

 

 

btw, if I read the post on RMS (ur link), the ternary condition is fixed?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

Woaaa this is good project , You do not need to translate one by one  /ok

hmm how to use this program sir?? need a compile ?? 

 

Yeah, I'm currently working on the autotools so that the project can be compiled on Unix, OSX, and Windows (with MinGW or Cygwin).

 

In addition, I might setup a homebrew formula for OSX, rpm packages for red hat Linux, and VS project for Windows, but this will depend on demand.

 

And since the only dependencies are standard C library, sqlite3, and libconfig (Hercules only), it should be fairly portable.

 

awesomeeee

 

 

btw, if I read the post on RMS (ur link), the ternary condition is fixed?

 

Yeah, the ternary condition (? operator) has been fixed.

 

If you look at the item 13110:

bonus2 bAddRace,RC_DemiHuman,pow(((getrefine()>14)?14:getrefine())-4,2)

compiles down to 

[Refine Rate 6 ~ 15]
 -> Increase +4% ~ +100% (based on Refine Level) physical damage on demi-human enemy.

The compiler figures out that ((getrefine()>14)?14:getrefine()) will only be ever have a range of 6~14 and subtract 4 will be 2~10, then pow with 2 will get 4 ~ 100.

Edited by trickyloki3
Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

awesome.

Suggestion: add to description item ID

 

Example (scroll down)

13110#
Increase +55% physical damage on demi-human enemy.
Increase +55% physical damage on player enemy.
Ignore +20% physical defense of demi-human enemy.
Ignore +20% physical defense of player enemy.
Weapon is indestructible.
[Refine Rate 6 ~ 15]
 -> Increase +4% ~ +100% (based on Refine Level) physical damage on demi-human enemy.
 -> Increase +4% ~ +100% (based on Refine Level) physical damage on player enemy.
 -> Ignore +5% physical defense of demi-human enemy.
 -> Ignore +5% physical defense of player enemy.
[Refine Rate 9 ~ 15]
 -> Add +100% chance of auto-casting Flip the Coin[Lv.1] when using Rapid Shower.
 -> Increase +18% ~ +30% (Refine Level * 2) Rapid Shower damage.
ITEM ID: [13110]
#
Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

Due to all the fixes made to the item database.

 

The item database can be compile with ABSOLUTELY NO ERRORS on the most recent repository pulled @ 3/14/2015.

 

Project Update: I am going to integrate lua and use it to do the item format rules, I'm looking towards creating a final usable item info (lua) or item description table (txt).

 

Keep an eye out!

 

Also checked out the item script to English translation.  ^_^

item.txt

Edited by trickyloki3
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Hmm.. but I'm gonna push something that might break your project  /wah

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   3
  • Joined:  09/04/14
  • Last Seen:  

The project is still in progress. Look at GitHub and you can see this. Look at the latest changes.

 

Best regards,

Garkor

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

Yup, I'm still working on it.

 

I'll definitely support whatever you commit Nana  /no1

Edited by trickyloki3
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

Todo

 * Create Visual Studio project for compilation on Windows.
 * Create Autotools for compilation on Unix and Linux.
 * Write guides on how to use the stupid program.
Edited by trickyloki3
  • Upvote 1
Link to comment
Share on other sites

  • 5 months later...

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

any news?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

Sorry for the late response.

 

I've been rewriting large portions of the project for the past few months and updating all of the project's resources. And I've been spending a great deal of time reading the battle.c, status.c, pc.c, and map.c source for accurate status and bonus translations.

 

1. Revise all +200 bonus format and translation in res/bonus_db.txt.

2. Recognize and interpret script engine variables in expressions. 

3. Implement compound assignment, increment, and decrement operators.

4. Re-implement processing of conditions for if, if-else, ? operator, and for statements.

5. Re-implement scheme for complex expressions show players how bonuses are calculated.

6. Re-implement .txt and .lua generation.

7. Develop a user interface for Windows.

8. Rewrite build script and packaging for Linux / OS X systems.

 

I work on this project for fun and to improve my skills. But, I hope this project will be useful and serve as a decent contribution to the community.

 

The next release will only be for eAthena and rAthena because I don't have time to develop the resources for Hercules.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

* Create Visual Studio project for compilation on Windows.

this one still isn't available yet?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

There are VS 2015 projects for db, and ic; including the dependencies sqlite3, libconfig, and lua5.

 

db converts eathena, rathena, and hercules databases to sqlite3 databases.

 

ic uses the sqlite3 database from db to generate the descriptions.

 

There will be a third tool that generates the txt and lua file format after the descriptions are generated.

 

See the proj folder for the VS 2015 projects.

 

Currently, the ic project is under development again; main function is in src/ic.c. You can uncomment a few things to see what it is outputting. 

 

src/db_search.c; search sqlite3 database to get information.

src/script.c; primary source file for generating description

src/range.c; data structure for representing min and max values

src/name_range.c; data structure for representing logic trees build from AND and OR operators (build on top of range.c)

src/util.c; for string, sorting, and error handling.

 

Currently, most bonuses generate nonsense, since I am still working on redoing them and accidentally chopped off the offsets for the format string. (see res/bonus_db.txt) Q.Q

Edited by trickyloki3
Link to comment
Share on other sites

  • 4 months later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

Updated result.txt and result2.txt. 03/07/2016

Hiya e1 :D

 

I came to share the fruits of my labor.

 

Attach below are item scripts translated into item descriptions.

 

From rathena's item database on revision 1abb02c to be exact.

 

There are still a few things left to do.

 

See https://github.com/trickyloki3/eadb.compiler if you're interested.

 

Everything is open source and available for compilation on OS X, Linux, and Windows. (Uses ANSI C libraries and libc.)

Here are some samples:

Sword Guardian Card (getiteminfo predicate generation)

getiteminfo(getequipid(EQI_HAND_R),11)==2 ||
getiteminfo(getequipid(EQI_HAND_R),11)==3
[4427]
[Right Hand's Weapon Type is One-handed Sword, Two-handed Sword]
HIT +5
CRIT +5
+25% Bowling Bash damage.
Glorious Spear (multi-level if-else generation w/ set blocks) * fixed

[1426]
+95% physical damage against demi-human enemies
+95% physical damage against player enemies
pierce +20% physical defense of demi-human enemies
pierce +20% physical defense of player enemies
weapon is indestructible
[Refine Level 6 ~ 15]
+16% ~ +121% physical damage against demi-human enemies
+16% ~ +121% physical damage against player enemies
pierce +5% physical defense of demi-human enemies
pierce +5% physical defense of player enemies
ASPD +10%
[Refine Level 9 ~ 15]
[Knight]
+20% chance of casting level 2 Critical Wounds when using Pierce
[Crusader]
+10% chance of casting level 5 Gloria Domini when attacking
 

Glorious Pistol (bonus generation) * fixed

[13110]
+55% physical damage against demi-human enemies
+55% physical damage against player enemies
pierce +20% physical defense of demi-human enemies
pierce +20% physical defense of player enemies
weapon is indestructible
[Refine Level 6 ~ 15]
+16% ~ +121% physical damage against demi-human enemies
+16% ~ +121% physical damage against player enemies
pierce +5% physical defense of demi-human enemies
pierce +5% physical defense of player enemies
[Refine Level 9 ~ 15]
+100% chance of casting level 1 Flip the Coin when using Rapid Shower
+0% ~ +30% (Refine Level) Rapid Shower damage.
Vanberk Card (autobonus generation)

[4411]
STR +2
Add 0.50% chance to activate on meelee and range phyiscal attacks for 5 seconds.
CRIT +100
Enhanced Soldier Skeleton Card (predicate generation)

[4634]
[Base Level 1 ~ 99]
CRIT +9
[Base Level 100 ~ 175]
CRIT +10
+5% critical damage
[15061]
All Status +1
[Mage, Archer, Acolyte]
+50% silence status resistance
[Swordsman, Merchant, Thief]
+50% stun status resistance
 

Blue Box (item group generation)

[603]
Select 1 item from Blue Box group.
 * 52 healing items
 * 44 usable items
 * 423 etc items
 * 210 armor items
 * 239 weapon items
 * 20 pet equipment items
 * 28 ammo items
 * 6 delay usable items

result.txt

result2.txt

Edited by trickyloki3
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  01/22/12
  • Last Seen:  

Hi there,

 

How to compile this? Or is there any compiled version for windows?

 

thanks


tried compile with debian i getting this error

 

In file included from src/ic/rbt_name_range.h:5:0,
                 from src/ic/rbt_name_range.c:1:
src/ic/rbt_range.h:4:21: fatal error: rbt.h: No such file or directory
compilation terminated.
make: *** [src/rbt_name_range.o] Error 1
Edited by daim
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   15
  • Joined:  11/03/14
  • Last Seen:  

You need to pull down the librbt and libsort submodules; i.e. my red black tree and quick sort implementation.

git submodule init
git submodule foreach --recursive git pull origin master
If you have visual studio 2014, then you can compile on windows without problems.

On linux, you'll need to make liblua.a and sqlite.a separately. I still need to work on the makefile. >.>

Edited by trickyloki3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...