当前位置: 首页>>代码示例>>Python>>正文


Python serverpackets.SystemMessage类代码示例

本文整理汇总了Python中net.sf.l2j.gameserver.network.serverpackets.SystemMessage的典型用法代码示例。如果您正苦于以下问题:Python SystemMessage类的具体用法?Python SystemMessage怎么用?Python SystemMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SystemMessage类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onKill

	def onKill (self,npc,player,isPet):
		npcId = npc.getNpcId()
		if npcId == WANDERING_CARAVAN:
			bcertificate = player.getInventory().getItemByItemId(BASIC_CERTIFICATE)
			scertificate = player.getInventory().getItemByItemId(STANDARD_CERTIFICATE)
			if bcertificate and not scertificate:
				item = player.getInventory().addItem("Quest", MARK_BETRAYAL, 1, player, None)
				iu = InventoryUpdate()
				iu.addItem(item)
				player.sendPacket(iu);
				sm = SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2)
				sm.addItemName(item)
				sm.addNumber(1)
				player.sendPacket(sm)
		if npcId in [22334,22335]:
			bcertificate = player.getInventory().getItemByItemId(BASIC_CERTIFICATE)
			scertificate = player.getInventory().getItemByItemId(STANDARD_CERTIFICATE)
			if bcertificate and not scertificate:
				item = player.getInventory().addItem("Quest", SCORPION_POISON_STINGER, 1, player, None)
				iu = InventoryUpdate()
				iu.addItem(item)
				player.sendPacket(iu);
				sm = SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2)
				sm.addItemName(item)
				sm.addNumber(1)
				player.sendPacket(sm)
		return
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:27,代码来源:__init__.py

示例2: onTalk

 def onTalk (self,npc,player):
   npcId = npc.getNpcId()
   if npcId == YIYEN :
      tele = PyObject()
      instanceId = enterInstance(self, player, "DarkCloudMansion.xml", tele)
   if self.worlds.has_key(npc.getInstanceId()) :
      world = self.worlds[npc.getInstanceId()]
      if npcId == SOTruth :
         tele = PyObject()
         tele.x = ReturnPort[dataIndex][0]
         tele.y = ReturnPort[dataIndex][1]
         tele.z = ReturnPort[dataIndex][2]
         exitInstance(player, tele)
         if player.getObjectId() in world.rewarded :
            pass
         else :
            item = player.getInventory().addItem("Quest", CC, 1, player, None)
            iu = InventoryUpdate()
            iu.addItem(item)
            player.sendPacket(iu)
            sm = SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2)
            sm.addItemName(item)
            sm.addNumber(1)
            player.sendPacket(sm)
            if debug : print "DarkCloudMansion - id" + str(player.getObjectId()) + " added to reward list"
            world.rewarded.append(player.getObjectId())
         return
   return
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:28,代码来源:__init__.py

示例3: checkCondition

def checkCondition(player):    
    party = player.getParty()
    if not party :
        player.sendPacket(SystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER))
        return False
    if not player.getParty().isLeader(player) :
        player.sendPacket(SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER))
        return False
    for partyMember in party.getPartyMembers().toArray() :
        if not partyMember.getLevel() >= 78 :
            sm = SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT)
            sm.addCharName(partyMember)
            player.sendPacket(sm)
            return False
    for partyMember in player.getParty().getPartyMembers().toArray() :
        if not partyMember.isInsideRadius(player, 500, False, False) :
            sm = SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED)
            sm.addCharName(partyMember)
            player.sendPacket(sm)
            return False
    for partyMember in player.getParty().getPartyMembers().toArray() :
        item = partyMember.getInventory().getItemByItemId(CRYSTAL)
        if not item:
            sm = SystemMessage(SystemMessageId.C1_ITEM_REQUIREMENT_NOT_SUFFICIENT)
            sm.addCharName(partyMember)
            player.sendPacket(sm)
            return False
    return True
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:28,代码来源:EmeraldSteam.py

示例4: getCertified

