-
Posts
1016 -
Joined
-
Last visited
-
Days Won
22
Community Answers
-
Poring King's post in Need Help : check the card items already installed in the equipment was marked as the answer
I have this . Try this one i dont know if this will still work to latest rAthena . But the script is easy to understand so you can play with it
prontera,150,150,4 script Item Inspector 123,{ mes "Welcome to the Item Inspector!"; mes "Enter the name of the player you want to inspect:"; input .@playerName$; // Get the player name input from the user // Check if the input is empty if (.@playerName$ == "") { dispbottom "You must enter a player name."; close; } // Get the target player's ID set .@target_charid, getcharid(0); // Get target player's ID // Check if player exists if (getcharid(0) != getcharid(0)) { dispbottom "Player not found or is offline."; close; } // Display player's inventory dispbottom "Inventory of " + .@playerName$ + ":"; query_sql "SELECT `id`, `item_id`, `amount` FROM `inventory` WHERE `char_id` = " + .@target_charid, .@inv_id, .@inv_item_id, .@inv_amount; if (getarraysize(.@inv_id) > 0) { for (set .@i, 0; .@i < getarraysize(.@inv_id); set .@i, .@i + 1) { dispbottom "Item ID: " + .@inv_item_id[.@i] + ", Amount: " + .@inv_amount[.@i]; } } else { dispbottom "No items found in inventory."; } // Display equipped items dispbottom "Equipped Items of " + .@playerName$ + ":"; query_sql "SELECT `id`, `item_id`, `card1`, `card2`, `card3`, `card4` FROM `equipment` WHERE `char_id` = " + .@target_charid, .@equip_id, .@equip_item_id, .@equip_card1, .@equip_card2, .@equip_card3, .@equip_card4; if (getarraysize(.@equip_id) > 0) { for (set .@i, 0; .@i < getarraysize(.@equip_id); set .@i, .@i + 1) { dispbottom "Item ID: " + .@equip_item_id[.@i] + ", Card 1: " + .@equip_card1[.@i] + ", Card 2: " + .@equip_card2[.@i] + ", Card 3: " + .@equip_card3[.@i] + ", Card 4: " + .@equip_card4[.@i]; } } else { dispbottom "No equipped items found."; } close; }
-
Poring King's post in HOW CAN I CHANGE THE LEVEL REQUIREMENT OF AN ITEM? was marked as the answer
If you want to change the item description in game . You can change it inside your client files . Find System info . But if you want to change it also on server side do it on item_db
-
Poring King's post in Skill Damage Adjustment was marked as the answer
Skill dmage db is already enabled . You don't need to enable it . Just simply edit it and use @reloadskilldb to your server after applying
-
Poring King's post in How to access drops of mobs via query_sql? was marked as the answer
Get some idea with this . I just write it simple
prontera,150,150,5 script QueryMobDrops 1_M_MERCHANT,{ // NPC Dialogue mes "Enter the Mob ID:"; input .@mob_id; // SQL Query query_sql("SELECT m.id, m.name_japanese, i.id, i.name_english, md.rate " + "FROM mob_db m " + "JOIN mob_drop md ON m.id = md.mob_id " + "JOIN item_db i ON md.item_id = i.id " + "WHERE m.id = " + .@mob_id + ";", .@mob_id, .@mob_name$, .@item_id, .@item_name$, .@drop_rate); if (getarraysize(.@mob_id) > 0) { mes "Mob: " + .@mob_name$; for (.@i = 0; .@i < getarraysize(.@mob_id); .@i++) { mes "Item: " + .@item_name$[.@i] + " (ID: " + .@item_id[.@i] + "), Drop Rate: " + .@drop_rate[.@i] + "%"; } } else { mes "No drops found for this mob ID."; } close; }
-
Poring King's post in Sell item to npc then npc will give something in return item/zeny/points was marked as the answer
The script you provided is close to being functional, but there are some issues that need to be addressed to ensure it works correctly. Below is the corrected script with explanations for the changes:
Here is the corrected script
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; } 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], ITEMINFO_TYPE); if ((.@type == IT_WEAPON || .@type == IT_ARMOR) && @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", 1; npcshopattach "salvage_shop"; close; } // Shop definition with placeholder items (you need to fill this with the actual items you want to allow for salvage) - shop salvage_shop -1,501:10000,502:10000,503:10000,504:10000,505:10000,506:10000,507:10000,508:10000,509:10000,510:10000 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_WEAPONLV); 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; The OnSellItem label should be properly defined and hooked into the shop functionality. The shop definition needs to include the items that are eligible for sale. The getiteminfo function needs to fetch the correct item information. Some logic and flow improvements.
Key Changes and Fixes:
Item Info Fetching:
Changed getiteminfo(.@item_id, ITEMINFO_WEAPONLEVEL) to getiteminfo(.@item_id, ITEMINFO_WEAPONLV) to correctly fetch the weapon level. Shop Definition:
The salvage_shop now includes example items with prices. Adjust these item IDs and prices according to your server's item database. Shop Invocation:
Adjusted callshop "salvage_shop", 1; to make sure the shop is called correctly. Reward Logic:
getiteminfo uses ITEMINFO_WEAPONLV to fetch the weapon level correctly. Item Type Constants:
Added constants IT_WEAPON and IT_ARMOR for better readability. Make sure the items you want to allow for salvage are included in the salvage_shop definition. Adjust the item IDs and the rewards as per your server's requirements. This should make the script functional and enable the salvage NPC to work correctly.
-
Poring King's post in Help to edit Hunting Mission script was marked as the answer
My bad typo . Just up the post so other will know that this trend will mark as solve
-
Poring King's post in [RESOLVED] Error when using Bowling with the Swordsman class was marked as the answer
You are missing of file .. You need to update your client files
-
Poring King's post in Does anyone have this bulletin board npc? was marked as the answer
Here
https://rathena.org/board/files/file/2379-npc-auction-system/
-
Poring King's post in can't received woe points was marked as the answer
It should be look like this . Its very case sensitive when you do a scripting...
set #WOEPOINTS,100; // Try this first and see if it work add some value - pointshop woe_shop -1,#WOEPOINTS,909:-1
-
Poring King's post in Wing effect was marked as the answer
Then go to your respective item add this code at the Script
Do you mean like the gympass ? If yes then copy the ticket script code
bonus bAddMaxWeight,n; MaxWeight + n (in units of 0.1)
-
Poring King's post in Pay to Enchant was marked as the answer
Here try this i just made it not tested but i hope you get the idea i try to make it more informative so you can understand
prontera,x,y script Test 99{ mes "Welcome"; mes "Let me check if you have zeny"; next; //To check if the player have zeny if ( Zeny > 5000){ // This is the condition if true then proceed if false then end the conversation set Zeny,Zeny-5000; // Deduct 5,000z mes "I see you have zeny now what should i do?"; next; switch(select("Process:Exit")){ case 1: mes "You select Process this is the start for the menu process"; end; case 2: mes "You select Exit this is the start for the menu exit"; end; } end; } mes "Sorry you dont have zeny to process"; end; // To end conversation }// End of script
-
Poring King's post in On-Off event was marked as the answer
Spend time reading the rAthena-Master/doc/script_commands.txt to answer your question find this inside the file *stopnpctimer
-
Poring King's post in Simple Information NPC Script that has Menus was marked as the answer
Goto rAthena-Master/doc/script_commands for guide everything you need for scripting is there
Ex:
switch(select("This is Label and it will go to Case 1:This is Label and it will go to Case 2")) { case 1: mes "You said yes!"; break; case 2: mes "Aww, why?"; break; } close;
-
Poring King's post in How to switch Renewal to pre renewal (vise versa) was marked as the answer
Just uncomment the Define PRERE so your server will load all pre-re
-
Poring King's post in custom megaphone was marked as the answer
Announce "This is how you use announce",BC_ALL;
Your mega phone is this "announce strcharinfo(0) + ": " + .@megaphone$,bc_all,0xFF0000;"
To correct that . use the default syntax
Announce "[ Streamer ]: "+strcharinfo(0)+":"+.@megaphone$+"",bc_all;
-
Poring King's post in COSTUME ERROR VIEW was marked as the answer
Here
Just click the up botton left side on my profile so it will show as a solve and other can see it easily
-
Poring King's post in NPC GM Switch was marked as the answer
Here
prontera,x,y,3 script testGM 99,{ if (getgmlevel() <= 90 ) goto GM_Menu; mes "[ Test NPC ]"; mes "This is where it go if you are normal player"; switch(select("Menu 1","Menu 2","Exit")){ case 1: mes "Menu 1 dialog"; end; case 2: mes "Menu 2 dialog"; end; case 3: mes "Exiting Bye"; end; } end; GM_Menu: mes "[ Test NPC ]"; mes "You are now in GM Menu"; switch(select("GM Menu 1","GM Menu 2","Exit")){ case 1: mes "GM Menu 1 dialog"; end; case 2: mes "GM Menu 2 dialog"; end; case 3: mes "Exiting Bye"; end; } end; }
-
Poring King's post in Is there any "How to create a KRO up-to-date RO server" guide ? was marked as the answer
This is where you start
-
Poring King's post in Client GM SPRITE - HELP was marked as the answer
If you want to get what you want on client.exe then get a clean or unpacked clients Add gm client thru this on your clientinfo.xml
Example:
<yellow> <admin>2000001</admin> <admin>2000002</admin> <admin>2000003</admin> </yellow> 3. If you want to hex / diff your clean client use nemo-master by 4144
-
Poring King's post in how to display # in fact announcer was marked as the answer
You can add a bind command to join in Global chat
-
Poring King's post in Help Adding Custom item ID to ROTD Script was marked as the answer
Try to change this value
input .BonusItem,0,32767;
-
Poring King's post in Atcommand was marked as the answer
I already provide you what you need . I even put 1 warp command to train . So you only need to do is to copy and replace it to your own map coordinates
This is the new one that you need
- script example -1,{ OnInit: bindatcmd "BTS",strnpcinfo(3) + "::OnBTS"; bindatcmd "Train",strnpcinfo(3) + "::OnTrain"; bindatcmd "Quest",strnpcinfo(3) + "::OnQuest"; end; //------------------------------------------------------- OnBTS: warp "prontera",155,180; end; //------------------------------------------------------- OnTrain: warp "prontera",155,180; end; //------------------------------------------------------- OnQuest: warp "prontera",155,180; end; }
-
Poring King's post in SQL wont load to my DB was marked as the answer
Solved
/* CREATE TABLE IF NOT EXISTS `fabre_punch_rank` ( `cid` INT(11) UNSIGNED NOT NULL DEFAULT '0', `name` NVARCHAR(30) NOT NULL DEFAULT '', `point` INT(11) NOT NULL DEFAULT '0', `rank` TINYINT(3) UNOT NULL DEFAULT '0', PRIMARY KEY (`cid`) ) ENGINE=MyISAM; */ -
Poring King's post in pass through a cell buff or with pop up mes was marked as the answer
prontera,0,0,3 script TouchMe -1,{ OnTouch: getitem 7227,1; dispbottom "You just receive an item from GameMaster Team"; } Not tested just made this from phone
-
Poring King's post in [Resolved] Errors when finishing an ET Instance was marked as the answer
You are using old lua files quest info . Always update your KRO then if the error is still there . Find a latest data that contain 2020 lua files or just simply extract rdata or data.grf and get the lua and copy it to your grf