Jump to content
  • 0

Custom Branch group new rathena


Question

Posted (edited)

I just want to know if the process that I am doing is the correct to add a new custom branch into my server in the lasted version of rAthena, because I saw the others requests about the topic are really outdated.
this is my process:

 

for now I only have 4 mvps in the pool of the branch to summon, for test, I dont know if that is the problem

I didnt find in mob.h this variable
 

#define MAX_RANDOMMONSTER 5

this is my steps.
in mob.c I add this line
sv_readdb(dbsubpath2, "mob_boss_G01.txt", ',', 4, 4, -1, &mob_readdb_group, silent);

and 
if (type == MOBG_Bloody_Dead_Branch && flag&RMF_MOB_NOT_BOSS)
        flag = static_cast<e_random_monster_flags>(flag&~RMF_MOB_NOT_BOSS);

if (type == MOBG_G_D_Branch_01 && flag&RMF_MOB_NOT_BOSS)
        flag = static_cast<e_random_monster_flags>(flag&~RMF_MOB_NOT_BOSS);

 

in mob.h
enum e_random_monster : uint16 {
    MOBG_Branch_Of_Dead_Tree = 0,
    MOBG_Poring_Box,
    MOBG_Bloody_Dead_Branch,
    MOBG_Red_Pouch_Of_Surprise,
    MOBG_ClassChange,
    MOBG_Taekwon_Mission,
    MOBG_G_D_Branch_01,
};

and I crete in db\re
mob_boss_G01.txt

and added the boss like this.
MOBG_G_D_Branch_01,1582,Deviling,1000000

in the mob_summon.yml I add this.
Body:
  - Group: G_D_Branch_01
    Default: MAYA
    Summon:
      - Mob: MAYA
        Rate: 100000
      - Mob: DEVILING
        Rate: 700000
      - Mob: Drake
        Rate: 700000
in item_db_usable.yml 
  - Id: ****
    AegisName: name
    Name: name
    Type: Usable
    Buy: 10000
    Weight: 200
    Flags:
      BuyingStore: true
      DeadBranch: true
    Script: |
      monster "this",-1,-1,"--ja--",-1-MOBG_G_D_Branch_01,1,"";

and in item_db.txt (I dont know if this is necesary with the YML structure in use).


***,name,name,2,10000,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ monster "this",-1,-1,"--ja--",-1-MOBG_G_D_Branch_01,1,""; },{},{}

Declare in script_constants.hpp

/* mob random groups */
	export_constant(MOBG_Branch_Of_Dead_Tree);
	export_constant(MOBG_Poring_Box);
	export_constant(MOBG_Bloody_Dead_Branch);
	export_constant(MOBG_Red_Pouch_Of_Surprise);
	export_constant(MOBG_ClassChange);
        export_constant(MOBG_G_D_Branch_01);

 

after I did that I got this error.

mob_get_random_id: Invalid type (6) of random monster.

I want to know if that is the correct process to do that, or what is my mistake.

I remember 1 time work for me, but I couldnt edit the rate of the MVPs or add new MVPs

Edited by f_fman
  • Upvote 1

5 answers to this question

Recommended Posts

  • 1
Posted (edited)

To add a custom monster summon branch, the steps are:

  1.  Add MOBG_G_D_Branch_01 before MOBG_MAX in https://github.com/rathena/rathena/blob/2f311bd1ef6abf0de642f93690eb37bebbb34d14/src/map/mob.hpp#L116
  2.  Add MOBG_G_D_Branch_01 after export_constant(MOBG_TAEKWON_MISSION); in https://github.com/rathena/rathena/blob/2f311bd1ef6abf0de642f93690eb37bebbb34d14/src/map/script_constants.hpp#L4625
  3. After compiling your server should have created a folder named "import". Add your custom branch data in import/mob_summon.yml
Header:
  Type: MOB_SUMMONABLE_DB
  Version: 1

Body:
  - Group: G_D_Branch_01
    Default: MAYA
    Summon:
      - Mob: MAYA
        Rate: 100000
      - Mob: DEVILING
        Rate: 700000
      - Mob: Drake
        Rate: 700000

      4. In import/item_db.yml

  - Id: ****
    AegisName: name
    Name: name
    Type: Usable
    Buy: 10000
    Weight: 200
    Flags:
      BuyingStore: true
      DeadBranch: true
    Script: |
      monster "this",-1,-1,"--ja--",-1-MOBG_G_D_Branch_01,1,"";

 