def getCertified(player, itemId, var):
  st = player.getQuestState(qn)
  qvar = st.getGlobalQuestVar(var)
  if qvar != "" and qvar != "0" :
    return ""
  item = player.getInventory().addItem("Quest", itemId, 1, player, player.getTarget())
  st.saveGlobalQuestVar(var,str(item.getObjectId()))
  smsg = SystemMessage(SystemMessageId.EARNED_ITEM)
  smsg.addItemName(item)
  player.sendPacket(smsg)
  return
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:11,代码来源:__init__.py

示例5: onKill

 def onKill(self, npc, player, isPet):
     npcId = npc.getNpcId()
     if self.worlds.has_key(npc.getInstanceId()):
         world = self.worlds[npc.getInstanceId()]
         if world.status == 0:
             if npcId == 22503:
                 newNpc = self.addSpawn(
                     KamaBoss1[0], 15829, -174885, -10395, 0, False, 0, False, world.instanceId
                 )  # Boss
                 world.startRoom.npclist[newNpc] = False
             if npcId == 25622:
                 newNpc = self.addSpawn(
                     KamaBoss[0], 12050, -174887, -9951, 0, False, 0, False, world.instanceId
                 )  # Boss
                 world.startRoom.npclist[newNpc] = False
             if npcId == 29147:
                 instanceObj = InstanceManager.getInstance().getInstance(self.currentWorld)
                 instanceObj.setDuration(300000)
                 instanceObj.removeNpcs()
                 party = player.getParty()
                 if party != None:
                     for partyMember in party.getPartyMembers().toArray():
                         partyMember.sendPacket(
                             SystemMessage.sendString("從現在起將會限制進入即時地區:「欲界 (深淵迷宮)」。下一次的進場時間可透過「/即時地區」指令來查詢。")
                         )
     return
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:26,代码来源:__init__.py

示例6: EvolvePet

def EvolvePet(player,item,striderControlItem) :
   con = L2DatabaseFactory.getInstance().getConnection()
   statement = con.prepareStatement("UPDATE items SET item_id =? WHERE object_id=? AND owner_id=?")
   statement.setInt(1, striderControlItem)
   statement.setInt(2, item.getObjectId())
   statement.setInt(3, player.getObjectId())
   statement.execute()
   statement.close()
   con.close()
   sm1 = SystemMessage(SystemMessageId.S2_S1_DISAPPEARED)
   sm1.addItemName(item.getItemId())
   sm1.addNumber(1)
   sm2 = SystemMessage(SystemMessageId.YOU_PICKED_UP_A_S1_S2)
   sm2.addNumber(item.getEnchantLevel())
   sm2.addItemName(striderControlItem)
   player.sendPacket(sm1)
   player.sendPacket(sm2)
   player.sendPacket(ItemList(player, False))
   return
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:19,代码来源:__init__.py

示例7: checkCondition

def checkCondition(player) :
  party = player.getParty()
  if not party :
    player.sendPacket(SystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER))
    return False
  if not player.getParty().isLeader(player) :
    player.sendPacket(SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER))
    return False
  membersCount = player.getParty().getMemberCount()
  if membersCount < 2 :
    player.sendPacket(SystemMessage(SystemMessageId.PARTY_EXCEEDED_THE_LIMIT_CANT_ENTER))
    return False
  for partyMember in party.getPartyMembers().toArray() :
    if not partyMember.getLevel() >= 78 :
      sm = SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT)
      sm.addCharName(partyMember)
      player.sendPacket(sm)
      return False
  for partyMember in player.getParty().getPartyMembers().toArray() :
    if not partyMember.isInsideRadius(player, 500, False, False) :
      sm = SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED)
      sm.addCharName(partyMember)
      player.sendPacket(sm)
      return False
  return True
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:25,代码来源:__init__.py

示例8: enterInstance

