示例#1
0
    def SendWhisper(self):
        text = self.chatLine.GetText()
        textLength = len(text)

        if textLength > 0:
            if app.LINK_IN_CHAT:
                link = self.GetLink(text)
                if link != "":
                    import chr
                    if not chr.IsGameMaster():
                        text = text.replace(
                            link, "|cFF00C0FC|h|Hweb:" +
                            link.replace("://", "XxX") + "|h" + link + "|h|r")
                    else:
                        text = text.replace(
                            link, "|cFF00C0FC|h|Hsysweb:" +
                            link.replace("://", "XxX") + "|h" + link + "|h|r")
#MULTILANGUAGE Chat Kingdom
            #net.SendWhisperPacket(self.targetName, text)
            net.SendWhisperPacket(self.targetName,
                                  "language_" + app.GetMyLang() + text)
            self.chatLine.SetText("")
            #MULTILANGUAGE Chat Kingdom
            chat.AppendWhisper(
                chat.WHISPER_TYPE_CHAT, self.targetName, "language_" +
                app.GetMyLang() + " " + player.GetName() + " : " + text)
	def SendWhisper(self):

		text = self.chatLine.GetText()
		textLength = len(text)

		if textLength > 0:
			if net.IsInsultIn(text):
				chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)
				return

			net.SendWhisperPacket(self.targetName, text)
			self.chatLine.SetText("")

			chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)
示例#3
0
    def OnUpdate(self):
        if player.IsPVPInstance(self.vid):
            if app.GetTime() > self.SaveSecond:
                self.SaveSecond = app.GetTime() + 0.2
                if str(chr.GetNameByVID(self.vid)) != "None":
                    net.SendWhisperPacket(
                        str(self.name.GetText()),
                        "CODE_MESSAGE_OPPONENTS_HP_29305|" +
                        str(player.GetMainCharacterIndex()))
                if constInfo.OPPONENTS_HP[1] != 0:
                    if constInfo.OPPONENTS_HP[0] <= 0:
                        self.SetHP(0)
                    else:
                        self.SetHP(((float(constInfo.OPPONENTS_HP[0]) /
                                     float(constInfo.OPPONENTS_HP[1])) * 100))

                    self.HPText.SetText(
                        "%d/%d" %
                        (constInfo.OPPONENTS_HP[0], constInfo.OPPONENTS_HP[1]))
                    self.HPText.Show()

        else:
            self.HPText.Hide()

        if self.isShowButton:

            exchangeButton = self.buttonDict[localeInfo.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()