Jump to content

KirieZ

Core Developers
  • Content Count

    211
  • Joined

  • Last visited

  • Days Won

    17

Posts posted by KirieZ


  1. It should be exactly like adding any item. You have to put the .spr file in the sprite directory as you did and also the item and collection bmp in texture folder. Iirc they are:

    texture/À¯ÀúÀÎÅÍÆäÀ̽º/item/<item name>.bmp  --> the sprite that appears in yor inventory
    texture/À¯ÀúÀÎÅÍÆäÀ̽º/collection/<item name>.bmp  --> the image that appears when you right click

     


  2. @fiction

    I finally got to my pc and could test it...

    The only issue I found is that when I run mapcache plugin it shows the error that it haven't found the group, but mapcache plugin kills map-server after adding the map. After the map is added and I properly start the server (this time without map-cache plugin), I don't get any errors and the drops does work. Tried on both pre-re and re.

    Is this the issue you found?

    I've copy pasted your example and it also works (diff attached).

    Edit: It probably doesn't matter but in my test I've used this "vip" map: https://herc.ws/board/files/file/73-vip-room-indoor/

    random_opt_drop_groups.diff


  3. If I recall correctly emperium does have some special behavior for WoE (I don't recall if this behavior is activated by some woe mapflag or by gvg map flag), did you try with other mobs? And I think there are something gvg (or woe) related that hides your real damage (e.g. display 1 to client while actually causing real damage -- I think there is a battle conf for that). One way to test would be to try on a poring or some other weak monster and check if you'll kill it in one hit.


  4. As of Release v2019.05.05 you can now create groups of random options that may be assigned to items dropped by monsters.

    In order to use it you must first create an Option drop group in db/option_drop_groups.conf, one group will set how each option slot is filled, the chance of it getting filled, etc. Each group has the following structure:

    	<Group Name Constant>: (
    		{ // Option Slot 1
    			Rate: (int) chance of filling option slot 1 (100 = 1%)
    
    			// Possible options for slot 1
    			// min/max value : int, defaults to 0
    			// chance : int, 100 = 1% if not set, will be 100%/number of possibiltiies
    			OptionName: value
    			// or
    			OptionName: [min value, max value]
    			// or
    			OptionName: [min value, max value, chance]
    			// ...  (as many as you want)
    		},
    		// ... (up to MAX_ITEM_OPTION)
    	),

    Details about this file may be found on Hercules' docs (doc/option_drop_group.md). This is an example group called MYGROUP:

    MYGROUP: (
    	{ /* Option Slot 1 */
    		Rate: 10000 /* It has 100% of chance of being filled */
    
    		/* This slot may have one of the following options: */
    		WEAPON_ATTR_WIND: 5                 /* WEAPON_ATTR_WIND Lv5 (33.33%) */
    		WEAPON_ATTR_GROUND: [2, 4]          /* WEAPON_ATTR_GROUND Lv 2~4 (33.33%) */
    		WEAPON_ATTR_POISON: [1, 4, 8000]    /* WEAPON_ATTR_POISON Lv 1~4 (80%) */
    	},
    	{ /* Option Slot 2 */
    		Rate: 5000 /* It has 50% of chance of being filled */
    
    		/* If filled, may have one of the following options: */
    		WEAPON_ATTR_WATER: 4     /* WEAPON_ATTR_WATER Lv4 (100%) */
    	}
    )

    Once a group is defined, you can them assign it to monster drops in mob database by using a new syntax that works for both Drops and MvpDrops:

    AegisName: (chance, "GROUP_NAME")

    This will set that the item AegisName has chance chance of drop (like we already know from the format already in use), and, when dropped it will get random options as specified by the group GROUP_NAME.

    For example:

    Knife: (5000, "MYGROUP")

    Will make "Knife" be dropped with a chance of 50%, and when dropped it will get options as defined by MYGROUP option group, in other words, the first slot will be filled with Wind, Ground or Poison option, and the second slot may or may not be filled with Water option.

    This feature should work on any client that supports item random options.


  5. Hmm I think you can't get the hash when you download the zip, but I'll assume it was the latest stable.

    Did you set ips for map/char server on their conf files? Try letting ips commented out or change then to 127.0.0.1 for testing. It looks like your map-server is not able to reach char-server in this ip.

     


  6. What about this?

    	setarray(.@costume[1], EQI_COSTUME_HEAD_TOP, EQI_COSTUME_HEAD_MID, EQI_COSTUME_HEAD_LOW, EQI_COSTUME_GARMENT);
    	.@menu$ = "";
    	for (.@i = 1; .@i < getarraysize(.@costume$); ++.@i)
    		.@menu$ += ((getequipisequiped(.@i)) ? getequipname(.@costume[.@i]) : "" + .@costume[.@i] + "-[Not equipped]") + ":";
    	// Select the part.
    	.@equip_index = select(.@menu$);

     


  7. If I understood correctly your question, you can left the menu entry empty and client will "count" it but not display it. Example:

    .@menu$ = "Opt1:";
    if (#myvar)
    	.@menu$ = .@menu$ + "Opt2";
    .@menu$ = .@menu$ + ":Opt3";
    
    // So we will get one of these
    // - Opt1:Opt2:Opt3
    // 		In this case it shows Opt1 (case1), Opt2 (case2), Opt3(case3)
    // - Opt1::Opt3 <- Note the ::
    // 		In this case it shows Opt1 (case1), Opt3(case3)
    
    switch (select(.@menu$)) {
      case 1: // Opt1
        break;
      case 2: // Opt2
        break;
      case 3: // Opt3
        break;
    }

     


  8. I haven't tested, but try this:

    src/map/battle.c search:

    		if (wd.flag & BF_WEAPON && src != target && damage > 0) {
    			if (battle_config.left_cardfix_to_right)
    				battle->drain(sd, target, wd.damage, wd.damage, tstatus->race, is_boss(target));
    			else
    				battle->drain(sd, target, wd.damage, wd.damage2, tstatus->race, is_boss(target));
    		}

    change to (first line)

    		if (src != target && damage > 0) {
    			if (battle_config.left_cardfix_to_right)
    				battle->drain(sd, target, wd.damage, wd.damage, tstatus->race, is_boss(target));
    			else
    				battle->drain(sd, target, wd.damage, wd.damage2, tstatus->race, is_boss(target));
    		}

     


  9. When you change the value on source, you have to update your registry instead of the sd-> variable.

    Example:

    pc_setglobalreg(sd,script->add_variable("TRAINING_POINT"), sd->training_point + pontos);

    This would update both the script var and your sd-> data.

    Also, your atcommand has some issues:

    1. sscanf

    pontos = sscanf(message, "%12d", &pontos);
    
    // should be
    sscanf(message, "%12d", &pontos);

    because sscanf will set values from string in the pointers passed by parameter. sscanf return is actually how many of these variables were filled (in this case it would always set "pontos" to 1 if you gave one number in the command). (Reference: http://www.cplusplus.com/reference/cstdio/sscanf/ )

    2. 
     

    clif->message( fd, resultado + "/200"); // message - show points

    C doesn't let you concat strings like that. You would need to use something like sprintf (Reference: http://www.cplusplus.com/reference/cstdio/sprintf/ ) to make a string to hold your value. Take a look on costume atcommand, it uses a safe version of sprintf. Something like: (untested)

    	// Where your str will be stored
    	char buffer [50];
    	
    	// writes into buffer a string in the format %d/200, where %d is the value of "resultado"
    	sprintf (buffer, "%d/200", resultado); 
    
    	// sends string to client
    	clif->message(fd, buffer);

    -------

    If you fix the pc_setregistry you'll be able to use your TRAINING_POINT in scripts like:

    prontera,150,150,4	script	TestGet	1_M_01,{
    	mes "Hi";
    	mes "> " + TRAINING_POINT;
    	close;
    }
    
    prontera,150,152,4	script	TestSet	1_M_01,{
    	mes "Hi";
    	TRAINING_POINT++;
    	close;
    }

     

×
×
  • Create New...

Important Information

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