Jump to content

mawjustin

Members
  • Posts

    121
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by mawjustin

  1. Hi Team,

    I would like to ask if its possible to have a copy of your latest accessoryid.lub for lua files inside .grf?

    image.png.7967f1646c9239cc077cce8ef7f0e151.png

    The one I got is only up to 2203, I was wondering if somebody got a complete copy of this as it is painful to add these items manually.

    image.png.b6293d9121d76b4d3db8f7e3a0fe7da7.png

     

    This is the renewal item that I'm trying to get, along with other items available on 2023 data.grf and rdata.grf

     

    image.png.a68592998c41ae2467748a921ee1bd6b.png

     

    Thank you.

  2. 6 hours ago, Vichomax14 said:
    (getiteminfo(getequipid(EQI_HAND_L),ITEMINFO_TYPE)

    getiteminfo = Returns some values of an item. Price, Weight, etc... (info of Doc)
    getequipid = Returns id from specific part of equipment.
    ITEMINFOTYPE = type of equipment, can be a weapon or armor(shield).

    I hope it helps you.


    Thank you!

  3. Hi Team,

     

    Is it possible to check if the equipped item in Left Hand is a Weapon or a Shield?
    I'm trying to separate the Enchantments for Weapon and Shield.

    If I will use EQI_HAND_L as a parameter Sinx can easily bypass this by wearing 2 weapons left and right.
    I want to add a scan if the selected equipment is a Shield type.

     

    Thank you.

  4. Hi Team,

    May I ask if this is possible?

    Scenario:

    I am killing/attacking a Poring.

    Poring drops a slotted knife, jellopy, apple, empty bottle, mucus, etc. based on chance.

    A script will then check if the item dropped is a weapon, armor, consumable, or an etc.

    After checking the item dropped, it will then check if the equipment (weapon, armor, etc) is a Level 1 to Level 4 equipment.

    After checking the equipment dropped, it can then check if the item is a dagger class, a spear class, or a rod class, etc.

     

    Basically what I want to do is to check if the item dropped by a monster is an equipment, if its an equipment, I then want to check what type of equipment it is (dagger, sword, rod, etc.), after that I want to check what level is the equipment (Level 1 to Level 4).

     

    Is this possible?

     

    I'm planning on doing this in script instead of manually checking the mob_db.yml.

    Thank you.

     

  5. sample in /npc/custom/barter.yml.

    # This file is a part of rAthena.
    #   Copyright(C) 2022 rAthena Development Team
    #   https://rathena.org - https://github.com/rathena
    #
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program. If not, see <http://www.gnu.org/licenses/>.
    #
    ###########################################################################
    # Barter Database
    ###########################################################################
    #
    # Barter Settings
    #
    ###########################################################################
    #  - Name               NPC name.
    #    Map                Map name. (Default: not on a map)
    #    X                  Map x coordinate. (Default: 0)
    #    Y                  Map y coordinate. (Default: 0)
    #    Direction          Direction the NPC is looking. (Default: North)
    #    Sprite             Sprite name of the NPC. (Default: FakeNpc)
    #    Items:             List of sold items.
    #      - Index          Index of the item inside the shop. (0-...)
    #                       Maximum index depends on client.
    #        Item           Aegis name of the item.
    #        Stock          Amount of item in stock. 0 means unlimited. (Default: 0)
    #        Zeny           Cost of them item in Zeny. (Default: 0)
    #        RequiredItems: List of required items (Optional)
    #          - Index      Index of the required item. (0-4)
    #            Item       Aegis name of required item.
    #            Amount     Amount of required item. (Default: 1)
    #            Refine     Refine level of required item. (Default: 0)
    ###########################################################################
    
    Header:
      Type: BARTER_DB
      Version: 1
    
    
    Body:
      - Name: barter_refine_11
        Map: prontera
        X: 150
        Y: 150
        Direction: South
        Sprite: 1_etc_01
        Items:
          - Index: 0
            Item: Oridecon
            RequiredItems:
              - Index: 0
                Item: Oridecon_Stone
                Amount: 5
          - Index: 1
            Item: Elunium
            RequiredItems:
              - Index: 0
                Item: Elunium_Stone
                Amount: 5
          - Index: 2
            Item: Bradium
            Zeny: 50000
            RequiredItems:
              - Index: 0
                Item: Oridecon
                Amount: 3
          - Index: 3
            Item: Carnium
            Zeny: 50000
            RequiredItems:
              - Index: 0
                Item: Elunium
                Amount: 3
          - Index: 4
            Item: Carnium
            Zeny: 50000
            RequiredItems:
              - Index: 0
                Item: Purified_Bradium

    image.png.9f762c3eb772dc4aac1db0a51e5362b6.png

    image.png.08987c587420931cc047b85be50d3070.png

    • Upvote 1
    • MVP 1
  6. Hi Team,

    How do we remove a specific random option only? I understand that we can just reroll it instead of removing, but I'm curious if we can only remove it instead of reroll.

    Example: I want to remove Max HP +1 only.

    image.png.9aaa897dbf03872e44f3d86ecf2df8db.png

    This script does not work.

    .enval = 0;
    .randomizedfinal = 0;
    setrandomoption(.part,.enindex,.randomizedfinal,.enval,0);


    image.png.88c87db7467012d1d09c66b93dced05b.png

    Is there a way to do this via script? or if not can we do this via db?

     

    Thank you.

  7. Hi Team,

    How do we merge arrays and use them as a single array?

    Example:

            setarray .attr1[0],4700,4701,4702,4703,4704,4705,4706,4707,4708,4709;
            setarray .attr2[0],4730,4731,4732,4733,4734,4735,4736,4737,4738,4739;
            setarray .attr3[0],4740,4741,4742,4743,4744,4745,4746,4747,4748,4749;
            setarray .attr4[0],4710,4711,4712,4713,4714,4715,4716,4717,4718,4719;
            setarray .attr5[0],4720,4721,4722,4723,4724,4725,4726,4727,4728,4729;
            setarray .attr6[0],4750,4751,4752,4753,4754,4755,4756,4757,4758,4759;

    I want to use them as 

           setarray .combinedArray[0], attr1, attr2, attr3, attr4, attr5, attr6;

    This way I can only modify a specific attribute if necessary without affecting the entire list of array, as the other .attr arrays are used in other functions.

     

    Thank you.

  8. Hi Team,

    May I ask if this is possible?

    I have a sample here that requires user to select which choice a player will choose.

    image.png.927f2266baa392c02ccf8548aa5d45d6.png

    Instead of selecting from switch expression, can we randomize this without changing the switch statement?

    The script will randomly choose from Case 1 to Case 4 without changing the switch statement.

    Is this possible?


    switch(expression) {
      case x:
        // code block
        break;
      case y:
        // code block
        break;
      default:
        // code block
    }

     

    Thank you.

  9. Hi Team,

     

    May I ask on how we can detect if the random option is already assigned in either 1st to 5th random option slot?

    I'm trying to avoid duplicate random option on mob drops.

    I've used this post of mine as reference, random option is working.

    My problem now is I cannot stop the duplication of random option, the random option always ends up being duplicated on either 1st to 5th slot.

     

    I'm using this line. What I would like to achieve is that if the code detects the same random option id on the 1st to 5th slot, it will either break it, or reroll and add another random option.

    Random Option must be unique and does not have a duplicate on all slots.

    On 10/3/2020 at 7:38 AM, -to- said:

    I needed a quick change to make something like this work.... It might help you:
    You just need to replace the function void itemdb_add_randomopt(struct item *it) in itemdb.cpp and recompile. It makes 1random option 100%, 2nd 80%, 3rd 60% and so on...

     

    void itemdb_add_randomopt(struct item *it)
    {
    	struct item_data *id;
    	struct s_random_opt_group *randomopt_group;
    	int i;
    
    	if (!it || !it->nameid || (id = itemdb_exists(it->nameid)) == NULL)
    	{
    		return;
    	}
    
    	for (i = 0; i < MAX_ITEM_RDM_OPT; i++)
    	{
    		if (id->randomopt_groupid[i] && ((randomopt_group = itemdb_randomopt_group_exists(id->randomopt_groupid[i])) != NULL))
    		{
    
    			int rndOpt = rnd() % (MAX_ITEM_RDM_OPT);
    
    			if (i > 0)
    			{
    				if ((i > 3 && rndOpt < 4) || (i > 2 && rndOpt < 3) || (i > 1 && rndOpt < 2))
    					break;
    				if (rndOpt < 1)
    					break;
    			}
    			int rnd_value = rnd() % (randomopt_group->total_weight);
    			int total = 0;
    			int j;
    
    			for (j = 0; j < randomopt_group->total; j++)
    			{
    				total += randomopt_group->entries[j].weight;
    
    				if (rnd_value < total)
    				{
    					it->option[i].id = randomopt_group->entries[j].option.id;
    
    					if (randomopt_group->entries[j].max_value > 0 && randomopt_group->entries[j].max_value != randomopt_group->entries[j].option.value)
    					{
    						int max = randomopt_group->entries[j].max_value;
    						int min = randomopt_group->entries[j].option.value;
    
    						it->option[i].value = rnd() % (max - min + 1) + min;
    					}
    					else
    					{
    						it->option[i].value = randomopt_group->entries[j].option.value;
    					}
    
    					it->option[i].param = randomopt_group->entries[j].option.param;
    					break;
    				}
    			}
    		}
    	}
    }

    In item_randomopt_equips.txt you cannot duplicate any RandomOption_GroupId in the same item. You can use something like this:

    1202,RDMOPT_Weapon_Tier1_Slot1,RDMOPT_Weapon_Tier1_Slot2,RDMOPT_Weapon_Tier1_Slot3,RDMOPT_Weapon_Tier1_Slot4,RDMOPT_Weapon_TierSpecial_Slot5

    If you want a item to have less than 5 options, you just need to remove the option from this file.

    Thank you.

  10. 30 minutes ago, Litro Endemic said:

    element like fire, wind and water? if yes, there is no available script command for that, since element is script based not field member of item, you need to create indexes your self for it

    I see, I guess I that's the only option for now.

  11. Hi Team,

    I tried checking on rathena document, but I am unable to find the following, I'm not sure if I am looking in the wrong files or data:

    1. How to check Random Option Element either from 1-5?
    2. How to check Armor Element?
    3. How to check Card slotted element?

    Thank you in advance.

  12. For IP, time_created, and redeem_time problems use this.

     

    /*
    DROP TABLE IF EXISTS `reward_codes`;
    DROP TABLE IF EXISTS `reward_logs`;
    CREATE TABLE IF NOT EXISTS `reward_codes` (
    	`promo` VARCHAR(26) NOT NULL DEFAULT '',
    	`nameid` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    	`item_name` VARCHAR(50) NOT NULL DEFAULT '',
    	`amount` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',
    	`time_created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    	`limit` INT(10) UNSIGNED NOT NULL DEFAULT '0',
    	`pool` INT(10) UNSIGNED NOT NULL DEFAULT '0',
    	PRIMARY KEY (`promo`)
    ) ENGINE = MYISAM;
    CREATE TABLE IF NOT EXISTS `reward_logs` (
    	`account_id` int(11) unsigned NOT NULL default '0',
    	`last_ip` BINARY( 15 ) NOT NULL,
    	`code` VARCHAR( 26 ) NOT NULL,
    	`redeem_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    	`claim` INT( 10 ) NOT NULL,
    	PRIMARY KEY (`code`)
    ) ENGINE = MYISAM;	
    */

     

×
×
  • Create New...