def enterInstance(self,player,template,teleto):
    instanceId = 0
    if not checkCondition(player):
        return 0
    party = player.getParty()
    # Check for existing instances of party members
    for partyMember in party.getPartyMembers().toArray():
        if partyMember.getInstanceId()!=0:
            instanceId = partyMember.getInstanceId()
            if debug: print "Emerald/Steam: found party member in instance:"+str(instanceId)
    # Existing instance
    if instanceId != 0:
        foundworld = False
        for worldid in self.world_ids:
            if worldid == instanceId:
                foundworld = True
        if not foundworld:
            player.sendPacket(SystemMessage.sendString("你的隊員已進入其它的即時地區。"))
            return 0
        teleto.instanceId = instanceId
        teleportplayer(self,player,teleto,True)
        return instanceId
    # New instance
    else:
        instanceId = InstanceManager.getInstance().createDynamicInstance(template)
        if not self.worlds.has_key(instanceId):
            world = PyObject()
            world.instanceId = instanceId
            world.bosses = 5
            self.worlds[instanceId]=world
            self.world_ids.append(instanceId)
            if debug: print "Emerald/Steam Instance: " +str(instanceId) + " created by player: " + str(player.getName()) 
            # Close all doors
            for door in InstanceManager.getInstance().getInstance(instanceId).getDoors():
                door.closeMe()
            # Start the first room
            runEmeraldAndSteamFirstRoom(self,world)
        # Teleports player
        for partyMember in party.getPartyMembers().toArray() :
            st = partyMember.getQuestState(qn)
            if not st : st = self.newQuestState(partyMember)
	    st.takeItems(9694,-1)
	    st.takeItems(9698,-1)
	    st.takeItems(9699,-1)
            teleto.instanceId = instanceId
            teleportplayer(self,partyMember,teleto,True)
        return instanceId
    return instanceId
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:48,代码来源:EmeraldSteam.py

示例9: enterInstance

def enterInstance(self, player, template, tele) :
  if not checkPrimaryConditions(player) :
     return
  tele = PyObject()
  dataIndex = getDcmIndex(DcmLevel)
  tele.x = DcmPorts[dataIndex][0]
  tele.y = DcmPorts[dataIndex][1]
  tele.z = DcmPorts[dataIndex][2]
  instanceId = getExistingInstanceId(player)
  if instanceId == 0 :
     #brand new instance
     if not checkNewInstanceConditions(player) :
        return
     instanceId = InstanceManager.getInstance().createDynamicInstance(DcmTemplate[dataIndex])
     if not self.worlds.has_key(instanceId) :
        world = PyObject()
        world.rewarded = []
        world.instanceId = instanceId
        self.worlds[instanceId] = world
        self.world_ids.append(instanceId)
        self.currentWorld = instanceId
        instanceObj = InstanceManager.getInstance().getInstance(instanceId)
        instanceObj.setAllowSummon(False)
        instanceObj.setReturnTeleport(ReturnPort[dataIndex][0],ReturnPort[dataIndex][1],ReturnPort[dataIndex][2])
        print "暗雲宅邸:使用 " + InstanceTemplate + " 即時地區:" + str(instanceId) + " 創造玩家:" + str(player.getName()) 
        runStartRoom(self, world)
        tele.instanceId = instanceId
        teleportPlayer(self, player, tele)
        party = player.getParty()
        if party != None :
           for partyMember in party.getPartyMembers().toArray() :
               teleportPlayer(self, partyMember, tele)
  else:
     foundworld = False
     for worldid in self.world_ids :
         if worldid == instanceId :
            foundworld = True
     if not foundworld:
        player.sendPacket(SystemMessage.sendString("你的隊員已進入其它的即時地區。"))
        return
     tele.instanceId = instanceId
     teleportPlayer(self, player, tele)
  return
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:43,代码来源:__init__.py

示例10: enterInstance

