Jump to content

Cabrera

Members
  • Content Count

    81
  • Joined

  • Last visited

  • Days Won

    4

Reputation Activity

  1. Upvote
    Cabrera got a reaction from Slammer in [Release] 2018 Clients translated tipbox   
    Hello everyone, I present to you a modified tip box which has been completely translated to English. 
    Tested on: 2018-04-04c RagexeRE and worked like a charm.
    In your System folder in Client side, replace your tipbox.lub with my translated tipbox i have attached below:
    tipbox.lub
    Then, Patch your client with whatever settings you want and then open the patched client in hexeditor ( I used XV132 for this)
    IMPORTANT NOTE : Make sure you hex a "patched" client. DO NOT do it on an unpatched client or else NEMO will show errors for random "recommended patches" that you select while patching it.
    Find the following and replace with hex for english translation : for checkbox: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 English translation: 53 61 76 65 20 54 69 70 3F 20 20 20 20 20 for close button : B4 DD B1 E2 English translation : 44 6F 6E 65 (korean translation of close has only 4 strings so I had to replace it with "Done" to match the string size -_-) OR go to your NEMO folder/patches/TranslateClient.txt and add this at the end of it then patch your clients: (Thanks to @Asheraf for telling me about this xD)
    M: Translate Tip box ------------------------------ F: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 R: 'Save Tip?' F: B4 DD B1 E2 R: 'Done' if you did everything as said, this will be your result :
    Old tip box:

    New translated tipbox:
     

     
    -- On a funny Note, I had no clue what the korean translation for the Check box was LOL so I just randomly translated it to "Save tip?" instead cuz it was a logical solution LMAO 
  2. Upvote
    Cabrera got a reaction from grimmm in [Guide] Increasing max itemdb (32k+)   
    Greetings Hercules,
    I have noticed that some people have not figured out how to increase itemdb from 32k limit to a higher amount. This maybe because the solutions are like in 4 different posts. This guide should help those having thousands of custom items like me in my test server.
    If you dont do the changes I have mentioned below, you would be getting this error :
    [SQL]: DB error - data of field 'nameid' was truncated [Debug]: column - 1 [Debug]: data - type=UNSIGNED MYSQL_TYPE_LONG, le [Debug]: buffer - type=MYSQL_TYPE_SHORT, length=2 So do the following to make it go away :
    1st : go to /src/map/itemdb.h:
    edit this line:
    #define MAX_ITEMDB 0x8000 // 32k array entries in array (the rest goes to the db) to this: #define MAX_ITEMDB 0x10000 // 64k array entries in array (the rest goes to the db) 2nd: go to /src/common/mmo.h:
    edit this line:
    short nameid; to this unsigned short nameid; 3rd: go to sql-files/main.sql:
    edit all these specific lines in the main.sql:
    `card0` smallint(11) NOT NULL default '0', `card1` smallint(11) NOT NULL default '0', `card2` smallint(11) NOT NULL default '0', `card3` smallint(11) NOT NULL default '0', To this : `card0` mediumint(11) NOT NULL default '0', `card1` mediumint(11) NOT NULL default '0', `card2` mediumint(11) NOT NULL default '0', `card3` mediumint(11) NOT NULL default '0', 4th: go to src/map/pc.h:
    edit this line :
    struct s_add_drop { short id, group; To this: struct s_add_drop { unsigned short id, group; and this line : int (*bonus_item_drop) (struct s_add_drop *drop, const short max, short id, short group, int race, int rate); to this : int (*bonus_item_drop) (struct s_add_drop *drop, const short max, unsigned short id, short group, int race, int rate); 5th: (we are almost done hang in there xD) go to src/map/pc.c:
    Change this line :
    int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short group, int race, int rate) { to this: int pc_bonus_item_drop(struct s_add_drop *drop, const short max, unsigned short id, short group, int race, int rate) { 6th : go to /src/char/char.c:
    edit this line :
    || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_SHORT, &item.nameid, 0, NULL, NULL) to this: || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_USHORT, &item.nameid, 0, NULL, NULL) Rebuild your server and you should not encounter the error anymore 
  3. Upvote
    Cabrera got a reaction from Dastgir in A battleground idea :D   
    Hey everyone  I have an idea for a BG based on a game called GunZ i used to play. It's called "Assassination"
    This is similiar to capture the flag in some ways more than anything,
    Concept:
    Normal teams Red vs Blue, lets say its a 3v3 ( u need a minimum of 2 players in a team or itd be lame xD)
    one of the 3 players get a target on their head ( some marker is put on the player to suggest that he/she is the one to be killed. This should not be shown in minimap though or it would be gamebreaking)
    The other 2 players in red and blue should search for the targets of their respective opponent teams, 1st team to kill the opponent target wins the round.
    Targets are the main priority. even if its 3 players alive in team Blue, 1 player alive in team Red, If the 1 player(who is the target and the rest of his/her team is dead) in Red kills the target of Blue, Blue looses.
    So basically, 1 target is chosen at random in each team(this changes in each round so basically every 1 might get to be the target). The opponent team has to assassinate this target. If the target dies, all his/her teammates die and the round is over, opponent wins.
    Hope i explained it well xD i have posted it on rA as well, hopefully someone comes up with possibilities of making this a script
  4. Upvote
    Cabrera got a reaction from Quazi in [Release] 2018 Clients translated tipbox   
    Hello everyone, I present to you a modified tip box which has been completely translated to English. 
    Tested on: 2018-04-04c RagexeRE and worked like a charm.
    In your System folder in Client side, replace your tipbox.lub with my translated tipbox i have attached below:
    tipbox.lub
    Then, Patch your client with whatever settings you want and then open the patched client in hexeditor ( I used XV132 for this)
    IMPORTANT NOTE : Make sure you hex a "patched" client. DO NOT do it on an unpatched client or else NEMO will show errors for random "recommended patches" that you select while patching it.
    Find the following and replace with hex for english translation : for checkbox: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 English translation: 53 61 76 65 20 54 69 70 3F 20 20 20 20 20 for close button : B4 DD B1 E2 English translation : 44 6F 6E 65 (korean translation of close has only 4 strings so I had to replace it with "Done" to match the string size -_-) OR go to your NEMO folder/patches/TranslateClient.txt and add this at the end of it then patch your clients: (Thanks to @Asheraf for telling me about this xD)
    M: Translate Tip box ------------------------------ F: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 R: 'Save Tip?' F: B4 DD B1 E2 R: 'Done' if you did everything as said, this will be your result :
    Old tip box:

    New translated tipbox:
     

     
    -- On a funny Note, I had no clue what the korean translation for the Check box was LOL so I just randomly translated it to "Save tip?" instead cuz it was a logical solution LMAO 
  5. Upvote
    Cabrera got a reaction from Khazou in [Release] 2018 Clients translated tipbox   
    Hello everyone, I present to you a modified tip box which has been completely translated to English. 
    Tested on: 2018-04-04c RagexeRE and worked like a charm.
    In your System folder in Client side, replace your tipbox.lub with my translated tipbox i have attached below:
    tipbox.lub
    Then, Patch your client with whatever settings you want and then open the patched client in hexeditor ( I used XV132 for this)
    IMPORTANT NOTE : Make sure you hex a "patched" client. DO NOT do it on an unpatched client or else NEMO will show errors for random "recommended patches" that you select while patching it.
    Find the following and replace with hex for english translation : for checkbox: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 English translation: 53 61 76 65 20 54 69 70 3F 20 20 20 20 20 for close button : B4 DD B1 E2 English translation : 44 6F 6E 65 (korean translation of close has only 4 strings so I had to replace it with "Done" to match the string size -_-) OR go to your NEMO folder/patches/TranslateClient.txt and add this at the end of it then patch your clients: (Thanks to @Asheraf for telling me about this xD)
    M: Translate Tip box ------------------------------ F: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 R: 'Save Tip?' F: B4 DD B1 E2 R: 'Done' if you did everything as said, this will be your result :
    Old tip box:

    New translated tipbox:
     

     
    -- On a funny Note, I had no clue what the korean translation for the Check box was LOL so I just randomly translated it to "Save tip?" instead cuz it was a logical solution LMAO 
  6. Upvote
    Cabrera got a reaction from IndieRO in [Release] 2018 Clients translated tipbox   
    Hello everyone, I present to you a modified tip box which has been completely translated to English. 
    Tested on: 2018-04-04c RagexeRE and worked like a charm.
    In your System folder in Client side, replace your tipbox.lub with my translated tipbox i have attached below:
    tipbox.lub
    Then, Patch your client with whatever settings you want and then open the patched client in hexeditor ( I used XV132 for this)
    IMPORTANT NOTE : Make sure you hex a "patched" client. DO NOT do it on an unpatched client or else NEMO will show errors for random "recommended patches" that you select while patching it.
    Find the following and replace with hex for english translation : for checkbox: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 English translation: 53 61 76 65 20 54 69 70 3F 20 20 20 20 20 for close button : B4 DD B1 E2 English translation : 44 6F 6E 65 (korean translation of close has only 4 strings so I had to replace it with "Done" to match the string size -_-) OR go to your NEMO folder/patches/TranslateClient.txt and add this at the end of it then patch your clients: (Thanks to @Asheraf for telling me about this xD)
    M: Translate Tip box ------------------------------ F: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 R: 'Save Tip?' F: B4 DD B1 E2 R: 'Done' if you did everything as said, this will be your result :
    Old tip box:

    New translated tipbox:
     

     
    -- On a funny Note, I had no clue what the korean translation for the Check box was LOL so I just randomly translated it to "Save tip?" instead cuz it was a logical solution LMAO 
  7. Upvote
    Cabrera got a reaction from Balfear in [Release] 2018 Clients translated tipbox   
    Hello everyone, I present to you a modified tip box which has been completely translated to English. 
    Tested on: 2018-04-04c RagexeRE and worked like a charm.
    In your System folder in Client side, replace your tipbox.lub with my translated tipbox i have attached below:
    tipbox.lub
    Then, Patch your client with whatever settings you want and then open the patched client in hexeditor ( I used XV132 for this)
    IMPORTANT NOTE : Make sure you hex a "patched" client. DO NOT do it on an unpatched client or else NEMO will show errors for random "recommended patches" that you select while patching it.
    Find the following and replace with hex for english translation : for checkbox: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 English translation: 53 61 76 65 20 54 69 70 3F 20 20 20 20 20 for close button : B4 DD B1 E2 English translation : 44 6F 6E 65 (korean translation of close has only 4 strings so I had to replace it with "Done" to match the string size -_-) OR go to your NEMO folder/patches/TranslateClient.txt and add this at the end of it then patch your clients: (Thanks to @Asheraf for telling me about this xD)
    M: Translate Tip box ------------------------------ F: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 R: 'Save Tip?' F: B4 DD B1 E2 R: 'Done' if you did everything as said, this will be your result :
    Old tip box:

    New translated tipbox:
     

     
    -- On a funny Note, I had no clue what the korean translation for the Check box was LOL so I just randomly translated it to "Save tip?" instead cuz it was a logical solution LMAO 
  8. Upvote
    Cabrera got a reaction from TheReturn in [Release] 2018 Clients translated tipbox   
    Hello everyone, I present to you a modified tip box which has been completely translated to English. 
    Tested on: 2018-04-04c RagexeRE and worked like a charm.
    In your System folder in Client side, replace your tipbox.lub with my translated tipbox i have attached below:
    tipbox.lub
    Then, Patch your client with whatever settings you want and then open the patched client in hexeditor ( I used XV132 for this)
    IMPORTANT NOTE : Make sure you hex a "patched" client. DO NOT do it on an unpatched client or else NEMO will show errors for random "recommended patches" that you select while patching it.
    Find the following and replace with hex for english translation : for checkbox: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 English translation: 53 61 76 65 20 54 69 70 3F 20 20 20 20 20 for close button : B4 DD B1 E2 English translation : 44 6F 6E 65 (korean translation of close has only 4 strings so I had to replace it with "Done" to match the string size -_-) OR go to your NEMO folder/patches/TranslateClient.txt and add this at the end of it then patch your clients: (Thanks to @Asheraf for telling me about this xD)
    M: Translate Tip box ------------------------------ F: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 R: 'Save Tip?' F: B4 DD B1 E2 R: 'Done' if you did everything as said, this will be your result :
    Old tip box:

    New translated tipbox:
     

     
    -- On a funny Note, I had no clue what the korean translation for the Check box was LOL so I just randomly translated it to "Save tip?" instead cuz it was a logical solution LMAO 
  9. Upvote
    Cabrera got a reaction from Ridley in [Release] 2018 Clients translated tipbox   
    Hello everyone, I present to you a modified tip box which has been completely translated to English. 
    Tested on: 2018-04-04c RagexeRE and worked like a charm.
    In your System folder in Client side, replace your tipbox.lub with my translated tipbox i have attached below:
    tipbox.lub
    Then, Patch your client with whatever settings you want and then open the patched client in hexeditor ( I used XV132 for this)
    IMPORTANT NOTE : Make sure you hex a "patched" client. DO NOT do it on an unpatched client or else NEMO will show errors for random "recommended patches" that you select while patching it.
    Find the following and replace with hex for english translation : for checkbox: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 English translation: 53 61 76 65 20 54 69 70 3F 20 20 20 20 20 for close button : B4 DD B1 E2 English translation : 44 6F 6E 65 (korean translation of close has only 4 strings so I had to replace it with "Done" to match the string size -_-) OR go to your NEMO folder/patches/TranslateClient.txt and add this at the end of it then patch your clients: (Thanks to @Asheraf for telling me about this xD)
    M: Translate Tip box ------------------------------ F: BD C3 C0 DB C7 D2 20 B6 A7 20 BF AD B1 E2 R: 'Save Tip?' F: B4 DD B1 E2 R: 'Done' if you did everything as said, this will be your result :
    Old tip box:

    New translated tipbox:
     

     
    -- On a funny Note, I had no clue what the korean translation for the Check box was LOL so I just randomly translated it to "Save tip?" instead cuz it was a logical solution LMAO 
  10. Upvote
    Cabrera got a reaction from bWolfie in [Guide] Increasing max itemdb (32k+)   
    Greetings Hercules,
    I have noticed that some people have not figured out how to increase itemdb from 32k limit to a higher amount. This maybe because the solutions are like in 4 different posts. This guide should help those having thousands of custom items like me in my test server.
    If you dont do the changes I have mentioned below, you would be getting this error :
    [SQL]: DB error - data of field 'nameid' was truncated [Debug]: column - 1 [Debug]: data - type=UNSIGNED MYSQL_TYPE_LONG, le [Debug]: buffer - type=MYSQL_TYPE_SHORT, length=2 So do the following to make it go away :
    1st : go to /src/map/itemdb.h:
    edit this line:
    #define MAX_ITEMDB 0x8000 // 32k array entries in array (the rest goes to the db) to this: #define MAX_ITEMDB 0x10000 // 64k array entries in array (the rest goes to the db) 2nd: go to /src/common/mmo.h:
    edit this line:
    short nameid; to this unsigned short nameid; 3rd: go to sql-files/main.sql:
    edit all these specific lines in the main.sql:
    `card0` smallint(11) NOT NULL default '0', `card1` smallint(11) NOT NULL default '0', `card2` smallint(11) NOT NULL default '0', `card3` smallint(11) NOT NULL default '0', To this : `card0` mediumint(11) NOT NULL default '0', `card1` mediumint(11) NOT NULL default '0', `card2` mediumint(11) NOT NULL default '0', `card3` mediumint(11) NOT NULL default '0', 4th: go to src/map/pc.h:
    edit this line :
    struct s_add_drop { short id, group; To this: struct s_add_drop { unsigned short id, group; and this line : int (*bonus_item_drop) (struct s_add_drop *drop, const short max, short id, short group, int race, int rate); to this : int (*bonus_item_drop) (struct s_add_drop *drop, const short max, unsigned short id, short group, int race, int rate); 5th: (we are almost done hang in there xD) go to src/map/pc.c:
    Change this line :
    int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short group, int race, int rate) { to this: int pc_bonus_item_drop(struct s_add_drop *drop, const short max, unsigned short id, short group, int race, int rate) { 6th : go to /src/char/char.c:
    edit this line :
    || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_SHORT, &item.nameid, 0, NULL, NULL) to this: || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_USHORT, &item.nameid, 0, NULL, NULL) Rebuild your server and you should not encounter the error anymore 
  11. Upvote
    Cabrera reacted to AnnieRuru in Advance SQL commands   
    1. When to use escape_sql script command
     
    .
    input .@haha$; dispbottom .@haha$; dispbottom escape_sql(.@haha$); it doesn't has much differences, because it only affect 3 special characters
    ' <- single quotation mark
    " <- double quotation mark
    \ <- left slash
    if I input -> haha"lala'hehe <-
    it will return -> haha\"lala\'hehe <-
    this is what we call, Escape a character
    in hercules script, we also know we can use " symbol in any string input
    mes "Susan says :\" Today I ate 3 eggs \"."; where in the game client, you can see the " symbol in the npc msg box
    let's say I have a sql script like this
    prontera,153,171,5 script Show Characters 1_F_MARIA,{ mes "input name, I'll show you all characters name it has on that player's account"; input .@name$; .@nb = query_sql("SELECT `char_id`, `name` FROM `char` WHERE `name` LIKE '"+ .@name$ +"'", .@cid, .@name$); if ( !.@nb ) { mes "no result"; close; } for ( .@i = 0; .@i < .@nb; ++.@i ) mes .@cid[.@i] +" "+ .@name$[.@i]; close; } this script has a possibility to be hacked
    because to perform sql injection, I can enclose the string with quotation mark, then use another sql command to hack
    BUT with an escape_sql command, if the user want to enclose the string with quotation mark to hack the script
    the escape_sql command escaped the string, the quotation mark the user input will be escaped
    thus the script will become impossible to hack
    just now that script was for string input
    prontera,153,171,5 script Show Characters 1_F_MARIA,{ mes "input account ID, I'll show you all characters name it has on that player's account"; input .@aid$; .@nb = query_sql("SELECT `char_id`, `name` FROM `char` WHERE `account_id` = "+ escape_sql(.@aid$), .@cid, .@name$); if ( !.@nb ) { mes "no result"; close; } for ( .@i = 0; .@i < .@nb; ++.@i ) mes .@cid[.@i] +" "+ .@name$[.@i]; close; } this is another stupid case.
    1. the scripter use string input while the script just needed a number
    2. even with escape_sql command over there, there is no quotation mark at all
    yes this script also has a risk to be hack
    because escape_sql only escape quotation mark.
    that hacker don't even have to input quotation mark because it is a number
    and an injection query can be sent without any quotation mark input
    there are 2 ways to solve this
    either use numeric variable for the input command
    or enclose that ....
    ..... WHERE `account_id` = '"+ escape_sql(.@aid$) +"'", .... with single quotation mark, when the hacker input a quotation mark will be escaped by escape_sql command
    Reference : https://www.w3schools.com/sql/sql_injection.asp
    escape_sql command for another thing is
    if the player register their names containing ' or ", these characters are escaped
    only happens when the server have no restriction on the creation of players name
    hercules\conf\char\char-server.conf
    // Manage possible letters/symbol in the name of charater. Control character (0x00-0x1f) are never accepted. Possible values are: // NOTE: Applies to character, party and guild names. // 0: no restriction (default) // 1: only letters/symbols in 'name_letters' option. // 2: Letters/symbols in 'name_letters' option are forbidden. All others are possibles. name_option: 1  
    and this was what happened to my SQL dota pvpladder script
    Silo's Babies <-- this is a guild name
    you can see the 5th string has a single quotation mark
    with escape_sql command, that string will turn into
    Silo\'s Babies <-- the quotation mark is escaped when send to sql query
  12. Upvote
    Cabrera reacted to bWolfie in [Guide] Mapcache Generation 2018   
    As of Release v2018.03.13, the method to generate mapcache for Hercules has changed. A lot of people. myself included, were confused as to how it works. In this thread, I will do my best to explain the new way to generate your cache. This guide is intended to help people using the old system, not to aid new people (i.e. never generated mapcache before), so if you are new, some of it may seem like alien talk.
    Old (your source predates [is older than] Feb 18, 2018)
    In the old system, there were two ways to generate mapcache
    You could run the mapcache executable in Hercules root folder. Or use a program such as WeeMapCache to edit in your required mapcache. These two methods would generate or alter your required mapcache located in db/[pre-re or re]/map_cache.dat. However, they are no longer supported.
    New (your source is using Release v2018.03.13 or newer)
    The new system involves the use of the new 'mapcache' plugin to generate files. Some quick points:
    db/[pre-re or re]/map_cache.dat has been dropped (no longer supported). In its place are individual .mcache files for every map located in maps/[pre-re or re]/ Mapcache executable has been removed. Replaced with the mapcache plugin (src/plugins/mapcache.c). How to generate the mapcache?
    Same as before, check conf/map/maps.conf and db/map_index.txt have all the maps you want to cache. Your maps need to exist somewhere in your repository! There are two ways for the plugin to find them:
    a. Place all your maps, including resnametable.txt, inside the data folder of your Hercules repo. I.e. Hercules/data/prontera.gat/gnd/gnd/rsw (note: I forget if all three files are needed).
    b. OR Configure your conf/grf-files.txt to tell it where to find your GRF(s) which contains your maps. Build the mapcache plugin. On linux, this can be done by running the following command:
    make plugin.mapcache
    If using MSVC, compile as you would any other plugin. Execute plugin. This can be done using the following command:
    ./map-server --load-plugin mapcache [param]
    In windows, just remove the './' and run the commands in your command prompt. The params:
    The first thing you should do is run
    ./map-server --load-plugin mapcache --help
    A list of usable parameters will appear. Here are the ones you need to know for mapcache:
    [Info]:   --convert-old-mapcache         Converts an old db/pre-re/map_cache.dat file to the new format. [Mapcache] [Info]:   --rebuild-mapcache             Rebuilds the entire mapcache folder (maps/pre-re/), using db/map_index.txt as index. [Mapcache] [Info]:   --map <name>                   Rebuilds an individual map's cache into maps/pre-re/ (usage: --map <map_name_without_extension>). [Mapcache] [Info]:   --fix-md5                      Updates the checksum for the files in maps/pre-re/, using db/map_index.txt as index (see PR #1981). [Mapcache] ./map-server --load-plugin mapcache --convert-old-mapcache
    Rebuild all the .mcache files using your old db/[pre-re or re]map_cache.dat file.
    NOTE: You should only run this command when you have an old map_cache.dat file you need to convert.
    ./map-server --load-plugin mapcache --rebuild-mapcache
    Rebuild all the .mcache files using your map files specified in step 2 of generation.
    NOTE: You should only run this command in special circumstances. This erases ALL the existing mapcache and rebuilds it with whatever files you provide it. If you don't have the required files, the build will fail and you will be left with missing mapcache files, meaning you won't be able to access those particular maps.
    ./map-server --load-plugin mapcache --map <name>
    Rebuild the .mcache file for the map name you specify. E.g. if you replace <name> with prontera, the maps/[pre-re or re]/prontera.mcache file will be rebuilt.
    NOTE: This is the best command to run, as it only caches a single map at a time.
    ./map-server --load-plugin mapcache --fix-md5
    I don't know what checksum is for.
    The End
    Feel free to ask for help here. I'll try to answer questions re: mapcache if possible. And if you think anything needs correcting or added, let me know.
    Hope this helps!
  13. Upvote
    Cabrera reacted to Alayne in Alayne's Scripts Collection   
    < Alayne's Script Collection >
    After several asks, here's a link to my github
    Feel free to comment or add anything that might be usefull and that I won't think of
    I've decided to release my scripts here, it'll be easier to me so I can duplicate it on hercules and rathena rather than uploading twice. So sorry for multiple upload between there and download section
    Don't mind the name Nyliar in the git, that's me too ^^
     
    < Instances >
     
    < Quests >
     
    < Event >
     
    < PvP Content >
     
    < Utilities >
     
    < Full Systems >
     
    < Dungeons >
     
    < Raid >
     
    < Battleground >
  14. Upvote
    Cabrera reacted to Litro in Help with script bonus >.<   
    try this
    1
    bonus bAllStats,20;bonus bMaxHP,2*getrefine();bonus bMaxSP,2*getrefine(); 2
    bonus bAllStats,15;bonus2 bAddRace,7,getrefine(); 3
    bonus bAllStats,30;bonus bSpeedAddRate,10;bonus2 bSubRace,7,getrefine(); nb: you should  take look into item_bonus.txt on doc folder
  15. Upvote
    Cabrera reacted to AnnieRuru in More like a sugestion oh well...   
    http://upaste.me/08de11117d6ab17d3
     
    you can even make multiple copies of the script, just by copy paste in the new npc and change the npc_id as the quest ID
    provided that you are using hercules of course, only hercules has character array
  16. Upvote
    Cabrera reacted to pan in Question about Mapflag : Loadmapevent   
    Open your map/script.c and search for OnPCLoadMapEvent, you should find something like:
    eA@r15265struct Script_Config script_config = { 1, // warn_func_mismatch_argtypes 1, 65535, 2048, //warn_func_mismatch_paramnum/check_cmdcount/check_gotocount 0, INT_MAX, // input_min_value/input_max_value "OnPCDieEvent", //die_event_name "OnPCKillEvent", //kill_pc_event_name "OnNPCKillEvent", //kill_mob_event_name "OnPCLoginEvent", //login_event_name "OnPCLogoutEvent", //logout_event_name "OnPCLoadMapEvent", //loadmap_event_name "OnPCBaseLvUpEvent", //baselvup_event_name "OnPCJobLvUpEvent", //joblvup_event_name "OnTouch_", //ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves) "OnTouch", //ontouch2_name (run whenever a char walks into the OnTouch area)};I don't know how it its in rA, but in Herc it is now: /* script_config base */ script->config.warn_func_mismatch_argtypes = 1; script->config.warn_func_mismatch_paramnum = 1; script->config.check_cmdcount = 65535; script->config.check_gotocount = 2048; script->config.input_min_value = 0; script->config.input_max_value = INT_MAX; script->config.die_event_name = "OnPCDieEvent"; script->config.kill_pc_event_name = "OnPCKillEvent"; script->config.kill_mob_event_name = "OnNPCKillEvent"; script->config.login_event_name = "OnPCLoginEvent"; script->config.logout_event_name = "OnPCLogoutEvent"; script->config.loadmap_event_name = "OnPCLoadMapEvent"; script->config.baselvup_event_name = "OnPCBaseLvUpEvent"; script->config.joblvup_event_name = "OnPCJobLvUpEvent"; script->config.ontouch_name = "OnTouch_";//ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves) script->config.ontouch2_name = "OnTouch";//ontouch2_name (run whenever a char walks into the OnTouch area)
  17. Upvote
    Cabrera reacted to AnnieRuru in [Outdated] battleground system without waitingroom   
    This plugin has outdated
    Haru has already fixed queue iterator script command
    this plugin is no longer needed
     
    sample battleground script using queue iterator
    http://upaste.me/ab3022385d0127b7f
     

     
    outdated topics from eathena or rathena
    this one is more update
     
    Download: 1.5
    plugin
     
    -----------------------------------------
     
    *createbgid , , , , ;
    create a specific battleground ID, for the rest .... refer to doc
    .red = createbgid( "guild_vs3", 13,50, strnpcinfo(0)+"::Onredout", strnpcinfo(0)+"::Onreddead" );.blue = createbgid( "guild_vs3", 86,50, strnpcinfo(0)+"::Onblueout", strnpcinfo(0)+"::Onbluedead" );.-----------------------------------------
     
    *setbgid {, };
    *setbgid {, };
    player attached to the script will join the battleground team,
    but if a player name ( or account ID ) is specify, will let that player join the battleground team
     
    for debugging purposes
    this command can return positive number ( > 0 ) if the function is successful
    if it return negative :-
    -1: the battleground team haven't create yet ... has to be create with createbgid
    -2: the team already full, it reached MAX_BG_MEMBERS = 30 which can increase at srcmapbattleground.h
    -3: player not found ... happens when the input is not online or not found
    -5: the player already join the battleground ID that you specify
     
    if the player has joined battleground ID 3, and you use setbgid 5;
    this will force the player to leave battleground ID 3 and join battleground ID 5 without any notification
    ( player who same group will receive a message mention that "player xxx leaving battlefield" )
    only when the player joined bg ID 9, and use setbgid 9; then only the command return -5
    but the script will still continue running without posting any error, so don't worry
     
    setbgid 0; is equal to *bg_leave;
    and setbgid 0, "annie"; or setbgid 0, 2000000;
    will make the player "annie" ( or account id 2000000 ) leave the battleground team without using *attachrid + *bg_leave
    warpwaitingpc "guild_vs3", 0,0;for ( .@i = 0; .@i < $@warpwaitingpcnum; .@i++ )setbgid ( .@i % 2 )? .red : .blue, $@warpwaitingpc[.@i];.-----------------------------------------
     
    *getbgusers ;
    similar to getpartymember , 2; // <-- return account ID
    this will create an array "$@arenamembers" holding all the player's account ID from the battleground team
    and $@arenamembersnum is equal to bg_get_data(, 0), just like $@partymembercount
    getbgusers .red;for ( .@i = 0; .@i < $@arenamembersnum; .@i++ )getitem 501, 1, $@arenamembers[.@i];.-----------------------------------------
     
    sample script
    http://upaste.me/7de710709dbb6fa17
     
    example script for reference material
    default battleground system using waitingroom, works in clean rathena/hercules
    http://upaste.me/497010755d3295805
    this script using this custom script commands
    http://upaste.me/b2781075699b0f8d9
    you can tell it really does make the script shorter
     
     
     
  18. Upvote
    Cabrera reacted to AnnieRuru in About woe controller's announcements.   
    you serious ?
    I see a permanent server array $WOE_CONTROL
    if you make a copy on 2 different script, they still share the same $WOE_CONTROL variable
     
    but yeah, I think, maybe change 1 of them into $WOE_CONTROL2, it might works
  19. Upvote
    Cabrera reacted to AnnieRuru in Gifting items from jobquests.   
    run a search "jobchange" with "Find in files" in "herculesnpc"
    after every single *jobchange,
    getitem 501,1;
    .... quite hassle to do like this
     
    or the easy way, yet unoptimized way, is to use a custom npc, ask them come to this npc to claim the gift
    prontera,154,184,5 script kjdhfksdjfs 100,{ mes "blah blah come and get a prize"; next; if ( Class == Job_Novice ) { mes "no gift for the noobs"; close; } if ( Job_Gift[ Class ] ) { mes "You have already claim the gift"; close; } switch ( Class ) { case Job_Swordman: getitem 501, 1; break; case Job_Mage: getitem 501, 1; break; case Job_Archer: getitem 501, 1; break; case Job_Acolyte: getitem 501, 1; break; // .... add more default: mes "this job ID is not yet done because the author is feeling lazy hahaha"; close; } Job_Gift[ Class ] = 1; mes "have a nice day"; close;}1 thing good using another npc is you don't have to look at another file when debuggingthe bad ... of course, used up a few custom variable, and needs to reminds players to come and get it
  20. Upvote
    Cabrera reacted to AnnieRuru in Offline invitation script :3   
    sql table
    create table guild_invite (id int(11) unsigned primary key auto_increment,char_id int(11) unsigned,guild_id int(11) unsigned,key (char_id),key (guild_id),unique (char_id,guild_id)) engine = innodb;source modificationhttp://upaste.me/648510601a30ea563
     
    and the script
    http://upaste.me/a50910600302d4ea5
     
     
    EDIT: oh wait, 100th post !
  21. Upvote
    Cabrera reacted to Ind in Hercules 1st 2014 MegaPatch   
    Hercules: 1st 2014 MEGAPATCH
    Helloooo! Starting 2014 with a boom, yet another outstanding patch from Hercules! Patch Item #1: Scripting Level UP
    Char and account variables overhaul They're no longer limited to #define ACCOUNT/GLOBAL_REG_NUM, they're now limitless Their storage capabilities have received a colossal improvement, each numeric variable now uses at least 1/10 the memory it did previously, and we achieved it while increasing speed, simply outstanding as expected from us. Thanks to their quantity no longer being limited, char and account variables now support arrays, i.e. setarray #accreg[y],...; Saving and loading procedures have been improved outstandingly! for instance, previously, if you had 100 char regs but only one had been modified or deleted, map server would need to send all of them and char server would have to re-insert all of them; now only modified or deleted ones are saving, increasing saving speed of both map and char server procedures and decreasing inter-server bandwidth by dinosaur steps. Magnificent Array Improvement (to all variable types) Size limit modified from 127 to ...2 billion! Speed of countless array operations have been improved thanks to new array handling, e.g. whereas previously upon deleting any array it'd set its 127 possible values to 0 (regardless of how many values it actually had) now it only deletes as many members as it possesses getarraysize (the-oh-misleading-function since it returns the arrays' highest index) has been sped up as well thanks to this, and it no longer wastes script stack room on every interaction And the futureThis improvement has open way for many other amazing features, for example, Haruna has designed a foreach implementation for scripting among some other useful enhancements Global account variable handling redesign To clarify, this is that ancient type used on multiple-char-server setups, ##varname, which are present in all servers an accounts logs into, as opposed to #varname which, while account-wide, are considered 'local' to a char server. Saving and loading have been modified to match char/local-acc variable new design, on its own it already is a major speed boost and bandwidth saver, however, it has also improved login servers overall processing speed, thanks to its processing no longer being attached to ordinary account handling, this means that all operations that required login server to use an accounts data (i.e. login/pincode change/ban/block/etca) have been sped up, and use less memory. '.', '.@' and ''' variables write operation speed up trying to write ''' variables outside instances will now print warnings instead of silently doing nothing runtime read/write operations of global/temporary(@) char variables, as well as account variables, have been considerably sped up, whereas previously it'd run a str lookup to find a match for read/write it now uses the variable id, furthermore it now relies on DBMaps to handle the lookup (whereas previously it was a normal loop). Database tables overhaulWe've analysed global reg data storage and we've decided that it not only is a memory waste, it is a processing one as well due to how int and str variables share the same storage, we've analysed global reg data for a number of large servers and have identified most variables are numbers, by a outstanding majority, with that in mind, this patch introduces 6 tables that will improve this drastically. You'll notice this patch's SQL upgrade file will take care of this, and thus migrate the data properly into the new tables. Special Thanks To:
    Haruna ! <3 wouldn't have gotten half of it done if it weren't for Haru, thank you so much sensei! jaBote, for proposing it! Emistry Yommy Streusel Patch Item #2: @autotrade Persistency
    Also known as: @at merchants survive server crashes/restart, as soon as the server starts again they're re-spawned. May be disabled on src/config/core.h by commenting out AUTOTRADE_PERSISTENCY Special Thanks To:
    Haruna! Michieru, this feature wouldn't be out now if it weren't for him, lets all thank him! Dekamaster/Nightroad for helping me on this features original design, 3-4 years ago. Thank you master <3! Link'u!
    Commit Upgrade files #1 (Autotrade) #2 (Scripting Level UP)
  22. Upvote
    Cabrera reacted to AnnieRuru in Is this possible?   
    a bit off-topic butyeah, 1 of the reason I move here because in hercules already has some powerful scripters around
     
    the only thing that jabote missed out is missing setmapflag
    - script warp_banned -1,{OnInit: setarray .not_2ndjob$[0], "morocc", "payon", "aldebaran"; // Maps NOT for second jobs. Add more with a comma, last member should have a semicolon setarray .not_3rdjob$[0], "amatsu", "gonryun", "geffen"; // Same as above, but for third jobs .not_2ndjob_size = getarraysize(.not_2ndjob$); .not_3rdjob_size = getarraysize(.not_3rdjob$); for ( .@i = 0; .@i < .not_2ndjob_size; .@i++ ) setmapflag .not_2ndjob$[.@i], mf_loadevent; // Thx to Keyworld <3 for ( .@i = 0; .@i < .not_3rdjob_size; .@i++ ) setmapflag .not_3rdjob$[.@i], mf_loadevent; end;OnPCLoadMapEvent: if ( eaclass() & ( EAJL_UPPER | EAJL_2 ) ) { // Player is 2nd trans job while ( strcharinfo(3) != .not_2ndjob$[.@i] && .@i < .not_2ndjob_size ) .@i++; } else if ( eaclass() & EAJL_THIRD ) { // Player is the 3rd job while ( strcharinfo(3) != .not_3rdjob$[.@i] && .@i < .not_3rdjob_size ) .@i++; } else end; if ( .@i != .not_2ndjob_size || .@i != .not_3rdjob_size ) { dispbottom "You're not supposed to be here..."; warp "SavePoint",0,0; } end;}... hmm .. why this {code} doesn't has cut the length ...edit ... oh ... have to refresh the page =/
  23. Upvote
    Cabrera reacted to jaBote in Is this possible?   
    Thanks for the setmapflag point, I just supposed Cabrera would have them set by himself somewhere else and didn't add them on the script.
     
    I usually prefer to make the scripts readable for the people, so that they could easily modify and/or use them for learning. At least in my hopes someone would ever get encouraged to jump upon the scripting because of my scripts...
  24. Upvote
    Cabrera reacted to jaBote in Is this possible?   
    If I were you, I'd just get rid of the item since you could try to cheat your way off the restrictions while using the class renders these cheats impossible. You could still give the item for the fun if you want, but do the checks based on the job.
     
    Keeping on the processor-intensive idea of using the loadevent mapflag on each map you want to restrict and add them to its respective list, for restricting 3rd jobs or 2nd trans jobs you should use bitmasks, which is minor magic but makes the restriction easier:
    - script warp_banned -1,{OnInit: setarray .not_2ndjob$[0], "prontera", "payon", "aldebaran"; // Maps NOT for second jobs. Add more with a comma, last member should have a semicolon setarray .not_3rdjob$[0], "amatsu", "gonryun", "geffen"; // Same as above, but for third jobs end;OnPCLoadMapEvent: if ( eaclass()&(EAJL_UPPER|EAJL_2) ) { // Player is 2nd trans job for (set .@i,0; .@i < getarraysize(.not_2ndjobs$); set .@i, .@i + 1){ if (strcharinfo(3) == .not_2ndjobs$[.@i]){ dispbottom "You're not supposed to be here..."; warp "SavePoint",0,0; } } } else if ( eaclass()&EAJL_THIRD ) { // Player is the 3rd job for (set .@i,0; .@i < getarraysize(.not_3rdjobs$); set .@i, .@i + 1){ if (strcharinfo(3) == .not_3rdjobs$[.@i]){ dispbottom "You're not supposed to be here..."; warp "SavePoint",0,0; } } } end;}  
    Again, I haven't tested it but should work as expected.
     
    If you want to make custom mapflags for checking if somebody is 2nd trans or 3rd job, then it's a source request and it's beyond my abilities ATM .
×
×
  • Create New...

Important Information

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