Jump to content

Legend

Members
  • Content Count

    375
  • Joined

  • Days Won

    5

Reputation Activity

  1. Upvote
    Legend reacted to Haru in About Code Review and Why You'd Want Your Code to Be Reviewed   
    About Code Review and Why You'd Want Your Code to Be Reviewed
     
    Hello, fellow developers and code contributors!
    As you certainly know, years ago, Hercules adopted a workflow based on pull requests, that includes code review as one of the necessary steps before any new piece of code makes it into the master branch of the repository.
    While being an uncommon and somewhat controversial change in Hercules (and in the RO emulator scene in general), code review is part of the workflow of most software projects, both open source and closed source, and has many benefits.
     
    Why Code Review
     
    The benefits of code review are several:
    "Given enough eyeballs, all bugs are shallow" [Linus's Law by Eric S. Raymond -- The Cathedral and the Bazaar, 1999]. While the law is not strictly true, it's certainly true that the more developers read and analyze a piece of code, the more likely it is that bugs that might be hidden in it are discovered early. Testing is not enough. It's very hard (or in the case of our codebase just plain impossible) to cover all the possible edge cases when testing a new feature or a fix. An additional pair of eyes reading the code may help discovering those more easily. This includes cases where the client would normally prevent a certain thing from happening, but it's not ensured anywhere on the server side. Better quality of code. By having other developers read a piece of code, they'll end up wondering why a certain approach was taken, rather than another, and discuss it with the submitter, leading to better, more efficient algorithms, or better engineered code. Better documentation. Since the code needs to be read by other people, it'll require proper comments (or they'll ask for explanations about the parts they can't easily explain). This increases the chance that the author, or anyone else that will need to read the same code again months or years after it's been submitted, will be able to understand it again, by finding appropriate comments in the appropriate parts of the code. Better insight into the code across the team. By reading code from different parts of the emulator as part of the review process, every team member increases their own general knowledge of the software, bit by bit. This is a very efficient way of learning how different parts of the emulator work, and why they were implemented that way. Future-proofing. By having public reviews, we keep a permanent trace of what were the hot topics and why certain decisions were taken, when a certain part of the emulator was implemented. If a bug arises, or something needs to be redesigned in future, we can look up the associated pull request and related discussion, and learn more about the discussion that went on in the past, and what's hiding behind code design decisions. Reviewing code from other people, as well as having one's own code reviewed by others might not be easy for everyone, especially at the beginning, but please try your best. Here are some suggestions on how to approach code review from either side. 
    How to approach code review (for code authors)
     
    As a code author, the worst thing you can do is to be afraid or shy about other people judging your code. This is the wrong approach! Don't be shy, have your code looked at by others, have them praise you for your genial approach to tackle a problem, listen to their suggestions on how to improve it. But be ready to defend your implementation, if you believe it's better than the suggestions you receive, or if the critics that are moved against it are wrong or meaningless.
     
    Always keep in mind that:
    Having your code reviewed and commented on isn't humiliating. Other people are spending their time looking at your code, asking you why you did something in a certain way rather than another, suggesting improvements. Both sides have a lot to learn from each others. (On the other hand, if no one reviews your code, that's somewhat humiliating!) If someone spots an issue in your code, it doesn't mean that you're a bad developer. We all make mistakes, and we should be happy to learn from them (and it's definitely better if someone spots them and points them out to us before it's too late and they were able to do some harm). Never, ever, take code review personally. No one will laugh about you, fire you, kill you, shame you, etc. if your code is commented on. If you believe you're right and the comments you received are pointless or wrong, chance is that you really are right. Be ready to defend your reasons, it's possible that the reviewer didn't think of them. It is your duty to explain them your reasons. How to approach code review (for code reviewers) 
    Reviewing code is several orders of magnitude harder than having your own code reviewed. You have to check the code for several classes of problems, point out your findings, suggest improvements. And you still have to deal with the worry about hurting the code author's feelings when pointing out a mistake.
     
    Here are some things you should keep in mind when reading and reviewing code from other people:
    You're not judging a person. You're judging code. Don't make your review sound personal. Always think of uncommon and edge cases, and never assume they can't happen, unless there's an explicit check that makes them impossible to happen. Even if the code was tested by the author, it doesn't mean that it can't cause problems to other existing features, or have some issues the author couldn't think of. If the same person writes and tests a piece of code, the chance that they don't test the cases they forgot to handle while coding, is very close to 100%. If the code is not following the project's style guidelines (and this isn't just about indentation, but also about names, conventions about function calls, proper modularization, etc), it is your duty to point it out now, before it's merged. This will make the life of your fellow developers easier later on. Think defensively. Consider the code you have in front of you as buggy until you can prove its correctness. If you see that a sanity check is missing, ask the author to add it. If you believe that a function returns the wrong value in certain cases, even if very unlikely to occur, prepare an example of input for which that happens and point it out. Remember that threats such as overflows, underflows, buffer overruns, null pointers, invalid pointers, numeric (floating point) approximation, etc. are always behind the corner, check for them as often as possible and prove that they can't occur. And remember that, while the code author isn't your enemy (and code review shouldn't generate negative feelings), it's often a good idea to think of them as your "professional enemies". There's a chance that something nasty is hiding in their code, even if they didn't write it with ill intent, and as such, you shouldn't blindly trust the code, regardless of who the author is. Don't be afraid when you comment on other people's code. Your goal isn't to hurt their feelings, you're asking them for explanations and/or suggesting the way you would have done something. Likewise, don't be afraid of making a pointless comment. If the author has a good reason for their implementation, be ready to take back your comment and learn from them. Don't accept compromises. If you're firmly convinced that the author's defense of their code is wrong, your duty is to prove them wrong. But if they manage to convince you, don't be ashamed of admitting you were wrong. Happy reviewing!
  2. Upvote
    Legend reacted to Sephus in Achievement & Item Link System   
    Preview of the achievements and the achievement window working on Hercules
     
    (All official content, no customizations - although supported in my implementation.)
     

  3. Upvote
    Legend got a reaction from hercules newbie in [Release] babbs event scripts   
    Thumbs up! Thanks for sharing 
  4. Upvote
    Legend reacted to imbadudelz in [Release] babbs event scripts   
    Description:   A collection of events I made 6 years ago (2011) on my server. I was using eAthena server files when I made these scripts. I'm not sure if it's compatible with Hercules' server files. Some servers are still using some of these scripts and I think they're using new emulators like rAthena or Hercules.   I just want to share these scripts to everyone.   I don't know anything about programming when I made these scripts so the code is quite ugly. I did not even use functions lol.   Players on my server really enjoyed Stop the Clock and Guess the Word event.   I can't answer any questions regarding these scripts. I can't even remember the codes I've written here.   Events: Stop the Clock event Guess the Word event Run for your Life event Monster Hunt event - The last boss in Monster Hunt is a custom mob. Change it into whatever you want to avoid errors.
    True or False event Lucky Box Event Poring Punch event Poring Catcher event Racing event MVP event Last Man Standing event (pvp) Free for All event (pvp) Soccer Ball event Treasure Box event  
    NPC: Prize Giver npc - Download the sql script in the link below. Load and execute it on your database (phpMyAdmin / MySQL Workbench). It will create a table used by the Prize Giver npc. It won't work without this table.
    Event Manager npc Event Warper npc Time Play npc Bubble Gum npc (copied the bubble gum quest in VanRO)  
    Note: The prize of some events, especially the automated events, is a custom item. Change it into whatever you want to avoid errors. babbs-event-scripts.rar
    prize-giver-sql-script.rar
  5. Upvote
    Legend reacted to Habilis in @emotion @heart @show @hold @detach   
    Aside from being 6 months old and there could be updates changing the commands mechanism...
     
    the only difference I can tell is this constant
    ALL_CLIENT
     
    as in 
    clif->specialeffect(&sd->bl,413,0);
     
    would be 
    clif->specialeffect(&sd->bl,413,ALL_CLIENT);
     
     
    And plugin init is not needed anymore?
    /* Server Startup */ HPExport void plugin_init (void) { addAtcommand("dance",dance); }  
    Anyways my code is cleaner than whatever you posted there.
     
    UPD: Soon will be installing fresh latest hercules and test 
    All of them one by one.
  6. Upvote
    Legend reacted to Sephus in Hercules vs rAthena: Current differences   
    This will change to -
    Hercules: better stability, performance, customisation, closer to official, more updated.
  7. Upvote
    Legend reacted to Ragno in Add usage of constants on item_db.conf structure   
    There are some numeric values that are constant to all items and doesn't change, it could be changed to constants and improve the understanding of item_db.
     
    Those values are: Type, Upper, Gender, Loc, View (can be seen constant name on lub files), Stack and Sprite.
     
    Example:
     
    { Id: 1626 AegisName: "Piercing_Staff" Name: "Piercing Staff" Type: TYPE_WEAPON Buy: 20 Weight: 500 Atk: 80 Matk: 145 Range: 1 Job: { Magician: true Acolyte: true Priest: true Wizard: true Monk: true Sage: true } Upper: { Upper: true Third Job: true Upper Third Job: true Baby Third Job: true } Loc: LOC_WEAPON WeaponLv: 3 EquipLv: 70 View: WEAPONTYPE_ROD Script: <" bonus bInt,4; bonus bIgnoreMdefRate,10+getrefine(); "> },  
    In this example is changed values from Type, Upper, Loc and View to constants.
  8. Upvote
    Legend reacted to Mystery in Templates : Issues & Pull Request   
    Hey everyone,
     
    We recently implemented Issue & Pull Request templates. You can find them here:
    Pull Request : https://github.com/HerculesWS/Hercules/blob/master/.github/PULL_REQUEST_TEMPLATE.md Issues : https://github.com/HerculesWS/Hercules/blob/master/.github/ISSUE_TEMPLATE.md  
    Basically, when users are creating Issues or Pull Requests, they will see this form. This helps Hercules' Developers & Contributors by having the right details at the start of a thread. It ensures issues get resolved quickly and time isn't wasted. These templates are a step forward to help lessen issues or pull requests that do not meet requirements. Failure to follow these templates will result in an automatic closure of the issue or pull request. 
     
    It is important for users to follow these templates and fill them out when creating issues and / or pull requests. 
     
     

  9. Upvote
    Legend reacted to Sephus in Little Control Panel, for those who only want registration and status   
    Might I suggest expanding this towards a MVC (Model, View and Controller) design. If you're still working on it.
  10. Upvote
    Legend reacted to Sephus in Achievement & Item Link System   
    Working on this
     
    The complete system is vast and requires scripting for most achievements as they're through NPCs. And we don't have much official info. But I've made it flexible enough to be customized for types of possible achievements, even ones not present in kRO.
  11. Upvote
    Legend reacted to Mystery in Changing up the Default Theme?   
    Hey everyone! I think the default theme of the FluxCP needs some sprucing up.... so here is my sort of take on it. The theme revolves around using Hercules and its colours. Check it out for yourself:
     






     
     
    Features:
    Mobile Responsive Hercules Theme FontAwesome RSS Fed News Status Checkers Player Counts  
    Popup Login & Login Page


     
    Logged-in Header

     
     
    Please keep in mind that this theme isn't your average FluxCP theme. Also please note that the theme is not done... tons of more work to do still!
     
    This will eventually be uploaded into the repo where members can help make PRs to fix anything / add anything into the theme.
  12. Upvote
    Legend reacted to Adel in Adel's Sprite Showcase   
    Hello people~
    I am Adel and this is my updated sprite showcase.
    ❤   ❤   ❤  Hope you enjoy    ❤   ❤   ❤
    Note: Please do not steal the display images.
    Some of the references for my sprites were taken from other game sources.  
          
          
       
          
       
          
          
       
          
          
          
       
          
             
             
       
          
             

          
       
             
           
              
          
          
       
           
           
             
          
       
           
           
             
          
          
             
          
          
                
            

        
                
             
          
       
          

             
           
        
          
          
          
          
          
        
     
          
          
          
          
     
    Mob Sprites
     
             
          
             
       

    Other Sprites

     
  13. Upvote
    Legend reacted to KirieZ in SetQuest2   
    SetQuest2
    View File NOTE: This functionality got merged into Hercules (check setquest and getcalendartime). That being said, I'm NOT maintaining this plugin anymore.
    Hello,
    This plugin adds the setquest2 script command that allows you to add a quest with your own time limit, ignoring the one in quest_db, thus allowing you to, for example, make a quest end at a determined time next day independently of when it was originally given.
    *setquest(<ID>,<Time Limit>)Place quest of <ID> that will expire at <Time Limit> in the users quest log, the state of which is "active".    
    Examples:
     
    - Ask the player to come back in a random number of minutes (1 ~ 3)
    prontera,150,150,4 script SetQuest2 1_m_01,{ .@p = questprogress(7128,PLAYTIME); if (.@p == 1) { mes "Come back later!"; } else { if (.@p == 2) { mes "You came back!"; getitem Red_Potion, 1; erasequest 7128; } .@i = rand(1, 3); mes "Come back in " + .@i + " minutes"; setquest2 7128, gettimetick(2) + (.@i * 60); } close;}    
    - Ask the player to come back tomorrow (next day at 00:00)
    prontera,150,152,4 script SetQuest2b 1_m_01,{ .@p = questprogress(7126,PLAYTIME); if (.@p == 1) { mes "Come back later!"; } else { if (.@p == 2) { mes "You came back!"; getitem Red_Potion, 1; erasequest 7126; } .@i = 86400 - gettimetick(1); mes "Come back tomorrow"; setquest2 7126, gettimetick(2) + .@i; } close;}    
    If you find any bug let me know.
    Submitter KirieZ Submitted 02/22/17 Category Plugins  
  14. Upvote
    Legend reacted to Adel in Adel's Free Sprites   
    Hello people~
    These are my sprite work that I would like to share with you all.
    Feel free to use them after you read the Terms of Use below.
    Please join my Discord channel and click on #freebies to Download.
    Enjoy!  

     

                   
              
              
                




     

         
         
     




  15. Upvote
    Legend reacted to Mystery in [showcase] Lightness Responsive   
    Hey everyone! I've been working on another site for an upcoming server. I'd like to show everyone the theme. Please keep in mind that the name 'Ragnarok Renewal' and the logo at the top is not the server's real identity; just dummy data. The site is mobile responsive, adapts to your screen size, has automatic rss feeds that can be pulled from different URLs, and the theme is basically very light with tons of lightness throughout the theme. There are also parallax affects on the cover images.
     
    This is not your basic "all ro, need to see everything" design. As in, you won't see scrolling slideshows,  or pvp banners, woe banners, etc. 













  16. Upvote
    Legend got a reaction from krypton99 in [Request] Script RWC or WRC automated 7 vs 7   
    @Iniciando do 0 Currently been working on this, hope you guys could still wait 
  17. Upvote
    Legend reacted to Kubix in IPB & Ragnarok accounts integration   
    Information about release: here.
    Sample NPC ingame, flux cp addons, sql-files.
     
    Download: Google.Drive
  18. Upvote
    Legend got a reaction from dfabsgwapings in equipment restriction   
    I can confirm this too...
    Equippable items can't be restricted even with map_zone_db, well i thought t'was working properly.
     
    So I made an alternative script
    Link: http://upaste.me/b63938928ba159ff3
    Please do report if you found bugs regarding to that script.

     
    Edit: Oops, found a bug.
    Script updated with the same link! 
  19. Upvote
    Legend reacted to vykimo in [Showcase] New mount for water : Fish   
    Here my latest showcase : a new job sprite !!
     
    This is a fish mount to survive when you are in deep water...
     

     
    You can use it everywhere there is a deep water (it detects water cell from gat tiles)
     
    Give me some review !
  20. Upvote
    Legend reacted to vykimo in [Showcase] Poring ball map 2015-version   
    Hi,
     
    What do you think about it :


  21. Upvote
    Legend got a reaction from Sephus in Hercules Battlegrounds   
    such a wonderful release, thanks
  22. Upvote
    Legend reacted to Sephus in Hercules Battlegrounds   
    Hercules Battlegrounds
    A full conversion and enhancement of eAmod's Battlegrounds system into a easy-to-install Hercules plugin library.
    Version: 1.0a (alpha)
     

     
    Repository @ https://github.com/Smokexyz/HerculesBG

    Installation
    1) Place plugin files in plugin directory. (If you wish to re-compile the code, please do so the standard way.)
    2) Place all script files in the default directory provided in the repository (or your own).
    3) Place all database and config parts in their respective files.
    4) in conf/plugins.conf add "hBG".
     
    Instructions on installing Plugins - http://herc.ws/wiki/HPM#Building_a_plugin
     
    Battleground Modes
    Capture the Flag Eye of Storm Triple Inferno Team DeathMatch Bossnia Conquest Stone Control Domination Rush Free For All Why use it?
    1) Prevents conflicts when updating Hercules.
    2) Easy to install.
    3) Can be easily modified for more functions/features in the future.

    For contributors
    If you wish to add a free BG script to the list of available battleground modes, please contact me.
     
    Bug Reporting
    Please feel free to open an issue on the repository and I'll get to it as soon as I can.

    Donate to support the project and motivate updates.


  23. Upvote
    Legend got a reaction from Tsuuu in OnPCDieEvent: - Monster Only?   
    How about this one?
     
    // ============================= - script Support#1 FAKE_NPC,{ OnInit: setarray .perm$[0], "disable_skill_usage", "disable_exp", "disable_store", "disable_pickup", "disable_pvp", "disable_pvm"; .prms = getarraysize(.perm$); end; OnCheckHide: while(CheckHide){ getmapxy(.@m$, .@mx, .@my, UNITTYPE_PC); if (map$ == .@m$ && mapx == .@mx && mapy == .@my){ map$ = ""; mapx = 0; mapy = 0; CheckHide = 0; atcommand "@hide"; copyarray .@prm$[0], .perm$[0],.prms; for (.@a = 0; .@a < getarraysize(.@prm$); ++.@a){ atcommand "@rmvperm "+.@prm$[.@a]; } message strcharinfo(0), "You are resurrected!"; specialeffect2 226; specialeffect2 18; detachrid; end; } sleep2 500; } end; OnPCDieEvent: if (getunittype(killerrid) != UNITTYPE_MOB) end; getmapxy(.@m$, .@mx, .@my, UNITTYPE_PC); map$ = .@m$; mapx = .@mx; mapy = .@my; // dispbottom "Map = "+map$+" X = "+mapx+" Y = "+mapy+"."; // FOR DEBUG PURPOSE. CheckHide = 1; sleep2 1000; atcommand "@raise"; atcommand "@hide"; copyarray .@prm$[0], .perm$[0],.prms; for (.@a = 0; .@a < getarraysize(.@prm$); ++.@a){ atcommand "@addperm "+.@prm$[.@a]; } attachrid(getcharid(3,strcharinfo(0))); warp map$,0,0; callsub OnCheckHide; end; OnPCLoginEvent: if (!CheckHide) end; atcommand "@hide"; copyarray .@prm$[0], .perm$[0],.prms; for (.@a = 0; .@a < getarraysize(.@prm$); ++.@a){ atcommand "@addperm "+.@prm$[.@a]; } attachrid(getcharid(3,strcharinfo(0))); callsub OnCheckHide; end; }  
    *thanks to n0tttt*
     
    @n0tttt nice trick you got there about making its Weight >= 90%  but I can't make use of that status SC_WEIGHTOVER90, it seems it doesn't work properly (bug i guess?). Uh, status icon showed up but when the player started to attack monsters, the icon got removed. 
    So, instead of adding status on them, I do atcommand "@addperm" & "@rmvperm" for their restrictions while on CheckHide status.
     
    @Aeromesi That's okay   Happy new year to you!
     
    @ts I suggest you to do some source modding or better use plugins for those atcommands for a cleaner & safer script.
  24. Upvote
    Legend got a reaction from Tsuuu in OnPCDieEvent: - Monster Only?   
    I tried to figure out and write it, so here's the outcome (this is based on @Aeromesi's idea *thanks to him*):
     
    - script Support#1 FAKE_NPC,{ OnCheckHide: while(CheckHide){ getmapxy(.@m$, .@mx, .@my, UNITTYPE_PC); if (map$ == .@m$ && mapx == .@mx && mapy == .@my){ map$ = ""; mapx = 0; mapy = 0; CheckHide = 0; atcommand "@hide"; message strcharinfo(0), "You are resurrected!"; specialeffect2 226; specialeffect2 18; detachrid; end; } sleep2 500; } end; OnPCDieEvent: getmapxy(.@m$, .@mx, .@my, UNITTYPE_PC); map$ = .@m$; mapx = .@mx; mapy = .@my; // dispbottom "Map = "+map$+" X = "+mapx+" Y = "+mapy+"."; // DEBUG PURPOSE. CheckHide = 1; sleep2 1000; atcommand "@raise"; atcommand "@hide"; attachrid(getcharid(3,strcharinfo(0))); warp map$,0,0; callsub OnCheckHide; end; OnPCLoginEvent: if (!CheckHide) end; atcommand "@hide"; attachrid(getcharid(3,strcharinfo(0))); callsub OnCheckHide; end; }  
    Note: 
    * I made it looped to determine the player state, WARNING: this might cause lag.
    * Players can attack mobs, players and can even use skills while on hide status since I executed "atcommand @hide", you can fix that by source modding if Im not mistaken.
    * THIS IS JUST AN IDEA.
     
    Well then, good luck! 
  25. Upvote
    Legend got a reaction from Tsuuu in Gate Script request   
    You can use this if you want:
    It behaves just like the barricade at novice ground.
    Please report any error found.
     
    http://upaste.me/c2e636755046b6638

    Note: Only 99 GM can activate the command.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.