Jump to content

Missingno

Members
  • Posts

    135
  • Joined

  • Last visited

  • Days Won

    4

Community Answers

  1. Missingno's post in Problem with my OnPCLoginEvent npc was marked as the answer   
    Add this line under OnPCLoginEvent:
    .@map$ = strcharinfo(3);
    If for some reason you're using eAthena, use this instead:
    set .@map$, strcharinfo(3);
  2. Missingno's post in custom points = item was marked as the answer   
    /*=========================================================
    Points to Item Exchanger
    by Mumbles
    ===========================================================
    Request: http://goo.gl/MplDtF
    ===========================================================
    Preview:
    ===========================================================
    Description:
    Exchanges items for points and vice-versa at a fixed rate.
    ===========================================================
    Compatibility:
    Optimised for rAthena emulators.
    ===========================================================
    Changelog:
    v1.0 - First version.
    v1.0.1 - Added changelog.
    v1.0.2 - Removed reverse transactions. [Missingno]
    v1.0.3 - Adjusted rates. [Missingno]
    v1.1 - Compatibilised for rAthena emulators. [Missingno]
    =========================================================*/
    prontera,164,169,3 script Point Exchanger::points2item 871,{
    /*-----------------------------------------------------
    Script
    -----------------------------------------------------*/
    mes .npc_name$;
    mes "Hello there, ^FF8800"+ strcharinfo(0) +"^000000! "+
    "Would you exchange your "+ .points_name$ +" "+
    "for "+ .pod_name$ +"?";
    mes " ";
    mes "Exchange Rate: "+ .rate +":1";
    mes .points_name$ +": [^FF0000"+ getd(.points_var$) +"^000000]";
    next;
    switch (select(implode(.menu_options$, ":"))) {
    case 1:
    mes .npc_name$;
    mes "Okay, come back if you change your mind!";
    break;
    case 2:
    mes .npc_name$;
    mes "Please enter the amount of "+ .points_name$ +" that you want to exchange.";
    do {
    mes " ";
    mes "Input ^0000FF0^000000 to cancel.";
    next;
    input .@amount;
    .@total = .@amount / .rate;
    // Check break input
    if (!.@amount) {
    message strcharinfo(0), strnpcinfo(1) +" : Exchange terminated.";
    close;
    }
    // Check amount against points
    if (getd(.points_var$) < .@amount) {
    mes .npc_name$;
    mes "^FF0000Please enter a valid amount.^000000";
    }
    } while (getd(.points_var$) < .@amount);
    // Check weight
    if (!checkweight(.pod_id, .@total)) {
    mes .npc_name$;
    mes "^FF0000You're overweight; please store some items.^000000";
    break;
    }
    setd .points_var$, getd(.points_var$) - .@amount;
    getitem .pod_id, .@total;
    mes .npc_name$;
    mes "You've exchanged "+ .@amount +" "+ .points_name$ +" for "+ .@total +" "+ .pod_name$ +". "+
    "You now have "+ getd(.points_var$) +" "+ .points_name$ +" and "+ countitem(.pod_id) +" "+ .pod_name$ +".";
    break;
    }
    close;
    /*-----------------------------------------------------
    Configuration
    -----------------------------------------------------*/
    OnInit:
    .npc_name$ = "[^0000FFPoint Exchanger^000000]";
    .rate = 20; // Exchange rate (rate = 1 PoDs)
    .pod_id = 7350; // Proof of Donation item ID or constant
    .pod_name$ = getitemname(.pod_id) +"(s)"; // Proof of Donation item name
    .points_name$ = "Cash Point(s)"; // Points name
    .points_var$ = "#CASHPOINTS"; // Points variable
    // Modifying these options requires updates to the corresponding case
    setarray .menu_options$[0], "^FF0000>^000000 Cancel",
    "^0000FF>^000000 Exchange "+ .points_name$ +" for "+ .pod_name$;
    end;
    }

  3. Missingno's post in if (!isequipped() was marked as the answer   
    Give this a try. See lines 21+ for configuration settings. I've left comments to briefly explain what each section of code does.
    prontera,150,150,5 script Test NPC 999,{ // Script mes .npc_name$; // Loop through item IDs for (.@i = 0; .@i < getarraysize(.item_id); .@i++) { // Check if current item is equipped if (isequipped(.item_id[.@i])) { // Display message if item is equipped mes "Hey, nice "+ getitemname(.item_id[.@i]) +"!"; close; } } // Display if no items are equipped mes "Huh, what do you want? Get lost!"; close; // Configuration OnInit: // NPC name .npc_name$ = "[Test NPC]"; // Item IDs to speak to NPC setarray .item_id[0], 5102, // Blank Eyes 5751, // Minstrel Song Hat 5138, // Magic Eyes 5383, // Hunter's Cap 5395, // Striped Hat 5308; // Brazil National Flag Hat end; }
  4. Missingno's post in How to add @joinevent and warp to event area was marked as the answer   
    Here's a sample of what you've described:
    - script joinevent -1,{ // Configuration OnInit: // Map settings .map_name$ = "payon"; .map_x = 20; .map_y = 20; // Command bindatcmd "joinevent", strnpcinfo(3) +"::OnCommand"; end; // Script OnCommand: // Confirm warp if (select("Warp to event area:End session") != 2) { // Warp to preset destination warp .map_name$, .map_x, .map_y; end; } close; }
    ...though I would probably just go without the confirmation, since the implementation is via atcommand:
    - script joinevent -1,{ // Configuration OnInit: // Map settings .map_name$ = "payon"; .map_x = 20; .map_y = 20; // Command bindatcmd "joinevent", strnpcinfo(3) +"::OnCommand"; end; // Script OnCommand: // Warp to preset destination warp .map_name$, .map_x, .map_y; end; close; }  
    I've left some comments so you can get an idea of what each section of code does.
  5. Missingno's post in Area Monster Spawn was marked as the answer   
    Read our Wiki article about areamonster.
     
    Syntax:
    areamonster <"map name">, <x1>, <y1>, <x2>, <y2>, <"display name">, <mob id>, <amount>[, <"event label">];

    Example: areamonster "prt_fild08", 50, 50, 100, 100, "Poring", 1002, 10, strnpcinfo(3) +"::OnPoringDeath"; Spawn 10 Poring (1002) named "Poring" in a rectangular area between coordinates 50, 50 and 100, 100 on the map "prt_fild08". When it is killed, run the event label "OnPoringDeath" in (this NPC name).
  6. Missingno's post in Monster not RE spawning was marked as the answer   
    The way you've written it, your mobs will respawn at some random coordinate on ama_test after 1-1.5 seconds. A possibility is that the monsters are respawning, just not in your room; after reviewing the map, there appears to be two rooms separate from each other:

     
    To control where the mobs are spawning, specify a rectangular area for the coordinates (i.e. ama_test,10,10,100,100 will spawn mobs between 10,10 and 100,100).
  7. Missingno's post in Poring Coin to Cashpoint NPC was marked as the answer   
    I saw this on another board, and it's in English:
    /*========================================================= Points to Item Exchanger by Mumbles =========================================================== Request: http://goo.gl/MplDtF =========================================================== Preview: =========================================================== Description: Exchanges items for points and vice-versa at a fixed rate. =========================================================== Compatibility: Optimised for Hercules emulators. =========================================================*/ prontera,164,169,3 script Donation Manager::points2item 4_M_OPERATION,{ /*----------------------------------------------------- Script -----------------------------------------------------*/ mes .npc_name$; mes "Hello there, ^FF8800"+ strcharinfo(0) +"^000000! "+ "Would you exchange your "+ .pod_name$ +" "+ "for "+ .points_name$ +"?"; mes " "; mes "Exchange Rate: "+ .rate +":1"; mes .points_name$ +": [^FF0000"+ getd(.points_var$) +"^000000]"; next; switch (select(implode(.menu_options$, ":"))) { case 1: mes .npc_name$; mes "Okay, come back if you change your mind!"; break; case 2: mes .npc_name$; mes "Please enter the amount of "+ .pod_name$ +" you want to exchange."; do { mes " "; mes "Input ^0000FF0^000000 to cancel."; next; input .@amount; .@total = .@amount / .rate; .@remainder = .@amount % .rate; // Check break input if (!.@amount) { message strcharinfo(0), strnpcinfo(1) +" : Exchange terminated."; close; } // Check total against inventory if (countitem(.pod_id) < .@amount) { mes .npc_name$; mes "^FF0000Please enter a valid amount.^000000"; } // Check remainder [loss prevention] else if (.@remainder) { mes .npc_name$; mes "Sorry, but you must exchange multiples of "+ .rate +"."; } } while (countitem(.pod_id) < .@amount || .@remainder); delitem .pod_id, .@amount; setd .points_var$, getd(.points_var$) + .@total; mes .npc_name$; mes "You've exchanged "+ .@amount +" "+ .pod_name$ +" for "+ .@total +" "+ .points_name$ +". "+ "You now have "+ getd(.points_var$) +" "+ .points_name$ +" and "+ countitem(.pod_id) +" "+ .pod_name$ +"."; break; case 3: mes .npc_name$; mes "Please enter the amount of "+ .points_name$ +" that you want to exchange."; do { mes " "; mes "Input ^0000FF0^000000 to cancel."; next; input .@amount; .@total = .@amount * .rate; // Check break input if (!.@amount) { message strcharinfo(0), strnpcinfo(1) +" : Exchange terminated."; close; } // Check amount against points if (getd(.points_var$) < .@amount) { mes .npc_name$; mes "^FF0000Please enter a valid amount.^000000"; } } while (getd(.points_var$) < .@amount); // Check weight if (!checkweight(.pod_id, .@total)) { mes .npc_name$; mes "^FF0000You're overweight; please store some items.^000000"; break; } setd .points_var$, getd(.points_var$) - .@amount; getitem .pod_id, .@total; mes .npc_name$; mes "You've exchanged "+ .@amount +" "+ .points_name$ +" for "+ .@total +" "+ .pod_name$ +". "+ "You now have "+ getd(.points_var$) +" "+ .points_name$ +" and "+ countitem(.pod_id) +" "+ .pod_name$ +"."; break; } close; /*----------------------------------------------------- Configuration -----------------------------------------------------*/ OnInit: .npc_name$ = "[^0000FFDonation Manager^000000]"; .rate = 20; // Exchange rate (1 point * rate = total PoDs) .pod_id = Donation_Card; // Proof of Donation item ID or constant .pod_name$ = getitemname(.pod_id) +"(s)"; // Proof of Donation item name .points_name$ = "Cash Point(s)"; // Points name .points_var$ = "#CASHPOINTS"; // Points variable // Modifying these options requires updates to the corresponding case setarray .menu_options$[0], "^FF0000>^000000 Cancel", "^0000FF>^000000 Exchange "+ .pod_name$ +" for "+ .points_name$, "^0000FF>^000000 Exchange "+ .points_name$ +" for "+ .pod_name$; end; }
    Change lines 16 and 126 to make it compatible for rAthena:
    prontera,164,169,3 script Donation Manager::points2item 4_M_OPERATION,{ prontera,164,169,3 script Donation Manager::points2item 864,{ .pod_id = Donation_Card; .pod_id = 7539;
    Source: Points to Item Exchanger
  8. Missingno's post in disable command # was marked as the answer   
    In rAthena, edit conf/groups.conf for the command(s) you want disabled. If you don't want a group to have the charcommand available and their inherited group(s) do not have a charcommand available, simply do not specify a second option:
    item: true
    If the inherited group does have a charcommand but you don't want the inheriting group to have it, specify false for the second option in this format:
    item: [true, false]
    To prevent the administrator from having the charcommand, specify the charcommand as false; this will override their all_commands permission:
    item: [true, false]

    In eAthena1, change the GM level for the charcommand in conf/atcommand_athena.conf to something higher than the admin's level, or simply do not specify one at all:
    item: 40, 100 item: 40

    1Disclaimer: I cannot guarantee the accuracy of this information, as eAthena is a bit ancient at this point and hasn't seen my desktop in years. d:
  9. Missingno's post in R>query for this? was marked as the answer   
    You could just add OR to the query to add an additional item, or you could create a script-based query to delete an array of items; here is the former:
    DELETE FROM `inventory` WHERE `id` = '7179' OR `id` = '909'; DELETE FROM `cart_inventory` WHERE `id` = '7179' OR `id` = '909'; DELETE FROM `storage` WHERE `id` = '7179' OR `id` = '909'; DELETE FROM `guild_storage` WHERE `id` = '7179' OR `id` = '909'; You can load this script and it will (in theory) automatically delete all the items from the array .@item_id from player inventories and storages, regardless of whether or not they are online; this is untested:
    - script delete_all -1,{ OnInit: // List of item IDs to delete setarray .@item_id[0], 909, 910, 911; // Build list of account IDs query_sql "SELECT `account_id` FROM `login`", .@account_id; // Loop for each account for (.@i = 0; .@i < getarraysize(.@account_id); .@i++) { // Loop for each item for (.@j = 0; .@j < getarraysize(.@item_id); .@j++) { // Check if account is logged in if (isloggedin(.@account_id[.@i])) { // Delete items from online player inventory attachrid .@account_id[.@i]; delitem .@item_id[.@j], countitem(.@item_id[.@j]); detachrid; } } } // Loop for each item for (.@i = .@j = 0; .@i < getarraysize(.@item_id); .@i++) { // Delete items from all inventories/storages query_sql "DELETE FROM `inventory` WHERE `id` = '"+ .@item_id[.@i] +"'"; query_sql "DELETE FROM `cart_inventory` WHERE `id` = '"+ .@item_id[.@i] +"'"; query_sql "DELETE FROM `storage` WHERE `id` = '"+ .@item_id[.@i] +"'"; query_sql "DELETE FROM `guild_storage` WHERE `id` = '"+ .@item_id[.@i] +"'"; // Build list of item names .@item_name$[.@j++] = getitemname(.@item_id[.@i]); } // Announce deleted items announce "The following items have been deleted: "+ implode(.@item_name$, ", "), bc_all; end; }
  10. Missingno's post in In game setting of GM level was marked as the answer   
    Here's a script-based atcommand version of your request: http://rathena.org/board/files/file/3128-adjgm-command/
  11. Missingno's post in Bounded Item Shop was marked as the answer   
    You could use Euphy's Quest Shop and just replace getitem commands with getitembound and the bound type.
  12. Missingno's post in Give Rewards thru whisper was marked as the answer   
    - script reward -1,{ OnInit: // Configuration .reward_id = 7720; .amount = 5; .min_gm = 40; end; OnWhisperGlobal: // Check GM level if (getgmlevel() < .min_gm) { message strcharinfo(0), "You are not authorised to access this feature."; end; } // Check if reward session ended if (select("Reward a player:End session") == 2) { close; } do { // Input target player's name message strcharinfo(0), "Enter the name of the character to be rewarded."; input .@player_name$; // Check if specified player is logged in if (!isloggedin(getcharid(3, .@player_name$), getcharid(0, .@player_name$))) { message strcharinfo(0), "'"+ .@player_name$ +"' is either not logged in or does not exist."; } } while (!isloggedin(getcharid(3, .@player_name$), getcharid(0, .@player_name$))); // Reward specified player getitem .reward_id, .amount, getcharid(3, .@player_name$); // Announce reward announce "The GM '"+ strcharinfo(0) +"' has rewarded '"+ .@player_name$ +"' with "+ .amount +" "+ getitemname(.reward_id) +".", bc_all; close; } Whisper to npc:reward to activate the GM panel; anyone below GM level 40 will be replied to with a fail message. I suspect you might be using eAthena, though; in which case, change lines 5 through 7 for compatibility:
    OnInit: // Configuration set .reward_id, 7720; set .amount, 5; set .min_gm, 40; end;
  13. Missingno's post in How to see script errors after exit on centos was marked as the answer   
    Download and install screen, then run your server from a screen session.

    sudo apt-get install screen screen -S server cd path/to/server/files/ ./athena-start start To detach from screen, press Ctrl A D simultaneously; to resume our screen session named "server", type this:
    screen -R server
  14. Missingno's post in Edit was marked as the answer   
    Do it from your home directory. o_o
    cd ~ fuser 5121/tcp kill PID fuser 6121/tcp kill PID fuser 6900/tcp kill PID
  15. Missingno's post in mes was marked as the answer   
    You can use a switch to prompt a menu that can adjust the dialogue without a next button:
    prontera,160,170,3 script Example NPC 721,{ mes "[Kafra]"; mes "Tell me where you want to go."; switch (select("Here:There:Cancel")) { case 1: // Here mes "If you go here, then you must pay."; break; case 2: // There mes "You can go there for free!"; break; case 3: // Cancel mes "Okay, see you later!"; break; } close; } Because of the way this is written, the script will continue based on which option you chose. If the first option ("Here") was selected, the switch will switch you over to case 1; similarly, if you choose the second option ("There"), you'll be switched over to case 2. Each case serves as a label (of sorts), but allows for a little more flexibility and readability than something like L_LameLabelName. These case labels also correspond to the value sent in the switch, which was returned by the function select(). At the end of each case label, the script should either break, close, or end (but only end in switches without a mes dialogue).
     
     
    Edit: Fixed typo. D:
  16. Missingno's post in Npc for Guild Master and Guild Members @gstorage was marked as the answer   
    Here's my method, which uses dynamic global variables in place of an SQL table:
    - script guildstorage -1,{ // Function: Return character name of sent ID function getcharname { query_sql("SELECT `name` FROM `char` WHERE `char_id` = '"+ getarg(0) +"'", .@query_name$); return .@query_name$; } OnInit: // Configuration bindatcmd "guildstorage", strnpcinfo(3) +"::OnAtcommand", 0, 0; bindatcmd "gstorage", strnpcinfo(3) +"::OnAtcommand", 0, 0; end; OnAtcommand: // Guild master access if (getguildmasterid(getcharid(2)) == getcharid(0)) { while (1) { switch (select("Open storage:Change permissions:End session")) { case 1: // Open storage message strcharinfo(0), "Guild storage opened."; guildopenstorage(); close; case 2: // Clear looped data cleararray .@access_list$[0], "", getarraysize(.@access_list$); cleararray .@member_list$[0], "", getarraysize(.@member_list$); .@j = 0; // Build access list for (.@i = 0; .@i < getarraysize(getd("$GS_Auth_"+ getcharid(2))); .@i++) { .@access_list$[.@j++] = getcharname(getd("$GS_Auth_"+ getcharid(2) +"["+ .@i +"]")); } // Inject "Add new member" option .@access_list$[getarraysize(.@access_list$)] = "Add new member"; // Inject "Go back" option .@access_list$[getarraysize(.@access_list$)] = "Go back"; // Select member to modify menu implode(.@access_list$, ":"), -; .@access_choice = @menu - 1; // Check if last option selected if (@menu == getarraysize(.@access_list$)) { break; } // Check if second to last option selected if (@menu == getarraysize(.@access_list$) - 1) { // Build member list query_sql "SELECT `name` FROM `guild_member` WHERE `guild_id` = '"+ getcharid(2) +"'", .@member_list$; // Inject "Go back" option .@member_list$[getarraysize(.@member_list$)] = "Go back"; // Add new member menu implode(.@member_list$, ":"), -; .@member_choice = @menu - 1; // Check if last option selected if (.@member_choice == getarraysize(.@member_list$)) { break; } // Add member's ID to array query_sql "SELECT `char_id` FROM `guild_member` WHERE `name` = '"+ .@member_list$[.@member_choice] +"'", .@member_id; message strcharinfo(0), "Granted guild storage access for '"+ .@member_list$[.@member_choice] +"'."; setd "$GS_Auth_"+ getcharid(2) +"["+ getarraysize(getd("$GS_Auth_"+ getcharid(2))) +"]", .@member_id; break; } // Revoke access switch (select("Revoke access:Go back")) { case 1: message strcharinfo(0), "Revoked guild storage access for '"+ getcharname(getd("$GS_Auth_"+ getcharid(2) +"["+ .@access_choice +"]")) +"'."; deletearray getd("$GS_Auth_"+ getcharid(2) +"["+ .@access_choice +"]"), 1; break; case 2: break; } break; case 3: close; } } // Guild member access } else if (getcharid(2)) { // Check permission for (.@i = 0; .@i < getarraysize(getd("$GS_Auth_"+ getcharid(2) +"["+ .@i +"]")); .@i++) { // Open storage if (getd("$GS_Auth_"+ getcharid(2) +"["+ .@i +"]") == getcharid(0)) { message strcharinfo(0), "Guild storage opened."; guildopenstorage(); end; } } // Unauthorised access message strcharinfo(0), "You are not authorised to access guild storage."; // No guild } else { message strcharinfo(0), "You are not in a guild."; } message strcharinfo(0), .@atcmd_command$ +" failed."; end; } This supports guildmaster changes and up to 128 members (not sure if rA has limitless arrays), though the typical maximum number of guild members is 76. A guild master can access the control panel and either grant or revoke member access.
     
     
    Edit: Removed debug code.
  17. Missingno's post in Binding Items was marked as the answer   
    Punch this code in after retrieving the desired item ID to be bound:
    // Item IDs that cannot be bound setarray .@blacklist[0], 1201, 1207, 2301; // Check blacklist for (.@i = 0; .@i < getarraysize(.@blacklist); .@i++) { if (@inventorylist_id[.@item] == .@blacklist[.@i]) { mes "Sorry, but "+ getitemname(@inventorylist_id[.@item]) +" is blacklisted from being bound."; close; } }
×
×
  • Create New...