本文整理汇总了Python中net.sf.l2j.gameserver.network.serverpackets.SystemMessage.addItemName方法的典型用法代码示例。如果您正苦于以下问题:Python SystemMessage.addItemName方法的具体用法?Python SystemMessage.addItemName怎么用?Python SystemMessage.addItemName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.l2j.gameserver.network.serverpackets.SystemMessage
的用法示例。
在下文中一共展示了SystemMessage.addItemName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onKill
# 需要导入模块: from net.sf.l2j.gameserver.network.serverpackets import SystemMessage [as 别名]
# 或者: from net.sf.l2j.gameserver.network.serverpackets.SystemMessage import addItemName [as 别名]
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
示例2: onTalk
# 需要导入模块: from net.sf.l2j.gameserver.network.serverpackets import SystemMessage [as 别名]
# 或者: from net.sf.l2j.gameserver.network.serverpackets.SystemMessage import addItemName [as 别名]
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
示例3: getCertified
# 需要导入模块: from net.sf.l2j.gameserver.network.serverpackets import SystemMessage [as 别名]
# 或者: from net.sf.l2j.gameserver.network.serverpackets.SystemMessage import addItemName [as 别名]
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
示例4: EvolvePet
# 需要导入模块: from net.sf.l2j.gameserver.network.serverpackets import SystemMessage [as 别名]
# 或者: from net.sf.l2j.gameserver.network.serverpackets.SystemMessage import addItemName [as 别名]
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