Jump to content
  • 0
Sign in to follow this  
Lord Ganja

Increase monster attack & skill damage rate on map

Question

Is it possible to increase monster damage rate on a specific map?

Like putting a mapflag ..

 

prontera mapflag increasemobdamagerate 100

all monsters on prontera will increase their attack and skill damage by 100%. thank you. :)

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

You could simply make duplicates of existing mobs and up their stats manually in the mob_db then place them on the map you want? @@Lord Ganja

Share this post


Link to post
Share on other sites
  • 0

@@Aeromesi,

I was about to do it with lots of mobs. That's why I was thinking it would be easier if I use a mapflag.. Do you know what part of src is the calculation of mob attack damage and mob skill damage? 

Share this post


Link to post
Share on other sites
  • 0

A while ago i've made a source modification that did exacly that!

I was using this to create a setmapflag command to increase mobpower on an instance, creating somekind of "Greater Rift" from Diablo, with infinity dificulty scale depending on the level that the player have already cleared.

Example( instance level30 = mobpower 3000% ).

I used the jexp/bexp mapflag as a base, as it is 100% on all non-set maps, and then i've called the mapflag values on the mob_spawn(mob.c);

 
 
 int m = md->bl.m;	if( map->list[m].mobpower != 100){	md->level = md->level * map->list[m].mobpower/100;	md->status.max_hp = (md->status.max_hp * map->list[m].mobpower)/100;	md->status.max_sp = (md->status.max_sp * map->list[m].mobpower)/100;	md->status.hp = (md->status.hp * map->list[m].mobpower)/100;	md->status.sp = (md->status.sp * map->list[m].mobpower)/100;	md->status.str = (md->status.str * map->list[m].mobpower)/10	md->status.batk = (md->status.batk * map->list[m].mobpower)/100;	md->status.rhw.atk= (md->status.rhw.atk * map->list[m].mobpower)/100;;	md->status.rhw.atk2= (md->status.rhw.atk2 * map->list[m].mobpower)/100;	md->status.lhw.atk= (md->status.rhw.atk * map->list[m].mobpower)/100;;	md->status.lhw.atk2= (md->status.rhw.atk2 * map->list[m].mobpower)/100;	}
md->attacked_id = 0;
md->target_id = 0;
md->move_fail_count = 0;

I've lost all the source files ;ooo.

I know that's not a tutorial, but i hope it gives you a good start or inspiration.

;]

Share this post


Link to post
Share on other sites
  • 0

@@raPalooza~

Thank you for the info :) I'll just create the new mapflag. I just wanted to know where should I put the src that increases a monster's attack & skill damage.

 

Anyway can you tell me what part of mob.c should I put those? Should I put it under int64 c = 0; ?

