#!/usr/bin/python # -*- coding: GBK -*- ##@package MakeItem # ÖÆÔìÎïÆ· <ÎïÆ·ID> [ÊýÁ¿] ÊýÁ¿ÈçÎÞ,ĬÈÏΪ1 # # @author mark # @date 2010-4-23 # @version 1.6 # @note: # # @change: "2013-02-22 15:00" wdb µôÂä½Ó¿ÚÐÞ¸Ä # @change: "2013-02-25 15:00" wdb ÐÞ¸ÄÎïÆ·µôÂä # @change: "2013-03-19 18:00" wdb ½«AddMapDropItem·Åµ½ChItem # @change: "2013-04-27 20:30" wdb Ôö¼Ó×°±¸¸½¼ÓÄÚÈÝ # @change: "2013-08-06 21:30" Alee Ìí¼ÓÌ××° # @change: "2015-12-11 16:00" hxp Ôö¼Ó»ù´¡ÊôÐÔ±ÈÀýÖ§³Ö #--------------------------------------------------------------------- #"""Version = 2015-12-11 16:00""" #------------------------------------------------------------------------------ import ItemControler import GameWorld import ChConfig import ChItem import PlayerControl ## GMÃüÁîÖ´ÐÐÈë¿Ú # @param curPlayer µ±Ç°Íæ¼Ò # @param msgList ²ÎÊýÁбí [ <ÎïÆ·ID> [ÊýÁ¿]] # @return None # @remarks º¯ÊýÏêϸ˵Ã÷. def OnExec(curPlayer, msgList): #ÊäÈëÃüÁî¸ñʽ´íÎó if len(msgList) < 1: GameWorld.DebugAnswer(curPlayer, "MakeItem ID (¸öÊý ÊÇ·ñÅÄÆ· ¹éÊôÀàÐÍ ¹éÊôID)") GameWorld.DebugAnswer(curPlayer, "¹éÊôÀàÐÍ:1-Íæ¼Ò,2-¶ÓÎé,5-ÕóÓª,6-Ö¸¶¨¶à¸öÍæ¼Ò") return itemID = msgList[0] itemCount = msgList[1] if len(msgList) > 1 else 1 isAuctionItem = msgList[2] if len(msgList) > 2 else 0 dropType = msgList[3] if len(msgList) > 3 else ChConfig.Def_NPCHurtTypeAll ownerID = 0 specOwnerIDList = [] if dropType == ChConfig.Def_NPCHurtTypeSpecial: specOwnerIDList = msgList[4:] if len(msgList) > 4 else [] else: ownerID = msgList[4] if len(msgList) > 4 else 0 gameMap = GameWorld.GetMap() dropPosX, dropPosY = curPlayer.GetPosX(), curPlayer.GetPosY() # ÒÔÍæ¼ÒΪÖÐÐĵ㿪ʼµôÂä doCount = 0 dropCount = 0 index = 0 sightLevel = PlayerControl.GetMapRealmDifficulty(curPlayer) for posX, posY in ChConfig.Def_DropItemAreaMatrix: doCount += 1 resultX = dropPosX + posX resultY = dropPosY + posY if not gameMap.CanMove(resultX, resultY): #Íæ¼Ò²»¿ÉÒÆ¶¯Õâ¸öµã continue if index > itemCount - 1: break index += 1 curItem = ItemControler.GetOutPutItemObj(itemID, 1, isAuctionItem, curPlayer=curPlayer) if curItem == None: GameWorld.DebugAnswer(curPlayer, 'ÎÞ·¨²éÕÒÎïÆ· = %s' % (itemID)) continue # ÔÚµØÉÏÌí¼ÓÎïÆ· ChItem.AddMapDropItem(resultX, resultY, curItem, ownerInfo=[dropType, ownerID, specOwnerIDList], sightLevel=sightLevel) dropCount += 1 GameWorld.DebugAnswer(curPlayer, "¼ì²â×ø±êÊý:%s µôÂäÊý: %s" % (doCount, dropCount)) return