Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/01/14 in all areas

  1. September Digest 2014 The following digest covers the month of September, 2014. Staffs Changes None. Development Highlights Cleaned up the first class skill quest NPCs. (caa80ec) Cleaned up and stabilized the autotrade system some more. (8a81940) Updated the Airship NPCs to match official. (77549f7) Fixed the behavior of Devotion to official. (9b4d922) Fixed skill unit effect not displaying correctly for newer clients. (05d3c6b) Added new flags for Skill Unit to remove hardcoded checks: UF_NOKNOCKBACK: Cannot be knocked back (only unit that can be damaged). UF_REM_CRAZYWEED: Removed if be overlapped by GN_CRAZYWEED. UF_REM_FIRERAIN: Removed if be overlapped by RL_FIRE_RAIN. Updated items to newer 2014 data. (8fc758f, 9bde9dc) Updated the EXP tables to the latest. (98c83ee) Summons (Pets, Elementals, Homunculus, Mercenaries) no longer get stuck when the master walks too fast. (60b0ed9) Cast sensor mobs will always target the caster when any skill is used. (60b0ed9) Various fixes for NPCs that used rand(1) always returning the first option. (17bace0) Updated Izlude's Magazine and Bullet Dealer NPC locations. (880903b) Added a check to clear unit group skills that are created by a NPC. (3efe537) Added script checks against equipment swapping using third-party tools. (14fddd3) Changed how the Unique ID System creates and stores IDs for items. (c0ed836) Various script cleanups. (30b4d57) Fixed the remaining skill import tables that were having issues. (51ecd9b) Added rewarp_counter to prevent infinite warps through a warp portal. (ea8ccfc) Minor renewal monster database update. (ea1a247) Removed any remaining TXT references. (2d2991a) Updated documenations. (403c22b, 8bdea5d) Added console commands for the login and character servers. (7cac208) Updated status effect chance to renewal. (9b4d922) Switching arrows no longer stops attacks. (a080117) Looter monsters will now randomly pick items on the ground rather than going for the closest. (a080117) Rewrote the hard monster AI. (cfef8a0) Updated various issues with Super Novices. (8256194) Updated the pathfinding system. (8256194) Fixed various skills that caused server crashes. Various third class skill cleanups. Statistics 5 authors have pushed 20 commits during this period. On master, 158 files have changed. There have been 11,220 additions and 10,204 deletions. Merged 2 pull requests, thanks for submitting those pull requests!
    3 points
  2. https://github.com/ThemonChan/2014-Ragexe-Client // 2014-02-05bRagexe - Themon // 2014-03-05bRagexe - Themon
    1 point
  3. -[Client Hexing Tutorial by nkwz*]- Hi! This is a tutorial for those who are interested in learning how to edit your client.exe from beginning. This tutorial will be divided into several topics: 1. Introduction 2. Basic Knowledge 3. Tools 4. Client Editing 5. Help the rA Community! 6. Credits I want to share my knowledge about client hexing, and I'd like to make this project as an rA Community Project. It's better to have more people joining this project, because it needs lots of effort for making a fully translated client. Suggestion and questions are always welcomed, and sorry for my poor English 1. INTRODUCTION rAthena is one of the popular Ragnarok Online emulator, some of you maybe already know about other emulators such as eAthena or 3CeAM. In order to play RO, we need something named as server and client. rA, eA and the others are Server. kRO, Miruku and the others are Client. Actually you can find another custom client package, just search throughout this forum and you'll find some. Most of rA codes based from kRO, not iRO. And that's why some of the original client (not hexed yet) comes with lots of Korean words hardcoded inside them, although some part of it is already translated into English but we still need to convert Korean letters into Latin first. I recommend to translate the client from Korean into English first, because it'll be easier if you want to translate your own client.exe into your native language later. 2. BASIC KNOWLEDGE 2a. Numeral System In our daily life we use a "Base 10" numeral system, called as Decimal. It goes from 0,1,2,3....10,11,12.... But in programming world, there's also other numerical bases such as: Binary (Base 2), Octal (Base 8), Hexadecimal (Base 16). In Decimal, we count from 0-9, when we add another 1 into 9, the result is 10. In Binary, it only have 2 numbers, 1 and 0. 1 Decimal = 1 Binary, 2 Decimal = 10 Binary. 3 --> 11, 4 --> 100, 5 --> 101, 6 --> 110, 7 --> 111, 8 --> 1000. In Octal is the same, they only have 0-7, there is no '8' in this numeral system. What about Hex? It's Base 16 right? How many numbers do they have in this numeral system? Of course 16. But what to come after 10? Hex has a special case, because Hex borrows 10 numbers from Decimal (That is 0-9) and also borrows 6 letters from Latin (A-F). So if you add 1 into 9, it doesn't become 10, instead it will becomes A. 0,1,2,3.....9,10,A,B,C... What to expect if you add 1 into F? Guess what, it becomes 10! So, 9 Decimal --> 9 Hex, 10 --> A, 15 --> F, 16 --> 10, 50 --> 32, 100 --> 64. That's why they are called as "Base x", x means how many numbers they have in their numeral system. 2b. File Structure This topic isn't necessary though, but I just want to help you to understand how executable file works. There are numerous of file types in nowadays computing world, starting with the widely known txt, mp3, avi, jpg, bmp, xls, exe. This time, what we need to know is only about exe files. In Windows, almost all of applications are 'exe' files. Coders/Developers write out codes in either Low Level Language or High Level one, and after that the codes are compiled into something that we (computer user) could use without knowing anything about programming language. When the exe file is being compiled, it also store something which called as "Header" in it's beginning lines. Different compiler generates different header too. One of the header contains filesize checksum, so that's why we can't edit exe file freely as we want to, because if we're not aware about this problem, our exe file won't work at all... 2c. Hardcode vs Softcode What on earth is that? Hardcode means the code is read from the file itself. So if we want to alter the code, we need some special tools. The case is different for some codes (that some people prefer to call as 'Softcode'), those type of code can be altered because the exe file reads them from outside of the file, the notable example is 'msgstringtable.txt', when you alter the word in that file, you can see the changes when you run your client.exe So when next time someone replied in a post "It's hardcoded in the client", you know exactly what it means 3. TOOLS If we want to edit our client.exe we need some tools, such as: - Hex Editor (Obviously ;P) - Text Processor (I use Notepad++ [set encoding to UTF-8]) - Calculator (Optional) - nkwz rA Toolkit --> http://rathena.org/b...kwz-ra-toolkit/ - Charmap.exe (Can be found in every PC that uses Windows) You can get those tools in the internet. Freeware is okay too.. 4. CLIENT EDITING Phew... After reading those exhausting topics, here we are.. (Afterall I guess that's why you're reading up to this point). First, get some 2012 client.exe. For example here, I use '2012-04-10aRagexeRE.exe', any 2012 version will do, as long as the client developer doesn't change the file structure (>_<') Then open your client.exe in hex editor, you'll notice 3 sections. The leftmost part is called Offset, the middle part is Hex stream/data, the right part is ASCII data. Offset is like a location pointer, and they're increasing if we scroll down. Still remember about Hex numeral system on previous topic? Well.. here they are, the heart of every exe files, hex! The right part is just a translated code from hex into Latin characters, so some of the data can be more understandable to human eye. The problem is the client.exe comes from Korean developers, so they use their native language, Koreans! That's a nightmare for those who doesn't live in Korea... (Yes it is! ) But if the developer creates an English version, then why am I writing this tutorial? Anyway back to the topic... Hmm.. Make a copy of your client.exe, open one client.exe in hex editor, and run the other one. After you login with correct username and password, there's the Char Selection window, go create a new char. Look, our first Korean word has appeared! If you hasn't install the Korean Language pack, you'll see this "Äɸ¯Å͸¸µé±â" (Note: I uninstall my Korean Language pack in order to see those letters). Open charmap.exe, use Arial font (or another font if you want), and find that strange letters one by one. (I know this is exhausting, that's why I want to make this project as a Community Project). After you double click each letter found in charmap, you should have all (or some) of the strange letters, well this part is a little tricky because your eye have to be good to see the correct letter, if you picked a wrong letter in charmap, then your conversion process won't be a success. After you collect the letters in charmap, then open 'nkwz rA Toolkit.exe', and you'll see 2 boxes, one is Input Hex, and the other is Input Latin. Paste the letters into 'Input Latin' and voila! You have those secret codes showing in Output Hex! Äɸ¯Å͸¸µé±â --> C4C9B8AFC5CD20B8B8B5E9B1E2 Then go back to your hex editor, search for 'C4C9B8AFC5CD20B8B8B5E9B1E2' (or some part of it), and if you're lucky, then you'll find the position, if not then you'll need to meet an Arch Bishop and request Gloria for Luk+30... Please note that some hex editor can't highlight all of the code even when it's found, so you'll have to see carefully. Look at the nkwz rA Toolkit, at the bottom of the program I also have write a simple line about how many chars that has been converted in the process. Then think about some name that would fit in the game, in http://rathena.org/b...r-2012-clients/ Razor X and Judas picked 'Create Player'. Back at the nkwz rA Toolkit, type Create Player in the Input Latin, and voila again! Suddenly some magical numbers appeared in Output Hex! Important: Look at the bottom part, 'Latin: 13 char'. Make sure you use same amount of chars as the replacement! If you plan to use other name that is shorter that the original, just add some space to the end at Input Latin, so the char amount is the same like hex chars. The next thing after your convert 'Create Player' or 'Create a Char' into hex, let's go back at the hex editor and edit the value according to the generated value in nkwz rA Toolkit in Output Hex. After that, save it and run the file to see if your changes has been made correctly into the client.exe Congratulations! Now you can make your own 2012 client.exe.. ^________^ And that's a wrap! 5. HELP THE rA COMMUNITY! As like I said earlier in this tutorial, I'd like to make this as a Community Project. How to join? Just post a decent and readable screenshot of Korean garbled letters, and also the location of the window/skill/item/chat window info so it's easy to find it in the game, then help us to find the letter in charmap.exe and paste it here, just follow the example post. After that, think of a good name as the replacement (in English please) If you can't think about it now, don't worry, someone may have a good name for it. 6. CREDITS This tutorial is written by me, after I read this post --> http://rathena.org/b...r-2012-clients/ I got inspired to write this tutorial. I wrote down the codes which floating in my head last night, and that's how 'nkwz rA Toolkit' was made. Umm.. I compress the exe file with UPX, and some antivirus app doesn't like a file with UPX compression D: Thanks to Razor X for his inspiring post Thanks to Utada Hikaru, Ayumi Hamasaki and also Winamp! ^^ You can call me as nkwz* too, and btw I don't have any Twitter/Facebook account ;P Thanks for reading this tutorial and let's add more power to rA! Example: Image: Location: Login --> Create a new char Korean: Äɸ¯ÅÍ ¸¸µé±â Hex code: C4C9B8AFC5CD20B8B8B5E9B1E2 English Suggestion: Create Player / Create a Char
    1 point
  4. So basically this was going to be something of a surprise. I've been working on this script since January, not constantly just occasionally. It works - kinda... The script runs fine if I don't include the heuristic... But when I do it stops about half way through ama_dun01. I think without the heuristic It takes approximately 3 minutes to complete ama_dun01. Why am I posting this here? Well simply put I don't have enough time to work on it at the moment, and it's just going to disappear forever if I don't. So what I'm asking is for anyone to optimize this and maybe help me figure out why it's stopping with the heuristic value. Before anyone says it, if they even do. Yeah it would be faster on Hercules because of unlimited arrays and ++.@r but that's obvious. I want this to work on rAthena . I'll try to update this topic when I get some more time. ( I've got a few other projects to finish first. ) Thanks in advance any input on this is appreciated. ( There are a few bits I left out because they were mainly for debug/or were part of the main event which I felt wasn't developed enough. ) //Diagonal = 14 //} G //Adjacent = 10 //} G function script abs { //.@v = getarg(0); //.@mask = .@v >> 4 * 8 - 1; //return ((.@v + .@mask) ^ .@mask); .@i = getarg(0); return ( (.@i < 0) ? -.@i : .@i ); } function script max { .@i = ((getarg(0) > getarg(1)) ? getarg(0) : getarg(1)); return .@i; //return getarg(0) ^ ((getarg(0) ^ getarg(1)) & -(getarg(0) < getarg(1))); } ama_dun01,233,9,3 script npc_go 100,{ OnGo: setarray .@dx, 1, 1, 0, -1, -1, -1, 0, 1; setarray .@dy, 0, 1, 1, 1, 0, -1, -1, -1; .@x = 233; //Start Pos .@y = 11; //Start Pos .@s_x = 233; //Start Pos .@s_y = 11; //Start Pos .@len = getarraysize(.@dx); .@e_x = .e_x; //End Pos .@e_y = .e_y; //End Pos .@map_size = 240*240; .@g = 0; dispbottom .@x+"!="+.@e_x+"&&"+.@y+"!="+.@e_y+"||"+.@q+"<"+.@map_size; debugmes "-------------Starting---------------"; set(.@time,gettimetick(0)); freeloop(1); setarray getd(".@node_x"+.@x+"y"+.@y+"c"), 1, .@x, .@y; .@v = 1; .@ar[getarraysize(.@ar)] = .@v; while( .@q<.@map_size ) { LOOP4: set(.@x2,.@x+.@dx[.@a]); set(.@y2,.@y+.@dy[.@a]); .@mes$ = .@x2+" "+.@y2+" "+.@v+" "+.@a+"|"+.@x+" "+.@y; set(.@tmp5$,".@node_x"+.@x2+"y"+.@y2); //----------------------------------------------------> (".@node_x"+.@x2+"y"+.@y2) Temp string. copyarray .@tc_ary, getd(.@tmp5$+"c"), 6; //-------------------------------------------------> .@tc_ary = "Testing closed-list array(node)". if( !.@tc_ary ) { //.@a++; .@q++; continue; } //---------------------------------------------> Challenge closed node. if(checkcell("ama_dun01",.@x2,.@y2,cell_chkwall) || checkcell("ama_dun01",.@x2,.@y2,cell_chkcliff) || checkcell("ama_dun01",.@x2,.@y2,cell_chkwater) || checkcell("ama_dun01",.@x2,.@y2,cell_chknopass) || checkcell("ama_dun01",.@x2,.@y2,cell_chknoreach)) { //---------------------------------> Challenge turf walk-able. .@mes$ = .@mes$+" Not valid turf!"; } else { set .@a$, .@tmp5$+"o"; //-------------------------------------------------------------> (".@node_x"+.@x2+"y"+.@y2+"o") Open-list node. copyarray .@to_ary, getd(.@a$), 6; //-------------------------------------------------> .@to_ary = "Testing open-list array(node)". set(.@m,!.@dx[.@a]||!.@dy[.@a]?10:14); //---------------------------------------------> Challenge diagonal. //dispbottom "Parent G: "+getd(".@node_x"+.@to_ary[1]+"y"+.@to_ary[2]+"c[0]"); //if(.@to_ary) { set(.@g,getd(".@node_x"+.@to_ary[1]+"y"+.@to_ary[2]+"c[0]")+.@m); } /*else {*/ if( .@to_ary ) { //-------------------------------------------------------------------> Testing open node. "True: Test if better parent to current closed node." set .@tmp$, ".@node_x"+.@x+"y"+.@y; //---------------------------------------------> (".@node_x"+.@x+"y"+.@y) Temp string. copyarray .@cc_ary, getd(.@tmp$+"c[0]"), 6; //-------------------------------------> .@cc_ary = "Current closed array". (Parent to testing nodes.) .@mes$ = .@mes$+" On open list... Testing!"; if( (.@cc_ary[0] + .@m ) < .@to_ary[0] ) { //--------------------------------------> Challenge current node g plus distance to parent less than testing node g. //dispbottom "New Parent: "+.@x2+", "+.@y2; .@mes$ = .@mes$+" shorter route!"; setarray getd(.@tmp$+"c[0]"), //-----------------------------------------------> (".@node_x"+.@x+"y"+.@y+"c[0]") (.@cc_ary[0] + .@m ), .@x2, .@y2, //----------------------------------------> new g, new parent >Recalculate current closed node. ((.@cc_ary[0] + .@m ) + getd(".h_x"+.@x+"_y"+.@y)); //-----------------------> g + heuristic = new heuristic. killmonster "ama_dun01",strnpcinfo(0)+"::On"+.@x2+"-"+.@y2; monster "ama_dun01",.@x2,.@y2,"New Parent",1936,1,strnpcinfo(0)+"::On"+.@x2+"-"+.@y2; killmonster "ama_dun01",strnpcinfo(0)+"::On"+.@x+"-"+.@y; monster "ama_dun01",.@x,.@y,"New Child",1935,1,strnpcinfo(0)+"::On"+.@x+"-"+.@y; copyarray getd(".@node_x"+.@x2+"y"+.@y2+"c[0]"), .@to_ary[0], 6; //------------> Move testing open-list node to closed-list node. } else { .@mes$ = .@mes$+" Not shorter!"; } } else { //---------------------------------------------------------------------------> Testing open node. "False: Add it to the open-list!" .@mes$ = .@mes$+" Not on the open list... Adding!"; set .@g, getd(".@node_x"+.@x+"y"+.@y+"c[0]")+.@m; //-------------------------------> Testing open node g equals current closed node g plus distance to testing open node g. .@f = .@g + getd(".h_x"+.@x2+"_y"+.@y2); //----------------------------------------> Testing open node f equals g plus heuristic. setarray getd(.@a$), .@g, .@x, .@y, .@f, .@x2, .@y2; //----------------------------> Set testing open list node values. //dispbottom "Adding: "+ .@g+", "+.@x+", "+.@y+", "+.@f+", "+.@x2+", "+.@y2; monster "ama_dun01",.@x2,.@y2,"Added",1934,1,strnpcinfo(0)+"::On"+.@x2+"-"+.@y2; //if( getarraysize(getd("@open_list"+.@v+"$")) >= 32 ) //----------------------------> Is current operating open-list greater than or equal to thirty-two? // .@ar[getarraysize(.@ar)] = .@v++; //-------------------------------------------> Not enough room for child/parent store value in a new open-list. if( getarraysize(getd("@open_list"+.@v+"$")) >= 32 ) { while( getarraysize(getd("@open_list"+.@v+"$")) ) .@v++; .@ar[getarraysize(.@ar)] = .@v; } //debugmes "Adding: ("+.@f+"|"+.@x2+"|"+.@y2+") to @open_list"+.@v+"$ Len: "+getarraysize(getd("@open_list"+.@v+"$")); .@loops = callfunc("AddHeap", (.@f+"|"+.@x2+"|"+.@y2), getd("@open_list"+.@v+"$")); //--------> Adding open node to the heap/open-list. } } } else { .@mes$ = .@mes$+" On Closed List!"; } dispbottom .@mes$; if( .@v == 737/* && .@a == 7*/ ) end; .@a++; jump_zero ( .@a >= .@len ), LOOP4; //.@u = .@cu = .@w_temp = 0; .@u = 0; //-------------------------------------------------------------------------------------------> Current open-list. .@cu = 0; //-------------------------------------------------------------------------------------------> Challenged open-list. .@w_temp = 0; //----------------------------------------------------------------------------------------> Smallest f value. .@v_len2 = .@v_len; .@v_len = getarraysize(.@ar); //-------------------------------------------------------------------------> Size of condensed open-lists. if(.@v_len2 < (.@v_len-1)) { debugmes .@v+"Dropped Value! "+.@v_len2+"<"+(.@v_len-1); } while( .@u<.@v_len //---------------------------------------------------------------------------------> While testing list within open list range /*|| !.@v_len //------------------------------------------------------------------------------------> or open-list doesn't exist >Find shortest open-list f. ( Might not need last parts double check. ) && .@u<=.@v_len*/ ) { //----------------------------------------------------------------------------> and testing list less than length lists. .@cu = .@ar[.@u]; .@len2 = getarraysize(getd("@open_list"+.@cu+"$")); .@tmp = atoi(getd("@open_list"+.@cu+"$")); debugmes .@u+" OpenList Array "+.@ar[.@u]; if( .@tmp<.@w_temp || !.@w_temp ) { .@w_temp = .@tmp; .@w_len = .@len2; .@w_ptr = .@u; .@w = .@cu; } //dispbottom "Len: "+.@len2+" "+getarraysize(getd("@open_list"+.@u+"$"))+"| Temp: "+.@tmp+"| .@w: "+.@w+"| .@u: "+.@u; .@u++; } //dispbottom "Before: "+getarraysize(getd("@open_list"+.@w+"$")); explode .@array$, getd("@open_list"+.@w+"$"), "|"; copyarray .@temp[0], getd(".@node_x"+.@array$[1]+"y"+.@array$[2]+"o[0]"), 6; //if(!(.@w_len-1)) { dispbottom "Deleteing: "+.@ar[.@w_ptr]+" | Array Size: "+getarraysize(getd("@open_list"+.@w+"$"))+" | Array: "+getd("@open_list"+.@ar[.@w_ptr]+"$"); } callfunc "DelHeap", 0, getd("@open_list"+.@w+"$"), .@w_len; if( .@w_len==1 ) { deletearray .@ar[.@w_ptr],1; } if( !getd(".@node_x"+.@array$[1]+"y"+.@array$[2]+"c[0]") ) { if(.@temp) { viewpoint 2, .@x, .@y, /*(*/.@q/*+.@a)*/, 0xFF0000; .@x = .@temp[4]; .@y = .@temp[5]; copyarray getd(".@node_x"+.@x+"y"+.@y+"c[0]"), .@temp, 6; deletearray getd(".@node_x"+.@x+"y"+.@y+"o"); setarray .@temp, 0, 0, 0, 0, 0, 0; ////monster "ama_dun01",.@x,.@y,"Using",1934,1; } } set(.@a,0); if(.@x==.@e_x&&.@y==.@e_y) { dispbottom "We did it"; break; } //We've reached the end. //if(.@x==.@l_x&&.@y==.@l_y) { dispbottom "Can't be solved!"; end; } //This puzzle can't be solved. .@l_x = .@x; .@l_y = .@y; .@q++; if(.stop) end; if(!(.@q%1000)/*.@v2 != .@v*/ ) { .@v2 = .@v; //viewpoint 1, .@x, .@y, /*(*/.@q/*+.@a)*/, 0xFF0000; //dispbottom "Still Working: .@q="+.@q+" | @open_list"+.@v+"$ Len="+getarraysize(getd("@open_list"+.@v+"$"))+" | .@ar Size: "+getarraysize(.@ar)+" | Cords: "+.@x+", "+.@y; sleep2(1); } if( getarraysize(getd("@open_list"+.@v+"$")) > 32 ) end; //dispbottom "Still Working: .@q="+.@q+" | @open_list"+.@v+"$ Len="+getarraysize(getd("@open_list"+.@v+"$"))+" | .@ar Size: "+getarraysize(.@ar)+" | Cords: "+.@x+", "+.@y; } LOOP3: .@x2 = getd(".@node_x"+.@x+"y"+.@y+"c[1]"); .@y2 = getd(".@node_x"+.@x+"y"+.@y+"c[2]"); monster "ama_dun01",.@x2,.@y2,"Path",1934,1; viewpoint 1, .@x, .@y, .@ii++, 0x00FF00; if(.@p_len>=128) { .@j++; .@p_len=0; } setd ".@p_l"+.@j+"$["+.@p_len+"]", .@x2+"|"+.@y2; .@p_len++; .@x = .@x2; .@y = .@y2; if( .@x == .@s_x && .@y == .@s_y ) GOTO L_1; if( !.@x && !.@y ) end; GOTO LOOP3; L_1: while(.@t<=.@j/*getarraysize(getd(".@p_l"+.@t+"$"))*/) { if(.@t<.@j) { .@len=64; .@i_len=128; } else { .@i_len = getarraysize(getd(".@p_l"+.@t+"$")); .@len =.@i_len/2; } for(.@y = 0; .@y < .@len; .@y++) { .@temp$ = getd(".@p_l"+.@t+"$["+.@y+"]"); setd(".@p_l"+.@t+"$["+.@y+"]",getd(".@p_l"+.@t+"$["+(.@i_len-.@y-1)+"]")); setd(".@p_l"+.@t+"$["+(.@i_len-.@y-1)+"]",.@temp$); } .@t++; } dispbottom "This process took: "+(gettimetick(0)-.@time)+" ms"; Clear: while(.@cu<=.@v) { deletearray getd("@open_list"+.@cu+"$"); .@cu++; } if(.@clear){ dispbottom "Cache Cleared"; end; } .@gid = bg_monster(.@a,"ama_dun01",233,8,"--ja--",3999,strnpcinfo(0)+"::OnDeadMob"); getmapxy(.@map$,.@m_x,.@m_y,3,""+.@gid); sleep2(100); set(.@z,.@t-1); while(getarraysize(getd(".@p_l"+.@z+"$"))) { while(.@k<getarraysize(getd(".@p_l"+.@z+"$"))) { explode(.@array$,getd(".@p_l"+.@z+"$["+.@k+"]"),"|"); unitwalk(.@gid,atoi(.@array$),atoi(.@array$[1])); sleep2(500); .@k++; } .@k=0; set(.@z,.@z-1); } end; OnGoHome: .stop = 1; end; OnGoClear: .@clear = 1; goto Clear; OnGoStart: warp "ama_dun01",233,9; end; OnList: getmapxy(.@map$,.@x,.@y,0); if(checkcell(.@map$,.@x,.@y,cell_chkwall) || checkcell(.@map$,.@x,.@y,cell_chkcliff) || checkcell(.@map$,.@x,.@y,cell_chknopass) || checkcell(.@map$,.@x,.@y,cell_chknoreach)) { dispbottom "Failed"; } else dispbottom "Added"; end; OnInit: bindatcmd "@stop",strnpcinfo(0)+"::OnGoHome"; bindatcmd "@clear",strnpcinfo(0)+"::OnGoClear"; bindatcmd "@list",strnpcinfo(0)+"::OnList"; bindatcmd "@start",strnpcinfo(0)+"::OnGoStart"; setarray .@map_max, 240, 0; .e_x = 232; //End Pos .e_y = 144; //End Pos freeloop(1); set(.@time,gettimetick(0)); if(!.h_switch) { .@x = 0; .@y = 240; LOOP1: LOOP2: if(checkcell("ama_dun01",.@x,.@y,cell_chkwall) || checkcell("ama_dun01",.@x,.@y,cell_chkcliff) || checkcell("ama_dun01",.@x,.@y,cell_chknopass) || checkcell("ama_dun01",.@x,.@y,cell_chknoreach)) {} else setd(".h_x"+.@x+"_y"+.@y, (10*(abs([email protected]_x ) + abs([email protected]_y )))); jump_zero ((.@y--)<.@map_max[1]),LOOP2; .@y = 240; jump_zero (.@x++>.@map_max),LOOP1; npctalk "This process took: "+(gettimetick(0)-.@time)+" ms"; } else { .@x_d = abs(.@x2-.@e_x); .@y_d = abs(.@y2-.@e_y); if(.@x_d > .@y_d) .@h = 14*.@y_d + 10*(.@x_d-.@y_d); else .@h = 14*.@x_d + 10*(.@x_d-.@x_d); //.@x_d = abs(.@x2 - .@e_x); //.@y_d = abs(.@y2 - .@e_y); //.@h = /*.@m*/14 * max(.@x_d, .@y_d); } } function script AddLeaf { .@key = getarg(0,0); .@ptr = getarg(1,0); if(!getstrlen(@node$)) @node$ = getarg(0)+"||"; else if(getarg(0) < atoi(@node$[.@ptr])) { if(getarraysize(@node$)>=(2*.@ptr)+1) { if(@node$[(2*.@ptr)+1]!="") //charat(.@node$[.@ptr],strpos(.@node$[.@ptr],"|")+1) callfunc("AddLeaf",((2*.@ptr)+1)); else @node$[(2*.@ptr)+1] = getarg(0)+"||"; } else { @node$[(2*.@ptr)+1] = getarg(0)+"||"; } } else if(getarg(0) > atoi(@node$[.@ptr])) { if(getarraysize(@node$)>=(2*.@ptr)+2) { if(@node$[(2*.@ptr)+2]!="") //charat(.@node$[.@ptr],strpos(.@node$[.@ptr],"|")+1) callfunc("AddLeaf",((2*.@ptr)+2)); else @node$[(2*.@ptr)+2] = getarg(0)+"||"; } else { @node$[(2*.@ptr)+2] = getarg(0)+"||"; } } else { dispbottom "The key has already been added to the tree."; } } //AddHeap({<value>,<array>,<pointer>}); function script AddHeap { .@key = getarg(0,0); .@ke$ = getarg(0,0); .@ptr = getarg(2,getarraysize(getarg(1,@node$))); copyarray .@ar$, getarg(1,@node$), .@ptr; LOOP: .@loops++; ///if(.@ptr>64) return 1; if(.@ptr) { .@pnt = (.@ptr-1)>>1; } if( getarraysize(.@ar$) ) if( countstr("#"+implode(.@ar$,"#")+"#", "#"+.@ke$+"#", 0) > 1 ) { debugmes .@ke$+" exists in "+implode(.@ar$,"#")+" loops "+.@loops; } if(!/*getstrlen(*/getarraysize(.@ar$)/*)*/) { .@ar$ = .@ke$; } else if(atoi(.@ar$[.@pnt]) > .@key) { .@temp$ = .@ar$[.@pnt]; .@ar$[.@pnt] = .@ke$; .@ar$[.@ptr] = .@temp$; .@ptr = .@pnt; goto LOOP; } else if(getarraysize(.@ar$)<=.@ptr) { .@ar$[.@ptr] = .@ke$; } copyarray getarg(1,@node$), .@ar$, getarraysize(.@ar$); return .@loops; } function script DelHeap { .@ptr = getarg(0,0); .@len = getarg(2,getarraysize(getarg(1,@node$)))-1; if( .@len < 0 ) end; copyarray .@ar$, getarg(1,@node$), .@len+1; .@ar$[.@ptr] = .@ar$[.@len]; .@ar$[.@len] = ""; deletearray getelementofarray(getarg(1,@node$),.@len),1; LOOP: .@cn1 = (.@ptr<<1)+1; //.@cn1 = (.@ptr*2)+1; .@cn2 = .@cn1+1; .@ptn = atoi(.@ar$[.@ptr]); .@cd1 = atoi(.@ar$[.@cn1]); if(.@len>.@cn2) { .@cd2 = atoi(.@ar$[.@cn2]); if(.@cd1>.@cd2) { if(.@ptn>.@cd2) { .@temp$ = .@ar$[.@ptr]; .@ar$[.@ptr] = .@ar$[.@cn2]; .@ar$[.@cn2] = .@temp$; .@len = getarraysize(.@ar$); .@ptr = .@cn2; goto LOOP; } } else { if(.@ptn>.@cd1) { .@temp$ = .@ar$[.@ptr]; .@ar$[.@ptr] = .@ar$[.@cn1]; .@ar$[.@cn1] = .@temp$; .@len = getarraysize(.@ar$); .@ptr = .@cn1; goto LOOP; } } } else if(.@ptn>.@cd1&&.@len==2) { .@temp$ = .@ar$[.@ptr]; .@ar$[.@ptr] = .@ar$[.@cn1]; .@ar$[.@cn1] = .@temp$; } else if(!.@ptn&&.@len==2) { .@temp$ = .@ar$[.@ptr]; .@ar$[.@ptr] = .@ar$[.@cn1]; .@ar$[.@cn1] = .@temp$; } copyarray getarg(1,@node$), .@ar$, getarraysize(.@ar$); return; } function script PrintInOrder { .@ptr = getarg(0); if(getarraysize(@node$)) { if(getarraysize(@node$)>=(2*.@ptr)+1) { if(@node$[(2*.@ptr)+1]!="") callfunc("PrintInOrder",((2*.@ptr)+1)); } .@message = .@message + @node$[.@ptr]; if(getarraysize(@node$)>=(2*.@ptr)+2) { if(@node$[(2*.@ptr)+2]!="") callfunc("PrintInOrder",((2*.@ptr)+2)); } } else { dispbottom "The tree is empty."; } } function script test { copyarray .@array$, getarg(0), getarraysize(getarg(0)); for(.@a=0;.@a<getarraysize(getarg(0));.@a++) { //dispbottom ""+getelementofarray(getarg(0),.@a); dispbottom .@array$[.@a]; } //return; dispbottom "done"; } test_map,7,82,5 script AtoI-Test 100,{ /*freeloop(1); .@time=gettimetick(0); for(.@a=0;.@a<1000;.@a++) { .@b = atoi("100|32432|10"); //.@b = atoi("100#32432#10"); //.@b = atoi("100a32432a10"); } npctalk "Test 1 "+(gettimetick(0)-.@time)+"ms"; Sleep(100); .@time=gettimetick(0); for(.@a=0;.@a<1000;.@a++) { explode(.@a$,"100|32432|10","|"); //explode(.@a$,"100#32432#10","#"); //explode(.@a$,"100a32432a10","a"); } npctalk "Test 2 "+(gettimetick(0)-.@time)+"ms";*/ deletearray @node$; ///setarray .@keys$, "50", "76", "21", "4", "32", "64", "15", "52", "14", "100", "83", "2", "3", "70", "87", "80"; ///setarray .@keys, 410, 705, 732, 23, 195, 78, 452, 970, 804, 970; setarray .@keys$, "9212", "7387", "1821", "4979", "9241", "1309", "4870", "4946", "707", "3081", "2141", "2135", "5324", "9566", "9638", "8759", "8749", "5620", "8667", "7287", "8", "668", "4899", "3688", "5614", "2754", "8833", "8783", "1682", "2781", "2720", "7709", "2120", "306", "6410", "4590", "6040", "3933", "2124", "5542", "6361", "7499", "3610", "155", "35", "9936", "1935", "8725", "9049", "4406", "5905", "4539", "6843", "9243", "3569", "5038", "2712", "8041", "2181", "796", "9083", "3534", "891", "1687"; dispbottom "Len "+getarraysize(.@keys$); ///callfunc("test",.@keys$); debugmes implode(@node$,"#"); .@tick = gettimetick(0); for(.@a=0;.@a<getarraysize(.@keys$);.@a++) callfunc("AddHeap",(.@keys$[.@a]),.@node$); ///callfunc("PrintInOrder"); debugmes implode(.@node$,"#"); for(.@a=0;.@a<getarraysize(.@keys$);.@a++) { callfunc("DelHeap",0,.@node$); debugmes implode(.@node$,"#"); } .@tock = gettimetick(0); debugmes ( .@tick-.@tock )+"ms"; }
    1 point
  5. August Digest 2014 The following digest covers the month of August, 2014. Staffs ChangesNone. Development Highlights Fixed several bugs with the autotrade system. Added packet documentation. (402170c) Devotion no longer reflects magic damage. (45a8e8f) Fixed unit skills not displaying their animations correctly. (05d3c6b) Skill Unit config additions: (453b6d0) UF_NOKNOCKBACK: Cannot be knocked back (only unit that can be damaged). UF_REM_CRAZYWEED: Removed if overlapped by GN_CRAZYWEED. UF_REM_FIRERAIN: Removed if overlapped by RL_FIRE_RAIN. Fixed several issues reported by CPPCheck. (fea3489) Updated EXP values for base levels 150 ~ 175 and job levels 50 ~ 60. (98c83ee) Fixed summons getting stuck when they are too far from their master. (60b0ed9) Added config 'spawn_direction' for keeping a character's face direction when teleporting/changing maps/logging in. Default is always North (official). (60b0ed9) Cast sensor mobs will now always target the caster when any skill type is used. (60b0ed9) Script command query_sql will now return -1 on an empty result or failed result.(60b0ed9) Added config 'arrow_shower_knockback' for the direction in which Arrow Shower is used. (70b8b8b) Added support for remaining database files to be imported. Added some NPC checks to thwart 3rd party hacks swapping items. (14fddd3) Cleaned up the Unique ID System. (c0ed836) Added a warp counter to prevent infinite warps by NPC. (ea8ccfc) Minor update to mobs. (ea1a247) Cleaned up a lot of core related issues. Bug-squashing, fixing a large number of skill issues in particular. Many Item DB Updates, thank for the contributions. Statistics 8 authors have pushed 44 commits during this period. On master, 269 files have changed. There have been 10,842 additions and 7,484 deletions. Merged 3 pull requests, thanks for submitting those pull requests!
    1 point
  6. Added AEGIS 'CLASS_' enum (dae8122, 8120164) contains updates in item bonuses. Item bonuses 'bAddDefClass' and 'bAddMdefClass' replaced by 'bAddDefMonster' and 'bAddMdefMonster'. Item bonuses 'bIgnoreMdefRate' and 'bIgnoreDefRate' replaced by 'bIgnoreMdefRaceRate' and 'bIgnoreDefRaceRate'. Added new item bonuses: bIgnoreDefClass, bDefRatioAtkClass, bAddClass, bSubClass, bMagicAddClass, bWeaponComaClass, bHpDrainValueClass, bSpDrainValueClass, bIgnoreMdefClassRate. All monsters separated on Class_, like in AEGIS: Class_Normal - all normal monsters Class_Boss - all boss monsters Class_Guardian - all Guardian type monsters (in gvg map) For example, we use now '{ bonus2 bAddClass,Class_Normal,10; }' instead of '{ bonus2 bAddRace,RC_NonBoss,10; }' in item bonus filed. This bonus will not affect on Guardians, only on Normal class. Also was added new constants: RC_ALL (RC_All) - Immediately to indicate all races. CLASS_ALL (Class_All) - Immediately to indicate all classes. ELE_ALL (Ele_All) - Immediately to indicate all elements. SZ_ALL (Size_All) - Immediately to indicate all sizes. For example, { bonus2 bAddSize,Size_All,40; } instead of { bonus2 bAddSize,Size_Small,40; bonus2 bAddSize,Size_Medium,40; bonus2 bAddSize,Size_Large,40; } New lines in doc/item_bonus.txt bonus bIgnoreDefClass,n; Disregard DEF against enemies of class n n: Class_Normal, Class_Boss, Class_Guardian bonus bDefRatioAtkClass,n; Does more damage depending on monster Defense against class n (defense disregard) bonus2 bIgnoreDefRaceRate,n,x; Disregard x% of the target's DEF if the target belongs to race n n: RC_Formless, RC_Undead, RC_Brute, RC_Plant, RC_Insect, RC_Fish, RC_Demon, RC_DemiHuman, RC_Angel, RC_Dragon, RC_All bonus2 bAddClass,n,x; +x% physical damage against class n n: Class_Normal, Class_Boss, Class_Guardian bonus2 bSubClass,n,x; +x% damage reduction against class n n: Class_Normal, Class_Boss, Class_Guardian bonus2 bMagicAddClass,n,x; +x% magical damage against class n n: Class_Normal, Class_Boss, Class_Guardian bonus2 bWeaponComaClass,n,y; y/100% chance to cause Coma when attacking a monster of class x with a normal attack n: Class_Normal, Class_Boss, Class_Guardian bonus2 bHpDrainValueClass,n,x; Heals +x HP when attacking a monster of class n with normal attack. n: Class_Normal, Class_Boss, Class_Guardian bonus2 bSpDrainValueClass,n,x; Heals +x SP when attacking a monster of class n with normal attack. n: Class_Normal, Class_Boss, Class_Guardian bonus2 bIgnoreMdefClassRate,n,x; Disregard x% of the target's MDEF if the target belongs to class n n: Class_Normal, Class_Boss, Class_Guardian
    1 point
  7. it should be same, let's see. and, seems I worry about the short type of cardfix short cardfix = 1000, t_class, s_class, s_race2, t_race2;
    1 point
  8. I can't see here, but are you using TABs where it should be (and not space)? prontera,102,81,4 script Donate Custom 811,{ I mean prontera,102,81,4<TAB>script<TAB>Donate Custom<TAB>811,{ Check on wiki for further info.
    1 point
  9. Well you need to do two things: 1. Make the required skill start SC_COMBO. This can be doen by adding the skill to skill_combo: void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){This one is pretty self-explanatory. In section "Start new combo", add the required skill and give it a duration. void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){ case AL_INCAGI: if (pc_checkskill(sd, MYCUSTOM_SKILL) > 0) duration=1; break;That means during AL_INCAGI effect you can do a combo. You can also set a fixed duration like 2000, that means you can do the combo until 2 seconds after the cast of AL_INCAGI.2. Now when using your new skill, add the code as explained above (see part I quoted). It would look like this: case MYCUSTOM_SKILL: if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI)) return false; break;That way you check if the combo was triggered by AL_INCAGI. If it's not the case you return false = "skill not possible".If you don't like the negation you can also do it the other way around: case MYCUSTOM_SKILL: if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI) break; return false;
    1 point
  10. Well, you have to work with status changes. Basically you do: if(sc && sc->data[SC_MYSTATUSCHANGE]) skillcode;Check skill.c, you can look at Monk combos to see examples: case MO_CHAINCOMBO: if(!sc) return false; if(sc->data[SC_BLADESTOP]) break; if(sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == MO_TRIPLEATTACK) break; return false; case MO_COMBOFINISH: if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == MO_CHAINCOMBO)) return false; break; case CH_TIGERFIST: if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == MO_COMBOFINISH)) return false; break; case CH_CHAINCRUSH: if(!(sc && sc->data[SC_COMBO])) return false; if(sc->data[SC_COMBO]->val1 != MO_COMBOFINISH && sc->data[SC_COMBO]->val1 != CH_TIGERFIST) return false; break; case MO_EXTREMITYFIST: // if(sc && sc->data[SC_EXTREMITYFIST]) //To disable Asura during the 5 min skill block uncomment this... // return false; if( sc && (sc->data[SC_BLADESTOP] || sc->data[SC_CURSEDCIRCLE_ATKER]) ) break; if( sc && sc->data[SC_COMBO] ) { switch(sc->data[SC_COMBO]->val1) { case MO_COMBOFINISH: case CH_TIGERFIST: case CH_CHAINCRUSH: break; default: return false; } }in function "skill_check_condition_castbegin".If you just want the increase agi status change to be a requirement to use another skill you can just check for that status change, very easy. But if you only want to allow the other skill if you used increase agi yourself, then you need to make increase agi give the SC_COMBO status change to yourself and set "val1" to AL_INCAGI.
    1 point
  11. You can try that one (attached file). Before and after. I did it pretty quickly though... wind_ghost.rar
    1 point
  12. .@i = 175; announce sprintf( "%d.%02dx",( .@i / 100 ),( .@i % 100 ) ),_bc_all; end; you can also try like this.
    1 point
  13. /*========================================================= Points to Item Exchanger by Mumbles =========================================================== Request: http://goo.gl/MplDtF =========================================================== Preview: =========================================================== Description: Exchanges items for points and vice-versa at a fixed rate. =========================================================== Compatibility: Optimised for rAthena emulators. =========================================================== Changelog: v1.0 - First version. v1.0.1 - Added changelog. v1.0.2 - Removed reverse transactions. [Missingno] v1.0.3 - Adjusted rates. [Missingno] v1.1 - Compatibilised for rAthena emulators. [Missingno] =========================================================*/ prontera,164,169,3 script Point Exchanger::points2item 871,{ /*----------------------------------------------------- Script -----------------------------------------------------*/ mes .npc_name$; mes "Hello there, ^FF8800"+ strcharinfo(0) +"^000000! "+ "Would you exchange your "+ .points_name$ +" "+ "for "+ .pod_name$ +"?"; mes " "; mes "Exchange Rate: "+ .rate +":1"; mes .points_name$ +": [^FF0000"+ getd(.points_var$) +"^000000]"; next; switch (select(implode(.menu_options$, ":"))) { case 1: mes .npc_name$; mes "Okay, come back if you change your mind!"; break; case 2: mes .npc_name$; mes "Please enter the amount of "+ .points_name$ +" that you want to exchange."; do { mes " "; mes "Input ^0000FF0^000000 to cancel."; next; input .@amount; .@total = .@amount / .rate; // Check break input if (!.@amount) { message strcharinfo(0), strnpcinfo(1) +" : Exchange terminated."; close; } // Check amount against points if (getd(.points_var$) < .@amount) { mes .npc_name$; mes "^FF0000Please enter a valid amount.^000000"; } } while (getd(.points_var$) < .@amount); // Check weight if (!checkweight(.pod_id, .@total)) { mes .npc_name$; mes "^FF0000You're overweight; please store some items.^000000"; break; } setd .points_var$, getd(.points_var$) - .@amount; getitem .pod_id, .@total; mes .npc_name$; mes "You've exchanged "+ .@amount +" "+ .points_name$ +" for "+ .@total +" "+ .pod_name$ +". "+ "You now have "+ getd(.points_var$) +" "+ .points_name$ +" and "+ countitem(.pod_id) +" "+ .pod_name$ +"."; break; } close; /*----------------------------------------------------- Configuration -----------------------------------------------------*/ OnInit: .npc_name$ = "[^0000FFPoint Exchanger^000000]"; .rate = 20; // Exchange rate (rate = 1 PoDs) .pod_id = 7350; // Proof of Donation item ID or constant .pod_name$ = getitemname(.pod_id) +"(s)"; // Proof of Donation item name .points_name$ = "Cash Point(s)"; // Points name .points_var$ = "#CASHPOINTS"; // Points variable // Modifying these options requires updates to the corresponding case setarray .menu_options$[0], "^FF0000>^000000 Cancel", "^0000FF>^000000 Exchange "+ .points_name$ +" for "+ .pod_name$; end; }
    1 point
  14. #Database: ragnarok #Table: loginlog CREATE TABLE IF NOT EXISTS `loginlog` ( `time` datetime NOT NULL default '0000-00-00 00:00:00', `ip` varchar(15) NOT NULL default '', `user` varchar(23) NOT NULL default '', `rcode` tinyint(4) NOT NULL default '0', `log` varchar(255) NOT NULL default '', INDEX (`ip`) ) ENGINE=MyISAM ; https://github.com/rathena/rathena/blob/master/sql-files/logs.sql -- -- Table structure for table `mapreg` -- CREATE TABLE IF NOT EXISTS `mapreg` ( `varname` varchar(32) NOT NULL, `index` int(11) unsigned NOT NULL default '0', `value` varchar(255) NOT NULL, KEY `varname` (`varname`), KEY `index` (`index`) ) ENGINE=MyISAM; https://github.com/rathena/rathena/blob/master/sql-files/main.sql http://rathena.org/wiki/SQL_Installation#Database_Installation
    1 point
×
×
  • Create New...