Jump to content

avertuss

Inactive Member
  • Posts

    480
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by avertuss

  1. Dnia 20.11.2018 o 02:58, VegaS™ napisał:

    You can do it in a simple way.

    • root/interfaceModule.py
      Odkryj ukrytą treść
    
    
    #1.1) Search for:
    		self.bigBoard = None
    #1.2) Add after:
    		if app.ENABLE_12ZI:
    			self.missionBoard = None
    
    #2.1) Search for:
    		self.bigBoard = uiTip.BigBoard()
    		self.bigBoard.Hide()
    #2.2) Add after:
    		if app.ENABLE_12ZI:
    			self.missionBoard = uiTip.MissionBoard()
    			self.missionBoard.Hide()
    
    #3.1) Search and delete:
    		self.__MakeTipBoard()
    
    #4.1) Search for:
    		self.__MakeMessengerWindow()
    #4.2) Add before:
    		self.__MakeTipBoard()	# ENABLE_12ZI Display it below the others ui.
    
    #5.1) Search for:
    		del self.wndItemSelect
    #5.2) Add after:
    		if app.ENABLE_12ZI:
    			del self.missionBoard

     

    • root/game.py
      Odkryj ukrytą treść
    
    
    #1.1) Search for:
    	def BINARY_SetBigMessage(self, message):
    		self.interface.bigBoard.SetTip(message)
    #1.2) Add after:
    	if app.ENABLE_12ZI:
    		def BINARY_SetMissionMessage(self, message):
    			if self.interface:
    				self.interface.missionBoard.SetMission(message)
    			
    		def BINARY_SetSubMissionMessage(self, message):
    			if self.interface:
    				self.interface.missionBoard.SetSubMission(message)
    			
    		def BINARY_CleanMissionMessage(self):
    			if self.interface:
    				self.interface.missionBoard.CleanMission()

     

    • root/uiTip.py
      Odkryj ukrytą treść
    
    
    #1.1) Search for:
    class BigTextBar(TextBar):
    	def __init__(self, width, height, fontSize):
    		ui.Window.__init__(self)
    		self.handle = grp.CreateBigTextBar(width, height, fontSize)
    
    	def __del__(self):
    		ui.Window.__del__(self)
    		grp.DestroyTextBar(self.handle)
    #1.2) Add after:
    if app.ENABLE_12ZI:
    	class MissionBoard(ui.Bar):
    		FONT_HEIGHT	= 15
    		LINE_HEIGHT	= FONT_HEIGHT + 5
    		STEP_HEIGHT	= LINE_HEIGHT + 5
    		LONG_TEXT_START_X	= 300
    		SCREEN_WIDTH = wndMgr.GetScreenWidth()
    		
    		def __init__(self):
    			ui.Bar.__init__(self)
    
    			self.AddFlag("not_pick")
    			self.missionText = None
    			self.missionFullText = None
    			self.curPos = 0
    			self.dstPos = -5
    			self.nextScrollTime = 0
    			self.flowMode = False
    			self.ScrollStartTime = 0.0
    
    			self.SetPosition(0, 100)
    			self.SetSize(self.SCREEN_WIDTH, 35)
    			self.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.5))
    			self.SetWindowHorizontalAlignCenter()
    
    			self.__CreateTextBar()
    			
    		def __del__(self):
    			ui.Bar.__del__(self)
    
    		def __CreateTextBar(self):
    			x, y = self.GetGlobalPosition()
    
    			self.textBar = BigTextBar(self.SCREEN_WIDTH * 2, 300, self.FONT_HEIGHT)
    			self.textBar.SetParent(self)
    			self.textBar.SetPosition(6, 8)
    			self.textBar.SetTextColor(242, 231, 193)
    			self.textBar.SetClipRect(0, y, self.SCREEN_WIDTH, y + 8 + self.STEP_HEIGHT)
    			self.textBar.Show()
    
    		def CleanMission(self):
    			self.missionText = None
    			self.missionFullText = None
    			self.textBar.ClearBar()
    			self.Hide()
    
    		def __RefreshBoard(self):
    			self.textBar.ClearBar()
    
    			if self.missionFullText:
    				(text_width, text_height) = self.textBar.GetTextExtent(self.missionFullText)
    				
    				if text_width>self.SCREEN_WIDTH:
    					self.textBar.TextOut(0, (self.STEP_HEIGHT - 8 - text_height) / 2, self.missionFullText)
    					self.flowMode = True
    				else:
    					self.textBar.TextOut((wndMgr.GetScreenWidth() - text_width) / 2, (self.STEP_HEIGHT - 8 - text_height) / 2, self.missionFullText)
    					self.flowMode = False
    
    		def SetMission(self, text):
    			self.__AppendText(text)
    			self.__RefreshBoard()
    
    			if self.flowMode:
    				self.dstPos = -text_width
    				self.curPos = self.LONG_TEXT_START_X
    				self.textBar.SetPosition(3 + self.curPos, 8)
    			else:
    				self.dstPos = 0
    				self.curPos = self.STEP_HEIGHT
    				self.textBar.SetPosition(3, 8 + self.curPos)
    			
    			if not self.IsShow():
    				self.Show()
    				
    		def SetSubMission(self, text):
    			self.missionFullText = self.missionText + text
    			preflowMode = self.flowMode
    			
    			self.__RefreshBoard()
    			
    			if preflowMode != self.flowMode:
    				if self.flowMode:
    					self.dstPos = -text_width
    					self.curPos = self.LONG_TEXT_START_X
    					self.textBar.SetPosition(3 + self.curPos, 8)
    				else:
    					self.dstPos = 0
    					self.curPos = self.STEP_HEIGHT
    					self.textBar.SetPosition(3, 8 + self.curPos)
    
    		def __AppendText(self, text):
    			if text == "":
    				self.CleanMission()
    				return
    				
    			self.missionText = text
    			self.missionFullText = text
    			
    		def OnUpdate(self):
    			if self.missionFullText == None:
    				self.Hide()
    				return
    
    			if self.dstPos < self.curPos:
    				self.curPos -= 1
    				if self.flowMode:
    					self.textBar.SetPosition(3 + self.curPos, 8)
    				else:
    					self.textBar.SetPosition(3, 8 + self.curPos)
    			else:
    				if self.flowMode:
    					self.curPos = self.SCREEN_WIDTH

     

    Now all what you need is to call them from server > client how you want.

    
    PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetMissionMessage", Py_BuildValue("(s)", "#MissionMessage"));	
    PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetSubMissionMessage", Py_BuildValue("(s)", "#SubMissionMessage"));
    PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_CleanMissionMessage", Py_BuildValue("()"));

    You can do a new CHAT_TYPE_UNKNOWN_NAME or like a command, depends of how you want to use it.

    • game/src/unknown_file.cpp
      Odkryj ukrytą treść
    
    
    ChatPacket(CHAT_TYPE_COMMAND, "SetMissionMessage %s", "VS. Ending Soon");
    ChatPacket(CHAT_TYPE_COMMAND, "SetSubMission %s", "VS. is over. The world begins again under...");
    ChatPacket(CHAT_TYPE_COMMAND, "CleanMission");

     

    • UserInterface/PythonNetworkStreamCommand.cpp
      Odkryj ukrytą treść
    
    
    #ifdef ENABLE_12ZI
    	else if (!strcmpi(szCmd, "SetMissionMessage"))
    	{
    		if (2 != TokenVector.size())
    		{
    			TraceError("CPythonNetworkStream::ServerCommand(c_szCommand=%s) - Strange Parameter Count : %s", c_szCommand);
    			return;
    		}
    
    		const std::string & c_rstrMessage = TokenVector[1].c_str();
    		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetMissionMessage", Py_BuildValue("(s)", c_rstrMessage.c_str()));	
    	}
    	
    	else if (!strcmpi(szCmd, "SetSubMissionMessage"))
    	{
    		if (2 != TokenVector.size())
    		{
    			TraceError("CPythonNetworkStream::ServerCommand(c_szCommand=%s) - Strange Parameter Count : %s", c_szCommand);
    			return;
    		}
    
    		const std::string & c_rstrMessage = TokenVector[1].c_str();
    		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetSubMissionMessage", Py_BuildValue("(s)", c_rstrMessage.c_str()));	
    	}
    	
    	else if (!strcmpi(szCmd, "CleanMissionMessage"))
    	{
    		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_CleanMissionMessage", Py_BuildValue("()"));	
    	}
    #endif

     

     

    How can i use spacerbar in cmdchat?

    cmdchat("SetMissionMessage You_should_kill_Azreael") -- it works

    cmdchat("SetMissionMessage You should kill Azreael") -- doesn't work

  2. 4 godziny temu, VegaS™ napisał:
    • if itemInvenPage == self.wndInventory.GetInventoryPageIndex():
    • if self.wndInventory and itemInvenPage == self.wndInventory.GetInventoryPageIndex():

    It works but what with this error?

    0822 00:01:29573 :: Traceback (most recent call last):
    
    0822 00:01:29573 ::   File "ui.py", line 1098, in ui.Button.CallEvent
    
    0822 00:01:29573 ::   File "ui.py", line 137, in ui.__mem_func__.__call__
    
    0822 00:01:29573 ::   File "ui.py", line 119, in ui.__noarg_call__.__call__
    
    0822 00:01:29573 ::   File "uiNewShop.py", line 133, in uiNewShop.ShopDialogCreate.CreateShop
    
    0822 00:01:29573 ::   File "uiPrivateShopBuilder.py", line 243, in uiPrivateShopBuilder.PrivateShopBuilder.Open
    
    0822 00:01:29573 :: AttributeError
    0822 00:01:29573 :: : 
    0822 00:01:29573 :: 'NoneType' object has no attribute 'SetOnTopWindow'
    0822 00:01:29573 :: 

     

  3. Hi. I have code:

    LPITEM item = ITEM_MANAGER::instance().CreateItem(70104, 1, 0, true);
    if (item)
    {
    	item->SetSocket(0, mobVnum);
    	int iEmptyPos = ch->GetEmptyInventory(item->GetSize());
    
    	if (iEmptyPos != -1)
    	{
    		ch->PointChange(POINT_GOLD, -price);
    		item = ch->AutoGiveItem(item->GetVnum(), item->GetCount());
    	}
    	else
    	{
    		M2_DESTROY_ITEM(item);
    		ch->ChatPacket(CHAT_TYPE_INFO, "No slots in inventory.");
    		break;
    	}
    }
    else
    {
    	ch->ChatPacket(CHAT_TYPE_INFO, "#%d item not exist by that vnum.", 70104);
    	break;
    }

    that code is stacking marble but i can't use them beacuse they haven't socket. Any ideas? 

  4. @xP3NG3Rx

    i have no idea why but if i have your code in uiexchange client is crashing when on login screen with syserr:

    0731 13:38:04482 :: 0731 13:38:04482 :: ============================================================================================================
    0731 13:38:04482 :: Abort!!!!

    Nothing more. Any ideas? I tried your modified file but without results. 

  5. 16 minut temu, ragem0re napisał:

    then post your error..

    Ahh sorry, im stupid

     

    Error 
    QUEST : new_guild
    STATE : start
    guild/new_guild.quest:3:assertion failure : t.token == '('
    Abort (core dumped)

     

    Quest

    quest new_guild begin
    	state start begin
    		function pc.make_guild(guild_name, required_money, required_level)
    			--[[to clean non alphanumeric characters]]
    			local guild_name = string.gsub(guild_name, "[^A-Za-z0-9]", "")
    			local guild_len_name = string.len(guild_name)
    			--[[to check wrong sized names]]
    			if not ((2 < guild_len_name) and (guild_len_name < 12)) then
    				say_reward("The name should not have special characters and its length should be between 3-11 characters!")
    				return
    			end
    			--[[to check required level]]
    			if not (pc.get_level() >= required_level) then
    				say_reward(string.format("Level too low. Needed: %d", required_level))
    				return false
    			end
    			--[[to check required money]]
    			if not (pc.get_gold() >= required_money) then
    				say_reward(string.format("Not enough money. Needed: %d", required_money))
    				return false
    			end
    			--[[to check already guilded people]]
    			if (pc.hasguild() or pc.isguildmaster()) then
    				say_reward("You're already inside a guild.")
    				return
    			end
    			--[[to add a user-validation check]]
    			say(string.format("Are you sure you wanna create such guild?[ENTER]%s", guild_name))
    			if select("Yes", "No")==2 then
    				return false
    			end
    			--[[create the guild and process the return value]]
    			local ret = pc.make_guild0(guild_name)
    			if ret==-2 then
    				say_reward("[NO] guild name is invalid (strlen <2 or >11!)")
    			elseif ret==-1 then
    				say_reward("[NO] guild name is invalid (special chars found!)")
    			elseif ret==0 then
    				say_reward("[NO] guild not created (guild name already present or already member of a guild)")
    			elseif ret==1 then
    				pc.change_gold(-required_money)
    				say_reward("[YES] guild created")
    				return true
    			elseif ret==2 then
    				say_reward("[NO] player already part of a guild")
    			elseif ret==3 then
    				say_reward("[NO] player already guild master")
    			end
    			return false
    		end
    		when 20016.chat."new guild" begin
    			local guild_name = input()
    			local required_money = 5435
    			local required_level = 75
    			new_guild.pc.make_guild(guild_name, required_money, required_level)
    		end
    	end
    end
    		

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