Beispiel #1
0
	def handleChat(self, type, activeChar, target, text):
		if activeChar.isChatBanned() and Util.contains(Config.BAN_CHAT_CHANNELS, type):
			activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED)
			return
		cs = CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text)
		pls = L2World.getInstance().getAllPlayersArray()
		if Config.DEFAULT_GLOBAL_CHAT.lower() == "on" or (Config.DEFAULT_GLOBAL_CHAT.lower() == "gm" and activeChar.isGM()):
			region = MapRegionManager.getInstance().getMapRegionLocId(activeChar)
			for player in pls:
				if region == MapRegionManager.getInstance().getMapRegionLocId(player) and not BlockList.isBlocked(player, activeChar) and player.getInstanceId() == activeChar.getInstanceId():
					player.sendPacket(cs)
		elif Config.DEFAULT_GLOBAL_CHAT.lower() == "global":
			if not activeChar.isGM() and not activeChar.getFloodProtectors().getGlobalChat().tryPerformAction("global chat"):
				activeChar.sendMessage(1101)
				return
			for player in pls:
				if not BlockList.isBlocked(player, activeChar):
					player.sendPacket(cs)
		if not self.answer == None:
			if text == self.answer:
				self.answer = None
				Announcements.getInstance().announceToAll("恭喜 %s 獲得 %s 數量 %s 答案:%s" % (activeChar.getName(), self.item, self.qty, text), self.isCritical)
				activeChar.addItem(self.qn, self.gifts[self.item], int(self.qty), None, True)
Beispiel #2
0
	def useVoicedCommand(self, command, player, params):
		if player.isInCombat(): return
		if player.isDead(): return
		if player.isInOlympiadMode(): return
		if player.isFakeDeath(): return
		if player.isFishing(): return
		if player.isInStoreMode() or player.isInCraftMode(): return
		if not TvTEvent.onEscapeUse(player.getObjectId()): return
		if player.isAfraid(): return
		if player.isCombatFlagEquipped(): return
		if player.isInOlympiadMode(): return
		#if GrandBossManager.getInstance().getZone(player) != None and not player.isGM(): return
		if player.isFestivalParticipant(): return
		if player.isInJail(): return
		if player.isInDuel(): return
		
		loc = MapRegionManager.getInstance().getTeleToLocation(player, MapRegionManager.TeleportWhereType.Town)
		if loc:
			player.setInstanceId(0)
			player.setIsIn7sDungeon(False)
			player.teleToLocation(loc, True)
Beispiel #3
0
    def useVoicedCommand(self, command, player, params):
        if player.isInCombat(): return
        if player.isDead(): return
        if player.isInOlympiadMode(): return
        if player.isFakeDeath(): return
        if player.isFishing(): return
        if player.isInStoreMode() or player.isInCraftMode(): return
        if not TvTEvent.onEscapeUse(player.getObjectId()): return
        if player.isAfraid(): return
        if player.isCombatFlagEquipped(): return
        if player.isInOlympiadMode(): return
        #if GrandBossManager.getInstance().getZone(player) != None and not player.isGM(): return
        if player.isFestivalParticipant(): return
        if player.isInJail(): return
        if player.isInDuel(): return

        loc = MapRegionManager.getInstance().getTeleToLocation(
            player, MapRegionManager.TeleportWhereType.Town)
        if loc:
            player.setInstanceId(0)
            player.setIsIn7sDungeon(False)
            player.teleToLocation(loc, True)