Jump to content

Sebypunct

Member
  • Posts

    54
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Sebypunct

  1. Acum 17 ore, Johnny69 a spus:

    This item type is the new type from official servers used for battle boxes and recently for boss chest and fish event boxes. You can open boxes few times (set in item_proto).

    1. You can use macro ENABLE_BATTLE_FIELD because was added with battle zone.

    2. Number of openings is in item_proto -> LimitValue1 (Like official)

    Let's start:

    Server Source Part:

    
    #db\src\ProtoReader.cpp
    //Search:
    		"ITEM_BELT",
    //Add after:
    		"ITEM_GACHA"
    
    #common\item_length.h
    //Search:
    	ITEM_BELT,	
    //Add after:
    	ITEM_GACHA,
    
    
    #game\src\item_manager.cpp
    //Search:
    	if (id == 0)
    //Add before: (be careful , before)
    	if(item->GetType() == ITEM_GACHA)
    		item->SetSocket(0, item->GetLimitValue(1));
    
    
    #game\src\char_item.cpp
    //Search: (CHARACTER::UseItemEx)
    		case ITEM_EXTRACT:
    			...
    			break;
    //Add after:
    		case ITEM_GACHA:
    			{
    				DWORD dwBoxVnum = item->GetVnum();
    				std::vector <DWORD> dwVnums;
    				std::vector <DWORD> dwCounts;
    				std::vector <LPITEM> item_gets(0);
    				int count = 0;
    
    				if (GiveItemFromSpecialItemGroup(dwBoxVnum, dwVnums, dwCounts, item_gets, count))
    				{
    					if(item->GetSocket(0) > 1)
    						item->SetSocket(0, item->GetSocket(0) - 1);
    					else
    						ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (ITEM_GACHA)");
    				}
    			}
    			break;

     

    Client Source Part:

    
    #GameLib\ItemData.h
    //Search:
    			ITEM_TYPE_BELT,
    //Add after:
    			ITEM_TYPE_GACHA,
    
    #UserInterface\PythonItemModule.cpp
    //Search:
    	PyModule_AddIntConstant(poModule, "ITEM_TYPE_BELT",				CItemData::ITEM_TYPE_BELT);
    //Add after:
    	PyModule_AddIntConstant(poModule, "ITEM_TYPE_GACHA",			CItemData::ITEM_TYPE_GACHA);

     

    Client root part:

    
    #root\uitooltip.py
    #Search:
    		elif item.ITEM_TYPE_FISH == itemType:
    			if 0 != metinSlot:
    				self.__AppendFishInfo(metinSlot[0])
    #Add after:
    		### Gacha = Battle Shop Chest ###
    		if item.ITEM_TYPE_GACHA == itemType:
    			if 0 != metinSlot:
    				if self.isShopItem:
    					restUsableCount = int(item.GetLimit(1)[1])
    				else:
    					restUsableCount = int(metinSlot[0])
    
    				self.AppendSpace(5)
    				self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (restUsableCount), grp.GenerateColor(0.5, 1.0, 0.3, 1.0))

     

    Client locale part:

    
    #locale_game.txt
    #Add:
    TOOLTIP_REST_USABLE_COUNT	Left: %d

     

    Server Item_proto example:

    
    25111	fish 보상상자	ITEM_GACHA	0	1	NONE	NONE	NONE	NONE	0	0	0	0	0	LIMIT_NONE	0	LIMIT_NONE	1	APPLY_NONE	0	APPLY_NONE	0	APPLY_NONE	0	0	0	0	0	0	0	0	0	0	12
    25112	fish 보상상자	ITEM_GACHA	0	1	NONE	NONE	NONE	NONE	0	0	0	0	0	LIMIT_NONE	0	LIMIT_NONE	2	APPLY_NONE	0	APPLY_NONE	0	APPLY_NONE	0	0	0	0	0	0	0	0	0	0	12
    25113	fish 보상상자	ITEM_GACHA	0	1	NONE	NONE	NONE	NONE	0	0	0	0	0	LIMIT_NONE	0	LIMIT_NONE	3	APPLY_NONE	0	APPLY_NONE	0	APPLY_NONE	0	0	0	0	0	0	0	0	0	0	12

     

    can you help me ? because for me , not work.

  2. Acum 47 minute, mateo7788 a spus:
    
    import net, constInfo, ui, background, time, chat
    
    class Zmiana_Kanalu(ui.Window):
    	def __init__(self):
    		ui.Window.__init__(self)
    
    	def __del__(self):
    		ui.Window.__del__(self)
    
    	def Open(self):
    		self.vegas_change = ui.BoardWithTitleBar()
    		self.vegas_change.AddFlag("movable")
    		self.vegas_change.AddFlag("float")
    		self.vegas_change.SetTitleName("Zmiana Kanału")
    		self.vegas_change.SetCloseEvent(self.Close)
    		
    		x = 0
    		
    		self.channel_list = []
    		
    		for ch in xrange(4): #Nr of channels
    			channel_button = ui.Button()
    			channel_button.SetParent(self.vegas_change) 
    			channel_button.SetSize(100, 100)
    			channel_button.SetPosition(30, 34 + (20 * x + x))
    			channel_button.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
    			channel_button.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
    			channel_button.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
    			channel_button.SetEvent(ui.__mem_func__(self.change_channel), ch)
    			
    			channel_button.SetText("Kanał " + str(ch+1))
    			channel_button.Show()
    			
    			self.channel_list.append(channel_button)
    			x = x + 1
    		
    		self.vegas_change.SetSize(150, 50 + (20 * x + x)) 
    		self.vegas_change.SetCenterPosition()
    		self.vegas_change.Show()
    		
    	def protect_maps(self):
    		protect_list = [
    			"season99/new_map_ox",
    			"maps_dungeon/devils_zone",
    			"maps_dungeon/dt_zone",
    			"maps_vegas/wedding_zone",
    			"maps_dungeon/spider_3",  
    			"maps_vegas/duel_zone",
    		]
    		if str(background.GetCurrentMapName()) in protect_list:
    			return TRUE
    		return FALSE    		
    		
    	def change_channel(self, ch):
    		if self.protect_maps():
    			chat.AppendChat(1, "[Zmiana Kanału] Nie możesz zmienić kanału na tej mapie!")
    			return	
    		elif time.clock() >= constInfo.change_time:			
    			self.Close()
    			net.SetServerInfo("Metin2 - Kanał %d" % int(ch+1)) # Nazwa pod minimapką po zmianie kanału
    			chat.AppendChat(chat.CHAT_TYPE_INFO, "[Zmiana Kanału] Zmiana kanału zakończona pomyślnie!")
    			net.SendChatPacket("/ch %d" % int(ch+1))
    			constInfo.change_time = time.clock() + 10 # Czas po którym można zmieniać kanał
    		else:
    			chat.AppendChat(chat.CHAT_TYPE_INFO, "[Zmiana Kanału] Możesz zmieniać kanał co 10 sekund!")		
    		
    	def	Close(self):
    		self.vegas_change.Hide()
    		
    	def OnPressExitKey(self):
    	
    		self.Close()
    		return True
    
    	def OnPressEscapeKey(self):
    		self.Close()
    		return True
    		

     

    Man , i need this "large_button_01.sub" same my photo , no system.

×
×
  • 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.