Giter VIP home page Giter VIP logo

rochargenphp's Introduction

ROChargenPHP

ROChargenPHP is a PHP tool made for Ragnarok Online private server to help them to solved a big problem : how to display game characters on the website ? So this tool comes at the rescue, parsing game data to render as an image the character/monster of your choice, base on your database or direct informations.

It required PHP5 with the PDO driver installed. All the settings are set in index.php file.

Features

  • Generator

    • Support .spr, .act, .pal, .grf files
    • A character is fully render (class, head, hats, palettes, weapon, shield, robes, mount) and you can set the action, direction, animation easily.
    • Generator for Character, Character head only, Monsters, Homunculus, Avatar and Signature.
    • Cache system if needed
    • Emblem loader
  • Client

    • DATA.ini files to set your own GRF to read files from.
    • Support GRF (0x200 version only without DES encryption) the data fodler is always read first.
    • Auto-Extract files from GRF if needed.
    • Updater script available to convert some lua files to PHP.

How to use

	http://www.example.com/ROChargenPHP/controller/data

Replace controller by the one you want (currently: character, characterhead, avatar, signature). Replace data with the info you want to send to the controller (by default the name of the player. Example:

	http://www.example.com/ROChargenPHP/avatar/KeyWorld

Will display KeyWorld's avatar. If you don't have url-rewriting in your host the link you will have to use:

	http://www.example.com/ROChargenPHP/index.php/avatar/KeyWorld

You can change the default link by modify the array $routes in the index.php file:

$routes['/avatar/(.*)']              = 'Avatar';
$routes['/character/(.*)']           = 'Character';
$routes['/characterhead/(.*)']       = 'CharacterHead';
$routes['/monster/(\d+)']            = 'Monster';
$routes['/signature/(.*)']           = 'Signature';

Custom display

At least, the tool is really easy to use, here an example on how to display a static character:

$chargen                 =  new CharacterRender();
$chargen->action         =  CharacterRender::ACTION_READYFIGHT;
$chargen->direction      =  CharacterRender::DIRECTION_SOUTHEAST;
$chargen->body_animation =  0;
$chargen->doridori       =  0;

// Custom data:
$chargen->sex            =  "M";
$chargen->class          = 4002;
$chargen->clothes_color  =    0;
$chargen->hair           =    5;
$chargen->hair_color     =   12;
// ... head_top, head_mid, head_bottom, robe, weapon, shield, sex, ...


// Generate Image
$img  = $chargen->render();
imagepng($img);

Avatar and signature

AvatarType1 AvatarType2 Signature


Full character, or just the head

head body


Monsters, without or with accessory

Eddga Poring


License

http://creativecommons.org/licenses/by-nc-sa/3.0/

License

rochargenphp's People

Contributors

vthibault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.