Beispiel #1
0
	def showResult(self, player, htmString):
		if not player or not htmString or len(htmString) == 0: return True
		if htmString.endswith(".htm") or htmString.endswith(".html"):
			htmString = JQuest.getHtm(self, player.getHtmlPrefix(), htmString)
		if len(htmString) != 0:
			st = player.getQuestState(qn)
			if player.getTarget():
				htmString.replace("%objectId%", str(player.getTarget().getObjectId()))
			htmString = htmString.replace("%playername%", player.getName())		
			htmString = htmString.replace("%times%", str(max(st.getInt('times'), 0)))
			htmString = htmString.replace("%skillSTR%", str(max(player.getSkillLevel(skillSTR), 1)-1))
			htmString = htmString.replace("%skillDEX%", str(max(player.getSkillLevel(skillDEX), 1)-1))
			htmString = htmString.replace("%skillCON%", str(max(player.getSkillLevel(skillCON), 1)-1))
			htmString = htmString.replace("%skillINT%", str(max(player.getSkillLevel(skillINT), 1)-1))
			htmString = htmString.replace("%skillWIT%", str(max(player.getSkillLevel(skillWIT), 1)-1))
			htmString = htmString.replace("%skillMEN%", str(max(player.getSkillLevel(skillMEN), 1)-1))

			htmString = htmString.replace("%freeRebirthPoint%", str(self.getFreeRebirthPoint(player)))
			htmString = htmString.replace("%maxRebirthPoint%", str(maxRebirthPoint))
			htmString = htmString.replace("%levelAfterRebirth%", str(levelAfterRebirth))
			htmString = htmString.replace("%require_level%", str(requireLevel))
			htmString = htmString.replace("%require_item_count_1%", str(requireItem[0][1]))
			html = NpcHtmlMessage(player.getTarget().getObjectId())
			html.setHtml(htmString)
			player.sendPacket(html)
		return htmString
Beispiel #2
0
    def showResult(self, player, htmString):
        if not player or not htmString or len(htmString) == 0: return True
        if htmString.endswith(".htm") or htmString.endswith(".html"):
            htmString = JQuest.getHtm(self, player.getHtmlPrefix(), htmString)
        if len(htmString) != 0:
            st = player.getQuestState(qn)
            if player.getTarget():
                htmString.replace("%objectId%",
                                  str(player.getTarget().getObjectId()))
            htmString = htmString.replace("%playername%", player.getName())
            htmString = htmString.replace("%times%",
                                          str(max(st.getInt('times'), 0)))
            htmString = htmString.replace(
                "%skillSTR%", str(max(player.getSkillLevel(skillSTR), 1) - 1))
            htmString = htmString.replace(
                "%skillDEX%", str(max(player.getSkillLevel(skillDEX), 1) - 1))
            htmString = htmString.replace(
                "%skillCON%", str(max(player.getSkillLevel(skillCON), 1) - 1))
            htmString = htmString.replace(
                "%skillINT%", str(max(player.getSkillLevel(skillINT), 1) - 1))
            htmString = htmString.replace(
                "%skillWIT%", str(max(player.getSkillLevel(skillWIT), 1) - 1))
            htmString = htmString.replace(
                "%skillMEN%", str(max(player.getSkillLevel(skillMEN), 1) - 1))

            htmString = htmString.replace(
                "%freeRebirthPoint%", str(self.getFreeRebirthPoint(player)))
            htmString = htmString.replace("%maxRebirthPoint%",
                                          str(maxRebirthPoint))
            htmString = htmString.replace("%levelAfterRebirth%",
                                          str(levelAfterRebirth))
            htmString = htmString.replace("%require_level%", str(requireLevel))
            htmString = htmString.replace("%require_item_count_1%",
                                          str(requireItem[0][1]))
            html = NpcHtmlMessage(player.getTarget().getObjectId())
            html.setHtml(htmString)
            player.sendPacket(html)
        return htmString
Beispiel #3
0
	def showResult(self, player, htmString):
		if not player or not htmString or len(htmString) == 0: return True
		if htmString.endswith(".htm") or htmString.endswith(".html"):
			htmString = JQuest.getHtm(self, player.getHtmlPrefix(), htmString)
		if len(htmString) != 0:
			st = player.getQuestState(self.qn)
			if player.getTarget():
				htmString.replace("%objectId%", str(player.getTarget().getObjectId()))
			htmString = htmString.replace("%playername%", player.getName())		

			myBuffList = self.getMyBuffList(st)
			if myBuffList:
				myBuffList = myBuffList.split()
				myBuffList = filter(lambda b: b in self.allowBuffList, myBuffList)
				for i in myBuffList:
					# htmString = htmString.replace('%'+i+'%', '_checked')
					htmString = htmString.replace('%'+i+'%', 'bgcolor=903000')
			for i in self.allowBuffList:
				htmString = htmString.replace('%'+i+'%', '')
			html = NpcHtmlMessage(player.getTarget().getObjectId())
			html.setHtml(htmString)
			player.sendPacket(html)
		return htmString