Hallo,
ich habe neue Ränge eingefügt und nun wird wenn man stirbt mit "Freundlich" ein Item gedroppt.
Wie kann ich das verhindern bzw wie muss ich das anpassen?
Habe mir bereits eine Stelle aus der Server Src rausgesucht inder man das anpassen sollte.
Doch ich weiß überhaupt nicht wie.
Hier die Stelle:
C: char_battle.cpp
- struct TItemDropPenalty
- {
- int iInventoryPct; // Range: 1 ~ 1000
- int iInventoryQty; // Range: --
- int iEquipmentPct; // Range: 1 ~ 100
- int iEquipmentQty; // Range: --
- };
- TItemDropPenalty aItemDropPenalty_kor[9] =
- {
- { 0, 0, 0, 0 }, // 선왕
- { 0, 0, 0, 0 }, // 영웅
- { 0, 0, 0, 0 }, // 성자
- { 0, 0, 0, 0 }, // 지인
- { 0, 0, 0, 0 }, // 양민
- { 25, 1, 5, 1 }, // 낭인
- { 50, 2, 10, 1 }, // 악인
- { 75, 4, 15, 1 }, // 마두
- { 100, 8, 20, 1 }, // 패왕
- };
- void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller)
- {
- // 개인상점을 연 상태에서는 아이템을 드롭하지 않는다.
- if (GetMyShop())
- return;
- if (false == LC_IsYMIR())
- {
- if (GetLevel() < 50)
- return;
- }
- if (CBattleArena::instance().IsBattleArenaMap(GetMapIndex()) == true)
- {
- return;
- }
- struct TItemDropPenalty * table = &aItemDropPenalty_kor[0];
- if (GetLevel() < 10)
- return;
- int iAlignIndex;
- //newalig
- if (GetRealAlignment() == 300000)
- iAlignIndex = 0;
- else if (GetRealAlignment() >= 200000)
- iAlignIndex = 1;
- else if (GetRealAlignment() >= 120000)
- iAlignIndex = 2;
- else if (GetRealAlignment() >= 80000)
- iAlignIndex = 3;
- else if (GetRealAlignment() >= 40000)
- iAlignIndex = 4;
- else if (GetRealAlignment() >= 10000)
- iAlignIndex = 5;
- else if (GetRealAlignment() >= 0)
- iAlignIndex = 6;
- else if (GetRealAlignment() > -40000)
- iAlignIndex = 7;
- else if (GetRealAlignment() > -80000)
- iAlignIndex = 8;
- else if (GetRealAlignment() > -120000)
- iAlignIndex = 9;
- else if (GetRealAlignment() > -200000)
- iAlignIndex = 10;
- else if (GetRealAlignment() > -250000)
- iAlignIndex = 11;
- else
- iAlignIndex = 12;
- // if (GetRealAlignment() >= 120000)
- // iAlignIndex = 0;
- // else if (GetRealAlignment() >= 80000)
- // iAlignIndex = 1;
- // else if (GetRealAlignment() >= 40000)
- // iAlignIndex = 2;
- // else if (GetRealAlignment() >= 10000)
- // iAlignIndex = 3;
- // else if (GetRealAlignment() >= 0)
- // iAlignIndex = 4;
- // else if (GetRealAlignment() > -40000)
- // iAlignIndex = 5;
- // else if (GetRealAlignment() > -80000)
- // iAlignIndex = 6;
- // else if (GetRealAlignment() > -120000)
- // iAlignIndex = 7;
- // else
- // iAlignIndex = 8;
- std::vector<std::pair<LPITEM, int> > vec_item;
- LPITEM pkItem;
- int i;
- bool isDropAllEquipments = false;
- TItemDropPenalty & r = table[iAlignIndex];
- sys_log(0, "%s align %d inven_pct %d equip_pct %d", GetName(), iAlignIndex, r.iInventoryPct, r.iEquipmentPct);
- bool bDropInventory = r.iInventoryPct >= number(1, 1000);
- bool bDropEquipment = r.iEquipmentPct >= number(1, 100);
- bool bDropAntiDropUniqueItem = false;
- if ((bDropInventory || bDropEquipment) && IsEquipUniqueItem(UNIQUE_ITEM_SKIP_ITEM_DROP_PENALTY))
- {
- bDropInventory = false;
- bDropEquipment = false;
- bDropAntiDropUniqueItem = true;
- }
- if (bDropInventory) // Drop Inventory
- {
- std::vector<BYTE> vec_bSlots;
- for (i = 0; i < INVENTORY_MAX_NUM; ++i)
- if (GetInventoryItem(i))
- vec_bSlots.push_back(i);
- if (!vec_bSlots.empty())
- {
- random_shuffle(vec_bSlots.begin(), vec_bSlots.end());
- int iQty = MIN(vec_bSlots.size(), r.iInventoryQty);
- if (iQty)
- iQty = number(1, iQty);
- for (i = 0; i < iQty; ++i)
- {
- pkItem = GetInventoryItem(vec_bSlots[i]);
- if (IS_SET(pkItem->GetAntiFlag(), ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_PKDROP))
- continue;
- SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots[i], 255);
- vec_item.push_back(std::make_pair(pkItem->RemoveFromCharacter(), INVENTORY));
- }
- }
- else if (iAlignIndex == 8)
- isDropAllEquipments = true;
- }
- if (bDropEquipment) // Drop Equipment
- {
- std::vector<BYTE> vec_bSlots;
- for (i = 0; i < WEAR_MAX_NUM; ++i)
- if (GetWear(i))
- vec_bSlots.push_back(i);
- if (!vec_bSlots.empty())
- {
- random_shuffle(vec_bSlots.begin(), vec_bSlots.end());
- int iQty;
- if (isDropAllEquipments)
- iQty = vec_bSlots.size();
- else
- iQty = MIN(vec_bSlots.size(), number(1, r.iEquipmentQty));
- if (iQty)
- iQty = number(1, iQty);
- for (i = 0; i < iQty; ++i)
- {
- pkItem = GetWear(vec_bSlots[i]);
- if (IS_SET(pkItem->GetAntiFlag(), ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_PKDROP))
- continue;
- SyncQuickslot(QUICKSLOT_TYPE_ITEM, vec_bSlots[i], 255);
- vec_item.push_back(std::make_pair(pkItem->RemoveFromCharacter(), EQUIPMENT));
- }
- }
- }
- if (bDropAntiDropUniqueItem)
- {
- LPITEM pkItem;
- pkItem = GetWear(WEAR_UNIQUE1);
- if (pkItem && pkItem->GetVnum() == UNIQUE_ITEM_SKIP_ITEM_DROP_PENALTY)
- {
- SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, 255);
- vec_item.push_back(std::make_pair(pkItem->RemoveFromCharacter(), EQUIPMENT));
- }
- pkItem = GetWear(WEAR_UNIQUE2);
- if (pkItem && pkItem->GetVnum() == UNIQUE_ITEM_SKIP_ITEM_DROP_PENALTY)
- {
- SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE2, 255);
- vec_item.push_back(std::make_pair(pkItem->RemoveFromCharacter(), EQUIPMENT));
- }
- }
- {
- PIXEL_POSITION pos;
- pos.x = GetX();
- pos.y = GetY();
- unsigned int i;
- for (i = 0; i < vec_item.size(); ++i)
- {
- LPITEM item = vec_item[i].first;
- int window = vec_item[i].second;
- item->AddToGround(GetMapIndex(), pos);
- item->StartDestroyEvent();
- sys_log(0, "DROP_ITEM_PK: %s %d %d from %s", item->GetName(), pos.x, pos.y, GetName());
- LogManager::instance().ItemLog(this, item, "DEAD_DROP", (window == INVENTORY) ? "INVENTORY" : ((window == EQUIPMENT) ? "EQUIPMENT" : ""));
- pos.x = GetX() + number(-7, 7) * 20;
- pos.y = GetY() + number(-7, 7) * 20;
- }
- }
- }
Hoffe mir kann jemand helfen.