| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package Event.EventSrc.FunctionNPCShopBuyCheck  | 
| #  | 
| # @todo:NPCÉ̵깺ÂòÎïÆ·ÏÞÖÆÌõ¼þÀ©Õ¹¼ì²éÄ£¿é  | 
| # @author hxp  | 
| # @date 2014-10-23  | 
| # @version 1.0  | 
| #  | 
| # ÏêϸÃèÊö: NPCÉ̵깺ÂòÎïÆ·ÏÞÖÆÌõ¼þÀ©Õ¹¼ì²éÄ£¿é  | 
| #  | 
| #---------------------------------------------------------------------  | 
| """Version = 2014-10-23 16:00"""  | 
|   | 
| import PlayerControl  | 
| import PlayerRune  | 
| #import GameWorld  | 
| #import ChConfig  | 
|   | 
|   | 
| (  | 
| ComType_Equal, # µÈÓÚ  | 
| ComType_LessEqual, # Ð¡ÓÚµÈÓÚ  | 
| ComType_GreatEqual, # ´óÓÚµÈÓÚ  | 
| ) = range(3)  | 
|   | 
| #ÏÞÖÆÀàÐÍΪByte£¬Çë¸ù¾ÝÐèÒªÁé»î·ÖÅä  | 
| #NPCÌØÓеÄÅжÏÏÞÖÆÀàÐÍ£¬²»Í¬NPCÖ®¼ä¿É¸´ÓøÃÀàÐÍ  | 
|   | 
| #¹«¹²ÏÞÖÆÌõ¼þÅжϺ¯Êý  | 
| #def CheckPublic_ÏÞÖÆÀàÐÍ(curPlayer, limitValue):  | 
| #    return True or False  | 
|   | 
| #¶ÔÓ¦NPCÌØÓÐÏÞÖÆÌõ¼þÅжϺ¯Êý  | 
| #def CheckByNPC_É̵êNPCID_ÏÞÖÆÀàÐÍ(curPlayer, limitValue):  | 
| #    return True or False  | 
|   | 
|   | 
| ### ¶ñħÁÔÈËÆÕͨ¹ý¹ØÊý¹ºÂòÏÞÖÆ  | 
| ## @param curPlayer: Íæ¼ÒʵÀý  | 
| ## @param limitValue: ÏÞÖÆÖµ  | 
| ## @return: Âú×ãÌõ¼þÓë·ñ  | 
| #def CheckByNPC_11006_100(curPlayer, limitValue):  | 
| #    curValue = xxx  | 
| #    isLimit = __CheckCompare(curPlayer, limitValue, curValue)  | 
| #    GameWorld.DebugLog("%s.CheckByNPC_11006_100 curValue=%s,limitValue=%s,isLimit=%s"   | 
| #                       % (__name__, curValue, limitValue, isLimit))  | 
| #    return isLimit  | 
| #  | 
| ### ¶ñħÁÔÈ˾«Ó¢¹ý¹ØÊý¹ºÂòÏÞÖÆ  | 
| ## @param curPlayer: Íæ¼ÒʵÀý  | 
| ## @param limitValue: ÏÞÖÆÖµ  | 
| ## @return: Âú×ãÌõ¼þÓë·ñ  | 
| #def CheckByNPC_11006_101(curPlayer, limitValue):  | 
| #    curValue = xxx  | 
| #    isLimit = __CheckCompare(curPlayer, limitValue, curValue)  | 
| #    GameWorld.DebugLog("%s.CheckByNPC_11006_101 curValue=%s,limitValue=%s,isLimit=%s"   | 
| #                       % (__name__, curValue, limitValue, isLimit))  | 
| #    return isLimit  | 
| #  | 
| ### ¶ñħÁÔÈËÓ¢ÐÛ¹ý¹ØÊý¹ºÂòÏÞÖÆ  | 
| ## @param curPlayer: Íæ¼ÒʵÀý  | 
| ## @param limitValue: ÏÞÖÆÖµ  | 
| ## @return: Âú×ãÌõ¼þÓë·ñ  | 
| #def CheckByNPC_11006_102(curPlayer, limitValue):  | 
| #    curValue = xxx  | 
| #    isLimit = __CheckCompare(curPlayer, limitValue, curValue)  | 
| #    GameWorld.DebugLog("%s.CheckByNPC_11006_102 curValue=%s,limitValue=%s,isLimit=%s"   | 
| #                       % (__name__, curValue, limitValue, isLimit))  | 
| #    return isLimit  | 
|   | 
| ## ·ûÓ¡Ëþ¹ý¹ØÊý¹ºÂòÏÞÖÆ  | 
| # @param curPlayer: Íæ¼ÒʵÀý  | 
| # @param limitValue: ÏÞÖÆÖµ  | 
| # @return: Âú×ãÌõ¼þÓë·ñ  | 
| def CheckByNPC_2_100(curPlayer, itemID, limitValue):  | 
|     return not PlayerRune.GetIsOpenByRuneID(curPlayer, itemID)  | 
|       | 
|   | 
| ## ÅжϷµ»Ø  | 
| # @param curPlayer: Íæ¼ÒʵÀý  | 
| # @return:   | 
| def __CheckCompare(curPlayer, limitValue, curValue, msgMark='', paramList=[],   | 
|                    comType = ComType_GreatEqual):  | 
|     isLimit = False  | 
|     if comType == ComType_GreatEqual and curValue < limitValue:  | 
|         isLimit = True  | 
|       | 
|     elif comType == ComType_LessEqual and curValue > limitValue:  | 
|         isLimit = True  | 
|       | 
|     elif comType == ComType_Equal and limitValue != curValue:  | 
|         isLimit = True  | 
|   | 
|     if isLimit and msgMark:  | 
|         PlayerControl.NotifyCode(curPlayer, msgMark, paramList)  | 
|       | 
|     return isLimit  | 
|   |