Bot Metin2 Dev 4929 Posted June 16, 2017 Bot Share Posted June 16, 2017 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Open char.cpp and find this function void CHARACTER::PointChange(BYTE type, int amount, bool bAmount, bool bBroadcast) Search the case POINT_EXP and replace with this: case POINT_EXP: { if (GetQuestFlag("exp_block") == 0) { DWORD exp = GetExp(); DWORD next_exp = GetNextExp(); if (amount < 0 && exp < -amount) { sys_log(1, "%s AMOUNT < 0 %d, CUR EXP: %d", GetName(), -amount, exp); amount = -exp; SetExp(exp + amount); val = GetExp(); } else { if (gPlayerMaxLevel <= GetLevel()) return; if (test_server) ChatPacket(CHAT_TYPE_INFO, "You have gained %d exp.", amount); DWORD iExpBalance = 0; if (exp + amount >= next_exp) { iExpBalance = (exp + amount) - next_exp; amount = next_exp - exp; SetExp(0); exp = next_exp; } else { SetExp(exp + amount); exp = GetExp(); } DWORD q = DWORD(next_exp / 4.0f); int iLevStep = GetRealPoint(POINT_LEVEL_STEP); if (iLevStep >= 4) { sys_err("%s LEVEL_STEP bigger than 4! (%d)", GetName(), iLevStep); iLevStep = 4; } if (exp >= next_exp && iLevStep < 4) { for (int i = 0; i < 4 - iLevStep; ++i) PointChange(POINT_LEVEL_STEP, 1, false, true); } else if (exp >= q * 3 && iLevStep < 3) { for (int i = 0; i < 3 - iLevStep; ++i) PointChange(POINT_LEVEL_STEP, 1, false, true); } else if (exp >= q * 2 && iLevStep < 2) { for (int i = 0; i < 2 - iLevStep; ++i) PointChange(POINT_LEVEL_STEP, 1, false, true); } else if (exp >= q && iLevStep < 1) PointChange(POINT_LEVEL_STEP, 1); if (iExpBalance) { PointChange(POINT_EXP, iExpBalance); } val = GetExp(); } }else{ val = GetExp(); } } break; Now open Questlua_pc.cpp and add this in the namespace quest: int pc_block_exp(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if (!lua_isnumber(L, 1)) { return 0; } int type=lua_tonumber(L,1); ch->SetQuestFlag("exp_block", type); if (type == 0) { ch->ChatPacket(CHAT_TYPE_INFO, "<ExpBlockSystem> [%d] You unlock your experience.", ch->GetQuestFlag("exp_block")); }else{ ch->ChatPacket(CHAT_TYPE_INFO, "<ExpBlockSystem> [%d] You lock your experience.", ch->GetQuestFlag("exp_block")); } return 0; } And this in the RegisterPCFunctionTable: { "block_exp", pc_block_exp }, Now compile your source, and try this quest: quest ExpBlockQuest begin state start begin when 72501.use begin say_title("Block EXP Ring:") say("") local s = select("Lock EXP", "Unlock EXP", "Reset EXP", "Close") if s == 1 then pc.block_exp(1) setskin(NOWINDOW) elseif s == 2 then pc.block_exp(0) setskin(NOWINDOW) elseif s == 3 then say_title("Block EXP Ring:") say("") say("Are you sure to reset[ENTER]your EXP points: "..pc.get_exp().."?") local s2=select("Yes", "No") if s2 == 1 then pc.block_exp(0) pc.give_exp2(-pc.get_exp()) syschat("<ExpBlockSystem> You reset your experience.") setskin(NOWINDOW) end end end end end 6 2 2 9 Link to comment Share on other sites More sharing options...
Tasho 244 Posted June 17, 2017 Share Posted June 17, 2017 Why not? Quote int type=lua_tonumber(L,1); PC* Check = CQuestManager::Instance().GetCurrentPC(); Check->SetFlag("exp_block", type); ch->SetQuestFlag("exp_block", type); Quote if (type == 0) { ch->ChatPacket(CHAT_TYPE_INFO, "<ExpBlockSystem> [%d] You unlock your experience.", Check->GetFlag("exp_block")); }else{ ch->ChatPacket(CHAT_TYPE_INFO, "<ExpBlockSystem> [%d] You lock your experience.", Check->GetFlag("exp_block")); } ch->ChatPacket(CHAT_TYPE_INFO, "<ExpBlockSystem> [%d] You %s your experience.", ch->GetQuestFlag("exp_block"), (type == 0 ? "lock" : "unlock")); 1 Link to comment Share on other sites More sharing options...
avertuss 48 Posted July 17, 2017 Share Posted July 17, 2017 @M2BobFixed After relog antyexp don't work. Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4929 Posted August 5, 2017 Author Bot Share Posted August 5, 2017 On 17/7/2017 at 2:57 PM, avertuss said: @M2BobFixed After relog antyexp don't work. I think you have some problem in Quest in database! Link to comment Share on other sites More sharing options...
Premium TAUMP 852 Posted August 7, 2017 Premium Share Posted August 7, 2017 On 8/5/2017 at 5:20 PM, M2BobFixed said: I think you have some problem in Quest in database! lol Link to comment Share on other sites More sharing options...
Recommended Posts