Jump to content
  • 0

Q > Mercenaries autoattack and Clones aspd bonuses


utofaery

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

1.

Is there anything that can be done for changing the mercenaries AI to be more aggressive (auto attack everything) than what is is now (passive)?

 

2.

about clones:

the test case here is master(player) has more damage compare to clone but slower aspd,

while clone(slave / evil) has lower hit rate, faster aspd with lower damage) but both doesn't seem to have equip bonuses applied at all.

so matter of the question

does clone get equip bonuses like player?

 

3

is aspd inherited on creation of clone?  (which from test case would seems to say otherwise)

 

  • Upvote 1
Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

8 hours ago, utofaery said:

1. Is there anything that can be done for changing the mercenaries AI to be more aggressive (auto attack everything) than what is is now (passive)?

https://rathena.org/board/topic/116308-using-2018-05-30b-client-anyone-have-a-working-ai-for-homunc/

supposedly we can adjust it in the data/AI folder, but now it seems unable to do so

 

int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, enum e_mode mode, int flag, unsigned int duration)
{
	int mob_id;
	int i,j,inf, fd;
	struct mob_data *md;
	struct mob_skill *ms;
	struct mob_db* db;
	struct status_data *status;

	nullpo_ret(sd);

	if(pc_isdead(sd) && master_id && flag&1)
		return 0;

	ARR_FIND( MOB_CLONE_START, MOB_CLONE_END, mob_id, mob_db(mob_id) == NULL );
	if(mob_id >= MOB_CLONE_END)
		return 0;

	try{
		db = &mob_db_data[mob_id];
	}catch( const std::bad_alloc& ){
		ShowError( "mob_clone_spawn: Memory allocation for clone %hu failed.\n", mob_id );
		return 0;
	}

	status = &db->status;
	strcpy(db->sprite,sd->status.name);
	strcpy(db->name,sd->status.name);
	strcpy(db->jname,sd->status.name);
	db->lv=status_get_lv(&sd->bl);
	memcpy(status, &sd->base_status, sizeof(struct status_data));
	status->rhw.atk2= status->dex + status->rhw.atk + status->rhw.atk2; //Max ATK
	status->rhw.atk = status->dex; //Min ATK
	if (status->lhw.atk) {
		status->lhw.atk2= status->dex + status->lhw.atk + status->lhw.atk2; //Max ATK
		status->lhw.atk = status->dex; //Min ATK
	}
	if (mode) //User provided mode.
		status->mode = mode;
	else if (flag&1) //Friendly Character, remove looting.
		status->mode = static_cast<enum e_mode>(status->mode&(~MD_LOOTER));
	status->hp = status->max_hp;
	status->sp = status->max_sp;
	memcpy(&db->vd, &sd->vd, sizeof(struct view_data));
	db->base_exp=1;
	db->job_exp=1;
	db->range2=AREA_SIZE; //Let them have the same view-range as players.
	db->range3=AREA_SIZE; //Min chase of a screen.
	db->option=sd->sc.option;

 

8 hours ago, utofaery said:

2. does clone get equip bonuses like player?

yes

8 hours ago, utofaery said:

3 is aspd inherited on creation of clone?  (which from test case would seems to say otherwise)

no

 

by the way, Hercules #evilclone are smarter, rathena mess up the monster mode

 

 

EDIT : Reminds me of someone coding that #autopilot ... if we can also code a homunculus/mercenary AI at the server side ... hmm...

Edited by AnnieRuru
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

4. Erm another question does clone inherit sc (status changes)?

5. Is there a way the list or check status change or stat of clone which get summon'ed?

eg.  like the command of mobinfo ??

 

Edited by utofaery
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

hmm ? you can't read the code I posted ?
mob_clone_spawn is the function to spawn a clone

 

2 hours ago, utofaery said:

4. Erm another question does clone inherit sc (status changes)?

no

tested with the script below, blessing and without blessing, the stat stays the same

2 hours ago, utofaery said:

5. Is there a way the list or check status change or stat of clone which get summon'ed?

spawn by atcommand #evilclone, no

spawn by script command, yes

prontera,155,185,5	script	sjdfkshf	1_F_MARIA,{
	if ( .cloneid ) {
		getunitdata .cloneid, .@unitdata;
		mes "map -> "+ mapid2name(.@unitdata[UMOB_MAPID]);
		mes "X -> "+ .@unitdata[UMOB_X];
		mes "Y -> "+ .@unitdata[UMOB_Y];
		mes "str -> "+ .@unitdata[UMOB_STR];
		mes "agi -> "+ .@unitdata[UMOB_AGI];
		mes "vit -> "+ .@unitdata[UMOB_VIT];
		mes "int -> "+ .@unitdata[UMOB_INT];
		mes "dex -> "+ .@unitdata[UMOB_DEX];
		mes "luk -> "+ .@unitdata[UMOB_LUK];
		close;
	}
	getmapxy .@map$, .@x, .@y;
	.cloneid = clone( .@map$, .@x, .@y, strnpcinfo(0)+"::OnDead", getcharid(0) );
	end;
OnDead:
	.cloneid = 0;
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

2 hours ago, AnnieRuru said:

hmm ? you can't read the code I posted ?

I don't understand source but only npc script..

 

Questions:

How to convert these lines to hercules script..since mainly played scripting in hercules 

rathena database is a mess.

		mes "map -> "+ mapid2name(.@unitdata[UMOB_MAPID]);
		mes "X -> "+ .@unitdata[UMOB_X];
		mes "Y -> "+ .@unitdata[UMOB_Y];
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,155,185,5	script	sjdfkshf	1_F_MARIA,{
	if ( .cloneid ) {
		getmapxy .@map$, .@x, .@y, UNITTYPE_MOB, .cloneid;
		mesf "map -> %s", .@map$;
		mesf "X -> %d", .@x;
		mesf "Y -> %d", .@y;
		mesf "str -> %d", getunitdata( .cloneid, UDT_STR );
		mesf "agi -> %d", getunitdata( .cloneid, UDT_AGI );
		mesf "vit -> %d", getunitdata( .cloneid, UDT_VIT );
		mesf "int -> %d", getunitdata( .cloneid, UDT_INT );
		mesf "dex -> %d", getunitdata( .cloneid, UDT_DEX );
		mesf "luk -> %d", getunitdata( .cloneid, UDT_LUK );
		close;
	}
	getmapxy .@map$, .@x, .@y, UNITTYPE_PC;
	.cloneid = clone( .@map$, .@x, .@y, strnpcinfo(0)+"::OnDead", getcharid(0) );
	end;
OnDead:
	.cloneid = 0;
	end;
}

 

Edited by AnnieRuru
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

4 hours ago, AnnieRuru said:

hmm ? you can't read the code I posted ?

I don't understand source but only npc script..

 

And a side question:

atcommand "@reloadscript";

this line of code if put in itemscript / npcscript won't run or execute in rathena script, why?

in hercules or eathena ( the ancient emulator ) works fine and correctly..

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

never use "@reloadscript" on a live server

use "@reloadnpc npc/zzz.txt"
well, that's my default script file

 

apparently Hercules doesn't have "@reloadnpc" ... hmm ....

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

15 hours ago, AnnieRuru said:

never use "@reloadscript" on a live server

use "@reloadnpc npc/zzz.txt"
well, that's my default script file

 

apparently Hercules doesn't have "@reloadnpc" ... hmm ....

1

So my only option in rathena would have to code in 

"@reloadnpc npc/zzz.txt" inside an npc???  instead of easily @reloadscript?

 

2

Hercules is fluid to test source compiling and restarting server add with @reloadscript makes @reloadnpc not much of a matter if running on test server.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

1. I'm actually thinking "@reloadnpc" is superior than "@reloadscript"
"@reloadnpc" only reload 1 single file, but "@reloadscript" will reload all scripts on the server, possibly disrupt other's players playing experience

actually you have to tell what is your actual idea, I never really heard anything about having to use "@reloadscript" in npc script or items

 

2.
well, according to what I heard from Euphy,
Hercules actually left some footprints in your computer after the server boot up once ( and only cleared when shut down/restart computer )
after that, after 2nd time boot up your server, it just load the memory directly from the RAM
... which according to rathena, that is not very resource friendly

but think about it ... once a computer is meant to host the server,
means it supposed to rerun the map-server/char-server/login-server again and again,
example, if server crash, hercules can restart itself much faster than rathena
so left some footprints behind make sense
yes, hercules is also more developer friendly

 

PS: use Shift+Enter instead of Enter

Edited by AnnieRuru
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

On 2/3/2019 at 7:32 AM, AnnieRuru said:

PS: use Shift+Enter instead of Enter

What would this do?

and at where should this be executed?

 

2. 

Hercules are correct in the regard of emulator should be hosting friendly instead of acting like most game client be.

because it's a server thing so if crash it should always run and faster startup

comparing cases if disable all npc but keep simple and global npc, guild npc, warps, monster, and some custom npc

rathena would took 7 ~ 10 seconds to actually startup (including db reading which is the longest time taken half of the total time to restart server)

hercules on the other hand if crash ... took 3 seconds if you do side by side compare... or any test

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...