Active Member nazox 238 Posted August 29 Active Member Share Posted August 29 (edited) Hello everyone, surely you know the system of ‘effective bonus’ against any race (below I attach image), This system (I don't remember who is, but thanks for creating the functions) from my point of view has a small problem, and is that it saturates a lot the uiTarget.py because you have to add a large list of mobs in the following way: if vnum == 5161 or vnum == 5162 or vnum == 5163 or vnum == 591 or vnum == 595 or vnum == 2191: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 2192 or vnum == 1901 or vnum == 1902 or vnum == 1903 or vnum == 1904 or vnum == 1905: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 1906 or vnum == 1304 or vnum == 1306 or vnum == 1307 or vnum == 1308 or vnum == 1309 or vnum == 1310 or vnum == 1334: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 691 or vnum == 692 or vnum == 693 or vnum == 791 or vnum == 792 or vnum == 793 or vnum == 794: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ORC + "|r - " if vnum == 2091 or vnum == 2092 or vnum == 2093 or vnum == 2095: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2206 or vnum == 2207 or vnum == 2291: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 1091 or vnum == 1092 or vnum == 1093 or vnum == 1094 or vnum == 1095 or vnum == 1096: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_DEVIL + "|r - " if vnum == 1191 or vnum == 1192 or vnum == 2595 or vnum == 2596 or vnum == 2597 or vnum == 2598 or vnum == 2591 or vnum == 993: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_UNDEAD + "|r - " if vnum == 2491 or vnum == 2492 or vnum == 2493 or vnum == 2494 or vnum == 2495: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_HUMAN + "|r - " if vnum == 2001 or vnum == 2002 or vnum == 2003 or vnum == 2004 or vnum == 2005 or vnum == 2031 or vnum == 2032 or vnum == 2033: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2034 or vnum == 2035 or vnum == 2036 or vnum == 2051 or vnum == 2052 or vnum == 2053 or vnum == 2054 or vnum == 2055: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2061 or vnum == 2062 or vnum == 2063 or vnum == 2064 or vnum == 2065 or vnum == 2071 or vnum == 2072 or vnum == 2073 or vnum == 2074 or vnum == 2075 or vnum == 2076: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 8001 or vnum == 8002 or vnum == 8003 or vnum == 8004 or vnum == 8005 or vnum == 8006 or vnum == 8006 or vnum == 8007 or vnum == 8008 or vnum == 8009 or vnum == 8010: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_METIN + "|r - " if vnum == 691: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_BOSS + "|r - " As you can see, if we have to put all the categories and all the ids in this way I think we fill the file with rubbish. And also the annoying part, is that it enlarges the target window to show the effective bonus like this : [LV 60 Nazox* Bonus: Animal ] from my perspective it's a bit annoying, so I modified the file a bit to have it a bit ‘cleaner’, running the ids from another file and I made a small function to add the bonus below the name to not enlarge the target window. So let's get down to business. 1. SVN Client, Open Locale_inc.h in UserInterface and add: #define ENABLE_BONUS_ANIMAL //Effective Bonus for Monsters and Bosses 1.2 Now open PythonApplicationModule.cpp and search: #ifdef USE_OPENID PyModule_AddIntConstant(poModule, "USE_OPENID", 1); if (openid_test) PyModule_AddIntConstant(poModule, "OPENID_TEST", 1); else PyModule_AddIntConstant(poModule, "OPENID_TEST", 0); #else PyModule_AddIntConstant(poModule, "USE_OPENID", 0); PyModule_AddIntConstant(poModule, "OPENID_TEST", 0); #endif /* USE_OPENID */ 1.3 Add Before this: #if defined(ENABLE_BONUS_ANIMAL) PyModule_AddIntConstant(poModule, "ENABLE_BONUS_ANIMAL", 1); #else PyModule_AddIntConstant(poModule, "ENABLE_BONUS_ANIMAL", 0); #endif 1.4 Now Open PythonNonPLayerModule.cpp and before void initNonPlayer() add: #if defined(ENABLE_BONUS_ANIMAL) PyObject * nonplayerGetRaceNumByVID(PyObject * poSelf, PyObject * poArgs) { int iVirtualID; if (!PyTuple_GetInteger(poArgs, 0, &iVirtualID)) return Py_BuildException(); CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(iVirtualID); if (!pInstance) return Py_BuildValue("i", -1); const CPythonNonPlayer::TMobTable * pMobTable = CPythonNonPlayer::Instance().GetTable(pInstance->GetVirtualNumber()); if (!pMobTable) return Py_BuildValue("i", -1); return Py_BuildValue("i", pMobTable->dwVnum); } #endif 1.5 Now Search NULL, and add before: #if defined(ENABLE_BONUS_ANIMAL) { "GetRaceNumByVID", nonplayerGetRaceNumByVID, METH_VARARGS }, #endif 2.Save all, compile and let's go to Python, first open locale_xx -> locale_game and add (check tabs): TARGET_INFO_RESISTS Resistance: TARGET_INFO_RESISTS_LINE0 Sword: %d%% Two-handed: %d%% Bell: %d%% TARGET_INFO_RESISTS_LINE1 Dagger: %d%% Fan: %d%% Bow: %d%% TARGET_INFO_REGEN_INFO Regen %d%% every %d sec. TARGET_INFO_GOLD_MIN_MAX Yang: %s ~ %s TARGET_INFO_NEWRACE_INSECT Insect TARGET_INFO_NEWRACE_FIRE Fire TARGET_INFO_NEWRACE_ICE Ice TARGET_INFO_NEWRACE_DESERT Desert TARGET_INFO_NEWRACE_TREE Tree TARGET_INFO_DAMAGE Damage : %s - %s TARGET_INFO_DEFENSE Defense : %s TARGET_INFO_EXP Experience : %s TARGET_INFO_MAINRACE Ratio : %s TARGET_INFO_MAX_HP Max. HP : %s TARGET_INFO_NO_ITEM_TEXT No results. TARGET_INFO_NO_RACE Immune TARGET_INFO_RACE_METIN Metin TARGET_INFO_RACE_ANIMAL Animal TARGET_INFO_RACE_DARK Darkness TARGET_INFO_RACE_DEVIL Demon TARGET_INFO_RACE_METIN Metin TARGET_INFO_RACE_BOSS Boss TARGET_INFO_RACE_EARTH Earth TARGET_INFO_RACE_ELEC Lightning TARGET_INFO_RACE_FIRE Fire TARGET_INFO_RACE_HUMAN Half Human TARGET_INFO_RACE_ICE Ice TARGET_INFO_RACE_MILGYO Mystic TARGET_INFO_RACE_ORC Orc TARGET_INFO_RACE_UNDEAD Undead TARGET_INFO_RACE_WIND Wind TARGET_INFO_STONE_NAME Metin TARGET_INFO_SUBRACE Subspecies : %s 2.1 Now open uiTarget.py and give you the original code and v2, the first, original code; search for: def SetEnemyVID(self, vid): self.SetTargetVID(vid) 2.2 Add: if app.ENABLE_BONUS_ANIMAL: self.vnum = 0 2.3 Now Search: grade = nonplayer.GetGradeByVID(vid) 2.4 Add: if app.ENABLE_BONUS_ANIMAL: vnum = nonplayer.GetRaceNumByVID(vid) 2.5 Now Search: nameFront = "" if -1 != level: nameFront += "Lv." + str(level) + " " if self.GRADE_NAME.has_key(grade): nameFront += "(" + self.GRADE_NAME[grade] + ") " 2.6 Add: if app.ENABLE_BONUS_ANIMAL: if vnum == 691 or vnum == 9208 or vnum == 3391 or vnum == 3891 or vnum == 3791 or vnum == 3191 or vnum == 3391: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ORC + "|r - " if vnum == 292 or vnum == 3691 or vnum == 6091 or vnum == 2492 or vnum == 2493 or vnum == 2598 or vnum == 64057: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_DEVIL + "|r - " if vnum == 3591: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_HUMAN + "|r - " if vnum == 3091 or vnum == 6191 or vnum == 5163 or vnum == 2092 or vnum == 2841 or vnum == 2772 or vnum == 2750 or vnum == 2830 or vnum == 2831 or vnum == 2790 or vnum == 266 or vnum == 236: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 2291: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 3964: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_MILGYO + "|r - " if vnum == 1093 or vnum == 1191: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_UNDEAD + "|r - " Now the V2, first Search in: class TargetBoard(ui.ThinBoard): def __init__(self): ui.ThinBoard.__init__(self) 1.2 And add after: if app.ENABLE_BONUS_ANIMAL: bonusTarget = ui.TextLine() bonusTarget.SetParent(self) bonusTarget.SetPosition(23, 21) bonusTarget.SetWindowHorizontalAlignLeft() bonusTarget.SetHorizontalAlignLeft() bonusTarget.Hide() self.bonusTarget = bonusTarget 1.3 Now in the same class, search for def Destroy(self): and add: if app.ENABLE_BONUS_ANIMAL: self.bonusTarget = None 1.4 Now search def ResetTargetBoard(self): and add: if app.ENABLE_BONUS_ANIMAL: self.bonusTarget.Hide() 1.5 Now search: def SetEnemyVID(self, vid): and add after self.SetTargetVID(vid): if app.ENABLE_BONUS_ANIMAL: self.vnum = 0 1.6 Now in the same function, after: nameFront = "" if -1 != level: nameFront += "Lv." + str(level) + " " if self.GRADE_NAME.has_key(grade): nameFront += "(" + self.GRADE_NAME[grade] + ") " 1.6.1 Add: if app.ENABLE_BONUS_ANIMAL: from mob_id import ANIMAL_VNUMS if vnum in ANIMAL_VNUMS: #Show bonus bonus_text = "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r" self.bonusTarget.SetText(bonus_text) self.bonusTarget.SetPosition(23, 21) # Change position if u want. self.bonusTarget.Show() else: self.bonusTarget.Hide() 1.7 Now in def SetHP(self, hpPercentage): add: if app.ENABLE_BONUS_ANIMAL: if self.bonusTarget.IsShow(): self.name.SetPosition(23, 9) else: self.name.SetPosition(23, 13) 1.8 Add in root folder: Spoiler mob_id.py #Update Hello people, last night I was too fast making the post, and I didn't explain correctly how to add a new class, and I forgot some code, I'll explain it in more detail below. So let's go. 1. The first open uiTarget.py and replace function with this: if app.ENABLE_BONUS_ANIMAL: from mob_id import ANIMAL_VNUMS bonus_text = "" #Fix if vnum in ANIMAL_VNUMS: #Animal bonus_text += "|cFF75FF33Bonus Efectivo: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r\n" if bonus_text: #Fix self.bonusTarget.SetText(bonus_text) self.bonusTarget.SetPosition(23, 21) self.bonusTarget.Show() else: self.bonusTarget.Hide() 2. Now, go to mob_id.py and add new class, for example ORC like this: #Animals ANIMAL_VNUMS = { 101, 102, 103, 104, 105, 106, 107, 108, 109, 110 } #Orcs ORC_VNUMS = { 691 } 3.Now, you can import new vnums in uiTarget.py, don't forgot duplicate line and change localeInfo.TARGET_XXX like this: if app.ENABLE_BONUS_ANIMAL: from mob_id import ANIMAL_VNUMS, ORC_VNUMS #Call ORC vnums from mob_id.py bonus_text = "" if vnum in ANIMAL_VNUMS: #Animals. #Animal bonus_text += "|cFF75FF33Bonus Efectivo: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r\n" if vnum in ORC_VNUMS: #New Bonus #orco bonus_text += "|cFF75FF33Bonus Efectivo: " + localeInfo.TARGET_INFO_RACE_ORC + "|r\n" And that's all, be careful with the tabulation, next the images. PS: If you have the Target drop system, you probably already have the locale_game part. Original files (the photo is from MaviRuh but idk if the autor): The v2: #Fix v2: An this is all. You can use the guide or download if you have problem please tell me, and btw sorry if not the best solution but for me work, regards. #Update Links: This is the hidden content, please Sign In or Sign Up This is the hidden content, please Sign In or Sign Up Edited August 30 by nazox Core X - External 2 Internal 10 1 2 2 Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™ Proyecto: Trabajando en el. Compañeros & firma: DreamHQ - 2009-2015 [Nostalgia] Link to comment Share on other sites More sharing options...
Active Member hachiwari 139 Posted August 30 Active Member Share Posted August 30 if vnum == 5161 or vnum == 5162 or vnum == 5163 or vnum == 591 or vnum == 595 or vnum == 2191: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 2192 or vnum == 1901 or vnum == 1902 or vnum == 1903 or vnum == 1904 or vnum == 1905: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 1906 or vnum == 1304 or vnum == 1306 or vnum == 1307 or vnum == 1308 or vnum == 1309 or vnum == 1310 or vnum == 1334: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 691 or vnum == 692 or vnum == 693 or vnum == 791 or vnum == 792 or vnum == 793 or vnum == 794: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ORC + "|r - " if vnum == 2091 or vnum == 2092 or vnum == 2093 or vnum == 2095: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2206 or vnum == 2207 or vnum == 2291: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 1091 or vnum == 1092 or vnum == 1093 or vnum == 1094 or vnum == 1095 or vnum == 1096: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_DEVIL + "|r - " if vnum == 1191 or vnum == 1192 or vnum == 2595 or vnum == 2596 or vnum == 2597 or vnum == 2598 or vnum == 2591 or vnum == 993: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_UNDEAD + "|r - " if vnum == 2491 or vnum == 2492 or vnum == 2493 or vnum == 2494 or vnum == 2495: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_HUMAN + "|r - " if vnum == 2001 or vnum == 2002 or vnum == 2003 or vnum == 2004 or vnum == 2005 or vnum == 2031 or vnum == 2032 or vnum == 2033: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2034 or vnum == 2035 or vnum == 2036 or vnum == 2051 or vnum == 2052 or vnum == 2053 or vnum == 2054 or vnum == 2055: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2061 or vnum == 2062 or vnum == 2063 or vnum == 2064 or vnum == 2065 or vnum == 2071 or vnum == 2072 or vnum == 2073 or vnum == 2074 or vnum == 2075 or vnum == 2076: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 8001 or vnum == 8002 or vnum == 8003 or vnum == 8004 or vnum == 8005 or vnum == 8006 or vnum == 8006 or vnum == 8007 or vnum == 8008 or vnum == 8009 or vnum == 8010: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_METIN + "|r - " if vnum == 691: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_BOSS + "|r - " 4 Link to comment Share on other sites More sharing options...
Active Member nazox 238 Posted August 31 Author Active Member Share Posted August 31 (edited) 22 hours ago, hachiwari said: if vnum == 5161 or vnum == 5162 or vnum == 5163 or vnum == 591 or vnum == 595 or vnum == 2191: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 2192 or vnum == 1901 or vnum == 1902 or vnum == 1903 or vnum == 1904 or vnum == 1905: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 1906 or vnum == 1304 or vnum == 1306 or vnum == 1307 or vnum == 1308 or vnum == 1309 or vnum == 1310 or vnum == 1334: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 691 or vnum == 692 or vnum == 693 or vnum == 791 or vnum == 792 or vnum == 793 or vnum == 794: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ORC + "|r - " if vnum == 2091 or vnum == 2092 or vnum == 2093 or vnum == 2095: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2206 or vnum == 2207 or vnum == 2291: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 1091 or vnum == 1092 or vnum == 1093 or vnum == 1094 or vnum == 1095 or vnum == 1096: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_DEVIL + "|r - " if vnum == 1191 or vnum == 1192 or vnum == 2595 or vnum == 2596 or vnum == 2597 or vnum == 2598 or vnum == 2591 or vnum == 993: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_UNDEAD + "|r - " if vnum == 2491 or vnum == 2492 or vnum == 2493 or vnum == 2494 or vnum == 2495: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_HUMAN + "|r - " if vnum == 2001 or vnum == 2002 or vnum == 2003 or vnum == 2004 or vnum == 2005 or vnum == 2031 or vnum == 2032 or vnum == 2033: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2034 or vnum == 2035 or vnum == 2036 or vnum == 2051 or vnum == 2052 or vnum == 2053 or vnum == 2054 or vnum == 2055: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2061 or vnum == 2062 or vnum == 2063 or vnum == 2064 or vnum == 2065 or vnum == 2071 or vnum == 2072 or vnum == 2073 or vnum == 2074 or vnum == 2075 or vnum == 2076: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 8001 or vnum == 8002 or vnum == 8003 or vnum == 8004 or vnum == 8005 or vnum == 8006 or vnum == 8006 or vnum == 8007 or vnum == 8008 or vnum == 8009 or vnum == 8010: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_METIN + "|r - " if vnum == 691: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_BOSS + "|r - " Yeah, this is the original code from creator, so for this i say this is suck so i creat mob_id.py but if someone want use the original code... meh xD. Edited August 31 by nazox Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™ Proyecto: Trabajando en el. Compañeros & firma: DreamHQ - 2009-2015 [Nostalgia] Link to comment Share on other sites More sharing options...
Active Member Helia01 2253 Posted September 2 Active Member Share Posted September 2 (edited) On 8/30/2024 at 7:26 PM, hachiwari said: if vnum == 5161 or vnum == 5162 or vnum == 5163 or vnum == 591 or vnum == 595 or vnum == 2191: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 2192 or vnum == 1901 or vnum == 1902 or vnum == 1903 or vnum == 1904 or vnum == 1905: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 1906 or vnum == 1304 or vnum == 1306 or vnum == 1307 or vnum == 1308 or vnum == 1309 or vnum == 1310 or vnum == 1334: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " if vnum == 691 or vnum == 692 or vnum == 693 or vnum == 791 or vnum == 792 or vnum == 793 or vnum == 794: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ORC + "|r - " if vnum == 2091 or vnum == 2092 or vnum == 2093 or vnum == 2095: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_ANIMAL + "|r - " nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2206 or vnum == 2207 or vnum == 2291: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 1091 or vnum == 1092 or vnum == 1093 or vnum == 1094 or vnum == 1095 or vnum == 1096: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_DEVIL + "|r - " if vnum == 1191 or vnum == 1192 or vnum == 2595 or vnum == 2596 or vnum == 2597 or vnum == 2598 or vnum == 2591 or vnum == 993: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_UNDEAD + "|r - " if vnum == 2491 or vnum == 2492 or vnum == 2493 or vnum == 2494 or vnum == 2495: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_HUMAN + "|r - " if vnum == 2001 or vnum == 2002 or vnum == 2003 or vnum == 2004 or vnum == 2005 or vnum == 2031 or vnum == 2032 or vnum == 2033: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2034 or vnum == 2035 or vnum == 2036 or vnum == 2051 or vnum == 2052 or vnum == 2053 or vnum == 2054 or vnum == 2055: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 2061 or vnum == 2062 or vnum == 2063 or vnum == 2064 or vnum == 2065 or vnum == 2071 or vnum == 2072 or vnum == 2073 or vnum == 2074 or vnum == 2075 or vnum == 2076: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_FIRE + "|r - " if vnum == 8001 or vnum == 8002 or vnum == 8003 or vnum == 8004 or vnum == 8005 or vnum == 8006 or vnum == 8006 or vnum == 8007 or vnum == 8008 or vnum == 8009 or vnum == 8010: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_METIN + "|r - " if vnum == 691: nameFront += "|cFF75FF33Bonus: " + localeInfo.TARGET_INFO_RACE_BOSS + "|r - " looks like code from a senior programmer Edited September 2 by Helia01 1 Link to comment Share on other sites More sharing options...
Active Member nazox 238 Posted September 3 Author Active Member Share Posted September 3 (edited) On 9/2/2024 at 12:33 PM, Helia01 said: looks like code from a senior programmer Yes, I think this system was released a few years ago, but I don't know who it is as, I mentioned but this guy decided to use this code believing it was the best, and since it was a system that I like, I decided to move all that code to a new and more class-ordered python, but I'm sure that more than one will use that fragment instead of the new one. #pd: i use like this with new version, i think is better the old version: Edited September 3 by Metin2 Dev International Core X - External 2 Internal Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™ Proyecto: Trabajando en el. Compañeros & firma: DreamHQ - 2009-2015 [Nostalgia] Link to comment Share on other sites More sharing options...
Active Member Helia01 2253 Posted September 4 Active Member Share Posted September 4 (edited) On 9/3/2024 at 5:39 PM, nazox said: Yes, I think this system was released a few years ago, but I don't know who it is as, I mentioned but this guy decided to use this code believing it was the best, and since it was a system that I like, I decided to move all that code to a new and more class-ordered python, but I'm sure that more than one will use that fragment instead of the new one. #pd: i use like this with new version, i think is better the old version: How to say it without offending. (The code you rewrote did not become much better) For example, you constantly repeat the line "color + Bonus" despite the fact that the color there is always the same. It is more logical to put the word "Bonus" in a txt file with translations and refer to it, and substitute the color directly in the python code. But this is not the main problem: Why should I list and remember some identifiers directly from the python script when the information about the race is in item_proto, do you know what I mean? No negativity, just trying to tell me what's wrong with your code. Overall, even though I have no use for your system, I appreciate your contribution to our community. Thanks for sharing. Edited September 4 by Helia01 1 Link to comment Share on other sites More sharing options...
Active Member nazox 238 Posted September 4 Author Active Member Share Posted September 4 1 hour ago, Helia01 said: How to say it without offending. (The code you rewrote did not become much better) For example, you constantly repeat the line "color + Bonus" despite the fact that the color there is always the same. It is more logical to put the word "Bonus" in a txt file with translations and refer to it, and substitute the color directly in the python code. But this is not the main problem: Why should I list and remember some identifiers directly from the python script when the information about the race is in item_proto, do you know what I mean? No negativity, just trying to tell me what's wrong with your code. Overall, even though I have no use for your system, I appreciate your contribution to our community. Thanks for sharing. Hi, don't worry I'm not offended, I think it's important that you can give your opinion and try to give ideas about it. I really appreciate your opinion and for giving me a new approach on how to do it, I've been in Metin2 for a few years but now is when I've taken seriously to study python and c++ by myself and I'm learning with time, so I'm not very good, it's not an excuse, but it's perfect for me to improve. Before this code I tried to do something like reading the database from the python file but I couldn't make it work (I don't know if I should add the data to access or something like that), so I thought that moving all the classes to the mob_id.py file would be something better, although as you say, I repeat too much the colour and the Bonus. When I have some time I'll try applying your advice, and I'll come back with something better. Thanks again, and yes, I think it's important to contribute and help others as much as possible, best regards. 1 Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™ Proyecto: Trabajando en el. Compañeros & firma: DreamHQ - 2009-2015 [Nostalgia] Link to comment Share on other sites More sharing options...
Gopinich 48 Posted September 4 Share Posted September 4 Good job, keep going in this direction. 1 Link to comment Share on other sites More sharing options...
Recommended Posts