Jump to content

Metin2 Dev

Bot
  • Posts

    2151
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Metin2 Dev

  1. FIXED. WHEN PLAYER ARE OFFLINE, ITEMS GOING IN ITEM SHOP MALL!
  2. Exactly but a lot of server haven't got the SAFEBOX OFFLINE SHOP!
  3. In the koray offline shop (a good offline shop), there is a big problem, when you close the shop, items not sold disappear! I'm there to give you the fix for this problem: Open the shop.cpp and search the function CShop::Remove(), change your function with this: void CShop::Remove() { if (!HasOwner()) return; m_bIsLocked = true; TOfflineShopTable p; memset(&p, 0, sizeof(p)); p.dwAID = m_dwOwnerAID; p.dwPID = m_dwOwnerPID; LPCHARACTER ch=CHARACTER_MANAGER::instance().FindByPID(m_dwOwnerPID); p.dwX = m_pkPC->GetX(); p.dwY = m_pkPC->GetY(); p.dwMapIndex = m_pkPC->GetMapIndex(); p.dwChannel = g_bChannel; p.ullMoney = m_Money; p.dwSize = m_bSize; p.dwColor = m_bColor; strlcpy(p.szSign, m_pkPC->GetShopSign().c_str(), sizeof(p.szSign)); for (DWORD i = 0; i < m_itemVector.size() && i < SHOP_HOST_ITEM_MAX_NUM; ++i) { SHOP_ITEM& item = m_itemVector[i]; if (item.pkItem == NULL) continue; p.items2[i] = item.itemid; p.price[i] = item.price; LPITEM item2=item.pkItem; if (item.isSold != 1) { if (ch == NULL) { sys_err("[OfflineShop] Shop owner was offline, i'm sending the items into the mall...\n"); char query_pos[1025]; snprintf(query_pos, sizeof(query_pos), "SELECT pos FROM player.item%s WHERE window='MALL' AND owner_id=%d;", get_table_postfix(), m_dwOwnerAID); SQLMsg * pMsg = DBManager::instance().DirectQuery(query_pos); if (pMsg != NULL) { int pos=0; if (pMsg->Get()->uiNumRows > 0) { MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult); str_to_number(pos, row[0]); pos+=1; } int random_id=number(1,999999999)+m_dwOwnerPID+number(1,50); int socket1=(int)item2->GetSocket(0); int socket2=(int)item2->GetSocket(1); int socket3=(int)item2->GetSocket(2); int applytype0=(int)item2->GetAttributeType(0); int applyvalue0=(int)item2->GetAttributeValue(0); int applytype1=(int)item2->GetAttributeType(1); int applyvalue1=(int)item2->GetAttributeValue(1); int applytype2=(int)item2->GetAttributeType(2); int applyvalue2=(int)item2->GetAttributeValue(2); int applytype3=(int)item2->GetAttributeType(3); int applyvalue3=(int)item2->GetAttributeValue(3); int applytype4=(int)item2->GetAttributeType(4); int applyvalue4=(int)item2->GetAttributeValue(4); int applytype5=(int)item2->GetAttributeType(5); int applyvalue5=(int)item2->GetAttributeValue(5); int applytype6=(int)item2->GetAttributeType(6); int applyvalue6=(int)item2->GetAttributeValue(6); char query[1025]; sprintf( query, // TABLE POSTFIX RANDOM-ID - AID - WINDOW - POS - COUNT - VNUM - S1 - S2 - S3 - B1 B1 B2 B2 B3 B3 B4 B4 B5 B5 B6 B6 B7 B7 "INSERT INTO player.item%s VALUES ('%d', '%d', 'MALL', '%d', '%d', '%d', '%d', '%d', '%d', '0', '0', '0', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d');", get_table_postfix(), random_id, (int)m_dwOwnerAID, pos, (int)item.count, (int)item.vnum, socket1, socket2, socket3, applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, applytype3, applyvalue3, applytype4, applyvalue4, applytype5, applyvalue5, applytype6, applyvalue6 ); std::auto_ptr<SQLMsg> ripristina(DBManager::instance().DirectQuery(query)); if (ripristina->Get()->uiAffectedRows > 0) sys_err("[OfflineShop] Done, Now items of the ID: %d are in the mall!\nQUERY: %s\n", m_dwOwnerAID, query); }else{ sys_err("[OfflineShop] Error while trying to get position.\n"); } }else{ LPITEM item3 = ITEM_MANAGER::instance().CreateItem(item2->GetVnum(), 1, 0, false); ITEM_MANAGER::CopyAllAttrTo(item2, item3); int Slot=ch->GetEmptyInventory(item2->GetSize()); item3->AddToCharacter(ch, TItemPos(INVENTORY, Slot)); ITEM_MANAGER::instance().FlushDelayedSave(item3); item3->AttrLog(); } }else{ item.pkItem->SetSkipSave(true); M2_DESTROY_ITEM(item.pkItem); memset(&item, 0, sizeof(item)); } } db_clientdesc->DBPacket(HEADER_GD_OFFLINE_SHOP_REMOVE, 0, &p, sizeof(p)); }
  4. HI GUYS I NEED HELP, I HAVE A BIG PROBLEM WITH THE KORAY OFFLINE SHOP, AFTER THE INSTALLATION THE OFFLINE SHOP WORKS WELL BUT THE "TYPE 0" (THE PRIVATE SHOP) NOT WORK! THE STANDARD SHOP WHEN I CLICK TO THE SHOP DOESN'T SHOW ME THE WINDOW OF ITEM! WHY? I CHECK A LOT OF TIMES THE FUNCTIONS IN THE SOURCE BUT WITHOUT ANY RESULTS. CAN U HELP ME? And if i try to "disconnect" or "change character" not work!
  5. M2 Download Center Download Here ( 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. Here: cmd_gm.cpp FUNCTIONS: #include <iostream> #include <vector> #include <string> void split(const std::string& s, char delim, std::vector<std::string>& v) { int i = 0; int pos = s.find(delim); while (pos != std::string::npos) { v.push_back(s.substr(i, pos-i)); i = ++pos; pos = s.find(delim, pos); if (pos == std::string::npos) v.push_back(s.substr(i, s.length())); } } int countChars(char* s, char c) { return *s == '\0' ? 0 : countChars( s + 1, c ) + (*s == c); } COMMAND: ACMD(do_create_item) { char item[256]; char bonus[1024]; two_arguments(argument, item, sizeof(item), bonus, sizeof(bonus)); if (!*item || !*bonus) { ch->ChatPacket(CHAT_TYPE_INFO, "Usage: /create_item <value_item> <b1:v1,b2:v2,b3:v3,b4:v4,b5:v5,b6:v6,b7:v7>"); ch->ChatPacket(CHAT_TYPE_INFO, ""); ch->ChatPacket(CHAT_TYPE_INFO, "[b] = Bonus vnum"); ch->ChatPacket(CHAT_TYPE_INFO, "[v] = Bonus value"); ch->ChatPacket(CHAT_TYPE_INFO, ""); ch->ChatPacket(CHAT_TYPE_INFO, "Created by RaFFa."); return; } if (bonus[(strlen(bonus)-1)] == ',') { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> [Err1] Syntax Error."); return; } if (bonus[(strlen(bonus)-1)] == ':') { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> [Err2] Syntax Error."); return; } if (strstr(bonus, ":") == NULL) { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> [Err3] Syntax Error."); return; } if (strstr(bonus, ",") == NULL) { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> Adding 1 bonus..."); int vnum=0; str_to_number(vnum, item); LPITEM i = ITEM_MANAGER::instance().CreateItem(vnum); if (!i) { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> This item-vnum not exists."); return; } int bonus_vnum=0; int bonus_value=0; std::vector<std::string> bonus2; split(std::string(bonus), ':', bonus2); str_to_number(bonus_vnum, std::string(bonus2[0]).c_str()); str_to_number(bonus_value, std::string(bonus2[1]).c_str()); i->SetForceAttribute(0, bonus_vnum, bonus_value); i->SetSocket(0, 1); int inventario = ch->GetEmptyInventory(i->GetSize()); if (inventario != -1) { i->AddToCharacter(ch, TItemPos(INVENTORY, inventario)); ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> Item created successfully."); }else{ M2_DESTROY_ITEM(i); ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> You haven't enough space in inventory."); } }else{ std::vector<std::string> bonus1; split(std::string(bonus), ',', bonus1); if (bonus1.size()>0) { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> Adding %d bonus...", (int)bonus1.size()); if (countChars(bonus, ':') != (int)bonus1.size()) { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> [Err4] Syntax Error."); return; } int vnum=0; str_to_number(vnum, item); LPITEM i = ITEM_MANAGER::instance().CreateItem(vnum); if (!i) { ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> This item-vnum not exists."); return; } int b_size=bonus1.size(); if (bonus1.size()>6) b_size=7; int bonus_vnum=0; int bonus_value=0; for (int n=0; n<b_size; n++) { std::vector<std::string> bonus2; split(std::string(bonus1[n]), ':', bonus2); str_to_number(bonus_vnum, std::string(bonus2[0]).c_str()); str_to_number(bonus_value, std::string(bonus2[1]).c_str()); i->SetForceAttribute(n, bonus_vnum, bonus_value); } i->SetSocket(0, 1); int inventario = ch->GetEmptyInventory(i->GetSize()); if (inventario != -1) { i->AddToCharacter(ch, TItemPos(INVENTORY, inventario)); ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> Item created successfully!"); }else{ M2_DESTROY_ITEM(i); ch->ChatPacket(CHAT_TYPE_INFO, "<CreateItem> You haven't enough space in inventory."); } } } } cmd.cpp ACMD(do_create_item); and: (into the struct command_info cmd_info[]) {"create_item", do_create_item, 0, POS_DEAD, GM_IMPLEMENTOR},
  7. Search @martysama0134 , he has that system in his source. Maybe he sell separated for a good price .
  8. This is even Lennts work. I also got it but i want a better one. (Jeha they all do the same but lennt isnt a good coder, he just c&p code fragments). But thanks for your answer
  9. PACI told me he wont sell it anymore.. This is why im searching for now.
  10. Hello guys, im searching for some professional coded dungeon runs, not like LENNT! This dungeons are the arboreal menace dungeon and meleys lair. But in first order im searching for the arboreal menace. This dungeons should be closely to the gf version with their effects and so on. If you know somebody let me know about and leave a response. Thanks in advance!
  11. I can now start the binary by using the visual studio debugger, but i get this error: [Hidden Content] I copied my whole client into the /bin path, where my UserInterface.exe will created. If i start the file with click on it it work, but over vs this error come every time. If i rename the python27.dll i get an error that the binary does not find the dll. Any ideas?
  12. I tried to use the "local windows-debugger", if i run it i get this error: [Hidden Content] In english: not possible to start CWebBrowser.lib The file is at the right place and i get no other errors, any ideas?
  13. Hello, is it possible to debug the binary? I dont mean to compile in debug mode, i mean live debug, something like remote debugging or something like this. Anyone has an idea how to do this?
  14. Hey, I added you in skype. There is a bug with the slots and at the moment I am trying to know, if your bugfix was for that bug. I send some Screens:
  15. Can you tell me how i do this or give me a tutorial? You mean something like 3ds max right?
  16. Yes i did: [Hidden Content] I tried to change number 4 - 6 but still wrong position.
×
×
  • 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.