Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0.0 Kopie sobie zróbcie w razie czego bo potem nie będę płaczu słuchać.
- 1.0 Source Server:
- common->service.h/CommonDefines.h
- #define ENABLE_COSTUME_TIME_EXTENDER
- common->item_length.h
- szukacie:
- (to powinno być 30 domyślnie, jezeli dodawaliście jakieś dodatkowe subtype'y to wiadomo dodajcie niżej)
- USE_PUT_INTO_RING_SOCKET,
- pod dodajecie:
- #ifdef ENABLE_COSTUME_TIME_EXTENDER
- USE_TIME_EXTEND, //31
- #endif
- db->ProtoReader.cpp
- szukacie:
- "USE_PUT_INTO_RING_SOCKET"
- pod dodajecie:
- #ifdef ENABLE_COSTUME_TIME_EXTENDER
- ,"USE_TIME_EXTEND"
- #endif
- game->char_item.cpp
- szukacie:
- if (item->GetVnum() >= 27863 && item->GetVnum() <= 27883)
- {
- if (CArenaManager::instance().IsArenaMap(GetMapIndex()) == true)
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ë·Ă Áßżˇ´Â ŔĚżëÇŇ Ľö ľř´Â ą°Ç°ŔÔ´Ď´Ů."));
- return false;
- }
- }
- if (test_server)
- {
- sys_log (0, "USE_ITEM %s Type %d SubType %d vnum %d", item->GetName(), item->GetType(), item->GetSubType(), item->GetOriginalVnum());
- }
- switch (item->GetSubType())
- {
- w tym switchu dopisujecie:
- #ifdef ENABLE_COSTUME_TIME_EXTENDER
- case USE_TIME_EXTEND:
- {
- LPITEM item2;
- if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
- return false; if (item2->GetType() != ITEM_COSTUME) return false;
- #ifdef ENABLE_SASH_SYSTEM
- if (item2->GetSubType() == COSTUME_SASH)
- return false;
- #endif
- //tutaj sobie dostosujcie czy chcecie też mounty wydłużać jeżeli macie w ogóle mounty zakładane do okienka kostiumów.
- #ifdef ENABLE_COSTUME_MOUNT
- if (item2->GetSubType() == COSTUME_MOUNT)
- return false;
- #endif
- if (item2->IsExchanging() || item2->IsEquipped())
- return false;
- //ja potrzebowałem konwersje czasu na dni, także tutaj po prostu musicie podzielić na odpowiednią ilość czasu value, aby uzyskać prawidłową wartość. Czas w Value ustalimy, że w wpisujemy w sekundach czyli godzina to będzie 3600. Komunikat dostosujcie sobie sami.
- int days = item->GetValue(0)/86400;
- item2->SetSocket(0, item2->GetSocket(0) + item->GetValue(0));
- char buf[21]; snprintf(buf, sizeof(buf), "%u", item2->GetID());
- LogManager::instance().ItemLog(this, item, "USE_TIME_EXTEND", buf);
- item->SetCount(item->GetCount() - 1);
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You added time %d to your costume."), days);
- }
- break;
- #endif
- 1.1 Client Source
- GameLib->ItemData.h
- (upewnijcie sie że macie zaincludowane Locale_inc.h, jak nie to u samej góry dopisujecie: #include "../UserInterface/Locale_inc.h")
- szukacie:
- USE_PUT_INTO_RING_SOCKET,
- pod dodajecie:
- #ifdef ENABLE_COSTUME_TIME_EXTENDER
- USE_TIME_EXTEND, //31
- #endif
- GameLib->ItemData.cpp
- szukacie:
- case USE_PUT_INTO_RING_SOCKET:
- return DEF_STR(USE_PUT_INTO_RING_SOCKET);
- pod dodajecie:
- #ifdef ENABLE_COSTUME_TIME_EXTENDER
- case USE_TIME_EXTEND:
- return DEF_STR(USE_TIME_EXTEND);
- #endif
- UserInterface->Locale_inc.h
- #define ENABLE_COSTUME_TIME_EXTENDER
- 1.2 Client:
- root->uiinventory.py
- szukacie:
- USE_TYPE_TUPLE =
- dopisujecie tutaj na końcu:
- ,"USE_TIME_EXTEND"
- szukacie:
- elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
- if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum):
- return True
- pod dodajecie:
- elif "USE_TIME_EXTEND" == useType:
- if self.__CanExtendCostume(dstSlotPos):
- return True
- szukacie:
- def __CanPutAccessorySocket(self, dstSlotPos, mtrlVnum):
- dstItemVNum = player.GetItemIndex(dstSlotPos)
- if dstItemVNum == 0:
- return False
- item.SelectItem(dstItemVNum)
- if item.GetItemType() != item.ITEM_TYPE_ARMOR:
- return False
- if not item.GetItemSubType() in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
- return False
- curCount = player.GetItemMetinSocket(dstSlotPos, 0)
- maxCount = player.GetItemMetinSocket(dstSlotPos, 1)
- if mtrlVnum != constInfo.GET_ACCESSORY_MATERIAL_VNUM(dstItemVNum, item.GetItemSubType()):
- return False
- if curCount>=maxCount:
- return False
- return True
- pod dodajecie:
- def __CanExtendCostume(self, dstSlotPos):
- itemVnum = player.GetItemIndex(dstSlotPos)
- if itemVnum == 0:
- return False item.SelectItem(itemVnum)
- #tutaj w zależnosci czy macie system szarf/mountów sobie dodajcie
- if app.ENABLE_SASH_SYSTEM:
- if item.GetItemSubType == COSTUME_SASH:
- return False
- if app.ENABLE_COSTUME_MOUNT_SYSTEM:
- if item.GetItemSubType == COSTUME_MOUNT:
- return False
- if item.GetItemType() != ITEM_COSTUME:
- return False
- return True
- 1.3 MySQL:
- Tworzycie przedmiot może być stackowalny w Value0 ustawiacie ile czasu ma dodawać w sekundach. Musi mieć Type 3 i SubType 31 (chyba że mieliście coś więcej w item_length.h)
- 1.4 share->locale->xxx->locale_string.txt:
- "You added time %d to your costume.";
- "<Serwer> Czas kostiumu został wydłużony o: %d dni.";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement