Jump to content

Ken

Inactive Member
  • Posts

    726
  • Joined

  • Last visited

  • Days Won

    44
  • Feedback

    0%

Community Answers

  1. Ken's post in Help fopen was marked as the answer   
    std::string GetFirstLineFromFile(std::string stFileName) { std::ifstream file(stFileName.c_str(), std::ios::in); if (!file.is_open()) return "Can not open the file"; std::string stLine = ""; if (!getline(file, stLine)) return "Can not get the first line!"; return stLine; } It will get the first line of the file. You can use this anywhere you want. (Don't forget to include fstream and string libraries)
    Best Regards
    Ken
  2. Ken's post in Metin2 quest compile problem was marked as the answer   
    It's probably missing the library in liblua folder (liblua.a). You just have to recompile liblua again. 
    Best Regards
    Ken
  3. Ken's post in [c++] mob_drop_item.txt Reload Ingame was marked as the answer   
    You should destroy everything about mob_drop_item.txt..
     



     
    your case ;
    case 'm': const int FILE_NAME_LEN = 256; char szMOBDropItemFileName[FILE_NAME_LEN]; snprintf(szMOBDropItemFileName, sizeof(szMOBDropItemFileName), "%s/mob_drop_item.txt", LocaleService_GetBasePath().c_str()); ITEM_MANAGER::Instance().DestroyMobDropItem(); if (!ITEM_MANAGER::Instance().ReadMonsterDropItemGroup(szMOBDropItemFileName)) { ch->ChatPacket(CHAT_TYPE_INFO, "Can not reload mob_drop_item.txt"); return; } ch->ChatPacket(CHAT_TYPE_INFO, "Reloaded mob_drop_item.txt!"); Edit 1:
     
    When you are kill game file, all tables will be reset. Because you are killed them. The method is work like that. 
     
    Kind Regards
    Ken
  4. Ken's post in Help new function for spawn a mob in a map was marked as the answer   
    int _spawn_mob_in_map(lua_State * L) { if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3) || !lua_isnumber(L,4) || !lua_isnumber(L,5) || !lua_isboolean(L,6)) { sys_err("Missing argument!"); return 1; } long lMapIndex = static_cast<long>(lua_tonumber(L, 1)); DWORD dwMobVnum = static_cast<DWORD>(lua_tonumber(L, 2)); long x = static_cast<long>(lua_tonumber(L, 3)); long y = static_cast<long>(lua_tonumber(L, 4)); BYTE bSpawnCount = static_cast<BYTE>(lua_tonumber(L, 5)); bool isAggressive = lua_toboolean(L, 6); const CMob * pMonster = CMobManager::instance().Get(dwMobVnum); if (pMonster) { for (BYTE i = 0; i < bSpawnCount; ++i) { LPCHARACTER pSpawnMonster = CHARACTER_MANAGER::instance().SpawnMobRange( lMapIndex, x - number(200, 750), y - number(200, 750), x + number(200, 750), y + number(200, 750), true, pMonster->m_table.bType == CHAR_TYPE_STONE, isAggressive); if (pSpawnMonster) ++bSpawnCount; } sys_log(0, "QUEST Spawn Monster: VNUM(%u) COUNT(%d) isAggressive(%d)", dwMobVnum, bSpawnCount, isAggressive); } lua_pushnumber(L, 0); return 1; } How to use it ;
    spawn_mob_in_map(mapIndex,mobVnum,coordinateX,coordinateY,spawnCount,isAggressive); Kind Regards
    Ken ~ TA
  5. Ken's post in Official mount system - summon_item was marked as the answer   
    pc.get_sig_items(vnum) System will check this in special_item_group.txt. So i mean this table
    Group 탈것교환권 { Vnum 10032 Type Quest 1 52701 1 1 2 52702 1 1 3 52703 1 1 4 52704 1 1 5 52705 1 1 6 52706 1 1 } If you wanna create new one you can do like that ;
    Group MyBrother { Vnum 10033 Type Quest 1 52707 1 1 2 52708 1 1 3 52709 1 1 4 52710 1 1 5 52711 1 1 6 52712 1 1 } local items = {pc.get_sig_items(10032)} Result :
    local items = {52701,52702,52703,52704,52705,52706}  52701 "전갑사자 교환권" "ITEM_QUEST" 0 1 "ANTI_DROP | ANTI_SELL | ANTI_GIVE | ANTI_STACK | ANTI_MYSHOP" "NONE" "NONE" "NONE" 0 0 0 0 0 "LIMIT_NONE" 0 "LIMIT_NONE" 0 "APPLY_NONE" 0 "APPLY_NONE" 0 "APPLY_NONE" 0 52031 52032 52033 52034 52035 0 0 0 0 If you wanna change give item, you can edit 52031,52032,52033,52034,52035
     
    Kind Regards
    Ken ~ TA
  6. Ken's post in C++ npc.get_level() is possible? was marked as the answer   
    int npc_get_level(lua_State * L) { LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr(); lua_pushnumber(L,npc ? npc->GetLevel() : 0); return 1; } Conditions
     
    Kind Regards
    Ken ~ TA
  7. Ken's post in Compile Error Cryptop was marked as the answer   
    Open m2server.2008.sln find that line remove it if you are not use that line.
     
    Kind Regards
    Ken ~ TA
  8. Ken's post in Hi, please help me... [INVENTORY BUG] was marked as the answer   
    Your dat files are not valid. That's all Check 4 inventory steps again.
     
    Kind Regards
    Rize
  9. Ken's post in [Question] Limit membership in a guild was marked as the answer   
    int CGuild::GetMaxMemberCount() { // GUILD_IS_FULL_BUG_FIX if ( m_iMemberCountBonus < 0 || m_iMemberCountBonus > 18 ) m_iMemberCountBonus = 0; // END_GUILD_IS_FULL_BUG_FIX if ( LC_IsHongKong() == true ) { quest::PC* pPC = quest::CQuestManager::instance().GetPC(GetMasterPID()); if ( pPC != NULL ) { if ( pPC->GetFlag("guild.is_unlimit_member") == 1 ) { return INT_MAX; } } } return 32 + 2 * (m_data.level-1) + m_iMemberCountBonus; } Kind Regards
    Zerelth ~ Ellie
  10. Ken's post in Item Dropped on ground disappears instantly was marked as the answer   
    1 minute.
    Created by myself game r34083 000505E5: 2C 3C 000505E6: 01 00 3 Minutes
    Created by myself game r34083 000505E5: 2C B4 000505E6: 01 00 Kind Regards
    Zerelth ~ Ellie
  11. Ken's post in fix warnings was marked as the answer   
    bool returnBool = false; Try this
     
    #Updated
     
    Best Regards
    Ellie
  12. Ken's post in New Config Option was marked as the answer   
    You can't do this. You must be define a variable for that.
     
    Like this ;
     
    config.h
    extern int g_iMaxPartyMember; config.cpp
    int g_iMaxPartyMember = 8; // Max Party Member is 8 (Default) TOKEN("max_party_member") { str_to_number(g_iMaxPartyMember,value_string); sys_log(0,"Party Max Member changed with %d",g_iMaxPartyMember); continue; } And search this in char.cpp
    else if (pchLeader->GetParty()) { if (pchLeader->GetParty()->GetMemberCount() == PARTY_MAX_MEMBER) return PERR_PARTYISFULL; } replace with this
    else if (pchLeader->GetParty()) { if (pchLeader->GetParty()->GetMemberCount() == g_iMaxPartyMember) return PERR_PARTYISFULL; } Best Regards
    Ellie
  13. Ken's post in Server shutting down was marked as the answer   
    If 61 map is not defined in your config or this map not exist in your locale/??/map folder, it's give this error.
     
    Best Regards
    Ellie
  14. Ken's post in error compile game was marked as the answer   
    Open your makefile and search this 
    LIBS += -lpng -ltiff -lmng -llcms -ljpeg Replace like that.
    LIBS += -lIL -lpng -ltiff -lmng -llcms -ljpeg Someone say install devil libraries or copy novaline makefile to your Project. First check Libs.
     
    Best Regards
    Ellie
     
     
  15. Ken's post in can some help me to fix this was marked as the answer   
    Sequence Problem : Your serverside sequence and binary sequence are not equal and this situation always show in syserr. And Who is in game, game is kicked them. SYSERR: Jul 18 20:49:45.119805 :: locale_find: LOCALE_ERROR: "¶³¾îءّ ¾ئہجإغہ؛ %d؛ذ بؤ »ç¶َء‎´د´ظ."; Your locale_string.txt missing this txt in locale_string.txt
    Solution : Add that txt in your locale_string.txt
    Best Regards
    Ellie
  16. Ken's post in Block warp scroll was marked as the answer   
    quest block_warpscroll begin state start begin when click with item.vnum >= 22000 and item.vnum <= 22050 begin if(item.get_sub_type() >= 3) then local index = {1,21,41} for i = 1,table.getn(index),1 do if(pc.get_map_index() >= index[i]) then syschat("You can't use to this warp scroll on this map..") return end end end end end end Best Regards
    Ellie
  17. Ken's post in proplem was marked as the answer   
    Already him using locale_ae, this problem shouldn't be. But i wonder maybe him uiInventory.py or beltInventory.py is wrong..
     
    Best Regards
    Ellie
  18. Ken's post in regen files was marked as the answer   
    Metin2 Map A1 ;
     



     
    Metin2 Map B1
     



     
    Metin2 Map C1
     



     
    Second question : Does the spawning of wild dogs instead of orcs? 
     
    Best Regards
    Ellie
×
×
  • 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.