Jump to content

xUniverse

Inactive Member
  • Posts

    31
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by xUniverse

  1. I've modified the CInstanceBase::__Assassin_SetEunhyeongAffect(bool isVisible) in InstanceBaseEffect.cpp.

    1. If the player have the affect: the function destroys (with __EffectContainer_Destroy) all effects.
    2. If the affect ends: I've created two new functions (RefreshRefinedEffect and RefreshAffectEffect) that "reload" the attached effects again.

    For the moment the only bug I found is: if you login with the affect, all effects will be shown again...

    giphy.gif

    • Love 1
  2. En 3/2/2019 a las 1:22, Mind Rapist dijo:

    Anyone has this fix?

    I've modified the CInstanceBase::__Assassin_SetEunhyeongAffect(bool isVisible) in InstanceBaseEffect.cpp.

    1. If the player have the affect: the function destroys (with __EffectContainer_Destroy) all effects.
    2. If the affect ends: I've created two new functions (RefreshRefinedEffect and RefreshAffectEffect) that "reload" the attached effects again.

    For the moment the only bug I found is: if you login with the affect, all effects will be shown again...

    Does anyone have another idea?

  3. En 20/12/2018 a las 17:25, ReFresh dijo:

    @xUniverse Thanks for answer!

    But I got this error:

      Hide contents

    1220 21:22:34946 ::   File "uiPhaseCurtain.py", line 61, in OnUpdate

    1220 21:22:34946 ::   File "networkModule.py", line 150, in __ChangePhaseWindow

    1220 21:22:34946 ::   File "game.py", line 144, in Open

    1220 21:22:34948 :: NameError
    1220 21:22:34948 :: : 
    1220 21:22:34948 :: global name 'Main' is not defined
    1220 21:22:34948 :: 
     

     

    Did you edit OnUpdate of uiPhaseCurtain.py? You must change OnUpdate from game.py

    And my last reply had an error, I've just edited it (you must add Main() before app.UpdateGame() and before app.SetFrameSkin(1))

  4. This is the code of register environment based on time from VegaS,

    Paste the three functions at the end of game.py (without self between parenthesis! )

    	def getModule():
    		self.EnvironmentData = {
    			# Explanation:
    				# 16 - (16:00:00 - 16:59:59)
    				# "d:/ymir work/environment/capedragonhead.msenv" - Environment what will be set on this time.
    			# You can add how many environments you want.
    			4:	"d:/ymir work/environment/metin2_map_n_flame_dragon_01.msenv",
    			8:	"d:/ymir work/environment/mtthunder.msenv",
    			12:	"d:/ymir work/environment/bayblacksand.msenv",
    			16:	"d:/ymir work/environment/capedragonhead.msenv",
    			20:	"d:/ymir work/environment/snowm02.msenv",
    			22:	"d:/ymir work/environment/trent02.msenv"
    		}
    		return self.EnvironmentData # Returns the dict with all items
    
    	def getHour():
    		return ((app.GetGlobalTimeStamp() / 60) / 60 % 24) # Returns the hour from server timestamp (loaded by TPacketGCTime) 
    
    	def Main():
    		for key, c_pszName in getModule().iteritems():
    			if getHour() is key and app.IsExistFile(c_pszName): # Checks if current hour is equal with index from dict EnvironmentData and it checks if environment exists (file .msenv) in pack.
    				background.RegisterEnvironmentData(0, c_pszName) # Set the environment
    				background.SetEnvironmentData(0)

    Then go to def OnUpdate(self) and put Main() before app.UpdateGame():

    	def OnUpdate(self):	
    		Main()
    		app.UpdateGame()
    		#...

    Finally go to def OnOpen(self) and do the same:

    	def Open(self):
    		Main()
    		app.SetFrameSkip(1)
    		#...

    I've not tested it. Give a try and tell me if it works!

  5. En 21/11/2018 a las 12:59, Tatsumaru dijo:

    One problem in the instancebase.cpp file. Other players do not see the visualization of skills. Is anyone able to fix it?

    giphy.webp

    This is what you want?

    2mu7KQx.gif

    (the delay is because I've tested in a online sv and my conection is bad)

  6. hace 12 horas, blackcatq8 dijo:

    I want to fix x and y for size just tell me pls where can i put it middle 

    VF2GoSC.png

     

    there Some buttons are subject to wrong side

    I want to know how to fix it pls help me for learn more❤️

    An idea, open uiTarget.py

    1. To fix the position of the (?) button, check the function SetEnemyVID(self, vid):

    	def SetEnemyVID(self, vid):
    
          	(...)
    
    		if app.ENABLE_SEND_TARGET_INFO:
    			(textWidth, textHeight) = self.name.GetTextSize()
    
    			self.infoButton.SetPosition(textWidth + 25, 12) # HERE
    			self.infoButton.SetWindowHorizontalAlignLeft() #
    
    			self.vnum = vnum
    			self.infoButton.Show()	

    2. (not tested) To fix the align of the item names, go to the class InfoBoard(ui.ThinBoard), check the init of class ItemListBoxItem(ui.ListBoxExNew.Item) and add:

    	if app.ENABLE_SEND_TARGET_INFO:
    		class InfoBoard(ui.ThinBoard):
    			class ItemListBoxItem(ui.ListBoxExNew.Item):
    				def __init__(self, width):
    					ui.ListBoxExNew.Item.__init__(self)
    
    					image = ui.ExpandedImageBox()
    					image.SetParent(self)
    					image.Show()
    					self.image = image
    
    					nameLine = ui.TextLine()
    					nameLine.SetParent(self)
    					nameLine.SetPosition(32 + 5, 0)
    					##
    					nameLine.SetWindowHorizontalAlignRight() #add this line
    					nameLine.SetHorizontalAlignRight() #add this line
    					##
    					nameLine.Show()
    					self.nameLine = nameLine
    
    					self.SetSize(width, 32 + 5)

    ##########

    And:

    hace 7 horas, T4UMP dijo:

    wtf, dont use this fucking arabic lang

    Is better to respect different cultures and languages :)

  7. En 23/11/2018 a las 21:21, Asterix dijo:

    Thanks my friend... 

     

    But i think that i have do a check of value, because i have need of more variety of colour based by value

    So you can define a new function, before def __GetAttributeColor(self, index, value) like this:

    	def __AppendItemRarity(self, attrSlot):
    		RareList = ["Common","Uncommon","Rare","Legendary","Epic","From other universe"]
    		idxRarity = 0
    		if 0 != attrSlot:
    			for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
    				type = attrSlot[i][0]
    				value = attrSlot[i][1]
    				if value == 0:
    					continue
    
    				# HERE IS WHERE YOU MUST CHECK THE VALUES AND TYPES #
    				# you have type and value, so you can increase idxRarity
    				# like you want
    				# ...............
    
    		# The next lines is if idxRarity between 0 and 100
    		if idxRarity == 0: self.AppendTextLine(RareList[0], self.COLOR_RARE_0)
    		elif idxRarity < 20: self.AppendTextLine(RareList[1], self.COLOR_RARE_1)
    		elif idxRarity < 40: self.AppendTextLine(RareList[2], self.COLOR_RARE_2)
    		elif idxRarity < 60: self.AppendTextLine(RareList[3], self.COLOR_RARE_3)
    		elif idxRarity < 80: self.AppendTextLine(RareList[4], self.COLOR_RARE_4)
    		else: self.AppendTextLine(RareList[5], self.COLOR_RARE_5)

    Search:

    				self.__AppendAttributeInformation(attrSlot)

    And add after:

    				self.__AppendItemRarity(attrSlot)

    And don't forget to define the colors in class ToolTip(ui.ThinBoard).

    ############
    Some tips:
    - You can make a dictionary with some types and ranges of values to simplify.
    - You can use the same condition in attributes with "same values" (for example in defenses against weapons).
    ############

    Example (i did it to test) :

    example.png.24adbce9b178e1a33f305c23c6cf09cb.png

    • Love 2
  8. hace 2 horas, Asterix dijo:

     

    Hello everyone! Today I was looking at the "uitooltip.py". And I immediately had an idea. Having it need to give a visual rarity, not script in game, to costumes. What is the function that governs the inclusion of colored writing under the bonuses? Thanks to anyone who can help me!

    Idk if I understand your question, but if I did -> Search:

    				self.__AppendAttributeInformation(attrSlot)

    You will find more than one match (for weapon, armor, belt, rings, costume), so select it like you want (in this case costume).

    Then make a new line and add something like:

    				self.AppendTextLine("some text...", self.MY_NEW_COLOR)

    And finally search NORMAL_COLOR in class ToolTip(ui.ThinBoard), make a new line and define MY_NEW_COLOR:

    	NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
    	MY_NEW_COLOR = grp.GenerateColor(0.6863, 0.9725, 0.3216, 1.0)

    And change the color like you want...

    • Love 1
  9. hace 14 horas, hachiwari dijo:

    lol, only remove form atlas, noo dont spawn npc xD

    It doesn't remove the spawn. The spawn continues.

    See that: else if (p->m_table.bType == CHAR_TYPE_NPC || p->m_table.bType == CHAR_TYPE_WARP || p->m_table.bType == CHAR_TYPE_GOTO) doesn't include CHAR_TYPE_MONSTER and monsters are spawned.

    -------------------------------------

    What it does?

    Basically we don't add the position of npc with vnum 9004 to m_mapNPCPosition[lMapIndex] (it isn't related with the spawn), so when the game send the packet of npc's positions in each map, it will not contain the position of npc with vnum 9004 and it isn't marked in atlas.

    You can prove this by seeing the next functions:

    InsertNPCPosition in sectree_manager.cpp:

    void SECTREE_MANAGER::InsertNPCPosition(long lMapIndex, BYTE bType, const char* szName, long x, long y)
    {
    	m_mapNPCPosition[lMapIndex].push_back(npc_info(bType, szName, x, y));
    }

    And SendNPCPosition in the same file:

    void SECTREE_MANAGER::SendNPCPosition(LPCHARACTER ch)
    {
    	LPDESC d = ch->GetDesc();
    	if (!d)
    		return;
    
    	long lMapIndex = ch->GetMapIndex();
    
    	if (m_mapNPCPosition[lMapIndex].empty())
    		return;
    
    	TEMP_BUFFER buf;
    	TPacketGCNPCPosition p;
    	p.header = HEADER_GC_NPC_POSITION;
    	p.count = m_mapNPCPosition[lMapIndex].size();
    
    	TNPCPosition np;
    
    	// TODO m_mapNPCPosition[lMapIndex] 를 보내주세요
    	itertype(m_mapNPCPosition[lMapIndex]) it;
    
    	for (it = m_mapNPCPosition[lMapIndex].begin(); it != m_mapNPCPosition[lMapIndex].end(); ++it)
    	{
    		np.bType = it->bType;
    		strlcpy(np.name, it->name, sizeof(np.name));
    		np.x = it->x;
    		np.y = it->y;
    		buf.write(&np, sizeof(np));
    	}
    
    	p.size = sizeof(p) + buf.size();
    
    	if (buf.size())
    	{
    		d->BufferedPacket(&p, sizeof(TPacketGCNPCPosition));
    		d->Packet(buf.read_peek(), buf.size());
    	}
    	else
    		d->Packet(&p, sizeof(TPacketGCNPCPosition));
    }

    Then go to client -> ../UserInterface/PythonNetworkStreamPhaseGame.cpp and see CPythonNetworkStream::RecvNPCList()

    bool CPythonNetworkStream::RecvNPCList()
    {
    	TPacketGCNPCPosition kNPCPosition;
    	if (!Recv(sizeof(kNPCPosition), &kNPCPosition))
    		return false;
    
    	assert(int(kNPCPosition.size)-sizeof(kNPCPosition) == kNPCPosition.count*sizeof(TNPCPosition) && "HEADER_GC_NPC_POSITION");
    
    	CPythonMiniMap::Instance().ClearAtlasMarkInfo();
    
    	for (int i = 0; i < kNPCPosition.count; ++i)
    	{
    		TNPCPosition NPCPosition;
    		if (!Recv(sizeof(TNPCPosition), &NPCPosition))
    			return false;
    
    		CPythonMiniMap::Instance().RegisterAtlasMark(NPCPosition.bType, NPCPosition.name, NPCPosition.x, NPCPosition.y);
    	}
    
    	return true;
    }

    If you can see at the start we get the packet of npc position and in the last lines we mark the position in the atlas: CPythonMiniMap::Instance().RegisterAtlasMark(NPCPosition.bType, NPCPosition.name, NPCPosition.x, NPCPosition.y);

    • Love 2
  10. En 21/11/2018 a las 16:09, iFreakTime~.~ dijo:

    Hello all. I want to hide a npc vnum from atlas map, as example: npc 9004 from atlas.

    I want this because of: 

    EX7C8GE.jpg

    Open ../game/src/regen.cpp and search:

    				else if (p->m_table.bType == CHAR_TYPE_NPC || p->m_table.bType == CHAR_TYPE_WARP || p->m_table.bType == CHAR_TYPE_GOTO)
    				{
    					SECTREE_MANAGER::instance().InsertNPCPosition(lMapIndex,
    							p->m_table.bType,
    							p->m_table.szLocaleName,
    							(regen->sx+regen->ex) / 2 - base_x,
    							(regen->sy+regen->ey) / 2 - base_y);
    				}

    And do some like that:

    				else if (p->m_table.bType == CHAR_TYPE_NPC || p->m_table.bType == CHAR_TYPE_WARP || p->m_table.bType == CHAR_TYPE_GOTO)
    				{
    					if (regen->vnum != 9004)
    					{
    						SECTREE_MANAGER::instance().InsertNPCPosition(lMapIndex,
    								p->m_table.bType,
    								p->m_table.szLocaleName,
    								(regen->sx+regen->ex) / 2 - base_x,
    								(regen->sy+regen->ey) / 2 - base_y);
    					}
    				}

    Or if you want to hide more than one npc, you can do something like that:

    				else if (p->m_table.bType == CHAR_TYPE_NPC || p->m_table.bType == CHAR_TYPE_WARP || p->m_table.bType == CHAR_TYPE_GOTO)
    				{
    					int hideList[] = {9004,9099}; // here you must add the vnums
    					std::vector<int> H(hideList, hideList + sizeof(hideList)/sizeof(hideList[0]));
    					if (find(H.begin(),H.end(),regen->vnum) == H.end())
    					{
    						SECTREE_MANAGER::instance().InsertNPCPosition(lMapIndex,
    								p->m_table.bType,
    								p->m_table.szLocaleName,
    								(regen->sx+regen->ex) / 2 - base_x,
    								(regen->sy+regen->ey) / 2 - base_y);
    					}
    				}

     

    • Love 3
  11. hace 5 horas, amosth dijo:

    When I create a new player, everything is fine.

    So /reload q is the problem. Don't use this command in a server with players, only in test server, it isn't safe. When you modify a quest is better to do a reboot to apply the changes.

    Close the server, open player.quest in db and fix manually the quests of players with problems (you can compare with the rows of a player without problems or more fast you can make a query to do it). Then start the server again. And don't use /reload  q.

    • Love 2
  12. hace 1 hora, amosth dijo:

    the bug is in the database player> quest

    only some players have this problem.

    If you create a new PJ, does the same thing happen? or the quest are OK?

    Did you do "reload q" when you applied the last changes in the quest? May be "reload q" generated the error..

    ----

    Se vôce cria um novo personagem, acontece a mesma coisa? ou tá bom?
    Você fez "reload q" depois de alterar a quest? Pode ser que isso tenha gerado o erro..

  13. Here is an ugly (but easy) way to solve it:

    In client pack, go to locale_xx/locale/xx/effect/ and open gm.mse (in my case locale_ro/locale/ro/effect/gm.mse).

    And replace:

        StartTime           0.000000

    With:

        StartTime           2.000000

    When you login (or teleport) the logo will be shown after 2 secs.  So if you are invisibility it will be detached before showing.

    • Love 1
  14. hace 3 horas, ReFresh dijo:

    1116 02:42:28891 :: Traceback (most recent call last):

    1116 02:42:28891 ::   File "ui.py", line 1558, in OnOverInItem

    1116 02:42:28892 ::   File "ui.py", line 136, in __call__

    1116 02:42:28892 ::   File "ui.py", line 127, in __call__

    1116 02:42:28892 ::   File "uiRefine.py", line 362, in OverInItem

    1116 02:42:28893 :: TypeError
    1116 02:42:28893 :: : 
    1116 02:42:28893 :: AddItemData() takes at most 6 arguments (7 given)
    1116 02:42:28893 :: 

     

      Hide contents
    
    
    https://metin2.download/picture/GIJ1rKas4zgBxa131bZmQ1hn22NKVe5p/.png

     

     

    In:

    self.tooltipItem.AddItemData(TOOLTIP_DATA['materials'].__getitem__(slotIndex), 0, 0, 0, 0, player.INVENTORY)
    
    ## OR
    
    self.tooltipItem.AddItemData(slotVnum, 0, 0, 0, 0, player.INVENTORY)

    Delete player.INVENTORY and try again.

    • Love 2
  15. If you don't have these functions, try to change:

    GetNewAttributeType to GetAttributeType
    GetNewAttributeValue to GetAttributeValue

    In char_item.cpp:

    							//Mount(item->GetValue(4), false, item->GetValue(0) * 60, item->GetNewAttributeType(0), item->GetNewAttributeValue(0));
    							Mount(item->GetValue(4), false, item->GetValue(0) * 60, item->GetAttributeType(0), item->GetAttributeValue(0));
    							item->SetCount(item->GetCount() - 1);

     

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