Jump to content

Louis T Steinhil

Members
  • Posts

    177
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Louis T Steinhil

  1. Thanks man! Happy father's day also to you and your father.
  2. This is the fix for icon not going away. and i edited also the timer so it could handle set .@timer, vip_status(2) - gettimetick(2); it will be 86400 for 1 day. So for 5 seconds it should be 5 i believe. // Script.cpp +/* +* fakeIcon +* fakeIcon(CHAR_ID,ICON_ID,TIME,STATE) +*/ +BUILDIN_FUNC(fakeIcon) +{ + int16 icon = EFST_BLANK; + TBL_PC* sd = map_charid2sd(script_getnum(st, 2)); + FETCH(3, icon); + int time = 1000 * abs(script_getnum(st, 4)); + bool state = (script_getnum(st, 5) == 1); + + if (sd == NULL) + return SCRIPT_CMD_FAILURE; + + if (icon <= EFST_BLANK || icon >= EFST_MAX) + icon = EFST_BLANK; + + clif_status_change(&sd->bl, (enum efst_type)icon, state, time, 0, 0, 0); + + return SCRIPT_CMD_SUCCESS; +} BUILDIN_FUNC(addrid) // Script.cpp ++BUILDIN_DEF(fakeIcon,"iiii"), BUILDIN_DEF(goto,"l"),
  3. Nevermind I edited the src. Anyone interested here it is, this also fix the icon not going away and entering negative values for timer. // Script.cpp +/* +* fakeIcon +* fakeIcon(CHAR_ID,ICON_ID,TIME,STATE) +*/ +BUILDIN_FUNC(fakeIcon) +{ + int16 icon = EFST_BLANK; + TBL_PC* sd = map_charid2sd(script_getnum(st, 2)); + FETCH(3, icon); + int time = 1000 * abs(script_getnum(st, 4)); + bool state = (script_getnum(st, 5) == 1); + + if (sd == NULL) + return SCRIPT_CMD_FAILURE; + + if (icon <= EFST_BLANK || icon >= EFST_MAX) + icon = EFST_BLANK; + + clif_status_change(&sd->bl, (enum efst_type)icon, state, time, 0, 0, 0); + + return SCRIPT_CMD_SUCCESS; +} BUILDIN_FUNC(addrid) // Script.cpp ++BUILDIN_DEF(fakeIcon,"iiii"), BUILDIN_DEF(goto,"l"),
  4. This is the manual for setup although it is VPS, it's the same setup for PC I believe. https://gist.github.com/anacondaq/3eae8e4afb5d3c3880d08b95b2c54b78
  5. This is the code that i found searching but it's not right when displaying it on icon timer. if ( vip_status(1) ) { set .@timer, vip_status(2) - gettimetick(2); fakeIcon(getcharid(0),EFST_VIPSTATE2,.@timer,1); set MaxWeight, MaxWeight + 2000; hateffect 19,true; dispbottom "Server Time: "+gettimestr("%H:%M:%S", 10)+""; dispbottom "============================================="; dispbottom "Account Status : Premium Account"; dispbottom "Account Status : Exp & Job Increase 100%"; dispbottom "Account Status : Drop Increase 100%"; dispbottom "Time left : "+ callfunc("Time2Str",vip_status(VIP_STATUS_EXPIRE)); dispbottom "============================================="; end; } it's always 1 minute
  6. script - script RateSelect -1,{ OnPCLoginEvent: switch (individual_rate) { case 1: .@exp_rate_multiplier = 100; .@jexp_rate_multiplier = 100; set .@rate_description$, "x1 (Low Rate)"; break; case 2: .@exp_rate_multiplier = 2500; .@jexp_rate_multiplier = 2500; set .@rate_description$, "x25 (Mid Rate)"; break; case 3: .@exp_rate_multiplier = 5000; .@jexp_rate_multiplier = 5000; set .@rate_description$, "x50 (High Rate)"; break; case 4: .@exp_rate_multiplier = 10000; .@jexp_rate_multiplier = 10000; set .@rate_description$, "x100 (Super High Rate)"; break; default: mes "[Rate Selector]"; mes "Select your preferred server rate for this character."; mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!"; individual_rate = select("Low Rate:Mid Rate:High Rate:Super High Rate"); close2; goto OnPCLoginEvent; // Return to case evaluation after selection } // Save the multipliers to the player variables set #exp_rate_multiplier, .@exp_rate_multiplier; set #jexp_rate_multiplier, .@jexp_rate_multiplier; fakeIcon(getcharid(0),2002,0,1); dispbottom "You have chosen the " + .@rate_description$ + " for your character."; end; OnNPCKillEvent: // Retrieve the stored multipliers .@exp_rate_multiplier = #exp_rate_multiplier; .@jexp_rate_multiplier = #jexp_rate_multiplier; .@base_exp = getmonsterinfo(killedrid, MOB_BASEEXP) * .@exp_rate_multiplier; .@job_exp = getmonsterinfo(killedrid, MOB_JOBEXP) * .@jexp_rate_multiplier; // Debug messages to track values dispbottom "[Debug] Base EXP: " + .@base_exp; dispbottom "[Debug] Job EXP: " + .@job_exp; if (.@base_exp > 0 || .@job_exp > 0) { // Use getcharid(0) to specify the character ID getexp2(.@base_exp, .@job_exp); } else { dispbottom "[Error] Experience values are zero."; } end; } stateiconinfo.lub StateIconList[EFST_IDs.EFST_RATE_UP] = { haveTimeLimit = 1, posTimeLimitStr = 2, descript = { { "RATE UP", COLOR_TITLE_BUFF }, { "%s", COLOR_TIME }, { "Increases your Bonus EXP and Job Exp" }, { "x1 / x25 / x50 / x100" }, { "Grants players different rewards" }, { "depending on what they choose." } } } efstids.lub EFST_VIPSTATE1 = 2000, EFST_VIPSTATE2 = 2001, EFST_RATE_UP = 2002, __newindex = function() error("unknown state") end } setmetatable(EFST_IDs, EFST_IDs) stateiconimginfo.lub -- Other official effects [EFST_IDs.EFST_VIPSTATE1] = "SI_VIP.tga", [EFST_IDs.EFST_VIPSTATE2] = "SI_VIP2.tga", [EFST_IDs.EFST_RATE_UP] = "RATE_UP.tga", [EFST_IDs.EFST_YGGDRASIL_BLESS] = "vitata500.tga", [EFST_IDs.EFST_PERIOD_RECEIVEITEM_2ND] = "ITEM_G.tga", [EFST_IDs.EFST_PERIOD_PLUSEXP_2ND] = "EXP_G.tga" } } status.hpp /// @APIHOOK_END /// Do not modify code above this, since it will be automatically generated by the API again EFST_VIPSTATE1 = 2000, EFST_VIPSTATE2 = 2001, EFST_RATE_UP = 2002, EFST_MAX, script_constants.hpp /// @APIHOOK_END /// Do not modify code above this, since it will be automatically generated by the API again export_constant(EFST_VIPSTATE1); export_constant(EFST_VIPSTATE2); export_constant(EFST_RATE_UP); export_constant(EFST_MAX); Install fakeicon: https://rathena.org/board/files/file/4034-fake-icon-stats/ RATE_UP.tga RATE_UP.tga
  7. Meron ako kaso irerename mo to sa job name ng 4th jobs.
  8. each character will get random card collection and bonus stats.
  9. I know there are some paid script like this but I created this from scratch. I'm sharing it now hoping that someone can improve it and make the community thrive from such simple script. Pros' Randomly gives any character 5 collection of cards Randomly set bonus stats for each cards Submission of cards will deduct any number of cards from inventory til max Gives permanent bonus to successfully submitted collection Retrieves cards that are already submitted and will remove permanent stats Resets the card collection and bonus stats Cons' While retrieving any cards this code is somewhat bugged with the application of visual addition of stats. Although my solution is bonus_script_clear but the issue here is bonus_script_clear will clear everything added to your character by bonus_script. So if you have buffs that came from a different script that has bonus_script. This will likely to be removed as well. // Apply reverse bonus to neutralize the effect //bonus_script(.@bonus_string$ + (-.@bonus_value) + ";", 512); //bugged stats won't be applied on the second try bonus_script_clear 1; Here's the code: //============================================================ //===== rAthena Script ======================================= //= Card Collection Quest NPC //= By: Louis T Steinhil //= Mostly ChatGPT v 1.0 //= v1.1 Added Alias Name to bonuses for better readability. //= v1.2 Added Cards submission even if the player doesn't //= have the right amount it will still submit regardless. //= v1.3 Initialization and resetting of arrays and variables: //= Ensure that arrays and variables are properly initialized //= and reset to avoid data from previous iterations. //= Avoiding nested loops with the same loop counter: //= The loop counter for the outer and inner loops should be //= different to prevent conflicts. //= v1.4 Rearranged for better readability. Replaced getiteminfo //= on submit with getitemname. //============================================================ yuno_in02,93,207,5 script Card Album 4_ENERGY_WHITE,{ switch (select("Start Card Collection:Reset:Cancel")) { case 1: // Main GM OPTION // Main GM OPTION if (!getd("card_list")) { // Define the fixed number of cards to collect set .@num_cards_to_select, 5; // Display the card collection quest dialogue mes "[Card Collection NPC]"; mes "Welcome to the Card Collection Quest!"; mes "Please submit the following [ " + .@num_cards_to_select + " ] different card/s to receive rewards."; next; mes "You must collect the following cards:"; // Fetch random card IDs for the collection if (checkre(0)) { .@mob_db$ = "mob_db_re"; .@item_db$ = "item_db_re"; } else { .@mob_db$ = "mob_db"; .@item_db$ = "item_db"; } freeloop 1; for (set .@i, 0; .@i < .@num_cards_to_select; set .@i, .@i + 1) { .@string$ = "( `name_aegis` IN ( SELECT DISTINCT `drop1_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop2_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop3_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop4_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop5_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop6_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop7_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop8_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop9_item` FROM `" + .@mob_db$ + "` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop10_item` FROM `" + .@mob_db$ + "` ) )"; .@sql_query$ = "SELECT DISTINCT `id` FROM `" + .@item_db$ + "` WHERE `type` = 'Card' AND " + .@string$ + " ORDER BY RAND()"; .@nb = query_sql(.@sql_query$, .@id[0]); freeloop 0; if (.@nb < 1) { mes "[Card Collection NPC]"; mes "There are not enough valid cards in the database."; close; } // Find a valid card that is not an enchant card for ( .@j = 0; .@j < .@nb; .@j++ ) { if (getiteminfo(.@id[.@j], ITEMINFO_SUBTYPE) != CARD_ENCHANT) { // Save the card ID setd("Card" + .@i, .@id[.@j]); break; // Exit the loop once a valid card is found } } // Check if all cards fetched are enchant cards if (.@j >= .@nb) { mes "[Card Collection NPC]"; mes "There are not enough valid cards in the database."; close; } // Generate a random number of cards to collect (between 1 and 10) set .@cards_to_collect, rand(1, 10); setd("Card" + .@i + "_", 0); setd("Collect" + .@i + "_", .@cards_to_collect); } // Clear the array for generating bonuses deletearray .@j[0], getarraysize(.@j); deletearray .@used_bonus_index[0], getarraysize(.@used_bonus_index); // Generate bonus array with bonus strings setarray .@bonus_string$, "bonus bStr,", "bonus bAgi,", "bonus bVit,", "bonus bInt,", "bonus bDex,", "bonus bLuk,"; // Generate corresponding alias array setarray .@bonus_alias$, "Str +", "Agi +", "Vit +", "Int +", "Dex +", "Luk +"; setarray .@used_bonus_index[0], false, false, false, false, false, false; // Display submitted cards and their statuses for (set .@i, 0; .@i < .@num_cards_to_select; set .@i, .@i + 1) { do { set .@random_bonus_index, rand(0, getarraysize(.@bonus_string$) - 1); } while (.@used_bonus_index[.@random_bonus_index]); set .@used_bonus_index[.@random_bonus_index], true; set .@random_number_bonus, rand(1, 10); // Store the generated bonus and its value setd("Bonus" + .@i + "_String$", .@bonus_string$[.@random_bonus_index]); setd("Bonus" + .@i + "_Alias$", .@bonus_alias$[.@random_bonus_index]); setd("Bonus" + .@i + "_Value", .@random_number_bonus); .@j[.@i] = getd("Card" + .@i); mes "(" + getd("Card" + .@i + "_") + " / " + getd("Collect" + .@i + "_") + ") - " + mesitemlink(.@j[.@i]); mes "> Deposit Reward: " + getd("Bonus" + .@i + "_Alias$") + " " + .@random_number_bonus; dispbottom("(" + getd("Card" + .@i + "_") + " / " + getd("Collect" + .@i + "_") + ") - " + itemlink(.@j[.@i]) + " > Deposit Reward: " + getd("Bonus" + .@i + "_Alias$") + " " + .@random_number_bonus); } // Set the card list flag setd("card_list", 1); close; } else { // Display regular options for starting the card collection or choosing "No" switch (select("See List:Submit Cards:Retrieve Card/s:Cancel")) { case 1: // See List // Check if bonuses have been generated before mes "[Card Collection NPC]"; mes "Here are your previously generated cards list & bonuses:"; for (set .@i, 0; .@i < 5; set .@i, .@i + 1) { // Clear the array deletearray .@j[0], getarraysize(.@j); set .@bonus_alias$, getd("Bonus" + .@i + "_Alias$"); set .@bonus_value, getd("Bonus" + .@i + "_Value"); // Display submitted cards and their statuses .@j[.@i] = getd("Card" + .@i); mes "(" + getd("Card" + .@i + "_") + " / " + getd("Collect" + .@i + "_") + ") - " + mesitemlink(.@j[.@i]); mes "> Deposit Reward: " + getd("Bonus" + .@i + "_Alias$") + " " + .@random_number_bonus; dispbottom("(" + getd("Card" + .@i + "_") + " / " + getd("Collect" + .@i + "_") + ") - " + itemlink(.@j[.@i]) + " > Deposit Reward: " + getd("Bonus" + .@i + "_Alias$") + " " + .@random_number_bonus); .@j[5] = .@j[5] + getiteminfo(.@j[.@i], ITEMINFO_AEGISNAME); } close; break; case 2: // Submit Cards // Initialize the menu string set .@menu$, ""; // Loop through the list of card IDs to populate the menu for (set .@i, 0; .@i < 5; set .@i, .@i + 1) { // Get the card name using its ID set .@card_name$, getitemname(getd("Card" + .@i)); // Get the submission count using dedicated variable set .@submission_count, getd("Card" + .@i + "_"); // Retrieve the required number of cards to collect for the chosen slot set .@required_cards, getd("Collect" + .@i + "_"); // Determine the submission status of the card set .@submission_status$, " (" + .@submission_count + " / " + .@required_cards + ")"; // Append the card name and submission status to the menu string .@menu$ += .@submission_status$ + " - " +.@card_name$ + ":"; } mes "[Card Collection NPC]"; mes "Which card would you like to submit?"; // Display the menu and handle player selection set .@selection, select(.@menu$) - 1; set .@selectedCardId, getd("Card" + .@selection); // Retrieve the submission count set .@submission_count, getd("Card" + .@selection + "_"); // Retrieve the required number of cards to collect for the chosen slot set .@required_cards, getd("Collect" + .@selection + "_"); // Calculate the number of cards to submit set .@cards_needed, .@required_cards - .@submission_count; // Get the player's inventory getinventorylist; // Check if the player has the selected card in their inventory set .@player_card_count, 0; for(set .@j, 0; .@j < @inventorylist_count; set .@j, .@j + 1) { if(@inventorylist_id[.@j] == .@selectedCardId) { set .@player_card_count, @inventorylist_amount[.@j]; break; } } // If player has no cards, inform and exit if (.@player_card_count == 0) { mes "[Card Collection NPC]"; mes "You do not have any of this card."; close; } // Calculate the actual number of cards to submit (up to the needed amount) set .@cards_to_submit, min(.@cards_needed, .@player_card_count); // Update submission count setd("Card" + .@selection + "_", .@submission_count + .@cards_to_submit); // Remove the cards from the player's inventory delitem .@selectedCardId, .@cards_to_submit; mes "[Card Collection NPC]"; mes "Card submitted successfully!"; // If the card collection is complete for this card, apply the bonus if (getd("Card" + .@selection + "_") >= getd("Collect" + .@selection + "_")) { // Retrieve the stored bonus and its value set .@bonus_string$, getd("Bonus" + .@selection + "_String$"); set .@bonus_alias$, getd("Bonus" + .@selection + "_Alias$"); set .@bonus_value, getd("Bonus" + .@selection + "_Value"); // Apply bonus bonus_script(.@bonus_string$ + .@bonus_value + ";", 512); // Display the bonus received mes "[Bonus " + (.@selection + 1) + "]: " + .@bonus_alias$ + " " + .@bonus_value; } close; break; case 3: // Retrieve Cards // Check if any cards have been submitted set .@cards_submitted, 0; for (set .@i, 0; .@i < 5; set .@i, .@i + 1) { if (getd("Card" + .@i + "_") == getd("Card" + .@i + "_")) { set .@cards_submitted, .@cards_submitted + 1; } } if (.@cards_submitted == 0) { mes "[Card Collection NPC]"; mes "You haven't submitted any cards yet."; close; } // Check if the player has already started the card collection if (getd("card_list") == 1) { mes "[Card Collection NPC]"; mes "^FF0000Warning: Retrieving cards will reset the card/s submitted and revoke any bonuses generated.^000000"; next; } // Retrieve submitted cards for 1 million zeny if (Zeny < 1000000) { mes "[Card Collection NPC]"; mes "You need 1,000,000 Zeny to retrieve the cards."; close; } // Deduct 1 million zeny set Zeny, Zeny - 1000000; // Neutralize the granted bonuses for (set .@i, 0; .@i < 5; set .@i, .@i + 1) { if (getd("Card" + .@i + "_") == getd("Card" + .@i + "_")) { // Retrieve the stored bonus and its value set .@bonus_string$, getd("Bonus" + .@i + "_String$"); set .@bonus_value, getd("Bonus" + .@i + "_Value"); // Apply reverse bonus to neutralize the effect //bonus_script(.@bonus_string$ + (-.@bonus_value) + ";", 512); //bugged stats won't be applied on the second try bonus_script_clear 1; } } // Return the cards to the player for (set .@i, 0; .@i < 5; set .@i, .@i + 1) { if (getd("Card" + .@i + "_") == getd("Card" + .@i + "_")) { getitem getd("Card" + .@i), getd("Card" + .@i + "_"); setd("Card" + .@i + "_", 0); } } mes "[Card Collection NPC]"; mes "You have retrieved your submitted cards and your bonus has been neutralized."; close; break; default: mes "[Card Collection NPC]"; mes "Alright, have a great day!"; close; break; } } case 2: // Check if the player has enough Zeny if (zeny < 5000000) { mes "[Card Collection NPC]"; mes "You don't have enough Zeny to restart the card collection."; close; } else { mes "[Card Collection NPC]"; mes "^FF0000Are you sure you want to restart the card collection? This action will deduct 5 million Zeny from your account^000000"; mes "^FF0000and the submitted card will be gone forever!^000000"; switch (select("Yes:No")) { case 1: // Deduct 5 million Zeny from the player zeny -= 5000000; // Start Card Collection again setd("card_list", 0); // Reset the flag to allow new bonuses to be generated set .BonusesGenerated, 0; next; mes "[Card Collection NPC]"; mes "Card list and Bonus Stats have been reset. 5 million Zeny has been deducted from your account."; close; break; case 2: mes "[Card Collection NPC]"; mes "Card collection reset cancelled."; close; break; } } break; default: mes "[Card Collection NPC]"; mes "Alright, have a great day!"; close; break; } OnInit: setunitdata( getnpcid(0), UNPC_GROUP_ID,6 ); setunittitle( getnpcid(0), "Universal" ); end; } Github Link: https://github.com/Qubeks/Script-Release/blob/main/Card_Collector.txt
  10. I made this work by using this bonus_script. But I gotta say anyone know how to make it work using sc_start? - Id: 50257 AegisName: Battle_Pass_Ticket_1D Name: Battle Pass Ticket 1D Type: Cash Buy: 2 Weight: 10 Trade: Override: 99 NoDrop: true NoSell: true NoMail: true NoAuction: true Script: | atcommand "@vip +1d "+strcharinfo(0)+""; bonus_script "{}",86400,0,0,EFST_VIPSTATE2;
  11. This is a working exp and drop rate selection on login. You can select x1 and x100 @mi monsters so you can see the difference in drop rates with that on. - script RateSelect -1,{ OnSetRate: OnPCLoginEvent: switch(individual_rate) { case 1: .@exp_rate_bonus = .low_rate_exp_bonus; .@jexp_rate_bonus = .low_rate_jexp_bonus; .@drop_rate_bonus = .low_rate_drop_bonus; set .@rate_description$, "x1 (Torment)"; break; case 2: .@exp_rate_bonus = .mid_rate_exp_bonus; .@jexp_rate_bonus = .mid_rate_jexp_bonus; .@drop_rate_bonus = .mid_rate_drop_bonus; set .@rate_description$, "x25 (Hell)"; break; case 3: .@exp_rate_bonus = .high_rate_exp_bonus; .@jexp_rate_bonus = .high_rate_jexp_bonus; .@drop_rate_bonus = .high_rate_drop_bonus; set .@rate_description$, "x50 (High Rate)"; break; case 4: .@exp_rate_bonus = .extreme_rate_exp_bonus; .@jexp_rate_bonus = .extreme_rate_exp_bonus; .@drop_rate_bonus = .extreme_rate_jexp_bonus; set .@rate_description$, "x100 (Nightmare)"; break; default: mes "[Rate Selector]"; mes "Select your preferred server rate for this character."; mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!"; individual_rate = select("Torment:Hell:Nightmare:Easy"); close2; goto OnSetRate; } sc_start SC_PERIOD_PLUSEXP_2ND, INFINITE_TICK, .@exp_rate_bonus; //sc_start SC_JEXPBOOST, INFINITE_TICK, .@jexp_rate_bonus, 10000, SCSTART_NOICON; sc_start SC_PERIOD_RECEIVEITEM_2ND, INFINITE_TICK, .@drop_rate_bonus; dispbottom "You have chosen the " + .@rate_description$ + " for your character."; end; OnInit: .low_rate_exp_bonus = 100; // x1 rate .mid_rate_exp_bonus = 2500; // x25 rate .high_rate_exp_bonus = 5000; // x50 rate .extreme_rate_exp_bonus = 10000; // x100 rate .low_rate_jexp_bonus = 100; // x1 rate .mid_rate_jexp_bonus = 2500; // x25 rate .high_rate_jexp_bonus = 5000; // x50 rate .extreme_rate_jexp_bonus = 10000; // x100 rate .low_rate_drop_bonus = 100; // x1 rate .mid_rate_drop_bonus = 2500; // x25 rate .high_rate_drop_bonus = 5000; // x50 rate .extreme_rate_drop_bonus = 10000; // x100 rate } You can also just add script_bonus on adding stats, buffs or status icons on characters. that's proven to work. I've done that
  12. It kinda work if it's like quering for both informations but if I add it into saving the cards into characters and making it a quest it somehow not saving at all. So i just access the item_db_re for now. .@sql_query$ = "SELECT `id` FROM `item_db_re` WHERE `type` = 'Card' AND `name_english` LIKE '%Card%' ORDER BY RAND() LIMIT 5"; .@nb = query_sql(.@sql_query$, .@id[.@i]);
  13. Please share query_sql? and also how did you manage to add vip status icon? Haven't managed to do that even tho i search all the previous ones that have reported they can't add it also.
  14. This is my code but i always get an error: set @string$, "( `name_aegis` IN ( SELECT DISTINCT `drop1_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop2_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop3_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop4_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop5_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop6_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop7_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop8_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop9_item` FROM `mob_db_re` ) " + "OR `name_aegis` IN ( SELECT DISTINCT `drop10_item` FROM `mob_db_re` ) )"; set @sql_query$, "SELECT `item_db_re`.`id` FROM `item_db_re` WHERE `type` = 'Card' AND " + .@string$; dispbottom "Generated SQL query: " + @sql_query$; .@nb = query_sql(@sql_query$, .@id); Error: [SQL]: DB error - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 [Debug]: at D:\Games\Ragnarok\01_emulator\renewal\src\map\script.cpp:17797 - SELECT `item_db_re`.`id` FROM `item_db_re` WHERE `type` = 'Card' AND [Warning]: Script command 'query_sql' returned failure. [Debug]: Source (NPC): Card_Quest_NPC at moc_para01 (16,13) [Debug]: Source (NPC): Card_Quest_NPC is located in: npc/custom/Card_Collector.txt I even tried this in query tab of database SELECT COUNT(*) FROM `mob_db_re` WHERE `drop8_item` IS NOT NULL; it returned 859. So meaning it has value. I also tried this set @query$, "SELECT `mob_db_re`.`drop8_item` FROM `mob_db_re`"; dispbottom "Generated SQL query: " + .@query$; .@nb = query_sql(.@query$, .@id); dispbottom "Number of rows returned: " + .@nb; it didn't return anything.
  15. ever tried using this? *bonus_script "<script code>",<duration>{,<flag>{,<type>{,<status_icon>{,<char_id>}}}}; This command will attach a script to a player for a given duration, in seconds. After that time, the script will automatically expire. The same bonus cannot be stacked. By default, this bonus will be stored on `bonus_script` table when player logs out. Flags (bitmask): 1 : Remove when dead. 2 : Removable by Dispell. 4 : Removable by Clearance. 8 : Remove when player logs out. 16 : Removeable by Banishing Buster. 32 : Removable by Refresh. 64 : Removable by Lux Anima. 128 : Remove when Madogear is activated or deactivated. 256 : Remove when receive damage. 512 : Script is permanent, cannot be cleared by bonus_script_clear. 1024: Force to replace duplicated script by expanding the duration. 2048: Force to add duplicated script. This flag cannot be stacked with 1024, if both are defined, 1024 will be checked first and ignore this flag.
  16. this is the default 175, 125. I'll upload later if I get to see a difference Desktop 2024.06.01 - 07.52.59.01.mp4
  17. Hello this is my script. I know something is missing but it has no errors. (latest rAthena trunk) Thanks in advance! Here's the code: firstcity,229,87,4 script Salvage NPC 856,{ mes "[Salvage NPC]"; mes "Hello! I can salvage your old weapons and armor."; mes "In return, I'll give you a special item based on the weapon's level."; next; mes "[Salvage NPC]"; mes "Would you like to proceed?"; switch(select("Yes:No")) { case 1: callfunc("salvage_item"); break; case 2: mes "[Salvage NPC]"; mes "Alright, come back if you change your mind."; close; } close; // Handle item sale OnSellItem: // Rewards based on weapon level setarray .@reward_common, 501, 502; // Example common loot item IDs setarray .@reward_rare, 503, 504; // Example rare loot item IDs setarray .@reward_unique, 505, 506; // Example unique loot item IDs setarray .@reward_legendary, 507, 508; // Example legendary loot item IDs setarray .@reward_ancient, 509, 510; // Example ancient loot item IDs set .@item_id, @sold_nameid; set .@weapon_level, getiteminfo(.@item_id, ITEMINFO_WEAPONLEVEL); switch (.@weapon_level) { case 1: // Reward common item/points getitem .@reward_common[rand(getarraysize(.@reward_common))], 1; break; case 2: // Reward rare item/points getitem .@reward_rare[rand(getarraysize(.@reward_rare))], 1; break; case 3: // Reward unique item/points getitem .@reward_unique[rand(getarraysize(.@reward_unique))], 1; break; case 4: // Reward legendary item/points getitem .@reward_legendary[rand(getarraysize(.@reward_legendary))], 1; break; case 5: // Reward ancient item/points getitem .@reward_ancient[rand(getarraysize(.@reward_ancient))], 1; break; default: dispbottom "This item cannot be salvaged."; } dispbottom "Thank you! Here is your reward."; end; } function script salvage_item { mes "[Salvage NPC]"; mes "Please show me the items you want to salvage."; next; // Fetch player's inventory getinventorylist; // Collect all weapons and armor in the player's inventory set .@item_count, 0; for (.@i = 0; .@i < @inventorylist_count; .@i++) { set .@type, getiteminfo(@inventorylist_id[.@i], 2); if ((.@type == 4 || .@type == 5) && @inventorylist_equip[.@i] == 0) { // Type 4 = Weapon, Type 5 = Armor, and not equipped set .@salvageable_items[.@item_count], @inventorylist_id[.@i]; set .@salvageable_items_qty[.@item_count], @inventorylist_amount[.@i]; set .@item_count, .@item_count + 1; } } if (.@item_count == 0) { mes "[Salvage NPC]"; mes "You don't have any salvageable items."; close; } mes "[Salvage NPC]"; mes "Here is a summary of the items you can salvage:"; for (.@i = 0; .@i < .@item_count; .@i++) { mes "^0000FF" + getitemname(.@salvageable_items[.@i]) + "^000000 x" + .@salvageable_items_qty[.@i]; } next; if (select("Proceed with Salvage:Cancel") == 2) { mes "[Salvage NPC]"; mes "Alright, come back if you change your mind."; close; } // Call the shop callshop "salvage_shop", 2; npcshopattach "salvage_shop"; close; } // Shop definition - shop salvage_shop -1,501:-1 here's the debug: [Debug]: npc_scriptcont: Salvage NPC (sd->npc_id=111487803) is not 'Unknown NPC' (id=0).
  18. There is a change, it move quite a bit but not the same as you have that waves her hands around. Mine is just like split second movement then rapid duplicated numbers
  19. How to make this Item Icon on NPC Dialog and what client is it compatible? Thanks in advace!
  20. Doesn't work on my 2022 client. rAthena trunk (latest)
×
×
  • Create New...