Jump to content

Akinari

Members
  • Posts

    247
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Akinari

  1. I've been pondering the usefulness of such commands and decided I'd throw my ideas out here and see what you guys have to say.  My thoughts are that we should have party script commands such as, createparty, addpartymember, delpartymember, delparty, and maybe some later ones that can fully manage parties from a script.  With a little creativity, I think these commands could become powerful additions to scripts for purposes such as:

    • Events
    • Instances (Allow adding members without party leader sending invite)
    • Random party making NPCs for any purpose

    Those are some of the ideas I had for such commands.  I was even thinking that if this was an accepted idea, it could be expanded later to merge parties, split parties, shuffle 2 parties, and really cool (how I feel about it) stuff like that.  What are your thoughts?

    • Upvote 1
  2. Added revive flag as per your suggestion.  Looking into optional map string for guild and party now.  Might have to move some stuff around.

     

    Edit: Going to make a bitwise flag for it.

     

    
    
    
    
    
    
    
    
     * <revive_flag> : (Add together flags to specify how you want to heal)
     *		 : 1 => Revive and Recover
     *		 : 2 => Only Full Heal
     *		 : 4 => Only Revive
     *		 : 8 => Party/Guild Map Only (must specify argument 5)
     *-------------------------------------------------------------------------*/
    

    Here's the result in script_commands documentation.  Let me know what you think.

     

    *recovery <type>{,<string>,<revive_flag>{,<map>}};

    Recovery can be used to recover all HP/SP to specific characters as well as revive.
    Party and Guild type uses a player name, not party or guild name.

    <type> is who you are targeting. Valid types are:
        - 0: Specific Character (<string> or target is invoker)
        - 1: Party (<string> or target party is invoker's)
        - 2: Guild (<string> or target party is invoker's)
        - 3: Map (<string> or invoker map)
        - 4: All

    <revive_flag> is used to determine what actions to take.
    This is a bitmask (like some config settings) and can be added together.
        - 1: Revive and Recover (Default)
        - 2: Only Full Heal
        - 4: Only Revive
        - 8: Party/Guild Map Only (must specify argument 4)

    <map> is used only when <revive_flag> has config 8 (party and guild <type> only).
    Note: If giving <revive_flag> of 8, a heal action is still required. [1,2,4]

    Examples:
        //Only revive characters in invoking party on map morocc
        recovery 1,strcharinfo(0),12,"morocc";

        //Fully heal (don't revive) all members of invoking character's guild
        recovery 2,2;

        //Revive and fully heal everyone in map prontera
        recovery 3,"prontera";

        //Only revive all dead characters on server
        recovery 4,4;
     
    Edit: Changing some more stuff around.  I was informed this was too confusing.  Going with ID's for arguments rather than names.
    • Upvote 1
  3. I've started working on this.  I've made an outline on what else I'd like to add.

     

    /*=========================================================================
     * Fully Recover a Character's HP/SP
     * recovery <target>,<string>,<revive_flag>; [Capuche]
     * <target> :
     *	0 - Character
     *	1 - Character Party
     *	2 - Character Guild
     *	3 - Map (Character on map)
     *	4 - All Characters
     * <string> :
     *	<target> : 0-2 => Character's name
     *	<target> : 3   => Map's name (player attached map's name by default)
     * <revive_flag> :
     *		 : 0 => Don't revive dead players
     *		 : 1 => Revive dead players
     *-------------------------------------------------------------------------*/
    
    • Upvote 1
  4. You're missing this portion of your patch in pc.h.

     

    ===================================================================
    --- src/map/pc.h	(revision 16365)
    +++ src/map/pc.h	(working copy)
    @@ -144,6 +144,7 @@
     		unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
     		unsigned int warping : 1;//states whether you're in the middle of a warp processing
     	} state;
    +	int cmdtick; //[Ind/ro-resources.net] rA Port by [LJA] Lord Jhedzkie - common tick for delay purposes.
     	struct {
     		unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
     		unsigned int restart_full_recover : 1;
    
  5. I know this is script support, but I thought I'd put in a different fix for this issue.  It's a source fix.

     

    pc.c in

    int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype)

    FIND

    m = map_mapindex2mapid(mapindex);
    

     

    ADD AFTER

    	if (map[m].flag.gvg && pc_get_group_level(sd) > 0)
    		return 1;
    

     

    Replace "0" with any number where you want the GM level to restrict GVG access.  For instance, if group level restricted 5 and above:

     

    pc_get_group_level(sd) > 4

     

    Just suggesting another option.

  6. File Name: Single Action Coin Exchanger

    File Submitter: Akinari

    File Submitted: 13 Apr 2013

    File Category: Utilities

    Content Author: Akinari

    Features:

    • Exchange all of a type (Zeny -> Coins) or (Coins -> Zeny) with one user action
    • Provides fail-safe configuration
    • Users see everything that has been exchanged and how much they've exchanged for without unnecessary click actions
    • Requires no script modification if you choose to change the configs

    Configuration:

    OnInit:	//bronze, silver, gold, mithril, platinum	setarray .selections$[0],"Bronze","Silver","Gold","Mithril","Platinum";	setarray .prices[0],10000,100000,1000000,100000000,1000000000;	setarray .items[0],673,675,671,674,677;	.arraysize = getarraysize(.items);	if(.arraysize != getarraysize(.prices)) { //These 2 arrays should be same size		debugmes "Array size for coins: "+.arraysize+" does not match size of price: "+getarraysize(.prices);		.arraysize = 0;	}	else if(.arraysize != getarraysize(.selections$)) { //These 2 arrays should be same size		debugmes "Array size for coins: "+.arraysize+" does not match size of selections: "+getarraysize(.selections$);		.arraysize = 0;	}	end;

    Click here to download this file

  7. I'm reviving this topic because this is still an issue.  I know it's a server-side issue because no other client fixes the problem.  Has anyone gotten farther on what this is?  Anyone know of a way to disable skill cooldown saving on logout?  Maybe that will fix it.

    • Upvote 1
  8. I recently made an NPC that will take most of the hassle out of dealing with guild packages while providing your players with an option to choose their own guild packages through a points system.

     

    Features:

    • 5 options available to make for easy configuration including logging (NPC logmes), special menus, and browsing guilds
    • After initial setup, just follow the NPC's instructions to easily give or remove guild package points
    • Browsing guilds option allows for easy viewing of all guilds and points with menu pages (Not recommended for large servers)
    • Setup is as simple as (ItemID,Cost) array on NPC initialization
    • Automatic SQL table alteration on first NPC initialization (must be done)

     

    Some credits go to Toasty for the menu pages function I modified for the guild browsing option.  Comments/Questions/Suggestions welcome.  You may modify or use any of this script as you please without any limitations.

    guildpack.txt

    • Upvote 1
  9. Made a few fixes to Mora Enchants with the Empowered Staves.  Did not work before.  Removed the quests from first post as they are no longer needed with recent revisions.  Also fixed Misty Forest's quests to not include an unnecessary quest which in new revisions causes an annoying error.

     

    @vpapa

    I haven't had any issues with the instance, but then again, I haven't spent much time after initial release really testing it out.  I was hoping someone else would pick up the project and clean up much of these scripts along with making them more like official servers.

     

    @Euphy

    According to your Script Tasks post you have written "Confirm with all users if they're willing to have their scripts added to the SVN.".  If this includes me, you're more than welcome to modify or release any part of these scripts.

    • Upvote 1
  10. Well it's not about what I think will work necessarily. I don't fully understand what you're aiming to do with this addition. I posted that modification because your first post contained SQL queries which were getting information from character IDs. But you say you want it account based, so that modification really isn't valid. Like I said, making your script use account (#) variables and then pulling from global_reg_table using account ID would probably be easiest.

  11. If you're looking to do an account variable, I suggest using a normal #variable which will update it normally. If you want to add another account variable that's stored within the login table, it's a much more in-depth process from my experience as you would need to pull up the information and store it into the session data using RFIFO and calling it across the servers with WFIFO. That's why using a normal #variable for what you need will probably be your best method, then pulling that information up from the SQL in the global_reg_value table.

  12. It's not necessarily hard to add another char status variable in the source. This might help you with the updating part, and use less queries overall as this method will make your current, OnLogout script void. Untested but should work. You should take the time to make sure it functions as intended. Also, this pulls from char table, so if you do go this route, you'll need to transfer your current bank balance to the char table in the SQL in a new 'bankbalance' collumn.

    mmo.h

    FIND

    #define MAX_QUEST_OBJECTIVES 3 //Max quest objectives for a quest
    

    ADD AFTER

    #define MAX_BANK #### //Replace with a number
    

    FIND

    struct mmo_charstatus {
    int char_id;
    int account_id;
    int partner_id;
    int father;
    int mother;
    int child;
    

    ADD AFTER

    unsigned int bankbalance;
    

    char.c

    FIND

    "`robe`"
    

    REPLACE WITH

     "`robe`,`bankbalance`"
    

    FIND

    || SQL_ERROR == SqlStmt_BindColumn(stmt, 35, SQLDT_SHORT,  &p.robe, 0, NULL, NULL)
    

    ADD AFTER

    || SQL_ERROR == SqlStmt_BindColumn(stmt, 36, SQLDT_UINT,  &p.bankbalance, 0, NULL, NULL)
    

    FIND

     "`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`"
    

    REPLACE WITH

     "`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`,`bankbalance`"
    

    FIND

    || SQL_ERROR == SqlStmt_BindColumn(stmt, 51, SQLDT_SHORT,  &p->robe, 0, NULL, NULL)
    

    ADD AFTER

    || SQL_ERROR == SqlStmt_BindColumn(stmt, 52, SQLDT_UINT,  &p->bankbalance, 0, NULL, NULL)
    

    FIND

     (p->rename != cp->rename) || (p->robe != cp->robe)
    

    REPLACE WITH

     (p->rename != cp->rename) || (p->robe != cp->robe) || (p->bankbalance != cp->bankbalance)
    

    FIND

    "`delete_date`='%lu',`robe`='%d'"
    

    REPLACE WITH

      "`delete_date`='%lu',`robe`='%d',`bankbalance`='%d'"
    

    FIND

      (unsigned long)p->delete_date,  // FIXME: platform-dependent size
      p->robe,
    

    REPLACE WITH

      (unsigned long)p->delete_date,  // FIXME: platform-dependent size
      p->robe, p->bankbalance,
    

    script.c

    Usage:

    bankbalance(+-Value);

    checkbank(); Returns current bank balance

    ADD NEW FUNCTIONS

    BUILDIN_FUNC(bankbalance)
    {
    int num;
    TBL_PC *sd;
    sd = script_rid2sd(st);
    if( sd == NULL )
     return 0;
    num = script_getnum(st,2);
    if(sd->bankbalance - num < 0) {
     ShowError("script:bankbalance: attempting to set bank to lower than 0 %d\n", num);
     return 1;
    } else if(MAX_BANK < num + sd->bankbalance) {
     ShowError("script:bankbalance: attempting to set bank higher than max \n");
     return 1;
    } else
     sd->bankbalance += num;
    return 0;
    }
    
    BUILDIN_FUNC(checkbank)
    {
    int num;
    TBL_PC *sd;
    sd = script_rid2sd(st);
    if( sd == NULL )
     return 0;
    
    script_pushint(st, sd->bankbalance);
    return 0;
    }
    

    BUILDIN_DEF(bankbalance,"i"),
    BUILDIN_DEF(checkbank,""),
    

  13. atcommand.c addition:

    /*===============================================
    * @identifyall
    * => Indentify all items in inventory - Akinari
    *-----------------------------------------------*/
    ACMD_FUNC(identifyall)
    {
    int i,cost=100; // Zeny cost
    nullpo_retr(-1, sd);
    for (i=0; i<MAX_INVENTORY; i++) {
    	if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify!=1) {
    		if((sd->status.zeny < cost) && (pc_get_group_level(sd) < 10)) { //GMs above group 9 bypass zeny check
    			sprintf(atcmd_output, msg_txt(719),cost);
    			clif_displaymessage(fd, atcmd_output);
    			clif_updatestatus(sd,SP_ZENY);
    			return 0;
    		} else if(pc_get_group_level(sd) < 10)
                   sd->status.zeny-=cost;
    		sd->status.inventory[i].identify=1; //I gotta poop, BRB
    		clif_item_identified(sd,i,0);
    	}
    }
    clif_updatestatus(sd,SP_ZENY);
    return 0;
    }
    

    ACMD_DEF(identifyall),
    

    msg_athena.conf addition:

    719: You need %d Zeny to use this function.

    There's a Zeny addition for my server in there. This has only been tested a few times on my test server using GM and non-GM character so try it out. If you don't want a Zeny check, just remove

    		if((sd->status.zeny < cost) && (pc_get_group_level(sd) < 10)) { //GMs above group 9 bypass zeny check
    			sprintf(atcmd_output, msg_txt(719),cost);
    			clif_displaymessage(fd, atcmd_output);
    			clif_updatestatus(sd,SP_ZENY);
    			return 0;
    		} else if(pc_get_group_level(sd) < 10)
    		sd->status.zeny-=cost;
    

    and

    clif_updatestatus(sd,SP_ZENY);
    

  14. Using Arch Linux for the server base, here's a gdb backtrace at a seg fault I got. I am not very knowledgeable about stuff like this and I've taken every step to solve this I can so I need some outside help.

    #0 0x00007ffff62850dc in __memcpy_ssse3_back () from /usr/lib/libc.so.6

    No symbol table info available.

    #1 0x000000000051471a in mob_setlootitem.30721.3978 ()

    No symbol table info available.

    #2 0x0000000000516969 in mob_dead ()

    No symbol table info available.

    #3 0x000000000054bb06 in status_damage ()

    No symbol table info available.

    #4 0x000000000054c64f in status_percent_change ()

    No symbol table info available.

    #5 0x0000000000512906 in mob_ai_sub_hard_slavemob.30753.4045 ()

    No symbol table info available.

    #6 0x000000000051441b in mob_ai_sub_lazy.30606.3991 ()

    No symbol table info available.

    #7 0x00000000005b4dbe in map_foreachmob ()

    No symbol table info available.

    #8 0x0000000000514613 in mob_ai_lazy.30687 ()

    No symbol table info available.

    #9 0x00000000004182c7 in do_timer.2690 ()

    No symbol table info available.

    #10 0x00000000004141c4 in main ()

    No symbol table info available.

    [Error]: Memory manager: args of aFree 0x0x7ff324e7dd8c is invalid pointer pc.c line 7810

    [Error]: Memory manager: args of aFree 0x0x7ff324e0704c is invalid pointer db.c line 1055

    [Error]: Memory manager: args of aFree 0x0x7ff324e0704c is invalid pointer db.c line 1055

    I know most people run seem to run CentOS for these servers, which happens to run glibc-2.5 while Arch Linux is at glibc-2.16. Any help is appreciated.

  15. I was following the other topic about code style here and it ended up simply making the files bigger and source harder to deal with while making more work for people with modifications as stated in the first post in that topic. I can only guess it might have been unintentional, but like Brian, I would have to agree that 4 spaces = tab is the correct way to go. Is there a final verdict on whether the files are staying like this or will it once again be modified?

    • Upvote 4
  16. After 4 grueling days of translation and rewrite, I finally have these scripts in a (sorta) releasable state. Please note that much of the translation was done via line-by-line translations in an online translator, then written by my (and 2 others) interpretation of the translation, so they may not be 100% accurate (SuperHulk also said he wrote it in his own words as well).

    The quests_mora script written by SuperHulk took the most time due a rewrite I had to do to remove all the copypasta. I also wanted it to be an iRO Wiki Mora Enchants replication and many of those features were non-existent within his script. The (somewhat) finished product being my mora_enchant script. I know it probably still needs some work along with adding/removing some text, but so far it seems to be functioning as intended.

    The instance script was left unaltered, aside from translation. Any issues you have with it will have to be fixed by someone else or whenever I get around to checking it out in further detail.

    The file mora.txt within the download has current Mora NPCs in it from the SVN copied over plus SuperHulk's with, of course, translations. Again, these are probably not perfect translations and anyone else can go through and add the correct text. It should, for the most part, be grammatically correct. You should copy over the npc/re/cities/mora.txt with the one in the zip to avoid duplicates.

    So to get on with it, here is the download link. You may post or message me about any issues you run into. I will try to modify the download file when necessary. You are free to use, modify, copy, send, and re-release as you please.

    Edit: Oops. Almost forgot. These quest translations were done by JoWei in the other topic. I take no credit for them.
     

    
    
    
    
    
    
    7211#Misty Forest Labyrinth Exploration#SG_FEEL#QUE_NOIMAGE#
    You have recently entered Misty Forest Labyrinth. Please wait 2 hours and 30 minutes before entering again.#
    #
    7212#Loki's Search#SG_FEEL#QUE_NOIMAGE#
    You met Loki at the entrance of the Labyrinth, he seemed to seek a ^0000FFwomen with long violet hairs^000000. What does it mean? We should tell Loki that we hope to find her.#
    #
    7213#Wandering Protector#SG_FEEL#QUE_NOIMAGE#
    Loki was searching that young women in his dragon form. After leaving the labyrinth, go talk to Loki at Mora.#
    #
    //-- 2010 ¿¡ÇǼҵå 14.1
    1109#Lope & Euridi - The forest survivors#SG_FEEL#QUE_NOIMAGE#
    Go to the Inn at Mora and ask Pitt if he know anything about Lope.#
    Talk to Pitt.#
    1110#Lope & Euridi - The fog's victims#SG_FEEL#QUE_NOIMAGE#
    Pitt thinks Lope is already dead, return to Euridi.#
    Talk to Euridi.#
    1111#Lope & Euridi - The Forest of Fog#SG_FEEL#QUE_NOIMAGE#
    Find ^0000FF30 Lope Clues^000000 and show them to Pitt.#
    Gather 30 Lope Clues.#
    1112#Lope & Euridi - The lost pieces#SG_FEEL#QUE_NOIMAGE#
    Pitt can't help you. You should return to Euridi and see if she can help you with the clues.#
    Talk to Euridi.#
    1113#Lope & Euridi - Lope's Letter#SG_FEEL#QUE_NOIMAGE#
    All the pieces restore a letter meant for Pitt. Return to Pitt to show him the personnal letter.#
    Talk to Pitt.#
    1114#Lope & Euridi - The sacrifice's cost#SG_FEEL#QUE_NOIMAGE#
    Pitt gave you Lope's Ring and confessed about what happened. You should tell the whole story to Euridi.#
    Talk to Euridi.#
    1115#Lope & Euridi - The Abyss sound#SG_FEEL#QUE_NOIMAGE#
    Black Shadow says that there was a suspicious man near the entrance of the forest. You didn't know?#
    #
    1116#Lope & Euridi - The thruth#SG_FEEL#QUE_NOIMAGE#
    You found Lope but he told you to relay to Euridi that he wants to live with the monsters. He can no longer be with her like he said so much he would in the past.#
    Talk to Euridi.#
    1117#Lope & Euridi - The fake promise of eternity#SG_FEEL#QUE_NOIMAGE#
    Euridi didn't took the information about Lope well and gave back Lope's Ring to you... Talk to Euridi's friend.#
    Talk to Black Shadow.#
    1118#Neighborhood Knight#SG_FEEL#QUE_NOIMAGE#
    Collect 30 Lope's clues. The leader of the Neighborhood Knights want to restore the letter written by Lope.#
    Gather 30 Lope's Clue.#
    1119#Neighborhood Knight#SG_FEEL#QUE_NOIMAGE#
    Collect 200 Mysterious seeds. The leader of the Neightborhood Knights didn't want to give you anymore information about the mission.#
    Gather 200 Mysterious Seeds.#



    Download mora.zip

    Edit: Messed up an exp function in mora.txt. Sorry about that. Forgot to fix before release. Probably some other small errors.

    mora.zip

    • Upvote 5
×
×
  • Create New...