Jump to content
  • 0

Mob Controller for event!


danielps

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

Hi guys!

What i wanna do is "simple". I want to creat 2 teams, team A and team B. Both are composed with players and mobs. I want to somehow each team dont kill themselves, like this:

Team A:
- Mob A (can't attack other mobs a and players a )
-Player A (can't attack other players a and mobs a )

 

Team B:
- Mob B (can't attack other mobs b and players b )
-Player B (can't attack other players b and mobs b )

 

I basicly wanna do a moba... I'm good with script, but i'm limited to the src commands we have in the emulator... I think i need some src modifications to do that moba event (like dota or lol)...

I need to create 2 teams and prevent them to hit each other, no matter if it's a plyaer or a creep, it can't hit a creep or player from same team.

After that i just need to control the mobs (creeps/minion), sent them to the fight and atack when see a enemi tower, player or creep/minion in his path.

I Just need a way to do that, i know exacly how to do with script, but we don't have commands and functions in src that allow me to do so...

So any ideia ? I'm not good with src =/

Thanks a lot for helpping!

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   16
  • Joined:  09/26/16
  • Last Seen:  

have you tried bg_monster and bg_monster_set_team?

well since you claimed you're "good" with script, no need for explanation. ^_^

Edited by Athan17
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  383
  • Reputation:   121
  • Joined:  03/31/12
  • Last Seen:  

It requires source modification.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

11 hours ago, Athan17 said:

have you tried bg_monster and bg_monster_set_team?

well since you claimed you're "good" with script, no need for explanation. ^_^

Yeah.. the problem is:
1- BG mobs don't atack other BG mobs.. like Team A mobs don't atack Team B mobs =/

2- How to control them? Like, i want them to go to a especific point in the map, and the mobs should atack bg players enemis or gb mobs enemis, how to control the mobs to sttop walking and atack if see any of player or bg mob enemi?

3- My bg don't start =/ I set the waiting room, and when it is full (2 v 2) it creates the gb teams and warp both teams to map, but it's not working.. is it wonrg?

//create teams

set $@lol_team1, waitingroom2bg("lol",59,156,"Moba::OnQuit","Moba::OnDie");

//warp them

bg_warp $@lol_team1,"lol",49,156; 

Full script atached...

9 hours ago, Azeroth said:

It requires source modification.

What kind of mod ? Any sugestion?

What if we duplicate the guild? Like, i want a command to creat a second guild, so that way i can creat guild for players and it won't affect the original guild of players... Is it hard to do? But in this way, we should do another mod, to control mobs, so that they don't attack players from a especific guild, attack mobs and players from enemi guild etc..

What is the complexity for that? any help please?

Sorry for bad my english guys, i'm frmo brazil! Thanks a lottt !!!

moba.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

On 09/01/2017 at 0:43 AM, Athan17 said:

have you tried bg_monster and bg_monster_set_team?

well since you claimed you're "good" with script, no need for explanation. ^_^

 

On 09/01/2017 at 2:54 AM, Azeroth said:

It requires source modification.

I did many tests here.. and i have 2 points..

1- BG mobes don't atack each other.. like, gb mobs from different teams of bg, they dont attack each other... any sugestion?

2- After sent a mob to a point, if he see a player anemi he stops and attack, but how to do the mob to afet kill the enemi, he come back to his path walking to his destiny?

I think it needs a src mod, right? Or there is a script command to that?

Thanks guys!

Edited by danielps
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  383
  • Reputation:   121
  • Joined:  03/31/12
  • Last Seen:  

36 minutes ago, danielps said:

 

I did many tests here.. and i have 2 points..

1- BG moves don't atack each other.. like, gb mobs from different teams of bg, they dont attack each other... any sugestion?

2- After sent a mob to a point, if he see a player anemi he stops and attack, but how to do the mob to afet kill the enemi, he come back to his path walking to his destiny?

I think it needs a src mod, right? Or there is a script command to that?

Thanks guys!

Try this mate:

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

10 hours ago, Azeroth said:

Try this mate:

 

 

Annie is off of rathena nad herc for a loong time...

Can't ask her help =/

 

@Playtester Can you help me bro? please?

I need help eiwht 2 points and said before =/
Can't find a script to solve that, will i need a src modification? If so, what do you sugest?

Thankss!!

Edited by danielps
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  802
  • Reputation:   229
  • Joined:  01/30/13
  • Last Seen:  

It's complex, I don't really have time for this.

You'll need to try around yourself in the source code.

You could try change:

int battle_check_target( struct block_list *src, struct block_list *target,int flag)

This one is called for flag = BCT_ENEMY. You will want to write it so that it returns true if the monster can attack another monster. I don't really know more about it either.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

On 10/01/2017 at 7:08 PM, Playtester said:

It's complex, I don't really have time for this.

You'll need to try around yourself in the source code.

You could try change:


int battle_check_target( struct block_list *src, struct block_list *target,int flag)

This one is called for flag = BCT_ENEMY. You will want to write it so that it returns true if the monster can attack another monster. I don't really know more about it either.

It kind of worked... but why can't i do gb mobs atack each other?

Like, the mobs are not in the same bg team, they are in a posite team, however thay don't atack each other, even with setunitdata mode -> canattack =/
 

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  802
  • Reputation:   229
  • Joined:  01/30/13
  • Last Seen:  

Even though you rewrote battle_check_target to return true in that situation?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

13 hours ago, Playtester said:

Even though you rewrote battle_check_target to return true in that situation?

No i was talking about item 2, when mob attack an enemi i managed do them come back to their paths...

But this one, i don't know how to do that, cause i'm good with script but not with src, i'll try right now and tell you. It would be like that ?

case BL_MOB:
        {
            struct mob_data *md = ((TBL_MOB*)target);

            //if (ud && ud->immune_attack) < ------------------------------------------ COMMENTED
                //return 0; < ------------------------------------------------------------------ COMMENTED
            if(((md->special_state.ai == AI_SPHERE || //Marine Spheres
                (md->special_state.ai == AI_FLORA && battle_config.summon_flora&1)) && s_bl->type == BL_PC && src->type != BL_MOB) || //Floras
                (md->special_state.ai == AI_ZANZOU && t_bl->id != s_bl->id) || //Zanzou
                (md->special_state.ai == AI_FAW && (t_bl->id != s_bl->id || (s_bl->type == BL_PC && src->type != BL_MOB)))
            ){    //Targettable by players
                state |= BCT_ENEMY;
                strip_enemy = 0;
            }
            break;
        }

If i comment those lines it will work? It so, will it have any other impacts in the game or only bg mobs will attack other bg mobs from other teams and just that?

Thanks! +1 for helping, even if it don't work!
I'm tryind this right now...

Edited by Emistry
Please use CODEBOX.
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  802
  • Reputation:   229
  • Joined:  01/30/13
  • Last Seen:  

It doesn't has much to do with immune attack.

I didn't try around with that code too much but if you always set state |= BCT_ENEMY there, then I think monsters will always attack each other.

If you find a good condition you can write for that you could pull it off.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

11 hours ago, Playtester said:

It doesn't has much to do with immune attack.

I didn't try around with that code too much but if you always set state |= BCT_ENEMY there, then I think monsters will always attack each other.

If you find a good condition you can write for that you could pull it off.

So where do i have to change? You said u didnt try arround there, ok but i'm not good with src, so u still better tham me lol hehe

I Have some sugestions, here ?

Or maybe here:

switch( t_bl->type ) {
            case BL_MOB: // Source => PC, Target => MOB
                if ( pc_has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVM) ) <<<<<<<<<<----------------------------------- ????
                    return 0;
                break;
            case BL_PC:
                if (pc_has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVP))
                    return 0;
                break;
            default:/* anything else goes */
                break;
        }
case BL_MOB:
        {
            struct mob_data *md = ((TBL_MOB*)target);

            if (ud && ud->immune_attack)
                return 0;
            if(((md->special_state.ai == AI_SPHERE || //Marine Spheres
                (md->special_state.ai == AI_FLORA && battle_config.summon_flora&1)) && s_bl->type == BL_PC && src->type != BL_MOB) || //Floras
                (md->special_state.ai == AI_ZANZOU && t_bl->id != s_bl->id) || //Zanzou
                (md->special_state.ai == AI_FAW && (t_bl->id != s_bl->id || (s_bl->type == BL_PC && src->type != BL_MOB)))
            ){    //Targettable by players
                state |= BCT_ENEMY;
                strip_enemy = 0; <<<<<<<<<<----------------------------------- set this for 1 ?? 
            }
            break;
        }

 

The first commentind immune_attack didnt work as you said.. i'll try the other ones.... 

Edited by Emistry
Please use CODEBOX.
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

Fail...none of the alternatives worked, but i tried something that worked but it affected all the server..

I found this:

{
            struct mob_data *md = BL_CAST(BL_MOB, s_bl);
            if( !map_flag_gvg(m) && md->guardian_data && md->guardian_data->guild_id )
                return 0; // Disable guardians/emperium owned by Guilds on non-woe times.

            if( !md->special_state.ai )
            { //Normal mobs
                if(
                    ( target->type == BL_MOB && t_bl->type == BL_PC && ( ((TBL_MOB*)target)->special_state.ai != AI_ZANZOU && ((TBL_MOB*)target)->special_state.ai != AI_ATTACK ) ) ||
                    ( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai )
                  )
                    state |= BCT_PARTY; //Normal mobs with no ai are friends.
                else
                    state |= BCT_ENEMY; //However, all else are enemies.
            }
            else
            {
                if( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai )
                    state |= BCT_ENEMY; //Natural enemy for AI mobs are normal mobs.
            }
            break;
        }

I just changed BCT_PARTY for BCT_ENEMY, and it worked 100%... but all the server mobs now are killing each otherin all maps hahahh

Maybe i must remove from this if only bg_monster, but how ?

if(
                    ( target->type == BL_MOB && t_bl->type == BL_PC && ( ((TBL_MOB*)target)->special_state.ai != AI_ZANZOU && ((TBL_MOB*)target)->special_state.ai != AI_ATTACK ) ) ||
                    ( t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai )
                  )

That's the point..

Edited by Emistry
Please use CODEBOX.
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   18
  • Joined:  10/09/14
  • Last Seen:  

bump

Link to comment
Share on other sites

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.

×
×
  • Create New...