Jump to content

CONTROL

Member
  • Posts

    9
  • Joined

  • Last visited

  • Feedback

    0%

About CONTROL

Recent Profile Visitors

254 profile views

CONTROL's Achievements

Enthusiast

Enthusiast (6/16)

  • Conversation Starter
  • First Post
  • One Year In
  • Dedicated
  • Reacting Well

Recent Badges

5

Reputation

  1. Thx, You might consider using a separate thread and sleep() if you're worried about performance or just check the root (if your index is from the source) nothing else really matter, but the thing here is that you can just cython your root and avoid all this non sense + improve the performance , And if you wanted an extra protection on the root you can also use dynamic python moudles, Both of these things are already shared in here..
  2. thx for ur time & sry about the section it's just my first topic in here when i said performance friendly i didn't really meant something that huge lmao XD and about the (break) it's not just a me thing most or even all pvm servers have (race + element) on some mobs and 1 of them will be disabled if they have the old code written above so i think it would be better to make 2 loops and use break on each one of them to get a single ( race + element ) struct RacePointPair { int raceFlag; uint8_t pointAttribute; }; RacePointPair racePointTable[] = { { RACE_FLAG_ANIMAL, POINT_ATTBONUS_ANIMAL }, { RACE_FLAG_UNDEAD, POINT_ATTBONUS_UNDEAD }, { RACE_FLAG_DEVIL, POINT_ATTBONUS_DEVIL }, { RACE_FLAG_HUMAN, POINT_ATTBONUS_HUMAN }, { RACE_FLAG_ORC, POINT_ATTBONUS_ORC }, { RACE_FLAG_MILGYO, POINT_ATTBONUS_MILGYO }, { RACE_FLAG_INSECT, POINT_ATTBONUS_INSECT }, { RACE_FLAG_DESERT, POINT_ATTBONUS_DESERT }, { RACE_FLAG_TREE, POINT_ATTBONUS_TREE } #ifdef ENABLE_NEW_ATTR ,{ RACE_FLAG_METIN, POINT_ATTBONUS_METIN } #endif #ifdef ENABLE_ZODIAC_ATTR ,{ RACE_FLAG_ZODIAC, POINT_ATTBONUS_ZODIAC } #endif #ifdef ENABLE_LEGENDARY_ATTR ,{ RACE_FLAG_LEGENDARY, POINT_ATTBONUS_LEGENDARY } #endif }; for (uint8_t i = 0; i < _countof(racePointTable); i++) { if (pkVictim->IsRaceFlag(racePointTable[i].raceFlag)) { iAtk += (iAtk * pkAttacker->GetPoint(racePointTable[i].pointAttribute)) / 100; break; } } RacePointPair elementPointTable[] = { { RACE_FLAG_FIRE, POINT_ATTBONUS_FIRE }, { RACE_FLAG_ICE, POINT_ATTBONUS_ICE } #ifdef ELEMENT_NEW_BONUSES ,{ RACE_FLAG_ELEC, POINT_ATTBONUS_ELEC } ,{ RACE_FLAG_WIND, POINT_ATTBONUS_WIND } ,{ RACE_FLAG_EARTH, POINT_ATTBONUS_EARTH } ,{ RACE_FLAG_DARK, POINT_ATTBONUS_DARK } #endif }; for (uint8_t i = 0; i < _countof(elementPointTable); i++) { if (pkVictim->IsRaceFlag(elementPointTable[i].raceFlag)) { iAtk += (iAtk * pkAttacker->GetPoint(elementPointTable[i].pointAttribute)) / 100; break; } }
  3. hi, today when i was trying my new element bonuses system i noticed that the elements cannot be with another race flag like RACE_FLAG_DEVIL for example so i went to the jungles of my source and i discoverd a little crime in battle.cpp if (pkVictim->IsRaceFlag(RACE_FLAG_ANIMAL)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ANIMAL)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_UNDEAD)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_UNDEAD)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_DEVIL)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_DEVIL)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_HUMAN)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_HUMAN)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_ORC)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ORC)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_MILGYO)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_MILGYO)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_INSECT)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_INSECT)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_FIRE)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_FIRE)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_ICE)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_ICE)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_DESERT)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_DESERT)) / 100; else if (pkVictim->IsRaceFlag(RACE_FLAG_TREE)) iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_TREE)) / 100; the redundancy in here is not just preventing the flags to be together it's affecting the performance too.. so i've changed the entire thing in order to make it less messy, and more readable & performance friendly (considering that this is one of the functions that should be triggered with each attack !!) you can adjust it based on your bonuses and all .. Thx
  4. you can just add a if vnum <= 0: return Before selecting any items
  5. I remember I ran into this 4 years ago or something, and I just threw a *4 after the number 8096 and looked away But this seems more efficient thx < 3
  6. input_main.cpp else if (iDelta < -(iServerDelta / 50)) // Bugged { // I understand that it goes 20msec faster in 1 second. sys_log(0, "SPEEDHACK: DETECTED! %s (delta %d %d)", ch->GetName(), iDelta, iServerDelta); if (ch->GetGMLevel() == GM_IMPLEMENTOR) { // Logged @fixme415 ch->ChatPacket(CHAT_TYPE_INFO, "SPEEDHACK: DETECTED! %s (delta %d %d)", ch->GetName(), iDelta, iServerDelta); } else { //ch->GetDesc()->DelayedDisconnect(3); } } i had this problem before, it's mainly because of this right here, if you're not working on a live server you gonna have to adjust the server time zone with (tzsetup) every once in a while or just disable the DelayedDisconnect and keep working. Great fix btw thx @ Distraught
  7. You must be having a terrible brain damage for that or you're just a 10yo
  8. srsly ? def OnPickItem(self, count): itemSlotIndex = self.dlgPickItem.itemGlobalSlotIndex n = 0 while n < count: net.SendShopBuyPacket(self.__GetRealIndex(itemSlotIndex)) n = n + 1
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.