Active Member ReFresh 2356 Posted March 4, 2018 Active Member Share Posted March 4, 2018 Hey guys, is here someone who can make this system? How the system works? When you hit a monster or monster is aggressive or monster just want go into a safe zone the system will detect it and send a block packet to the monster and monster will go to his spawn position. Thanks for answers! Sincerely, ReFresh I'll be always helpful! Link to comment Share on other sites More sharing options...
Mareq 0 Posted March 5, 2018 Share Posted March 5, 2018 On official servers, when a mob enters a safezone, the mob automatically disappears. As if you were applying a purge Link to comment Share on other sites More sharing options...
meneleos 307 Posted March 5, 2018 Share Posted March 5, 2018 find in char_state.cpp if (!Attack(victim)) add on top SECTREE *vsectree = victim->GetSectree(); if (vsectree) { if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK)) { SetVictim(NULL); return; } } Link to comment Share on other sites More sharing options...
Active Member ReFresh 2356 Posted March 5, 2018 Author Active Member Share Posted March 5, 2018 @meneleos If I did it right, it does not work. Code: Spoiler SECTREE *vsectree = victim->GetSectree(); if (vsectree) { if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK)) { SetVictim(NULL); return; } } if (!Attack(victim)) // °ř°Ý ˝ÇĆжó¸é? żÖ ˝ÇĆĐÇßÁö? TODO m_dwStateDuration = passes_per_sec / 2; else { // ŔűŔ» ąŮ¶óş¸°Ô ¸¸µç´Ů. SetRotationToXY(victim->GetX(), victim->GetY()); SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0, dwCurTime); float fDuration = CMotionManager::instance().GetMotionDuration(GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_NORMAL_ATTACK)); m_dwStateDuration = (DWORD) (fDuration == 0.0f ? PASSES_PER_SEC(2) : PASSES_PER_SEC(fDuration)); } } I'll be always helpful! Link to comment Share on other sites More sharing options...
meneleos 307 Posted March 6, 2018 Share Posted March 6, 2018 On 05.03.2018 at 5:50 PM, ReFresh said: @meneleos If I did it right, it does not work. Code: Reveal hidden contents SECTREE *vsectree = victim->GetSectree(); if (vsectree) { if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK)) { SetVictim(NULL); return; } } if (!Attack(victim)) // °ř°Ý ˝ÇĆжó¸é? żÖ ˝ÇĆĐÇßÁö? TODO m_dwStateDuration = passes_per_sec / 2; else { // ŔűŔ» ąŮ¶óş¸°Ô ¸¸µç´Ů. SetRotationToXY(victim->GetX(), victim->GetY()); SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0, dwCurTime); float fDuration = CMotionManager::instance().GetMotionDuration(GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_NORMAL_ATTACK)); m_dwStateDuration = (DWORD) (fDuration == 0.0f ? PASSES_PER_SEC(2) : PASSES_PER_SEC(fDuration)); } } * not tried. find LPCHARACTER pkChrProtege = GetProtege(); add top SECTREE *vsectree = victim->GetSectree(); if (vsectree) { if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK)) { SetVictim(NULL); m_dwStateDuration = PASSES_PER_SEC(1); return; } } this SECTREE *vsectree = victim->GetSectree(); if (vsectree) { if (vsectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK)) { SetVictim(NULL); m_dwStateDuration = PASSES_PER_SEC(1); return; } } LPCHARACTER pkChrProtege = GetProtege(); try Link to comment Share on other sites More sharing options...
Legend 187 Posted March 6, 2018 Share Posted March 6, 2018 https://pastebin.com/tUyrecdn #File : common/service.h #define __MONSTER_ON_SAFEZONE__ 1 Link to comment Share on other sites More sharing options...
Active Member ReFresh 2356 Posted March 6, 2018 Author Active Member Share Posted March 6, 2018 Thanks to all I'll be always helpful! Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19773 Posted March 13, 2018 Honorable Member Share Posted March 13, 2018 (edited) Probably you can extend this for the FindVictim as well. I mean if an aggressive monster looks for a potential victim, it will skip the safe zone. Trigger.cpp --> FuncFindMobVictim Spoiler Actually I am using this in the CHARACTER::Follow and works pretty well: Spoiler Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 4 Link to comment Share on other sites More sharing options...
Active Member ReFresh 2356 Posted March 24, 2018 Author Active Member Share Posted March 24, 2018 Here is a little problem, monsters can't get to the safezone, but the character is still their target so it will be good if someone know how to untarget this char who went to the safezone. I'll be always helpful! Link to comment Share on other sites More sharing options...
Premium Speachless 767 Posted March 24, 2018 Premium Share Posted March 24, 2018 3 hours ago, ReFresh said: Here is a little problem, monsters can't get to the safezone, but the character is still their target so it will be good if someone know how to untarget this char who went to the safezone. SetVictim(NULL); Link to comment Share on other sites More sharing options...
Active Member ReFresh 2356 Posted March 24, 2018 Author Active Member Share Posted March 24, 2018 @Dobrescu Sebastian Tried, and still don't work. I'll be always helpful! Link to comment Share on other sites More sharing options...
Premium Speachless 767 Posted March 24, 2018 Premium Share Posted March 24, 2018 Put it before if (Return()) Link to comment Share on other sites More sharing options...
Active Member ReFresh 2356 Posted March 24, 2018 Author Active Member Share Posted March 24, 2018 @Dobrescu Sebastian I did it. And still don't work. I'll be always helpful! Link to comment Share on other sites More sharing options...
Premium Speachless 767 Posted March 24, 2018 Premium Share Posted March 24, 2018 11 minutes ago, ReFresh said: @Dobrescu Sebastian I did it. And still don't work. Move the code to char_state.cpp Follow/Move. Search 2493 (ctrl+f) and you will add the code before it. Link to comment Share on other sites More sharing options...
Active Member ReFresh 2356 Posted March 25, 2018 Author Active Member Share Posted March 25, 2018 SECTREE *tree = pkChr->GetSectree(); if (tree && tree->IsAttr(pkChr->GetX(), pkChr->GetY(), ATTR_BANPK)) { if (Return()) SetVictim(NULL); return true; } I have it like this and I'm still the target of mobs when I go out of the safezone. I'll be always helpful! Link to comment Share on other sites More sharing options...
Premium Speachless 767 Posted March 25, 2018 Premium Share Posted March 25, 2018 If you teleport before mobs come nears to you in safezone, the mob will stay there so i think lent's code need to be used because it's on OnMove. Tested, works. SECTREE * sectree = GetSectree(); if (sectree && sectree->IsAttr(GetX(), GetY(), ATTR_BANPK) && IsMonster()) { SetVictim(NULL); Return(); } Link to comment Share on other sites More sharing options...
Active Member ReFresh 2356 Posted March 25, 2018 Author Active Member Share Posted March 25, 2018 @Dobrescu Sebastian Didn't work. Try to go out of the safezone Mobs will follow you. I'll be always helpful! Link to comment Share on other sites More sharing options...
Premium Speachless 767 Posted March 25, 2018 Premium Share Posted March 25, 2018 2 hours ago, ReFresh said: @Dobrescu Sebastian Didn't work. Try to go out of the safezone Mobs will follow you. AA i see now, it happens when you hit them, not if you use bravely cape. I will search for a fix. 1 Link to comment Share on other sites More sharing options...
Premium Speachless 767 Posted March 26, 2018 Premium Share Posted March 26, 2018 We better work on a official ++ topic for the future members to be able to find faster. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now