Hallo ich habe grade die steine bearbeitet und Uppsystem usw. gemacht.
ich habe alles korrekt eingefügt für das Uppen der Steine. Und ich kann steine nur per schmied Uppen.
alles andere geht nicht und da kommt so china shit. wie im 2. bild zu sehen ist.
woran kann es liegen?
Bei anderen Sachen wie z.B Schwert +8 geht es mit Magischer Stein usw. nur bei Steinen nicht !!!
Nutze Fliege 2.1
Schmied :
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Magischer Stein oder änliches :
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Source/char_item.cpp // DoRefineWhitScroll und RefineInformation
- bool CHARACTER::DoRefineWithScroll(LPITEM item)
- {
- if (!CanHandleItem(true))
- {
- ClearRefineMode();
- return false;
- }
- ClearRefineMode();
- //개량 시간제한 : upgrade_refine_scroll.quest 에서 개량후 5분이내에 일반 개량을
- //진행할수 없음
- if (quest::CQuestManager::instance().GetEventFlag("update_refine_time") != 0)
- {
- if (get_global_time() < quest::CQuestManager::instance().GetEventFlag("update_refine_time") + (60 * 5))
- {
- sys_log(0, "can't refine %d %s", GetPlayerID(), GetName());
- return false;
- }
- }
- const TRefineTable * prt = CRefineManager::instance().GetRefineRecipe(item->GetRefineSet());
- if (!prt)
- return false;
- LPITEM pkItemScroll;
- // 개량서 체크
- if (m_iRefineAdditionalCell < 0)
- return false;
- pkItemScroll = GetInventoryItem(m_iRefineAdditionalCell);
- if (!pkItemScroll)
- return false;
- if (!(pkItemScroll->GetType() == ITEM_USE && pkItemScroll->GetSubType() == USE_TUNING))
- return false;
- if (pkItemScroll->GetVnum() == item->GetVnum())
- return false;
- DWORD result_vnum = item->GetRefinedVnum();
- DWORD result_fail_vnum = item->GetRefineFromVnum();
- if (result_vnum == 0)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("더 이상 개량할 수 없습니다."));
- return false;
- }
- // MUSIN_SCROLL
- if (pkItemScroll->GetValue(0) == MUSIN_SCROLL)
- {
- if (item->GetRefineLevel() >= 4)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 개량서로 더 이상 개량할 수 없습니다."));
- return false;
- }
- }
- // END_OF_MUSIC_SCROLL
- else if (pkItemScroll->GetValue(0) == MEMO_SCROLL)
- {
- if (item->GetRefineLevel() != pkItemScroll->GetValue(1))
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 개량서로 개량할 수 없습니다."));
- return false;
- }
- }
- else if (pkItemScroll->GetValue(0) == BDRAGON_SCROLL)
- {
- if (item->GetType() != ITEM_METIN || item->GetRefineLevel() != 4)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템으로 개량할 수 없습니다."));
- return false;
- }
- }
- TItemTable * pProto = ITEM_MANAGER::instance().GetTable(item->GetRefinedVnum());
- if (!pProto)
- {
- sys_err("DoRefineWithScroll NOT GET ITEM PROTO %d", item->GetRefinedVnum());
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
- return false;
- }
- // Check level limit in korea only
- if (!g_iUseLocale)
- {
- for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
- {
- long limit = pProto->aLimits[i].lValue;
- switch (pProto->aLimits[i].bType)
- {
- case LIMIT_LEVEL:
- if (GetLevel() < limit)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("개량된 후 아이템의 레벨 제한보다 레벨이 낮습니다."));
- return false;
- }
- break;
- }
- }
- }
- if (GetGold() < prt->cost)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("개량을 하기 위한 돈이 부족합니다."));
- return false;
- }
- for (int i = 0; i < prt->material_count; ++i)
- {
- if (CountSpecifyItem(prt->materials[i].vnum) < prt->materials[i].count)
- {
- if (test_server)
- {
- ChatPacket(CHAT_TYPE_INFO, "Find %d, count %d, require %d", prt->materials[i].vnum, CountSpecifyItem(prt->materials[i].vnum), prt->materials[i].count);
- }
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("개량을 하기 위한 재료가 부족합니다."));
- return false;
- }
- }
- for (int i = 0; i < prt->material_count; ++i)
- RemoveSpecifyItem(prt->materials[i].vnum, prt->materials[i].count);
- int prob = number(1, 100);
- int success_prob = prt->prob;
- bool bDestroyWhenFail = false;
- const char* szRefineType = "SCROLL";
- if (pkItemScroll->GetValue(0) == HYUNIRON_CHN ||
- pkItemScroll->GetValue(0) == YONGSIN_SCROLL ||
- pkItemScroll->GetValue(0) == YAGONG_SCROLL) // 현철, 용신의 축복서, 야공의 비전서 처리
- {
- const char hyuniron_prob[9] = { 100, 75, 65, 55, 45, 40, 35, 25, 20 };
- const char hyuniron_prob_euckr[9] = { 100, 75, 65, 55, 45, 40, 35, 30, 25 };
- const char yagong_prob[9] = { 100, 100, 90, 80, 70, 60, 50, 30, 20 };
- const char yagong_prob_euckr[9] = { 100, 100, 90, 80, 70, 60, 50, 40, 30 };
- if (pkItemScroll->GetValue(0) == YONGSIN_SCROLL)
- {
- if (LC_IsYMIR() == true || LC_IsKorea() == true)
- success_prob = hyuniron_prob_euckr[MINMAX(0, item->GetRefineLevel(), 8)];
- else
- success_prob = hyuniron_prob[MINMAX(0, item->GetRefineLevel(), 8)];
- }
- else if (pkItemScroll->GetValue(0) == YAGONG_SCROLL)
- {
- if (LC_IsYMIR() == true || LC_IsKorea() == true)
- success_prob = yagong_prob_euckr[MINMAX(0, item->GetRefineLevel(), 8)];
- else
- success_prob = yagong_prob[MINMAX(0, item->GetRefineLevel(), 8)];
- }
- else
- {
- sys_err("REFINE : Unknown refine scroll item. Value0: %d", pkItemScroll->GetValue(0));
- }
- if (test_server)
- {
- ChatPacket(CHAT_TYPE_INFO, "[Only Test] Success_Prob %d, RefineLevel %d ", success_prob, item->GetRefineLevel());
- }
- if (pkItemScroll->GetValue(0) == HYUNIRON_CHN) // 현철은 아이템이 부서져야 한다.
- bDestroyWhenFail = true;
- // DETAIL_REFINE_LOG
- if (pkItemScroll->GetValue(0) == HYUNIRON_CHN)
- {
- szRefineType = "HYUNIRON";
- }
- else if (pkItemScroll->GetValue(0) == YONGSIN_SCROLL)
- {
- szRefineType = "GOD_SCROLL";
- }
- else if (pkItemScroll->GetValue(0) == YAGONG_SCROLL)
- {
- szRefineType = "YAGONG_SCROLL";
- }
- // END_OF_DETAIL_REFINE_LOG
- }
- // DETAIL_REFINE_LOG
- if (pkItemScroll->GetValue(0) == MUSIN_SCROLL) // 무신의 축복서는 100% 성공 (+4까지만)
- {
- success_prob = 100;
- szRefineType = "MUSIN_SCROLL";
- }
- // END_OF_DETAIL_REFINE_LOG
- else if (pkItemScroll->GetValue(0) == MEMO_SCROLL)
- {
- success_prob = 100;
- szRefineType = "MEMO_SCROLL";
- }
- else if (pkItemScroll->GetValue(0) == BDRAGON_SCROLL)
- {
- success_prob = 80;
- szRefineType = "BDRAGON_SCROLL";
- }
- pkItemScroll->SetCount(pkItemScroll->GetCount() - 0);
- if (prob <= success_prob)
- {
- // 성공! 모든 아이템이 사라지고, 같은 속성의 다른 아이템 획득
- LPITEM pkNewItem = ITEM_MANAGER::instance().CreateItem(result_vnum, 1, 0, false);
- if (pkNewItem)
- {
- ITEM_MANAGER::CopyAllAttrTo(item, pkNewItem);
- LogManager::instance().ItemLog(this, pkNewItem, "REFINE SUCCESS", pkNewItem->GetName());
- BYTE bCell = item->GetCell();
- NotifyRefineSuccess(this, item, szRefineType);
- DBManager::instance().SendMoneyLog(MONEY_LOG_REFINE, item->GetVnum(), -prt->cost);
- ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (REFINE SUCCESS)");
- pkNewItem->AddToCharacter(this, TItemPos(INVENTORY, bCell));
- ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
- pkNewItem->AttrLog();
- //PointChange(POINT_GOLD, -prt->cost);
- PayRefineFee(prt->cost);
- }
- else
- {
- // 아이템 생성에 실패 -> 개량 실패로 간주
- sys_err("cannot create item %u", result_vnum);
- NotifyRefineFail(this, item, szRefineType);
- }
- }
- else if (!bDestroyWhenFail && result_fail_vnum)
- {
- // 실패! 모든 아이템이 사라지고, 같은 속성의 낮은 등급의 아이템 획득
- LPITEM pkNewItem = ITEM_MANAGER::instance().CreateItem(result_fail_vnum, 1, 0, false);
- if (pkNewItem)
- {
- ITEM_MANAGER::CopyAllAttrTo(item, pkNewItem);
- LogManager::instance().ItemLog(this, pkNewItem, "REFINE FAIL", pkNewItem->GetName());
- BYTE bCell = item->GetCell();
- DBManager::instance().SendMoneyLog(MONEY_LOG_REFINE, item->GetVnum(), -prt->cost);
- NotifyRefineFail(this, item, szRefineType, -1);
- ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (REFINE FAIL)");
- pkNewItem->AddToCharacter(this, TItemPos(INVENTORY, bCell));
- ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
- pkNewItem->AttrLog();
- //PointChange(POINT_GOLD, -prt->cost);
- PayRefineFee(prt->cost);
- }
- else
- {
- // 아이템 생성에 실패 -> 개량 실패로 간주
- sys_err("cannot create item %u", result_fail_vnum);
- NotifyRefineFail(this, item, szRefineType);
- }
- }
- else
- {
- NotifyRefineFail(this, item, szRefineType); // 개량시 아이템 사라지지 않음
-
- PayRefineFee(prt->cost);
- }
- return true;
- }
- bool CHARACTER::RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell)
- {
- if (bCell > INVENTORY_MAX_NUM)
- return false;
- LPITEM item = GetInventoryItem(bCell);
- if (!item)
- return false;
- // REFINE_COST
- if (bType == REFINE_TYPE_MONEY_ONLY && !GetQuestFlag("deviltower_zone.can_refine"))
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("사귀 타워 완료 보상은 한번까지 사용가능합니다."));
- return false;
- }
- // END_OF_REFINE_COST
- TPacketGCRefineInformation p;
- p.header = HEADER_GC_REFINE_INFORMATION;
- p.pos = bCell;
- p.src_vnum = item->GetVnum();
- p.result_vnum = item->GetRefinedVnum();
- p.type = bType;
- if (p.result_vnum == 0)
- {
- sys_err("RefineInformation p.result_vnum == 0");
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
- return false;
- }
- if (item->GetType() == ITEM_USE && item->GetSubType() == USE_TUNING)
- {
- if (bType == 0)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 이 방식으로는 개량할 수 없습니다."));
- return false;
- }
- else
- {
- LPITEM itemScroll = GetInventoryItem(iAdditionalCell);
- if (!itemScroll || item->GetVnum() == itemScroll->GetVnum())
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("같은 개량서를 합칠 수는 없습니다."));
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("축복의 서와 현철을 합칠 수 있습니다."));
- return false;
- }
- }
- }
- CRefineManager & rm = CRefineManager::instance();
- const TRefineTable* prt = rm.GetRefineRecipe(item->GetRefineSet());
- if (!prt)
- {
- sys_err("RefineInformation NOT GET REFINE SET %d", item->GetRefineSet());
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
- return false;
- }
- // REFINE_COST
-
- //MAIN_QUEST_LV7
- if (GetQuestFlag("main_quest_lv7.refine_chance") > 0)
- {
- // 일본은 제외
- if (!item->CheckItemUseLevel(20) || item->GetType() != ITEM_WEAPON)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("무료 개량 기회는 20 이하의 무기만 가능합니다"));
- return false;
- }
- p.cost = 0;
- }
- else
- p.cost = ComputeRefineFee(prt->cost);
-
- //END_MAIN_QUEST_LV7
- p.prob = prt->prob;
- if (bType == REFINE_TYPE_MONEY_ONLY)
- {
- p.material_count = 0;
- memset(p.materials, 0, sizeof(p.materials));
- }
- else
- {
- p.material_count = prt->material_count;
- thecore_memcpy(&p.materials, prt->materials, sizeof(prt->materials));
- }
- // END_OF_REFINE_COST
- GetDesc()->Packet(&p, sizeof(TPacketGCRefineInformation));
- SetRefineMode(iAdditionalCell);
- return true;
- }
- bool CHARACTER::RefineItem(LPITEM pkItem, LPITEM pkTarget)
- {
- if (!CanHandleItem())
- return false;
- if (pkItem->GetSubType() == USE_TUNING)
- {
- // XXX 성능, 소켓 개량서는 사라졌습니다...
- // XXX 성능개량서는 축복의 서가 되었다!
- // MUSIN_SCROLL
- if (pkItem->GetValue(0) == MUSIN_SCROLL)
- RefineInformation(pkTarget->GetCell(), REFINE_TYPE_MUSIN, pkItem->GetCell());
- // END_OF_MUSIN_SCROLL
- else if (pkItem->GetValue(0) == HYUNIRON_CHN)
- RefineInformation(pkTarget->GetCell(), REFINE_TYPE_HYUNIRON, pkItem->GetCell());
- else if (pkItem->GetValue(0) == BDRAGON_SCROLL)
- {
- if (pkTarget->GetRefineSet() != 702) return false;
- RefineInformation(pkTarget->GetCell(), REFINE_TYPE_BDRAGON, pkItem->GetCell());
- }
- else
- {
- if (pkTarget->GetRefineSet() == 501) return false;
- RefineInformation(pkTarget->GetCell(), REFINE_TYPE_SCROLL, pkItem->GetCell());
- }
- }
- else if (pkItem->GetSubType() == USE_DETACHMENT && IS_SET(pkTarget->GetFlag(), ITEM_FLAG_REFINEABLE))
- {
- LogManager::instance().ItemLog(this, pkTarget, "USE_DETACHMENT", pkTarget->GetName());
- bool bHasMetinStone = false;
- for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
- {
- long socket = pkTarget->GetSocket(i);
- if (socket > 2 && socket != ITEM_BROKEN_METIN_VNUM)
- {
- bHasMetinStone = true;
- break;
- }
- }
- if (bHasMetinStone)
- {
- for (int i = 0; i < ITEM_SOCKET_MAX_NUM; ++i)
- {
- long socket = pkTarget->GetSocket(i);
- if (socket > 2 && socket != ITEM_BROKEN_METIN_VNUM)
- {
- AutoGiveItem(socket);
- //TItemTable* pTable = ITEM_MANAGER::instance().GetTable(pkTarget->GetSocket(i));
- //pkTarget->SetSocket(i, pTable->alValues[2]);
- // 깨진돌로 대체해준다
- pkTarget->SetSocket(i, ITEM_BROKEN_METIN_VNUM);
- }
- }
- pkItem->SetCount(pkItem->GetCount() - 1);
- return true;
- }
- else
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("빼낼 수 있는 메틴석이 없습니다."));
- return false;
- }
- }
- return false;
- }
Alles anzeigen