This repository has been archived by the owner on Feb 21, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce str file loader, welcome effects !
- Loading branch information
Showing
11 changed files
with
795 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* DB/EffectList.js | ||
* | ||
* List effects | ||
* TODO: complete the list, add informations about sound. | ||
* | ||
* This file is part of ROBrowser, Ragnarok Online in the Web Browser (http://www.robrowser.com/). | ||
* | ||
* @author Vincent Thibault | ||
*/ | ||
|
||
define(function() | ||
{ | ||
"use strict"; | ||
|
||
return { | ||
23: { str: 'stonecurse' }, | ||
|
||
29: { str: 'lightning' }, | ||
30: { str: 'thunderstorm' }, | ||
|
||
41: { str: 'angelus' }, | ||
|
||
66: { str: 'cure' }, | ||
67: { str: 'provoke' }, | ||
68: { str: 'mvp' }, | ||
69: { str: 'skidtrap' }, | ||
|
||
75: { str: 'gloria', wav:'priest_gloria' }, | ||
76: { str: 'magnificat' }, | ||
77: { str: 'resurrection' }, | ||
|
||
85: { str: 'lexaeterna' }, | ||
86: { str: 'aspersio' }, | ||
87: { str: 'lexdivina' }, | ||
88: { str: 'suffragium' }, | ||
89: { str: 'stormgust' }, | ||
90: { str: 'lord' }, | ||
|
||
102: { str: 'black_hammerfall' }, | ||
103: { str: 'weaponperfection' }, | ||
104: { str: 'maximizepower' }, | ||
|
||
111: { str: 'spring' }, | ||
112: { str: 'kyrie' }, | ||
113: { str: 'magnus' }, | ||
|
||
154: { str: 'bs_refinesuccess' }, | ||
155: { str: 'bs_refinefailed' }, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/** | ||
* Loaders/Str.js | ||
* | ||
* Loaders for Gravity .str file (effects file) | ||
* It's basically a .ezv file compiled to binary (except ezv file are version 0x95, str are 0x94). | ||
* | ||
* This file is part of ROBrowser, Ragnarok Online in the Web Browser (http://www.robrowser.com/). | ||
* | ||
* @author Vincent Thibault | ||
*/ | ||
|
||
define( ['Utils/BinaryReader'], function( BinaryReader ) | ||
{ | ||
'use strict'; | ||
|
||
|
||
/** | ||
* Str class loader | ||
* | ||
* @param {ArrayBuffer} data - optional | ||
*/ | ||
function STR( data ) | ||
{ | ||
this.version = 0.0; | ||
|
||
if (data) { | ||
this.load(data); | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Parse a STR file | ||
* | ||
* @param {ArrayBuffer} data | ||
*/ | ||
STR.prototype.load = function load( data ) | ||
{ | ||
var fp, i; | ||
|
||
fp = new BinaryReader(data); | ||
this.header = fp.readString(4); | ||
|
||
if (this.header !== 'STRM') { | ||
throw new Error('STR::load() - Incorrect header "' + this.header + '", must be "STRM"'); | ||
} | ||
|
||
this.version = fp.readULong(); | ||
|
||
if (this.version !== 0x94) { | ||
throw new Error('STR - Invalid version "'+ this.version +'", not supported'); | ||
} | ||
|
||
this.fps = fp.readULong(); | ||
this.maxKey = fp.readULong(); | ||
this.layernum = fp.readULong(); | ||
fp.seek(16, SEEK_CUR); // display, group, type, ... ? | ||
|
||
this.layers = new Array(this.layernum); | ||
|
||
for (i = 0; i < this.layernum; ++i) { | ||
this.layers[i] = new STRLayer(fp); | ||
} | ||
}; | ||
|
||
|
||
/** | ||
* Layer structure | ||
* | ||
* @param {BinaryReader} fp | ||
*/ | ||
function STRLayer( fp ) | ||
{ | ||
var i; | ||
|
||
this.texcnt = fp.readLong(); | ||
this.texname = new Array(this.texcnt); | ||
|
||
for (i = 0; i < this.texcnt; ++i) { | ||
this.texname[i] = 'data\\texture\\effect\\' + fp.readString(128); | ||
} | ||
|
||
this.anikeynum = fp.readLong(); | ||
this.animations = new Array(this.anikeynum); | ||
|
||
for (i = 0; i < this.anikeynum; ++i) { | ||
this.animations[i] = new STRAnimation(fp); | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Frame structure | ||
* | ||
* @param {BinaryReader} fp | ||
*/ | ||
function STRAnimation( fp ) | ||
{ | ||
this.frame = fp.readLong(); | ||
this.type = fp.readULong(); | ||
this.pos = new Float32Array([ fp.readFloat(), fp.readFloat() ]); | ||
this.uv = new Float32Array([ fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat() ]); | ||
this.xy = new Float32Array([ fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat(), fp.readFloat() ]); | ||
this.aniframe = fp.readFloat(); | ||
this.anitype = fp.readULong(); | ||
this.delay = fp.readFloat() * 1000; | ||
this.angle = fp.readFloat() / (1024/360); | ||
this.color = new Float32Array([ fp.readFloat() / 255.0, fp.readFloat() / 255.0, fp.readFloat() / 255.0, fp.readFloat() / 255.0 ]); | ||
this.srcalpha = fp.readULong(); | ||
this.destalpha = fp.readULong(); | ||
this.mtpreset = fp.readULong(); | ||
} | ||
|
||
|
||
/** | ||
* Export | ||
*/ | ||
return STR; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.