Register for your free account! | Forgot your password?

You last visited: Today at 19:14

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[TUT]Opponent's HP and MP during pvp

Discussion on [TUT]Opponent's HP and MP during pvp within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
Endymion_'s Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 46
Received Thanks: 139
[TUT]Opponent's HP and MP during pvp

Hi.


And now tutorial how add it into client:

You must add following code to costinfo.py
Code:
INPUT_IGNORE = 0

VID = 0
STHX = 0
HPXD = 0

PLAYER_HP = 0
PLAYER_MAX_HP = 0
PLAYER_SP = 0
PLAYER_MAX_SP = 0
PLAYER_NAME = ""
Next, open game.py, and add these things:
Code:
import uiHealth
			
			#wskaznikiHP
			"super_quest"				: self.Tabulejtor,
			"pvp_zdruwko"				: self.Mozart,
			
			#inputpowerdziwko
			"get_input_value"				: self.GetInputValue,
			"get_input_start"				: self.GetInputOn,
			"get_input_end"					: self.GetInputOff,

def Mozart(self, data):
		dane = data.split("|")
		constInfo.PLAYER_NAME = str(dane[0])
		constInfo.PLAYER_HP = int(dane[1])
		constInfo.PLAYER_MAX_HP = int(dane[2])
		constInfo.PLAYER_SP = int(dane[3])
		constInfo.PLAYER_MAX_SP = int(dane[4])

def Tabulejtor(self, id):
		constInfo.STHX = int(id)
			
	def GetInputOn(self):
		constInfo.INPUT_IGNORE = 1
		
	def GetInputOff(self):
		constInfo.INPUT_IGNORE = 0
			
	def GetInputValue(self):
		net.SendQuestInputStringPacket(str(constInfo.VID))

def OpenQuestWindow(self, skin, idx):
		if constInfo.INPUT_IGNORE == 1:
			return
		else:
			self.interface.OpenQuestWindow(skin, idx)
Next pieces of code you have to add to uitarget.py
Code:
import uiHealth
import constInfo

def OnUpdate(self):		
		if player.IsPVPInstance(self.vid):
			constInfo.VID = self.vid
			event.QuestButtonClick(constInfo.STHX)
			if not self.healthBoard.IsShow() and self.vid != 0:
				self.healthBoard.Show()
		else:
			self.healthBoard.Hide()
		
		if self.isShowButton:
			
			exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE]
			distance = player.GetCharacterDistance(self.vid)

			if distance < 0:
				return

			if exchangeButton.IsShow():
				if distance > self.EXCHANGE_LIMIT_RANGE:
					self.RefreshButton()

			else:
				if distance < self.EXCHANGE_LIMIT_RANGE:
					self.RefreshButton()
In def __init__(self) (uitarget.py) must add this:

Code:
		self.healthBoard = uiHealth.HealthBoard()
In def Close() must add this:
Code:
		self.healthBoard.Hide()
For eg.
Code:
def Close(self):
		self.__Initialize()
		self.healthBoard.Hide()
		self.Hide()
Now you must create uihealth.py in root and paste there this code:
Code:
#Krzywy
import ui
import constInfo

def GetInfoFrom(id):
	table = {
		1	:	constInfo.PLAYER_NAME,
		2	:	constInfo.PLAYER_HP,
		3	:	constInfo.PLAYER_MAX_HP,
		4	:	constInfo.PLAYER_SP,
		5	:	constInfo.PLAYER_MAX_SP}
		
	if table.has_key(id):
		return table[id]
		

