Jump to content

KeyWorld

Members
  • Posts

    379
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by KeyWorld

  1. Made my day @jingcleovil I'm not a big fan, maybe because I don't really love facebook.
  2. I don't understand what the problem with the "npc capture". Don't forget that it just print the "visual" result ( mes, next, menu, input, close) and not all others internals thing like variables, algo, condition, check, rand, etc (which is the more important part of a npc). Good job Yommy
  3. Hi, maybe a link will help us to find the problem ?
  4. Be sure that your web host don't add some code to your page (publicity for example). Maybe your have a php error (sql connection or other thing) that provoke some code to don't be run and some html tags not displayed to the page (and break your template).
  5. As far i know a "file structure/format" can't be copyright, just the content inside. Since no files from Gravity are packed in his GND/GAT/RSW, just used externally (sound/models/textures) he doesn't release a Gravity work, just 3 files that contain HIS content (mesh, maps infos, etc.). So no problem I think for your ,,Friend"" (if it was really a lawyer).
  6. Something like this: online_user.php: <?php header('Content-type:text/plain'); // Configs $db_host = "localhost"; $db_name = "ragnarok"; $db_user = "ragnarok"; $db_pass = "ragnarok"; $cache_file = "status.txt"; $cache_time = 60; // seconds. if ( !file_exists($cache_file) || filemtime($cache_file) + $cache_time < time() ) { $db = new PDO("mysql:host={$db_host};dbname={$db_name}", $db_user, $db_pass ); $count = $db->query("SELECT COUNT(*) FROM `char` WHERE `online` = '1'")->fetchColumn(); file_put_contents( $cache_file, $count ); } readfile($cache_file); ?> html page: <div id="online_user"><?php include('online_user.php'); ?></div> <script type="text/javascript"> // lol IE lol window.XMLHttpRequest = window.XMLHttpRequest || function() { try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch (e) {} try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch (e) {} try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {} throw new Error('No support for XMLHttpRequest ?'); } setInterval( function() { var req = new XMLHttpRequest(); req.onreadystatechange = function() { if ( this.readyState === 4 && this.status === 200 ) document.getElementById('online_user').innerHTML = this.responseText; // IE love innerHTML }; req.open('GET', 'online_user.php', true ); req.send(null); }, <?php echo $cache_time * 1000; ?> ); </script>
  7. Good I didn't add it because there is just one frame for the death action. But if you want : http://robrowser.com/prototype/act/syouji.php - Here you go
  8. If it can help - script var -1,{ function inside_func { // own namespace // .@b: 0 set .@c, 5; } // <- clean .@c OnInit: set .@a, 5; end; // <- clean .@a OnEvent: // Custom event // .@a: 0 set .@b, 3; inside_func(); // .@c: 0 // .@b: 3 goto OnTest; OnTest: // goto keep variables // .@b: 3 set .@c, 8; callsub OnTest2; // .@b: 3 // .@c: 8 // .@d: 0 end; // clean .@b, .@c OnTest2: // .@b: 0 // .@c: 0 set .@d, 5; return; // <- clean .@d } .@var are limited to their namespaces and not copy to their inside function/callsub. But you can modify them in a function using getarg(): - script var -1,{ function double { set getarg(0), getarg(0) * 2; } OnInit: set .@b, 10; double(.@; // .@b: 20 } No problem with switch in switch. You can even do function in function without problem
  9. Hi. From the doc: 0: bare fist 1: Daggers 2: One-handed swords 3: Two-handed swords 4: One-handed spears 5: Two-handed spears 6: One-handed axes 7: Two-handed axes 8: Maces 9: Unused 10: Staves 11: Bows 12: Knuckles 13: Musical Instruments 14: Whips 15: Books 16: Katars 17: Revolvers 18: Rifles 19: Gatling guns 20: Shotguns 21: Grenade launchers 22: Fuuma Shurikens
  10. Well, you leave irc so... http://robrowser.com/prototype/act/syouji.php It's auto-generated, so maybe some errors. Let me know.
  11. They should use playerattached(). In memory getcharid() throw an error if no player attached to the scriptNo opinion about an offline mode.
  12. // When loading frames: for( $i=0; $i<$this->sHeader['num_pal']; $i++ ) { $this->frames[$i] = unpack('Swidth/Sheight/', fread($this->spr, 0x04)); extract( unpack('Ssize', fread($this->spr,0x02) ) ); $this->frames[$i]['data'] = fread( $this->spr, $size ); } // When you want to draw a frame $frame = $this->frames[$frame]; // $frame is the frame you want to render $width = $frame['width']; $height = $frame['height']; $data = $frame['data']; $img = imagecreatetruecolor( $width, $height ); // Allocate palette $pal = array(); for ( $i=0, $j=4; $i<256; ++$i, ++$j ) $pal[$i] = imagecolorallocate( $img, ord($this->palette[$j++]), ord($this->palette[$j++]), ord($this->palette[$j++]) ); // Render image for ( $i=0; $i < $width * $height; ++$i ) { imagesetpixel( $img, $i % $width, $i/$width | 0, $pal[ ord($data[$i]) ] ); } imagepng( $img );
  13. Well, each frames in the sprite have a data ( the data start to $this->frames[<index>]['offset'] and end to ($this->frames[<index>]['offset'] + $this->frames[<index>]['data_length'] ). Each bytes of this data represent $spr_index.
  14. Yeah imagesetpixel is inside a loop. In your sprite file, you have a raw data that contain all palettes indexes, $spr_index represent one of this palettes indexes.
  15. Palette contain 1024 bytes, so basically 256 * rgba values (when alpha isn't used). Sprite contain palette indexes (and in some cases, some raw images). And one (default) palette is also contain in the end of a sprite file, so if you can display a sprite without loading an extra .pal file you should be able to load a .pal file (it's the same thing). So basically: // Loading palette $pal_data = fread( $fp_pal, 1024 ); // Allocate palettes $palette = array(); for ( $i=0, $j=0; $i<256; $i++, $j+=4 ) { $palette[ $i ] = imagecolorallocate( ord( $pal_data[$j+0] ), ord( $pal_data[$j+1] ), ord( $pal_data[$j+2] ) ); } // Display a pixel : ($spr_index) imagesetpixel( $img, $x, $y, $palette[ $spr_index ] );
  16. Really nice, good job I love it ! (Except the header that can be better I think).But by the way remove my name, I have done nothing in your design
  17. You can use my online grf parser to find files (just change the url with what you want): http://grf.robrowser...rite/shadow.spr http://grf.robrowser...rite/shadow.act The first and second are not stored in my 3 grfs, I think this files don't exist.
  18. You should test it before ask Missing a "{", missing a "}", bad else location, the announce is send every time a player log out, warp players every time the log out to prontera. Should be something like this: OnPCLogOutEvent: if ( strcharinfo(3) == "1@pump" ) { if ( getmapusers("1@pump") == 0 ) // 0 or 1 ? Does the script is execute before decrement the map counter ? { hideoffnpc "MvP Summoner"; announce "MvP room is now availabe.", bc_all; killmonsterall "1@pump"; } warp "prontera", 150, 150; end; }
  19. It would be nice to ask me before releasing my repeatable background in template #4. I'm not a bad guy you know ? Just a thing, don't forget that Firefox isn't the only browser, don't forget webkit, ie, opera...
  20. Are you sure ? M : start to index 2: 1 7 5 4 3 6 8 9 10 12 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 F : start to index 2: 4 7 1 5 3 6 12 10 9 11 8 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 (Default style: 2) It was base on an old client, things may have change, I didn't check it recently. Anyway, good job
  21. db/item_avail.txt ? It will copy the item server-side and tell to the client that your custom item is another item (so no need to add something client-side).
  22. I had this problem in the past. It's not related to the patcher ! It's a IE problem (yeah IE sux lol). You can fix it with a CSS rule, but I don't remember the code lol. Try to do : body, html { margin: 0; padding: 0; border: none; }
  23. Welcome back Thadium
×
×
  • Create New...