def enterInstance(self, player, template, teleto) :
  instanceId = 0
  if not checkCondition(player) :
    return 0
  party = player.getParty()
  # Check for existing instances of party members
  for partyMember in party.getPartyMembers().toArray() :
    if partyMember.getInstanceId() != 0 :
      instanceId = partyMember.getInstanceId()
  # Existing instance
  if instanceId != 0 :
    foundWorld = False
    for worldid in self.world_ids :
      if worldid == instanceId :
        foundWorld = True
    if not foundWorld :
      player.sendPacket(SystemMessage.sendString("你的隊員已進入其它的即時地區。"))
      return
    teleto.instanceId = instanceId
    teleportPlayer(self, player, teleto)
    return instanceId
  # New instance
  else :
    instanceId = InstanceManager.getInstance().createDynamicInstance(template)
    if not self.worlds.has_key(instanceId) :
      world = PyObject()
      world.instanceId = instanceId
      self.worlds[instanceId] = world
      self.world_ids.append(instanceId)
      print "Tower of Infinity: started " + template + " Instance: " +str(instanceId) + " created by player: " + str(player.getName())
      runFloor(self, world, 0)
    # teleports player
    for partyMember in party.getPartyMembers().toArray() :
      st = partyMember.getQuestState(qn)
      if not st : st = self.newQuestState(partyMember)
      teleto.instanceId = instanceId
      teleportPlayer(self, partyMember, teleto)
    return instanceId
  return instanceId
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:39,代码来源:__init__.py

示例11: checkNewInstanceConditions

def checkNewInstanceConditions(player) :
  if not player.getParty().isLeader(player) :
     player.sendPacket(SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER))
     return False
  party = player.getParty()
  if party == None :
     return True
  for partyMember in party.getPartyMembers().toArray() :
     if not isWithinLevel(partyMember) :
        sm = SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT)
        sm.addCharName(partyMember)
        player.sendPacket(sm)
        return False
  for partyMember in player.getParty().getPartyMembers().toArray() :
     if not partyMember.isInsideRadius(player, 500, False, False) :
        sm = SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED)
        sm.addCharName(partyMember)
        player.sendPacket(sm)
        return False
  return True
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:20,代码来源:__init__.py

示例12: checkPrimaryConditions

def checkPrimaryConditions(player):
	if not player.getParty():
		player.sendPacket(SystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER))
		return False
	if not player.getParty().isLeader(player):
		player.sendPacket(SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER))
		return False
	if not isPartySizeOk(player):
		player.sendPacket(SystemMessage(SystemMessageId.PARTY_EXCEEDED_THE_LIMIT_CANT_ENTER))
	if not isWithinLevel(player):
		sm = SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT)
		sm.addCharName(player)
		player.sendPacket(sm)
		return False
	for partyMember in player.getParty().getPartyMembers().toArray():
		if not partyMember.isInsideRadius(player, 500, False, False):
			sm = SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED)
			sm.addCharName(partyMember)
			player.sendPacket(sm)
			return False
	return True
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:21,代码来源:__init__.py

示例13: checkConditions

def checkConditions(player, new) :
	party = player.getParty()
	if not party :
		player.sendPacket(SystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER))
		return False
	if not player.getParty().isLeader(player) :
		player.sendPacket(SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER))
		return False
	if party and party.getMemberCount() < 2 :
		player.sendPacket(SystemMessage(SystemMessageId.PARTY_EXCEEDED_THE_LIMIT_CANT_ENTER))
		return False
	for partyMember in party.getPartyMembers().toArray():
		if not partyMember.getLevel() >= 78 :
			sm = SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT)
			sm.addCharName(partyMember)
			player.sendPacket(sm)
			return False
		if not Util.checkIfInRange(1000, player, partyMember, True) and new :
			sm = SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED)
			sm.addCharName(partyMember)
			player.sendPacket(sm)
			return False
	return True
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:23,代码来源:__init__.py

示例14: checkCondition

def checkCondition(player):
    party = player.getParty()
    if party:
        player.sendPacket(SystemMessage.sendString("菲拉卡只能由單人挑戰。"))    
        return False
    return True
开发者ID:svn2github,项目名称:l2jtw_datapack,代码行数:6,代码来源:__init__.py


注:本文中的net.sf.l2j.gameserver.network.serverpackets.SystemMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。