class HealthBoard(ui.ThinBoard):

	def __init__(self):
		ui.ThinBoard.__init__(self)
		
		self.Config()

	def __del__(self):
		ui.ThinBoard.__del__(self)
		
	def Config(self):
		self.SetSize(200, 120)
		self.SetPosition(0, 20)
		
		self.hp_bar = ui.Gauge()
		self.hp_bar.SetParent(self)
		self.hp_bar.SetPosition(30, 30+20)
		self.hp_bar.MakeGauge(130, "red")
		self.hp_bar.Show()
		
		self.sp_bar = ui.Gauge()
		self.sp_bar.SetParent(self)
		self.sp_bar.SetPosition(30, 60+20)
		self.sp_bar.MakeGauge(130, "blue")
		self.sp_bar.Show()
		
		self.name = ui.TextLine()
		self.name.SetParent(self)
		self.name.SetDefaultFontName()
		self.name.SetPosition(45, 30)
		self.name.SetText("")
		self.name.Show()	
		
		self.hp_show = ui.TextLine()
		self.hp_show.SetParent(self)
		self.hp_show.SetDefaultFontName()
		self.hp_show.SetPosition(60-15, 57)
		self.hp_show.SetText("")
		self.hp_show.Show()	
		
		self.sp_show = ui.TextLine()
		self.sp_show.SetParent(self)
		self.sp_show.SetDefaultFontName()
		self.sp_show.SetPosition(60-15, 80+7)
		self.sp_show.SetText("")
		self.sp_show.Show()	
		
	def OnUpdate(self):
		if (GetInfoFrom(2)+GetInfoFrom(3)+GetInfoFrom(4)+GetInfoFrom(5)) == 0:
			self.Hide()
		self.hp_bar.SetPercentage(GetInfoFrom(2), GetInfoFrom(3))
		self.sp_bar.SetPercentage(GetInfoFrom(4), GetInfoFrom(5))
		self.name.SetText(GetInfoFrom(1))
		self.hp_show.SetText("Health Points: %s / %s" % (GetInfoFrom(2), GetInfoFrom(3)))
		self.sp_show.SetText("Mana Points: %s / %s" % (GetInfoFrom(4), GetInfoFrom(5)))
		self.name.SetText("Character: %s" % (GetInfoFrom(1)))
And quest:
Code:
-- Quest Opponents HP and MP during pvp
-- Made by: Endymion_
-- Server: Ascarial.pl
quest wskaznikHpWroga begin
	state start begin
		when login begin
			cmdchat("super_quest "..q.getcurrentquestindex())
		end

		when info or button begin
			cmdchat("get_input_start")
			local vid = input(cmdchat("get_input_value"))
			cmdchat("get_input_end")
			local old_pc = pc.select(vid)
			local name = pc.get_name()
			local hp = pc.get_hp()
			local max_hp = pc.get_max_hp()
			local mp = pc.get_sp()
			local max_mp = pc.get_max_sp()
			pc.select(old_pc)
			cmdchat("pvp_zdruwko "..name.."|"..hp.."|"..max_hp.."|"..mp.."|"..max_mp)
		end
	end
end
Greetings.
Endymion_ is offline  
Thanks
77 Users
Old 12/29/2013, 11:07   #2
 
elite*gold: 0
Join Date: Jan 2012
Posts: 12
Received Thanks: 1
video tutorial?
mvluis100 is offline  
Old 12/29/2013, 11:09   #3
 
deltous'fabius's Avatar
 
elite*gold: 84
Join Date: May 2013
Posts: 478
Received Thanks: 234
Its very nice.
Better way, put it under the Name colum.

€: Tested it works
deltous'fabius is offline  
Thanks
1 User
Old 12/29/2013, 11:10   #4
 
elite*gold: 2
Join Date: Jun 2013
Posts: 1,063
Received Thanks: 1,725
nice job, hope to see more from you!
ProfessorEnte is offline  
Old 12/29/2013, 11:13   #5
 
elite*gold: 0
Join Date: Jul 2013
Posts: 809
Received Thanks: 1,613
Wolte das bei mir im Forum releasen ne bessere version
aber naja xD die ist auch ned schlecht
CryPrime is offline  
Old 12/29/2013, 11:45   #6
 
elite*gold: 0
Join Date: May 2012
Posts: 4
Received Thanks: 0
1229 11:44:05019 ::
networkModule.py(line:201) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:26) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 530)

1229 11:44:05019 :: ================================================== ================================================== ========
1229 11:44:05019 :: Abort!!!!
zukke is offline  
Old 12/29/2013, 11:59   #7

 
Aze /..'s Avatar
 
elite*gold: 220
Join Date: Oct 2011
Posts: 7,369
Received Thanks: 7,610
Nice job.

Will test it. Thanks
Aze /.. is offline  
Thanks
1 User
Old 12/29/2013, 17:26   #8
 
elite*gold: 0
Join Date: Jul 2011
Posts: 40
Received Thanks: 12
Ugly gui and ugly cmdchat but nice work.
JaPitole is offline  
Old 12/29/2013, 17:31   #9
 
