Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/26/13 in Posts

  1. Hi so this is a suggestion to update our environnement. I'll talk about : 1) Main dir hirarchie and files in 2) Makefiles 3) Shell script update You'll need a basic knowledge on Make (Makefile), shell, and unix filesystem to understand the following. here the current diff : http://upaste.me/b5405421f849ddda 1) I'm thinking the main dir is kinda ugly with a bunch of file we don't use. (we don't use .bat and .sh in same time nor all .sln solution); I'd like to move each .sln into their project path and make a script folder for the (.sh .bat). Wich is more a less the same things as 'tools' dir atm, but I think a rename could be more disanbuisious and we could add more in their. Goal would be to cleanup thing a bit and to create a package/systeme rather then 1 prog like we tend to do atm with increasing map-serv while we could do other proc. 2) Makefiles So just a reminder of the current flow : configure.in is used with autoconf to produce configure, configure is used to produce Makefile by reading Makefile.in and finally make use those makefile to produce binary. With a quick look on Makefiles I saw we still had some 'txt' target in some place (src/map) wich had invalid target and therefore can't compile. You may have a binary with some few edit but it will most likely crash due to all the function require mysql. Therefor I think a small cleanup and harmonisation between those Makefile are necessary to prevent any of this attemp and to not have ugly Makefile harder to maintain. Also I'm not sure about the extensive check on mysql, sure it prevent compiling if you don't have the requirement by default but that would mean your ./configure return an error to begin with. Wouldn't be safer to check if configure didn't fail instead only mysql ? what if we add new lib ? I also change the 'all' target to run all the makefile in subdir so we could check if something didn't broke other like it's currently the case with src/test. (since Sql_Init) make install uninstall bin-clean was also rewritten and taken out as external shell script. I'll talk about them in part 3 3) Shell script. First we using shell script cause bash ain't the default interpreter in all distribution (ksh, tsh,..). athena-start : Since the .pid file was added to prevent killing other servers with the same name on same host. (like map-server p6900 and map-server p6800 dual server). There a small glitch issue if you attempt to relaunch start while a runnig server is on with the same config, it will fail (socket already in use) but the .pid file will be overwritten with the new process id wich won't correspond to the running server. So now we checking this before attempting start wich I hope will remove question about socket error 5 or etc. So new func would be : -status : return whetear the servers are up or down. -restart : now fully check if server down before attemting restart. -start : now check if no instance already running (will launch down ones if so) -watch : auto restart server if taken down (experimental atm) Also I'll save those action into log/map-server.log for exemple. With these change I think we could remove "char-server.sh, map-server.sh, login-server.sh start" wich the first 3 was only monitoring and the last was a multiple start attemp... install.sh uninstall.sh : Those 2 new shell are what was somewhat into make install | uninstall | bin-clean. There being extracted cause we usually have install script outside and also gave the advantage of having more instruction instead depend on make syntaxe. The previous install process was kinda like take our current repository and move it into install directory. (usually /opt/ or /usr/local/) While this "ok" it fork the emplacement of src npc was then in 2 different base path (origin path and install path) making change/sync harder and you couldn't reinstall without those folder into "origin path" (just imagine the nightware for a new script command..) Also "install path" are usualy under root ownership (security to prevent user to add non wanted apps..) wich wasn't check atm and result in a fail. (root ownership will also harder change a bit). I therefore prefer to copy file under installation path and make athena-start use it if we have so. -I wont tread /opt/ vs /usr/local/ that more an admin preference, let just say /opt will be easier to see as a whole package. -db/ was move from etc/ to var/ why ? even if in our case the db is read only it's still meant to be a db and idk maybe one day will writte in it too, db are usually in var/ for that reason not etc/ -Hierarchy of symlink change why ? yes wasn't make sense to have conf/ db/ etc into bin/ directory, but it's common to have binary linked into package dir, wich I did. Hierarchie of opt/rathena/ is the same as if that /opt/rathena/ was the / one. -rathena was added in usr/bin/ why ? this allow user to use "rathena start" everywhere as if it was in /opt/rathena, it's now treated as a real user system command. Why not add /opt/rathena/ into path instead ? didn't really want to bother with .profile and make uninstallation easier. (same go for alias) function.sh To facilitate script dev I moved common var and function into this file so it could be loaded and use everywhere. This prevent name mistmach for server declaration, install_path or package name etc..
    3 points
  2. Fixed. More seriously, yeah I agree with the message (if you want more, ask a question ? maybe ?).
    2 points
  3. I think it is a great idea to cleanup the leftovers from txt from makefile. Fixing the problems with script files are also a great thing to do. Unfortunately I'm not competent enough with makefiles to revise your changes, but based on your description I like them so far. My only request: just try to test the new settings on as many platforms as possible.
    2 points
  4. Well test this: public function readAct($act,$save,$output,$code) { // Open the act file. $this->act = fopen($act, "rb"); // Just like on the sprites we read some infos: ident=ACT, version, number of frames $this->aHeader = unpack('H4ident/Sversion/SnumFrames', fread($this->act, 0x06)); // Get the filesize (used this for sql database etc.) $this->aSize = filesize($act); // The total amount of animations used $this->aAnimations = $this->aHeader['numFrames']; // The number of actions is the num of animations divided by 8. // So what are the "actions"? I just named them like this. They're basicly the directions you can look at. Just like in actOR. // \ | / } // -- o -- }-> 8 in total // / | \ } $this->aActions = ($this->aAnimations / 8); // The version $this->aVersion = dechex($this->aHeader['version']); // Format the version nicely $this->aVersion = (double)preg_replace('{([0-9])(.*?)([0-9])}', '$1.$2', $this->aVersion); // Skip some useless data on one needs fseek($this->act, 0xA, SEEK_CUR); // We're currently at action 0 $currentAction = 0; // Our index for the while loop $anim = 0; // Arrays we save our informations in $pointerMemoryANIM = array(); $pointerMemoryNF = array(); $pointerMemoryPAT = array(); // Lets go through the animations, shall we? while($anim < $this->aAnimations) { // First how many Frames does the action have? // On a normal headgear this would be 3. Because when you are sitting downwards you can look down with your head, left and right. So 3 in total. // Ff you have an animated sprite its more obviously $this->aAnimData[$anim] = unpack('lnumFrames', fread($this->act, 0x04)); // So lets loop through those Frames, cuz they all got individual informations for us for($nf = 0; $nf < $this->aAnimData[$anim]['numFrames']; $nf++) { // Skip useless data fseek($this->act, 0x20, SEEK_CUR); // And now we check how many subFrames this frame got. Or better said Patterns (like in actOR) // For example, if you have a monster sprite and some special effects as seperates sprite frames in the .spr file. // You'll have to paste them onto the stage right? Thats where the patters are being created. Like layers in photoshop. $this->aAnimData[$anim][$nf] = unpack('lnumSubFrames', fread($this->act, 0x04)); // Loop through the patterns or layers for more info about them for($patNo = 0; $patNo < $this->aAnimData[$anim][$nf]['numSubFrames']; $patNo++) { $this->aAnimData[$anim][$nf][$patNo] = unpack('lxOffset/lyOffset/lsprNo/lmirrored/Cred/Cgreen/Cblue/Calpha', fread($this->act, 0x14)); if($this->aVersion < 2.0 ); else if($this->aVersion < 2.4 ) $this->aAnimData[$anim][$nf][$patNo] += unpack('fxyScale/lrotation/lsprType', fread($this->act, 12)); else if($this->aVersion == 2.4 ) $this->aAnimData[$anim][$nf][$patNo] += unpack('fxScale/fyScale/lrotation/lspr_type', fread($this->act, 16)); else $this->aAnimData[$anim][$nf][$patNo] += unpack('fxScale/fyScale/lrotation/lsprType/lsprWidth/lsprHeight', fread($this->act, 24)); } // The end of the Patterns/Layers on the Frame. // So lets see if it has some kind of sound attached to it? (To the frame) fseek( $this->act, 4, SEEK_CUR ); // sound id, store it in a variable if you want extract( unpack("lnumExtraInfo", fread($this->act,0x04) ) ); $extraInfos = array(); for ( $i=0; $i<$numExtraInfo; ++$i ) { $extraInfos[$i] = unpack( "x4/VExtXOffsetX/VExtXOffsetY/x4", fread($this->act,16) ); } } // Increase our Action and loop through the next frames and patterns^^ $anim++; } // After reading all infos we are at the end of the act file where the sound informations are stored. $this->aSoundData = unpack('lnumSounds', fread($this->act, 0x04)); // It has some sounds? if($this->aSoundData['numSounds'] > 0) { // We loop through number of sounds to grab it. for($nSnd = 0; $nSnd < $this->aSoundData['numSounds']; $nSnd++) { // Now because the sound file is a string (directs to some .wav file in the grf), saved in hex and for our advantage always exactly 40 bytes long // we read the string as hex values and save it like that $this->aSoundData[$nSnd] = unpack('H80file', fread($this->act, 0x28)); } } // Oh we also got the interval a frame is played at? That info is ours! > for($intv = 0; $intv < $this->aAnimations; $intv++) { $this->aAnimData[$intv] += unpack('fanimSpeed', fread($this->act, 0x04)); } // Lets format our earlier saved hex string to a actual string with letters and not just numbers ^^ // Some note: If there are sounds in the act (mostly monsters) there always appears to be a sound called "atk", just like that. // It doesnt exist in the grf and I have no idea how it is being handled. Maybe some description of the sounds? foreach($this->aSoundData as $id=>$string) { if((string)$id != 'numSounds') $this->aSoundData[$id] = str_replace(pack('H2','00'),"",(pack('H*', $string['file']))); } // Lets display our results of the act file. $act = '$jact'; if (strpos($output, "head")) { $act = '$hact'; } else { echo '<pre>'; echo print_r($this->aAnimData, true); echo print_r($this->aSoundData, true); echo '</pre>'; } // Close the file, its no longer needed. =( fclose($this->act); }
    1 point
  5. Ok I see the problem. // Change this: $this->aAnimData[$anim][$nf] += unpack('lExtYOffset/lExtYOffset/lExtXOffset/lExtYOffset/lExtXOffset', fread($this->act, 0x14)); $extrainfo = unpack('lbool', fread($this->act, 0x04)); if($extrainfo['bool'] == 1) fseek($this->act, 0x10, SEEK_CUR); // To: fseek( $this->act, 4, SEEK_CUR ); // sound id, store it in a variable if you want $extrainfo = unpack('lbool', fread($this->act, 0x04)); // Extras infos (if you need) fseek($this->act, 0x10 * $extrainfo['bool'], SEEK_CUR);
    1 point
  6. The damage of earthquake is the divided by the number of players hit by the skill. If there are no players hit by it, there is a division by 0. It's in trunk/src/map/battle.c (line 4157) if (skill_id == NPC_EARTHQUAKE) { //Adds atk2 to the damage, should be influenced by number of hits and skill-ratio, but not mdef reductions. [Skotlex] //Also divide the extra bonuses from atk2 based on the number in range [Kevin] if(mflag>0) ad.damage+= (sstatus->rhw.atk2*skillratio/100)/mflag; else ShowError("Zero range by %d:%s, divide per 0 avoided!\n", skill_id, skill_get_name(skill_id)); }
    1 point
  7. This topic has info on installing MySQL. phpMyAdmin install instructions via Google. Nginx from the same. Google's pretty helpful.
    1 point
  8. don't use 8000 + as mob id... try 2400 - 2800 like that
    1 point
  9. clieninfo.xml <?xml version="1.0" encoding="euc-kr" ?> <clientinfo> <servicetype>korea</servicetype> <servertype>sakray</servertype> <connection> <display>AllegRO</display> <balloon>Welcome</balloon> <desc>Welcome</desc> <address>127.0.0.1</address> <<add this to if using host server <address>111.67.18.116</address> <port>6900</port> <version>26</version> <langtype>1</langtype> <registrationweb></registrationweb> <aid> <admin>2000000</admin> </aid> <loading> <image>loadingscreen01.jpg</image> </loading> </connection> </clientinfo>
    1 point
  10. Use this: divorce This function will also destroy both wedding rings and send a message to both players, telling them they are now divorced.
    1 point
  11. prontera,152,183,0 script Poring#test1 1002,2,2,{ end; OnInit: initnpctimer; setarray .x[0],160,152,159,152; setarray .y[0],187,175,169,183; set .a,0; set .m$,"prontera"; end; OnTimer2000: getmapxy(.m$,.nowx,.nowy,1); if (.nowx != .x[.a] && .nowy != .y[.a]) { npcwalkto .x[.a],.y[.a]; } else {set .a,.a+1; if (.a >= getarraysize(.x)) set .a,0; } initnpctimer; end; OnTouch: npctalk "Hey! Toi!"; mes "Line 1"; next; mes "Don't block me!","Now I'll continue to walk..","Even though if you haven't press the next or the close button."; close; } Here you go! Oh.... I think I have misread your second request Anyway, here you go: prontera,152,183,0 script Poring#test1 1002,2,2,{ end; OnInit: initnpctimer; setarray .x[0],160,152,159,152; setarray .y[0],187,175,169,183; set .a,0; set .m$,"prontera"; end; OnTimer2000: getmapxy(.m$,.nowx,.nowy,1); if (.nowx != .x[.a] && .nowy != .y[.a] && .stop != 1) { npcwalkto .x[.a],.y[.a]; } else {set .a,.a+1; if (.a >= getarraysize(.x)) set .a,0; } initnpctimer; end; OnTouch: set .stop,1; npctalk "Hey! Toi!"; mes "I'll stop right here."; next; mes "Now I'll continue to walk after you press the close button."; close2; set .stop,0; end; } For delay between points, just add a delay by using sleep 1000 //Delay by 1 second. sleep 60000 //Delay by 1 minute. Hope it is solved now..
    1 point
  12. where's your NPC header ? =='' i assume that you should know how to add a npc header... read Basic_Scripting
    1 point
  13. In battle.conf, attack_attr_none is set to 14 by default. Set it to 12 to affect mob attacks.
    1 point
  14. was tryed currently on freebsd_9.1 (64); centos 6.3 (32); debian 6.0.3 (64); fedora 18 (64), and ubuntu 12.10 (64).
    1 point
  15. Check the getitem2 at script_commands.txt
    1 point
  16. Or simply use this script: - script AreaMonster -1,{ OnInit: areamonster "prontera",1,2,3,4,"Drops",1113,100,strnpcinfo(0)+"::OnMobKill"; end; OnMobKill: areamonster "prontera",1,2,3,4,"Drops",1113,1,strnpcinfo(0)+"::OnMobKill"; end; }
    1 point
  17. Already answered your bug report, please refrain from posting in two places. You didn't recompile, that's all. You're missing a new script command and the msg_* update.
    1 point
  18. switch to rA....if i am not mistaken...only rA have this script command..i dont think 3ceam / eAthena have it. *instance_check_party(<party id>{,<amount>{,<min>{,<max>}}}); This function checks if a party meets certain requirements, returning 1 if all conditions are met and 0 otherwise. It will only check online characters. amount - number of online party members (default is 1). min - minimum level of all characters in the party (default is 1). max - maximum level of all characters in the party (default is max level in conf).
    1 point
  19. This is impossible with our pre-re/re split unless we duplicate entire scripts, which we've already decided not to do (it's hellishly annoying to edit files this way). In general, for duplicates in pre-re/re split files, we keep a floating NPC in the root folder and duplicates in the pre-re/re paths. All duplicates in mixed folders (merchants, other, etc.) should be self-contained. Do you have any specific examples?
    1 point
×
×
  • Create New...