Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/29/18 in all areas

  1. The best results are achieved using os.time() for seeding. math.randomseed(os.time()) local random = math.random(1, 100) print(random) However, I prefer to use the built-in function for these kind of matters: number(min, max).
    2 points
  2. M2 Download Center Download Here ( Internal ) Hi devs, I created simple wait hack detection and ban system open "battle.cpp" and add ths include #include "db.h" Result; search "bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)" and replace with this #define ENABLE_SYSCHAT_NOTICE #define ENABLE_SYSLOG_NOTICE #define ENABLE_BAN_WAITHACK bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time) { if (ch->m_kAttackLog.dwVID == victim->GetVID()) { if (current_time - ch->m_kAttackLog.dwTime < GET_ATTACK_SPEED(ch)) { INCREASE_SPEED_HACK_COUNT(ch); if (test_server) { sys_log(0, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d", ch->GetName(), current_time - ch->m_kAttackLog.dwTime, GET_ATTACK_SPEED(ch), ch->m_speed_hack_count); ch->ChatPacket(CHAT_TYPE_INFO, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d", ch->GetName(), current_time - ch->m_kAttackLog.dwTime, GET_ATTACK_SPEED(ch), ch->m_speed_hack_count); } SET_ATTACK_TIME(ch, victim, current_time); SET_ATTACKED_TIME(ch, victim, current_time); return true; } } SET_ATTACK_TIME(ch, victim, current_time); if (victim->m_AttackedLog.dwPID == ch->GetPlayerID()) { if (current_time - victim->m_AttackedLog.dwAttackedTime < GET_ATTACK_SPEED(ch)) { INCREASE_SPEED_HACK_COUNT(ch); if (ch->m_speed_hack_count > 50) { #ifdef ENABLE_SYSLOG_NOTICE sys_log(0, "%s Attack Speed HACK! time (delta, limit)=(%u, %u), hack_count = %d", ch->GetName(), current_time - victim->m_AttackedLog.dwAttackedTime, GET_ATTACK_SPEED(ch), ch->m_speed_hack_count); #endif #ifdef ENABLE_SYSCHAT_NOTICE ch->ChatPacket(CHAT_TYPE_INFO, "Attack Speed Hack(%s), (delta, limit)=(%u, %u), hack_count = %d", ch->GetName(), current_time - victim->m_AttackedLog.dwAttackedTime, GET_ATTACK_SPEED(ch), ch->m_speed_hack_count); #endif #ifdef ENABLE_BAN_WAITHACK std::auto_ptr<SQLMsg> msg(DBManager::instance().DirectQuery("UPDATE account.account SET status= 'BLOCK' WHERE id = %d", ch->GetDesc()->GetAccountTable().id)); #endif ch->GetDesc()->DelayedDisconnect(3); } SET_ATTACKED_TIME(ch, victim, current_time); return true; } } SET_ATTACKED_TIME(ch, victim, current_time); return false; } Before: [Hidden Content] [Hidden Content] After: [Hidden Content] [Hidden Content] Final:
    1 point
  3. 1 point
  4. char_item.cpp case USE_ADD_ATTRIBUTE : find for vnums
    1 point
  5. @xP3NG3Rx for me you can give an ferrari enzo please? I really need that.
    1 point
  6. Comming soon Titan2.global
    0 points
  7. I'm having trouble with the item 30270 (dragonsoul gem). So here is the issue: The item cannot be dropped until after the char has become qualified (complete the Alchemist mission). I don't know what's wrong. I checked the source 1000 times and my quest is normal. I saw that this was commented in item_manager.cpp: if (pkChr->GetLevel() >= 30 && (GetDropPerKillPct(50, 100, iDeltaPercent, "ds_drop") >= number(1, iRandRange))) { const static DWORD dragon_soul_gemstone = 30270; if ((item = CreateItem(dragon_soul_gemstone, 1, 0, true))) { vec_item.push_back(item); } } So I uncommented it. Nothing changed. I also tried to modify it so the specific item keeps ownership until it gets purged. This is how I changed it: if (pkChr->GetLevel() >= 30 && (GetDropPerKillPct(50, 100, iDeltaPercent, "ds_drop") >= number(1, iRandRange))) { const static DWORD dragon_soul_gemstone = 30270; if ((item = CreateItem(dragon_soul_gemstone, 1, 0, true))) { item->SetOwnership (pkChr, item_floor_time); vec_item.push_back(item); } } where item_floor_time = 3 minutes. This didn't work either. My quest:
    0 points
×
×
  • 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.