[uLow]NTX?!'s Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 1,266
Received Thanks: 627
Hopefully he knows, that the Client by default recived the Hp from the server
[uLow]NTX?! is offline  
Old 12/29/2013, 17:49   #10
 
enizer007's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 16
Received Thanks: 2
works 100%, thanks for sharing ^^
enizer007 is offline  
Old 12/29/2013, 18:02   #11
 
elite*gold: 0
Join Date: Jun 2012
Posts: 58
Received Thanks: 14
Quote:
Originally Posted by zukke View Post
1229 11:44:05019 ::
networkModule.py(line:201) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:26) ?
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 530)

1229 11:44:05019 :: ================================================== ================================================== ========
1229 11:44:05019 :: Abort!!!!
Check the tabs men.
LordMG is offline  
Old 12/29/2013, 22:12   #12
 
elite*gold: 0
Join Date: Sep 2013
Posts: 1
Received Thanks: 0
1229 23:04:16952 :: self.name.SetText("Character: %s" % (GetInfoFrom(1)))
help plese fasttt
kopernikosre is offline  
Old 12/29/2013, 22:46   #13
 
.Cyous's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 2,575
Received Thanks: 916
Very nice.
Thanks for this tutorial.

.Cyous
.Cyous is offline  
Old 12/29/2013, 23:51   #14


 
xXGaardenXx's Avatar
 
elite*gold: 26
Join Date: Jan 2009
Posts: 1,175
Received Thanks: 469
1229 23:47:22186 :: File "networkModule.py", line 231, in SetGamePhase

1229 23:47:22186 :: File "system.py", line 139, in __pack_import

1229 23:47:22186 :: File "
1229 23:47:22186 :: <string>
1229 23:47:22186 :: ", line
1229 23:47:22186 :: 2164
1229 23:47:22186 ::

1229 23:47:22186 ::
1229 23:47:22186 :: net.SendQuestInputStringPacket(str(constInfo.VID))
1229 23:47:22186 ::

1229 23:47:22186 ::
1229 23:47:22187 :: ^

1229 23:47:22187 :: SyntaxError
1229 23:47:22187 :: :
1229 23:47:22187 :: invalid syntax
1229 23:47:22187 ::
xXGaardenXx is offline  
Old 12/30/2013, 01:57   #15
 
elite*gold: 0
Join Date: Oct 2011
Posts: 15
Received Thanks: 4
add import event for event.QuestButtonClick(constInfo.STHX). 100% work, tested

Code:
	def OnUpdate(self):
		if player.IsPVPInstance(self.vid):
			constInfo.VID = self.vid
			import event
			event.QuestButtonClick(constInfo.STHX)
			if not self.healthBoard.IsShow() and self.vid != 0:
				self.healthBoard.Show()
		else:
			self.healthBoard.Hide()

		if self.isShowButton:

			exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE]
			distance = player.GetCharacterDistance(self.vid)

			if distance < 0:
				return

			if exchangeButton.IsShow():
				if distance > self.EXCHANGE_LIMIT_RANGE:
					self.RefreshButton()

			else:
				if distance < self.EXCHANGE_LIMIT_RANGE:
					self.RefreshButton()
Flexio32 is offline  
Thanks
3 Users
Reply


Similar Threads Similar Threads
Opponent Card Viewer
12/28/2013 - Hearthstone - 9 Replies
Removed. Fake
Selling sick Gold1 Account on EUW with 300+ Teamwork and 100+ Honorable Opponent
06/23/2013 - League of Legends Trading - 0 Replies
SOLD
Soul Crash (No Opponent BUG)
04/26/2012 - Facebook - 14 Replies
http://desmond.imageshack.us/Himg252/scaled.php?se rver=252&filename=watsrong.jpg&res=landing Anyone have solution? some one will give solution but with payment :mad: help :(
Make your Arena opponent disconnect! [2.3.2]
01/14/2008 - WoW Exploits, Hacks, Tools & Macros - 3 Replies
In Arena, if you mind control people and walk them into the Shadowsight debuff, they will disconnect. Rejoice!
Outdoor Raid Bosses:Mess Up The Opponent Midfight
10/06/2005 - WoW Guides & Templates - 1 Replies
On Azuergos and Lord Kazzak a main tank is a must have, when removed suddenly the raid will most likely wipe should they not have a backup. Things you need. An engineer with Gnomish Mind Control Hat(rogue pref) A distraction A Rogue



All times are GMT +2. The time now is 19:14.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.