Jump to content

nitrous

Developer
  • Posts

    138
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by nitrous

  1. It should be NULL not NUL. Can you upload the file somewhere? How are you invoking main.sql? Through a tool like Workbench or on the command line?
  2. Well I'm dumb, I'm connecting to the wrong database. Please ignore this post.
  3. To make the automated build work. I split the mobdb and mobdrop tables in the database, which requires me to fix this script. The first SQL statement should return a list of letters in alphabetical order so that there exists at least one normal monster that drops a card that starts with that letter.
  4. Hey guys, looks like I need some help. I have 3 tables, mob_db_re, mob_drop_re, and item_db_re. mob_drop_re is created with this ddl statement: CREATE TABLE `mob_drop_re` ( `mobid` mediumint(9) unsigned NOT NULL default '0', `dtype` smallint(5) unsigned NOT NULL default '0', `index` smallint(5) unsigned NOT NULL, `nameid` smallint(5) unsigned NOT NULL default '0', `rate` smallint(9) unsigned NOT NULL default '0', `stealProtected` bool default false, `randomOptionGroup` text, PRIMARY KEY (`mobId`, `dtype`, `index`) ) ENGINE=MyISAM; I'm working on the card_seller in npc/custom/card_seller.txt, and I get an error at the first query_sql call. Here's the code: OnInit: if (checkre(0)) { [email protected]_db$ = "mob_db_re"; [email protected]_drop$ = "mob_drop_re"; [email protected]_db$ = "item_db_re"; } else { [email protected]_db$ = "mob_db"; [email protected]_drop$ = "mob_drop"; [email protected]_db$ = "item_db"; } freeloop 1; [email protected] = query_sql("SELECT DISTINCT LEFT(`name_japanese`, 1) AS alphabets FROM `"+ [email protected]_db$ +"` RIGHT JOIN `"+ [email protected]_drop$ +"` ON `"+ [email protected]_drop$ +"`.`nameid` = `"+ [email protected]_db$ +"`.`id` RIGHT JOIN `"[email protected]_db$ +"` ON `"+ [email protected]_db$ +"`.`ID` = `"+ [email protected]_drop$ +"`.`mobid` WHERE `"+ [email protected]_db$ +"`.`type` = 6 AND `name_english` LIKE '%_Card' AND ~(`MODE`) & 0x4000000 ORDER BY alphabets;", .alphabet$); for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) { .alphabet_menu$ = .alphabet_menu$ + .alphabet$[[email protected]] +" Cards:"; [email protected] = query_sql("SELECT `"[email protected]_db$ +"`.`id` FROM `"+ [email protected]_db$ +"` RIGHT JOIN `"+ [email protected]_drop$ +"` ON `"+ [email protected]_drop$ +"`.`nameid` = `"+ [email protected]_db$ +"`.`id` RIGHT JOIN `"[email protected]_db$ +"` ON `"+ [email protected]_db$ +"`.`ID` = `"+ [email protected]_drop$ +"`.`mobid` WHERE `"+ [email protected]_db$ +"`.`type` = 6 AND `name_english` LIKE '%_Card' AND ~(`MODE`) & 0x4000000 AND LEFT(`name_japanese`, 1) = '"+ .alphabet$[[email protected]]+"' GROUP BY `name_japanese` ORDER BY `name_japanese` LIMIT 128;", [email protected]); npcshopdelitem "card_mob#"+ .alphabet$[[email protected]], 501; for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) npcshopadditem "card_mob#"+ .alphabet$[[email protected]], [email protected][[email protected]], 1000000; } freeloop 0; end; The script creates a sql statement as so: SELECT DISTINCT LEFT(`name_japanese`, 1) AS alphabets FROM `item_db_re` RIGHT JOIN `mob_drop_re` ON `mob_drop_re`.`nameid` = `item_db_re`.`id` RIGHT JOIN `mob_db_re` ON `mob_db_re`.`ID` = `mob_drop_re`.`mobid` WHERE `item_db_re`.`type` = 6 AND `name_english` LIKE '%_Card' AND ~(`MODE`) &0x4000000 ORDER BY alphabets; It works fine on MySQL Workbench, but produces an error when using it in the script: [SQL]: DB error - Unknown column 'mob_drop_re.nameid' in 'on clause' [Debug]: at script.cpp:16666 - SELECT DISTINCT LEFT(`name_japanese`, 1) AS alpha bets FROM `item_db_re` RIGHT JOIN `mob_drop_re` ON `mob_drop_re`.`nameid` = `ite m_db_re`.`id` RIGHT JOIN `mob_db_re` ON `mob_db_re`.`ID` = `mob_drop_re`.`mobid` WHERE `item_db_re`.`type` = 6 AND `name_english` LIKE '%_Card' AND ~(`MODE`) & 0x4000000 ORDER BY alphabets; [Debug]: Source (NPC): Card Seller at prontera (155,177) Can anyone help?
  5. Instead of sending the HP, you can send the SP. There's no way to send and show both hp/sp values on other players, so you can have a command to switch between the two.
  6. iirc, we solved it by updating the lua files. Just get them from the translation project
  7. Are you sure you didn't change it? https://github.com/rathena/rathena/blob/master/src/map/battle.c#L6378
  8. [SQL]: DB error - Unknown column 'last_mac' in 'field list' [Debug]: at script.cpp:16625 - SELECT `last_mac` FROM `login` WHERE `account_id` = '2000004' [Debug]: Source (NPC): Guild Master at prontera (203,135) [SQL]: DB error - Unknown column 'last_cpu' in 'field list' [Debug]: at script.cpp:16625 - SELECT `last_cpu` FROM `login` WHERE `account_id` = '2000004' [Debug]: Source (NPC): Guild Master at prontera (203,135) [SQL]: DB error - Unknown column 'last_motherboard' in 'field list' [Debug]: at script.cpp:16625 - SELECT `last_motherboard` FROM `login` WHERE `account_id` = '2000004' [Debug]: Source (NPC): Guild Master at prontera (203,135) These are because you haven't changed your login table to have `last_mac`, `last_cpu`, `last_motherboard`. [SQL]: DB error - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `guild_package` WHERE `acc_id` = '2000004'' at line 1 [Debug]: at script.cpp:16625 - SELECT FROM `guild_package` WHERE `acc_id` = '2000004' [Debug]: Source (NPC): Guild Master at prontera (203,135) [SQL]: DB error - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `guild_package` WHERE `claim_ip` = '180'' at line 1 [Debug]: at script.cpp:16625 - SELECT FROM `guild_package` WHERE `claim_ip` = '180' [Debug]: Source (NPC): Guild Master at prontera (203,135) These are because your SQL syntax is wrong. You need to use `SELECT * FROM blahblahblah`
  9. You can use addrid https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L3824-L3844 It will look something like this: addrid(0); variable = 0; detachrid(); query_sql( "DELETE FROM `char_reg_num` WHERE `key`='variable' " );
  10. You can try this diff. https://github.com/vstumpf/rathena/blob/playground/diffs/mob_hp_bars.diff
  11. Looks like you're using herc, not rA.
  12. When someone quits the game, the socket closes with EOF. This gets parsed in logclif_parse(login server), chclif_parse(char server), and clif_parse(map server). In the login server, when it reads EOF it just closes the socket. In the char server, if a character is already loaded, it might set the character offline, thereby saving the changes. In the map server, depending on how the client quits, it will either use map_quit, use clif_quitsave which calls map_quit, or nothing (in the case of autotrading).
  13. It can be done through source edits/additions. You would need to create a new timer function and make it trigger 5 minutes before the spawn of the monster. That function will send the announcement that the monster will spawn. In mob_setdelayspawn, you will have to check if the mob is an MvP, then call add_timer with the current tick of the server + spawn time - 5 minutes.
  14. 4359,B_Eremes_Card,Assassin Cross Card,6,20,,10,,,,,,,,2,,,,,{ if(Class != Paladin && Class != Champion) { bonus3 bAutoSpell,378,3,30; }},{},{} Try that.
  15. You either need to wait for Functor to respond or revert the update.
  16. You don't need visual studio on your vps, since you're not editing your code there. Follow the directions here: https://github.com/rathena/rathena#rathena
  17. This is the part of the code that's the problem: struct instance_db *db = instance_searchname_db(name); nullpo_retr(-1, db); The name you pass into instance_create is not being found in the instance database. EDIT: Looking further into this, the entry in instance_db.txt is incorrect. The correct format is: // ID,Name,LimitTime,IdleTimeOut,EnterMap,EnterX,EnterY,Map2,Map3,...,Map255
  18. I only showed you where the error was, you need to go in and remove the back tick from the beginning of the second query_sql line.
  19. You have an extra backtick (`) in the for-loop in case 2.
  20. Sniper's Sharpshooting has a similar effect. It uses a function called map_foreachinpath, which might be something to look into.
×
×
  • Create New...

Important Information

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