senatin Posted March 5, 2015 Posted March 5, 2015 Help! I want to edit the behavior of monster. I want the monster to attack base on target level. the monster will only attack player above lvl 49. Quote
Capuche Posted March 5, 2015 Posted March 5, 2015 From what I know there is no such mode for mob, only MD_TARGETWEAK Target Weak: Allows aggressive monsters to only be aggressive against characters that are five levels below it's own level. For example, a monster of level 104 will not pick fights with a level 99. but you can add a new mode diff --git a/src/map/mob.c b/src/map/mob.c index 0e2b177..848b9ce 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1071,6 +1071,9 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) if ((mode&MD_TARGETWEAK) && status_get_lv(bl) >= md->level-5) return 0; + if ((mode&MD_TARGETSTRONG) && status_get_lv(bl) <= md->level) + return 0; + if(battle_check_target(&md->bl,bl,BCT_ENEMY)<=0) return 0; diff --git a/src/map/status.h b/src/map/status.h index 251e5ad..dd03334 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1562,6 +1562,7 @@ enum e_mode { MD_MVP = 0x080000, MD_IGNOREMISC = 0x100000, MD_KNOCKBACK_IMMUNE = 0x200000, + MD_TARGETSTRONG = 0x400000, }; #define MD_MASK 0x00FFFF #define ATR_MASK 0xFF0000 MD_TARGETSTRONG mode : monster lvl >= player lvl --> monster passive refer to mode in mob_db.txt // ID,Sprite_Name,kROName,iROName,LV,HP,SP,EXP,JEXP,Range1,ATK1,ATK2,DEF,MDEF,STR,AGI,VIT,INT,DEX,LUK,Range2,Range3,Scale,Race,Element,Mode,Speed,aDelay,aMotion,dMotion,MEXP,MVP1id,MVP1per,MVP2id,MVP2per,MVP3id,MVP3per,Drop1id,Drop1per,Drop2id,Drop2per,Drop3id,Drop3per,Drop4id,Drop4per,Drop5id,Drop5per,Drop6id,Drop6per,Drop7id,Drop7per,Drop8id,Drop8per,Drop9id,Drop9per,DropCardid,DropCardper and the docs https://github.com/rathena/rathena/blob/master/doc/mob_db.txt 1 Quote
senatin Posted March 5, 2015 Author Posted March 5, 2015 (edited) Thank you so much Capuche for the help!!! I tried to apply the if statement and MD_TARGETSTRONG to its location, and I'm still figuring out how Skotlex work. Skotlex is the one to be inserted in the mode at mob_db.txt isn't that right? Edited March 6, 2015 by senatin Quote
Capuche Posted March 6, 2015 Posted March 6, 2015 I don't understand. Skotlex was a core dev.. 1 Quote
senatin Posted March 6, 2015 Author Posted March 6, 2015 (edited) to apply the MD_TARGETSTRONG into a monster, I should edit mob_db.txt Mode right? the thing I dont know is, what should i change it for. As I look around I end up with Skotlex's hexing. I edited one of the monster mode in mob_db.txt and nothing change in game, I even tried to copy the mode of poring which is 0x83 still the behavior of monster doesnt change. but other options works. I also tried editing in my sql database the mode of a monster but with no result. Am I missing something? Edited March 6, 2015 by senatin Quote
senatin Posted March 6, 2015 Author Posted March 6, 2015 (edited) yes I added in status.h and mob.c and recompile the map server via visual c++!yes It worked! I tried converting hexadecimal to binary and compared poring, isis, familiar and zombie. And i figured out why they all acted weird. i made my binary and converted it to hexadecimal and everything worked as I wanted it!thank you so much Capuche for everything. Edited March 6, 2015 by senatin Quote
Question
senatin
Help! I want to edit the behavior of monster.
I want the monster to attack base on target level. the monster will only attack player above lvl 49.
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.