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.