/*========================================== * Mob spawning. Initialization is also variously here. *------------------------------------------*/int mob_spawn (struct mob_data *md){	int i=0;	int64 tick = timer->gettick();	int64 c = 0;	md->last_thinktime = tick;	if (md->bl.prev != NULL)		unit->remove_map(&md->bl,CLR_RESPAWN,ALC_MARK);	else if (md->spawn && md->class_ != md->spawn->class_) {		md->class_ = md->spawn->class_;		status->set_viewdata(&md->bl, md->class_);		md->db = mob->db(md->class_);		memcpy(md->name,md->spawn->name,NAME_LENGTH);	}	if (md->spawn) { //Respawn data		md->bl.m = md->spawn->m;		md->bl.x = md->spawn->x;		md->bl.y = md->spawn->y;		if( (md->bl.x == 0 && md->bl.y == 0) || md->spawn->xs || md->spawn->ys ) {			//Monster can be spawned on an area.			if( !map->search_freecell(&md->bl, -1, &md->bl.x, &md->bl.y, md->spawn->xs, md->spawn->ys, battle_config.no_spawn_on_player?4:0) ) {				// retry again later				if( md->spawn_timer != INVALID_TIMER )					timer->delete(md->spawn_timer, mob->delayspawn);				md->spawn_timer = timer->add(tick+5000,mob->delayspawn,md->bl.id,0);				return 1;			}		} else if( battle_config.no_spawn_on_player > 99 && map->foreachinrange(mob->count_sub, &md->bl, AREA_SIZE, BL_PC) ) {			// retry again later (players on sight)			if( md->spawn_timer != INVALID_TIMER )				timer->delete(md->spawn_timer, mob->delayspawn);			md->spawn_timer = timer->add(tick+5000,mob->delayspawn,md->bl.id,0);			return 1;		}	}	memset(&md->state, 0, sizeof(md->state));	status_calc_mob(md, SCO_FIRST);	md->attacked_id = 0;	md->target_id = 0;	md->move_fail_count = 0;	md->ud.state.attack_continue = 0;	md->ud.target_to = 0;	md->ud.dir = 0;	if( md->spawn_timer != INVALID_TIMER )	{		timer->delete(md->spawn_timer, mob->delayspawn);		md->spawn_timer = INVALID_TIMER;	}	//md->master_id = 0;	md->master_dist = 0;	md->state.aggressive = (md->status.mode&MD_ANGRY) ? 1 : 0;	md->state.skillstate = MSS_IDLE;	md->next_walktime = tick+rnd()%1000+MIN_RANDOMWALKTIME;	md->last_linktime = tick;	md->dmgtick = tick - 5000;	md->last_pcneartime = 0;	for (i = 0, c = tick-MOB_MAX_DELAY; i < MAX_MOBSKILL; i++)		md->skilldelay[i] = c;	memset(md->dmglog, 0, sizeof(md->dmglog));	md->tdmg = 0;	if (md->lootitem)		memset(md->lootitem, 0, sizeof(*md->lootitem));	md->lootitem_count = 0;	if(md->db->option)		// Added for carts, falcons and pecos for cloned monsters. [Valaris]		md->sc.option = md->db->option;	// MvP tomb [GreenBox]	if ( md->tomb_nid )		mob->mvptomb_destroy(md);	map->addblock(&md->bl);	if( map->list[md->bl.m].users )		clif->spawn(&md->bl);	skill->unit_move(&md->bl,tick,1);	mob->skill_use(md, tick, MSC_SPAWN);	return 0;}

 

And can you explain these to me? What are those for?

md->attacked_id = 0;
md->target_id = 0;
md->move_fail_count = 0;
 
 
Thank you so much.

Share this post


Link to post
Share on other sites
  • 0
You're welcome buddy,

The way i did was,
Under int64 c= 0;
You have to write int m = md->bl.m; so you can get the spawning mob map, and ask for the mapflag later on.

I've changed the mob status through the  if( map->list[m].mobpower != 100right before md->attacked_id = 0; on mob_spawn, that's why i wrote that down on the other post, forgot to mention why it was there XD

I don't know if there's much diference on where to modificate it's status, but before md->attacked_id = 0; worked fine for me. ( still newbie on source edit's )

The mapflag way will not change the mobs stats that have already spawned, so you have to spawn the mob after you setmapflag or write the mapflag from the server start. (Little confuse but i think i got the point)
 
o/

Hope Hercules Pluguin creates a easier way of creating mapflags
Right now it is a pain in the ass, with a lot of changes to make. T-T

Share this post


Link to post
Share on other sites
  • 0

@@raPalooza~

I'll try it. Thank you for the info  :D

 

EDIT:

 

@@raPalooza~

Can you tell me what's lhw.atk? xD Can't seem to find it. I only knew rhw.atk..

And also what is batk? base attack?

 

Do you also know where can I modify the magical attack damage without altering the mob's int?

 

Thankyou :D

Edited by Lord Ganja

Share this post


Link to post
Share on other sites
  • 0

@@Lord Ganja

RHW AND LHW stands for Right Hand Weapon and Left Hand Weapon, i'm not sure it makes any diference, i was testing at the time how it works

 

yes batk is the basic atack. I havent played enouth with the mob's stat to give you a good answer of what each one does but, i think you can start testing it out.

No idea on the magic attack part x_X
 

 

 

Share this post


Link to post
Share on other sites
  • 0

Monster's MATK is based mostly on their ATK2.

 

 

#define MOB_MATK1(mobdata)( ((mobdata)->lv + (mobdata)->status.int_) + (mobdata)->status.rhw.atk2 * 7 / 10 )#define MOB_MATK2(mobdata)( ((mobdata)->lv + (mobdata)->status.int_) + (mobdata)->status.rhw.atk2 * 13 / 10 )
Edited by Anisotropic Defixation

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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