All other steps are unnecessary (I think you just forgot to compile according to the error in your first post).

Edited by Capuche
  • Upvote 2
  • MVP 1
  • 0
Posted (edited)
2 hours ago, BeWan said:

why dont you create script and put it on rand? and then use oncall function to your new branch item?

@BeWan can you explain me how to do that, I never did that before.

Edited by ffman22
  • 0
Posted (edited)
function	script	LHZ_Boss	{

OnInit:
set .mob_id, rand(1646,1651);

or if you want different id you can use f_rand

.mob_id = callfunc("F_Rand",1,2,3,4,5,6,7,11,10,9);


  monster "this", -1,-1, "--ja--", .mob_id[.@s], 1, "";


}

For ITEMDB

callfunc "LHZ_Boss";

 

Edited by BeWan
  • Upvote 1
  • 0
Posted (edited)
On 7/14/2021 at 4:55 AM, BeWan said:
function	script	LHZ_Boss	{

OnInit:
set .mob_id, rand(1646,1651);

or if you want different id's you can use f_item

.mob_id = callfunc("F_Rand",1,2,3,4,5,6,7,11,10,9);


  monster "this", -1,-1, "--ja--", .mob_id[.@s], 1, "";


}

For ITEMDB

callfunc "LHZ_Boss";

 

ok thanks you, and in the case that I need to get a parameter to select the random group that I want to use? like example

callfunc "LHZ_Boss(1)";
because I want to use the same fuction in diferent branches.

I am trying something like this 

function active_branch { if(getarg(0)==1){ setarray .mvpid[0],1147,1582,1492,1112; } monster "this",-1,-1,"--ja--",.mvpid[rand(4)],1,""; }

function    active_branch    {
    if(getarg(0)==1){
        setarray .mvpid[0],1147,1582,1492,1112;
        }
     monster "this",-1,-1,"--ja--",.mvpid[rand(4)],1,"";
}

 

 

I am getting this error, 

buildin_callfunc: Function not found!


I include my script in the script_custom.conf
like this.

npc: npc/custom/branch_script.txt

 

 

On 7/14/2021 at 5:46 AM, Capuche said:

export_constant(MOBG_TAEKWON_MISSION

 

On 7/14/2021 at 5:46 AM, Capuche said:

To add a custom monster summon branch, the steps are:

  1.  Add MOBG_G_D_Branch_01 before MOBG_MAX in https://github.com/rathena/rathena/blob/2f311bd1ef6abf0de642f93690eb37bebbb34d14/src/map/mob.hpp#L116
  2.  Add MOBG_G_D_Branch_01 after export_constant(MOBG_TAEKWON_MISSION); in https://github.com/rathena/rathena/blob/2f311bd1ef6abf0de642f93690eb37bebbb34d14/src/map/script_constants.hpp#L4625
  3. After compiling your server should have created a folder named "import". Add your custom branch data in import/mob_summon.yml
Header:
  Type: MOB_SUMMONABLE_DB
  Version: 1

Body:
  - Group: G_D_Branch_01
    Default: MAYA
    Summon:
      - Mob: MAYA
        Rate: 100000
      - Mob: DEVILING
        Rate: 700000
      - Mob: Drake
        Rate: 700000

      4. In import/item_db.yml

  - Id: ****
    AegisName: name
    Name: name
    Type: Usable
    Buy: 10000
    Weight: 200
    Flags:
      BuyingStore: true
      DeadBranch: true
    Script: |
      monster "this",-1,-1,"--ja--",-1-MOBG_G_D_Branch_01,1,"";

 

All other steps are unnecessary (I think you just forgot to compile according to the error in your first post).

thank you for the answer, I just notice that my emulator doesnt have the MOBG_MAX in the list
 

/// Random Monster Groups
enum e_random_monster : uint16 {
	MOBG_Branch_Of_Dead_Tree = 0,
	MOBG_Poring_Box,
	MOBG_Bloody_Dead_Branch,
	MOBG_Red_Pouch_Of_Surprise,
	MOBG_ClassChange,
	MOBG_Taekwon_Mission,
};

in that case I just need to add it after MOBG_Taekwon_Mission, ?

 

Edited by ffman22

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...