Jump to content

Ryokem

Members
  • Posts

    205
  • Joined

  • Last visited

Everything posted by Ryokem

  1. Getexp Maybe you can try with the set method... set BaseExp, BaseExp + getmonsterinfo(killedrid,3); set JobExp, JobExp + getmonsterinfo(killedrid,4); EDIT: <3 u Annie xD
  2. Nah, I don't have any purpose on "attacking" you or your posts. Do you think I really have any interest about showing my abilities this way? I would have way better things to do xD. Just I feel that you are pretty nice a cooperative girl, and your help is good for a nice community, so matching with you and the others is (in my opinion) always a good way for both sides (so me as well) to improve their knowledges or to learn something new. Also 'cause even if my knowledges about Programming are quite good, rAthena is still a new world for me, and facing people who knows it can help me to understand the whole rA background system. So don't feel like I'm attacking anyone xD *pokes Annie and hugs her kindly*
  3. @Annie: The system above the source is really different from NPC scriptings. You can see yourself you have structures and pointers in the source, for not speaking about the higher variable setups and types, like enumerations, booleans and others. Bits are used for different purpose other than for NPC scriptings. Pointers works pretty well with stack, heap, blocks of memory and bits.
  4. True thing about POO and destabilization. But I believe that OOrAthena would simplify every kind of problem about storing variables or using bitmasks (not really used this much lol). And good from rAthena if bit-a-bit operations are this fast to compute, 'cause is not really like that in the most part of IPLs actually used... That's exactly why I proposed to open up a thread about bitmasks, I'm sure we can develop it pretty well and fast sharing our knowledges (not me and you only, I mean everyone who is good at it).
  5. Ryokem

    Request: party

    Yeah, it was just a friendly reminder ^^
  6. Nice try Key, this is a good solution to try to face in my opinion one of the biggest Athena emulation problem: as you work on storage variables and datas from different players, why didn't developers make Athena (both eA and rA) an Object Oriented language? So easy to work between classes and objects, and to store/load them whenever it is necessary... That's the biggest Athena limit in my opinion. Times ago, I was working myself to try to develop and emphatize the concept of class and struct, oriented to a new system of storing datas, based on OOL of course. Had to drop the project 'cause it was pretty long, hard and my time was almost zero. Oh and btw, I still believe anyway that the bit process above bitmasks is pretty odd, helps maybe on storing boolean variables or save space, but still slow for the server to compute. We should release anyway a thread about bitmasks to teach the new generation of scripters what there is in the deep part of the programming.
  7. Bitmasks can only save up to 2 statements, as you correctly compared them to boolean variables. You can have a chain of tons of bits, each of them storing a boolean for an evaluation of 2^n elements. Shifting the bits or using bitmasks, you can get the boolean reference of overy of them. As this process requires a virtual statement, it needs multiple checkings on the bit of the variable you are checking, plus the operation you run to recover the correct bit, while a normal variable declaration just need the time for conversion. Also, if I want a quest to have multiple steps, you can't updrate the variables with bits as both of the 2 status are taken already. So, you can still operate to integer decimal variables, giving a variable 10 possible values instead of 2. The operations will be the same, just it will skip the part of the bit-catching and will reduce again the number of operation the system has to compute (speaking about IPLs, I'm not really a rA expert, it may be there are some particular mechanics that works better with rA more than in other IPLs, that's my limit after all ^^; )
  8. Ryokem

    Request: party

    Also, be sure they don't create a party after joining the event, unless you want them to do it.
  9. I meant that if you want to "save" space, is still better to use decimal system variables more than bits, as you will need to compute more operations for checking bits while it would be way simpler with decimal sys, if you need to save space.
  10. Not really as the space they will placed in is different, unless rAthena didn't really changed it (I just supposed it's like all "normal" IPL's). And as I said before, both ways are correct, but I'd prefer not to use the heap to compute bitmasks, when I can just store values, especially if there can be future updates about the script. Also, are you sure that bitmasks actually set the variable as boolean? I believe that even if it has boolean properties, it's considered as integer, so the memory used won't change, unless you use just one variable and make correspond every bit to a variable value. But the same you can do with integers as well. hmm I never actually tries to code something outside eathena/rathenaany example or external links that I can refer on ? Assembly language (wikipedia) Based on registers and bit-usage. Haha
  11. What's up with bitmasks? Why wasting a spot on heap to operate something binary when actually is the same thing? The variable is stored in a xBit register, and so it happens when you operate with bitmasks. The thing is actually the same, just without any shift or check operation. @Annie: You are a bitmasks-addicted, you should try to program on assembly EDIT: I believe this thread can still be up without getting on PMs, it can help many people to improve a lot as things has started to be shown. Can also be a chance for newbie scripters to learn bitmasks, as the argument has been introduced here. Just my belief
  12. Ryokem

    Quest

    [OT] [/OT] Well yeah, even if Annie didn't correct the error, that's just a typo. You have to use ; next;
  13. Isn't 99 the maximum GM level? xD I can be wrong but I remember those kind of sql ip checking scripts had problems with Internet Cafè's as well...
  14. Woop not really "this" long xD I ended scripting eAthena stuff in 2009-2010, so unless the SVN of the private server I was scripting for was still out-to-date, this problem was still there. Good if it was corrected anyway. That's the spirit.
  15. I've tried it many times since when on eAthena, and a blank menu was just skipping that index, left-shifting all the followings. Unless rAthena changed it, it still should pop to index 0. Although your script can look "sexy" or h/e Annie called it, it has a slow process and a useless overusage of the heap with the setd/getd command, when not necessary.
  16. @Annie: Won't be this good till you will implement the correct sDoc, as he asked how to do it to learn. And well, I didn't know really about the implode function honestly. But still, there is an error in those script tho: if ( !.@pick ) .@currentpage--; This is the general case, but it won't be correct for the very first page, 'cause option 0 in the first page is actually a correct element.
  17. // Setting items to show each page .@list = 15; // Looking for the arraysize .@arraysize = getarraysize(.itemsids); // Setting initial page to 1 .@page = 1; do { // Setting the "Previous Page" menu option (only if not the first page) if( .@page != 1 ) .@menu$ = "Previous Page"; // Setting the array element 0 otherwise else .@menu$ = "" + .itemsids[0]; // Looping .@list array elements each page for(.@i = ((.@page - 1)*.@list); .@i < (.@page*.@list); .@i++ ) { // Adding to .@menu$ the items .@menu$ = .@menu$ + ":" + .itemsids[.@i]; // Checking if the size has reached the maximum if( .@i == (.@arraysize - 1) ) break; } // Setting the "Next Page" menu option (only if not the last page) if( .@i == (.@arraysize - 1) ) .@menu$ = .@menu$ + ":Next Page"; // Setting the selected value. .@s = select( .@menu$ ) - 1; // Condition 1: first page (so no "previous page" option) - Next Page option if( (.@page == 1) && (.@s == .@list) ) .@page++; // Condition 2: not the first page, not the last page - Next Page option else if( (.@page != (.@arraysize / .@list )) && (.@s == (.@list + 1)) ) .@page++; // Condition 3: not the first page - Previous Page option else if( (.@page != 1) && (!.@s) ) .@page--; // Confition 4: you selected a valid menu else break; } while(1); // Recovering the correct array index: if( .@page == 1 ) .@index = .@s; else .@index == (.@s - 1) + (.@list * (.@page - 1); // messaging! mes "You have selected the index " + .@index; mes "Your value is: " + .itemsids[.@index]; EDIT: Not tested.
  18. Yeah, it will delete the item if you set that the item expires after being used. And I personally try not to use atcommand command inside scripts unless it's really the only choice I have, mostly 'cause of server runtime.
  19. Yeah, you can add a timer and setting that kinf of command too, exactly in the same way. Something like... function script command__ { attachnpctimer getcharid(3); atcommand "@autoattack"; initnpctimer; return; OnTimer60000: //60 seconds OnTimerQuit: atcommand "@autoattack"; end; } Note that you have to be careful to use an @command in the OnTimerQuit label, 'cause the player already logged out but it may be still able to run the command.
  20. Just call a function inside the item. Make it an usable item. { callfunc "getItem__"; },{},{} then the function itself.. function script getItem__ { mes "input the ID"; input .@id; //Code to check if the input is avaible/correct mes "input the amount"; input .@amount; //Code to check if the input is avaible/correct getitem .@id, .@amount; return; }
  21. for Auction, you mean a place where people put some items to sell and buyers bet to the highest prize? If I am not wrong, there was a sort of released-auction somewhere in the official emulated client...
  22. Oh yeah, I forgot to initialize the function :<
  23. Try to give a shoot at this.
  24. My bad. zhakastia,104,68,3 script PvP Warper 413,{ function dispell__; mes "[PvP Warper]"; mes "Which arena do you want to go to?"; next; switch(select("Normal PvP ["+getmapusers("guild_vs5")+"/100]:Dispel PvP ["+getmapusers("guild_vs3")+"/100]:No Healing Potions PvP ["+getmapusers("guild_vs2")+"/100]")) { case 1: // Normal PvP if (getmapusers("prt_are01") > 99) callsub S_full; set .@map$, "guild_vs5"; break; Case 2: // Dispel PvP if (getmapusers("guild_vs3") > 99) callsub S_full; set .@map$, "guild_vs3"; dispell__(); break; Case 3: // No Healing Potions PvP if (getmapusers("guild_vs2") > 99) callsub S_full; set .@map$, "guild_vs2"; break; } warp .@map$, 0, 0; end; S_full: mes " "; mes "I'm sorry, this arena is full. Please try again later..."; close; function dispell__ { for( .@i = 0; .@i < 308; .@i++ ) if( (.@i != 53) && (.@i != 54) && (.@i != 249) && (.@i != 103) ) //Do not dispell SC_WEIGHT50, SC_WEIGHT90, SC_JAILED, SC_NOCHAT sc_end .@i; return; } } prt_are01,150,130,4 script PvP Exit 868,{ warp "prontera",0,0; end; } //============= MAP FLAG =============== // Player guild_vs3 mapflag nosave guild_vs3 mapflag noteleport guild_vs3 mapflag nowarpto guild_vs3 mapflag nowarp guild_vs3 mapflag nomemo guild_vs3 mapflag nopenalty guild_vs3 mapflag nobranch guild_vs3 mapflag noicewall guild_vs3 mapflag noreturn guild_vs3 mapflag pvp_noguild guild_vs5 mapflag noteleport guild_vs5 mapflag nowarp guild_vs5 mapflag nosave guild_vs5 mapflag nopenalty guild_vs5 mapflag nobranch guild_vs5 mapflag noicewall guild_vs5 mapflag pvp_noguild guild_vs2 mapflag nopenalty guild_vs2 mapflag nosave SavePoint guild_vs2 mapflag nowarp guild_vs2 mapflag noteleport guild_vs2 mapflag nomemo guild_vs2 mapflag loadevent guild_vs2 mapflag noreturn guild_vs2 mapflag nobranch guild_vs2 mapflag pvp_noguild
×
×
  • Create New...