Jump to content

Denis

Banned
  • Posts

    1031
  • Joined

  • Last visited

  • Days Won

    53
  • Feedback

    0%

Posts posted by Denis

  1. It's an interesting way of allowing more gold trade without source. Clean, and well thought of!

    If i know good, for more than 2kkk store in this item, you must too edit source for max long long

    and when you have max gold in source, why this item need? if you can trade more than 2kkk 

    It's much easier and cleaner to do it like that,because you don't even need to edit source, but still if you want to change the gold limit it's your choice.

  2. well i made it but as the guys mentioned before the name does not hide when i click the button and the * does not appear to the name of the aggressive mobs... here is my syserr

    1029 00:33:06728 :: Traceback (most recent call last):
    
    1029 00:33:06775 ::   File "ui.py", line 1128, in OnToggleDown
    
    1029 00:33:06775 ::   File "uiGameOption.py", line 432, in __OnClickShowMobLevelButton
    
    1029 00:33:06776 :: NameError
    1029 00:33:06776 :: : 
    1029 00:33:06776 :: global name 'True' is not defined
    1029 00:33:06776 :: 
    
    1029 00:33:07680 :: Traceback (most recent call last):
    
    1029 00:33:07681 ::   File "ui.py", line 1128, in OnToggleDown
    
    1029 00:33:07681 ::   File "uiGameOption.py", line 441, in __OnClickShowMobAIFlagButton
    
    1029 00:33:07681 :: NameError
    1029 00:33:07681 :: : 
    1029 00:33:07681 :: global name 'True' is not defined
    1029 00:33:07681 :: 
    
    1029 00:33:08504 :: Traceback (most recent call last):
    
    1029 00:33:08505 ::   File "ui.py", line 1124, in OnToggleUp
    
    1029 00:33:08505 ::   File "uiGameOption.py", line 441, in __OnClickShowMobAIFlagButton
    
    1029 00:33:08505 :: NameError
    1029 00:33:08505 :: : 
    1029 00:33:08505 :: global name 'True' is not defined
    1029 00:33:08505 :: 
    
    1029 00:33:09133 :: Traceback (most recent call last):
    
    1029 00:33:09133 ::   File "ui.py", line 1124, in OnToggleUp
    
    1029 00:33:09133 ::   File "uiGameOption.py", line 432, in __OnClickShowMobLevelButton
    
    1029 00:33:09133 :: NameError
    1029 00:33:09133 :: : 
    1029 00:33:09133 :: global name 'True' is not defined
    1029 00:33:09133 :: 
    

     

     

    Change True to TRUE

  3. Try this:

    void CInputMain::PartyInvite(LPCHARACTER ch, const char * c_pData)
    {
    	if (ch->GetArena())
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("????? ???? ? ????."));
    		return;
    	}
    
    	TPacketCGPartyInvite * p = (TPacketCGPartyInvite*) c_pData;
    
    	LPCHARACTER pInvitee = CHARACTER_MANAGER::instance().Find(p->vid);
    
    	if (!pInvitee || !ch->GetDesc() || !pInvitee->GetDesc())
    	{
    		sys_err("PARTY Cannot find invited character");
    		return;
    	}
    	
    	if(ch->GetMapIndex() == 41)
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO,"WRONG MAP INDEX");
    		return;
    	}
    	else
    	{
    		ch->PartyInvite(pInvitee);
    	}
    }
    

     

    • Love 1
  4. It's untested but it should work

    Find this function:

    void CInputMain::PartyInvite(LPCHARACTER ch, const char * c_pData)
    {
    	if (ch->GetArena())
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련장에서 사용하실 수 없습니다."));
    		return;
    	}
    
    	TPacketCGPartyInvite * p = (TPacketCGPartyInvite*) c_pData;
    
    	LPCHARACTER pInvitee = CHARACTER_MANAGER::instance().Find(p->vid);
    
    	if (!pInvitee || !ch->GetDesc() || !pInvitee->GetDesc())
    	{
    		sys_err("PARTY Cannot find invited character");
    		return;
    	}
    	
    }

    And add this line to it:

    ch->GetMapIndex() == 41 ? ch->ChatPacket(CHAT_TYPE_INFO,"WRONG MAP INDEX") : ch->PartyInvite(pInvitee); // 41 = map index of the blocked map

    So it should look something like this:

    void CInputMain::PartyInvite(LPCHARACTER ch, const char * c_pData)
    {
    	if (ch->GetArena())
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련장에서 사용하실 수 없습니다."));
    		return;
    	}
    
    	TPacketCGPartyInvite * p = (TPacketCGPartyInvite*) c_pData;
    
    	LPCHARACTER pInvitee = CHARACTER_MANAGER::instance().Find(p->vid);
    
    	if (!pInvitee || !ch->GetDesc() || !pInvitee->GetDesc())
    	{
    		sys_err("PARTY Cannot find invited character");
    		return;
    	}
    	ch->GetMapIndex() == 41 ? ch->ChatPacket(CHAT_TYPE_INFO,"WRONG MAP INDEX") : ch->PartyInvite(pInvitee);
    }

     

  5. 0705 18:46:27105 ::   File "game.py", line 1088, in SetHPTargetBoard

    0705 18:46:27105 ::   File "uiTarget.py", line 338, in SetHP

    0705 18:46:27105 :: AttributeError
    0705 18:46:27105 :: : 
    0705 18:46:27105 :: 'TargetBoard' object has no attribute 'hpPercenttxt'
    0705 18:46:27105 :: 

    Under

    self.name = name

    add this

    self.hpPercenttxt = hpPercenttxt

     

    • Love 1
  6.  idk why he wrote the map check function with python he could do it with c++ :mellow:

     

    and i'm very sorry i don't know how to use spoiler with this new interface (design):blush:

    Just write [ spoiler ] [ /spoiler ] without spaces and...

    Voila!

    • Love 1
  7. thx for the system i didnt test it or add it
    also iam not c++ progream but your code it seem to be ugly -_-

    good luck :)

    Really? I can't find anything ugly about this. Actually the c++ part is very nice. I didn't check on python.

    And why are you wishing him good luck at his own release? ._. Sometimes I don't understand people...^^

     

    Anyway, the idea behind that is great and I like the c++ part a lot. Oh, and a german sentence slipped through ;)

     

    I know that it isn't the best c++ Code, but I really.love using maps ^^

     

    Py part is 1:1 from wom:o

     

    And yeah the German sentence comes through :D

    sorry for that ^^

    Mobile phone and yeah :D

    i dont know how to tell u why he is ugly

    also iam arabic from libya not germany

    alina wasn't talking to  you when he/she wrote this ---> "and a german sentence slipped through ;)"

    he/she was talking to the topic maker

     

    and for the python part :

    go to uisystem.py in root and search for this tow times

    self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)

    and under it write this

    self.GetChild("Change_Channel").SAFE_SetEvent(self.__ClickChangeChButton)

    and after this

    	def __ClickInGameShopButton(self):	   	
    	   	self.Close()
    		net.SendChatPacket("/in_game_mall")

    write this

    	def	__ClickChangeChButton(self):
    		if constInfo.channel == 0:
    			constInfo.channel == 1
    			self.uuchangechannel = uichannel.ChannelChanger()
    			self.uuchangechannel.Show()
    		elif constInfo.channel == 1:
    			constInfo.channel == 0
    			self.uuchangechannel = uichannel.ChannelChanger()
    			self.uuchangechannel.hide()

    save and exit

    2: change uichannel.py in root with this

    import ui
    import net
    import app
    import chat
    import math
    import wndMgr
    import serverInfo
    import background
    import ServerStateChecker
    import snd
    import constInfo
    Channel_window = "uiscript/channel.py"
    class ChannelChanger(ui.ScriptWindow):
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    		
    	def Show(self):
    		self.__LoadWindow()
    		ui.ScriptWindow.Show(self)
    		
    	def __LoadWindow(self):
    		try:			
    			pyScrLoader = ui.PythonScriptLoader()
    			pyScrLoader.LoadScriptFile(self, Channel_window)
    		except:
    			import exception
    			exception.Abort("PetWindow.LoadWindow.LoadObject")
    		#buttons
    		self.TitleBar = self.GetChild("TitleBar")
    		self.channel1 = self.GetChild("Channel_1")
    		self.channel2 = self.GetChild("Channel_2")
    		self.channel3 = self.GetChild("Channel_3")
    		self.channel4 = self.GetChild("Channel_4")
    		
    		#event buttons
    		self.TitleBar.SetCloseEvent(ui.__mem_func__(self.Close))
    		self.channel1.SetEvent(ui.__mem_func__(self.___1))
    		self.channel2.SetEvent(ui.__mem_func__(self.___2))
    		self.channel3.SetEvent(ui.__mem_func__(self.___3))
    		self.channel4.SetEvent(ui.__mem_func__(self.___4))
    	
    
    	
    	def	___1(self):
    		snd.PlaySound("sound/ui/click.wav")
    		ch = "1"
    		self.__OnChangeChannel(ch)
    		
    	def	___2(self):
    		snd.PlaySound("sound/ui/click.wav")
    		ch = "2"
    		self.__OnChangeChannel(ch)
    		
    	def	___3(self):
    		snd.PlaySound("sound/ui/click.wav")
    		ch = "3"
    		self.__OnChangeChannel(ch)
    		
    	def	___4(self):
    		snd.PlaySound("sound/ui/click.wav")
    		ch = "4"
    		self.__OnChangeChannel(ch)
    		
    	def __IsSpecialMap(self):
    		dis_maps = [
    			"season1/metin2_map_oxevent",
    			"season2/metin2_map_guild_inside01",
    			"season2/metin2_map_empirewar01",
    			"season2/metin2_map_empirewar02",
    			"season2/metin2_map_empirewar03",
    			"metin2_map_dragon_timeattack_01",
    			"metin2_map_dragon_timeattack_02",
    			"metin2_map_dragon_timeattack_03",
    			"metin2_map_skipia_dungeon_boss",
    			"metin2_map_skipia_dungeon_boss2",
    			"metin2_map_devilsCatacomb",
    			"metin2_map_deviltower1",
    			"metin2_map_t1",
    			"metin2_map_t2",
    			"metin2_map_t3",
    			"metin2_map_t4",
    			"metin2_map_t5",
    			"metin2_map_wedding_01",
    			"metin2_map_duel",
    			"metin2_map_orclabyrinth",
    			"metin2_map_n_flame_dungeon_01",
    			"metin2_map_n_snow_dungeon_01"
    		]
    		if str(background.GetCurrentMapName()) in dis_maps:
    			return TRUE
    		return FALSE
    		
    	def __OnChangeChannel(self, ch):
    		ServerStateChecker.Update()
    		channel = net.GetServerInfo()[-1]
    #		channelnum = filter(str.isdigit, channel)
    		if ch == channel:
    			chat.AppendChat(chat.CHAT_TYPE_INFO, "You're already in the selected channel!")
    			return
    		if self.__IsSpecialMap():
    			chat.AppendChat(chat.CHAT_TYPE_INFO, "Sorry, This Is One of spiecal maps which you cannot change channel while you in it!")
    			return
    		net.SendChatPacket("/channel "+ str(ch))
    		self.Close()
    		
    	def Close(self):
    		constInfo.channel = 0
    		self.Hide()
    		return TRUE
    		
    	def OnPressEscapeKey(self):
    		constInfo.channel = 0
    		self.Hide()
    		return TRUE
    		

    3: change systemdialog.py in uiscript with this

    import uiScriptLocale
    
    ROOT = "d:/ymir work/ui/public/"
    
    window = {
    	"name" : "SystemDialog",
    	"style" : ("float",),
    
    	"x" : SCREEN_WIDTH/2 - 100,
    	"y" : SCREEN_HEIGHT/2 - 114,
    
    	"width" : 200,
    	"height" : 298,
    
    	"children" :
    	(
    		{
    			"name" : "board",
    			"type" : "thinboard",
    
    			"x" : 0,
    			"y" : 0,
    
    			"width" : 200,
    			"height" : 298,
    
    			"children" :
    			(
    				{
    					"name" : "Change_Channel",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 17,
    
    					"text" : uiScriptLocale.SYSTEM_CHANGE_CH,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    				{
    					"name" : "help_button",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 47,
    
    					"text" : uiScriptLocale.SYSTEM_HELP,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    
    				{
    					"name" : "system_option_button",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 97,
    
    					"text" : uiScriptLocale.SYSTEMOPTION_TITLE,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    				{
    					"name" : "game_option_button",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 127,
    
    					"text" : uiScriptLocale.GAMEOPTION_TITLE,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    				{
    					"name" : "change_button",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 157,
    
    					"text" : uiScriptLocale.SYSTEM_CHANGE,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    				{
    					"name" : "logout_button",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 187,
    
    					"text" : uiScriptLocale.SYSTEM_LOGOUT,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    				{
    					"name" : "exit_button",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 217,
    
    					"text" : uiScriptLocale.SYSTEM_EXIT,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    				{
    					"name" : "cancel_button",
    					"type" : "button",
    
    					"x" : 10,
    					"y" : 257,
    
    					"text" : uiScriptLocale.CANCEL,
    
    					"default_image" : ROOT + "XLarge_Button_01.sub",
    					"over_image" : ROOT + "XLarge_Button_02.sub",
    					"down_image" : ROOT + "XLarge_Button_03.sub",
    				},
    			),
    		},
    	),
    }

    and finally go to constnfo.py in root and write this

    channel = 0

    and the python part is over <3

    Yeah,but what if the user just write /channel x? With that way the user will just skip the map check :rolleyes:

  8. If you're using source you can do this via input_main.cpp:

    Before CBanwordManager::instance().ConvertString(buf, buflen); add this code:

    	if(ch->GetMapIndex() == MAP_OX_ID && (pinfo->type == CHAT_TYPE_TALKING || pinfo->type == CHAT_TYPE_PARTY || pinfo->type == CHAT_TYPE_GUILD || pinfo->type == CHAT_TYPE_GUILD))
    	{
    		return iExtraLen;
    	}

    Otherwise if you're not using the source I guess I don't know any other way

    • Love 1
  9. At client src:

    Change this(InstanceBase.cpp):

    m_dwLevel = c_rkCreateData.m_dwLevel

    To this:

    	BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace);
    
    	m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel);

    Ah and don't forget to include PythonNonPlayer.h

    After that open PythonNonPlayer.h and add this:

    		std::map<DWORD, BYTE> LevelByVnum;

    After that find:

            const TMobTable *	GetTable(DWORD dwVnum);

    And add this:

            BYTE				GetMobLevel(DWORD dwVnum);

    Next we need to open PythonNonPlayer.cpp:

    Find this line:

    m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData));

    Under that line add this:

    LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel;

    And finally add this event:

    BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum)
    {
    	map<DWORD, BYTE>::iterator it;
    	it = LevelByVnum.find(dwVnum);
    	if (it != LevelByVnum.end()) {
    		return it->second;
    	}
    	return 0;
    }

    It's untested but it will probably work.

    ​Why did you add the new map LevelByVnum and not just implemented the CPythonNonPlayer::GetMobLevel(DWORD dwVnum) like this:

    BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum)
    {
    	const CPythonNonPlayer::TMobTable * c_pTable = GetTable(dwVnum);
    	if (!c_pTable)
    		return 0;
    
    	return c_pTable->bLevel;
    }

    Regards

    ​I don't know, I guess I forgot that I could do it like this :P

    • Love 1
  10. Edit pls :)

    https://mega.co.nz/#!jkBDzDbb!abZpBDh0CXdu2AKuwdX8HGaqtw4BJrme1W56LEh6unM

    https://mega.co.nz/#!ftIH2JIS!9KOs9tv-wcqKpVDWFKthvh9iMOa5nbepu6VrVuQ_hk0

    At client src:

    Change this(InstanceBase.cpp):

    m_dwLevel = c_rkCreateData.m_dwLevel

    To this:

    	BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace);
    
    	m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel);

    Ah and don't forget to include PythonNonPlayer.h

    After that open PythonNonPlayer.h and add this:

    		std::map<DWORD, BYTE> LevelByVnum;

    After that find:

            const TMobTable *	GetTable(DWORD dwVnum);

    And add this:

            BYTE				GetMobLevel(DWORD dwVnum);

    Next we need to open PythonNonPlayer.cpp:

    Find this line:

    m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData));

    Under that line add this:

    LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel;

    And finally add this event:

    BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum)
    {
    	map<DWORD, BYTE>::iterator it;
    	it = LevelByVnum.find(dwVnum);
    	if (it != LevelByVnum.end()) {
    		return it->second;
    	}
    	return 0;
    }

    It's untested but it will probably work

    Dont work

    ​I just implemented it and it worked: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif/

    • Metin2 Dev 1
    • Love 2
  11. At client src:

    Change this(InstanceBase.cpp):

    m_dwLevel = c_rkCreateData.m_dwLevel

    To this:

    	BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace);
    
    	m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel);

    Ah and don't forget to include PythonNonPlayer.h

    After that open PythonNonPlayer.h and add this:

    		std::map<DWORD, BYTE> LevelByVnum;

    Next we need to open PythonNonPlayer.cpp:

    Find this line:

    m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData));

    Under that line add this:

    LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel;

    And finally add this event:

    BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum)
    {
    	map<DWORD, BYTE>::iterator it;
    	it = LevelByVnum.find(dwVnum);
    	if (it != LevelByVnum.end()) {
    		return it->second;
    	}
    	return 0;
    }

    It's untested but it will probably work.

    Tons of errors XD

     

    http://pastebin.com/MnkrD54x

    ​Upload here the files you edited.

    • Love 1
  12. At client src:

    Change this(InstanceBase.cpp):

    m_dwLevel = c_rkCreateData.m_dwLevel

    To this:

    	BYTE level_mob = CPythonNonPlayer::Instance().GetMobLevel(c_rkCreateData.m_dwRace);
    
    	m_dwLevel = ((c_rkCreateData.m_dwRace > 8 && c_rkCreateData.m_bType == CActorInstance::TYPE_ENEMY) ? level_mob : c_rkCreateData.m_dwLevel);
    

    Ah and don't forget to include PythonNonPlayer.h

    After that open PythonNonPlayer.h and add this:

    		std::map<DWORD, BYTE> LevelByVnum;

    After that find:

            const TMobTable *	GetTable(DWORD dwVnum);

    And add this:

            BYTE				GetMobLevel(DWORD dwVnum);

    Next we need to open PythonNonPlayer.cpp:

    Find this line:

    m_NonPlayerDataMap.insert(TNonPlayerDataMap::value_type(pNonPlayerData->dwVnum, pNonPlayerData));

    Under that line add this:

    LevelByVnum[pNonPlayerData->dwVnum] = pNonPlayerData->bLevel;

    And finally add this event:

    BYTE CPythonNonPlayer::GetMobLevel(DWORD dwVnum)
    {
    	map<DWORD, BYTE>::iterator it;
    	it = LevelByVnum.find(dwVnum);
    	if (it != LevelByVnum.end()) {
    		return it->second;
    	}
    	return 0;
    }

    It's untested but it will probably work.

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