| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #---------------------------------------------------------------------  | 
| #  | 
| #---------------------------------------------------------------------  | 
| ##@package QuestRunner  | 
| # @todo: ÈÎÎñÖ´ÐÐÂß¼  | 
| #  | 
| # @author: eggxp  | 
| # @date 2010-04-27  | 
| # @version 8.4  | 
| #  | 
| # @note: ÈÎÎñÖ´ÐÐÂß¼´¦Àí,½Ó¿Úº¯Êý  | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
| #"""Version = 2017-04-25 17:00"""  | 
| #---------------------------------------------------------------------  | 
| #ConditionType_   #ÊÂǰÅж¨  | 
| #DoType_          #ʺóÅж¨  | 
| #---------------------------------------------------------------------  | 
| import ChConfig  | 
| import EventShell  | 
| import BuffSkill  | 
| import FBLogic  | 
| import GameMap  | 
| import GameWorld  | 
| import GameWorldProcess  | 
| import IPY_GameWorld  | 
| import ItemControler  | 
| import PlayerControl  | 
| import PlayerTruck  | 
| import QuestRunnerValue  | 
| import SkillCommon  | 
| import ItemCommon  | 
| import ReadChConfig  | 
| import QuestCommon  | 
| import SkillShell  | 
| import GameLogInfo  | 
| import PlayerReincarnation  | 
| import PlayerMissionCollect  | 
| import PlayerFamily  | 
| import ShareDefine  | 
| #import PlayerPrestigeSys  | 
| import NetPackCommon  | 
| import ChPyNetSendPack  | 
| import DataRecordPack  | 
| import ChItem  | 
| import ChEquip  | 
| import PlayerActivity  | 
| import PlayerSuccess  | 
| import EventReport  | 
| #import PlayerCostVIP  | 
| import GameFuncComm  | 
| import IpyGameDataPY  | 
| import ShopItemManage  | 
| import PlayerPet  | 
| import PlayerArrestTask  | 
| import PlayerMagicWeapon  | 
| import PlayerBossReborn  | 
| import PlayerFairyCeremony  | 
| import PlayerWeekParty  | 
| import PlayerHorse  | 
| import FBCommon  | 
| import PyGameData  | 
|   | 
| import math  | 
| import time  | 
| import datetime  | 
| import random  | 
| import re  | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
| TYPE_Event_Select = 1  | 
| TYPE_Event_Do = 2  | 
|   | 
| #×¢Òâ! ÕâÀïµÄ×ÖµäÃû²»Äܳ¬¹ý29¸ö×Ö½Ú  | 
| #ÿÈÕÈÎÎñµÄ½±Àø(ÔÚ¸ø½ÓÊÜÐÂÈÎÎñµÄʱºòÉèÖÃ)  | 
| Def_Day_Event_Reward_Exp = "day_event_exp"              #ÿÈÕÈÎÎñµÄ½±Àø  | 
| Def_Day_Event_Reward_Money = "day_event_money"          #ÿÈÕÈÎÎñµÄ¸øÇ®  | 
| Def_Day_Event_Reward_Truck_Money = "day_event_truck_money"  #ÿÈÕÈÎÎñæô³µ  | 
| Def_Day_Event_Reward_Item_Id = "day_event_item_id"            #ÿÈÕÈÎÎñµÄ½±ÀøÎïÆ·ID  | 
| Def_Day_Event_Reward_Item_Count = "day_event_item_count"            #ÿÈÕÈÎÎñµÄ½±ÀøÎïÆ·ÊýÁ¿  | 
| Def_Day_Event_Reward_Player_Family_Hornor = "day_event_pfamily_hornor"  | 
| Def_Day_Event_Reward_Player_Family_ActiveValue = "day_event_pfamily_actvalue"  | 
| Def_Day_Event_Reward_Family_Money = "day_event_family_money"  | 
| Def_Day_Event_Reward_Family_Hornor = "day_event_hornor"  | 
| Def_Day_Event_Reward_Pet_Exp = "day_event_pet_exp"    #ÿÈÕ³èÎï¾Ñé½±Àø  | 
| Def_Day_Event_Reward_Prestige = "day_event_prestige"    #ÿÈÕÍþÍû½±Àø  | 
|   | 
| #ÅÜ»·ÈÎÎñ½±Àø  | 
| Def_Run_Around_Reward_Exp = "run_around_exp"              #ÅÜ»·ÈÎÎñµÄ½±Àø  | 
| Def_Run_Around_Reward_ExpPoint = "run_around_exp_point"     #ÅÜ»·ÈÎÎñµÄ½±Àø  | 
| Def_Run_Around_Reward_Money = "run_around_money"          #ÅÜ»·ÈÎÎñµÄ¸øÇ®  | 
| Def_Run_Around_Reward_FamilyHornor = "run_around_familyhornor"     #ÅÜ»·ÈÎÎñµÄÏÉÃ˹±Ï×½±Àø  | 
| Def_Run_Around_Reward_Multiple = "run_around_multiple"     #ÅÜ»·ÈÎÎñµÄ½±Àø·±¶Êý  | 
|   | 
| Def_Task_Reward_Per = "reward_per"     #ÁìÈ¡ÈÎÎñ½±Àø±¶Êý°Ù·Ö±È; 150´ú±í1.5±¶  | 
|   | 
|   | 
| #ÅÜ»·½áÊø×´Ì¬  | 
| Def_Run_Around_Over_1 = 1  | 
| Def_Run_Around_Over_2 = 2  | 
| Def_Run_Around_Over_3 = 3  | 
|   | 
| #1. xmlûÓе÷ÓùýSetStateº¯Êý  | 
| #2. Íæ¼Ò֮ǰûÓдËÈÎÎñ  | 
| #ÔòÔÚÕâÀï°Ñµ±Ç°ÈÎÎñ֪ͨ¸øÍæ¼Ò  | 
| #·ÀÖ¹Á¬ÐøÍ¨Öª2´Î, µ¼ÖÂÍæ¼ÒµÄÈÎÎñ²éѯÁбíÖÐÓÐ2¸öÏàͬÈÎÎñ  | 
| __PlayerSetState = False  | 
|   | 
| #-------------------------------------------------  | 
| ## ÍÚ±¦¹ã²¥ÐÅÏ¢.  | 
| #  | 
| #  PyClassÀàµÄÏêϸ˵Ã÷.  | 
| class TreasureNotifyContent:  | 
|     LV = 0  | 
|     Content = None  | 
|     MissionID = 0  | 
|     #---------------------------------------------------------------------  | 
|     ## ÈÝÆ÷³õʼ»¯, LV,Content,MissionID  | 
|     #  @param self ÀàʵÀý  | 
|     #  @return ·µ»ØÖµÎÞÒâÒå  | 
|     #  @remarks ÈÝÆ÷³õʼ»¯, LV,Content,MissionID  | 
|     def __init__(self):  | 
|         self.LV = 0  | 
|         self.Content = str()  | 
|         self.MissionID = 0  | 
|           | 
| TreasureNotifyContentList = list() #Type = TreasureNotifyContent  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##³õʼ»¯ÍÚ±¦¹ã²¥ÐÅÏ¢ÁÐ±í  | 
| # @param ÎÞ  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ³õʼ»¯ÍÚ±¦¹ã²¥ÐÅÏ¢Áбí TreasureNotifyContentList = list() #Type = TreasureNotifyContent  | 
| def InitTreasureNotifyContentList():  | 
|     global TreasureNotifyContentList  | 
|     TreasureNotifyContentList = list()  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##»ñÈ¡ÍÚ±¦¹ã²¥ÐÅÏ¢ÁÐ±í   | 
| # @param ÎÞ  | 
| # @return ·µ»ØÖµ, ÍÚ±¦¹ã²¥ÐÅÏ¢ÁÐ±í  | 
| # @remarks »ñÈ¡ÍÚ±¦¹ã²¥ÐÅÏ¢Áбí TreasureNotifyContentList = list() #Type = TreasureNotifyContent  | 
| def GetTreasureNotifyContentList():  | 
|     return TreasureNotifyContentList  | 
|       | 
| #-------------------------------------------------  | 
|   | 
| #eggxp  | 
| TalkContent = IPY_GameWorld.IPY_TalkMsg()  | 
|   | 
| #MissionDescription = IPY_GameWorld.IPY_MissionDescription()  | 
| MissionDescription = IPY_GameWorld.IPY_MissionDesc()  | 
|   | 
| CurrentPlayerAnswer = str()  | 
|   | 
| CurrentKillNPC = None  | 
|   | 
| #ËùÓÐÈÎÎñµÄË÷Òý  | 
| FindQuestFunc = None  | 
| #¹¦ÄÜnpcµÄ¶Ô»°  | 
| FunctionNPCTalk = None  | 
| #ĬÈ϶Ի°Êý¾Ý  | 
| FindDefaultTalkFunc = None  | 
| #ÈÎÎñ¶Ô»°Á´  | 
| QuestTrig = None  | 
| #ÈÎÎñĬÈÏÃèÊö  | 
| QuestDescriptions = None  | 
| #ËùÓÐÈÎÎñʼþ  | 
| AllQuestsEvents = None  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖÃÈ«¾ÖÈÎÎñ  | 
| # @param allQuestsEvents ËùÓÐÈÎÎñʼþ  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸³ÖµÈ«¾Ö±äÁ¿AllQuestsEvents = allQuestsEvents  | 
| def SetAllQuestsEvents(allQuestsEvents):  | 
|     global AllQuestsEvents  | 
|     AllQuestsEvents = allQuestsEvents  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖÃÈ«¾ÖÈÎÎñ²éÕÒº¯Êý  | 
| # @param questIndex ÈÎÎñË÷Òý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸³ÖµÈ«¾Ö±äÁ¿FindQuestFunc = QuestCommon.SetFindQuestFunc  | 
| def SetFindQuestFunc(questIndex):  | 
|     global FindQuestFunc  | 
|     FindQuestFunc = questIndex  | 
|     QuestCommon.SetFindQuestFunc(questIndex)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖù¦ÄÜNPC¶Ô»°  | 
| # @param funcTalk ÈÎÎñ¶Ô»°Êý¾Ý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸³ÖµÈ«¾Ö±äÁ¿FunctionNPCTalk = funcTalk  | 
| def SetFunctionNPCTalk(funcTalk):  | 
|     global FunctionNPCTalk  | 
|     FunctionNPCTalk = funcTalk  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖù¦ÄÜNPCĬÈ϶Ի°  | 
| # @param funcTalk ÈÎÎñ¶Ô»°Ä¬ÈÏÊý¾Ý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸³ÖµÈ«¾Ö±äÁ¿FindDefaultTalkFunc = defaultTalk  | 
| def SetFindDefaultTalkFunc(defaultTalk):  | 
|     global FindDefaultTalkFunc  | 
|     FindDefaultTalkFunc = defaultTalk  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖû÷ɱµÄNPC  | 
| # @param curNPC NPCʵÀý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸³ÖµÈ«¾Ö±äÁ¿CurrentKillNPC = curNPC  | 
| def SetKillNPC(curNPC):  | 
|     global CurrentKillNPC  | 
|     CurrentKillNPC = curNPC  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÈÎÎñÌø×ª  | 
| # @param questTrig ÈÎÎñÌø×ªÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸³ÖµÈ«¾Ö±äÁ¿QuestTrig = questTrig  | 
| def SetQuestTrig(questTrig):  | 
|     global QuestTrig  | 
|     QuestTrig = questTrig  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÈÎÎñÃèÊö  | 
| # @param questDescriptions ÈÎÎñÃèÊö  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸³ÖµÈ«¾Ö±äÁ¿QuestDescriptions = questDescriptions  | 
| def SetQuestDescriptions(questDescriptions):  | 
|     global QuestDescriptions  | 
|     QuestDescriptions = questDescriptions  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##»ñÈ¡Íæ¼Òµ±Ç°µã»÷µÄNPC  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @return ·µ»ØÖµ, NPCʵÀý  | 
| # @remarks »ñÈ¡Íæ¼Òµ±Ç°µã»÷µÄNPC  | 
| def GetPlayerTalkNPC(curPlayer):  | 
|     #µÃµ½Íæ¼ÒµÄ¶ÔÏóNPC  | 
|     tagObj = curPlayer.GetActionObj()  | 
|     if tagObj == None:  | 
|         #ûÓÐÄ¿±ê  | 
|         return None  | 
|       | 
|     if tagObj.GetGameObjType() != IPY_GameWorld.gotNPC:  | 
|         return None  | 
|       | 
|     curNPC = GameWorld.GetNPCManager().GetNPCByIndex(tagObj.GetIndex())  | 
|     return curNPC  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##»ñÈ¡Íæ¼Òµ±Ç°µã»÷µÄNPC̸»°ÄÚÈÝ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @return ·µ»ØÖµ, Ì¸»°ÄÚÈÝ, ²Ëµ¥Ñ¡Ïî  | 
| # @remarks »ñÈ¡Íæ¼Òµ±Ç°µã»÷µÄNPC̸»°ÄÚÈÝ  | 
| def GetTalkContent(curPlayer):  | 
|     global TalkContent  | 
|     TalkContent.Clear()  | 
|     #µÃµ½Íæ¼ÒµÄ¶ÔÏóNPC  | 
|     curNPC = GetPlayerTalkNPC(curPlayer)  | 
|     if curNPC == None:  | 
|         #ûÓÐÕâ¸öNPC  | 
|         return TalkContent, None  | 
|       | 
|     funcTalkDict = FunctionNPCTalk  | 
|       | 
|     funcType = curNPC.GetFunctionType()  | 
|     if funcTalkDict.has_key(funcType) != True:  | 
|         return TalkContent, None  | 
|       | 
|     menuList = list()  | 
|       | 
|     for menu in funcTalkDict[funcType].Menus:  | 
|         if QuestRunnerValue.RunMenuCheck(curPlayer, menu.Check, menu.CheckArgs) != True:  | 
|             continue  | 
|           | 
|         menuList.append(menu.Code)  | 
|           | 
|     return TalkContent, menuList  | 
| #---------------------------------------------------------------------  | 
| ##ÔËÐÐÈÎÎñʼþµÄËùÓÐ½Úµã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMissionID ÈÎÎñID  | 
| # @param questEventLoader ÈÎÎñʼþÊý¾Ý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ÔËÐÐÈÎÎñʼþµÄËùÓÐ½Úµã  | 
| def RunAllQuest(curPlayer, curMissionID, questEventLoader):  | 
|     if questEventLoader == None or questEventLoader.IsEmpty():  | 
|         #ûÓÐʼþ  | 
|         GameWorld.Log("ûÓÐʼþ" , curPlayer.GetPlayerID())  | 
|         return  | 
|     #-------------------------event½Úµã-------------------  | 
|     eventNode = questEventLoader.FindNode("event")  | 
|     if eventNode == None or eventNode.IsEmpty():  | 
|         GameWorld.Log("·ÃÎÊʼþ²»´æÔÚevent" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     #2009.8.26ÈÕ  | 
|     #ÏÈÅж¨ÓÐûÓÐÕâ¸öÈÎÎñ, Èç¹ûûÓÐÕâ¸öÈÎÎñ, É¾³ý  | 
|     if curMissionID != 0:  | 
|         #2009.8.27ÐÞ¸Ä  | 
|         #0ÈÎÎñÊÇÌØÊâ´¥·¢, ²»É¾³ý  | 
|         questData = FindQuestFunc(curMissionID)  | 
|         if questData == None:  | 
|             #ûÓÐÕâ¸öÈÎÎñ, ·µ»Ø  | 
|             GameWorld.Log("RunAllQuest, ÕÒ²»µ½ÈÎÎñ%s É¾³ýÈÎÎñÊý¾Ý" % curMissionID , curPlayer.GetPlayerID())  | 
|               | 
|             #2009.10.9ÈÕÐÞÕý  | 
|             #ÔËÐе½ÕâÀïµÄʱºò, Íæ¼Ò¿ÉÄܸù±¾Ã»Õâ¸öÈÎÎñ. Èç¹ûÔÚÏÂÃæ´¥·¢É¾³ý, »á±¨c++¾¯¸æ  | 
|             #ËùÒÔÒª¼ÓÉÏÅж¨  | 
|             if curPlayer.FindMission(curMissionID):  | 
|                 curPlayer.DelMission(curMissionID)  | 
|             return  | 
|       | 
|     curMission = curPlayer.FindMission(curMissionID)  | 
|     #-------------------------quest½Úµã-------------------  | 
|     global __PlayerSetState  | 
|     for i in range(0, eventNode.GetChildCount()):  | 
|         #±éÀúÈÎÎñÁбí, ÕÒµ½Õâ¸öÈËÎï¿ÉÒÔÖ´ÐеÄÈÎÎñ  | 
|         questNode = eventNode.GetChild(i)  | 
|         if eventNode == None or questNode.IsEmpty():  | 
|             #ûÓÐÈÎÎñ½Úµã  | 
|             GameWorld.Log("ûÓÐÈÎÎñ½Úµã" , curPlayer.GetPlayerID())  | 
|             return  | 
|           | 
|         #2008.12.22  | 
|         #¼ÓÉÏÏÂÃæÒ»¾ä, »áÔÚOnDayµÄʱºò, Èç¹ûÍæ¼Òµ±Ç°ÕýÔÚ¶Ô»°, ¶Ô»°ÐèÒª½øÐÐDoType_Run_Embranchment²Ù×÷  | 
|         #»á¿¨×¡  | 
|         #curPlayer.SetCurrentQuestNode(questNode)  | 
|         #-------------------------embranchment½Úµã-------------------  | 
|         #µÃµ½ÁËÈËÎﵱǰÔËÐеÄÈÎÎñ, ¿ªÊ¼ÔËÐиÃÈÎÎñµÄ¶Ô»°·ÖÖ§  | 
|         for j in range(0, questNode.GetChildCount()):  | 
|             embranchmentNode = questNode.GetChild(j)  | 
|             if embranchmentNode == None or embranchmentNode.IsEmpty():  | 
|                 #ÕÒ²»µ½·ÖÖ§½Úµã  | 
|                 GameWorld.Log("RunAllQuest ÕÒ²»µ½·ÖÖ§½Úµã" , curPlayer.GetPlayerID())  | 
|                 return  | 
|               | 
| #            attributeID = questNode.GetAttribute("id")  | 
| #            if attributeID == "":  | 
| #                #ÊÇComment  | 
| #                continue  | 
| #            curMissionID = int(attributeID)  | 
|               | 
|               | 
|             result = __CanRunEmbranchmentNode(curPlayer, curMission, embranchmentNode)  | 
|             #GameWorld.Log("result = %s, xml = %s"%(result, embranchmentNode.GetXML()))  | 
|             if result != True:  | 
|                 continue  | 
|               | 
|             answersNode = embranchmentNode.FindChildNode("answers")  | 
|             actionsNode = None  | 
|             if answersNode and (not answersNode.IsEmpty()):  | 
|                 actionsNode = __FindAnswerActionNode(curPlayer, curMission, answersNode)  | 
|                 if actionsNode == None or actionsNode.IsEmpty():  | 
|                     continue  | 
|               | 
|               | 
|             #GameWorld.Log("%s-------------------"%curMissionID)  | 
|             needNotifyMission = False  | 
|             if curMission == None:  | 
|                 #Íæ¼ÒûÓÐÕâ¸öÿÈÕÈÎÎñ, Ìí¼ÓÿÈÕÈÎÎñ¸øËû  | 
|                 needNotifyMission = True  | 
|                 curMission = QuestCommon.AddNewMission(curPlayer, curMissionID)  | 
|                   | 
|             runResult = False  | 
|               | 
|             runResult = RunEmbranchmentNode(curPlayer, curMission, embranchmentNode, actionsNode)  | 
| #            try:  | 
| #                runResult = RunEmbranchmentNode(curPlayer, curMission, embranchmentNode, actionsNode)  | 
| #            except  Exception:  | 
| #                GameWorld.Log("RunEmbranchmentNode Error : curPlayer = %d, curMission = %d, embranchmentNode = %s"%(curPlayer.GetPlayerID(), curMissionID, embranchmentNode.GetXML()))  | 
| #                raise Exception("RunEmbranchmentNode Error")              | 
|             #1. xmlûÓе÷ÓùýSetStateº¯Êý  | 
|             #2. Íæ¼Ò֮ǰûÓдËÈÎÎñ  | 
|             #ÔòÔÚÕâÀï°Ñµ±Ç°ÈÎÎñ֪ͨ¸øÍæ¼Ò  | 
|             #·ÀÖ¹Á¬ÐøÍ¨Öª2´Î, µ¼ÖÂÍæ¼ÒµÄÈÎÎñ²éѯÁбíÖÐÓÐ2¸öÏàͬÈÎÎñ  | 
|               | 
|             curMission = curPlayer.FindMission(curMissionID)  | 
|             if curMission == None:  | 
|                 #2009.3.9 18:02  | 
|                 #´ËʱÈÎÎñÒѾɾ³ýÁË(ÔËÐÐÁËOver) ²»ÓÃÍ¨ÖªÍæ¼ÒÈÎÎñ״̬ÁË   | 
|                 break  | 
|             if needNotifyMission and not __PlayerSetState :  | 
|                 EventShell.NotifyOneMission(curPlayer, curMission)  | 
|                   | 
|                 #2009.8.26ÈÕ  | 
|                 #ÔÚEventShell.NotifyOneMission»áɾ³ýÈÎÎñ  | 
|                 #ËùÒÔÔÚÕâÀïÒªÔÙȡһ´Î. ·ñÔò»áµ¼ÖÂcurMission Aµô  | 
|                 curMission = curPlayer.FindMission(curMissionID)  | 
|                   | 
|             __PlayerSetState = False   | 
|             if runResult:  | 
|                 break  | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ϵͳµ¯³öµÄÈÎÎñ¶Ô»°, Ã»ÓÐÈÎÎñÃû³ÆÑ¡Ôñ·ç¸ñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param questEventLoader ÈÎÎñʼþÊý¾Ý  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÖ´Ðгɹ¦  | 
| # @remarks ÏµÍ³µ¯³öµÄÈÎÎñ¶Ô»°, Ã»ÓÐÈÎÎñÃû³ÆÑ¡Ôñ·ç¸ñ  | 
| def RunFunctionQuest(curPlayer, questEventLoader):  | 
|     if questEventLoader == None or questEventLoader.IsEmpty():  | 
|         #ûÓÐʼþ  | 
|         GameWorld.Log("ûÓÐʼþ" , curPlayer.GetPlayerID())  | 
|         return  | 
|     #-------------------------event½Úµã-------------------  | 
|     eventNode = questEventLoader.FindNode("event")  | 
|     if eventNode.IsEmpty():  | 
|         GameWorld.Log("·ÃÎÊʼþ²»´æÔÚevent" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     curPlayer.SetCurrentXMLNode(eventNode)  | 
|     #-------------------------quest½Úµã-------------------  | 
| #    curMission = None  | 
|     questNode = None  | 
| #    nonQuestNode = None  | 
|   | 
| #    curMission = curPlayer.FindMission(curMissionID)  | 
| #    if curMission == None:  | 
| #        return  | 
| #      | 
| #    if curMission.GetState() == -1:  | 
| #        return  | 
|       | 
|     for i in range(0, eventNode.GetChildCount()):  | 
|         questNode = eventNode.GetChild(i)  | 
|         curPlayer.SetCurrentQuestNode(questNode)  | 
|         for i in range(0, questNode.GetChildCount()):  | 
|             embranchmentNode = questNode.GetChild(i)  | 
|             if embranchmentNode == None or embranchmentNode.IsEmpty():  | 
|                 #ÕÒ²»µ½·ÖÖ§½Úµã  | 
|                 GameWorld.Log("RunFunctionQuest ÕÒ²»µ½·ÖÖ§½Úµã" , curPlayer.GetPlayerID())  | 
|                 return  | 
|             if RunEmbranchmentNode(curPlayer, None, embranchmentNode) == True:  | 
|                 #GameWorld.Log("ÔÚµÚ %d ¸ö½ÚµãÔËÐгɹ¦"%(i))  | 
| #                isRunMission = True  | 
|                 return True  | 
|             else:  | 
|                 #GameWorld.Log("ÔÚµÚ %d ¸ö½ÚµãÔËÐÐʧ°Ü %s"%(i, questNode.GetXML()))  | 
|                 pass  | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ϵͳµ¯³öµÄÈÎÎñ¶Ô»°, Ã»ÓÐÈÎÎñÃû³ÆÑ¡Ôñ·ç¸ñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMissionID ÈÎÎñID  | 
| # @param questEventLoader ÈÎÎñʼþÊý¾Ý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ÏµÍ³µ¯³öµÄÈÎÎñ¶Ô»°, Ã»ÓÐÈÎÎñÃû³ÆÑ¡Ôñ·ç¸ñ  | 
| def RunQuest(curPlayer, curMissionID, questEventLoader):  | 
|     timeClock = time.clock()  | 
|       | 
|     if questEventLoader == None or questEventLoader.IsEmpty():  | 
|         #ûÓÐʼþ  | 
|         GameWorld.Log("ûÓÐʼþ" , curPlayer.GetPlayerID())  | 
|         return  | 
|     #-------------------------event½Úµã-------------------  | 
|     eventNode = questEventLoader.FindNode("event")  | 
|     if eventNode == None or eventNode.IsEmpty():  | 
|         GameWorld.Log("·ÃÎÊʼþ²»´æÔÚevent" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     curPlayer.SetCurrentXMLNode(eventNode)  | 
|     #-------------------------quest½Úµã-------------------  | 
| #    curMission = None  | 
|     questNode = None  | 
| #    nonQuestNode = None  | 
|   | 
|     curMission = curPlayer.FindMission(curMissionID)  | 
|     if curMission == None:  | 
|         return  | 
|       | 
|     if curMission.GetState() == ChConfig.Def_Mission_State_Over:  | 
|         return  | 
|       | 
|     for i in range(0, eventNode.GetChildCount()):  | 
|         questNode = eventNode.GetChild(i)  | 
|         #2009.9.27  | 
|         #bug: Íæ¼ÒÔÚ½»ÈÎÎñµÄʱºò, ´¥·¢ÁËÆäËûµÄɱ¹ÖÈÎÎñ,   | 
|         #µ¼ÖÂCurrentQuestNode±»ÖØÖÃÁË  | 
|         #½â¾ö: ²»ÄÜÖ±½ÓSetCurrentQuestNode  | 
|         #Ôö¼ÓÅж¨  | 
|         #curPlayer.SetCurrentQuestNode(questNode)  | 
|         for i in range(0, questNode.GetChildCount()):  | 
|             embranchmentNode = questNode.GetChild(i)  | 
|             if embranchmentNode == None or embranchmentNode.IsEmpty():  | 
|                 #ÕÒ²»µ½·ÖÖ§½Úµã  | 
|                 GameWorld.Log("RunQuest ÕÒ²»µ½·ÖÖ§½Úµã" , curPlayer.GetPlayerID())  | 
|                 return  | 
|               | 
|             if RunEmbranchmentNode(curPlayer, curMission, embranchmentNode) == True:  | 
|                 #GameWorld.Log("ÔÚµÚ %d ¸ö½ÚµãÔËÐгɹ¦"%(i))  | 
| #                isRunMission = True  | 
| #===============================================================================  | 
| #                    c++´úÂë, WaitEvent»áÖÃm_CurrentMissionID, ÓÃÕâ¸öÖµÀ´Åж¨  | 
| #                    void                Player::WaitEvent(int missionID, IPY_XMLNode       curNode)  | 
| #                    {  | 
| #                        m_CurrentMissionID = missionID;  | 
| #                        m_CurrentEventNode = curNode;  | 
| #                    }  | 
| #===============================================================================  | 
|                 talkMissionID = curPlayer.GetCurrentMissionID()  | 
|                 if talkMissionID != 0 and talkMissionID == curMissionID:  | 
|                     #Ö»Óеȴý¶Ô»°×´Ì¬²¢ÇÒÊǵ±Ç°¶Ô»°µÄÈÎÎñ£¬²ÅÉ趨QuestÖ¸Õë   | 
|                     curPlayer.SetCurrentQuestNode(questNode)  | 
|                 return True  | 
|             else:  | 
|                 #GameWorld.Log("ÔÚµÚ %d ¸ö½ÚµãÔËÐÐʧ°Ü %s"%(i, questNode.GetXML()))  | 
|                 pass  | 
|       | 
|     #¼Ç¼ÈÎÎñÏà¹ØÐÅÏ¢  | 
|     GameLogInfo.LogInfo_MissionTime(timeClock)  | 
|     GameLogInfo.LogInfo_MissionCount(1)  | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| # Íæ¼ÒºÍNPC¶Ô»°¹ý³Ì:  | 
| # 1. NPC¶Ô»°ÏÔʾ (RunQuestOnVisit)  | 
| #   ÈÎÎñ - XXX  | 
| #   ÈÎÎñ - XXX  | 
| #     | 
| # 2. (Íæ¼ÒÑ¡Ôñ)ÈÎÎñ-xxxÖ®ºó (Answer_MissionSelect)  | 
| #    ¿ªÊ¼ÔËÐÐÕâ¸öNPCµÄxmlÎļþ  | 
| #===============================================================================  | 
| ##ϵͳµ¯³öµÄÈÎÎñ¶Ô»°, Ã»ÓÐÈÎÎñÃû³ÆÑ¡Ôñ·ç¸ñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curTrigMission ÈÎÎñÊý¾Ý  | 
| # @param npcID NPCID  | 
| # @return ·µ»ØÖµ, key = ("on_visit", "%d.xml"%0)  | 
| # @remarks ÏµÍ³µ¯³öµÄÈÎÎñ¶Ô»°, Ã»ÓÐÈÎÎñÃû³ÆÑ¡Ôñ·ç¸ñ  | 
| def GetVisitNPCKey(curPlayer, curMission, curTrigMission, npcID):  | 
|     #Ëæ»ú·ÃÎÊNPCÅж¨  | 
|     key = ("on_visit", "%d.xml" % 0)  | 
|     if curTrigMission.QuestsEvent.has_key(key) :  | 
|         if npcID == curMission.GetProperty(QuestCommon.Def_Visit_Npc_ID):  | 
|             return key  | 
|       | 
|     #Õý³£·ÃÎÊNPCÅж¨  | 
|     key = ("on_visit", "%d.xml" % npcID)  | 
|     if curTrigMission.QuestsEvent.has_key(key) :  | 
|         return  key  | 
|   | 
|     return  | 
|   | 
|   | 
| ##½øÈëÔٴζԻ°Âß¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @return ¶Ô»°³É¹¦Óë·ñ  | 
| # @remarks ½øÈëÔٴζԻ°Âß¼  | 
| def TalkAgain(curPlayer):  | 
|     #»ñµÃ¶Ô»°¶ÔÏóNPC  | 
|     curActionObj = curPlayer.GetActionObj()  | 
|       | 
|     if curActionObj == None:  | 
|         return False  | 
|       | 
|     if curActionObj.GetGameObjType() != IPY_GameWorld.gotNPC:  | 
|         return False  | 
|       | 
|     curActionNPC = GameWorld.GetNPCManager().GetNPCByIndex(curActionObj.GetIndex())  | 
|     npcID = curActionNPC.GetNPCID()  | 
|           | 
|     #ÕÒµ½Íæ¼ÒÉíÉÏËùÓÐÄܺÍÕâ¸öNPC¶Ô»°µÄÈÎÎñ  | 
|     for i in range(curPlayer.GetMissionCount()):  | 
|         curMission = curPlayer.GetMissionByIndex(i)  | 
|           | 
|         #δ½Ó ºÍ ¿É½»µÄÈÎÎñ¿ÉÒÔÔÙ¶Ô»°  | 
|         if curMission.GetState() not in \  | 
|         [ChConfig.Def_Mission_State_NoAccept, ChConfig.Def_Mission_State_CanComplete]:  | 
|             continue  | 
|           | 
|         missionID = curMission.GetMissionID()  | 
|           | 
|         curTrigMission = FindQuestFunc(missionID)  | 
|         if curTrigMission == None:  | 
|             continue  | 
|           | 
|         if curTrigMission.Type == QuestCommon.Def_GM_Active_Mission_Type:  | 
|             #Õâ¸öÈÎÎñÊǽÚÈÕÈÎÎñ, ÐèÒªGM¿ªÆôµÄ  | 
|             if not GameWorld.GetGameWorld().IsEventActive(missionID):  | 
|                 continue  | 
|           | 
|         key = GetVisitNPCKey(curPlayer, curMission, curTrigMission, npcID)  | 
|           | 
|         if key == None:  | 
|             #ÎÞ´Ëkey  | 
|             continue  | 
|           | 
|         runResult = False  | 
|         allNodelist = curTrigMission.QuestsEvent[key].GetXMLEventLoader().GetNodeList()  | 
|         eventNode = allNodelist.FindNode("event")  | 
|         if eventNode == None or eventNode.IsEmpty():  | 
|             GameWorld.Log("·ÃÎÊʼþ²»´æÔÚevent" , curPlayer.GetPlayerID())  | 
|             return False  | 
|           | 
|         #-------------------------quest½Úµã-------------------  | 
|         for i in range(0, eventNode.GetChildCount()):  | 
|             #±éÀúÈÎÎñÁбí, ÕÒµ½Õâ¸öÈËÎï¿ÉÒÔÖ´ÐеÄÈÎÎñ  | 
|             questNode = eventNode.GetChild(i)  | 
|             curPlayer.SetCurrentQuestNode(questNode)  | 
|   | 
|             for i in range(0, questNode.GetChildCount()):  | 
|                 embranchmentNode = questNode.GetChild(i)  | 
|                 if CanDoQuestNodeTalk(curPlayer, curMission, embranchmentNode):  | 
|                     runResult = True  | 
|                     break  | 
|           | 
|         if not runResult:  | 
|             #²»ÄÜÔËÐÐÈÎÎñ  | 
|             continue  | 
|   | 
|   | 
|         #¿ÉÒÔÔٴζԻ°£¬½øÐжԻ°Âß¼  | 
|         GameWorld.DebugLog("ÔٴνøÈë¶Ô»°¶Ô»°£¡ %s  %s" % key)  | 
|         if not RunQuestOnVisit(curPlayer, npcID):  | 
|             GameWorld.Log("%sÈÎÎñ¼ÌÐø¶Ô»°Ö´ÐÐʧ°Ü" % (npcID) , curPlayer.GetPlayerID())  | 
|             return False  | 
|           | 
|         return True  | 
|     return False  | 
|    | 
|    | 
| ##ÔٴζԻ°»òÍ˳ö¶Ô»°Âß¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @return ÎÞ  | 
| # @remarks ÔٴζԻ°»òÍ˳ö¶Ô»°Âß¼  | 
| def DoTalkOrExit(curPlayer):  | 
|     #ÊÇ·ñ¼ÌÐø¶Ô»°  | 
|     if TalkAgain(curPlayer):  | 
|         return  | 
|   | 
|     EventShell.DoExitEvent(curPlayer)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ºÍNPC¶Ô»°, µÚÒ»¾ä¶Ô»°Òªµ¯³öÈÎÎñÃû³Æ, È»ºóÑ¡Ôñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param npcID NPCID  | 
| # @param addFuncMenu ÊÇ·ñÔö¼ÓËùÓеĶԻ°(¹¦ÄܶԻ°)  | 
| # @return ·µ»ØÖµ, ÊÇ·ñ¶Ô»°³É¹¦  | 
| # @remarks ºÍNPC¶Ô»°, µÚÒ»¾ä¶Ô»°Òªµ¯³öÈÎÎñÃû³Æ, È»ºóÑ¡Ôñ  | 
| def RunQuestOnVisit(curPlayer, npcID, addFuncMenu=True):  | 
|     timeClock = time.clock()  | 
|     #¶Ô»°¸ñʽ:  | 
|     #msg = Ïл°     answer = ÈÎÎñÃû³Æ  | 
|     talkContent, menuList = GetTalkContent(curPlayer)  | 
|       | 
|     talkContent.SetMsg(__GetDefaultTalkContent(curPlayer, npcID))  | 
|       | 
|     #ÕÒµ½Íæ¼ÒÉíÉÏËùÓÐÄܺÍÕâ¸öNPC¶Ô»°µÄÈÎÎñ  | 
|     for i in range(curPlayer.GetMissionCount()):  | 
|         curMission = curPlayer.GetMissionByIndex(i)  | 
|         if curMission.GetState() == ChConfig.Def_Mission_State_Over:  | 
|             continue  | 
|         missionID = curMission.GetMissionID()  | 
|           | 
|         curTrigMission = FindQuestFunc(missionID)  | 
|         if curTrigMission == None:  | 
|             continue  | 
|           | 
|         if curTrigMission.Type == QuestCommon.Def_GM_Active_Mission_Type:  | 
|             #Õâ¸öÈÎÎñÊǽÚÈÕÈÎÎñ, ÐèÒªGM¿ªÆôµÄ  | 
|             if not GameWorld.GetGameWorld().IsEventActive(missionID):  | 
|                 continue  | 
|           | 
|         key = GetVisitNPCKey(curPlayer, curMission, curTrigMission, npcID)  | 
|           | 
|         if key == None:  | 
|             #ÎÞ´Ëkey  | 
|             continue  | 
|           | 
|         ######################¼ì²éÄܲ»ÄÜÔËÐзÖÖ§½Úµã, Èç¹ûÄÜ, ¼ÓÔÚµÚÒ»´Î¶Ô»°ÖÐ#################  | 
|         runResult = False  | 
|         allNodelist = curTrigMission.QuestsEvent[key].GetXMLEventLoader().GetNodeList()  | 
|         eventNode = allNodelist.FindNode("event")  | 
|         if eventNode == None or eventNode.IsEmpty():  | 
|             GameWorld.Log("·ÃÎÊʼþ²»´æÔÚevent" , curPlayer.GetPlayerID())  | 
|             return  | 
|           | 
|         #-------------------------quest½Úµã-------------------  | 
|         for i in range(0, eventNode.GetChildCount()):  | 
|             #±éÀúÈÎÎñÁбí, ÕÒµ½Õâ¸öÈËÎï¿ÉÒÔÖ´ÐеÄÈÎÎñ  | 
|             questNode = eventNode.GetChild(i)  | 
|             curPlayer.SetCurrentQuestNode(questNode)  | 
|             if curMission == None:  | 
|                 continue  | 
|             if curMission.GetState() == ChConfig.Def_Mission_State_Over:  | 
|                 continue  | 
|             for i in range(0, questNode.GetChildCount()):  | 
|                 embranchmentNode = questNode.GetChild(i)  | 
|                 if CanDoQuestNodeTalk(curPlayer, curMission, embranchmentNode) == True:  | 
|                     runResult = True  | 
|                     break  | 
|           | 
|         if runResult != True:  | 
|             #²»ÄÜÔËÐÐÈÎÎñ  | 
|             continue  | 
|           | 
|         name = curTrigMission.Code  | 
|         talkContent.AddAnswer(name)  | 
|   | 
|   | 
|     if menuList != None:  | 
|         for menu in menuList:  | 
|             TalkContent.AddAnswer(menu)  | 
|       | 
|     talkContent.AddAnswer('c')  | 
|     #ÉèÖÃÍæ¼ÒÈÎÎñ״̬  | 
|     curPlayer.SetEventState(TYPE_Event_Select)  | 
| #    if talkContent.GetAnswerCount() == 1:  | 
| #        curPlayer.TalkMessage("", talkContent)  | 
| #    else:  | 
|     curPlayer.Talk(0, "", talkContent)  | 
|       | 
|     #¼Ç¼ÈÎÎñÏà¹ØÐÅÏ¢  | 
|     GameLogInfo.LogInfo_MissionTime(timeClock)  | 
|     GameLogInfo.LogInfo_MissionCount(1)  | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÄܹ»ÔËÐнڵã¶Ô»°  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param embranchmentNode ½ÚµãÊý¾Ý  | 
| # @return ·µ»ØÖµÕæ, ¼ì²éͨ¹ý  | 
| # @remarks ÊÇ·ñÄܹ»ÔËÐнڵã¶Ô»°  | 
| def CanDoQuestNodeTalk(curPlayer, curMission, embranchmentNode):  | 
|     #------------------------È¡µÃ/УÑéÌõ¼þ-----------------------------  | 
|     conditionsNode = embranchmentNode.FindChildNode("conditions")  | 
|     if conditionsNode == None or conditionsNode.IsEmpty():  | 
|         #ûÓÐÌõ¼þÔ¼Êø  | 
|         GameWorld.Log("CanDoQuestNodeTalk Ã»ÓÐÌõ¼þÔ¼Êø" , curPlayer.GetPlayerID())  | 
|         return True  | 
|       | 
|     for i in range(0, conditionsNode.GetChildCount()):  | 
|         #È¡µÃµ±Ç°Ìõ¼þ½Úµã  | 
|         curConditionNode = conditionsNode.GetChild(i)  | 
| #        GameWorld.Log(str(curConditionNode.GetXML()))  | 
|         if AnswerConditionJudge(curPlayer, curMission, curConditionNode) != True:  | 
|             #Ö´ÐÐÌõ¼þУÑéʧ°Ü, ²»ÔËÐÐÕâ¸ö·ÖÖ§  | 
| #            GameWorld.Log("ÔÚÕâ¸öxml³ö´í : %s"%(curConditionNode.GetXML()))  | 
|             return  | 
|   | 
|     return True  | 
|   | 
|   | 
| ##-------------------------------------ÈÎÎñ´«ËÍ-------------------------------------------------  | 
| ###ÈÎÎñ´«ËÍ»ñµÃÈÎÎñÃèÊö<a href="MoveTo NPC,51">,ÍÚ±¦<a href="Goto (!mapid!),(!posx!),(!posy!)">  | 
| ## @param curPlayer Íæ¼ÒʵÀý  | 
| ## @param curMission ÈÎÎñʵÀý  | 
| ## @return ·µ»ØÖµ, ÈÎÎñÃèÊö  | 
| ## @remarks ÈÎÎñ´«ËÍ»ñµÃÈÎÎñÃèÊö<a href="MoveTo NPC,51">,ÍÚ±¦<a href="Goto (!mapid!),(!posx!),(!posy!)">  | 
| #def GetMsgNode_NPCID(curPlayer, curMission):  | 
| #    movePos = []  | 
| #    if FindQuestFunc(curMission.GetMissionID()) == None:  | 
| #        return None  | 
| #      | 
| #    descriptIndex = curMission.GetDescriptionIndex()  | 
| #      | 
| #    questList = FindQuestFunc(curMission.GetMissionID()).QuestDescriptionList  | 
| #    if descriptIndex >= len(questList) or descriptIndex < 0:  | 
| #        return None  | 
| #      | 
| #    MsgNode = questList[descriptIndex].MsgNode  | 
| #    if MsgNode == None or MsgNode.IsEmpty():  | 
| #        return None  | 
| #      | 
| #    for i in range(MsgNode.GetChildCount()):  | 
| #        curNode = MsgNode.GetChild(i)  | 
| #        if curNode == None or curNode.IsEmpty():  | 
| #            return None  | 
| #          | 
| #        if curNode.GetNodeName().lower() != 'a':  | 
| #            continue  | 
| #          | 
| #        moveStr = curNode.GetAttribute("href")  | 
| #        #ûÓÐ×ø±êºÍNPC£¬·µ»Ø  | 
| #        if moveStr == "":  | 
| #            return  None  | 
| #          | 
| #        movelist = moveStr.split(',')  | 
| #        #ÿÈÕÈÎÎñÌØÊâ´¦Àí<a href="MoveTo NPC,(!day_event_id!)">  | 
| #        if movelist[1] == "(!day_event_id!)":  | 
| #            npcID = curMission.GetProperty(QuestCommon.Def_Day_Event_ID)  | 
| #            movePos = [npcID]  | 
| #              | 
| #        #ÒÆ¶¯NPC<a href="MoveTo NPC,51">  | 
| #        elif len(movelist) == 2:  | 
| #            npcID = int(moveStr.split(',')[1])  | 
| #            movePos = [npcID]  | 
| #              | 
| #        #ÍÚ±¦<a href="Goto (!mapid!),(!posx!),(!posy!)">  | 
| #        elif len(movelist) == 3:  | 
| #            #»ñµÃÈÎÎñÍÚ±¦×ø±ê  | 
| #            moveMapID = curMission.GetProperty('mapid')  | 
| #            movePosX = curMission.GetProperty('posx')  | 
| #            movePosY = curMission.GetProperty('posy')  | 
| #            movePos = [ moveMapID, movePosX, movePosY ]    | 
| #        else:  | 
| #            return None   | 
| #          | 
| #        return movePos  | 
|   | 
| #*****************************************************************************  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖÃÏûÏ¢ÌáʾÁбíGetMsgPar  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param talkContent Ì¸»°ÐÅÏ¢  | 
| # @param msgNode ÏûÏ¢½Úµã  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ÉèÖÃÏûÏ¢ÌáʾÁбíGetMsgPar  | 
| def __SetNPCTalkMsg(curPlayer, curMission, talkContent, msgNode):  | 
|     talkContent.SetMsg(msgNode.GetAttribute("code"))  | 
|       | 
|     #ÉèÖÃMsgÖеIJÎÊý  | 
|     msgPar = talkContent.GetMsgPar()  | 
|     msgPar.Clear()  | 
|     text = msgNode.GetXML()  | 
|     parseList = QuestCommon.DealWithInPut(text)  | 
|     if len(parseList) == 0:  | 
|         return  | 
|       | 
|     #---warning: ·þÎñ¶Ë msgParÏûÏ¢ÖÐÖ»´æstrÀàÐ͠ûÓÐintÀàÐÍ£¬¿Í»§¶ËûÓжÔint´¦Àí£¨08 01·â°ü£©---  | 
|     for i in range(0, len(parseList)):  | 
|         parseList[i] = QuestRunnerValue.GetNPCTalkReplaceValue(curPlayer, curMission, parseList[i])  | 
|       | 
|     for item in parseList:  | 
|         if type(item) == int:  | 
|             msgPar.AddInt(item)  | 
|         else:  | 
|             msgPar.AddStr(item)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐпնԻ°( ÒѾ²»Ê¹Óà)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param embranchmentNode ½ÚµãÊý¾Ý  | 
| # @param talkContent Ì¸»°ÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÖ´Ðгɹ¦  | 
| # @remarks Ö´ÐпնԻ°( ÒѾ²»Ê¹Óà)  | 
| def DoNoneQuestNodeTalk(curPlayer, curMission, embranchmentNode, talkContent):  | 
|     #------------------------È¡µÃ/УÑéÌõ¼þ-----------------------------  | 
|     conditionsNode = embranchmentNode.FindChildNode("conditions")  | 
|     if conditionsNode == None or conditionsNode.IsEmpty():  | 
|         #ûÓÐÌõ¼þÔ¼Êø  | 
|         GameWorld.Log("DoNoneQuestNodeTalk Ã»ÓÐÌõ¼þÔ¼Êø" , curPlayer.GetPlayerID())  | 
|         return True  | 
|       | 
|     for i in range(0, conditionsNode.GetChildCount()):  | 
|         #È¡µÃµ±Ç°Ìõ¼þ½Úµã  | 
|         curConditionNode = conditionsNode.GetChild(i)  | 
| #        GameWorld.Log(str(curConditionNode.GetXML()))  | 
|         if AnswerConditionJudge(curPlayer, curMission, curConditionNode) != True:  | 
|             #Ö´ÐÐÌõ¼þУÑéʧ°Ü, ²»ÔËÐÐÕâ¸ö·ÖÖ§  | 
| #            GameWorld.Log("ÔÚÕâ¸öxml³ö´í : %s"%(curConditionNode.GetXML()))  | 
|             return  | 
|           | 
|     #------------------------Ö´ÐжԻ°-----------------------------  | 
|     talkNode = embranchmentNode.FindChildNode("talk")  | 
|       | 
|     if talkNode == None or talkNode.IsEmpty():  | 
|         return  | 
|       | 
|     msgNode = talkNode.FindChildNode("msg")  | 
|     npcID = talkNode.GetAttribute("id")  | 
|     if npcID == "":  | 
|         npcID = 0  | 
|     else:  | 
|         npcID = int(npcID)  | 
|     #talkContent.SetMsg(ReplaceNPCTalkText(curPlayer, curMission, msgNode.GetXML()))  | 
|     __SetNPCTalkMsg(curPlayer, curMission, talkContent, msgNode)  | 
|   | 
|     talkAnswersNode = talkNode.FindChildNode("talk_answers")  | 
|     for i in range(0, talkAnswersNode.GetChildCount()):  | 
|         talkNode = talkAnswersNode.GetChild(i)  | 
|         answerText = talkNode.GetAttribute("code")  | 
|         talkContent.AddAnswer(answerText)  | 
|           | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñ¿ÉÒÔ´¥·¢½ÚµãÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param conditionsNode Ìõ¼þ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý  | 
| # @remarks ÊÇ·ñ¿ÉÒÔ´¥·¢½ÚµãÐÅÏ¢  | 
| def __CanRunCondition(curPlayer, curMission, conditionsNode):  | 
|     for i in range(0, conditionsNode.GetChildCount()):  | 
|         #È¡µÃµ±Ç°Ìõ¼þ½Úµã  | 
|         curConditionNode = conditionsNode.GetChild(i)  | 
|         #GameWorld.Log(str(curConditionNode.GetXML()))  | 
|         if AnswerConditionJudge(curPlayer, curMission, curConditionNode) != True:  | 
|             #Ö´ÐÐÌõ¼þУÑéʧ°Ü, ²»ÔËÐÐÕâ¸ö·ÖÖ§  | 
|             #GameWorld.Log("ÔÚÕâ¸öxml³ö´í : %s"%(curConditionNode.GetXML()))  | 
|             return False  | 
|           | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##µÃµ½Ä¬È϶Ի°µÄÄÚÈÝ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param npcID NPCID  | 
| # @return ·µ»ØÖµ, Ä¬È϶Ի°Êý¾Ý  | 
| # @remarks µÃµ½Ä¬È϶Ի°µÄÄÚÈÝ  | 
| def __GetDefaultTalkContent(curPlayer, npcID):  | 
|     curDefaultTalk = FindDefaultTalkFunc(npcID)  | 
|     if not curDefaultTalk :  | 
|         return GameWorld.Log("ûÓжԻ°!!!!" , curPlayer.GetPlayerID())  | 
|       | 
|     talkNode = curDefaultTalk.GetNodeList()  | 
|     eventNode = talkNode.FindNode("event")  | 
|     if eventNode == None or eventNode.IsEmpty():  | 
|         GameWorld.Log("ûÓÐĬÈ϶Ի°½Úµã __GetDefaultTalkContent" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     eventNode = eventNode.FindChildNode("quest")  | 
|     for i in range(eventNode.GetChildCount()):  | 
|         curEmbranchment = eventNode.GetChild(i)  | 
|         conditionsNode = curEmbranchment.FindChildNode("conditions")  | 
|           | 
|           | 
|         if conditionsNode != None and (not conditionsNode.IsEmpty()):          | 
|             if __CanRunCondition(curPlayer, None, conditionsNode) != True:  | 
|                 continue  | 
|           | 
|         #¿ÉÒÔÔËÐзÖÖ§½Úµã, ·µ»ØËµ»°ÄÚÈÝ  | 
|         talkNode = curEmbranchment.FindChildNode("talk")  | 
|         talkIndex = random.randint(0, talkNode.GetChildCount() - 1)  | 
|         msgNode = talkNode.GetChild(talkIndex)  | 
|           | 
|         #ÐÞ¸Ä, ¶Ô»°¸ÄΪ´úÂëÐÎʽ  | 
|         #return msgNode.GetXML()  | 
|         return msgNode.GetAttribute("code")  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñ¿ÉÒÔÔËÐзÖÖ§½ÚµãÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param embranchmentNode ·ÖÖ§½ÚµãÊý¾Ý  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÑé֤ͨ¹ý  | 
| # @remarks ÊÇ·ñ¿ÉÒÔÔËÐзÖÖ§½ÚµãÐÅÏ¢  | 
| def __CanRunEmbranchmentNode(curPlayer, curMission, embranchmentNode):  | 
|     #------------------------È¡µÃ/УÑéÌõ¼þ-----------------------------  | 
|     conditionsNode = embranchmentNode.FindChildNode("conditions")  | 
|     if conditionsNode == None or conditionsNode.IsEmpty():  | 
|         #ûÓÐÌõ¼þÔ¼Êø  | 
|         #GameWorld.Log("__CanRunEmbranchmentNode Ã»ÓÐÌõ¼þÔ¼Êø" , curPlayer.GetPlayerID())  | 
|         return True  | 
|       | 
|     result = __CanRunCondition(curPlayer, curMission, conditionsNode)  | 
|       | 
|     #GameWorld.Log("__CanRunCondition result = %s "%result)  | 
|     return result  | 
|   | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| # #ÔËÐзÖÖ§½Úµã  | 
| # #ÔÚRunAllµÄʱºò, »áÕÒµ½actionsNode½Úµã, ÔÚÕâÖÖÇé¿öÏÂ, Ö±½Ó°ÑactionsNode½Úµã´«Èë  | 
| # #ÔÚÔËÐеÄʱºò, ²»½øÐмì²é. ±ÜÃâÖØ¸´µÄ¼ì²é  | 
| #===============================================================================  | 
| ##ÔËÐзÖÖ§½Úµã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param embranchmentNode ·ÖÖ§½ÚµãÊý¾Ý  | 
| # @param actionsNode ´«ÈëµÄ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÔËÐгɹ¦  | 
| # @remarks ÔÚRunAllµÄʱºò, »áÕÒµ½actionsNode½Úµã, ÔÚÕâÖÖÇé¿öÏÂ, Ö±½Ó°ÑactionsNode½Úµã´«Èë, ÔÚÔËÐеÄʱºò, ²»½øÐмì²é. ±ÜÃâÖØ¸´µÄ¼ì²é  | 
| def RunEmbranchmentNode(curPlayer, curMission, embranchmentNode, actionsNode=None):  | 
|     #------------------------È¡µÃ/УÑéÌõ¼þ-----------------------------  | 
|     if (actionsNode == None or actionsNode.IsEmpty()) and __CanRunEmbranchmentNode(curPlayer, curMission, embranchmentNode) != True:  | 
|         return  | 
|     #------------------------Ö´ÐжԻ°-----------------------------  | 
|     global TalkContent  | 
|     TalkContent.Clear()  | 
|     talkNode = embranchmentNode.FindChildNode("talk")  | 
|     answersNode = embranchmentNode.FindChildNode("answers")  | 
|       | 
|     #----------------------Pre Answer Ä£¿é------------------  | 
|     preAnswer = embranchmentNode.FindChildNode("pre_answers")  | 
|     if preAnswer != None and (not preAnswer.IsEmpty()):  | 
|         #µ¯³ö´°¿ÚÁ¢¼´×öʼþ  | 
|         __RunAnswerAction(curPlayer, curMission, preAnswer)       | 
|     #-------------------------------------------------------  | 
|       | 
|     if talkNode == None or talkNode.IsEmpty():  | 
| #        GameWorld.Log(answersNode.GetXML())  | 
|         #ûÓÐ̸»°»Ø´ð, Ö±½ÓÔËÐлشð·ÖÖ§(on_kill)  | 
|         if actionsNode == None or actionsNode.IsEmpty():  | 
|             __RunAnswerAction(curPlayer, curMission, answersNode)  | 
|         else:  | 
|             __DoAnswerActionNode(curPlayer, curMission, actionsNode)  | 
|         return True  | 
|       | 
|     #----------------------talk_answers Ä£¿é------------------      | 
|     msgNode = talkNode.FindChildNode("msg")  | 
|     style = talkNode.GetAttribute("style")  | 
|     npcName = talkNode.GetAttribute("name_code")  | 
|       | 
|     __SetNPCTalkMsg(curPlayer, curMission, TalkContent, msgNode)  | 
|       | 
|     talkAnswersNode = talkNode.FindChildNode("talk_answers")  | 
|     for i in range(0, talkAnswersNode.GetChildCount()):  | 
|         talkNode = talkAnswersNode.GetChild(i)  | 
|         answerText = talkNode.GetAttribute("code")  | 
|         TalkContent.AddAnswer(answerText)  | 
|           | 
|     missionID = 0  | 
|     if curMission != None:  | 
|         missionID = curMission.GetMissionID()  | 
|     if style == "select":  | 
|         curPlayer.Talk(missionID , npcName, TalkContent)  | 
|     elif style == "msg":  | 
|         curPlayer.TalkMessage(missionID , npcName, TalkContent)  | 
|     elif style == "pic":  | 
|         curPlayer.TalkPic(missionID , npcName, TalkContent)  | 
|     elif style == "info":  | 
|         curPlayer.TalkInfo(missionID , npcName, TalkContent)  | 
| #    elif style == "replacemsg":  | 
| #        #ÐèÒª×öÌæ»»µÄÏûÏ¢  | 
| #        TalkContent = GetMissionReplaceMsg(TalkContent, curMission)  | 
| #        curPlayer.TalkMessage(npcName, TalkContent)  | 
|     else:  | 
|         GameWorld.Log("talk ·ç¸ñ²»ÕýÈ· : %s missionID = %s -> %s" % (style , missionID, embranchmentNode.GetXML()), curPlayer.GetPlayerID())  | 
|   | 
|     if answersNode == None or answersNode.IsEmpty():  | 
|         #»Ø´ð½ÚµãΪ¿Õ  | 
|         GameWorld.Log('»Ø´ð½ÚµãΪ¿ÕcurMission.GetMissionID() = %d' % curMission.GetMissionID() , curPlayer.GetPlayerID())  | 
| #        if waitEvent == True:  | 
| #            EventShell.DoExitEvent(curPlayer)  | 
|         return  | 
|     #===±£´æÔËÐÐÏÖ³¡, µÈ´ýÍæ¼Ò»ØÓ¦===================================  | 
|     missionID = 0  | 
|     if curMission != None:  | 
|         missionID = curMission.GetMissionID()  | 
|           | 
|     #if curPlayer.GetPlayerAction() == IPY_GameWorld.paEvent:  | 
|     curPlayer.SetEventState(TYPE_Event_Do)  | 
|       | 
|     curPlayer.WaitEvent(missionID, answersNode)  | 
|     return True  | 
|   | 
| #------------------------------ÈÎÎñ״̬1: Ì¸»°Ñ¡Ôñ----------------TYPE_Event_Select  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¶Ô»°_ÈÎÎñÑ¡Ôñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param answer ¶Ô»°Ñ¡Ïî  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¶Ô»°_ÈÎÎñÑ¡Ôñ  | 
| def Answer_MissionSelect(curPlayer, answer):  | 
|     #-------------------------embranchment½Úµã-------------------  | 
|     missionID = GameWorld.ToIntDef(answer)  | 
|     if missionID == 0:  | 
|         Answer_Do(curPlayer, answer)  | 
|         return  | 
|     #Íæ¼ÒºÍNPCµÚÒ»´Î¶Ô»°, µ¯³öµÄÈÎÎñ  | 
|     curMission = curPlayer.FindMission(missionID)  | 
|     if curMission == None:  | 
|         GameWorld.Log("Íæ¼ÒÎÞÕâ¸öÈÎÎñ%d" % missionID , curPlayer.GetPlayerID())  | 
|         EventShell.DoExitEvent(curPlayer)  | 
|         return  | 
|       | 
|     if curMission.GetState() == ChConfig.Def_Mission_State_Over:  | 
|         GameWorld.Log("Íæ¼ÒÈÎÎñ%dÒѾÍê³É" % missionID , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     if FindQuestFunc(missionID) == None:  | 
|         return  | 
|       | 
|     curNPC = GetPlayerTalkNPC(curPlayer)  | 
|       | 
|     if curNPC == None:  | 
|         return  | 
|       | 
|     curTrigMission = FindQuestFunc(missionID)  | 
|     key = GetVisitNPCKey(curPlayer, curMission, curTrigMission, curNPC.GetNPCID())  | 
|       | 
|     if not curTrigMission.QuestsEvent.has_key(key) :  | 
|         GameWorld.Log("Can't Find missionID = %d,  %s" % (missionID, str(key)) , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     RunQuest(curPlayer, missionID, curTrigMission.QuestsEvent[key].GetXMLEventLoader().GetNodeList())  | 
|       | 
|      | 
| #------------------------------ÈÎÎñ״̬2: »ØÓ¦-------------------TYPE_Event_Do  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¶Ô»°_ÈÎÎñ»ØÓ¦  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param answer ¶Ô»°Ñ¡Ïî  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¶Ô»°_ÈÎÎñ»ØÓ¦  | 
| def Answer_Do(curPlayer, answer):  | 
|     global CurrentPlayerAnswer  | 
|     answersNode = curPlayer.GetWaitEvent()  | 
|     if answersNode == None or answersNode.IsEmpty():  | 
|         GameWorld.Log("µÈ´ýʼþΪ¿Õ" , curPlayer.GetPlayerID())  | 
|         EventShell.DoExitEvent(curPlayer)  | 
|         return False  | 
|       | 
|     curMissionID = curPlayer.GetCurrentMissionID()  | 
|     curMission = None  | 
|     if curMissionID != 0:  | 
|         curMission = curPlayer.FindMission(curMissionID)  | 
|         if curMission == None:  | 
|             GameWorld.Log("ÕÒ²»µ½ÈÎÎñID : %d" % (curMissionID) , curPlayer.GetPlayerID())  | 
|             EventShell.DoExitEvent(curPlayer)  | 
|             return False  | 
|       | 
|     CurrentPlayerAnswer = answer  | 
|     __RunAnswerAction(curPlayer, curMission, answersNode)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¶Ô»°_ÆÕͨ¶Ô»°  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param answer ¶Ô»°Ñ¡Ïî  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¶Ô»°_ÆÕͨ¶Ô»°  | 
| def RunPlayerAnswer(curPlayer, answer):  | 
|     if curPlayer.GetEventState() == 0:  | 
|         EventShell.DoExitEvent(curPlayer)  | 
|         GameWorld.Log("Íæ¼Ò»Ø´ð²»ÔÚÈÎÎñ״̬ curPlayer.GetEventState() == 0" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     if curPlayer.GetEventState() == TYPE_Event_Select:  | 
|         #ÈÎÎñÑ¡Ôñ  | 
|         Answer_MissionSelect(curPlayer, answer)  | 
|     elif curPlayer.GetEventState() == TYPE_Event_Do:  | 
|         #ÈÎÎñ»Ø»°  | 
|         Answer_Do(curPlayer, answer)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##²éÕÒ¶Ô»°½ÚµãÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param answersNode »Ø»°½Úµã  | 
| # @return ·µ»ØÖµ, ¶Ô»°½ÚµãÐÅÏ¢  | 
| # @remarks ²éÕÒ¶Ô»°½ÚµãÐÅÏ¢  | 
| def __FindAnswerActionNode(curPlayer, curMission, answersNode):  | 
|     if answersNode == None or answersNode.IsEmpty():  | 
|         #ûÓÐÌõ¼þÔ¼Êø  | 
|         GameWorld.Log("__FindAnswerActionNode Ã»Óлشð½ÚµãÔ¼Êø" , curPlayer.GetPlayerID())  | 
|         return   | 
|       | 
|     for i in range(0, answersNode.GetChildCount()):  | 
|         #------------------------Ö´Ðж¯×÷-----------------------------  | 
|         answerNode = answersNode.GetChild(i)  | 
|         conditionsNode = answerNode.FindChildNode("answer_conditions")  | 
|         runResult = True  | 
|           | 
|         if conditionsNode != None and (not conditionsNode.IsEmpty()):  | 
|             for j in range(0, conditionsNode.GetChildCount()):  | 
|                 curConditionNode = conditionsNode.GetChild(j)  | 
|                   | 
|                 if AnswerConditionJudge(curPlayer, curMission, curConditionNode) != True:  | 
|                     #Ö´ÐÐÌõ¼þУÑéʧ°Ü, ²»ÔËÐÐÕâ¸ö·ÖÖ§                  | 
|                     runResult = False  | 
|                     #GameWorld.Log("missionID = %d, Ö´ÐÐÌõ¼þУÑéʧ°Ü, ²»ÔËÐÐÕâ¸ö·ÖÖ§  %s"%(curMission.GetMissionID(), curConditionNode.GetXML()))  | 
|                     break  | 
|               | 
|             if runResult != True:  | 
|                 continue  | 
|               | 
|         actionsNode = answerNode.FindChildNode("answer_actions")  | 
|           | 
|         return actionsNode  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐжԻ°½ÚµãÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param answersNode »Ø»°½Úµã  | 
| # @return ·µ»ØÖµ, ÎÞÒâÒå  | 
| # @remarks Ö´ÐжԻ°½ÚµãÐÅÏ¢  | 
| def __DoAnswerActionNode(curPlayer, curMission, actionsNode):  | 
|     if actionsNode == None or actionsNode.IsEmpty():  | 
|         GameWorld.Log('__DoAnswerActionNodeÕÒ²»µ½»Ø´ð½Úµã! ÈÎÎñID=%s' % (0 if curMission == None else curMission.GetMissionID()))  | 
|         return  | 
|       | 
|     QuestCommon.SetMissionBeDeleted(0)  | 
|       | 
|     missionID = 0  | 
|     if curMission != None:  | 
|         missionID = curMission.GetMissionID()  | 
|       | 
|     for j in range(0, actionsNode.GetChildCount()):  | 
|         curActionNode = actionsNode.GetChild(j)  | 
| #            if curMission ==None:  | 
| #                DoAction(curPlayer,None, curActionNode)  | 
|         DoAction(curPlayer, curMission, curActionNode)  | 
|           | 
|         #²»Çå³þ¾ßÌåÂ߼ΪʲôҪÉèÖÃÈÎÎñɾ³ý±êʶ£¬ÈÔÒª¼ÌÐøÖ´ÐÐÈÎÎñ½Úµã£¬ÀíÂÛÉϻᱨ´í  | 
|         #Ìí¼Ó·À·¶ÊÇ·ñµ±Ç°ÈÎÎñ±»É¾³ý£¬ÔÝʱ±£Áô´úÂë  | 
|         if QuestCommon.IsDeleteMission() == 1 and curPlayer.FindMission(missionID) == None:  | 
|             curMission = None  | 
|     return  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐжԻ°½ÚµãÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param answersNode »Ø»°½Úµã  | 
| # @return ·µ»ØÖµ, ÎÞÒâÒå  | 
| # @remarks Ö´ÐжԻ°½ÚµãÐÅÏ¢  | 
| def __RunAnswerAction(curPlayer, curMission, answersNode):  | 
|     actionsNode = __FindAnswerActionNode(curPlayer, curMission, answersNode)  | 
|     if actionsNode == None or actionsNode.IsEmpty():  | 
|         GameWorld.DebugLog('__RunAnswerActionÕÒ²»µ½»Ø´ð½Úµã--%s'%curMission.GetMissionID())  | 
|         return  | 
|       | 
|     __DoAnswerActionNode(curPlayer, curMission, actionsNode)  | 
|     return True  | 
|   | 
| #========================== Ìõ¼þÅж¨½Ó¿Ú ConditionType_ =======================================  | 
| #ÀàÐÍ -> Differ//²»µÈÓÚ,Equal//µÈÓÚ,Less//СÓÚ,Great//´óÓÚ  | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÈÎÎñ״̬  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <var type="ÀàÐÍ" name="²ß»®ÓÃ:ÈÎÎñ×ÖµäÃû(Ö»Åжϲ»´æ)" value="Öµ" dict_value="³ÌÐòÓÃ:ÈÎÎñ×ÖµäÃû(Òª´æÈ¡)" replace_value="Ìæ»»×ÖµäÖµ" id="Ä¿±êÈÎÎñID" diff="ÈÝ´íÖµ"/>  | 
| def ConditionType_Var(curPlayer, curMission, curConditionNode):  | 
|     #var ÐÍÌõ¼þ½ÚµãµÄÅж¨   (ÈÎÎñÌõ¼þ (state, kill_byid_...))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     conditionName = curConditionNode.GetAttribute("name")  | 
|     dict_value = curConditionNode.GetAttribute("dict_value")  | 
|     dict_id = GameWorld.ToIntDef(curConditionNode.GetAttribute("dict_id"), 0)  | 
|     replace_value = curConditionNode.GetAttribute("replace_value")  | 
|     conditionValue = curConditionNode.GetAttribute("value")  | 
|     conditionID = curConditionNode.GetAttribute("id")  | 
|     diff = curConditionNode.GetAttribute("diff")  | 
|     if diff != "":  | 
|         diff = int(diff)  | 
|           | 
|     if dict_value != "":  | 
|         #Ä¿±êÈÎÎñ  | 
|         if dict_id:  | 
|             tmpMission = curPlayer.FindMission(dict_id)  | 
|             if tmpMission == None:  | 
|                 return  | 
|             conditionValue = tmpMission.GetProperty(dict_value)  | 
|         else:  | 
|             conditionValue = curMission.GetProperty(dict_value)  | 
|               | 
|     elif replace_value != "":  | 
|         #ÐèÒªÌæ»»µÄ  | 
|         conditionValue = int(QuestRunnerValue.GetNPCTalkReplaceValue(curPlayer, curMission, replace_value))  | 
|     else:  | 
|         conditionValue = int(conditionValue)  | 
|   | 
|     #Ä¿±êÈÎÎñ  | 
|     tagMission = curMission  | 
|     if conditionID != "":          | 
|         conditionID = int(conditionID)  | 
|         tagMission = curPlayer.FindMission(conditionID)  | 
|           | 
|     curValue = 0  | 
|     if tagMission == None and conditionName.lower() == 'state':  | 
|         #ÌØÊâÇå¿Õ´¦Àí, Èç¹ûûÓÐÈÎÎñ, stateΪ0  | 
|         curValue = 0  | 
|     elif tagMission == None:  | 
|         GameWorld.DebugLog("ûÓÐÄ¿±êÈÎÎñ %s" % conditionID , curPlayer.GetPlayerID())  | 
|         return  | 
|     else:  | 
|         curValue = QuestRunnerValue.GetValue(curPlayer, tagMission, conditionName)  | 
|   | 
|     return QuestRunnerValue.GetEval(conditionType, curValue, conditionValue, diff)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Åжϱ³°ü¿Õ¸ñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <space type="ÀàÐÍ" value="Öµ" bag="±³°üÀàÐÍ"/>  | 
| def ConditionType_Space(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<space value="" type="" bag=""(±³°üÀàÐÍ ²»ÌîĬÈϰü¹ü)/>  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     conditionBag = curConditionNode.GetAttribute("bag")  | 
|     if conditionBag == "":  | 
|         curBag = IPY_GameWorld.rptItem  | 
|     else:  | 
|         curBag = int(conditionBag)  | 
|     value = ItemControler.GetItemPackSpace(curPlayer, curBag)  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÊÇ·ñÓÐͨѶ°²È«Ëø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Have_Tellock/>  | 
| def ConditionType_Have_Tellock(curPlayer, curMission, curConditionNode):  | 
|     #»ñȡͨѶ°²È«Ëø¼¤»î״̬£¬0δ֪£¬1ÒÑ¿ªÍ¨£¬2δ¿ªÍ¨  | 
|     return (curPlayer.GetTelLockState() == 1)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÈÎÎñÎïÆ·µôÂ伸ÂÊ[²»¿ÉÓÃÔڻشðÅжÏ]  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <probability value="³öÏÖ¼¸ÂÊ(°Ù·ÖÂÊ)" point="×î´ó¼¸ÂÊ(°Ù·ÖÂÊ)"/>  | 
| def ConditionType_Probability(curPlayer, curMission, curConditionNode):  | 
|     rate = int(curConditionNode.GetAttribute("value"))  | 
|     point = GameWorld.ToIntDef(curConditionNode.GetAttribute("point"), 100)  | 
|     return GameWorld.CanHappen(rate, point)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÊÇ·ñÓµÓмÒ×å  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Have_Family/>  | 
| def ConditionType_Have_Family(curPlayer, curMission, curConditionNode):  | 
|     #ÅжϼÒ×å<have_family>  | 
|     if curPlayer.GetFamilyID() != 0 :  | 
|         return True  | 
|       | 
|     return False  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÊÇ·ñÓµÓÐÂíÆ¥  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <have_horse value="Öµ" type="ÀàÐÍ"/>  | 
| def ConditionType_Have_Horse(curPlayer, curMission, curConditionNode):  | 
|     #ÅжÏÂíÆ¥<have_horse value="" type="">  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     roleEquipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)  | 
|     #===========================================================================  | 
|     # itemRideHorse = roleEquipPack.GetAt(IPY_GameWorld.retHorse)  | 
|     # #ÎÞÂíÆ¥  | 
|     # if not ItemCommon.CheckItemCanUse( itemRideHorse ):  | 
|     #    value = 0  | 
|     # else:  | 
|     #    value = 1  | 
|     #===========================================================================  | 
|     value = 1  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)  | 
|   | 
| ##ÅжÏÊÇ·ñ´©´÷ij²¿Î»(·ÇʱЧ)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <have_equip value="×°±¸Î»"/>  | 
| def ConditionType_Have_Equip(curPlayer, curMission, curConditionNode):  | 
|     equipPlace = int(curConditionNode.GetAttribute("value"))  | 
|     roleEquipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)  | 
|     curEquip = roleEquipPack.GetAt(equipPlace)  | 
|     if curEquip.IsEmpty():  | 
|         return False  | 
|     if curEquip.GetEndureReduceType():  | 
|         return False  | 
|     return True  | 
|       | 
| #---------------------------------------------------------------------  | 
| ##Ôö¼Ó¼Ò×åÏà¹ØÖµ   | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Add_Family_Value hornorValue="¼Ò×å¹±Ï×" familyMoney="¼Ò×å×ʽð"/>  | 
| def DoType_Add_Family_Value(curPlayer, curMission, curActionNode):  | 
|     #Ôö¼Ó¼Ò×åÏà¹ØÖµ<Add_Family_Value hornorValue="¼Ò×å¹±Ï×" familyMoney="¼Ò×å×ʽð"/>  | 
|     curPlayerFamilyID = curPlayer.GetFamilyID()  | 
|       | 
|     if not curPlayerFamilyID:  | 
|         return  | 
|       | 
|     # ¼Ò×åÈÙÓþÔÝÓÃÓÚÓÀºãÏîÄ¿¼Ò×å×êʯÓã¬ÈÙÓþÂß¼ÔÝÆÁ±Î    20160606 by hxp  | 
| #    addFamilyHornor = GameWorld.ToIntDef(curActionNode.GetAttribute("hornorValue"), 0)  | 
| #    #Ôö¼Ó¼Ò×å¹±Ï×  | 
| #    if addFamilyHornor != 0:  | 
| #        PlayerFamily.SendPack_GameServer_AddFamilyDetail(curPlayer, addFamilyHornor = addFamilyHornor, resion=ShareDefine.Def_AddFAVReason_DoFamilyMisson)  | 
|       | 
|     addFamilyMoney = GameWorld.ToIntDef(curActionNode.GetAttribute("familyMoney"), 0)  | 
|       | 
|     #Ôö¼Ó¼Ò×å×ʽð  | 
|     if addFamilyMoney != 0:  | 
|         PlayerFamily.SendPack_GameServer_AddFamilyDetail(curPlayer, addFamilyMoney=addFamilyMoney, resion=ShareDefine.Def_AddFAVReason_DoFamilyMisson)  | 
|           | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ôö¼ÓÍæ¼ÒXPÖµ   | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Add_Player_XP value="Íæ¼ÒxpÖµ"/>  | 
| def DoType_Add_Player_Xp(curPlayer, curMission, curActionNode):  | 
|     #Ôö¼ÓÍæ¼ÒÏà¹ØÖµ<Add_Player_XP value="Íæ¼ÒxpÖµ"/>  | 
|       | 
|     xpValue = curActionNode.GetAttribute("value")  | 
|       | 
|     if xpValue != "":  | 
|         #ÉèÖÃÍæ¼ÒxpÖµ  | 
|         openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP')  | 
|         curXp = min(int(xpValue), maxXPValue)  | 
|         curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curXp)  | 
|         curPlayer.SetXP(curXp)  | 
|           | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¼Ò×åÉý¼¶.  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ÎÞ·µ»ØÖµ  | 
| # @remarks ¼Ò×åÉý¼¶  | 
| def DoType_Familylvup(curPlayer, curMission, curActionNode):  | 
|     curPlayer.GameServer_LVUpFamily()  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸ÅÂʵôÂ䣨×îµÍɱ¹Ö)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Drop_Result rate="³öÏÖ¼¸ÂÊ(°Ù·ÖÂÊ)" minMonsterCount="×îСɱ¹ÖÊýÁ¿" curMonsterCount="ÒÑɱ¹ÖÊýÁ¿"/>  | 
| def ConditionType_Drop_Result(curPlayer, curMission, curConditionNode):  | 
|     #³õʼµôÂÊ  | 
|     rate = int(curConditionNode.GetAttribute("rate"))  | 
|     #×îСɱ¹ÖÊýÁ¿  | 
|     minMonsterCount = int(curConditionNode.GetAttribute("minMonsterCount"))  | 
|     #µ±Ç°É±¹ÖÊýÁ¿  | 
|     curMonsterCountStr = curConditionNode.GetAttribute("curMonsterCount")  | 
|     curMonsterCount = int(curMission.GetProperty(curMonsterCountStr))  | 
|       | 
|     if curMonsterCount < minMonsterCount :  | 
|         return False  | 
|       | 
|     return GameWorld.CanHappen(rate, 100)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸ÅÂʵôÂä, ºÍɱ¹ÖÊýÄ¿ÓйØ(×î¸ßɱ¹Ö)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <drop_form rate="³öÏÖ¼¸ÂÊ(°Ù·ÖÂÊ)" maxItem="×î¶àµôÂäÊýÁ¿" curItem="ÓµÓÐÎïÆ·ÊýÁ¿" maxMonsterCount="×î¶àɱ¹ÖÊýÁ¿" curMonsterCount="ÒÑɱ¹ÖÊýÁ¿"/>  | 
| def ConditionType_Drop_Form(curPlayer, curMission, curConditionNode):  | 
|     #³õʼµôÂÊ  | 
|     rate = float(curConditionNode.GetAttribute("rate")) / 100  | 
|     #×î´óÊýÁ¿  | 
|     maxItem = float(curConditionNode.GetAttribute("maxItem"))  | 
|     #µ±Ç°µÃµ½ÎïÆ·ÊýÄ¿  | 
|     curItemCountStr = curConditionNode.GetAttribute("curItem")  | 
|     curItemCount = float(curMission.GetProperty(curItemCountStr))  | 
|     #×î´óɱ¹ÖÊýÁ¿  | 
|     maxMonsterCount = float(curConditionNode.GetAttribute("maxMonsterCount"))  | 
|     #µ±Ç°É±¹ÖÊýÁ¿  | 
|     curMonsterCountStr = curConditionNode.GetAttribute("curMonsterCount")  | 
|     curMonsterCount = float(curMission.GetProperty(curMonsterCountStr)) + 1  | 
|       | 
|     #GameWorld.Log("rate = %f, maxItem = %f, curItemCount = %f, curMonsterCount = %f"%(  | 
|     #                                rate, maxItem, curItemCount, curMonsterCount))  | 
|     if curMonsterCount >= maxMonsterCount:  | 
|         #ɱ¹ÖÊýÁ¿ÒÑÂú, Ò»¶¨µôÂä  | 
|         return True  | 
|     #****************************************  | 
|     #³õʼ±ØµôÂä¸öÊý  | 
|     baseDropCount = float(maxItem / 10)  | 
|     #GameWorld.Log("³õʼ±ØµôÂä¸öÊý : %s"%str(baseDropCount))  | 
|     #³õʼ±ØµôÂäɱ¹ÖÊý  | 
|     dropMonsterCount = float(maxMonsterCount / 10)  | 
|     #GameWorld.Log("³õʼ±ØµôÂäɱ¹ÖÊý : %s"%str(dropMonsterCount))  | 
|     #****************************************  | 
|     realRate = eval(ChConfig.Def_Event_Drop_Formula) * 100  | 
|     #GameWorld.Log("ɱ¹ÖµôÂÊ : %s"%str(realRate))  | 
|     #ת»»ÎªÕûÐÍ  | 
|     realRate = int(realRate)  | 
|       | 
|     #×îÖÕ½á¹û  | 
|     calcResult = GameWorld.CanHappen(realRate, 100)  | 
|     #GameWorld.Log("×îÖÕµôÂÊ : %s"%str(calcResult))  | 
|     return calcResult  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Åжϱ³°ü»ñµÃÄÜ·ñ¿Éµþ¼ÓÈÎÎñÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Can_Put id="ÎïÆ·ID" count="ÎïÆ·ÊýÁ¿" nobind="²»Ê¹Óð󶨲ÄÁÏ" result="ÆÚÍû½á¹û"/>  | 
| def ConditionType_Can_Put(curPlayer, curMission, curConditionNode):  | 
|     curItemID = GameWorld.ToIntDef(curConditionNode.GetAttribute("id"), 0)  | 
|       | 
|     if curItemID == 0:  | 
|         curItemID = curMission.GetProperty(QuestCommon.Def_Item_ID)  | 
|           | 
|     curItemCount = int(curConditionNode.GetAttribute("count"))  | 
|       | 
|     noBind = GameWorld.ToIntDef(curConditionNode.GetAttribute("nobind"), 0)  | 
|     #ĬÈÏÈÎÎñÎïÆ·Îª°ó¶¨£¬·Ç°ó¶¨ÌØÊâ´¦Àí  | 
|     bind = 1  | 
|     if noBind == 1:   | 
|         bind = 0  | 
|     #ÈÎÎñÎïÆ·¾ùΪ°ó¶¨ÎïÆ·  | 
|     itemControl = ItemControler.PlayerItemControler(curPlayer)  | 
|     expectResult = int(curConditionNode.GetAttribute("result"))  | 
|     result = itemControl.CanPutInItem(IPY_GameWorld.rptItem, curItemID, curItemCount, bind)  | 
|     if int(result) == expectResult:  | 
|         return True  | 
|       | 
|     return False  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##²éÕÒº¯Êý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Find name="Ìæ»»µÄÃû×Ö,ÈçFind_Item" id="²éÕÒµÄID" result="ÆÚÍû½á¹û"/>  | 
| def ConditionType_Find(curPlayer, curMission, curConditionNode):  | 
|     conditionName = curConditionNode.GetAttribute("name")  | 
|     id = int(curConditionNode.GetAttribute("id"))  | 
|     #ÆÚÍû½á¹û  | 
|     expectResult = int(curConditionNode.GetAttribute("result"))  | 
|     result = QuestRunnerValue.GetFind(curPlayer, conditionName, id)  | 
|     if int(result) == expectResult:  | 
|         return True  | 
|       | 
|     return False  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓµÓÐÖ¸¶¨¼¼ÄÜTypeIDµÄ¼¼ÄÜ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Skill skilltype="¼¼ÄÜTypeID"/>  | 
| def ConditionType_Have_Skill(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<have_skill skilltype=""/> ²é¿´Íæ¼ÒÓÐÎÞ¼¼ÄÜ  | 
|     skillTypeStr = curConditionNode.GetAttribute("skilltype")  | 
|       | 
|     if not skillTypeStr:  | 
|         GameWorld.ErrLog("XML Have_Skill id = %sΪ¿Õ£¡" % (skillTypeStr))  | 
|         return False  | 
|       | 
|     return curPlayer.GetSkillManager().FindSkillBySkillTypeID(int(skillTypeStr))  | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÓÐÎÞBUFF  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Buff id="¼¼ÄÜÀàÐÍID" value=""/>  | 
| def ConditionType_Have_Buff(curPlayer, curMission, curConditionNode):  | 
|     #<have_buff id="" value=""/>  | 
|     skillTypeID = int(curConditionNode.GetAttribute("id"))  | 
|     value = int(curConditionNode.GetAttribute("value"))  | 
|     curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillTypeID)  | 
|     if not curSkill:  | 
|         GameWorld.ErrLog("ConditionType_Have_BuffÒì³££¬skillTypeID = %s" % skillTypeID)  | 
|         return  | 
|       | 
|     buffType = SkillCommon.GetBuffType(curSkill)  | 
|     buffTuple = SkillCommon.GetBuffManagerByBuffType(curPlayer, buffType)  | 
|     #ͨ¹ýÀàÐÍ»ñȡĿ±êµÄbuff¹ÜÀíÆ÷Ϊ¿Õ£¬ÔòÌø³ö  | 
|     if buffTuple == ():  | 
|         return  | 
|       | 
|     buffManager = buffTuple[0]  | 
|     buff = buffManager.FindBuff(skillTypeID)  | 
|       | 
|     if buff == None:  | 
|         return 0 == value  | 
|       | 
|     return 1 == value  | 
|   | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##buffÊ£Óàʱ¼äÅÐ¶Ï  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Skill_Remain_Time type="__Eval+Ìæ»»µÄÃû×Ö" time="±È½ÏµÄÖµ(ºÁÃë)" id="ÔöÖµBuff¼¼ÄÜTypeID"/>  | 
| def ConditionType_Skill_Remain_Time(curPlayer, curMission, curConditionNode):  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     conditionValue = int(curConditionNode.GetAttribute("time"))  | 
|     id = int(curConditionNode.GetAttribute("id"))  | 
|     buffState = curPlayer.GetIncBuff()  | 
|     curPlayerbuff = buffState.FindBuff(id)  | 
|     if curPlayerbuff == None:  | 
|         values = 0  | 
|     else:  | 
|         values = curPlayerbuff.GetRemainTime()  | 
|           | 
|     return QuestRunnerValue.GetEval(conditionType, values, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñºÍïÚ³µÔÚͬһµØÍ¼ÅÐ¶Ï  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Truck_In_Around type="__Eval+Ìæ»»µÄÃû×Ö" time="±È½ÏµÄÖµ" />  | 
| def ConditionType_Truck_In_Around(curPlayer, curMission, curConditionNode):  | 
|     #<Truck_In_Around type="equal" value="1"/>  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     playerTruck = curPlayer.GetTruck()  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|       | 
|     if playerTruck != None:  | 
|         values = 1  | 
|     else:  | 
|         values = 0  | 
|           | 
|     return QuestRunnerValue.GetEval(conditionType, values, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##²Ö¿âµÈ¼¶ÅÐ¶Ï  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Warehouse_Lv type="__Eval+Ìæ»»µÄÃû×Ö" lv="±È½ÏµÄÖµ" />  | 
| def ConditionType_Warehouse_Lv(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<warehouse_lv lv="">  | 
|     curWarehouseLV = curPlayer.GetWarehouseLV()  | 
|     lv = int(curConditionNode.GetAttribute("lv"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     return QuestRunnerValue.GetEval(conditionType, curWarehouseLV, lv)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Åжϱ³°üÖÐÎïÆ·ÊýÁ¿  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Item_Count dict_id="ÈÎÎñ×ÖµäÖµ" id="dict_idΪ¿Õʱ¶ÁÈ¡" dict_value="ÈÎÎñ×ÖµäÖµ" value="dict_valueΪ¿Õʱ¶ÁÈ¡" type="__Eval+Ìæ»»µÄÃû×Ö" />  | 
| def ConditionType_Item_Count(curPlayer, curMission, curConditionNode):  | 
|     dict_id = curConditionNode.GetAttribute("dict_id")  | 
|     dict_value = curConditionNode.GetAttribute("dict_value")  | 
|       | 
|     if dict_id == "":  | 
|         id = int(curConditionNode.GetAttribute("id"))  | 
|     else:  | 
|         id = curMission.GetProperty(dict_id)  | 
|           | 
|     #GameWorld.Log("ÈÎÎñID£º%d"%(id))  | 
|     if dict_value == "":  | 
|         conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     else:  | 
|         conditionValue = curMission.GetProperty(dict_value)  | 
|           | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     value = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, id)  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÊýÁ¿ÊÇ·ñ×ã¹»(¿ÉÑéÖ¤°ó¶¨)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Item_Isbind_Count id="ÎïÆ·ID" value="ÑéÖ¤ÊýÁ¿" isBind="ÊÇ·ñËã°ó¶¨µÄÎïÆ· 0:²»Ëã,1:Ëã" />  | 
| def ConditionType_Item_Isbind_Count(curPlayer, curMission, curConditionNode):  | 
| #    <Item_Isbind_Count id="" value="" isbind=""/> 0£ºÃ»°ó¶¨  1£º°ó¶¨  | 
|     itemID = GameWorld.ToIntDef(curConditionNode.GetAttribute("id"))  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"))  | 
|     isBind = GameWorld.ToIntDef(curConditionNode.GetAttribute("isbind"))  | 
|   | 
|     curPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)  | 
|     findItemCount = 0  | 
|     for i in range(0, curPack.GetCount()):  | 
|         item = curPack.GetAt(i)  | 
|           | 
|         if not ItemCommon.CheckItemCanUse(item):  | 
|             continue  | 
|           | 
|         if item.GetItemTypeID() != itemID:  | 
|             continue  | 
|           | 
|         #ÐèÒª²éÕҷǰó¶¨ÎïÆ·£¬²éÕÒÎïÆ·ºÍËùÐèÎïÆ·°ó¶¨ÊôÐÔÏàͬ  | 
|         if isBind == 0 and item.GetIsBind() != isBind:  | 
|             continue  | 
|           | 
|         #ÀÛ»ý²éÕÒÎïÆ·ÊýÁ¿  | 
|         findItemCount += item.GetCount()  | 
|         if findItemCount >= conditionValue:  | 
|             #ÊýÁ¿Âú×ã·µ»Ø  | 
|             #GameWorld.Log("²éÕҳɹ¦£¬ÐèÒªÊýÁ¿£º%s£¬ÕÒµ½ÊýÁ¿£º%s"%(conditionValue,findItemCount))  | 
|             return True  | 
|           | 
|     return  | 
| #---------------------------------------------------------------------  | 
| ##ɾ³ýÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Del_Item_Bind id="ÎïÆ·ID" value="ÑéÖ¤ÊýÁ¿" isBind="ÊÇ·ñËã°ó¶¨µÄÎïÆ· 0:²»Ëã,1:Ëã" />  | 
| def DoType_Del_Item_Bind(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<Del_Item_Bind value="1" id="50029" isbind=""/>0:²»°ó 1£º°ó  | 
|     itemID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"))  | 
|     conditionValue = GameWorld.ToIntDef(curActionNode.GetAttribute("value"))  | 
|     isBind = GameWorld.ToIntDef(curActionNode.GetAttribute("isbind"))  | 
|       | 
|     #PlayerControl.NotifyCode(curPlayer, "LostRes", [itemID,conditionValue])  | 
|     inputGuidList = []  | 
|     ItemControler.DelPlayerItem_Bind(curPlayer, IPY_GameWorld.rptItem, itemID, conditionValue, isBind, delEventItem=True, guidList=inputGuidList)  | 
|     guidStr = ''  | 
|     for guid in inputGuidList:  | 
|         guidStr += ' %s' % guid  | 
|     #31.        Òòʼþh³ý   Í¬ÉÏ  | 
|     if not curMission:  | 
|         missionID = 0  | 
|     else:  | 
|         missionID = curMission.GetMissionID()  | 
|   | 
|     #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         dataDict = {"ItemID":itemID, "ItemCount":conditionValue, "IsBind":isBind,  | 
|                     "MissionID":missionID}  | 
|         DataRecordPack.DR_DeleteItem(curPlayer, "Event_Del_Item_Bind", dataDict)  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¼ì²âÎïÆ·±³°üºÍ×°±¸À¸ÊÇ·ñÓдËÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| def ConditionType_Have_Item(curPlayer, curMission, curConditionNode):  | 
|     #<have_item id="" packtype="1,3" value="" type="" />  | 
|     itemID = GameWorld.ToIntDef(curConditionNode.GetAttribute("id"), 0)  | 
|     count = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|       | 
|     if itemID <= 0:  | 
|         GameWorld.ErrLog('ConditionType_Have_Item itemID = %s, error' % (itemID))  | 
|         return  | 
|   | 
|     packList = curConditionNode.GetAttribute("packtype").split(',')  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|       | 
|     #ÏȾÀ´íÒ»´Î  | 
|     tmpList = []  | 
|       | 
|     for typeStr in packList:  | 
|         packType = GameWorld.ToIntDef(typeStr, 0)  | 
|   | 
|         if packType <= 0 or packType >= ShareDefine.rptMax:  | 
|             GameWorld.ErrLog("ConditionType_Have_Item Ìîд±³°ü·¶Î§´íÎó %s" % packList)  | 
|             return  | 
|   | 
|         tmpList.append(packType)  | 
|       | 
|     value = 0  | 
|   | 
|     for packType in tmpList:  | 
|         value += ItemControler.FindPlayerItemCountByItemID(curPlayer, packType, itemID)  | 
|           | 
|     return QuestRunnerValue.GetEval(conditionType, value, count)  | 
| #---------------------------------------------------------------------  | 
| ##¼ì²âÊÇ·ñÓµÓÐïÚ³µÑº½ð  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Truck_Money value="ÆÚÍû½á¹û" />  | 
| def ConditionType_Have_Truck_Money(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<have_truck_money value=""/>  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     truck_money = int(curMission.GetProperty("day_event_truck_money"))  | 
|     result = PlayerControl.HaveMoney(curPlayer, curPlayer.GetUseSilverType(), truck_money)  | 
|     return conditionValue == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¼ì²âHP°Ù·Ö±È(°Ù·Ö±È)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Get_Hp_Percent value="ÊýÖµ(°Ù·Ö±È)" type="ÆÚÍû½á¹û" />  | 
| def ConditionType_Get_Hp_Percent(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     curPlayerHP = curPlayer.GetHP()  | 
|     conditionHP = curPlayer.GetMaxHP() * conditionValue / 100  | 
|       | 
|       | 
|     return QuestRunnerValue.GetEval(conditionType, curPlayerHP, conditionHP)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸ù¾ÝIDÉ±Ëæ»ú¹Ö  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Kill_Rand_Npc_By_Id name="ÈÎÎñ×ÖµäÃû,ɱ¹ÖÃû" value="ÈÎÎñ×ÖµäÃû,ɱ¹ÖÊý" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Kill_Rand_Npc_By_Id(curPlayer, curMission, curConditionNode):  | 
|     #<kill_rand_npc_by_id name = "1" value = "30"  | 
|     name = curConditionNode.GetAttribute("name")  | 
|     value = curConditionNode.GetAttribute("value")  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     #GameWorld.Log("name = %s, kill_id_count = %s"%(name,value))  | 
|     #GameWorld.Log("Propertyname:%s"%(name))  | 
|     kill_id_count = curMission.GetProperty(value)  | 
|     kill_id_name = curMission.GetProperty(name)  | 
|     #GameWorld.Log("curMissionID = %d"%(curMission.GetMissionID()))  | 
|     #GameWorld.Log("Propertykill_id_counts:%d"%(kill_id_count))  | 
|     return QuestRunnerValue.GetEval(conditionType, kill_id_name, kill_id_count)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓµÓÐÎäÆ÷  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Weapon value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Have_Weapon(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     PlayerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)  | 
|     curWeapon = PlayerEquip.GetAt(ShareDefine.retWeapon)  | 
|     curWeapon2 = PlayerEquip.GetAt(ShareDefine.retWeapon2)  | 
|     result = not (curWeapon.IsEmpty() and curWeapon2.IsEmpty())  | 
|     #GameWorld.Log('conditionValue = %s, result = %s'%(conditionValue, result))  | 
|     return QuestRunnerValue.GetEval(conditionType, result, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÎåÐÐÊôÐÔÅж¨  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Player_Type value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Player_Type(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     value = curPlayer.GetPlayerType()  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##µÈ¼¶´¥·¢Åж¨  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Lv value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Lv(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     value = curPlayer.GetLV()  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)  | 
|   | 
| def ConditionType_Createroledays(curPlayer, curMission, curConditionNode):  | 
|     #ÅжÏÍæ¼Ò´´½ÇÌì  | 
|     #<Createroledays value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     value = GameWorld.GetCreateRoleDays(curPlayer)  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÉíÉÏÊÇ·ñÓÐijÖÖÀàÐÍÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Job_Mission value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö" missiontype="ÈÎÎñÀàÐÍ"/>  | 
| def ConditionType_Have_Job_Mission(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<have_job_mission value="" type="" missiontype="">  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     type = int(curConditionNode.GetAttribute("missiontype"))  | 
|     for i in range(0, curPlayer.GetMissionCount()):  | 
|         curMission = curPlayer.GetMissionByIndex(i)  | 
|         taskID = curMission.GetMissionID()  | 
|         if FindQuestFunc(taskID) == None:  | 
|             continue  | 
|         taskType = FindQuestFunc(taskID).Type  | 
|         if taskType == type:  | 
|             value = 1  | 
|         else:  | 
|             value = 0  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Íæ¼ÒÊÇ·ñÔÚÖ¸¶¨µÄµØÍ¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Map_Id value="µ¥µØÍ¼ÆÚÍûÖµ" maplist="¶àµØÍ¼Áбí" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Map_Id(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ:<map_id type = "Equal" value = "505"/>  | 
|     value = curPlayer.GetMapID()  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     mapList = curConditionNode.GetAttribute("maplist")  | 
|     #µ¥Ò»µØÍ¼  | 
|     if conditionValue != 0:  | 
|         return QuestRunnerValue.GetEval(conditionType, value, conditionValue)                                               | 
|     #¶àµØÍ¼  | 
|     mapList = mapList.split(',')  | 
|     for map in mapList:  | 
|         if value == int(map):  | 
|             return True  | 
|          | 
|     return False       | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Íæ¼ÒÊÇ·ñÓµÓÐ×ã¹»»õ±Ò  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Money value="ÆÚÍûÖµ" check="²éÕÒ¶Ô»°ÖеĻõ±Ò" moneytype="»õ±ÒÀàÐÍ 1Ôª±¦2Àñȯ3ÒøÁ½" type="__Eval+Ìæ»»µÄÃû×Ö" maxItem="ÐèÒªÎïÆ·ÊýÁ¿" itemID="20410"/>  | 
| def ConditionType_Have_Money(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<have_money value="" type="" moneytype=""/>  | 
|     value = curConditionNode.GetAttribute("value")  | 
|     check = curConditionNode.GetAttribute("check")  | 
|     if value != "":  | 
|         conditionValue = int(value)  | 
|     elif check != "":  | 
|         conditionValue = int(QuestRunnerValue.GetNPCTalkReplaceValue(curPlayer, curMission, check))  | 
|       | 
|     maxItemCnt = GameWorld.ToIntDef(curConditionNode.GetAttribute("maxItem"), 0)  | 
|     itemID = GameWorld.ToIntDef(curConditionNode.GetAttribute("itemID"), 0)  | 
|     if maxItemCnt and itemID: #δÊÕ¼¯µÄµÀ¾ß¸öÊý³ËÒÔµ¥¼Û  | 
|         haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)  | 
|         conditionValue = max(0, maxItemCnt-haveCnt)*conditionValue  | 
|           | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     moneyType = int(curConditionNode.GetAttribute("moneytype"))  | 
|       | 
|     #GameWorld.Log('    conditionValue=%s,maxItemCnt=%s,itemID=%s'%(conditionValue,maxItemCnt,itemID))  | 
|       | 
|     goldValue = curPlayer.GetGold()  | 
|     goldPaperValue = curPlayer.GetGoldPaper()  | 
|     silverValue = PlayerControl.GetSilver(curPlayer)  | 
|       | 
|     if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:  | 
|         return QuestRunnerValue.GetEval(conditionType, goldValue, conditionValue)  | 
|     elif moneyType == IPY_GameWorld.TYPE_Price_Gold_Paper:  | 
|         return QuestRunnerValue.GetEval(conditionType, goldPaperValue, conditionValue)  | 
|     elif moneyType == IPY_GameWorld.TYPE_Price_Silver_Money:  | 
|         return QuestRunnerValue.GetEval(conditionType, silverValue, conditionValue)  | 
|     elif moneyType == ShareDefine.TYPE_Price_Gold_Paper_Money:  | 
|         return QuestRunnerValue.GetEval(conditionType, goldValue + goldPaperValue, conditionValue)  | 
|     else:  | 
|         GameWorld.Log("ÈÎÎñ = %s , moneytype = %sÌî´íÀ" % (curMission.GetMissionID() , moneyType) , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Íæ¼ÒÊÇ·ñÓµÓÐÉèÖÃÐǼ¶µÄ»õ±Ò  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Set_Mission_Star_Have_Money />      | 
| def ConditionType_Set_Mission_Star_Have_Money(curPlayer, curMission, curConditionNode):  | 
|     missionID = curMission.GetMissionID()  | 
|     curMissionData = FindQuestFunc(missionID)  | 
|     if not curMissionData:  | 
|         return False  | 
|     missionType = curMissionData.Type  | 
|     Def_Around_Star = GetRunKey(missionType, Key_Around_Star)  | 
|       | 
|     moneyType, costFormat = ReadChConfig.GetEvalChConfig("RunAround_SetStarCost")  | 
|     reLV = curPlayer.GetLV()  | 
|     reExp = 0  | 
|     reMoney = 0  | 
|     aroundStar = curMission.GetProperty(Def_Around_Star)  | 
|     moneyPrice = int(eval(costFormat))  | 
|       | 
|     if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:  | 
|         return curPlayer.GetGold() >= moneyPrice  | 
|       | 
|     if moneyType == IPY_GameWorld.TYPE_Price_Gold_Paper:  | 
|         return curPlayer.GetGoldPaper() >= moneyPrice  | 
|   | 
|     if moneyType == IPY_GameWorld.TYPE_Price_Silver_Money:  | 
|         return PlayerControl.GetSilver(curPlayer) >= moneyPrice  | 
|   | 
|     if moneyType == IPY_GameWorld.TYPE_Price_Silver_Paper:  | 
|         return curPlayer.GetSilverPaper() >= moneyPrice  | 
|       | 
|     return False  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Çå³ýÐéÈõÐèÒª»õ±Ò  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Clearbornbuff_Have_Money/>     | 
| def ConditionType_Clearbornbuff_Have_Money(curPlayer, curMission, curConditionNode):  | 
|     return 0  | 
|   | 
| ##ŵØÒ½ÉúÅжϽðÇ®  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Health_Have_Money moneytype="½ðÇ®ÀàÐÍ" />     | 
| def ConditionType_Health_Have_Money(curPlayer, curMission, curConditionNode):  | 
|     moneyType = int(curConditionNode.GetAttribute("moneytype"))  | 
|       | 
|     price = QuestRunnerValue.GetHealthLostMoney(curPlayer)  | 
|       | 
|     return PlayerControl.HaveMoney(curPlayer, moneyType, price, False)  | 
|       | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊÇÆÚÍûµÄÖ°Òµ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Check_Job value="ÆÚÍûÖµ" type="Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Check_Job(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     value = curPlayer.GetJob()  | 
|     return QuestRunnerValue.GetEval(conditionType, value, conditionValue)   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊÇÆÚÍûµÄ»Ø´ð  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Answer value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Answer(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = curConditionNode.GetAttribute("value")  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     answer = CurrentPlayerAnswer  | 
|     answer = answer.lower()  | 
|     conditionValue = conditionValue.lower()  | 
|     return QuestRunnerValue.GetEval(conditionType, answer, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊÇÆÚÍûµÄæô³µÊ¼þID  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Truck_Event_Id id="ÆÚÍûÖµ"/>  | 
| def ConditionType_Truck_Event_Id(curPlayer, curMission, curConditionNode):  | 
|     id = int(curConditionNode.GetAttribute("id"))  | 
|     if curPlayer.GetTruckEventID() == id:  | 
|         return True  | 
|       | 
|     return False  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÉíÉÏÓÐÆÚÍûµÄÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Find_Mission id="ÈÎÎñID" result="ÆÚÍûÖµ"/>  | 
| def ConditionType_Find_Mission(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<find_mission id = "" result = ""/>  | 
|     conditionID = GameWorld.ToIntDef(curConditionNode.GetAttribute("id"), 0)  | 
|       | 
|     if conditionID == 0:  | 
|         return False  | 
|     curMission = curPlayer.FindMission(conditionID)  | 
|     curResult = 0  | 
|     conditionResult = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     if curMission == None:  | 
|         curResult = 0  | 
|         return curResult == conditionResult  | 
|   | 
|     curResult = 1  | 
|     return curResult == conditionResult  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓÐÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Mission id="ÈÎÎñID" result="ÆÚÍûÖµ"/>  | 
| def ConditionType_Have_Mission(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<have_mission id = "" result = ""/>  | 
|     conditionID = GameWorld.ToIntDef(curConditionNode.GetAttribute("id"), 0)  | 
|       | 
|     if conditionID == 0:  | 
|         #ÅжÏËùÓÐÈÎÎñ  | 
|         for i in range(0, curPlayer.GetMissionCount()):  | 
|             curMission = curPlayer.GetMissionByIndex(i)  | 
|             if not (curMission == None or curMission.GetState() == ChConfig.Def_Mission_State_Over):  | 
|                 return False  | 
|         return True  | 
|     curMission = curPlayer.FindMission(conditionID)  | 
|     curResult = 0  | 
|     conditionResult = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     if curMission == None:  | 
|         curResult = 0  | 
|         return curResult == conditionResult  | 
|       | 
|     curState = curMission.GetState()  | 
|     if curState in [ChConfig.Def_Mission_State_NoAccept, ChConfig.Def_Mission_State_Over]:  | 
|         curResult = 0  | 
|         return curResult == conditionResult  | 
|       | 
|     curResult = 1  | 
|     return curResult == conditionResult  | 
|   | 
| #---------------------------------------------------------------------  | 
|   | 
| ##ÅжÏÊÇ·ñÓÐÆ¥ÅäÌõ¼þµÄÈÎÎñÀàÐÍ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Have_Mission_Type value="ÆÚÍûÖµ" missiontype="ÈÎÎñÀàÐÍ" state="Æ¥ÅäÈÎÎñ״̬ÁÐ±í¶ººÅ¸ô¿ª" nostate="²»Æ¥ÅäµÄÈÎÎñ״̬ÁÐ±í¶ººÅ¸ô¿ª"/>  | 
| def ConditionType_Have_Mission_Type(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"))  | 
|     missiontype = GameWorld.ToIntDef(curConditionNode.GetAttribute("missiontype"))  | 
|     stateList = eval("[%s]" % curConditionNode.GetAttribute("state"))  | 
|     nostateList = eval("[%s]" % curConditionNode.GetAttribute("nostate"))  | 
|   | 
|     GameWorld.DebugLog("Have_Mission_Type conditionValue=%s,missiontype=%s,stateList=%s,nostateList=%s"   | 
|                        % (conditionValue, missiontype, stateList, nostateList))  | 
|       | 
|     haveCondMission = 0  | 
|     for i in range(curPlayer.GetMissionCount()):  | 
|         mission = curPlayer.GetMissionByIndex(i)  | 
|         taskID = mission.GetMissionID()  | 
|         curMissionData = FindQuestFunc(taskID)  | 
|         if not curMissionData:  | 
|             GameWorld.DebugLog("    taskID=%s is None!" % taskID)  | 
|             continue  | 
|           | 
|         taskType = curMissionData.Type  | 
|         if taskType != missiontype:  | 
|             GameWorld.DebugLog("    taskID=%s,taskType(%s) != missiontype(%s)" % (taskID, taskType, missiontype))  | 
|             continue  | 
|           | 
|         missionState = mission.GetState()  | 
|         if stateList and missionState not in stateList:  | 
|             GameWorld.DebugLog("    taskID=%s,missionState=%s not in stateList=%s" % (taskID, missionState, stateList))  | 
|             continue  | 
|           | 
|         if nostateList and missionState in nostateList:  | 
|             GameWorld.DebugLog("    taskID=%s,missionState=%s in nostateList=%s" % (taskID, missionState, nostateList))  | 
|             continue  | 
|           | 
|         haveCondMission = 1  | 
|         GameWorld.DebugLog("    taskID=%s,taskType=%s,missionState=%s OK!" % (taskID, taskType, missionState))  | 
|         break  | 
|       | 
|     GameWorld.DebugLog("    haveCondMission=%s" % (haveCondMission))  | 
|     return haveCondMission == conditionValue  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##µ±Ç°ÈÎÎñ²½ÖèÊÇ·ñ¿ÉÒÔɾ³ýÈÎÎñÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Can_Del_Mission_Item result="ÆÚÍûÖµ"/>  | 
| def ConditionType_Can_Del_Mission_Item(curPlayer, curMission, curConditionNode):  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)      | 
|     #ÅжÏËùÓÐÈÎÎñ  | 
|     for i in range(0, curPlayer.GetMissionCount()):  | 
|         curMission = curPlayer.GetMissionByIndex(i)  | 
|         if curMission == None:  | 
|             continue  | 
|         if curMission.GetState() > 0:  | 
|             return False == result  | 
|           | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓжÓÎé  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <have_team/>  | 
| def ConditionType_Have_Team(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<have_team/>  | 
|     curPlayerTeam = curPlayer.GetTeam()  | 
|     if curPlayerTeam == None:  | 
|         return True  | 
|       | 
|     return False  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñ¿ÉÒÔ¿ªÊ¼ÀïÚÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Can_Start_Truck value="ÆÚÍûÖµ"/>  | 
| def ConditionType_Can_Start_Truck(curPlayer, curMission, curConditionNode):  | 
|     #<can_start_truck value="1"/>   0:²»¿É½Ó     1£º¿É½Ó      | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|       | 
|     if PlayerTruck.PlayerInMapHaveTruck(curPlayer):  | 
|         #Íæ¼ÒÔÚµØÍ¼ÖÐÓÐæô³µ  | 
|         return conditionValue == 0  | 
|       | 
|     truckState = curPlayer.GetTruckState()  | 
|     #ïÚ³µÎ´½ÓºÍ¶ªÊ§¶¼¿É½Ó  | 
|     if truckState == IPY_GameWorld.tusNull or truckState == IPY_GameWorld.tusDisappear:  | 
|         return conditionValue == 1  | 
|   | 
|     return conditionValue == 0  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊÇÆÚÍûµÄæô³µ×´Ì¬  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Truck_State value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Truck_State(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|       | 
|     return QuestRunnerValue.GetEval(conditionType, curPlayer.GetTruckState(), conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñ¶ÓÔ±±ØÐëÔÚͬһµØÍ¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Team_State result="ÆÚÍûÖµ"/>  | 
| def ConditionType_Team_State(curPlayer, curMission, curConditionNode):  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     curPlayerTeam = curPlayer.GetTeam()  | 
|     if curPlayerTeam == None:  | 
|         return False == result  | 
|     #¶ÓÎéû³¬¹ý2ÈË£¨¶ÓÎéÈËÊýÅжÏÊǶ¼ÔÚͬһµØÍ¼£©  | 
|     if curPlayerTeam.GetMemberCount() < 2:  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓÐ×é¶Ó  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Is_Team_State value="ÆÚÍûÖµ" type="__Eval+Ìæ»»µÄÃû×Ö"/>  | 
| def ConditionType_Is_Team_State(curPlayer, curMission, curConditionNode):  | 
|     #<is_team_state type="" value=""/>  | 
|     conditionValue = int(curConditionNode.GetAttribute("value"))  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     return QuestRunnerValue.GetEval(conditionType, curPlayer.GetTeamID(), conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓÐïÚ³µÔÚ¸½¼þ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Truck_Near/>  | 
| def ConditionType_Truck_Near(curPlayer, curMission, curConditionNode):  | 
|     curTruck = curPlayer.GetTruck()  | 
|     if curTruck == None:  | 
|         return False  | 
|       | 
|     #»ñµÃÍæ¼ÒºÍïÚ³µ¼äµÄ¾àÀë  | 
|     dist = GameWorld.GetDist(curTruck.GetPosX(), curTruck.GetPosY(),  | 
|                              curPlayer.GetPosX(), curPlayer.GetPosY())  | 
|     #ïÚ³µÍ£Ö¹  | 
|     if dist > ChConfig.Def_PlayerTruckEventDist:  | 
|         return False  | 
|       | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÎïÆ·±³°üÖÐÊÇ·ñÓÐÁбíÎïÆ·ÖеÄÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Have_Item_List id="ÎïÆ·Çåµ¥50044/50045...50052 "/>  | 
| def ConditionType_Have_Item_List(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<have_item_List id="50044/50045...50052"/>  | 
|     ItemID = curConditionNode.GetAttribute("id")  | 
|       | 
|     #»ñµÃÎïÆ·ÁÐ±í  | 
|     ItemIDList = ItemID.split("/")  | 
|     #»ñµÃÍæ¼Ò±³°üÎïÆ·  | 
|     PlayerItem = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)  | 
|     #±éÀúÎïÆ·ÁÐ±í  | 
|     for i in range(0, len(ItemIDList)):  | 
|         haveItemID = int(ItemIDList[i])  | 
|         #±éÀúÍæ¼Ò±³°ü  | 
|         for j in range(0, PlayerItem.GetCount()):  | 
|             curItem = PlayerItem.GetAt(j)  | 
|             curItemID = curItem.GetItemTypeID()  | 
|             if haveItemID != curItemID :  | 
|                 continue  | 
|             else:  | 
|                 return True  | 
|     return False  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##²Ö¿âÖÐÊÇ·ñÓÐÆÚÍûµÄÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Warehouse_Have_Item id="ÎïÆ·ID" result="ÆÚÍûµÄ½á¹û" />     | 
| def ConditionType_Warehouse_Have_Item(curPlayer, curMission, curConditionNode):  | 
|     #¸ñʽ<warehouse_have_item id="" result="">  | 
|     itemID = int(curConditionNode.GetAttribute("id"))  | 
|     result = int(curConditionNode.GetAttribute("result"))  | 
|     #»ñµÃ²Ö¿â±³°ü  | 
|     rolePack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptWarehouse)  | 
|     #»ñµÃµÚÒ»¸ñÎïÆ·  | 
|     item = rolePack.GetAt(0)  | 
|     if not ItemCommon.CheckItemCanUse(item):  | 
|         return False == result  | 
|       | 
|     if item.GetItemTypeID() != itemID :  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊǼÒ×峤  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Family_Leader result="ÆÚÍûµÄ½á¹û" />   | 
| def ConditionType_Family_Leader(curPlayer, curMission, curConditionNode):  | 
|     #<Family_Leader result=""/> result:0²»ÊÇ×峤£¬1ÊÇ£¨Ä¬ÈÏ1£©  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 1)  | 
|     memberLV = curPlayer.GetFamilyMemberLV()  | 
|   | 
|     if memberLV != IPY_GameWorld.fmlLeader:  | 
|         return 0 == result  | 
|       | 
|     return 1 == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊÇÔÚÆÚÍûµÄʱ¼ä¶ÎÄÚ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Time startYear="Æðµã:Äê" startMonth="Æðµã:ÔÂ" startDay="Æðµã:Ìì" startHour="Æðµã:Сʱ" overYear="ÖÕµã:Äê" overMonth="ÖÕµã:ÔÂ" overDay=="ÖÕµã:Ìì" overHour="ÖÕµã:Сʱ"/>   | 
| def ConditionType_Time(curPlayer, curMission, curConditionNode):  | 
| #<time startYear="2009" startMonth="1" startDay="20" startHour="23" overYear="2009" overMonth="2" overDay="5" overHour="24"/>      | 
|     curTime = GameWorld.GetCurrentTime()  | 
|   | 
|     #¿ªÊ¼Ê±¼ä  | 
|     startY = GameWorld.ToIntDef(curConditionNode.GetAttribute("startYear"), 0)  | 
|     startM = GameWorld.ToIntDef(curConditionNode.GetAttribute("startMonth"), 0)  | 
|     startD = GameWorld.ToIntDef(curConditionNode.GetAttribute("startDay"), 0)  | 
|     startH = GameWorld.ToIntDef(curConditionNode.GetAttribute("startHour"), 0)  | 
|     #½áÊøÊ±¼ä  | 
|     overY = GameWorld.ToIntDef(curConditionNode.GetAttribute("overYear"), 0)  | 
|     overM = GameWorld.ToIntDef(curConditionNode.GetAttribute("overMonth"), 0)  | 
|     overD = GameWorld.ToIntDef(curConditionNode.GetAttribute("overDay"), 0)  | 
|     overH = GameWorld.ToIntDef(curConditionNode.GetAttribute("overHour"), 0)  | 
|       | 
|     startTime = GameWorld.GetDateTimeByStr('%s-%s-%s %s:%s:%s' % (startY, startM, startD, startH, 0, 0))  | 
|     overTime = GameWorld.GetDateTimeByStr('%s-%s-%s %s:%s:%s' % (overY, overM, overD, overH, 0, 0))  | 
|       | 
|       | 
|     if startTime == None or overTime == None:  | 
|         return False  | 
|       | 
|     return startTime <= curTime < overTime  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊÇÔÚÆÚÍûµÄСʱÄÚ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Hour startH="Æðµã:Сʱ" ÖÕµã:Сʱ" />   | 
| def ConditionType_Hour(curPlayer, curMission, curConditionNode):  | 
|     curTime = GameWorld.GetCurrentTime()  | 
|     startH = GameWorld.ToIntDef(curConditionNode.GetAttribute("startH"), 0)  | 
|     overH = GameWorld.ToIntDef(curConditionNode.GetAttribute("overH"), 0)  | 
|     curHour = curTime.hour  | 
|       | 
|     return startH <= curHour <= overH  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÊÇÔÚÆÚÍûµÄ·ÖÖÓÄÚ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Hour startH="Æðµã:Сʱ" ÖÕµã:Сʱ" />   | 
| def ConditionType_Minute(curPlayer, curMission, curConditionNode):  | 
|     curTime = GameWorld.GetCurrentTime()  | 
|     startM = GameWorld.ToIntDef(curConditionNode.GetAttribute("startM"), 0)  | 
|     overM = GameWorld.ToIntDef(curConditionNode.GetAttribute("overM"), 0)  | 
|     curMinute = curTime.minute  | 
|       | 
|     return startM <= curMinute <= overM  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¾º¼¼³¡»î¶¯ÊÇ·ñ¿ªÆô  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Check_Vsroomisbegin result="ÆÚÍûÖµ"/>   | 
| def ConditionType_Check_Vsroomisbegin(curPlayer, curMission, curConditionNode):  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö¸¶¨ÈÎÎñÀàÐ͸öÊýÊÇ·ñ´ïµ½Ö¸¶¨Êý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Hour startH="Æðµã:Сʱ" ÖÕµã:Сʱ" />   | 
| def ConditionType_Check_Missionsum_Bytype(curPlayer, curMission, curConditionNode):  | 
|     missionType = GameWorld.ToIntDef(curConditionNode.GetAttribute("mission_type"), 0)  | 
|     maxSum = GameWorld.ToIntDef(curConditionNode.GetAttribute("max_sum"), 0)  | 
|       | 
|     curMissionSum = 0  | 
|     for i in range(curPlayer.GetMissionCount()):  | 
|         newMission = curPlayer.GetMissionByIndex(i)  | 
|         if newMission == None or newMission.GetState() in [ChConfig.Def_Mission_State_Over]:  | 
|             continue  | 
|           | 
|         curTrigMission = FindQuestFunc(newMission.GetMissionID())  | 
|         if curTrigMission == None or curTrigMission.Type != missionType:  | 
|             continue  | 
|           | 
|         curMissionSum += 1  | 
|           | 
|     if curMissionSum < maxSum:  | 
|         return True  | 
|       | 
|     return False  | 
|   | 
| ##×øÆïÊÇ·ñ´ïµ½¶àÉÙ½×  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Check_HorseClasslv type="ÀàÐÍ" value="Öµ"/>   | 
| def ConditionType_Check_Horseclasslv(curPlayer, curMission, curConditionNode):  | 
|     return False  | 
| #    conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
| #    conditionType = curConditionNode.GetAttribute("type")  | 
| #    curHorseClassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV,  | 
| #                                                 0, ChConfig.Def_PDictType_Horse)  | 
| #      | 
| #    return QuestRunnerValue.GetEval(conditionType,curHorseClassLV,conditionValue)  | 
|   | 
| ##×øÆïÊÇ·ñ´ïµ½¶àÉÙ½×¶àÉÙÐÇ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Check_Horselv type="ÀàÐÍ" classlv="½×¼¶" star="ÐǼ¶"/>   | 
| def ConditionType_Check_Horselv(curPlayer, curMission, curConditionNode):  | 
|     return False  | 
|   | 
| ##ÉíÉÏ´©Á˶àÉÙ¼þ³È×°  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <QualityEquipCnt quality="×°±¸Æ·ÖÊ" value="ÆÚÍûÊýÁ¿"/>   | 
| def ConditionType_Qualityequipcnt(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     quality = GameWorld.ToIntDef(curConditionNode.GetAttribute("quality"), 0)  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     curQualityEquipCnt = 0 #´ïµ½¸ÃÆ·ÖʵÄ×°±¸ÊýÁ¿£¬Æ·ÖʸߵļæÈÝÆ·ÖÊµÍµÄ  | 
|     equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)  | 
|     for equipIndex in range(0, equipPack.GetCount()):  | 
|         #±¸ÓÃ×°±¸À¸²»´¦Àí  | 
|         if equipIndex not in ChConfig.Type_Equip_CanTake :  | 
|             continue  | 
|         curEquip = equipPack.GetAt(equipIndex)  | 
|         if curEquip.IsEmpty():  | 
|             continue  | 
|         if curEquip.GetItemQuality() < quality:  | 
|             continue  | 
|         curQualityEquipCnt += 1  | 
|       | 
|     return QuestRunnerValue.GetEval(conditionType, curQualityEquipCnt, conditionValue)  | 
|   | 
| ##Ç¿»¯ X¼þ×°±¸Ç¿»¯µ½X¼¶  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Check_Equippartstar star="×ÜÐǼ¶" type="ÀàÐÍ"/>   | 
| def ConditionType_Check_Equippartstar(curPlayer, curMission, curConditionNode):  | 
|     #conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     star = GameWorld.ToIntDef(curConditionNode.GetAttribute("star"))  | 
|       | 
|     totalPlusLV = 0  | 
|     for packType, equipPartIndexList in ChConfig.Pack_EquipPart_CanPlusStar.items():  | 
|         for i in equipPartIndexList:  | 
|             partStarLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, i)  | 
|             totalPlusLV += partStarLV  | 
|       | 
|       | 
|       | 
|     #key = curConditionNode.GetAttribute("key") #µ±Ç°´ïµ½Ìõ¼þµÄ¼þÊýkey  | 
|       | 
| #    partCnt = 0 #Âú×ãÌõ¼þµÄ¼þÊý  | 
| #    equipPartIndexList = ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, [])  | 
| #    for i in equipPartIndexList:  | 
| #        #ͳ¼ÆÈ«ÉíÇ¿»¯µÈ¼¶  | 
| #        partStarLV = ChEquip.GetEquipPartStarLV(curPlayer, IPY_GameWorld.rptEquip, i)  | 
| #        if partStarLV >= star:  | 
| #            partCnt +=1   | 
|     #GameWorld.Log('star=%s,conditionValue=%s,partCnt=%s,%s'%(star,conditionValue,partCnt,QuestRunnerValue.GetEval(conditionType, partCnt, conditionValue)))  | 
|     #curMission.SetProperty(key, partCnt)  | 
|     return QuestRunnerValue.GetEval(conditionType, totalPlusLV, star)  | 
|   | 
| ##¾ôλ´ïµ½ÁËX½×XÐÇ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Check_Officiallv type="ÀàÐÍ" classlv="½×¼¶ star="ÐǼ¶"/>   | 
| def ConditionType_Check_Officiallv(curPlayer, curMission, curConditionNode):  | 
|     return  | 
|   | 
| ##ͨ¹ØÊÔÁ¶Ö®ËþµÚX²ã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Check_Trialtower type="ÀàÐÍ" value="Öµ"/>   | 
| def ConditionType_Check_Trialtower(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     maxPassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV) # ÀúÊ·×î´ó¹ý¹ØÊý  | 
|     return QuestRunnerValue.GetEval(conditionType, maxPassLV, conditionValue)  | 
|   | 
| def ConditionType_Get_Player_Coin(curPlayer, curMission, curConditionNode):  | 
|     # ÅжÏÍæ¼ÒÒѳäÖµµãȯÊý  | 
|     # <Get_Player_Coin type="great" value="0"/> ³äÖµµãȯ´óÓÚ0´ú±íÒѾÊ׳ä¹ý  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     coinPointTotal = curPlayer.GetChangeCoinPointTotal()  | 
|     return QuestRunnerValue.GetEval(conditionType, coinPointTotal, conditionValue)  | 
|   | 
|   | 
| def ConditionType_Is_Activate_Pet(curPlayer, curMission, curConditionNode):  | 
|     # ÅжϳèÎïÊÇ·ñ¼¤»î  | 
|     # <Is_Activate_Pet petID="0"/> petIDΪ0ʱ´ú±íÈÎÒâ³èÎï, ¾ßÌå³èÎïIDΪָ¶¨³èÎï  | 
|     checkPetID = GameWorld.ToIntDef(curConditionNode.GetAttribute("petID"), 0)  | 
|     if not checkPetID:  | 
|         petPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptPet)  | 
|         if not petPack:  | 
|             return False  | 
|         return petPack.GetCount() > 0  | 
|     return PlayerPet.GetPetDataItemByNPCID(curPlayer, checkPetID) != None  | 
|   | 
| def ConditionType_Is_Buy_Tehuiitem(curPlayer, curMission, curConditionNode):  | 
|     # ÅжÏÊÇ·ñ¹ºÂò¹ýÌØ»ÝÉ̵êÎïÆ·  | 
|     # <Is_Buy_Tehuiitem shopID="1007" itemShopIndex="0,1,2"/> shopIDÔݶ¨ÐèÖ¸¶¨É̵êID, itemShopIndex¿ÉÖ¸¶¨¶à¸öË÷Òý, ÖмäÓ¢ÎĶººÅ¸ô¿ª  | 
|     shopID = GameWorld.ToIntDef(curConditionNode.GetAttribute("shopID"), 0)  | 
|     if not shopID:  | 
|         return False  | 
|     indexList = []  | 
|     indexInfo = curConditionNode.GetAttribute("itemShopIndex")  | 
|     if indexInfo != '':  | 
|         indexList = eval('[' + indexInfo + ']')  | 
|     if not indexList:  | 
|         shopItemList = ShopItemManage.GetShopItemList(shopID)  | 
|         indexList = range(len(shopItemList))  | 
|     if not indexList:  | 
|         GameWorld.DebugLog("ÐèÖ¸¶¨ÅжϵÄÌØ»ÝÉ̵êÎïÆ·Ë÷Òý±àºÅ!indexInfo=%s" % indexInfo)  | 
|         return False  | 
|     for i in indexList:  | 
|         buyCnt = ShopItemManage.__GetPlayerShopItemBuyCnt(curPlayer, shopID, i)  | 
|         if buyCnt > 0:  | 
|             return True  | 
|     return False  | 
|   | 
| ##¾º¼¼³¡ÊÇ·ñ´ïµ½¶àÉÙÃû  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Check_Jjcorder type="ÀàÐÍ" value="Öµ"/>   | 
| def ConditionType_Check_Jjcorder(curPlayer, curMission, curConditionNode):  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     maxOrder = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HighLadder_HistoryMaxOrder, 0,  | 
|                     ChConfig.Def_PDictType_Default)  | 
|       | 
|     return QuestRunnerValue.GetEval(conditionType, maxOrder, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐР¿Û³ýÍæ¼ÒïÚ³µÑº½ð  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks <Del_Truck_Money/>  | 
| def DoType_Del_Truck_Money(curPlayer, curMission, curActionNode):  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐР½«ÎïÆ··ÅÈë´òÔì±³°ü  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Composepack_Putin_Item id="ÎïÆ·ID" value="ÎïÆ·ÊýÁ¿" />   | 
| def DoType_Composepack_Putin_Item(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ£º<Composepack_Putin_Item id = "" value=""/>  | 
|       | 
|     itemID = int(curActionNode.GetAttribute("id"))  | 
|     itemCount = int(curActionNode.GetAttribute("value"))  | 
|       | 
|     #Éú³É×°±¸¶ÔÏó  | 
|     equipTag = ItemCommon.CreateSingleItem(itemID)  | 
|     if equipTag == None:  | 
|         #ÎÞ´ËÎïÆ·  | 
|         GameWorld.Log("´´ÔìÎïÆ·Ê§°Ü")  | 
|         return False  | 
|       | 
|     #ÉèÖ÷ÀÈëÎïÆ·ÊýÁ¿  | 
|     ItemControler.SetItemCount(equipTag, itemCount, curPlayer.GetPlayerID(), curPlayer.GetAccID(),  | 
|                                curPlayer.GetPlayerName())  | 
|     #×°±¸GUIID  | 
|     equipTagGUID = equipTag.GetGUID()  | 
|       | 
|     #½«ÎïÆ··ÅÈë½á¹û  | 
|     PlayerItemControler = ItemControler.PlayerItemControler(curPlayer)  | 
|     if not PlayerItemControler.PutInItem(IPY_GameWorld.rptCompose, equipTag):  | 
|         GameWorld.Log('###ÈÎÎñ = %s¸øÓèÎïÆ·Òì³£,%s,%s' % (curMission.GetMissionID() , itemID , itemCount) , curPlayer.GetPlayerID())  | 
|         equipTag.Clear()  | 
|         return  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐР½«ÎïÆ··ÅÈë²Ö¿â  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| # @remarks  <Warehouse_Putin_Item id="ÎïÆ·ID" value="ÎïÆ·ÊýÁ¿" />   | 
| def DoType_Warehouse_Putin_Item(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<warehouse_putin_item id="" value="">  | 
|     #»ñµÃ²Ö¿â±³°ü  | 
|     #rolePack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptWarehouse)  | 
|     #·ÅÈëÎïÆ·ÊýÁ¿  | 
|     putCount = int(curActionNode.GetAttribute("value"))  | 
|     #Éú³ÉÎïÆ·  | 
|     itemID = int(curActionNode.GetAttribute("id"))  | 
|     item = ItemCommon.CreateSingleItem(itemID)  | 
|     #ÉèÖ÷ÅÈëÊýÁ¿  | 
|     ItemControler.SetItemCount(item, putCount, curPlayer.GetPlayerID(), curPlayer.GetAccID(),  | 
|                                curPlayer.GetPlayerName())  | 
|     #ÎïÆ·GUID  | 
|     itemGUID = item.GetGUID()  | 
|     #½«ÎïÆ··ÅÖÃÍæ¼Ò±³°ü  | 
|     PlayerItemControler = ItemControler.PlayerItemControler(curPlayer)  | 
|     if not PlayerItemControler.PutInItem(IPY_GameWorld.rptWarehouse, item):  | 
|         GameWorld.Log('###ÈÎÎñ = %s¸øÓèÎïÆ·Òì³£,%s,%s' % (curMission.GetMissionID() , itemID , putCount) , curPlayer.GetPlayerID())  | 
|         item.Clear()  | 
|         return  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Åжϵ±Ç°µÄÌõ¼þ·ÖÖ§½ÚµãÊÇ·ñ¿ÉÒÔÔËÐÐ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÊý¾ÝÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks µ÷ÓàConditionType_  | 
| def AnswerConditionJudge(curPlayer, curMission, curConditionNode):  | 
|     funcName = curConditionNode.GetNodeName()  | 
|     funcName = "ConditionType_" + funcName.title()  | 
|   | 
|     if globals().has_key(funcName):  | 
|         result = globals()[funcName](curPlayer, curMission, curConditionNode)  | 
|         #GameWorld.Log("Call funcName = %s result = %s"%(funcName, result))  | 
|         return result  | 
|       | 
|     GameWorld.ErrLog("%s, noFind" % (funcName))  | 
|     return  | 
|   | 
| #==================================================================  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´Ðе±Ç°µÄ¶¯×÷  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Var name="½ÚµãÃû" value="Öµ" getvalue="Íæ¼Ò½Ó¿Ú" type='½ÚµãÀàÐÍ' id="ÈÎÎñID" id_name="ÈÎÎñID´æ´¢key"/>   | 
| #<Var name="mission_dict_key"  value="1" getvalue="LV" type='add' id="13" >  | 
| def DoType_Var(curPlayer, curMission, curActionNode):  | 
|     conditionName = curActionNode.GetAttribute("name")  | 
|       | 
|     #½«Íæ¼Òµ±Ç°Ö¸¶¨Öµ ¸³Öµ¸ø Íæ¼ÒÈÎÎñ×Öµä  | 
|     getValue = curActionNode.GetAttribute("getvalue")  | 
|     if hasattr(curPlayer, "Get%s" % getValue):  | 
|         value = getattr(curPlayer, "Get%s" % getValue)()  | 
|     else:  | 
|         value = curActionNode.GetAttribute("value")  | 
|       | 
|     conditionType = curActionNode.GetAttribute("type")  | 
|     questID = curActionNode.GetAttribute("id")  | 
|     idNameStr = curActionNode.GetAttribute("id_name")  | 
|       | 
|     if curMission and idNameStr != "":  | 
|         questID = GameWorld.ToIntDef(curMission.GetProperty(idNameStr), 0)  | 
|         if questID != 0:  | 
|             curMission = curPlayer.FindMission(questID)  | 
|             if curMission == None:  | 
|                 curMission = QuestCommon.AddNewMission(curPlayer, questID)  | 
|                   | 
|     if questID != "":  | 
|         #ÉèÖÃÈÎÎñID  | 
|         questID = int(questID)  | 
|         curMission = curPlayer.FindMission(questID)  | 
|         if curMission == None:  | 
|             #ÈÎÎñ²»´æÔÚ, ÐèÒªÌí¼ÓÈÎÎñ  | 
|             curMission = QuestCommon.AddNewMission(curPlayer, questID)  | 
|             #GameWorld.Log(str("ÒÑÌí¼ÓÈÎÎñ"))  | 
|               | 
|     QuestRunnerValue.SetValue(curPlayer, curMission, conditionType, conditionName, value)          | 
|   | 
| ##ÊäÈë×Ö·û´®  | 
| #def DealWithInPut(str, mark = '?'):  | 
| #    var=[]  | 
| #    r=re.compile(r"[\(][%s][^\(]*[%s][\)]"%(mark, mark))  | 
| #    strList=r.findall(str)  | 
| #    rs=re.compile(r"[^\(%s][^\(]*[^%s\)]"%(mark, mark))  | 
| #    for i in range(len(strList)):  | 
| #        curItem=rs.findall(strList[i])  | 
| #        var.extend(curItem)  | 
| #    return var  | 
| #  | 
| #def DealWithReverse(str,rstr, mark = '?'):  | 
| #    r=re.compile(r"[\(][%s][^\(]*[%s][\)]"%(mark, mark))  | 
| #    strList=r.findall(str)  | 
| #    replaceStr=str  | 
| #    for j in range(len(strList)):  | 
| #        if len(rstr)!=len(strList):  | 
| #            raise "Out Of Index Exception"  | 
| #        replaceStr=replaceStr.replace(strList[j],rstr[j])  | 
| #    return replaceStr      | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´Ðд«Ë͹㲥  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Notify code="ÌáʾµÄÏûÏ¢×Ö·û´®" />   | 
| def DoType_Notify(curPlayer, curMission, curActionNode):  | 
|     content = curActionNode.GetAttribute("code")  | 
|       | 
|     missionID = 0  | 
|     if curMission != None:  | 
|         missionID = curMission.GetMissionID()  | 
|           | 
|     curPlayer.Notify(missionID, content)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÿÈÕÈÎÎñNPCÃû×ÖÌæ»»  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Notify_Npc_Name code="Ìæ»»µÄÏûÏ¢×Ö·û´®" />   | 
| def DoType_Notify_Npc_Name(curPlayer, curMission, curActionNode):  | 
|     #<notify_npc_name content="ÒÑ»÷°ÜËùÓР(!NPCName!)" dict_id = "day_event_id"/>  | 
| #    dict_id = curActionNode.GetAttribute("dict_id")  | 
| #    NpcID = curMission.GetProperty(dict_id)  | 
|     content = curActionNode.GetAttribute("code")  | 
|       | 
|     missionID = 0  | 
|     if curMission != None:  | 
|         missionID = curMission.GetMissionID()  | 
|   | 
| #    #´ÓÊý¾ÝÖлñµÃµ±Ç°NPC  | 
| #    curNPC = GameWorld.GetGameData().FindNPCDataByID(int(NpcID))  | 
| #    Name = curNPC.GetName()  | 
| #    #Ìæ»»NPCÃû×Ö  | 
| #    parseList = DealWithInPut(content)  | 
| #    for i in range(0,len(parseList)):  | 
| #        if parseList[i] == "NPCName":  | 
| #            parseList[i] = Name  | 
| #    msg = DealWithReverse(content, parseList)  | 
|     curPlayer.Notify(missionID, content)  | 
|     curPlayer.NotifyMiddle(missionID, content)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##»ñµÃ¸ÃÎïÆ·¿É·ÅÈëµÄ±³°üË÷Òý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param itemID ÎïÆ·ID  | 
| # @param itemCount ÎïÆ·ÊýÁ¿  | 
| # @param bind °ó¶¨  | 
| # @param packList ±³°üË÷Òý  | 
| # @return ±³°üË÷Òý£¬-1±íʾûÓпɷŵı³°ü  | 
| def GetCanPutInPackIndex(curPlayer, itemID, itemCount, bind, packList):  | 
|     itemControl = ItemControler.PlayerItemControler(curPlayer)  | 
|     for index in packList:  | 
|         if not itemControl.CanPutInItem(index, itemID, itemCount, bind):  | 
|             continue  | 
|           | 
|         return index  | 
|       | 
|     return -1  | 
|   | 
| ##¸øÍæ¼ÒÎïÆ·±³°üÖÐÐÂÔöÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param itemID ÎïÆ·ID  | 
| # @param itemCount ÎïÆ·ÊýÁ¿  | 
| # @param identifypar ¼ø¶¨ÏµÊý  | 
| # @param itemStarLV ÐÇÊý  | 
| # @param bind °ó¶¨  | 
| # @param property ÎåÐÐ  | 
| # @param isSuite ÊÇ·ñÌ××°»¯  | 
| # @param baseAttrRate ¿ÉÇ¿»¯µÄ×°±¸»ù´¡ÊôÐÔËæ»ú¼ÓÇ¿±ÈÀýĬÈÏ10000  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸øÍæ¼ÒÎïÆ·±³°üÖÐÐÂÔöÎïÆ·  | 
| def AddEventItem(curPlayer, curMission, itemID, itemCount, identifypar=None,  | 
|                  itemStarLV=0, bind=False, property=None,  | 
|                  packList=[IPY_GameWorld.rptItem], isSuite=False,  | 
|                  addAttrLV=0, isLucky=False, skillBoostEff=[], holeCount=0,  | 
|                  equipIndex= -1, isGreat=0, baseAttrRate=ShareDefine.Def_MaxRateValue, greatAttrList=[]):  | 
| #    if PlayerFamily.DoAddFamilyBossFoodEx(curPlayer, itemID, itemCount, ShareDefine.Def_AddFAVReason_DoFamilyMisson):  | 
| #        #ÏÉÃËÊÞÁ¸×Ô¶¯Ê¹Óà  | 
| #        return  | 
|           | 
|     #ÈÎÎñ¸øÓèÎïÆ·Ó¦¸ÃÖ»ÄÜ·ÅÈëÍòÄܱ³°üºÍ±³°ü  | 
|     itemControl = ItemControler.PlayerItemControler(curPlayer)  | 
|   | 
|     #»ñµÃ¿É·ÅÈëµÄ±³°üË÷Òý  | 
|     packIndex = GetCanPutInPackIndex(curPlayer, itemID, itemCount, bind, packList)  | 
|     if packIndex == -1:  | 
|         return  | 
|   | 
|     #ÉèÖÃÎïÆ·ÊôÐÔ  | 
|     curSingleItem = CreatMissionItem(itemID, itemStarLV, addAttrLV, isSuite, bind,  | 
|                                       isLucky, skillBoostEff, itemCount, holeCount, isGreat, baseAttrRate, greatAttrList)  | 
|     if not curSingleItem:  | 
|         return  | 
|       | 
|     #¹¦ÄܽøÈëÎÞ·¨¼Ç¼ÈÎÎñÌØÊâ´¦Àí  | 
|     if not curMission:  | 
|         missionID = 0  | 
|     else:  | 
|         missionID = curMission.GetMissionID()  | 
|           | 
|     #×°±¸Ôò·ÅÈë±³°ü  | 
|     if packIndex == IPY_GameWorld.rptEquip:  | 
|         #ÈÎÎñû¸ø³ö×°±¸Î»Öã¬Ôò°´Ìî±íµÄ  | 
|         if equipIndex == -1:  | 
|             equipIndex = curSingleItem.GetEquipPlace()  | 
|               | 
|         if equipIndex == 0:  | 
|             GameWorld.ErrLog("ÈÎÎñÔùËÍ×°±¸Î»ÖôíÎó equipIndex=-1")  | 
|             return  | 
|           | 
|         if ItemCommon.CheckHasEquip(curPlayer, IPY_GameWorld.rptEquip, equipIndex):  | 
|             #ÎïÆ·ÒÑ´æÔÚÖ±½Ó¸ø±³°ü  | 
|             if not itemControl.PutInItem(IPY_GameWorld.rptItem, curSingleItem, event=["AddEventItem", False, {'MissionID':missionID}]):  | 
|                 GameWorld.Log('###ÈÎÎñ = %s¸øÓèÎïÆ·Òì³£, %s, %s' % (missionID, itemID, itemCount), curPlayer.GetPlayerID())  | 
|                 curSingleItem.Clear()  | 
|                 return  | 
|         else:  | 
|             ChEquip.DoPlayerEquipItem(curPlayer, curSingleItem, equipIndex, 0)  | 
|       | 
|     #ObtainRes01    <n>»ñµÃ</n><Info Type="Item" Name="Name" ID="{%S1%}"/><n>¡Á</n><n>{%S2%}!</n>  | 
|     elif not itemControl.PutInItem(packIndex, curSingleItem, event=["AddEventItem", False, {'MissionID':missionID}]):  | 
|         GameWorld.Log('###ÈÎÎñ = %s¸øÓèÎïÆ·Òì³£, %s, %s' % (missionID, itemID, itemCount), curPlayer.GetPlayerID())  | 
|         curSingleItem.Clear()  | 
|         return  | 
|           | 
|     #֪ͨµÃµ½ÎïÆ·¶¯»ÏÔʾ  | 
|     #curPlayer.Sync_GetItemView(itemID, itemCount)  | 
|     #PlayerControl.NotifyCode(curPlayer, "ObtainRes01", [itemID, itemCount])  | 
|       | 
|   | 
| ## ´´½¨ÈÎÎñÎïÆ·  | 
| #  @param itemID: ÎïÆ·id  | 
| #  @param starLV: ÐÇÊý  | 
| #  @param wuxing: ÎåÐÐ  | 
| #  @param isSuite: ÊÇ·ñÌ××°»¯  | 
| #  @param bind: ÊÇ·ñ°ó¶¨  | 
| #  @param itemCount: ÎïÆ·ÊýÁ¿  | 
| #  @param baseAttrRate: ÈÎÎñ´´½¨µÄÎïÆ·Ä¬ÈϵĻù´¡ÊôÐÔËæ»úֵΪ10000  | 
| #  @return None  | 
| def CreatMissionItem(itemID, starLV=0, addAttrLV=0, isSuite=False, bind=False,  | 
|                      isLucky=0, skillBoostEff=[], itemCount=1, holeCount=0,  | 
|                      isGreat=0, baseAttrRate=ShareDefine.Def_MaxRateValue, greatAttrList=[]):  | 
|       | 
|     curSingleItem = ItemControler.GetOutPutItemObj(itemID)  | 
|       | 
|     if not curSingleItem:  | 
|         GameWorld.Log('###´´ÔìÈÎÎñÎïÆ·Ê§°Ü, itemID = %s' % (itemID))  | 
|         return  | 
|       | 
|     tmpEquipData = ItemControler.SingleEquipTmpData()  | 
|     tmpEquipData.starLV = starLV  | 
|     tmpEquipData.holeCnt = holeCount  | 
|     tmpEquipData.isSuite = isSuite  | 
|     tmpEquipData.isBind = bind  | 
|       | 
|     ChItem.EquipAddAdditionEx(curSingleItem, tmpEquipData)  | 
|   | 
|     #ÉèÖÃÊýÁ¿  | 
|     ItemControler.SetItemCount(curSingleItem, itemCount)  | 
|       | 
|     return curSingleItem  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÍÚ±¦¸øÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Dig_Get_Item list="ÎïÆ·Áбí" />      | 
| def DoType_Dig_Get_Item(curPlayer, curMission, curActionNode):  | 
|     #<dig_get_item list = ""/>  | 
|     listStr = curActionNode.GetAttribute("list")  | 
|     itemID, itemCount = DealWithInPut_InDig(listStr)  | 
|     if itemID == 0:  | 
|         return  | 
|   | 
|     AddEventItem(curPlayer, curMission, itemID, itemCount)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÉèÖÃÈÎÎñÃèÊö  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_Description_Index index="ÉèÖõÄË÷Òý" id="ÈÎÎñID" />    | 
| def DoType_Set_Description_Index(curPlayer, curMission, curActionNode):  | 
|     #<set_description_index index = "" id = "" notify = "0"/>  | 
|     index = int(curActionNode.GetAttribute("index"))  | 
|     questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|     #notify = curActionNode.GetAttribute("notify")  | 
|     #ÊÇ·ñÌáʾ¿Í»§¶Ë£¨0£º²»Ìáʾ   1ºÍ·Å¿Õ¶¼ÎªÌáʾ£©  | 
| #    if notify == "" :  | 
| #        notify = 1  | 
| #    else:  | 
| #        notify = int(notify)  | 
|     if questID != 0:  | 
|         curMission = curPlayer.FindMission(questID)  | 
|         if curMission == None:  | 
|             return  | 
|   | 
|     curMission.SetDescriptionIndex(index)  | 
|     #Í¨ÖªÍæ¼ÒÃèÊö¸Ä±ä  | 
| #    curPlayer.Sync_TaskDetailChange(curMission.GetMissionID())  | 
|     #ÎÞÐè¼ÌÐøÌáʾ¿Í»§¶Ë  | 
| #    if notify == 0:  | 
| #        return  | 
|     #Í¨ÖªÍæ¼ÒÐÅºÅµÆ¸Ä±ä  | 
| #    ShowMissionLight(curPlayer, curMission)  | 
|       | 
|     #Í¨ÖªÍæ¼ÒÈÎÎñÐÅÏ¢  | 
| #    ShowMissionInfo(curPlayer, curMission, -1)  | 
|       | 
|     #а汾֪ͨ¿Í»§¶Ë·½Ê½  | 
|     RefreshMission(curPlayer, curMission)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÈÎÎñɾ³ýÅÐ¶Ï  | 
| # @param questID ÈÎÎñID  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý  | 
| # @remarks ÊÇ·ñÄÜɾ³ýÈÎÎñ  | 
| def CanDeleteQuest(questID):  | 
|     key = ("on_delete", "%s.xml" % str(questID))  | 
|     if AllQuestsEvents.has_key(key):  | 
|         return True  | 
|       | 
|     return False  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓн±Àø½Úµã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @return ·µ»ØÖµ, ½ÚµãÐÅÏ¢  | 
| # @remarks ÊÇ·ñÓн±Àø½Úµã  | 
| def __GetRewardCode(curPlayer, curMission):  | 
|     curNode = QuestCommon.GetRewardNode(curPlayer, curMission)  | 
|     if curNode == None or curNode.IsEmpty():  | 
|         return ""  | 
|     msgNode = curNode.FindChildNode("msg")  | 
|     if msgNode == None or msgNode.IsEmpty():  | 
|         return ""  | 
|       | 
|     return msgNode.GetAttribute("code")  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##֪ͨ¿Í»§¶ËÈÎÎñÃèÊöÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks Í¨Öª¿Í»§¶ËÈÎÎñÃèÊöÐÅÏ¢  | 
| def RefreshMission(curPlayer, curMission):  | 
|     global MissionDescription  | 
|     MissionDescription.Clear()  | 
|       | 
|     questID = curMission.GetMissionID()  | 
|     descriptIndex = curMission.GetDescriptionIndex()  | 
|     state = curMission.GetState()  | 
|   | 
|     #ÉèÖÿͻ§¶ËÈÎÎñ״̬  | 
|     missionState = curMission.GetMissionState()  | 
|     #Íê³É  | 
|     if state == ChConfig.Def_Mission_State_Over:  | 
|         missionState = IPY_GameWorld.msComplete  | 
|     #²»´æÔÚ  | 
|     elif state == ChConfig.Def_Mission_State_UnMission:  | 
|         missionState = IPY_GameWorld.msNoExist  | 
|     #¿É½Ó  | 
|     elif state == ChConfig.Def_Mission_State_NoAccept:  | 
|         missionState = IPY_GameWorld.msNoMission  | 
|     #¿É½»  | 
|     elif state == ChConfig.Def_Mission_State_CanComplete:  | 
|         missionState = IPY_GameWorld.msCanComplete  | 
|       | 
|       | 
|     #µ±Ç°¿Í»§¶ËµÄÈÎÎñ״̬Ϊδ½Ó£¬XML״̬²»ÊÇδ½Ó£¬ÔòÉèÖÃÈÎÎñ½øÐÐÖÐ  | 
|     if missionState == IPY_GameWorld.msNoMission and state != 0:  | 
|         missionState = IPY_GameWorld.msProcessing  | 
|       | 
|     MissionDescription.SetMissionID(questID)  | 
|     MissionDescription.SetMissionState(missionState)  | 
|     MissionDescription.SetDiscriptionIndex(descriptIndex)  | 
|       | 
|     #ÐÂ½Ó¿Ú  | 
|     curPlayer.Sync_PlayerMissionDesc(MissionDescription)  | 
|     return  | 
|   | 
| #===============================================================================  | 
| # def RefreshMission(curPlayer, curMission):  | 
| #    global MissionDescription  | 
| #    MissionDescription.Clear()  | 
| #    questID = curMission.GetMissionID()  | 
| #      | 
| #    descriptIndex = curMission.GetDescriptionIndex()  | 
| #    state = curMission.GetState()  | 
| #      | 
| #    questData = FindQuestFunc(questID)  | 
| #    if questData == None:  | 
| #        GameWorld.Log("RefreshMission, ÕÒ²»µ½ÈÎÎñ%s É¾³ýÈÎÎñÊý¾Ý"%questID , curPlayer.GetPlayerID())  | 
| #        curPlayer.DelMission(questID)          | 
| #        return  | 
| #      | 
| #    if questData.Type == QuestCommon.Def_GM_Active_Mission_Type:  | 
| #        #Õâ¸öÈÎÎñÊǽÚÈÕÈÎÎñ, ÐèÒªGM¿ªÆôµÄ  | 
| #        if not GameWorld.GetGameWorld().IsEventActive(questID):  | 
| #            return  | 
| #      | 
| #    if questData.Type == 8 and state == 0:  | 
| #        #ÈÎÎñÀàÐÍ:8 ÎªÓÂÕßÈÎÎñ(¾íÖáÈÎÎñ), ²»Í¨Öª¸ø¿Í»§¶Ë  | 
| #        return  | 
| #    if questData.Invisible == 1 and state == 0:  | 
| #        #ÈÎÎñ²éѯÀ¸²»Í¨Öª¸ø¿Í»§¶ËÏÔʾ  | 
| #        return  | 
| #   | 
| # #    GameWorld.Log("descriptIndex = %d"%descriptIndex)  | 
| # #    if state == 0:  | 
| # #        #״̬µÈÓÚ0, Ö»ÏÔʾµÆ  | 
| # ##        GameWorld.Log("״̬µÈÓÚ0, Ö»ÏÔʾµÆ")  | 
| # #        ShowMissionLight(curPlayer, curMission)  | 
| # #          | 
| # #        #ÔÚÈÎÎñ²éѯÖÐÌí¼ÓÕâ¸öÈÎÎñ  | 
| # #        NotifyNewQuestInfo(curPlayer, curMission)  | 
| # #        return  | 
| #      | 
| #    questDescriptList = questData.QuestDescriptionList  | 
| #      | 
| #    if descriptIndex < 0 or descriptIndex >= len(questDescriptList):  | 
| #        GameWorld.Log("descriptIndex Error = %d missionID = %d"%(descriptIndex, curMission.GetMissionID()) , curPlayer.GetPlayerID())  | 
| #        return  | 
| #      | 
| #      | 
| #    #ÉèÖÿͻ§¶ËÈÎÎñ״̬  | 
| #    missionState = curMission.GetMissionState()  | 
| #    if state == -1:  | 
| #        missionState = IPY_GameWorld.msComplete  | 
| #    elif state == -4:  | 
| #        missionState = IPY_GameWorld.msNoExist  | 
| #    elif state == 0:  | 
| #        missionState = IPY_GameWorld.msNoMission  | 
| #          | 
| #    if missionState == IPY_GameWorld.msNoMission and state != 0:  | 
| #        missionState = IPY_GameWorld.msProcessing  | 
| #          | 
| #          | 
| # #    GameWorld.Log("missionState = %d"%missionState)  | 
| #      | 
| #    questID = curMission.GetMissionID()  | 
| #    MissionDescription.SetMissionID(questID)  | 
| #    MissionDescription.SetMissionType(questData.Type)  | 
| #    MissionDescription.SetLV(questData.LV)  | 
| #    MissionDescription.SetNPCID(questData.NPCID)  | 
| #    MissionDescription.SetName(questData.NameCode)  | 
| #    MissionDescription.SetColorLV(questData.Color_lv)  | 
| #    day_CountMsg = QuestRunnerValue.ReplaceNPCTalkText(curPlayer, curMission, questData.Day_Count)  | 
| #    MissionDescription.SetCompleteState(day_CountMsg)  | 
| #    #ÓÐon__deleteÎļþ£¬²éѯÀ¸Îª¿Éɾ³ý  | 
| #    if CanDeleteQuest(questID) and questData.CanDel == 1:  | 
| #        #ÉèÖÃÈÎÎñΪ¿Éɾ³ý״̬  | 
| #        MissionDescription.SetCanDelete(1)  | 
| #      | 
| #    #Éú³ÉÈÎÎñÃèÊö  | 
| #    rewardNode = None  | 
| #    if state == -1 or state ==0:  | 
| #        #ÈÎÎñÒѾÍê³É/ûÓнӣ¬ Ã»Óн±Àø½Úµã  | 
| #        MissionDescription.SetMissionState(missionState)  | 
| #          | 
| #        if QuestDescriptions.has_key(questID):  | 
| #            curQuestDescriptions = QuestDescriptions[questID]  | 
| #            descMsg = curQuestDescriptions.Code  | 
| #            if curQuestDescriptions.ShowReward:  | 
| #                #2009.4.28¿Í»§¶Ë½âÎöͳһ¿Õ¸ñ************************************  | 
| #                descMsg = '%s %s'%(descMsg, __GetRewardCode(curPlayer, curMission))  | 
| #            MissionDescription.SetDesc(descMsg)  | 
| #         | 
| #        #GameWorld.Log('µ±Ç°ÈÎÎñ %s ÃèÊö: %s'%(questID, QuestDescriptions[questID]))     | 
| #    else:  | 
| #        descriptIndex = curMission.GetDescriptionIndex()  | 
| #        #µÃµ½ÈÎÎñ½±Àø, Æ´½Ó  | 
| #        rewardNode = QuestCommon.GetRewardNode(curPlayer, curMission)  | 
| #        | 
| #        infoQuest = questDescriptList[descriptIndex]  | 
| #        if infoQuest.IsRewardNode:    | 
| #            missionState = IPY_GameWorld.msCanComplete  | 
| #              | 
| #        MissionDescription.SetMissionState(missionState)  | 
| #              | 
| #        #ÈÎÎñÃèÊöÌæ»»  | 
| #        detail = infoQuest.Msg   | 
| #          | 
| #        if rewardNode != None and (not rewardNode.IsEmpty()):  | 
| #            #ÈÎÎñÃèÊöÓëÈÎÎñ½±ÀøÌæ»»  | 
| #            detail = "%s %s"%(detail, rewardNode.FindChildNode("msg").GetAttribute("code"))  | 
| #              | 
| #        #ÉèÖÃÈÎÎñÃèÊö  | 
| #        MissionDescription.SetDesc(detail)  | 
| #          | 
| #        #Éú³ÉÈÎÎñ×·×Ù  | 
| #        questInfoList = infoQuest.Info  | 
| #        for content in questInfoList:  | 
| #            MissionDescription.AddMissionInfo(content)  | 
| #          | 
| #        #Éú³ÉÈÎÎñµÆ  | 
| #        for light in infoQuest.Lights:  | 
| #            curNPCID = light.NPCID   | 
| #            if curNPCID == 0:  | 
| #                #ÌØÊâÇå¿Õ, Ëæ»ú·ÃÎÊNPC  | 
| #                curNPCID = curMission.GetProperty(QuestCommon.Def_Visit_Npc_ID)  | 
| #            MissionDescription.AddPlayerMissionLight(curNPCID, light.Type)  | 
| #          | 
| #        #GameWorld.Log('µ±Ç°ÈÎÎñ %s ÃèÊö: %s'%(questID, detail))      | 
| #      | 
| #    curPlayer.Sync_PlayerMission(MissionDescription)  | 
| #    return  | 
| #===============================================================================  | 
|   | 
| ##ÏÔÊ¾Íæ¼ÒµÄÈÎÎñÐÅºÅµÆ  | 
| #def ShowMissionLight(curPlayer, curMission):  | 
| #    questID = curMission.GetMissionID()  | 
| #    if curMission.GetState() == 0:  | 
| #        #ÈÎÎñ״̬Ϊδ½Ó, ÌØÊâ´¦Àí  | 
| #        curPlayer.Sync_MissionLight(questID, FindQuestFunc(questID).NPCID, 0)  | 
| #        return  | 
| #    descriptIndex = curMission.GetDescriptionIndex()  | 
| #      | 
| #    questDescriptList = FindQuestFunc(questID).QuestDescriptionList  | 
| #    if descriptIndex < 0 or descriptIndex >= len(questDescriptList):  | 
| #        GameWorld.Log("descriptIndex Error = %d missionID = %d"%(descriptIndex, questID))  | 
| #        return  | 
| #    #֪ͨ¿Í»§¶ËÃðµôËùÓÐµÄµÆ  | 
| #    curPlayer.Sync_ClearMapMissionLight(questID)  | 
| #    infoQuest = questDescriptList[descriptIndex]  | 
| #    for light in infoQuest.Lights:  | 
| #        curPlayer.Sync_MissionLight(questID, light.NPCID, light.Type)  | 
| #        GameWorld.Log("ÈÎÎñID %d  Ïà¹ØNPC : %d , ÀàÐÍ: %d"%  | 
| #                                          (questID, light.NPCID, light.Type))  | 
|   | 
| #def GetMissionReplaceMsg(content, curMission):  | 
| #    parseList = DealWithInPut(content)  | 
| #    for i in range(0,len(parseList)):  | 
| #        parseList[i] = str(curMission.GetProperty(parseList[i]))  | 
| #    content = DealWithReverse(content, parseList)  | 
| #    return content  | 
|       | 
| ##ÏÔʾÈÎÎñ×·×Ù <µ±Ç°Íæ¼Ò, µ±Ç°ÈÎÎñ, µÚ¼¸¸öÈÎÎñ×·×Ù(-1 ±íʾÏÔʾËùÓÐÈÎÎñ×·×Ù)>  | 
| #def ShowMissionInfo(curPlayer, curMission, index):  | 
| #    descriptIndex = curMission.GetDescriptionIndex()  | 
| #      | 
| #    questDescriptList = FindQuestFunc(curMission.GetMissionID()).QuestDescriptionList  | 
| #      | 
| #    if descriptIndex < 0 or descriptIndex >= len(questDescriptList):  | 
| #        GameWorld.Log("descriptIndex Error = %d missionID = %d"%(descriptIndex, curMission.GetMissionID()))  | 
| #        return  | 
| #      | 
| #    infoQuest = questDescriptList[descriptIndex]  | 
| #    questInfoList = infoQuest.Info  | 
| #      | 
| #    if index != -1:  | 
| #        #Ö»ÏÔʾһ¸öÐÅÏ¢  | 
| #        #content = GetMissionReplaceMsg(questInfoList[index], curMission)  | 
| #        content = questInfoList[index]  | 
| #        curPlayer.Sync_MissionMsg(curMission.GetMissionID(), content)    | 
| #        return  | 
| #  | 
| #    #ÏÔʾËùÓÐÐÅÏ¢  | 
| #    for content in questInfoList:  | 
| #        #showContent = GetMissionReplaceMsg(content, curMission)  | 
| #        showContent = content  | 
| #        curPlayer.Sync_MissionMsg(curMission.GetMissionID(), showContent)    | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÈÎÎñÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Show_Mission_Info index="Ë÷Òý" />   | 
| def DoType_Show_Mission_Info(curPlayer, curMission, curActionNode):  | 
| #    #¸ñʽ£º<show_mission_info index = "0"/> (index ¿ÉÑ¡)  | 
| #    index = -1  | 
| #    indexStr = curActionNode.GetAttribute("index")  | 
| #    if indexStr != "":  | 
| #        index = int(indexStr)  | 
| #          | 
| #    ShowMissionInfo(curPlayer, curMission, index)  | 
|     return  | 
|     | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÈÎÎñ¸øÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Event_Get_Item list="ÎïÆ·Çåµ¥" />       | 
| def DoType_Event_Get_Item(curPlayer, curMission, curActionNode):  | 
|     #<dig_get_item list = ""/>  | 
|     listStr = curActionNode.GetAttribute("list")  | 
|     itemID, itemCount = DealWithInPut_InDig(listStr)   | 
|     if itemID == 0:  | 
|         return  | 
|       | 
|     AddEventItem(curPlayer, curMission, itemID, itemCount)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÉèÖÃÆÕͨÍÚ±¦×ø±ê  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Treasure_Rand_Pos_Map type="ÀàÐÍ, week¿ÉÑ¡,±íʾÊǰ´ÕÕÐÇÆÚÀ´»¹ÊÇĬÈÏ" mapid="µØÍ¼ID" posx="×ø±êX" posy="×ø±êY" />  | 
| def DoType_Treasure_Rand_Pos_Map(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ: <treasure_rand_pos_map type = "week" mapid="mapid" posx="posx" posy="posy"/> (type = "week" ¿ÉÑ¡, ±íʾÊǰ´ÕÕÐÇÆÚÀ´»¹ÊÇĬÈÏ)  | 
|       | 
| #    #µÃµ½Íæ¼ÒµÄ¶ÔÏóNPC  | 
| #    curNPC = GetPlayerTalkNPC(curPlayer)  | 
| #    if curNPC == None:  | 
| #        GameWorld.Log("ûÓÐÕâ¸öNPC")  | 
| #        return  | 
|   | 
|     missionID = curMission.GetMissionID()  | 
|     if FindQuestFunc(missionID) == None:  | 
|         return None  | 
|           | 
|     treasureData = FindQuestFunc(missionID).Treasure  | 
|       | 
|     if treasureData == None:  | 
|         GameWorld.Log('ÍÚ±¦Êý¾ÝΪ¿Õ missionID = %s' % (missionID), curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     type = curActionNode.GetAttribute("type")  | 
|       | 
|     posList = None  | 
|     if type == "":  | 
|         posList = treasureData.Normal  | 
|     elif type == "week":  | 
|         if treasureData.Week == None:  | 
|             GameWorld.Log('ÍÚ±¦Êý¾ÝWeekΪ¿Õ missionID = %s' % (missionID), curPlayer.GetPlayerID())  | 
|             return  | 
|           | 
|         if not treasureData.Week.has_key(curPlayer.GetLV()):  | 
|             GameWorld.Log('ÈÎÎñID = %s ÕÒ²»µ½ ÍÚ±¦µÈ¼¶ = %s' % (missionID, curPlayer.GetLV()), curPlayer.GetPlayerID())  | 
|             return  | 
|         curDateTime = GameWorld.GetCurrentTime()  | 
|         curWeek = datetime.datetime.isocalendar(curDateTime)[2]  | 
|         posList = treasureData.Week[curPlayer.GetLV()][curWeek]  | 
|       | 
|     if posList == None:  | 
|         GameWorld.Log("DoType_Treasure_Rand_Pos_Map, ÀàÐÍ´íÎó! type = %s" % (type) , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     getLen = len(posList)  | 
|     if getLen == 0:  | 
|         GameWorld.Log("DoType_Treasure_Rand_Pos_Map Ã»ÓÐÍÚ±¦µÄÈÎÎñ×ø±ê missid = %d" % (missionID) , curPlayer.GetPlayerID())  | 
|         return  | 
|     getIndex = random.randint(0, getLen - 1)  | 
|       | 
|     mapid = curActionNode.GetAttribute("mapid")  | 
|     posx = curActionNode.GetAttribute("posx")  | 
|     posy = curActionNode.GetAttribute("posy")  | 
|     curMission.SetProperty(mapid, posList[getIndex].MapID)  | 
|     curMission.SetProperty(posx, posList[getIndex].PosX)  | 
|     curMission.SetProperty(posy, posList[getIndex].PosY)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÍÚ±¦µôÂ伯Ëã  | 
| # @param str ÍÚ±¦×Ö·û´®  | 
| # @return ·µ»ØÖµ,(ÎïÆ·ID,ÎïÆ·ÊýÁ¿)  | 
| # @remarks ÍÚ±¦µôÂ伯Ëã  | 
| def DealWithInPut_InDig(str):  | 
|     var = []  | 
|     curRateList = []  | 
|     curRateLists = []  | 
|     r = re.compile(r"[\[][^\[]*[\]]")  | 
|     rs = re.compile(r"[^\[][^\[]*[^\]]")  | 
|     strList = r.findall(str)  | 
|     for i in range(len(strList)):  | 
|         curRate = rs.findall(strList[i])  | 
|         var.extend(curRate)  | 
|     for j in range(len(var)):  | 
|         curRateList = var[j].split(",")  | 
|         curRateLists.append(curRateList)  | 
|   | 
|     randomRate = random.randint(0, ChConfig.Def_MaxRateValue)  | 
|     for i in range(len(curRateLists)):  | 
|         if randomRate < int(curRateLists[i][1]):  | 
|             itemID = int(curRateLists[i][0])  | 
|             itemCount = int(curRateLists[i][2])  | 
|             return itemID, itemCount  | 
|   | 
|     return 0, 0  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| #DayEventµÄkey¿ÉÄÜÊǵȼ¶»òÕߣ¨×îС£¬×î´óµÈ¼¶£©  | 
| #ÕÒµ½Ã¿ÈÕÈÎÎñÐÅÏ¢  | 
| def GetDayEventInfo(curPlayer, missionData, dayEventType):  | 
|     dayEvent = missionData.DayEvent  | 
|     if dayEventType not in dayEvent:  | 
|         return  | 
|     lv = curPlayer.GetLV()  | 
|     if lv in dayEvent[dayEventType]:  | 
|         return dayEvent[dayEventType][lv]  | 
|       | 
|     for lvInfo in dayEvent[dayEventType]:  | 
|         if isinstance(lvInfo, int):  | 
|             continue  | 
|         if lv >= lvInfo[0] and lv <= lvInfo[1]:  | 
|             return dayEvent[dayEventType][lvInfo]  | 
|       | 
|     return  | 
|   | 
| ##°´ÎïÆ·µÈ¼¶Ëæ»ú¸øÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Event_Get_Rand_Item_By_Lv type="ÀàÐÍ"/>   | 
| def DoType_Event_Get_Rand_Item_By_Lv(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ: <event_get_rand_item_by_lv/>  | 
|     missionID = curMission.GetMissionID()  | 
|     missionData = FindQuestFunc(missionID)  | 
|     if missionData == None:  | 
|         return  | 
|       | 
|     #°´²»Í¬¹«Ê½¼ÆËãÎïÆ·±¶ÂÊ  | 
|     type = GameWorld.ToIntDef(curActionNode.GetAttribute("type"), 0)  | 
|     familyLV = curPlayer.GetFamilyLV()  | 
|     if type == 0:  | 
|         rate = 1  | 
|     elif type == 1:  | 
|         rate = (1 + (familyLV + 1) * 0.25)  | 
|           | 
|     getItemList = GetDayEventInfo(curPlayer, missionData, QuestCommon.Day_GetItem_By_ID)  | 
|     #ÿÈÕÎïÆ·Ëæ»úµÈ¼¶Òì³£******************************************  | 
|     if not getItemList:  | 
|         GameWorld.ErrLog("ÿÈÕÎïÆ·Ëæ»úµÈ¼¶Òì³£")  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return  | 
|       | 
|     getLen = len(getItemList)  | 
|     if getLen == 0:  | 
|         GameWorld.Log("%dµÈ¼¶Ã»ÓÐËæ»úµÃµ½ÎïÆ·µÄÈÎÎñ" % curPlayer.GetLV() , curPlayer.GetPlayerID())  | 
|         return  | 
|     getIndex = random.randint(0, getLen - 1)  | 
|       | 
|     name = QuestCommon.Def_Item_ID  | 
|     #name = curActionNode.GetAttribute("name")  | 
|     #itemcount = curActionNode.GetAttribute("count")  | 
|     itemcount = QuestCommon.Def_Item_Count  | 
|     #GameWorld.Log("%sÎïÆ·:    %d"%(itemcount, getItemList[getIndex].Count))  | 
|     curMission.SetProperty(name, getItemList[getIndex].ID)  | 
|     max_item_count = int((getItemList[getIndex].Count) * rate)  | 
|     curMission.SetProperty(itemcount, max_item_count)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##°´NPCµÈ¼¶Ëæ»úɱ¹Ö  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Event_Kill_Rand_Npc_By_Lv isxiaoenlu="ÊÇ·ñЦ¶÷¼ÈÎÎñ"/>   | 
| def DoType_Event_Kill_Rand_Npc_By_Lv(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ: <event_kill_rand_npc_by_lv isxiaoenlu="ÊÇ·ñЦ¶÷¼ÈÎÎñ"/>  | 
|     missionID = curMission.GetMissionID()  | 
|     missionData = FindQuestFunc(missionID)  | 
|     if missionData == None:  | 
|         return  | 
|       | 
|     killNPCList = GetDayEventInfo(curPlayer, missionData, QuestCommon.Day_KillNPC_By_LV_List)  | 
|     if not killNPCList:  | 
|         GameWorld.ErrLog("ÿÈÕÎïÆ·Ëæ»úµÈ¼¶Òì³£")  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return  | 
|       | 
|     getLen = len(killNPCList)  | 
|     if getLen == 0:  | 
|         GameWorld.Log("%dµÈ¼¶Ã»ÓÐËæ»úµÃµ½ÎïÆ·µÄÈÎÎñ" % (curPlayer.GetLV()) , curPlayer.GetPlayerID())  | 
|         return  | 
|     getIndex = random.randint(0, getLen - 1)  | 
|     name = QuestCommon.Def_Kill_Npc_LV  | 
|     #name = curActionNode.GetAttribute("name")  | 
|     kill_lv_count = QuestCommon.Def_Kill_Npc_LV_Count  | 
|     #kill_lv_count = curActionNode.GetAttribute("count")  | 
|     curMission.SetProperty(name, killNPCList[getIndex].ID)  | 
|       | 
|     curMission.SetProperty(kill_lv_count, killNPCList[getIndex].Count)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##°´NPCµÈ¼¶Ëæ»ú·ÃÎÊ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Event_Visit_Rand_Npc_By_Lv />   | 
| def DoType_Event_Visit_Rand_Npc_By_Lv(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ:   | 
|     #<Event_Visit_Rand_Npc_By_Lv/>  | 
|     #"kill_npc_by_id"  | 
|     #(!cur_kill_count!)/(!kill_id_count!)  | 
|     missionID = curMission.GetMissionID()  | 
|       | 
|     missionData = FindQuestFunc(missionID)  | 
|     if missionData == None:  | 
|         return  | 
|       | 
|     visitNPCList = GetDayEventInfo(curPlayer, missionData, QuestCommon.Day_VisitNPCList)  | 
|     if not visitNPCList:  | 
|         GameWorld.Log("##°´NPCµÈ¼¶Ëæ»ú·ÃÎʵȼ¶Òì³£")  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return  | 
|     npcData = __GetRandNPCID(curPlayer, visitNPCList, ChConfig.Def_Player_Dict_TaskLastVisitNPCID)  | 
|     if not npcData:  | 
|         GameWorld.Log("##°´NPCµÈ¼¶Ëæ»ú·ÃÎÊÒì³£ ")  | 
|         return  | 
|       | 
|     name = QuestCommon.Def_Visit_Npc_ID  | 
|       | 
|     curMission.SetProperty(name, npcData.ID)  | 
|     return  | 
| #---------------------------------------------------------------------  | 
|   | 
| ##Ëæ»ú»÷ɱָ¶¨IDµÄNPC  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Event_Collect_Rand_Npc_By_Id type="ÀàÐÍ" isxiaoenlu="ÊÇ·ñЦ¶÷¼ÈÎÎñ"/>   | 
| def DoType_Event_Collect_Rand_Npc_By_Id(curPlayer, curMission, curActionNode):  | 
|     #°´²»Í¬¹«Ê½¼ÆËãɱ¹Ö±¶ÂÊ  | 
|     type = GameWorld.ToIntDef(curActionNode.GetAttribute("type"), 0)  | 
|     familyLV = curPlayer.GetFamilyLV()  | 
|     if type == 0:  | 
|         rate = 1  | 
|     elif type == 1:  | 
|         rate = (1 + (familyLV + 1) * 0.25)  | 
|   | 
|     missionID = curMission.GetMissionID()  | 
|     missionData = FindQuestFunc(missionID)  | 
|     if missionData == None:  | 
|         return  | 
|       | 
|     collectNPCList = GetDayEventInfo(curPlayer, missionData, QuestCommon.Day_CollectNPCList)  | 
|     if not collectNPCList:  | 
|         GameWorld.Log("##Ëæ»ú»÷ɱָ¶¨IDµÄNPCÒì³£")  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return  | 
|   | 
|     ranNPCDict = {}  | 
|     for collectNPC in collectNPCList:  | 
|         mapid = collectNPC.MapID  | 
|         if mapid and not PlayerControl.CanEnterMap(curPlayer, mapid, False):  | 
|             continue  | 
|         if mapid in ranNPCDict:  | 
|             ranNPCDict[mapid].append(collectNPC)  | 
|         else:  | 
|             ranNPCDict[mapid] = [collectNPC]  | 
|           | 
|     if not ranNPCDict:  | 
|         GameWorld.Log("##Ëæ»ú»÷ɱָ¶¨IDµÄNPCÒì³£ ranNPCDict=%s"%ranNPCDict)  | 
|         return  | 
|     ranNPCList = ranNPCDict[max(ranNPCDict.keys())]  | 
|     getLen = len(ranNPCList)  | 
|     if getLen == 0:  | 
|         GameWorld.Log("%dµÈ¼¶Ã»ÓÐËæ»ú²É¼¯µÄÈÎÎñ" % curPlayer.GetLV() , curPlayer.GetPlayerID())  | 
|         return  | 
|     getIndex = random.randint(0, getLen - 1)  | 
|       | 
|     name = QuestCommon.Def_Collect_Npc_ID  | 
|     collectCountName = QuestCommon.Def_Collect_Npc_ID_Count  | 
|   | 
|     curMission.SetProperty(name, ranNPCList[getIndex].ID)  | 
|       | 
|     max_kill_count = int((ranNPCList[getIndex].Count) * rate)  | 
|     curMission.SetProperty(collectCountName, max_kill_count)  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ëæ»ú»÷ɱָ¶¨IDµÄNPC  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Event_Kill_Rand_Npc_By_Id type="ÀàÐÍ" isxiaoenlu="ÊÇ·ñЦ¶÷¼ÈÎÎñ"/>   | 
| def DoType_Event_Kill_Rand_Npc_By_Id(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ: <event_kill_rand_npc_by_id/>  | 
|     #"kill_npc_by_id" #(!cur_kill_count!)/(!kill_id_count!)  | 
|     #°´²»Í¬¹«Ê½¼ÆËãɱ¹Ö±¶ÂÊ  | 
| #    type = GameWorld.ToIntDef(curActionNode.GetAttribute("type"), 0)  | 
| #    familyLV = curPlayer.GetFamilyLV()  | 
| #    if type == 0:  | 
| #        rate = 1  | 
| #    elif type == 1:  | 
| #        rate = (1 + (familyLV + 1) * 0.25)  | 
|   | 
|     missionID = curMission.GetMissionID()  | 
|     missionData = FindQuestFunc(missionID)  | 
|     if missionData == None:  | 
|         return  | 
|       | 
|     killNPCList = GetDayEventInfo(curPlayer, missionData, QuestCommon.Day_KillNPC_By_ID_List)  | 
|     if not killNPCList:  | 
|         GameWorld.Log("##Ëæ»ú»÷ɱָ¶¨IDµÄNPCÒì³£")  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return  | 
|     npcData = __GetRandNPCID(curPlayer, killNPCList, ChConfig.Def_Player_Dict_TaskLastKillNPCID)  | 
|     if not npcData:  | 
|         return  | 
|       | 
|     heroLV = curPlayer.GetLV()  | 
|     name = QuestCommon.Def_Kill_Npc_ID  | 
|     kill_id_count = QuestCommon.Def_Kill_Npc_ID_Count  | 
|     curMission.SetProperty(name, npcData.ID)  | 
|     killCntDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskKillNPCCnt')  | 
|     max_kill_count = GameWorld.GetDictValueByRangeKey(killCntDict, heroLV, 50)  | 
|     curMission.SetProperty(kill_id_count, max_kill_count)  | 
|     return  | 
|   | 
| def __GetRandNPCID(curPlayer, killNPCList, recordKey):  | 
|     heroLV = curPlayer.GetLV()  | 
|     ranNPCList = []  | 
|     returnNPC = None  | 
|     secondNPC = None  | 
|     for killNPC in killNPCList:  | 
|         mapid = killNPC.MapID  | 
|         #ÅжÏnpcËùÔÚµØÍ¼ÊÇ·ñ¿É½ø  | 
|         if mapid and not PlayerControl.CanEnterMap(curPlayer, mapid, False):  | 
|             continue  | 
|         #npcµÈ¼¶²»¸ßÓÚÍæ¼ÒµÈ¼¶£¬²»µÍÓÚÍæ¼Ò30¼¶  | 
|         npcData = killNPC.NPCData  | 
|         if not npcData:  | 
|             continue  | 
|         NPCLV = npcData.GetLV()  | 
|         if NPCLV > heroLV or NPCLV < heroLV-30:  | 
|             if NPCLV < heroLV-30:  | 
|                 secondNPC = killNPC  | 
|             continue  | 
|         #²»ºÍÉϴεÄNPCIDÏàͬ  | 
|         if killNPC.ID == curPlayer.NomalDictGetProperty(recordKey):  | 
|             continue  | 
|         ranNPCList.append(killNPC)  | 
|       | 
|     if ranNPCList:  | 
|         returnNPC = random.choice(ranNPCList)  | 
|     else:  | 
|         GameWorld.DebugLog("##Ëæ»ú»÷ɱ¡¢·ÃÎÊÖ¸¶¨IDµÄNPCÒì³£ secondNPC=%s"%secondNPC)  | 
|         returnNPC = secondNPC or killNPCList[0]  | 
|     if not returnNPC:  | 
|         return  | 
|     PlayerControl.NomalDictSetProperty(curPlayer, recordKey, returnNPC.ID)  | 
|     return returnNPC  | 
|           | 
| #---------------------------------------------------------------------  | 
| ##¸øÍæ¼Ò¾Ñé  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Exp value="Öµ" />   | 
| def DoType_Add_Exp(curPlayer, curMission, curActionNode):  | 
|     #<add_exp value="2" exp_rate = "1"/>  | 
|       | 
| #===============================================================================  | 
| #    exp_rate = curActionNode.GetAttribute("exp_rate")  | 
| #    if exp_rate == "" or exp_rate == "0":  | 
| #        #²»ÏíÊܾÑé¼Ó³É  | 
| #        exp_rate = False  | 
| #    else:  | 
| #        #ÏíÊܾÑé¼Ó³É  | 
| #        exp_rate = True   | 
| #===============================================================================  | 
|     #¼Ó¾Ñé  | 
|     content = curActionNode.GetAttribute("value")  | 
|     content = int(content)  | 
|     multiple = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TaskExpRewardMultiple)  | 
|     if multiple:  | 
|         content = int(content * multiple / 100.0)  | 
|     playerControl = PlayerControl.PlayerControl(curPlayer)  | 
|     playerControl.AddExp(content)  | 
|     #PlayerControl.NotifyCode(curPlayer, 'GeRen_lhs_0', [content])  | 
|     #curPlayer.Sync_ExpGetView(content)  | 
|     curMissionID = curMission.GetMissionID()  | 
|     FBLogic.DoFB_OnFinishRunAroundTask(curPlayer, curMissionID, content)  | 
|     GameWorld.Log("MissionID = %s , exp = %s " % (curMission.GetMissionID() , content) , curPlayer.GetID())  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ɾ³ýÍæ¼Ò½ðÇ®  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Del_Money form_value="ÊÇ·ñÈ¡¶Ô»°µÄÖµ" value="form_valueΪ¿ÕÈ¡" moneytype="1Ôª±¦2Àñȯ3ÒøÁ½" maxItem="ÐèÒªÎïÆ·ÊýÁ¿" itemID="20410"/>   | 
| def DoType_Del_Money(curPlayer, curMission, curActionNode):  | 
|     #¿ÛÇ®  | 
|     #¸ñʽ<del_money form_value = ""value="" moneytype=""/>  | 
|     value = None  | 
|     form_value = curActionNode.GetAttribute("form_value")  | 
|     if form_value != "":  | 
|         value = int(QuestRunnerValue.GetNPCTalkReplaceValue(curPlayer, curMission, form_value))  | 
|     else:  | 
|         value = int(curActionNode.GetAttribute("value"))      | 
|       | 
|     maxItemCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("maxItem"), 0)  | 
|     itemID = GameWorld.ToIntDef(curActionNode.GetAttribute("itemID"), 0)  | 
|     if maxItemCnt and itemID: #δÊÕ¼¯µÄµÀ¾ß¸öÊý³ËÒÔµ¥¼Û  | 
|         haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)  | 
|         value = max(0, maxItemCnt-haveCnt)*value  | 
|       | 
|     moneytype = int(curActionNode.GetAttribute("moneytype"))  | 
|       | 
| #    if moneytype not in ChConfig.Def_MoneyType_All:  | 
| #        GameWorld.Log("##Òì³£moneytype = %sÌî´íÀ" % (moneytype))  | 
| #        return  | 
|       | 
|     curMissionID = 0  | 
|     if curMission == None:  | 
|         curMissionID = 0  | 
|     else:  | 
|         curMissionID = curMission.GetMissionID()  | 
|     costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, moneytype, value)  | 
|     if not costMoneyList:  | 
|         GameWorld.Log("##¸¶·ÑÒì³£,Íæ¼Ò½ðÇ®²»×ã,ÈÎÎñmissionID = %s" % (curMissionID) , curPlayer.GetPlayerID())  | 
|         EventShell.DoExitEvent(curPlayer)  | 
|         return  | 
|     #¸¶Ç®  | 
|     for moneyType, moneyNum in costMoneyList:  | 
|         if not PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_MissionDel, {"MissionID":curMissionID}):  | 
|             GameWorld.Log("##¸¶·ÑÒì³£,Íæ¼Ò½ðÇ®²»×ã,ÈÎÎñmissionID = %s" % (curMissionID) , curPlayer.GetPlayerID())  | 
|             EventShell.DoExitEvent(curPlayer)  | 
|             return  | 
|       | 
|     GameWorld.Login_Interface_GoldRec(curPlayer , 0 , 0 , 'MissionID_%s_Cost' % (curMissionID), moneytype, value)  | 
|     return  | 
| #---------------------------------------------------------------------  | 
| ##Ìí¼ÓÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Item id="ÎïÆ·ID" count="ÎïÆ·ÊýÁ¿" starLV="ÐǼ¶" bind="ÊÇ·ñ°ó¶¨"   | 
| #        packtype="1,2±³°üË÷Òý" equipIndex="×°±¸Î»ÖÃ" suite="ÊÇ·ñÌ××°»¯" addAttrLV="×·¼ÓµÈ¼¶"£¬isLucky="ÊÇ·ñÓÐÐÒÔË"  | 
| #        skillBoostEff="[¼¼ÄÜЧ¹ûÔöÇ¿Ë÷Òý, Öµ]", holeCount="¿×Êý" isGreat="1" baseAttrRate="¿ÉÇ¿»¯µÄ×°±¸»ù´¡ÊôÐÔËæ»ú¼ÓÇ¿±ÈÀýĬÈÏ10000"  | 
| #        greatAttr="[׿ԽÊôÐÔÁбí]" />    | 
| def DoType_Add_Item(curPlayer, curMission, curActionNode):  | 
|     curItemCount = GameWorld.ToIntDef(curActionNode.GetAttribute("count"), 1)  | 
|       | 
|     curItemID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)          | 
|     if curItemID == 0:  | 
|         curItemID = curMission.GetProperty(QuestCommon.Def_Item_ID)  | 
|       | 
|     packInfo = curActionNode.GetAttribute("packtype")  | 
|   | 
|     packTypeList = [IPY_GameWorld.rptItem]  | 
|     if packInfo != '':  | 
|         packTypeList = eval('[' + packInfo + ']')  | 
|       | 
|     #ÎïÆ·ÐÇÊý  | 
|     itemStarLV = GameWorld.ToIntDef(curActionNode.GetAttribute("starLV"), 0)  | 
|       | 
|     #ÎïÆ·ÊÇ·ñ°ó¶¨  | 
|     bind = True if curActionNode.GetAttribute("bind") else False  | 
|       | 
|     #ÎïÆ·ÊÇ·ñÌ××°»¯  | 
|     isSuite = True if curActionNode.GetAttribute("suite") else False  | 
|       | 
|     #×·¼Ó  | 
|     addAttrLV = GameWorld.ToIntDef(curActionNode.GetAttribute("addAttrLV"), 0)  | 
|       | 
|     #ÐÒÔË  | 
|     isLucky = GameWorld.ToIntDef(curActionNode.GetAttribute("isLucky"), 0)  | 
|       | 
|     #×°±¸¼¼ÄÜ  | 
|     skillBoostEff = curActionNode.GetAttribute("skillBoostEff")  | 
|     skillBoostEff = [] if skillBoostEff == "" else eval(skillBoostEff)   | 
|     #¿×Êý  | 
|     holeCount = GameWorld.ToIntDef(curActionNode.GetAttribute("holeCount"), 0)  | 
|       | 
|     #×°±¸Î»Öà  | 
|     equipIndex = GameWorld.ToIntDef(curActionNode.GetAttribute("equipIndex"), -1)  | 
|       | 
|     #׿Խ  | 
|     isGreat = GameWorld.ToIntDef(curActionNode.GetAttribute("isGreat"), 0)  | 
|       | 
|     #׿ԽÊôÐÔÁÐ±í  | 
|     greatAttr = curActionNode.GetAttribute("greatAttr")  | 
|     greatAttrList = [] if greatAttr == "" else eval(greatAttr)  | 
|       | 
|     #¿ÉÇ¿»¯µÄ×°±¸»ù´¡ÊôÐÔËæ»ú¼ÓÇ¿±ÈÀýĬÈÏ10000  | 
|     baseAttrRate = GameWorld.ToIntDef(curActionNode.GetAttribute("baseAttrRate"), ShareDefine.Def_MaxRateValue)  | 
|     AddEventItem(curPlayer, curMission, curItemID, curItemCount, None, itemStarLV,  | 
|                  bind, False, packTypeList, isSuite, addAttrLV, isLucky,  | 
|                  skillBoostEff, holeCount, equipIndex, isGreat, baseAttrRate, greatAttrList)  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´Ðи±±¾Âß¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Do_Fb_Onkill />   | 
| def DoType_Do_Fb_Onkill(curPlayer, curMission, curActionNode):  | 
|     tick = GameWorld.GetGameWorld().GetTick()  | 
|     FBLogic.DoFBOnKill_NPC(curPlayer , tick)  | 
|     return  | 
|   | 
|   | 
| ##Ö´Ðи±±¾Âß¼(Íê³ÉijÈÎÎñʱ֪ͨµ½¸±±¾)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| def DoType_Do_Fb_Achieve_Task(curPlayer, curMission, curActionNode):  | 
|       | 
|     achieve = curActionNode.GetAttribute("achieve")  | 
|       | 
|     if not achieve.isdigit():  | 
|         GameWorld.Log('###ÈÎÎñ´«¹ýÀ´µÄÖµÒì³£,ÎÞ·¨×ª»»³ÉÊý×Ö = %s' % (achieve))  | 
|         return  | 
|       | 
|     FBLogic.DoFB_OnAchieveTask(curPlayer, int(achieve))  | 
|     return  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÔÚµØÉÏ´´½¨ÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Drop_Item id="ÎïÆ·ID" count="ÎïÆ·ÊýÁ¿" starLV="ÐǼ¶" bind="ÊÇ·ñ°ó¶¨"   | 
| #         suite="ÊÇ·ñÌ××°»¯" addAttrLV="×·¼ÓµÈ¼¶"£¬isLucky="ÊÇ·ñÓÐÐÒÔË"  | 
| #        skillBoostEff="[¼¼ÄÜЧ¹ûÔöÇ¿Ë÷Òý, Öµ]", holeCount="¿×Êý", isGreat="1", effIndex="1" , dropDist="µôÂ䷶ΧĬÈÏ3"  | 
| #        aroundPlayer="1" baseAttrRate="¿ÉÇ¿»¯µÄ×°±¸»ù´¡ÊôÐÔËæ»ú¼ÓÇ¿±ÈÀýĬÈÏ10000" greatAttr="[׿ԽÊôÐÔÁбí]" />    | 
| def DoType_Drop_Item(curPlayer, curMission, curActionNode):  | 
|     curNPC = CurrentKillNPC  | 
|       | 
|     killPlayerID = curPlayer.GetPlayerID()  | 
|       | 
|     count = GameWorld.ToIntDef((curActionNode.GetAttribute("count")), 1)  | 
|       | 
|     curItemID = GameWorld.ToIntDef((curActionNode.GetAttribute("id")), 0)  | 
|     if curItemID <= 0:  | 
|         return  | 
|       | 
|     starLV = GameWorld.ToIntDef((curActionNode.GetAttribute("starLV")), 0)  | 
|       | 
|     isSuite = GameWorld.ToIntDef((curActionNode.GetAttribute("suite")), 0)  | 
|       | 
|     bind = GameWorld.ToIntDef((curActionNode.GetAttribute("bind")), 1)  | 
|       | 
|     #×·¼Ó  | 
|     addAttrLV = GameWorld.ToIntDef(curActionNode.GetAttribute("addAttrLV"), 0)  | 
|       | 
|     #ÐÒÔË  | 
|     isLucky = GameWorld.ToIntDef(curActionNode.GetAttribute("isLucky"), 0)  | 
|       | 
|     #×°±¸¼¼ÄÜ  | 
|     skillBoostEff = curActionNode.GetAttribute("skillBoostEff")  | 
|     skillBoostEff = [] if skillBoostEff == "" else eval(skillBoostEff)   | 
|       | 
|     #¿×Êý  | 
|     holeCount = GameWorld.ToIntDef(curActionNode.GetAttribute("holeCount"), 0)  | 
|       | 
|     #׿Խ  | 
|     isGreat = GameWorld.ToIntDef(curActionNode.GetAttribute("isGreat"), 0)  | 
|       | 
|     #׿ԽÊôÐÔÁÐ±í  | 
|     greatAttr = curActionNode.GetAttribute("greatAttr")  | 
|     greatAttrList = [] if greatAttr == "" else eval(greatAttr)  | 
|       | 
|     #¿ÉÇ¿»¯µÄ×°±¸»ù´¡ÊôÐÔËæ»ú¼ÓÇ¿±ÈÀýĬÈÏ10000  | 
|     baseAttrRate = GameWorld.ToIntDef(curActionNode.GetAttribute("baseAttrRate"), ShareDefine.Def_MaxRateValue)  | 
|   | 
|     #ÉèÖÃÎïÆ·ÊôÐÔ  | 
|     curItem = CreatMissionItem(curItemID, starLV, addAttrLV, isSuite, bind,  | 
|                                isLucky, skillBoostEff, count, holeCount, isGreat, baseAttrRate, greatAttrList)  | 
|           | 
|     if not curItem:  | 
|         GameWorld.Log('###´´½¨µØÉÏÎïÆ·Òì³£,ÎÞ´ËIDÎïÆ· = %s' % (curItemID))  | 
|         return  | 
|       | 
|     if curActionNode.GetAttribute("aroundPlayer") == "1":  | 
|         posX, posY = curPlayer.GetPosX(), curPlayer.GetPosY()  | 
|     else:  | 
|         posX, posY = curNPC.GetPosX(), curNPC.GetPosY()  | 
|           | 
|     #µôÂ䷶Χ  | 
|     dropDist = GameWorld.ToIntDef(curActionNode.GetAttribute("dropDist"), ChConfig.Def_DropItemDist)  | 
|       | 
|     dropPos = GameMap.GetEmptyPlaceInArea(posX, posY, dropDist)  | 
|       | 
|     effIndex = GameWorld.ToIntDef((curActionNode.GetAttribute("effIndex")), 0)  | 
|       | 
|     curMapItem = ChItem.AddMapDropItem(dropPos.GetPosX(), dropPos.GetPosY(), curItem, effIndex)  | 
|     curMapItem.SetOwnerType(ChConfig.Def_NPCHurtTypePlayer)  | 
|     curMapItem.SetOwnerID(killPlayerID)  | 
|               | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖÃÈËÎïѪÁ¿°Ù·Ö±È  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_Hp_Percent value="°Ù·Ö±È"/>   | 
| def DoType_Set_Hp_Percent(curPlayer, curMission, curActionNode):  | 
|     value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"))  | 
|       | 
|     maxHP = curPlayer.GetMaxHP()  | 
|     playerHP = maxHP * value / ShareDefine.Def_Percentage  | 
|       | 
|     smallHP = 1  | 
|     if maxHP < smallHP:  | 
|         GameWorld.ErrLog("Íæ¼Ò×î´óѪÁ¿: %s" % maxHP, curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     #·À·¶¾À´í ×îÉÙ1µãѪ£¬×î¶àÂúѪ  | 
|     playerHP = GameWorld.ToIntArea(playerHP, smallHP, maxHP)  | 
|       | 
|     curPlayer.SetHP(playerHP)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖÃÈËÎï·¨Á¿°Ù·Ö±È  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_Mp_Percent value="°Ù·Ö±È"/>   | 
| def DoType_Set_Mp_Percent(curPlayer, curMission, curActionNode):  | 
|     value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"))  | 
|       | 
|     maxMP = curPlayer.GetMaxMP()  | 
|     playerMP = maxMP * value / ShareDefine.Def_Percentage  | 
|       | 
|     smallMP = 1  | 
|     if maxMP < smallMP:  | 
|         GameWorld.ErrLog("Íæ¼Ò×î´ó·¨Á¦: %s" % maxMP, curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     #·À·¶¾À´í ×îÉÙ1µã·¨£¬×î¶àÂú·¨  | 
|     playerMP = GameWorld.ToIntArea(playerMP, smallMP, maxMP)  | 
|       | 
|     curPlayer.SetMP(playerMP)  | 
|   | 
| ##ÉèÖóèÎïѪÁ¿°Ù·Ö±È  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_Pet_Hp_Percent value="°Ù·Ö±È"/>   | 
| def DoType_Set_Pet_Hp_Percent(curPlayer, curMission, curActionNode):  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Çå³ýÈËÎïBUFF  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Clear_Buff id="¼¼ÄÜTypeID"/>   | 
| def DoType_Clear_Buff(curPlayer, curMission, curActionNode):  | 
|     #<clear_buff id = "">  | 
|     skillTypeID = int(curActionNode.GetAttribute("id"))  | 
|     tick = GameWorld.GetGameWorld().GetTick()  | 
|     if BuffSkill.DelBuffBySkillTypeID(curPlayer, skillTypeID, tick):  | 
|           | 
|         #ÖØË¢ËùÓÐÊôÐÔ  | 
|         curControl = PlayerControl.PlayerControl(curPlayer)  | 
|         curControl.RefreshAllState()  | 
|   | 
|     return  | 
|   | 
|   | 
| #===============================================================================  | 
| # #¿Û³ýɾ³ý¸´»îÐéÈõ½ðÇ®  | 
| # def DoType_Del_Clear_Born_Buff_Money(curPlayer, curMission, curActionNode):  | 
| #    return  | 
| #===============================================================================  | 
|   | 
| ##ŵØÒ½Éú¿ÛÇ®  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Lost_Money_By_Lv moneytype=""/>   | 
| def DoType_Lost_Money_By_Lv(curPlayer, curMission, curActionNode):  | 
|     return  | 
|       | 
| #---------------------------------------------------------------------  | 
| ##¿Û³ý¾º¼¼µã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <DoType_Lost_Vspoint value=""/>   | 
| def DoType_Lost_Vspoint(curPlayer, curMission, curActionNode):  | 
|     value = int(curActionNode.GetAttribute("value"))  | 
|     PlayerControl.ReduceVsSportsPoint(curPlayer, value)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¿ªÍ¨²Ö¿â  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Open_Warehouse lv="²Ö¿âµÈ¼¶"/>   | 
| def DoType_Open_Warehouse(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<Open_Warehouse lv=""/>  | 
|     warehouseLV = int(curActionNode.GetAttribute("lv"))  | 
|     EventShell.ResetWarehouse(curPlayer, warehouseLV)  | 
|     #ÉèÖòֿâ״̬ΪûÓпªÊ¼²Ö¿â  | 
| #    curPlayer.SetWarehouseState(IPY_GameWorld.wsNull)  | 
| #    Func_6.OpenWarehouse(curPlayer)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸øÍæ¼ÒÌáʾÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Notifycode msg="Ìæ»»µÄ×Ö·û´®" par%d_type="ÌáʾÀàÐÍint" par%d_value="Ìáʾֵ" par%d_dict_value="ÈÎÎñ×ÖµäÐÅÏ¢" %dÇø¼ä0~9 />   | 
| def DoType_Notifycode(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<NotifyCode msg = "xxxx" par1_type = "int" par1_value="10".../>  | 
|     msg = curActionNode.GetAttribute("msg")  | 
|       | 
|     parList = []  | 
|     for i in range(0, 10):  | 
|         parType = curActionNode.GetAttribute("par%d_type" % i)  | 
|         parValue = curActionNode.GetAttribute("par%d_value" % i)  | 
|         dictValue = curActionNode.GetAttribute("par%d_dict_value" % i)  | 
|         if parType == "int":  | 
|             if parValue != "":  | 
|                 parValue = int(parValue)  | 
|                 parList.append(parValue)  | 
|             if dictValue != "":  | 
|                 dictValue = curMission.GetProperty(dictValue)  | 
|                 parList.append(dictValue)  | 
|                        | 
|     PlayerControl.NotifyCode(curPlayer, msg, parList)  | 
|       | 
| #---------------------------------------------------------------------  | 
| ##ÊÀ½ç¹ã²¥  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <WorldNotify msg="mark" par = '²ÎÊý'/>   | 
| def DoType_Worldnotify(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<WorldNotify msg = "xxxx" par = "1"/>  | 
|     msg = curActionNode.GetAttribute("msg")  | 
|     par = GameWorld.ToIntDef(curActionNode.GetAttribute("par"), 0)  | 
|       | 
|     #¹¹½¨²ÎÊýÁÐ±í  | 
|     parList = []  | 
|       | 
|     if par == 1:  | 
|         #²ÎÊý1ÎªÍæ¼ÒÃû×Ö  | 
|         parList = [curPlayer.GetName()]  | 
|       | 
|     PlayerControl.WorldNotify(0, msg, parList)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¿ªÍ¨°ü¹ü  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Open_Backpack lv="°ü¹üµÈ¼¶"/>   | 
| def DoType_Open_Backpack(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<Open_Backpack lv=""/>  | 
|     backpackLV = int(curActionNode.GetAttribute("lv"))  | 
|     EventShell.ResetBackPack(curPlayer, backpackLV)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ìí¼Ó³ÆºÅ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Title id="³ÆºÅID" />         | 
| def DoType_Add_Title(curPlayer, curMission, curActionNode):  | 
|   | 
|     return  | 
| #---------------------------------------------------------------------  | 
| ##°´ÐÔ±ðËæ»ú¸øÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Random_Item_By_Sex id="ÎïÆ·ID" value="ÎïÆ·ÊýÁ¿" />    | 
| def DoType_Add_Random_Item_By_Sex(curPlayer, curMission, curActionNode):  | 
|     ItemID = curActionNode.GetAttribute("id")  | 
|     if ItemID == "":  | 
|         GameWorld.Log("Error : DoType_Add_Random_Item_By_Sex , id = NULL" , curPlayer.GetPlayerID())  | 
|         return  | 
|     curItemCount = curActionNode.GetAttribute("value")  | 
|     if curItemCount == "":  | 
|         curItemCount = 1  | 
|     else:  | 
|         curItemCount = int(curItemCount)  | 
|       | 
|     ItemIDList = ItemID.split("/")  | 
|       | 
|     #»ñµÃÐÔ±ð,1ÄÐ2Å®  | 
|     curPlayerSex = curPlayer.GetSex()  | 
|     #»ñÈ¡µ±Ç°ÐÔ±ð»ñµÃÎïÆ·ÁÐ±í    | 
|     curItemList = ItemIDList[curPlayerSex - 1].split(",")  | 
|     #Ëæ»úÑ¡ÔñÎïÆ·ÐòºÅ  | 
|     randomItemID = random.randint(0, len(curItemList) - 1)  | 
|     #¸ù¾ÝËæ»úÊý»ñµÃÎïÆ·ID,²¢×ª»»ÎªÕûÐÍ  | 
|     curItemID = int(curItemList[randomItemID])  | 
|       | 
|     AddEventItem(curPlayer, curMission, curItemID, curItemCount)  | 
|       | 
| #---------------------------------------------------------------------  | 
| ##°´Ö°ÒµËæ»ú¸øÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Random_Item_By_Job id="ÎïÆ·ID" value="ÎïÆ·ÊýÁ¿" />    | 
| def DoType_Add_Random_Item_By_Job(curPlayer, curMission, curActionNode):  | 
|     itemID = curActionNode.GetAttribute("id")  | 
|       | 
|     if itemID == "":  | 
|         GameWorld.Log("Error : DoType_Add_Random_Item_By_Sex , id = NULL" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     curItemCount = curActionNode.GetAttribute("value")  | 
|       | 
|     if curItemCount == "":  | 
|         curItemCount = 1  | 
|     else:  | 
|         curItemCount = int(curItemCount)  | 
|       | 
|     itemIDList = itemID.split("/")  | 
|       | 
|     #»ñµÃÖ°Òµ:0:½£×Ú 1:Æø×Ú 2:ħ×Ú  | 
|     curPlayerJob = curPlayer.GetJob()  | 
|   | 
|     #»ñÈ¡µ±Ç°ÐÔ±ð»ñµÃÎïÆ·ÁÐ±í    | 
|     curItemList = itemIDList[curPlayerJob].split(",")  | 
|     #Ëæ»úÑ¡ÔñÎïÆ·ÐòºÅ  | 
|     randomItemID = random.randint(0, len(curItemList) - 1)  | 
|     #¸ù¾ÝËæ»úÊý»ñµÃÎïÆ·ID,²¢×ª»»ÎªÕûÐÍ  | 
|     curItemID = int(curItemList[randomItemID])  | 
|     if curItemID == 0:  | 
|         return  | 
|       | 
|     AddEventItem(curPlayer, curMission, curItemID, curItemCount)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸ù¾ÝÁбíɾ³ýÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Del_Item_List id="ÎïÆ·Áбí 50044/50045...50052" />    | 
| def DoType_Del_Item_List(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<del_item_List id="50044/50045...50052"/>  | 
|     ItemID = curActionNode.GetAttribute("id")  | 
|       | 
|     #»ñµÃÎïÆ·ÁÐ±í  | 
|     ItemIDList = ItemID.split("/")  | 
|     #»ñµÃÍæ¼Ò±³°üÎïÆ·  | 
|     PlayerItem = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)  | 
|     #±éÀúËæ»úɾ³ýÎïÆ·ÁÐ±í  | 
|     for i in range(0, len(ItemIDList)):  | 
|         delItemID = int(ItemIDList[i])  | 
|         #±éÀúÍæ¼Ò±³°ü  | 
|         for j in range(0, PlayerItem.GetCount()):  | 
|             curItem = PlayerItem.GetAt(j)  | 
|             curItemID = curItem.GetItemTypeID()  | 
|             if delItemID != curItemID :  | 
|                 continue  | 
|               | 
|             curItemCnt = curItem.GetCount()  | 
|             #PlayerControl.NotifyCode(curPlayer, "LostRes", [delItemID, curItemCnt])  | 
|             #curPlayer.Sync_DelItemView(delItemID, 1)  | 
|             #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|             if GameWorld.IsMissonDR(curPlayer):  | 
|                 missionID = QuestCommon.GetMissionID(curMission)  | 
|                 delItemInfoDict = {"ItemID":curItemID, "ItemCount":curItemCnt, "IsBind":curItem.GetIsBind(),  | 
|                                    "ItemGUID":curItem.GetGUID(), "MissionID":missionID}  | 
|                 DataRecordPack.DR_DeleteItem(curPlayer, "Event_Del_Item_List", delItemInfoDict)  | 
|   | 
|             #ɾ³ýÎïÆ·  | 
|             curItem.Clear()  | 
|       | 
|     return  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ìí¼ÓËæ»úÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Random_Item id="ÎïÆ·ID" value="ÎïÆ·ÊýÁ¿" />      | 
| def DoType_Add_Random_Item(curPlayer, curMission, curActionNode):  | 
|     ItemID = curActionNode.GetAttribute("id")  | 
|     if ItemID == "":  | 
|         GameWorld.Log("Error : DoType_Add_Random_Item_By_Sex , id = NULL" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     curItemCount = curActionNode.GetAttribute("value")  | 
|     if curItemCount == "":  | 
|         curItemCount = 1  | 
|     else:  | 
|         curItemCount = int(curItemCount)  | 
|   | 
|     ItemIDList = ItemID.split("/")  | 
|     #Ëæ»úÑ¡ÔñÎïÆ·ÐòºÅ  | 
|     randomItemID = random.randint(0, len(ItemIDList) - 1)  | 
|     #¸ù¾ÝËæ»úÊý»ñµÃÎïÆ·ID,²¢×ª»»ÎªÕûÐÍ  | 
|     curItemID = int(ItemIDList[randomItemID])  | 
|       | 
|     AddEventItem(curPlayer, curMission, curItemID, curItemCount)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ## ÅжÏïÚ³µµÈ¼¶  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return bool  | 
| #  @remarks <Check_Truck_Lv, trucklv="ïÚ³µµÈ¼¶"/>  | 
| def ConditionType_Check_Truck_Lv(curPlayer, curMission, curConditionNode):  | 
|     truckLv = GameWorld.ToIntDef(curConditionNode.GetAttribute("trucklv"), -1)  | 
|       | 
|     curTruckLv = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TruckLV)  | 
|     return curTruckLv == truckLv  | 
|   | 
|   | 
| ## ¸øïÚ³µÈÎÎñ½±Àø  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return ·µ»ØÖµÎÞÒâÒå  | 
| def DoType_Give_Truck_Award(curPlayer, curMission, curActionNode):  | 
|     curTruck = curPlayer.GetTruck()  | 
|     if not curTruck:  | 
|         #ûÓÐïÚ³µ  | 
|         return  | 
|       | 
|     PlayerTruck.GiveTruckAward(curPlayer, curTruck)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸øÍæ¼Ò½±ÀøµÄ½ðÇ®  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Money value="Öµ" type="»õ±ÒÀàÐÍ" />   | 
| def DoType_Add_Money(curPlayer, curMission, curActionNode):  | 
|     #¼ÓÇ®  | 
|     value = int(curActionNode.GetAttribute("value"))  | 
|     type = curActionNode.GetAttribute("type")  | 
|       | 
|     type = GameWorld.ToIntDef(type, IPY_GameWorld.TYPE_Price_Silver_Paper)  | 
|     addDataDict = {ChConfig.Def_Give_Reason_SonKey:curMission.GetMissionID()}  | 
|     if not PlayerControl.GiveMoney(curPlayer, type, value, ChConfig.Def_GiveMoney_Mission, addDataDict, False):  | 
|         return  | 
|       | 
|     #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         DataRecordPack.DR_EventAddMoney(curPlayer, "Add_Money", curMission.GetMissionID(), type, value)  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÈÙÓþ»»¹¤×Ê  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Hornor_Exchane_Money/>  | 
| def DoType_Hornor_Exchane_Money(curPlayer, curMission, curActionNode):  | 
|     #»ñµÃ×é¶ÓÈÙÓþ  | 
|     hornor = curPlayer.GetTeamHornor()  | 
|     #¸øÇ®,»»ÈÙÓþ  | 
|     money = hornor / ChConfig.Def_TeamHornor_Money  | 
|     hornor -= money * ChConfig.Def_TeamHornor_Money  | 
|     curPlayer.SetTeamHornor(hornor)  | 
|     addDataDict = {ChConfig.Def_Give_Reason_SonKey:"HornorExchane"}  | 
|     if not PlayerControl.GiveMoney(curPlayer, ChConfig.Def_TeamHornor_MoneyType, money, ChConfig.Def_GiveMoney_Mission, addDataDict):  | 
|         return  | 
|       | 
|     #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         #59 Á÷Ïò¼Ç¼ Òòʼþ»ñµÃ½ðÇ®  | 
|         DataRecordPack.DR_EventAddMoney(curPlayer, "Hornor_Exchane_Money", curMission.GetMissionID(),  | 
|                                         ChConfig.Def_TeamHornor_MoneyType, money)  | 
|   | 
|     GameWorld.Log("ÈÙÓþ»»¹¤×Ê »ñµÃ½ðÇ® = %s,Ê£ÓàÈÙÓþ = %s" % (money , hornor) , curPlayer.GetPlayerID())  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¿Û»Ö¸´ÂíÆ¥Ä;ÃÇ®  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Del_Horse_Money/>      | 
| def DoType_Del_Horse_Money(curPlayer, curMission, curActionNode):  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¿ÛÉèÖÃÈÎÎñÐǼ¶»õ±ÒÏûºÄ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Del_Set_Mission_Star_Money moneytype="1Ôª±¦2Àñȯ3ÒøÁ½"/>      | 
| def DoType_Del_Set_Mission_Star_Money(curPlayer, curMission, curActionNode):  | 
|     missionID = curMission.GetMissionID()  | 
|     curMissionData = FindQuestFunc(missionID)  | 
|     if not curMissionData:  | 
|         return  | 
|     missionType = curMissionData.Type  | 
|     Def_Around_Star = GetRunKey(missionType, Key_Around_Star)  | 
|       | 
|     moneyType, costFormat = ReadChConfig.GetEvalChConfig("RunAround_SetStarCost")  | 
|       | 
|     reLV = curPlayer.GetLV()  | 
|     reExp = 0  | 
|     reMoney = 0  | 
|     aroundStar = curMission.GetProperty(Def_Around_Star)  | 
|     moneyPrice = int(eval(costFormat))  | 
|       | 
|     if not PlayerControl.PayMoney(curPlayer, moneyType, moneyPrice, ChConfig.Def_Cost_MissionStar, {"MissionID":missionID}):  | 
|         GameWorld.Log("###ÈÎÎñÉèÖÃÐǼ¶¸¶·ÑÒì³£,Íæ¼Ò½ðÇ®²»¹» MissionID=%s" % curMission.GetMissionID() , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸øÍæ¼ÒÊ£Ó༼ÄÜµã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Freeskillpoint value="µãÊý"/>   | 
| def DoType_Add_Freeskillpoint(curPlayer, curMission, curActionNode):  | 
|     #¼Ó¼¼ÄÜµã  | 
|     #¸ñʽ: <add_freeskillpoint value=""/>  | 
|     value = int(curActionNode.GetAttribute("value"))  | 
|     curPlayerFreeSkillPoint = curPlayer.GetFreeSkillPoint()  | 
|     curPlayer.SetFreeSkillPoint(curPlayerFreeSkillPoint + value)  | 
|   | 
|               | 
| #---------------------------------------------------------------------  | 
| ##¸øÍæ¼ÒÊ£ÓàÊôÐ﵋  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Freepoint value="µãÊý"/>       | 
| def DoType_Add_Freepoint(curPlayer, curMission, curActionNode):  | 
|     #¼ÓÊôÐ﵋  | 
|     #¸ñʽ: <add_freepoint value=""/>  | 
|     value = int(curActionNode.GetAttribute("value"))  | 
|     curPlayerFreePoint = curPlayer.GetFreePoint()  | 
|     curPlayer.SetFreePoint(curPlayerFreePoint + value)  | 
|       | 
|     DataRecordPack.DR_Freepoint(curPlayer, "Event", value, {"MissionID":curMission.GetMissionID()})  | 
|       | 
|   | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| # PlayerJob_Warrior,  #  ½£Ê¿,  | 
| # PlayerJob_Wizard,   #  Ä§·¨Ê¦,  | 
| # PlayerJob_Assassin, #  ¹¼ýÊÖ,  | 
| # PlayerJob_Chaplain, #  Ä§½£Ê¿,  | 
| # PlayerJob_Knight,   # ÆïÊ¿  | 
| # PlayerJob_ForceUser,# Ä§µ¼Ê¦  | 
| # PlayerJob_BowMaster,# Ê¥ÉäÊÖ  | 
| #===============================================================================  | 
| ##Íæ¼Òתְҵ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå <Change_Job checkLV="150" changeJob="4">  | 
| def DoType_Change_Job(curPlayer, curMission, curActionNode):  | 
|     playerID = curPlayer.GetID()  | 
|       | 
|     checkLV = GameWorld.ToIntDef(curActionNode.GetAttribute("checkLV"), 0)  | 
|     if not checkLV:  | 
|         GameWorld.Log("change job error! checkLV=%s" % checkLV, playerID)  | 
|         return  | 
|   | 
|     curLV = curPlayer.GetLV()  | 
|     if curLV < checkLV:  | 
|         GameWorld.Log("change job error! checkLV=%s curlv=%s" % (checkLV, curLV), playerID)  | 
|         return  | 
|       | 
|     changeJob = GameWorld.ToIntDef(curActionNode.GetAttribute("changeJob"), 0)  | 
|     #ÑéÖ¤Ö°Òµ  | 
|     if not changeJob:  | 
|         GameWorld.Log("change job error! changeJob=%s" % changeJob, playerID)  | 
|         return  | 
|           | 
|     #curJob = curPlayer.GetJob()  | 
|   | 
|     #¼ÆËãµãÊý, »Ö¸´µÈ¼¶²îµÄµãÊý  | 
|     #addPointDict = ReadChConfig.GetEvalChConfig('lvUp_Point')  | 
|       | 
|     #addPoint = (curLV - checkLV)*(addPointDict.get(changeJob) - addPointDict.get(curJob))  | 
|       | 
|     #ÉèÖÃÍæ¼Ò¿É¼ÓÊôÐ﵋  | 
|     #curPlayer.SetFreePoint(curPlayer.GetFreePoint() + addPoint)  | 
|     #DataRecordPack.DR_Freepoint(curPlayer, "ChangeJob", addPoint, {"job":changeJob})  | 
|       | 
|     #ÉèÖÃÖ°Òµ  | 
|     curPlayer.SetJob(changeJob)  | 
|       | 
|     playerControl = PlayerControl.PlayerControl(curPlayer)  | 
|     playerControl.RefreshAllState()  | 
|       | 
|     PlayerReincarnation.DoPlayerReincarnation(curPlayer)  | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ɾ³ýÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Del_Item dict_id="×ÖµäÃû" id="dict_idΪ¿Õ¶ÁÈ¡" dict_value="×ÖµäÃû" value="dict_valueΪ¿Õ¶ÁÈ¡" />  | 
| def DoType_Del_Item(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ<del_item value="1" id="50029"/>  | 
|     dict_id = curActionNode.GetAttribute("dict_id")  | 
|     dict_value = curActionNode.GetAttribute("dict_value")  | 
|     if dict_id == "":  | 
|         id = int(curActionNode.GetAttribute("id"))  | 
|     else:  | 
|         id = curMission.GetProperty(dict_id)  | 
|     #GameWorld.Log("ÈÎÎñID£º%d"%(id))  | 
|     if dict_value == "":  | 
|         conditionValue = int(curActionNode.GetAttribute("value"))  | 
|     else:    | 
|         conditionValue = curMission.GetProperty(dict_value)  | 
|       | 
|     #GameWorld.Log("packtype = %s"%curActionNode.GetAttribute("packtype"))  | 
|     packType = GameWorld.ToIntDef(curActionNode.GetAttribute("packtype"), IPY_GameWorld.rptItem)  | 
|       | 
|     inputGuidList = []  | 
|     delResult = ItemControler.DelPlayerItem(curPlayer, packType, id, conditionValue, delEventItem=True, guidList=inputGuidList)  | 
|     if not delResult:  | 
|         return  | 
|   | 
|     #PlayerControl.NotifyCode(curPlayer, "LostRes", [id,conditionValue])  | 
|     #curPlayer.Sync_DelItemView(id, conditionValue)  | 
|           | 
|     guidStr = ''  | 
|     for guid in inputGuidList:  | 
|         guidStr += ' %s' % guid  | 
|     #31.        Òòʼþh³ý   Í¬ÉÏ  | 
|     if not curMission:  | 
|         missionID = 0  | 
|     else:  | 
|         missionID = curMission.GetMissionID()  | 
|           | 
|     #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         delItemInfoDict = {"PackType":packType, "ItemID":id, "ItemCount":conditionValue,  | 
|                            "MissionID":missionID}  | 
|         DataRecordPack.DR_DeleteItem(curPlayer, "Event_Del_Item", delItemInfoDict)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÔËÐзÖÖ§½Úµã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Run_Embranchment id="ÔËÐеÄID" />  | 
| def DoType_Run_Embranchment(curPlayer, curMission, curActionNode):  | 
|     #<Run_Embranchment id = "1"/>  | 
|     #ÔËÐзÖÖ§½Úµã  | 
|     questNode = curPlayer.GetCurrentQuestNode()  | 
|       | 
|     if questNode == None or questNode.IsEmpty():  | 
|         #ÕÒ²»µ½·ÖÖ§½Úµã  | 
|         GameWorld.Log("DoType_Run_Embranchment ÕÒ²»µ½·ÖÖ§½Úµã" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     runID = int(curActionNode.GetAttribute("id"))  | 
|     curPlayer.SetEventState(TYPE_Event_Do)  | 
|     for i in range(0, questNode.GetChildCount()):  | 
|         embranchmentNode = questNode.GetChild(i)  | 
|         if runID == int(embranchmentNode.GetAttribute("id")):  | 
|             if RunEmbranchmentNode(curPlayer, curMission, embranchmentNode) != True:  | 
| #                GameWorld.Log("ÔÚÕâ¸ö½ÚµãÔËÐÐʧ°Ü : %s"%curActionNode.GetXML())  | 
|                 pass  | 
|             return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÍÚ±¦Ìáʾ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Treasure_Notify code="Ìæ»»×Ö·û´®" />  | 
| def DoType_Treasure_Notify(curPlayer, curMission, curActionNode):  | 
|     #ÍÚ±¦ÈÎÎñÌáʾ  | 
|     global TreasureNotifyContentList  | 
|     content = curActionNode.GetAttribute("code")  | 
|     #content = GetMissionReplaceMsg(content, curMission)  | 
|     lv = curActionNode.GetAttribute("lv")  | 
|     curContent = TreasureNotifyContent()  | 
|     curContent.Content = content  | 
|     curContent.LV = lv  | 
|     curContent.MissionID = curMission.GetMissionID()  | 
|     #Ìí¼Óµ½ÌáʾÁÐ±í  | 
|     TreasureNotifyContentList.append(curContent)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÖØÐÂÔËÐÐÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Rerun_Quest/>   | 
| def DoType_Rerun_Quest(curPlayer, curMission, curActionNode):  | 
|     #ÔËÐзÖÖ§½Úµã  | 
|     questNode = curPlayer.GetCurrentQuestNode()  | 
|       | 
|     if questNode == None or questNode.IsEmpty():  | 
|         #ÕÒ²»µ½·ÖÖ§½Úµã  | 
|         GameWorld.Log("DoType_Rerun_Quest ÕÒ²»µ½·ÖÖ§½Úµã" , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     curPlayer.SetEventState(TYPE_Event_Do)  | 
|     for i in range(0, questNode.GetChildCount()):  | 
|         embranchmentNode = questNode.GetChild(i)  | 
|         if RunEmbranchmentNode(curPlayer, curMission, embranchmentNode) == True:  | 
|             return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Éú³É´«ËÍÁбí[[PosX,PosY],......]  | 
| # @param curStr Ìæ»»µÄ×Ö·û´®  | 
| # @return ·µ»ØÖµ, Éú³ÉµÄ´«ËÍÁÐ±í  | 
| # @remarks Éú³É´«ËÍÁбí[[PosX,PosY],......]  | 
| def __GetRandPosList(curStr):  | 
|     r = re.compile(r"[0-9]+\,[0-9]+")  | 
|     strList = r.findall(curStr)  | 
|       | 
|     result = []  | 
|     for str in strList:  | 
|         curStr = str.split(',')  | 
|         result.append((int(curStr[0]), int(curStr[1])))  | 
|           | 
|     return result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##³äÖµÍæ¼Ò×ø±ê  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_World_Pos id='µØÍ¼ID' id_list="µØÍ¼IDÁбíÈç1,2,3,4,5" rand_pos="Ëæ»ú×ø±ê´«ËÍ" posx="rand_posΪ¿Õ¶ÁÈ¡,×ø±êX" posY="rand_posΪ¿Õ¶ÁÈ¡,×ø±êY" range="ÈÝ´íÇøÓò" fbid="¸±±¾ID" fbid_min="¸±±¾IDËæ»úAÖµ" fbid_max="¸±±¾IDËæ»úBÖµ" />   | 
| def DoType_Set_World_Pos(curPlayer, curMission, curActionNode):  | 
|     idstr = curActionNode.GetAttribute("id")  | 
|     #ÔËÐзÖÖ§  | 
|     runID = 0  | 
|     if idstr != "":  | 
|         runID = int(idstr)  | 
|     else:  | 
|         idstr = curActionNode.GetAttribute("id_list")  | 
|         idList = idstr.split(",")  | 
|         index = random.randint(0, len(idList) - 1)  | 
|         runID = int(idList[index])  | 
|     #************************Ëæ»úX Y×ø±ê******************************  | 
|       | 
|     rand_pos = curActionNode.GetAttribute("rand_pos")  | 
|     if rand_pos != '':  | 
|         #Ëæ»úÁбíX£¬Y×ø±ê´«ËÍ  | 
|         result = __GetRandPosList(rand_pos)  | 
|         curPos = result[random.randint(0, len(result) - 1)]  | 
|         pos_x = curPos[0]  | 
|         pos_y = curPos[1]  | 
|     else:  | 
|         #Õý³£×ø±ê´«ËÍ  | 
|         #»ñµÃÒÆ¶¯X×ø±ê  | 
|         pos_x = int(curActionNode.GetAttribute("posx"))  | 
|         #»ñµÃÒÆ¶¯Y×ø±ê  | 
|         pos_y = int(curActionNode.GetAttribute("posy"))  | 
|           | 
|     posRangeStr = curActionNode.GetAttribute("range")  | 
|     if posRangeStr != '':  | 
|         orgPosRange = int(posRangeStr)  | 
|         posRange = random.randint(-orgPosRange, orgPosRange)  | 
|         pos_x = pos_x + posRange  | 
|         posRange = random.randint(-orgPosRange, orgPosRange)    | 
|         pos_y = pos_y + posRange  | 
|          | 
|       | 
|     #GameWorld.Log("pos_x:==============================%d"%pos_x)  | 
|     #GameWorld.Log("pos_y:==============================%d"%pos_y)  | 
|           | 
|     fbID = curActionNode.GetAttribute("fbid")  | 
|     minID = curActionNode.GetAttribute("fbid_min")  | 
|     maxID = curActionNode.GetAttribute("fbid_max")  | 
|     if fbID != "":  | 
|         fbID = GameWorld.ToIntDef(curActionNode.GetAttribute("fbid"), 0)  | 
|     elif minID != "" and maxID != "" :  | 
|         #**********************Ëæ»úµØÍ¼Ïß·*******************************  | 
|         fbID = random.randint(int(minID), int(maxID))  | 
|         fbID = GameWorld.ToIntDef(fbID, 0)  | 
|       | 
|     if fbID != "":  | 
|         PlayerControl.PlayerResetWorldPosFB(curPlayer, runID, pos_x, pos_y, False, fbID - 1)  | 
|         return  | 
|       | 
|     __NPCAllowResetWorldPos(curPlayer, runID, pos_x, pos_y, False)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##NPC´«ËÍͳһµ÷ÓÃ½Ó¿Ú  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param mapID µØÍ¼ID  | 
| # @param pos_x ×ø±êX  | 
| # @param pos_y ×ø±êY  | 
| # @param isTruck ÊÇ·ñЯ´øïÚ³µ  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks NPC´«ËÍͳһµ÷ÓÃ½Ó¿Ú  | 
| def __NPCAllowResetWorldPos(curPlayer, mapID, pos_x, pos_y, isTruck):  | 
|     if not PlayerControl.CanEnterMap(curPlayer, mapID):  | 
|         #Íæ¼Ò²»¿É½øÈë¸Ã³¡¾°  | 
|         return  | 
|   | 
|     #´«ËÍµØµã  | 
|     PlayerControl.PlayerResetWorldPos(curPlayer, mapID, pos_x, pos_y, isTruck)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÐÂÔöÌøÎèµöÓãʼþBuff  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Game_Event_Add_Buffer id="¼¼ÄÜID" count="Ìí¼Ó´ÎÊý" />   | 
| def DoType_Game_Event_Add_Buffer(curPlayer, curMission, curActionNode):  | 
|     tick = GameWorld.GetGameWorld().GetTick()  | 
|     id = int(curActionNode.GetAttribute("id"))  | 
|     count = GameWorld.ToIntDef(curActionNode.GetAttribute("count"), 1)  | 
|     curSkill = GameWorld.GetGameData().GetSkillBySkillID(id)  | 
|     for i in range(count):  | 
|         BuffSkill.DoAddBuff(curPlayer, IPY_GameWorld.bfIncBuff, curSkill, tick)  | 
|           | 
|     #Ë¢ÐÂÈËÎïÊôÐÔ  | 
|     playerControl = PlayerControl.PlayerControl(curPlayer)  | 
|     #Ë¢ÐÂËùÓÐ״̬  | 
|     playerControl.RefreshAllState()  | 
|   | 
|       | 
| #---------------------------------------------------------------------  | 
| ##Ôö¼Óbuff  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Buffer id="¼¼ÄÜID"/>   | 
| def DoType_Add_Buffer(curPlayer, curMission, curActionNode):  | 
|     tick = GameWorld.GetGameWorld().GetTick()  | 
|     buffId = int(curActionNode.GetAttribute("id"))  | 
|     curSkill = GameWorld.GetGameData().GetSkillBySkillID(buffId)  | 
|       | 
|     if not curSkill:  | 
|         GameWorld.ErrLog("DoType_Add_Buffer£¬ÕÒ²»µ½buffId = %s µÄÐÅÏ¢" % buffId)  | 
|         return  | 
|       | 
|     SkillCommon.AddBuffBySkillType(curPlayer , buffId , tick)  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÈÎÎñ(²»Ê¹ÓÃÁË)  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Run_Quest />   | 
| def DoType_Run_Quest(curPlayer, curMission, curActionNode):  | 
|     GameWorld.Log("ÏÖÔÚ²»Ö§³Ö!!!!!!!!!")  | 
|     EventShell.DoExitEvent(curPlayer)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##½áÊøÊ¼þ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Exitevent />      | 
| def DoType_Exitevent(curPlayer, curMission, curActionNode):  | 
|     #ĬÈϼì²éÊÇ·ñ¼ÌÐø¶Ô»°  | 
|     value = GameWorld.ToIntDef(curActionNode.GetAttribute("again"), 1)  | 
|   | 
|     if value == 1:  | 
|         DoTalkOrExit(curPlayer)  | 
|         return  | 
|           | 
|     EventShell.DoExitEvent(curPlayer)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¿ªÊ¼Ê¼þ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Beginevent />    | 
| def DoType_Beginevent(curPlayer, curMission, curActionNode):  | 
|     curPlayer.BeginEvent()  | 
|     curPlayer.SetEventState(TYPE_Event_Select)  | 
|   | 
| #---------------------------------------------------------------------  | 
| #enum            TMoneyType  | 
| #{  | 
| #    TYPE_Price_Gold_Money = 1,    | 
| #    TYPE_Price_Gold_Paper = 2,    | 
| #    TYPE_Price_Silver_Money = 3,  | 
| #    TYPE_Price_Silver_Paper = 4,  | 
| #};  | 
|   | 
| #<start_truck id = "" money = "" eventid = "">      -->¿ªÊ¼æô³µ, idΪæô³µID, eventid ÎªÊ¼þID  | 
| #<start_truck id = "" dict_money = "day_event_truck_money" eventid = "" />  | 
| #È¥µômoney_type ½ðÇ®ÀàÐÍ, ½ðÇ®ÀàÐÍÓÃÍæ¼Òµ±Ê±Ñ¡ÔñµÄ½ðÇ®ÀàÐÍ, ¿ÉÒÔÓÃÒø×Ó/񿮱  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¿ªÊ¼ÀïÚ³µ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <start_truck id="æô³µID" money="Ѻ½ð" dict_money="Èç¹ûmoneyΪ¿Õ,¶ÁÈ¡dict_money" eventid="ʼþID" />  | 
| def DoType_Start_Truck(curPlayer, curMission, curActionNode):  | 
|     truckID = int(curActionNode.GetAttribute("id"))  | 
|     money = 0  | 
|     moneyStr = curActionNode.GetAttribute("money")  | 
|     if moneyStr != "":  | 
|         money = int(curActionNode.GetAttribute("money"))  | 
|     else:  | 
|         dict_money = curActionNode.GetAttribute("dict_money")  | 
|         money = curMission.GetProperty(dict_money)  | 
|           | 
|     money_type = curPlayer.GetUseSilverType()  | 
|     #money_type = GameWorld.ToIntDef(curActionNode.GetAttribute("money_type"), 0)  | 
|     eventid = int(curActionNode.GetAttribute("eventid"))  | 
|     GameWorld.Log("%s ¿ªÊ¼æô³µ, Ñº½ð: %d" % (curPlayer.GetID(), money))  | 
|       | 
|     PlayerTruck.CreateTruck(curPlayer, money, money_type, truckID, eventid, GameWorld.GetGameWorld().GetTick())  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ɾ³ýÍæ¼Òæô³µ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Del_Truck />  | 
| def DoType_Del_Truck(curPlayer, curMission, curActionNode):  | 
|     #æô³µÊ¼þIDÓëÈÎÎñID²»Í¬£¬²»´¦Àí  | 
|     if curPlayer.GetTruckEventID() != curMission.GetMissionID():  | 
|         return  | 
|       | 
|     if curPlayer.GetTruckID() != 0:  | 
|         curPlayer.GameServer_DelTruck()  | 
|         return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖüÒ×åÿÈÕÈÎÎñÊýÄ¿  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_Family_Mission_Count/>  | 
| def DoType_Set_Family_Mission_Count(curPlayer, curMission, curActionNode):  | 
|     if curPlayer.GetFamilyLV() == 0:  | 
|         return  | 
|       | 
|     curMission.SetProperty(QuestCommon.Def_Day_Event_Max_Complete_Count, curPlayer.GetFamilyLV())  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Çå³ýÈÎÎñ×ÖµäÐÅÏ¢  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks Çå³ýÈÎÎñ×ÖµäÐÅÏ¢  | 
| def __ClearMissionProperty(curPlayer, curMission):  | 
|     missionID = curMission.GetMissionID()  | 
|     curPlayer.Sync_ClearMissionDict(missionID)  | 
|     curMission.ClearProperty()  | 
|     return  | 
|   | 
|   | 
| ##Íê³ÉÅÜ»·ÈÎÎñËæ»úÏÂÒ»¸öÅÜ»·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMissionData ÈÎÎñÊý¾Ý  | 
| # @return Ï¸öÅÜ»·ÈÎÎñID  | 
| # @remarks Çå³ýÈÎÎñ×ÖµäÐÅÏ¢  | 
| def __OverRandRunAround(curPlayer, curMissionData):  | 
|     missionList = GetDayEventInfo(curPlayer, curMissionData, QuestCommon.Day_MissionList)  | 
|     if not missionList:  | 
|         GameWorld.ErrLog("Íê³ÉÅÜ»·ÈÎÎñËæ»úÏÂÒ»¸öÅÜ»·Òì³£", curPlayer.GetID())  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return 0  | 
|       | 
|     missionID = GameWorld.GetResultByRandomList(missionList)  | 
|     GameWorld.DebugLog('Íê³ÉÅÜ»·ÈÎÎñËæ»úÏÂÒ»¸öÅÜ»· missionList=%s, missionID=%s' % (missionList, missionID))  | 
|     if missionID == None:  | 
|         GameWorld.ErrLog("Íæ¼ÒµÈ¼¶ %s £¬Ã»ÓÐËæ»úÈÎÎñ" % curPlayer.GetLV(), curPlayer.GetID())  | 
|         return 0  | 
|     return missionID  | 
|   | 
|   | 
| ##ɾ³ýÅÜ»·ÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param mission_1 ÈÎÎñ1ʵÀý  | 
| # @param curActionNode µ±Ç°½Úµã  | 
| # @return ÎÞ  | 
| # @remarks É¾³ýÅÜ»·ÈÎÎñ,×Ü»·Êý+1 Ëæ»úÐÂÈÎÎñ  | 
| def __DelRunAroundMission(curPlayer, mission_1, curMissionData, Def_Around_AllCount,  | 
|                           Def_Around_Count, aroundCount, allCount, RUNCOUNT):  | 
|   | 
|     allCount += 1  | 
|       | 
|     mission_1.SetProperty(Def_Around_AllCount, allCount)  | 
|     EventShell.EventRespons_RunTaskAllCnt(curPlayer, curMissionData.Type, allCount)  | 
|     GameWorld.Log("ɾ³ýÈÎÎñallCount %s, RUNCOUNT=%s" % (allCount, RUNCOUNT))  | 
|   | 
|   | 
|     if allCount < RUNCOUNT:  | 
|         #ÅÜ»·1  | 
|         #Ëæ»úÈÎÎñID ÏÉÃËÈÎÎñÅжÏÊÇ·ñÓÐÏÉÃË  | 
|         if curMissionData.Type == QuestCommon.Def_Mission_Type_RunFamily:  | 
|             if not curPlayer.GetFamilyID():  | 
|                 GameWorld.DebugLog("  É¾³ýÅÜ»·ÈÎÎñºó  Ã»ÓÐÏÉÃË£¬²»Ëæ»úÏÉÃËÈÎÎñ")  | 
|                 return  | 
|         nextMissionID = __OverRandRunAround(curPlayer, curMissionData)  | 
|         if not curPlayer.FindMission(nextMissionID):  | 
|             QuestCommon.AddNewMission(curPlayer, nextMissionID)  | 
|               | 
|         nextMission = curPlayer.FindMission(nextMissionID)  | 
|         QuestCommon.SetPlayerMissionState(curPlayer, nextMission, 1)  | 
|         nextMission.SetMissionState(1)  | 
|         nextMission.SetDescriptionIndex(0)  | 
|   | 
|         #ÏÈÇå¿Õ×ÖµäÔÙÉèÖÃеÄ×Öµä  | 
|         __ClearMissionProperty(curPlayer, nextMission)  | 
|           | 
|         nextMission.SetProperty(Def_Around_AllCount, allCount)  | 
|         nextMission.SetProperty(Def_Around_Count, aroundCount)  | 
|         #ÉèÖÃËæ»úÈÎÎñʼþ  | 
|         EventShell.EventRespons_SetRunAround(curPlayer, nextMissionID)  | 
|         GameWorld.DebugLog("ɾ³ý£º Í¨ÖªÏÂÒ»¸öÈÎÎñ×Öµä Ë¢Ð·â°ü %s"%nextMission.GetMissionID())  | 
|         EventShell.NotifyOneMission(curPlayer, nextMission)  | 
|     return  | 
|   | 
| Key_Around_AllCount = "run_count" # ×Ü»·Êýkey  | 
| Key_Around_Count = "around_count" # »·Êýkey  | 
| Key_Around_Star = "around_star" # »·ÐÇkey  | 
|   | 
| ##»ñÈ¡ÅÜ»·ÈÎÎñ×Öµäkey  | 
| # @param missionType   | 
| # @param key ×Öµäkey¶¨Ò壬Òà×÷ΪĬÈÏkey  | 
| # @return key  | 
| def GetRunKey(missionType, key):  | 
|     keyDict = {  | 
|                # ÈÕ³£ÅÜ»·  | 
|                QuestCommon.Def_Mission_Type_RunDaily:{  | 
|                   Key_Around_AllCount:QuestCommon.Def_Run_Count_In_Mission_1,  | 
|                   Key_Around_Count:QuestCommon.Def_Around_Count_In_Mission_1,  | 
|                   Key_Around_Star:QuestCommon.Def_Around_Star_In_Mission_1,  | 
|                   },  | 
|                  | 
|                # ¼Ò×åÅÜ»·  | 
|                QuestCommon.Def_Mission_Type_RunFamily:{  | 
|                   Key_Around_AllCount:QuestCommon.Def_Run_Count_Family_In_Mission_1,  | 
|                   Key_Around_Count:QuestCommon.Def_Around_Count_Family_In_Mission_1,  | 
|                   Key_Around_Star:QuestCommon.Def_Around_Star_Family_In_Mission_1,  | 
|                   },  | 
|                }  | 
|       | 
|     return keyDict.get(missionType, {}).get(key, key)  | 
|   | 
| ##ÅÜ»·ÈÎÎñ½áÊø´¦Àí  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñ  | 
| # @param curMissionData ÈÎÎñÊý¾Ý  | 
| # @param curActionNode µ±Ç°½Úµã  | 
| # @return ÎÞ  | 
| # @remarks ÅÜ»·ÈÎÎñ½áÊø´¦Àí£¬É¾³ý»òÕßËæ»úÏÂÒ»¸ö  | 
| def __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode):  | 
|     GameWorld.Log("__RunAroundMission----%s"%missionID, curPlayer.GetID())  | 
|     #ÈÎÎñÍê³É£¬´¥·¢Ëæ»úÅÜ»·  | 
|     run_event = GameWorld.ToIntDef(curActionNode.GetAttribute("run_around"), 0)  | 
|     firstMissionID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|       | 
|     mission_1 = QuestCommon.GetCommonMission(curPlayer)  | 
|       | 
|     if mission_1 == None:  | 
|         GameWorld.ErrLog('__RunAroundMission, Íæ¼Ò = %sÎÞ·¨»ñµÃ¹«¹²ÈÎÎñ' % (curPlayer.GetName()), curPlayer.GetID())  | 
|         return  | 
|       | 
|     Def_Around_AllCount = GetRunKey(curMissionData.Type, Key_Around_AllCount)  | 
|     Def_Around_Count = GetRunKey(curMissionData.Type, Key_Around_Count)  | 
|       | 
|     #×Ü»·Êý  | 
|     allCount = mission_1.GetProperty(Def_Around_AllCount)  | 
|     #µ¥ÂÖÒÑ×ö»·Êý  | 
|     aroundCount = mission_1.GetProperty(Def_Around_Count)  | 
|     #GameWorld.DebugLog('    ÅÜ»·ÈÎÎñ½áÊø´¦ÀímissionID =%s,allCount=%s,aroundCount=%s,run_event=%s,curMissionData.Type=%s' % (missionID, allCount, aroundCount, run_event, curMissionData.Type))  | 
|       | 
|     allCntDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskCnt', 1, {})  | 
|     #×Ü»·ÊýÉÏÏÞ  | 
|     RUNCOUNT = allCntDict.get(curMissionData.Type, 0)  | 
|     #µ¥ÂÖ»·ÊýÉÏÏÞ  | 
|     RunTaskCntDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskCnt', 2, {})  | 
|     AROUNDCOUNT = RunTaskCntDict.get(curMissionData.Type, 0)  | 
|     #1Ϊ´¥·¢Ëæ»úÅÜ»·,2Ϊɾ³ýÈÎÎñ 3Ϊ´¥·¢µÚÒ»¸öÅÜ»·  | 
|     if run_event == Def_Run_Around_Over_2:  | 
|         __DelRunAroundMission(curPlayer, mission_1, curMissionData, Def_Around_AllCount,  | 
|                           Def_Around_Count, aroundCount, allCount, RUNCOUNT)  | 
|         return  | 
|      | 
|     elif run_event not in [Def_Run_Around_Over_1, Def_Run_Around_Over_3]:  | 
|         return  | 
|       | 
|       | 
|     #×ÜÅÜ»·´ÎÊýÒÑÂú£¬²»¿ÉÔÙ×ö  | 
|     if run_event == Def_Run_Around_Over_1:  | 
|         if allCount >= RUNCOUNT or aroundCount >= AROUNDCOUNT:  | 
|             return  | 
|       | 
|     nextMissionID = 0  | 
|     nextMission = None  | 
|     if run_event == Def_Run_Around_Over_1:  | 
|         aroundCount += 1 #±¾ÂÖ´ÎÊý+1  | 
|         allCount += 1 #×Ü»·Êý+1  | 
|         mission_1.SetProperty(Def_Around_AllCount, allCount)  | 
|         mission_1.SetProperty(Def_Around_Count, aroundCount)  | 
|       | 
|     if firstMissionID and run_event == Def_Run_Around_Over_3:  | 
|         if not curPlayer.FindMission(firstMissionID):  | 
|             QuestCommon.AddNewMission(curPlayer, firstMissionID)  | 
|               | 
|         nextMission = curPlayer.FindMission(firstMissionID)  | 
|         QuestCommon.SetPlayerMissionState(curPlayer, nextMission, 1)  | 
|         nextMission.SetMissionState(1)  | 
|         nextMission.SetDescriptionIndex(0)  | 
|   | 
|         #ÏÈÇå¿Õ×ÖµäÔÙÉèÖÃеÄ×Öµä  | 
|         __ClearMissionProperty(curPlayer, nextMission)  | 
|           | 
|         nextMission.SetProperty(Def_Around_AllCount, allCount)  | 
|         nextMission.SetProperty(Def_Around_Count, aroundCount)  | 
|         #nextMission.SetProperty(Def_Around_Star, aroundStar)  | 
|         #ÉèÖÃËæ»úÈÎÎñʼþ  | 
|         EventShell.EventRespons_SetRunAround(curPlayer, firstMissionID)  | 
|           | 
|       | 
|     #»·Êý´ïµ½ÉÏÏÞ£¬´ÎÊýûµ½ÉÏÏÞ£¬ ÖØÖÃÅÜ»·1£¬  | 
|     elif aroundCount >= AROUNDCOUNT:  | 
|         #ÉèÖÿÉÁìÈ¡±¾ÂÖ×ܽ±Àø×´Ì¬ ¼Ó¸öÁìÈ¡½±ÀøµÄÈÎÎñ  | 
|         GameWorld.DebugLog('    ±¾ÂÖ´ÎÊý´ïµ½%s, ¿É³éÈ¡±¾ÂÖ½±Àø£¡'%aroundCount)  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskAwardState % curMissionData.Type, 0)  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskAwardRecord % curMissionData.Type, 0)  | 
|         EventShell.NotifyRunEndAward(curPlayer, curMissionData.Type)  | 
|         runTaskAwardTaskIDDict = IpyGameDataPY.GetFuncEvalCfg('RunTaskAwardTaskID')  | 
|         runTaskAwardTaskID = runTaskAwardTaskIDDict.get(curMissionData.Type, 0)  | 
|         if not curPlayer.FindMission(runTaskAwardTaskID):  | 
|             QuestCommon.AddNewMission(curPlayer, runTaskAwardTaskID)  | 
|         newMission = curPlayer.FindMission(runTaskAwardTaskID)  | 
|         QuestCommon.SetPlayerMissionState(curPlayer, newMission, 1)  | 
|         newMission.SetMissionState(1)  | 
|         newMission.SetDescriptionIndex(0)  | 
|         EventShell.NotifyOneMission(curPlayer, newMission, isNotifyAll=False)  | 
|           | 
|         if curMissionData.Type == QuestCommon.Def_Mission_Type_RunFamily:  | 
|             PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TaskFRun, 1)  | 
| #        if allCount < RUNCOUNT:  | 
| #            nextMissionID = __OverRandRunAround(curPlayer, curMissionData)  | 
| #            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RunTaskNextMissionID % curMissionData.Type, nextMissionID)  | 
|           | 
|                   | 
|               | 
|   | 
|     else:  | 
|         #---Ëæ»úÏÂÒ»¸öÅÜ»·ÈÎÎñ  | 
|           | 
|         #Ëæ»úÈÎÎñID  | 
|         nextMissionID = __OverRandRunAround(curPlayer, curMissionData)  | 
|           | 
|         if nextMissionID <= 0:  | 
|             EventShell.DoExitEvent(curPlayer)  | 
|             return  | 
|           | 
|         if not curPlayer.FindMission(nextMissionID):  | 
|             QuestCommon.AddNewMission(curPlayer, nextMissionID)  | 
|               | 
|         nextMission = curPlayer.FindMission(nextMissionID)  | 
|         QuestCommon.SetPlayerMissionState(curPlayer, nextMission, 1)  | 
|         nextMission.SetMissionState(1)  | 
|         nextMission.SetDescriptionIndex(0)  | 
|   | 
|         #ÏÈÇå¿Õ×ÖµäÔÙÉèÖÃеÄ×Öµä  | 
|         __ClearMissionProperty(curPlayer, nextMission)  | 
|           | 
|         nextMission.SetProperty(Def_Around_AllCount, allCount)  | 
|         nextMission.SetProperty(Def_Around_Count, aroundCount)  | 
|         #nextMission.SetProperty(Def_Around_Star, aroundStar)  | 
|         #ÉèÖÃËæ»úÈÎÎñʼþ  | 
|         EventShell.EventRespons_SetRunAround(curPlayer, nextMissionID)  | 
|       | 
|       | 
|     #mission_1.SetProperty(Def_Around_Star,aroundStar)  | 
|     if nextMission:  | 
|         EventShell.NotifyOneMission(curPlayer, nextMission, isNotifyAll=False)  | 
|         EventShell.EventRespons_RunTaskAllCnt(curPlayer, curMissionData.Type, allCount)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##½áÊøÈÎÎñÂß¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <over none_event="ÈÎÎñÍê³ÉºóÊÇ·ñÍ˳öʼþ" diff_event="ÈÎÎñÍê³ÉΪ-1£¬²»É¾³ý£¬  | 
| # ¿É´¥·¢ºóÐøÈÎÎñ" del_event="ÈÎÎñÍê³Éɾ³ý£¬²»´¥·¢ºóÐøÈÎÎñ" two_event="ÈÎÎñÍê³Éɾ³ý,²»Í˳öʼþ£¬²»´¥·¢ºóÐøÈÎÎñ"   | 
| # run_around="1" 1Ϊ´¥·¢Ëæ»úÅÜ»· id="13"/>  | 
| # ÅÜ»·¸ñʽ˵Ã÷£º<over run_around="1" id="1201"/>  ===¡· run_around="1" Ëæ»úÅÜ»·ÈÎÎñ£¬idΪµÚÒ»¸öÅÜ»·ÈÎÎñID£¬ÅÜ»·ÈÎÎñ²»ÊôÓÚºóÐøÈÎÎñ   | 
| def DoType_Over(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ: <over/>  | 
|     missionID = curMission.GetMissionID()  | 
|     #ÈÎÎñÍê³ÉºóÊÇ·ñÍ˳öʼþ£¬ÒÔÃâ·ÇÍæ¼Ò²Ù×÷Íê³ÉÈÎÎñ£¬¶ø½áÊøÊ¼þ£¨ÌøÎèµöÓ㣩  | 
|     noneEvent = GameWorld.ToIntDef(curActionNode.GetAttribute("none_event"), 0)  | 
|     #ÈÎÎñÍê³ÉΪ-1£¬²»É¾³ý£¬¿É´¥·¢ºóÐøÈÎÎñ  | 
|     diff_event = GameWorld.ToIntDef(curActionNode.GetAttribute("diff_event"), 0)  | 
|     #ÈÎÎñÍê³Éɾ³ý£¬²»´¥·¢ºóÐøÈÎÎñ  | 
|     del_event = GameWorld.ToIntDef(curActionNode.GetAttribute("del_event"), 0)  | 
|     #ÈÎÎñÍê³Éɾ³ý,²»Í˳öʼþ£¬²»´¥·¢ºóÐøÈÎÎñ  | 
|     two_event = GameWorld.ToIntDef(curActionNode.GetAttribute("two_event"), 0)  | 
|   | 
|     curMissionData = FindQuestFunc(missionID)  | 
|       | 
|     #»ñµÃµ±Ç°ÖØÖôÎÊý£¬ÏÂÃæÑéÖ¤ÊÇ·ñÐèÒª  | 
|     curResetCount = curMission.GetProperty(curMissionData.ResetCurCountDictName)  | 
|       | 
|     if curMissionData.DayMaxCount != '':  | 
|         #ÅжÏÕâ¸öÈÎÎñÊÇ·ñÓд¥·¢´ÎÊý,   | 
|         # --»¹¿ÉÒÔ´¥·¢, ´ÎÊý+1  | 
|         # --²»ÄÜ´¥·¢ÁË, Ê²Ã´¶¼²»×ö  | 
|         curCount = curMission.GetProperty(curMissionData.DayCurCount)  | 
|         maxCount = GameWorld.ToIntDef(curMissionData.DayMaxCount, 0)  | 
|         dictHaveCount = False  | 
|           | 
|         if maxCount == 0:  | 
|             #×î´ó´ÎÊýÊÇÐèÒª²é×ÖµäµÄ  | 
|             dictHaveCount = True  | 
|             maxCount = curMission.GetProperty(curMissionData.DayMaxCount)  | 
|           | 
|         #GameWorld.Log('curCount = %s, maxCount = %s'%(curCount, maxCount))  | 
|         if curCount < maxCount - 1:  | 
|             __ClearMissionProperty(curPlayer, curMission)  | 
|             if dictHaveCount:  | 
|                 #Õâ¸öÈÎÎñÓÐ×î´ó´ÎÊýÏÞÖÆ, ÉèÖÃ×î´ó´ÎÊý  | 
|                 curMission.SetProperty(curMissionData.DayMaxCount, maxCount)  | 
|               | 
|             if curMissionData.ResetMaxCount != 0:  | 
|                 #¼Ì³ÐÈÎÎñÖØÖÃÐÅÏ¢  | 
|                 curMission.SetProperty(curMissionData.ResetCurCountDictName, curResetCount, False)  | 
|               | 
|             #»¹¿ÉÒÔ´¥·¢, ´ÎÊý+1, ÉèÖÃÈÎÎñ²½ÖèΪ0  | 
|             curMission.SetProperty(curMissionData.DayCurCount, curCount + 1)  | 
|             #Çå³ýÐÅºÅµÆ  | 
| #            curPlayer.Sync_ClearMapMissionLight(curMission.GetMissionID())  | 
|             if curMissionData.Invisible == 1 :  | 
|                 #ÓдÎÊýÈÎÎñ£¬Ê¹ÓÃOVERÂß¼£¬Íê³ÉÒ»´ÎºóÐèÇå¿ÕÈÎÎñÃèÊö£¬²»ÏÔʾÔÚ²éѯÀ¸  | 
|                 QuestCommon.SetPlayerMissionState(curPlayer, curMission, -1)  | 
|             else:  | 
|                 #ÏÔʾÔÚ²éѯÀ¸      | 
|                 QuestCommon.SetPlayerMissionState(curPlayer, curMission, 0)  | 
|             curMission.SetDescriptionIndex(0)  | 
|             EventShell.NotifyOneMission(curPlayer, curMission)  | 
|               | 
|             if noneEvent == 0:  | 
|                 DoTalkOrExit(curPlayer)  | 
|               | 
|             #´¥·¢ÏÂÒ»¸öÅÜ»·ÈÎÎñ  | 
|             __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode)  | 
|             return   | 
|       | 
|     #----------------------------ÈÎÎñÍê³É  | 
|     QuestCommon.SetPlayerMissionState(curPlayer, curMission, -1)  | 
|     curMission.SetDescriptionIndex(len(curMissionData.QuestDescriptionList) - 1)      | 
|     EventShell.NotifyOneMission(curPlayer, curMission, isNotifyAll=False)  | 
|       | 
|     #ɾ³ýÕâ¸öÈÎÎñ  | 
|     #µÚÒ»¸öÈÎÎñ¾ö¶¨ÊÇ·ñÒª´¥·¢OnEnterʼþ, ËùÒÔ²»ÄÜɾ³ý  | 
|     if missionID != 1 and diff_event == 0:  | 
|         if curMissionData.DayMaxCount != '':  | 
|             #Çå¿ÕÈÎÎñ×ÖµäClearProperty()  | 
|             __ClearMissionProperty(curPlayer, curMission)  | 
|               | 
|             if curMissionData.ResetMaxCount != 0:  | 
|                 #¼Ì³ÐÈÎÎñÖØÖÃÐÅÏ¢  | 
|                 curMission.SetProperty(curMissionData.ResetCurCountDictName, curResetCount, False)  | 
|               | 
|         else:  | 
|             QuestCommon.DeleteMission(curPlayer, missionID)  | 
|             curMission = None  | 
|           | 
|     #ÈÎÎñÍê³Éɾ³ý£¬²»´¥·¢ºóÐøÈÎÎñ  | 
|     if del_event == 1:  | 
|         DoTalkOrExit(curPlayer)  | 
|           | 
|         #´¥·¢ÏÂÒ»¸öÅÜ»·ÈÎÎñ  | 
|         __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode)      | 
|         return  | 
|       | 
|     #²»Í˳öʼþ£¬²»´¥·¢ºóÐøÈÎÎñ  | 
|     if two_event == 1:  | 
|           | 
|         #´¥·¢ÏÂÒ»¸öÅÜ»·ÈÎÎñ  | 
|         __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode)     | 
|         return  | 
|       | 
|     if not QuestTrig.has_key(missionID) :  | 
|         #GameWorld.Log("²»ÄÜ´¥·¢ÏÂÒ»¸öÈÎÎñ! noneEvent = %s"%noneEvent, curPlayer.GetPlayerID())  | 
|         if noneEvent == 0:  | 
|             DoTalkOrExit(curPlayer)  | 
|           | 
|         #´¥·¢ÏÂÒ»¸öÅÜ»·ÈÎÎñ  | 
|         __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode)     | 
|         return  | 
|       | 
|     trigList = QuestTrig[missionID]  | 
|       | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|       | 
|     continueMission = 0  | 
|       | 
|     for trig in trigList:  | 
|         #//Ö°ÒµÑéÖ¤¼ì²é²»Í¨¹ý  | 
|         if trig.CheckJob != '' and int(trig.CheckJob) != curPlayer.GetJob():  | 
|             continue  | 
|           | 
|         nextMission = FindQuestFunc(trig.Next)  | 
|           | 
|         if nextMission == None:  | 
|             continue  | 
|           | 
|         #µ±Ç°ÈÎÎñΪ½ÚÇìÈÎÎñ ²¢ÇÒ ÏÂÒ»¸öÈÎÎñûÓм¤»î  | 
|         if nextMission.Type == QuestCommon.Def_GM_Active_Mission_Type and (not gameWorld.IsEventActive(trig.Next)):  | 
|             continue  | 
|           | 
|         if curPlayer.FindMission(trig.Next) == True:  | 
|             #GameWorld.Log("ÒѾÓÐÏÂÒ»¸öÈÎÎñ, É¾³ý!" , curPlayer.GetPlayerID())  | 
|             QuestCommon.DeleteMission(curPlayer, trig.Next)  | 
|               | 
|         curAddMission = QuestCommon.AddNewMission(curPlayer, trig.Next)  | 
|         EventShell.NotifyOneMission(curPlayer, curAddMission)  | 
|           | 
|         if trig.Continue != 0:  | 
|             continueMission = trig.Next  | 
|               | 
|     if continueMission == 0:  | 
|         #ÈÎÎñÈ«²¿Ö´ÐÐÍê±Ï, Í˳ö  | 
|         if noneEvent == 0:  | 
|             DoTalkOrExit(curPlayer)  | 
|           | 
|         #´¥·¢ÏÂÒ»¸öÅÜ»·ÈÎÎñ  | 
|         __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode)     | 
|         return  | 
|       | 
|     curContinueMissionData = FindQuestFunc(continueMission)  | 
|     npcID = curContinueMissionData.NPCID  | 
|     key = ("on_visit", "%s.xml" % npcID)  | 
|     questEvent = curContinueMissionData.QuestsEvent  | 
|       | 
|     if not questEvent.has_key(key) :  | 
|         GameWorld.Log("ÈÎÎñID = %s ×ÖµäÖРûÓÐKey = %s, ×Öµä = %s" % (continueMission, str(key), str(questEvent)) , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     questNode = questEvent[key].GetXMLEventLoader().GetNodeList()  | 
|   | 
|     #ÉèÖÃÈËÎﵱǰÔËÐеÄÈÎÎñ  | 
|     RunQuest(curPlayer, continueMission, questNode)  | 
|       | 
|     #´¥·¢ÏÂÒ»¸öÅÜ»·ÈÎÎñ  | 
|     __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode)     | 
|   | 
| #---------------------------------------------------------------------  | 
| ##´¥·¢½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <reward_action index="½±Àø½Úµã", exp_multiple="¾Ñé½±Àø±¶Öµ200´ú±í2±¶£¬Ä¬ÈÏ1±¶"/>  | 
| def DoType_Reward_Action(curPlayer, curMission, curActionNode):  | 
|     #¸ñʽ : <reward_action index = "1"/>      index¿ÉÑ¡  | 
|     rewardNode = QuestCommon.GetRewardNode(curPlayer, curMission)  | 
|     if rewardNode == None or rewardNode.IsEmpty():  | 
|         GameWorld.Log("DoType_Reward_Action, Ã»Óн±Àø!! curMission.GetDescriptionIndex() = %d" % curMission.GetDescriptionIndex() , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     actionIndexStr = rewardNode.GetAttribute("index")  | 
|     actionIndex = GameWorld.ToIntDef(actionIndexStr, 0)   | 
|   | 
|     actionsNode = rewardNode.FindChildNode("actions")  | 
|     if actionsNode == None or actionsNode.IsEmpty():  | 
|         GameWorld.Log("No Reward Action! curMission = %d" % curMission.GetMissionID() , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     rewardAction = actionsNode.GetChild(actionIndex)  | 
|     if (rewardAction == None or rewardAction.IsEmpty()) and GameWorld.GetGameWorld().GetDebugLevel() \  | 
|         and curPlayer.GetGMLevel() == ChConfig.Def_GM_LV_God:  | 
|         GameWorld.DebugAnswer(curPlayer, "###ÈÎÎñûÓн±Àø! ID=%s" % curMission.GetMissionID())  | 
|           | 
|     exp_multiple = GameWorld.ToIntDef(curActionNode.GetAttribute("exp_multiple"), 0)  | 
|     if exp_multiple > 0:  | 
|         curPlayer.SetDict(ChConfig.Def_PlayerKey_TaskExpRewardMultiple, exp_multiple)  | 
|           | 
|     __DoAnswerActionNode(curPlayer, curMission, rewardAction)  | 
|           | 
|     if exp_multiple > 0:  | 
|         # ×îºóÒªÖØÖþÑé½±Àø±¶Öµ  | 
|         curPlayer.SetDict(ChConfig.Def_PlayerKey_TaskExpRewardMultiple, 0)  | 
|     return  | 
|   | 
| ##ÅÜ»·Íê³É  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param missionType ÈÎÎñÀàÐÍ  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| def OnAroundMissionFinish(curPlayer, missionType, addCnt=1):  | 
|     #ÅÜ»·ÈÎÎñidÁÐ±í  | 
|     # »îÔ¾¶È  | 
|     GameWorld.Log('    ÅÜ»·Íê³É´¥·¢»îÔ¾¶È missionType=%s'%missionType, curPlayer.GetPlayerID())  | 
|     if missionType == QuestCommon.Def_Mission_Type_RunDaily:  | 
|         PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_DailyRunMission, addCnt)  | 
|         PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TaskCRun, addCnt)  | 
|         PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_RunTask, addCnt)  | 
|         PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RunTask, addCnt)  | 
|         PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_RunTask, addCnt)  | 
|     elif missionType == QuestCommon.Def_Mission_Type_RunFamily:  | 
|         PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRunMission, addCnt)  | 
|         PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)  | 
|     else:  | 
|         GameWorld.Log('    ÅÜ»·Íê³É´¥·¢»îÔ¾¶ÈÒì³£ missionType=%s'%missionType, curPlayer.GetPlayerID())  | 
|     return  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖÃÌØÊâ¼Ò×åÈÎÎñ½±Àø±¶Êý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <set_reward_rate />  | 
| def DoType_Set_Reward_Rate(curPlayer, curMission, curActionNode):  | 
|     #<set_reward_rate>    (1+(familyLV - 1)*0.5)  | 
|     #¼Ò×åµÈ¼¶  | 
|     familyLV = curPlayer.GetFamilyLV()  | 
|     rewardRate = int(eval(ReadChConfig.GetChConfig('Def_Family_Mission_Reward')))  | 
|     if not curMission:  | 
|         GameWorld.Log("###ÉèÖÃÌØÊâ¼Ò×åÈÎÎñ½±Àø±¶ÊýÒì³£,Íæ¼ÒÎÞ´ËÈÎÎñ,playerid = %s" % curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     curMission.SetProperty('rewardRate', rewardRate)  | 
|   | 
|   | 
| # rewardLVΪָ¶¨µÈ¼¶½±Àø£¬isMaxLVΪÊÇ·ñÈ¡×î´ó  | 
| def GetRunAroundReward(curPlayer, runAroundReward, rewardLV=0, isMaxLV=False):  | 
|     if not runAroundReward:  | 
|         GameWorld.ErrLog("ÅÜ»·ÈÎÎñ½±Àø´íÎó", curPlayer.GetID())  | 
|         return  | 
|       | 
|     curRewardLV = rewardLV if rewardLV > 0 else curPlayer.GetLV()  | 
|   | 
|     if isMaxLV:  | 
|         curRewardLV = runAroundReward.MaxLV  | 
|       | 
|     #¾ÀÕýÏÂÖ¸¶¨½±Àø·¶Î§  | 
|     if curRewardLV < runAroundReward.MinLV:  | 
|         curRewardLV = runAroundReward.MinLV  | 
|     if curRewardLV > runAroundReward.MaxLV:  | 
|         curRewardLV = runAroundReward.MaxLV  | 
|       | 
|     for lvInfo in runAroundReward.Rewards:  | 
|         if curRewardLV >= lvInfo[0] and curRewardLV <= lvInfo[1]:  | 
|             return runAroundReward.Rewards[lvInfo]  | 
|       | 
|     return  | 
|   | 
|   | 
| ##תÉúºóÅÜ»·½±Àø´¦Àí  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ×ªÉúºóÅÜ»·½±Àø´¦Àí  | 
| def __ReinAddRunAroundReward(curPlayer, curMission):  | 
|     runAroundReward = FindQuestFunc(curMission.GetMissionID()).RunAroundReward  | 
|   | 
|     lvReward = GetRunAroundReward(curPlayer, runAroundReward, rewardLV=0, isMaxLV=True)  | 
|     if not lvReward:  | 
|         GameWorld.Log("תÉúÅÜ»·½±Àø´íÎó id = %d" % curMission.GetMissionID() , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     #½ðÇ®½±Àø×î´óµÈ¼¶  | 
|     if lvReward.Money != 0:  | 
|         curMission.SetProperty(Def_Run_Around_Reward_Money, lvReward.Money)     | 
|       | 
| #---------------------------------------------------------------------  | 
| ##תÉúºóÿÈÕÈÎÎñÐÂÔö½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Reincarnation_Add_Reward />  | 
| def DoType_Reincarnation_Add_Reward(curPlayer, curMission, curActionNode):  | 
|     #ûתÉú²»´¦Àí  | 
|     curReinLV = curPlayer.GetReincarnationLv()  | 
|     if curReinLV < 1:  | 
|         return  | 
|       | 
|     dayEventReward = FindQuestFunc(curMission.GetMissionID()).DayEventReward  | 
|       | 
|     if dayEventReward == None:  | 
|         GameWorld.Log("תÉú½±Àø´íÎó id = %d" % curMission.GetMissionID() , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     curRewardLV = dayEventReward.MaxLV  | 
|     familyLV = curPlayer.GetFamilyLV()  | 
|       | 
|     #µ±Ç°µÈ¼¶ÈÎÎñ½±Àø½á¹¹Ìå  | 
|     curLVDayEventReward = dayEventReward.Rewards[curRewardLV]  | 
|       | 
|     #½ðÇ®½±Àø×î´óµÈ¼¶  | 
|     if curLVDayEventReward.Money != 0:  | 
|         curMission.SetProperty(Def_Day_Event_Reward_Money, curLVDayEventReward.Money)     | 
|       | 
|     #¼Ò×å»îÔ¾×î´óµÈ¼¶  | 
|     if curLVDayEventReward.PlayerFamilyActiveValue != 0:  | 
|         curMission.SetProperty(Def_Day_Event_Reward_Player_Family_ActiveValue, (curLVDayEventReward.PlayerFamilyActiveValue) * familyLV)     | 
|       | 
|     #ïÚ³µÑ¹½ð×î´óµÈ¼¶  | 
|     if curLVDayEventReward.TruckMoney != 0:  | 
|         curMission.SetProperty(Def_Day_Event_Reward_Truck_Money, curLVDayEventReward.TruckMoney)  | 
|       | 
|     #תÉúºóÅÜ»·½±Àø´¦Àí  | 
|     __ReinAddRunAroundReward(curPlayer, curMission)  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ôö¼ÓÈÕ³£ÈÎÎñ½±Àø±¶ÂÊ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Add_Day_Event_Reward_Rate value="Ôö¼ÓµÄ±¶ÂÊ<Íò·ÖÂÊ>" />   | 
| def DoType_Add_Day_Event_Reward_Rate(curPlayer, curMission, curActionNode):  | 
|     addRewardRate = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|       | 
|     rewardRate = ChConfig.Def_Mission_Reward_Rate  | 
|     if curMission and curMission.GetProperty('rewardRate'):  | 
|         rewardRate = curMission.GetProperty('rewardRate')  | 
|       | 
|     if addRewardRate <= 0:  | 
|         return  | 
|       | 
|     GameWorld.DebugLog("DoType_Add_Day_Event_Reward_Rate rewardRate=%s,addRewardRate=%s"  | 
|                        % (rewardRate, addRewardRate))  | 
|     curMission.SetProperty('rewardRate', rewardRate + addRewardRate)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÉèÖÃÅÜ»·ÈÎÎñÐǼ¶  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_Run_Star value="Ö¸¶¨ÐǼ¶" id_name="ÈÎÎñID´æ´¢key" />   | 
| def DoType_Set_Run_Star(curPlayer, curMission, curActionNode):  | 
|     idNameStr = curActionNode.GetAttribute("id_name")  | 
|     if curMission and idNameStr != "":  | 
|         questID = GameWorld.ToIntDef(curMission.GetProperty(idNameStr), 0)  | 
|         if questID != 0:  | 
|             curMission = curPlayer.FindMission(questID)  | 
|             if curMission == None:  | 
|                 curMission = QuestCommon.AddNewMission(curPlayer, questID)  | 
|               | 
|     curMissionID = curMission.GetMissionID()  | 
|     curMissionData = FindQuestFunc(curMissionID)  | 
|     if not curMissionData:  | 
|         return  | 
|     missionType = curMissionData.Type  | 
|     Def_Around_Star = GetRunKey(missionType, Key_Around_Star)  | 
|       | 
|     setStar = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|       | 
|     if setStar > 0:  | 
|         aroundStar = setStar  | 
|     else:  | 
|         #---Ëæ»úÐǼ¶  | 
|         randStarList = eval(ReadChConfig.GetChConfig('RunAround_Star'))  | 
|         aroundStar = GameWorld.GetResultByRandomList(randStarList, 1)  | 
|           | 
|         #vipStar = PlayerCostVIP.GetRoundStar(curPlayer)  | 
|         vipStar = 0  | 
|         if vipStar > 0:  | 
|             aroundStar = vipStar  | 
|           | 
|         #vipLVStar = ReadChConfig.GetEvalChConfig('RunAround_StarVIP')  | 
|         #if len(vipLVStar) == 2:  | 
|         #    vipLV, vipStar = vipLVStar  | 
|         #    if curPlayer.GetVIPLv() >= vipLV:  | 
|         #        aroundStar = vipStar  | 
|       | 
|     GameWorld.DebugLog("DoType_Set_Run_Star setStar=%s,aroundStar=%s" % (setStar, str(aroundStar)))  | 
|     curMission.SetProperty(Def_Around_Star, aroundStar)  | 
|     return  | 
|   | 
| #def OnRunMissionStarChange(curPlayer, curMission, prevStar):  | 
| #    curStar = curMission.GetProperty(Def_Around_Star)  | 
| #      | 
| #    # ¸üÐÂ×î´óɱ¹ÖÊý  | 
| #    kill_id_count = QuestCommon.Def_Kill_Npc_ID_Count  | 
| #    max_kill_count = curMission.GetProperty(kill_id_count)  | 
| #    reduceCnt = ReadChConfig.GetEvalChConfig("RunAround_StarKillCnt")  | 
| #    if reduceCnt > 0:  | 
| #        max_kill_count = max(1, max_kill_count - reduceCnt * (curStar - prevStar))  | 
| #        curMission.SetProperty(kill_id_count, max_kill_count)  | 
| #    return  | 
|   | 
| ##ÉèÖÃÅÜ»·ÈÎÎñ½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ÉèÖÃÅÜ»·ÈÎÎñ½±Àø <set_run_around_reward multiple="Ö¸¶¨±¶Êý" id_name="ÈÎÎñID´æ´¢key" />   | 
| def DoType_Set_Run_Around_Reward(curPlayer, curMission, curActionNode):  | 
|     curMissionID = curMission.GetMissionID()  | 
|     GameWorld.Log("DoType_Set_Run_Around_Reward---%s"%curMissionID, curPlayer.GetID())  | 
|     idNameStr = curActionNode.GetAttribute("id_name")  | 
|     if curMission and idNameStr != "":  | 
|         questID = GameWorld.ToIntDef(curMission.GetProperty(idNameStr), 0)  | 
|         if questID != 0:  | 
|             curMission = curPlayer.FindMission(questID)  | 
|             if curMission == None:  | 
|                 curMission = QuestCommon.AddNewMission(curPlayer, questID)  | 
|               | 
|     curMissionData = FindQuestFunc(curMissionID)  | 
|     if not curMissionData:  | 
|         return  | 
|    | 
|     rewardList = __GetRunAroundReward(curPlayer, curMission)  | 
|     if rewardList:  | 
|         curExp, curMoney, curFamilyHornor, itemID, itemCount = rewardList  | 
|     else:  | 
|         curExp, curMoney, curFamilyHornor, itemID, itemCount = 0, 0, 0, 0  | 
|       | 
|     curMission.SetProperty(Def_Run_Around_Reward_Exp, curExp % ChConfig.Def_PerPointValue)  | 
|     curMission.SetProperty(Def_Run_Around_Reward_ExpPoint, curExp / ChConfig.Def_PerPointValue)  | 
|     curMission.SetProperty(Def_Run_Around_Reward_Money, curMoney)  | 
|       | 
|     curMission.SetProperty(Def_Day_Event_Reward_Item_Id, itemID)  | 
|     curMission.SetProperty(Def_Day_Event_Reward_Item_Count, itemCount)  | 
|     curMission.SetProperty(Def_Run_Around_Reward_FamilyHornor, curFamilyHornor)  | 
|       | 
|     return  | 
|   | 
|   | 
|   | 
| ##»ñÈ¡ÅÜ»·ÈÎÎñ½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param isQuick ÊÇ·ñÒ»¼ü¿ìËÙÍê³É  | 
| # @return curExp, curMoney, pfavalue  ÕÒ²»µ½·µ»ØNone  | 
| def __GetRunAroundReward(curPlayer, curMission, rewardLV=0):  | 
|     curRewardLV = rewardLV if rewardLV > 0 else curPlayer.GetLV()  | 
|     runAroundReward = FindQuestFunc(curMission.GetMissionID()).RunAroundReward  | 
|   | 
|     curLVRunAroundReward = GetRunAroundReward(curPlayer, runAroundReward, curRewardLV)  | 
|     #µÈ¼¶½±ÀøÒì³£QuestTrig.has_key(missionID)  | 
|     if curLVRunAroundReward == None:  | 
|         GameWorld.Log("½±Àø´íÎó id = %d" % curMission.GetMissionID() , curPlayer.GetPlayerID())  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return  | 
|       | 
|     baseExp = curLVRunAroundReward.Exp  | 
|     baseMoney = curLVRunAroundReward.Money  | 
|     reLV = curRewardLV  | 
|     reExp = PlayerControl.GetPlayerReExp(curPlayer)  | 
|       | 
|     curExp = eval(IpyGameDataPY.GetFuncCfg('RunTaskExp'))  | 
|     curExp += curLVRunAroundReward.AddExp  | 
|     curMoney = baseMoney  | 
|     curFamilyHornor = curLVRunAroundReward.PlayerFamilyHornor  | 
|     itemInfo = curLVRunAroundReward.Item  | 
|     if itemInfo:  | 
|         itemID, itemCount = eval(itemInfo)  | 
|     else:  | 
|         itemID, itemCount = 0, 0  | 
|      | 
|     return (curExp, curMoney, curFamilyHornor, itemID, itemCount)  | 
|     | 
| #---------------------------------------------------------------------  | 
| ##¸øÓèÅÜ»·½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸øÓèÅÜ»·½±Àø  | 
| def DoType_Give_Run_Around_Reward(curPlayer, curMission, curActionNode):  | 
|     #XML :  <give_run_around_reward/>  | 
|     curMissionID = curMission.GetMissionID()  | 
|     OnAroundMissionFinish(curPlayer, FindQuestFunc(curMissionID).Type)  | 
|     runAroundReward = FindQuestFunc(curMissionID).RunAroundReward  | 
|     playerControl = PlayerControl.PlayerControl(curPlayer)  | 
|       | 
|     exp = curMission.GetProperty(Def_Run_Around_Reward_Exp)  | 
|     expPoint = curMission.GetProperty(Def_Run_Around_Reward_ExpPoint)  | 
|     exp = expPoint * ChConfig.Def_PerPointValue + exp  | 
|     money = curMission.GetProperty(Def_Run_Around_Reward_Money)  | 
|       | 
|     if exp != 0:  | 
|         playerControl.AddExp(exp)  | 
|         #PlayerControl.NotifyCode(curPlayer, 'GeRen_lhs_0', [exp])  | 
|       | 
|     addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Run"}  | 
|     PlayerControl.GiveMoney(curPlayer, runAroundReward.MoneyType, money, ChConfig.Def_GiveMoney_Mission, addDataDict, False)  | 
|       | 
|     familyHornor = curMission.GetProperty(Def_Run_Around_Reward_FamilyHornor)  | 
|     if familyHornor:   | 
|         PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, familyHornor, True, ShareDefine.Def_AddFAVReason_DoFamilyMisson, True)  | 
|   | 
|     item_id = curMission.GetProperty(Def_Day_Event_Reward_Item_Id)  | 
|     item_count = curMission.GetProperty(Def_Day_Event_Reward_Item_Count)  | 
|       | 
|     #¸øÎïÆ·½±Àø  | 
|     itemInfo = []  | 
|     if item_id and item_count:  | 
|         itemInfo = [[item_id, item_count, True]]  | 
|         packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1)  | 
|         if 1 > packSpace:  | 
|             PlayerControl.NotifyCode(curPlayer, "UnionTask_Reward")  | 
|             PlayerControl.SendMailByKey("UnionTaskReward", [curPlayer.GetID()], itemInfo)  | 
|         else:  | 
|             AddEventItem(curPlayer, curMission, item_id, item_count, bind=True)  | 
|           | 
|     GameWorld.DebugLog("ÈÎÎñ£º%d  »ñµÃ¾Ñé:%d,Ç®=%s,ÎïÆ·ID=%s,ÎïÆ·ÊýÁ¿=%s"   | 
|                        % (curMission.GetMissionID(), exp, money, item_id, item_count))  | 
|       | 
|     FBLogic.DoFB_OnFinishRunAroundTask(curPlayer, curMissionID, exp, {runAroundReward.MoneyType:money}, itemInfo)  | 
|       | 
|     #´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         DataRecordPack.DR_EventAddMoney(curPlayer, "Run_Reward", curMissionID,  | 
|                                         runAroundReward.MoneyType, money)  | 
|     return  | 
|           | 
| ##¸øÓèËùÓÐÅÜ»·½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸øÓèÅÜ»·½±Àø  | 
| def DoType_Give_Run_All_Around_Reward(curPlayer, curMission, curActionNode):  | 
|     # ÅÜ»·»·ÊýÉÏÏÞ£¬´Ó0¿ªÊ¼  | 
| #    curMissionID = curMission.GetMissionID()  | 
| #    curMissionData = FindQuestFunc(curMissionID)  | 
| #    if not curMissionData:  | 
| #        return  | 
| #    missionType = curMissionData.Type  | 
| #    Def_Around_Count = GetRunKey(missionType, Key_Around_Count)  | 
| #    Def_Around_Star = GetRunKey(missionType, Key_Around_Star)  | 
| #          | 
| #    maxAroundCnt = IpyGameDataPY.GetFuncEvalCfg('RunTaskAward', 2)  | 
| #    curAroundCnt = curMission.GetProperty(Def_Around_Count)  | 
| #    if curAroundCnt >= maxAroundCnt:  | 
| #        GameWorld.DebugLog("Ò»¼üÍê³ÉÅÜ»·ÈÎÎñ id=%s,µ±Ç°»·=%s,×î´ó»·=%s"   | 
| #                           % (curMissionID, curAroundCnt, maxAroundCnt))  | 
| #        return  | 
| #      | 
| #    multiple = GameWorld.ToIntDef(curActionNode.GetAttribute("multiple"), 0)  | 
| #      | 
| #    rewardCnt = maxAroundCnt - curAroundCnt  | 
| #    GameWorld.DebugLog("Ò»¼üÍê³ÉÅÜ»·ÈÎÎñ id=%s,µ±Ç°»·Êý=%s,×î´ó»·Êý=%s,½±Àø»·Êý=%s"   | 
| #                       % (curMissionID, curAroundCnt, maxAroundCnt, rewardCnt))  | 
| #      | 
| #    runAroundReward = FindQuestFunc(curMissionID).RunAroundReward  | 
| #    playerControl = PlayerControl.PlayerControl(curPlayer)  | 
| #      | 
| #    addExp = 0  | 
| #    addMoney = 0  | 
| #    addPfavalue = 0  | 
| #    addFHomeExp = 0  | 
| #    curLV = curPlayer.GetLV()  | 
| #    curTotalExp = PlayerControl.GetPlayerTotalExp(curPlayer)  | 
| #    #pfavalue = curMission.GetProperty(Def_Run_Around_Reward_PFAV)  | 
| #    for i in range(rewardCnt):  | 
| #        rewardLV = PlayerControl.GetRealPlayerLvEx(curLV, curTotalExp + addExp)  | 
| #        rewardList = __GetRunAroundReward(curPlayer, curMission, 1, Def_Around_Count,   | 
| #                                          Def_Around_Star, rewardLV, multiple)  | 
| #        if not rewardList:  | 
| #            continue  | 
| #          | 
| #          | 
| #        exp, money, curSoul, pfavalue, familyHomeExp = rewardList  | 
| #          | 
| #        addExp += exp  | 
| #        addMoney += money  | 
| #        addFHomeExp += familyHomeExp  | 
| #          | 
| #        if pfavalue != 0 and curPlayer.GetFamilyID() != 0:  | 
| #            addPfavalue += pfavalue  | 
| #                  | 
| #        GameWorld.DebugLog("    ¸ø»·½±Àøi=%s,curLV=%s,rewardLV=%s,exp=%s,money=%s,pfavalue=%s"   | 
| #                           % (i, curLV, rewardLV, exp, money, pfavalue))  | 
| #  | 
| #    OnAroundMissionFinish(curPlayer, missionType, rewardCnt)  | 
| #    OnTodayAroundMissionFinish(curPlayer, missionType)  | 
| #      | 
| #    if addExp > 0:  | 
| #        playerControl.AddExp(addExp)  | 
| #          | 
| #    if addMoney > 0:  | 
| #        addDataDict = {ChConfig.Def_Give_Reason_SonKey:"AllRun"}  | 
| #        PlayerControl.GiveMoney(curPlayer, runAroundReward.MoneyType, addMoney, ChConfig.Def_GiveMoney_Mission, addDataDict)  | 
| #        if GameWorld.IsMissonDR(curPlayer):  | 
| #            DataRecordPack.DR_EventAddMoney(curPlayer, "Run_Reward", curMissionID,   | 
| #                                            runAroundReward.MoneyType, addMoney)  | 
| #          | 
| #    if addPfavalue > 0:  | 
| #        PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addPfavalue, True,  | 
| #                                                    ShareDefine.Def_AddFAVReason_DoFamilyMisson)  | 
| #      | 
| #    if addFHomeExp > 0:  | 
| #        PlayerFamily.AddFamilyHomeExp(curPlayer, addFHomeExp)  | 
| #           | 
| #    GameWorld.DebugLog("    »·×ܽ±Àø exp=%s,money=%s,pfavalue=%s,addFHomeExp=%s" % (addExp, addMoney, addPfavalue, addFHomeExp))  | 
|     return  | 
|   | 
| ##¸øÓèÐüÉÍÈÎÎñ½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸øÓèÐüÉÍÈÎÎñ½±Àø  | 
| def DoType_Give_Arrest_Reward(curPlayer, curMission, curActionNode):  | 
|     #XML :  <give_arrest_reward/>  | 
|       | 
|     curMissionID = curMission.GetMissionID()  | 
|     if curMissionID != ChConfig.Def_ArrestMissionID:  | 
|         return  | 
|     PlayerArrestTask.OnArrestTaskOver(curPlayer)  | 
|       | 
|     return  | 
| #---------------------------------------------------------------------  | 
| ##¸øÃ¿ÈÕÈÎÎñ½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Set_Day_Event_Reward type="½±ÀøÀàÐÍ"/>  | 
| def DoType_Set_Day_Event_Reward(curPlayer, curMission, curActionNode):  | 
|     #¸øÃ¿ÈÕÈÎÎñ½±Àø  | 
|     #<set_day_event_reward type=""/>  | 
|     #2009.7.8ÐÂÔöïÚ³µÈÎÎñ½±ÀøÌØÊâ´¦Àí  | 
|     missionType = GameWorld.ToIntDef(curActionNode.GetAttribute("type"), 0)  | 
|     curRewardLV = curPlayer.GetLV()  | 
|     dayEventReward = FindQuestFunc(curMission.GetMissionID()).DayEventReward  | 
|     familyLV = curPlayer.GetFamilyLV()  | 
|     if dayEventReward == None:  | 
|         GameWorld.Log("½±Àø´íÎó id = %d" % curMission.GetMissionID() , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     if curRewardLV < dayEventReward.MinLV:  | 
|         curRewardLV = dayEventReward.MinLV  | 
|     if curRewardLV > dayEventReward.MaxLV:  | 
|         curRewardLV = dayEventReward.MaxLV  | 
|     #µÈ¼¶½±ÀøÒì³£QuestTrig.has_key(missionID)  | 
|     if not dayEventReward.Rewards.has_key(curRewardLV):  | 
|         GameWorld.Log("##µÈ¼¶½±ÀøÒì³£,ûÓоÑé½±Àø")  | 
|         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Perfection")  | 
|         return  | 
|       | 
|     #¼Ò×åÈÎÎñ½±Àø±¶ÂÊ£¬Ä¬ÈÏΪ1±¶£º10000£¨2009.10.26£©******************  | 
|     rewardRate = ChConfig.Def_Mission_Reward_Rate  | 
|     if curMission and curMission.GetProperty('rewardRate'):  | 
|         rewardRate = curMission.GetProperty('rewardRate')  | 
|       | 
|     #µ±Ç°µÈ¼¶ÈÎÎñ½±Àø½á¹¹Ìå  | 
|     curLVDayEventReward = dayEventReward.Rewards[curRewardLV]  | 
|       | 
|     #ÿÈÕÈÎÎñ¾Ñé½±Àø  | 
|     baseExp = curLVDayEventReward.Exp  | 
|     count = curMission.GetProperty(QuestCommon.Def_Day_Event_Cur_Complete_Count)  | 
|     if missionType == 0:  | 
|         curExp = eval(ChConfig.Def_Day_Event_Exp_Reward_Formula) * rewardRate  | 
|     #ÌØÊâïÚ³µ  | 
|     elif missionType == 1:  | 
|         curExp = eval(ReadChConfig.GetChConfig('Mission_Truck_Exp')) * rewardRate  | 
|     curMission.SetProperty(Def_Day_Event_Reward_Exp, int(curExp / ChConfig.Def_Mission_Reward_Rate))  | 
|     #½ðÇ®½±Àø  | 
|     if curLVDayEventReward.Money != 0:  | 
|         curMission.SetProperty(Def_Day_Event_Reward_Money, curLVDayEventReward.Money)     | 
|     #ïÚ³µÑ¹½ð  | 
|     if curLVDayEventReward.TruckMoney != 0:  | 
|         curMission.SetProperty(Def_Day_Event_Reward_Truck_Money, curLVDayEventReward.TruckMoney)  | 
|     #¼Ò×å¹±Ï×  | 
|     if curLVDayEventReward.PlayerFamilyHornor != 0:  | 
|         if missionType == 0:  | 
|             playerFamilyHornor = (curLVDayEventReward.PlayerFamilyHornor) * rewardRate  | 
|         elif missionType == 1:  | 
|             playerFamilyHornor = ((curLVDayEventReward.PlayerFamilyHornor) * familyLV) * rewardRate  | 
|               | 
|         curMission.SetProperty(Def_Day_Event_Reward_Player_Family_Hornor, int(playerFamilyHornor / ChConfig.Def_Mission_Reward_Rate))      | 
|     #¼Ò×å»îÔ¾  | 
|     if curLVDayEventReward.PlayerFamilyActiveValue != 0:  | 
|         if missionType == 0:  | 
|             playerFamilyActive = (curLVDayEventReward.PlayerFamilyActiveValue) * rewardRate  | 
|         elif missionType == 1:  | 
|             playerFamilyActive = ((curLVDayEventReward.PlayerFamilyActiveValue) * familyLV) * rewardRate  | 
|               | 
|         curMission.SetProperty(Def_Day_Event_Reward_Player_Family_ActiveValue, int(playerFamilyActive / ChConfig.Def_Mission_Reward_Rate))  | 
|     #¼Ò×å×ʽð  | 
|     if curLVDayEventReward.FamilyMoney != 0:  | 
|         if missionType == 0:  | 
|             familyMoney = (curLVDayEventReward.FamilyMoney) * rewardRate  | 
|         elif missionType == 1:  | 
|             familyMoney = ((curLVDayEventReward.FamilyMoney) * familyLV) * rewardRate  | 
|           | 
|         curMission.SetProperty(Def_Day_Event_Reward_Family_Money, int(familyMoney / ChConfig.Def_Mission_Reward_Rate))  | 
|     #¼Ò×å¸öÈËÈÙÓþ  | 
|     if curLVDayEventReward.FamilyHornor != 0:  | 
|         if missionType == 0:  | 
|             familyHornor = (curLVDayEventReward.FamilyHornor) * rewardRate  | 
|         elif missionType == 1:  | 
|             familyHornor = ((curLVDayEventReward.FamilyHornor) * familyLV) * rewardRate  | 
|               | 
|         curMission.SetProperty(Def_Day_Event_Reward_Family_Hornor, int(familyHornor / ChConfig.Def_Mission_Reward_Rate))  | 
|       | 
|     #---³èÎï¾Ñé---  | 
|     if curLVDayEventReward.PetExp != 0:  | 
|         if missionType == 0:  | 
|             petExp = int(curLVDayEventReward.PetExp * rewardRate / ChConfig.Def_Mission_Reward_Rate)  | 
|         elif missionType == 1:  | 
|             petExp = int(curLVDayEventReward.PetExp * familyLV * rewardRate / ChConfig.Def_Mission_Reward_Rate)  | 
|               | 
|         curMission.SetProperty(Def_Day_Event_Reward_Pet_Exp, petExp)  | 
|       | 
|     #---ÎïÆ·---  | 
|     listStr = curLVDayEventReward.Item  | 
|     itemID, itemCount = DealWithInPut_InDig(listStr)  | 
|     if itemID == 0:  | 
|         return  | 
|       | 
|     curMission.SetProperty(Def_Day_Event_Reward_Item_Id, itemID)  | 
|     curMission.SetProperty(Def_Day_Event_Reward_Item_Count, itemCount)  | 
|       | 
|     #---ÍþÍû---  | 
|     if curLVDayEventReward.Prestige != 0:  | 
|         curMission.SetProperty(Def_Day_Event_Reward_Prestige, curLVDayEventReward.Prestige)  | 
|     return  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÿÈÕÈÎÎñ½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Give_Day_Event_Reward />  | 
| def DoType_Give_Day_Event_Reward(curPlayer, curMission, curActionNode):  | 
|     #XML :  <give_day_event_reward/>  | 
|     #ÿÈÕÈÎÎñ²»ÏíÊܾÑé¼Ó³É½±Àø  | 
|     #---»ñÈ¡Íæ¼ÒÊôÐÔ---  | 
|     curPlayerID = curPlayer.GetID()  | 
|     curPlayerFamilyID = curPlayer.GetFamilyID()  | 
|     playerControl = PlayerControl.PlayerControl(curPlayer)  | 
|       | 
|     #---»ñÈ¡ÈÎÎñÊôÐÔ---  | 
|     curMissionID = curMission.GetMissionID()  | 
|     dayEventReward = FindQuestFunc(curMissionID).DayEventReward  | 
|     addExp = curMission.GetProperty(Def_Day_Event_Reward_Exp)  | 
|     addMoney = curMission.GetProperty(Def_Day_Event_Reward_Money)  | 
| #===============================================================================  | 
| #    #ïÚ³µ»Ù»µºóµÄ½±Àø¸Ä±ä  | 
| #    if curMissionID == curPlayer.GetTruckEventID():  | 
| #        if curPlayer.GetTruckState()== IPY_GameWorld.tusDestroy:  | 
| #            exp = int(exp * ChConfig.Def_Day_Event_Truck_Destroy_Exp)  | 
| #            money = int(money * ChConfig.Def_Day_Event_Truck_Destroy_Money)  | 
| #===============================================================================  | 
|     if addExp > 0:  | 
|         playerControl.AddExp(addExp)  | 
|         #GameWorld.Log("ÈÎÎñ%s, »ñµÃ¾Ñé:%s"%(curMission.GetMissionID(), addExp), curPlayerID)  | 
|       | 
|     if addMoney > 0:  | 
|         addDataDict = {ChConfig.Def_Give_Reason_SonKey:"DayEvent"}  | 
|         PlayerControl.GiveMoney(curPlayer, dayEventReward.MoneyType, addMoney, ChConfig.Def_GiveMoney_Mission, addDataDict)  | 
|       | 
|     #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         DataRecordPack.DR_EventAddMoney(curPlayer, "Day_Event_Reward", curMissionID,  | 
|                                         dayEventReward.MoneyType, addMoney)  | 
|       | 
|     if curPlayerFamilyID > 0:  | 
|         #Ìí¼ÓµÄ¸öÈË»îÔ¾¶È  | 
|         addPlayerActiveValue = curMission.GetProperty(Def_Day_Event_Reward_Player_Family_ActiveValue)  | 
|         #Ìí¼Ó¼Ò×å×ʽð  | 
|         addFamilyMoney = curMission.GetProperty(Def_Day_Event_Reward_Family_Money)  | 
|         if addPlayerActiveValue > 0:  | 
|             PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addPlayerActiveValue,  | 
|                                                 sendPackGameServer=False, reason=ShareDefine.Def_AddFAVReason_DoFamilyMisson)  | 
|               | 
|             PlayerControl.NotifyCode(curPlayer , "Family_Task_Award02", [addPlayerActiveValue])  | 
|           | 
|         if addFamilyMoney > 0:  | 
|             PlayerControl.NotifyCode(curPlayer , "Family_Task_Award03", [addFamilyMoney])  | 
|           | 
|         #ÀÛ¼Ó¼Ò×åÊôÐÔ  | 
|         PlayerFamily.SendPack_GameServer_AddFamilyDetailEx(curPlayer, addPlayerActiveValue, addFamilyMoney=addFamilyMoney,   | 
|                                                            resion=ShareDefine.Def_AddFAVReason_DoFamilyMisson)  | 
|   | 
|     #³èÎï¾Ñé½±Àø  | 
|     #petExpValue = curMission.GetProperty(Def_Day_Event_Reward_Pet_Exp)  | 
|           | 
|     item_id = curMission.GetProperty(Def_Day_Event_Reward_Item_Id)  | 
|     item_count = curMission.GetProperty(Def_Day_Event_Reward_Item_Count)  | 
|       | 
|     if item_id <= 0 or item_count <= 0:  | 
|         return  | 
|       | 
|     #¸øÎïÆ·½±Àø  | 
|     AddEventItem(curPlayer, curMission, item_id, item_count)  | 
|       | 
|     #ÍþÍû½±Àø  | 
|     #addPrestige = curMission.GetProperty(Def_Day_Event_Reward_Prestige)  | 
|     #if addPrestige != 0:  | 
|     #    PlayerPrestigeSys.AddPrestigeOffcialLV(curPlayer, addPrestige, ChConfig.Def_AddPrestige_DayMission)  | 
|           | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##´ò¿ª½çÃæ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <open_frm cmd = "´ò¿ª½çÃæ"/>  | 
| def DoType_Open_Frm(curPlayer, curMission, curActionNode):  | 
|     #<open_frm cmd = "task_frm"/>  | 
|     msg = curActionNode.GetAttribute("cmd")  | 
|     curPlayer.Frm_Open(msg)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##´ò¿ªÅÝÅÝ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <open_Bubble cmd = "´ò¿ª½çÃæ"/>  | 
| def DoType_Open_Bubble(curPlayer, curMission, curActionNode):  | 
|     #<open_Bubble cmd = "´ò¿ª½çÃæ"/>  | 
|     msg = curActionNode.GetAttribute("cmd")  | 
|     curPlayer.OpenBubble(msg)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##½øÈëµ¥È˸±±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Single_Enter_FB mapid = "µØÍ¼ID" lineid = "Ïß·ID" posx = "×ø±êX" posy = "×ø±êY"/>  | 
| def DoType_Single_Enter_Fb(curPlayer, curMission, curActionNode):  | 
|     #<Single_Enter_FB mapid = "505" posx = "35" posy = "32"/>  | 
|     mapID = int(curActionNode.GetAttribute("mapid"))  | 
|     lineID = GameWorld.ToIntDef(curActionNode.GetAttribute("lineid"), 0)  | 
|     posx = GameWorld.ToIntDef(curActionNode.GetAttribute("posx"), 0)  | 
|     posy = GameWorld.ToIntDef(curActionNode.GetAttribute("posy"), 0)  | 
|     PlayerControl.PlayerEnterFB(curPlayer, mapID, lineID, posx, posy)  | 
|     #¼Ç¼¸±±¾¶ÔÓ¦µÄÈÎÎñID  | 
|     if FBCommon.GetRecordMapID(mapID) in [ChConfig.Def_FBMapID_ClearDevil, ChConfig.Def_FBMapID_MagicWeapon]:  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ReqFBMissionID, curMission.GetMissionID())  | 
|         missionID = curMission.GetMissionID()  | 
|         curMissionData = FindQuestFunc(missionID)  | 
|         if curMissionData:  | 
|             missionType = curMissionData.Type  | 
|             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ReqFBMissionType, missionType)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##½øÈë×é¶Ó¸±±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Team_Enter_FB mapid = "µØÍ¼ID" posx = "×ø±êX" posy = "×ø±êY"/>  | 
| def DoType_Team_Enter_Fb(curPlayer, curMission, curActionNode):  | 
|     DoType_Single_Enter_Fb(curPlayer, curMission, curActionNode)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##½øÈë¼Ò×帱±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Family_Enter_FB mapid = "µØÍ¼ID" posx = "×ø±êX" posy = "×ø±êY"/>  | 
| def DoType_Family_Enter_Fb(curPlayer, curMission, curActionNode):  | 
|     DoType_Single_Enter_Fb(curPlayer, curMission, curActionNode)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| #def NotifyNewQuestInfo(curPlayer, curMission):  | 
| #    if curMission.GetState() != 0:  | 
| #        return  | 
| #      | 
| #    curQuest = FindQuestFunc(curMission.GetMissionID())  | 
| #    day_CountMsg = ReplaceNPCTalkText(curPlayer, curMission, curQuest.Day_Count)  | 
| #    #curQuest.Name  | 
| #    curPlayer.NotifySpecialQuest(curQuest.ID, curQuest.Type, curQuest.NameCode, curQuest.LV, curQuest.MapID, curQuest.NPCID, day_CountMsg)  | 
| #    #GameWorld.Log("-----δ½ÓÈÎÎñ : %s , %s"%(curQuest.Name, day_CountMsg))  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ë¢ÐÂÿÈÕÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <refresh_day_event/>  | 
| def DoType_Refresh_Day_Event(curPlayer, curMission, curActionNode):  | 
| #    NotifyNewQuestInfo(curPlayer, curMission)  | 
|     RefreshMission(curPlayer, curMission)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ɾ³ýÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Delete_Mission id="Ҫɾ³ýµÄÈÎÎñID"/>  | 
| def DoType_Delete_Mission(curPlayer, curMission, curActionNode):  | 
|     #<Delete_Mission id=""/> É¾³ýÈÎÎñ  | 
|     newMissionID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|     if newMissionID == 0:  | 
|         missionID = curMission.GetMissionID()  | 
|     else:  | 
|         if not curPlayer.FindMission(newMissionID):  | 
|             # ÉíÉÏÎÞ´ËÈÎÎñ  | 
|             return  | 
|         missionID = newMissionID  | 
|     #ɾ³ýÕâ¸öÈÎÎñ  | 
|     QuestCommon.DeleteMission(curPlayer, missionID)  | 
|     if newMissionID == 0:  | 
|         curMission = None  | 
|     return  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ìí¼Ó¸±±¾NPC  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Add_FB_NPC id = "NPCID" count = "NPCÊýÁ¿"/>  | 
| def DoType_Add_Fb_Npc(curPlayer, curMission, curActionNode):  | 
|     #Ìí¼Ó¸±±¾NPC  | 
|     #<Add_FB_NPC id = "" count = ""/>  | 
|     npcid = int(curActionNode.GetAttribute("id"))  | 
|     npcCount = int(curActionNode.GetAttribute("count"))  | 
|     curPlayer.AddChangeMapTakeCreateNPC(npcid, npcCount)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸øÈÎÎñÌØÊâ½±Àø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Give_Special_Mission_Reward />  | 
| def DoType_Give_Special_Mission_Reward(curPlayer, curMission, curActionNode):  | 
|     #<give_special_mission_reward/>  | 
|     QuestRunnerValue.GiveSpecialMissionReward(curPlayer, curMission, curActionNode)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¹Ø±Õ¸±±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Close_FB />  | 
| def DoType_Close_Fb(curPlayer, curMission, curActionNode):  | 
|     #É趨¹Ø±Õ¸±±¾µÄʱ¼ä  | 
|     GameWorldProcess.CloseFB(GameWorld.GetGameWorld().GetTick())  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##À뿪¸±±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Leave_FB />  | 
| def DoType_Leave_Fb(curPlayer, curMission, curActionNode):  | 
|     #<Leave_FB/>  | 
|     PlayerControl.PlayerLeaveFB(curPlayer)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##À뿪¸±±¾  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Exit_Fb />  | 
| def DoType_Exit_Fb(curPlayer, curMission, curActionNode):  | 
|     PlayerControl.PlayerLeaveFB(curPlayer)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸´»îµã¼Ç¼  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Set_Reborn_Point />  | 
| def DoType_Set_Reborn_Point(curPlayer, curMission, curActionNode):  | 
|     #°ÑÈËÎïÉèÖûØÖØÉúµã  | 
|     gameData = GameWorld.GetGameData()  | 
|     bornRefreshCount = gameData.GetBornRefreshCount()  | 
|     if bornRefreshCount == 0:  | 
|         #GameWorld.Log("´ËµØÍ¼Ã»ÓÐÖØÉúµã" , curPlayer.GetPlayerID())  | 
|         return False  | 
|     #Ò»°ãÖØÉúµãÁбí,¸ù¾Ý¹ú¼®É¸Ñ¡  | 
|     bornList = []  | 
|     #´´½¨ÖØÉúµãÁÐ±í  | 
|     for i in range(0, bornRefreshCount):  | 
|         bornRefreshPoint = gameData.GetBornRefreshByIndex(i)  | 
|         if GameWorld.IsSameCountry(curPlayer, bornRefreshPoint):  | 
|             bornList.append(i)  | 
|       | 
|     if len(bornList) == 0:  | 
|         #GameWorld.Log("´ËµØÍ¼Ã»ÓкÏÊÊÍæ¼ÒµÄÖØÉúµã" , curPlayer.GetPlayerID())  | 
|         return False  | 
|       | 
|     randIndex = random.randint(0, len(bornList) - 1)  | 
|     bornIndex = bornList[randIndex]  | 
|     bornRefreshPoint = gameData.GetBornRefreshByIndex(bornIndex)  | 
|     roundPos = bornRefreshPoint.GetRound()  | 
|       | 
|     bornX = random.randint(bornRefreshPoint.GetPosX() - roundPos ,  | 
|                                bornRefreshPoint.GetPosX() + roundPos)  | 
|     bornY = random.randint(bornRefreshPoint.GetPosY() - roundPos ,  | 
|                                bornRefreshPoint.GetPosY() + roundPos)  | 
|   | 
|     curPlayer.SetRebornMapID(curPlayer.GetMapID())  | 
|     curPlayer.SetRebornPosX(bornX)  | 
|     curPlayer.SetRebornPosY(bornY)  | 
|     return  | 
|   | 
| ##ÉèÖÃÒÑ»ñµÃ·¨±¦¸öÊý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Set_Mwcnt key="" />  | 
| def DoType_Set_Mwcnt(curPlayer, curMission, curActionNode):  | 
|     key = curActionNode.GetAttribute("key")  | 
|     curMission.SetProperty(key, PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer))  | 
|     return  | 
|   | 
| ##ÉèÖÃ×øÆï×ܵȼ¶  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Set_Horsetotallv key="" />  | 
| def DoType_Set_Horsetotallv(curPlayer, curMission, curActionNode):  | 
|     key = curActionNode.GetAttribute("key")  | 
|     questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|     if questID != 0:  | 
|         curMission = curPlayer.FindMission(questID)  | 
|     curMission.SetProperty(key, PlayerHorse.GetHorseSumLV(curPlayer))  | 
|     return  | 
|   | 
| ##ÉèÖÃÇ¿»¯×ܵȼ¶  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Set_Totalpluslv key="" />  | 
| def DoType_Set_Totalpluslv(curPlayer, curMission, curActionNode):  | 
|     key = curActionNode.GetAttribute("key")  | 
|     questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|     if questID != 0:  | 
|         curMission = curPlayer.FindMission(questID)  | 
|     curMission.SetProperty(key, ChEquip.GetTotalPlusLV(curPlayer, False))  | 
|     return  | 
|   | 
| ##ÉèÖÃ×°±¸×ÜÐǼ¶  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks <Set_Equiptotalstar key="" />  | 
| def DoType_Set_Equiptotalstar(curPlayer, curMission, curActionNode):  | 
|     key = curActionNode.GetAttribute("key")  | 
|     questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|     if questID != 0:  | 
|         curMission = curPlayer.FindMission(questID)  | 
|     curMission.SetProperty(key, ChEquip.GetTotalEquipStars(curPlayer))  | 
|     return  | 
| #---------------------------------------------------------------------  | 
| ##DoType_µ÷¶ÈÆ÷  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks Ö´ÐÐÈÎÎñÏàÓ¦Âß¼  | 
| def DoAction(curPlayer, curMission, curActionNode):  | 
|     funcName = curActionNode.GetNodeName()  | 
|     funcName = "DoType_" + funcName.title()  | 
|       | 
|     if globals().has_key(funcName):  | 
|         return globals()[funcName](curPlayer, curMission, curActionNode)  | 
|     else:  | 
|         GameWorld.Log("Error : DoAction actionName = %s" % funcName)  | 
|       | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´Ðз¢²¼ÈÎÎñ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Send_Pub_Mission missionID="ÈÎÎñID" pubType="·¢²¼ÀàÐÍ" />   | 
| def DoType_Send_Pub_Mission(curPlayer, curMission, curActionNode):  | 
|     #ÈÎÎñ·¢²¼ : ÈÎÎñID, ·¢²¼ÀàÐÍ, ·¢²¼ID  | 
|     #GameServer_MissionPub(int missionID, int pubType, int pubID);  | 
|     #XML£º<send_pub_mission pubType="" pubID=""/>pubType:·¢²¼ÀàÐÍ pubID:·¢²¼ÈÎÎñID  | 
|     pubType = GameWorld.ToIntDef(curActionNode.GetAttribute("pubType"), 0)  | 
|     curMissionID = GameWorld.ToIntDef(curActionNode.GetAttribute("missionID"), 0)  | 
|     pubID = curPlayer.GetFamilyID()  | 
|     #֪ͨÈÎÎñ·¢²¼  | 
|     curPlayer.GameServer_MissionPub(curMissionID, pubType, pubID)  | 
|     #GameWorld.Log("·¢²¼ÈÎÎñ³É¹¦**************************")  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Íæ¼Òµ±Ç°×´Ì¬ÊÇ·ñÄÜɾ³ýÈÎÎñÅÐ¶Ï  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Can_Del_Mission />   | 
| def ConditionType_Can_Del_Mission(curPlayer, curMission, curConditionNode):  | 
|     #<can_del_mission/>  | 
|     #·Ç¿ÕÏÐ״̬²»´¦Àí/·Ç¸±±¾×´Ì¬  | 
|     curMap = GameWorld.GetMap()  | 
|     if curPlayer.GetPlayerAction() != IPY_GameWorld.paNull or curMap.GetMapFBType() != IPY_GameWorld.fbtNull:  | 
|         #ÄúºÃ,ÄúÖ»ÓÐÔÚ¿ÕÏÐ״̬ÏÂ²Å¿É·ÅÆúÈÎÎñ  | 
|         #PlayerControl.NotifyCode(curPlayer,"Task_cannot_Delete02")  | 
|         return False  | 
|       | 
|     #ÒÆ¶¯Öв»Ö´Ðд˲Ù×÷  | 
|     if curPlayer.IsMoving():  | 
|         return False  | 
|       | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÊÇ·ñºìÃû  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Check_Player_Name_Red result="ÆÚÍû½á¹û" />   | 
| def ConditionType_Check_Player_Name_Red(curPlayer, curMission, curConditionNode):  | 
|     #0²»ÊÇ£¬1ÊÇ     <Check_Player_Name_Red result=""/>  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     if curPlayer.GetPlayerNameColor() != IPY_GameWorld.pncRed:  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÊÇ·ñ2ÈËÒìÐÔ×é¶Ó  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Player_Diff_Sex_Team result="ÆÚÍû½á¹û" />   | 
| def ConditionType_Player_Diff_Sex_Team(curPlayer, curMission, curConditionNode):  | 
|     #<player_diff_sex_team result=""/> 0²»ÊÇ2ÈËÒìÐÔ×é¶Ó£¬1ÊÇ  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)   | 
|       | 
|     curPlayerTeam = curPlayer.GetTeam()  | 
|     if curPlayerTeam == None:  | 
|         return False == result  | 
|     #¶ÓÎ鳬¹ý2ÈË£¬²»´¦Àí  | 
|     if curPlayerTeam.GetMemberCount() != 2:  | 
|         return False == result  | 
|       | 
|     for i in range(0, curPlayerTeam.GetMemberCount()):  | 
|         player = curPlayerTeam.GetMember(i)  | 
|         if curPlayer.GetPlayerID() == player.GetPlayerID():  | 
|             continue  | 
|         if curPlayer.GetSex() == player.GetSex():  | 
|             return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Åж϶ÓÎéÈÎÎñÊÇ·ñÏàͬ״̬  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Player_Team_Mission_State state="ÈÎÎñ״̬" result="ÆÚÍû½á¹û" />        | 
| def ConditionType_Player_Team_Mission_State(curPlayer, curMission, curConditionNode):  | 
|     #<Player_Team_Mission_State state="" result=""/>  | 
|     state = GameWorld.ToIntDef(curConditionNode.GetAttribute("state"), 0)  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     missionID = curMission.GetMissionID()  | 
|     #Íæ¼Ò×Ô¼ºÅÐ¶Ï  | 
|       | 
|     curPlayerTeam = curPlayer.GetTeam()  | 
|     if curPlayerTeam == None:  | 
|         return False == result  | 
|       | 
|     for i in range(0, curPlayerTeam.GetMemberCount()):  | 
|         player = curPlayerTeam.GetMember(i)  | 
|   | 
|         curMission = player.FindMission(missionID)  | 
|         #ÓÐÈËûÓÐÈÎÎñ£¬·µ»Ø  | 
|         if curMission == None:  | 
|             return False == result  | 
|         #ÈÎÎñ״̬²»Í¬£¬·µ»Ø  | 
|         if curMission.GetState() != state:  | 
|             return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Åж϶ÓÎéÈËÊý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Team_Player_Count count="ÆÚÍûÈËÊý" result="ÆÚÍû½á¹û" />    | 
| def ConditionType_Team_Player_Count(curPlayer, curMission, curConditionNode):  | 
|     #<Team_Player_Count count="" result=""/>  | 
|     playerCount = GameWorld.ToIntDef(curConditionNode.GetAttribute("count"), 0)  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     curPlayerTeam = curPlayer.GetTeam()  | 
|     #û¶ÓÎ飬·µ»Ø  | 
|     if curPlayerTeam == None:  | 
|         return False == result  | 
|     #¶ÓÎ鳬¹ý£¬²»´¦Àí  | 
|     if curPlayerTeam.GetMemberCount() != playerCount:  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÊDz»ÊǶӳ¤  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Is_Team_Leader result="ÆÚÍû½á¹û" />    | 
| def ConditionType_Is_Team_Leader(curPlayer, curMission, curConditionNode):  | 
|     #<Is_Team_Leader result=""/>  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     curPlayerTeam = curPlayer.GetTeam()  | 
|     #û¶ÓÎ飬·µ»Ø  | 
|     if curPlayerTeam == None:  | 
|         return False == result  | 
|       | 
|     if curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÈÎÎñ״̬ÊÇ·ñ¶¼Îª0£¬ÄÜ·ñÖ´ÐÐɾ³ýÈÎÎñÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Can_Del_All_Mission_Item result="ÆÚÍû½á¹û" />  | 
| def ConditionType_Can_Del_All_Mission_Item(curPlayer, curMission, curConditionNode):  | 
|     #<Can_Del_All_Mission_Item result=""/>  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     #ÅжÏËùÓÐÈÎÎñ  | 
|     for i in range(0, curPlayer.GetMissionCount()):  | 
|         curMission = curPlayer.GetMissionByIndex(i)  | 
|           | 
|         if curMission != None and \  | 
|         curMission.GetState() in [ChConfig.Def_Mission_State_NoAccept, ChConfig.Def_Mission_State_Over]:  | 
|             continue  | 
|           | 
|         #ÓÐÈÎÎñ״̬²»µÈÓÚ0»ò-1  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÉíÉÏÓÐûÓÐÈÎÎñÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Have_Mission_Item result="ÆÚÍû½á¹û" />  | 
| def ConditionType_Have_Mission_Item(curPlayer, curMission, curConditionNode):  | 
|     #<Have_Mission_Item result=""/>  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     rolePack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)  | 
|     for i in range(0, rolePack.GetCount()):  | 
|         item = rolePack.GetAt(i)  | 
|           | 
|         if not ItemCommon.CheckItemCanUse(item):  | 
|             continue  | 
|           | 
|         #ÊÇÈÎÎñÎïÆ·ÀàÐÍ£¬·µ»Ø  | 
|         if ItemControler.IsEventItem(item):  | 
|             return True == result  | 
|   | 
|     return False == result  | 
|       | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÈÎÎñ״̬¶¼Îª0,¿ÉÒÔɾ³ýËùÓÐÈÎÎñÏà¹ØÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Del_All_Mission_Item />   | 
| def DoType_Del_All_Mission_Item(curPlayer, curMission, curActionNode):  | 
|     #<Del_All_Mission_Item/>  | 
|     rolePack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)  | 
|     for i in range(0, rolePack.GetCount()):  | 
|         item = rolePack.GetAt(i)  | 
|           | 
|         if not ItemCommon.CheckItemCanUse(item):  | 
|             continue  | 
|           | 
|         #²»ÊÇÈÎÎñÎïÆ·ÀàÐÍ£¬²»´¦Àí  | 
|         if not ItemControler.IsEventItem(item):  | 
|             continue  | 
|           | 
|         itemCount = item.GetCount()  | 
|         itemID = item.GetItemTypeID()  | 
|         isBind = item.GetIsBind()  | 
|         itemGuid = item.GetGUID()  | 
|           | 
|         #ɾ³ýÈÎÎñÎïÆ·  | 
|         ItemControler.DelPlayerItem(curPlayer, IPY_GameWorld.rptItem, itemID, itemCount, delEventItem=True, guidList=None)  | 
|         #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|         if GameWorld.IsMissonDR(curPlayer):  | 
|             missionID = QuestCommon.GetMissionID(curMission)  | 
|             dataDict = {"ItemID":itemID, "ItemCount":itemCount, "IsBind":isBind, "ItemGUID":itemGuid,  | 
|                         "MissionID":missionID}  | 
|             DataRecordPack.DR_DeleteItem(curPlayer, "Event_Del_Item_All", dataDict)  | 
|           | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐËãØÔËæ»ú»ñµÃÎïÆ·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Player_Lucky_Show />   | 
| def DoType_Player_Lucky_Show(curPlayer, curMission, curActionNode):  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÐÇÆÚ¼¸ÅжϠ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Week_Index type="__Eval+Ìæ»»µÄÃû×Ö" value="ÆÚÍûÖµ" />   | 
| def ConditionType_Week_Index(curPlayer, curMission, curConditionNode):  | 
|     #<week_index type="great" value="1"/>  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     conditionValue = curConditionNode.GetAttribute("value")  | 
|           | 
|     curTime = GameWorld.GetCurrentTime()  | 
|     #ÐÇÆÚ¼¸  | 
|     curWeekIndex = curTime.weekday() + 1  | 
|       | 
|     return QuestRunnerValue.GetEval(conditionType, curWeekIndex, int(conditionValue))  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÍòÄܱ³°üÊÇ·ñΪ¿Õ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Check_Anywhere_Bag result="ÆÚÍûÖµ" />   | 
| def ConditionType_Check_Anywhere_Bag(curPlayer, curMission, curConditionNode):  | 
|     #<Check_Anywhere_Bag result=""/>  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     itemManager = curPlayer.GetItemManager()  | 
|     playerPack = itemManager.GetPack(IPY_GameWorld.rptAnyWhere)  | 
|     if not ItemControler.GetPackIsEmpty(playerPack):  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
|   | 
| ##ÅжÏÍæ¼ÒÊÇ·ñÓгäÖµ¹ý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Check_Change_Coin result="ÆÚÍûÖµ" />   | 
| def ConditionType_Check_Change_Coin(curPlayer, curMission, curConditionNode):  | 
|     #<Check_Anywhere_Bag result=""/>  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     #Íæ¼Ò¶Ò»»µãȯ¼Ç¼  | 
|     totalChangeCoinPointBefore = curPlayer.GetChangeCoinPointTotal()  | 
|     if totalChangeCoinPointBefore > 0:  | 
|         return True == result  | 
|       | 
|     return False == result   | 
|   | 
|   | 
| ##ÅжÏÍæ¼ÒÊÇ·ñÓгöÕ½³èÎï  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Check_Change_Coin result="ÆÚÍûÖµ" />   | 
| def ConditionType_Check_Pet_Out(curPlayer, curMission, curConditionNode):  | 
|     #<Check_Anywhere_Bag result=""/>  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|       | 
|     petMgr = curPlayer.GetPetMgr()  | 
|     fightPetObj = petMgr.GetFightPet()  # ³öÕ½µÄ³èÎï¶ÔÏó  | 
|     if fightPetObj != None:  | 
|         return True == result  | 
|       | 
|     return False == result  | 
|   | 
|   | 
| ##ÅжÏÍæ¼ÒºÃÓѸöÊý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢   | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Check_Friend_Count" type="Ìæ»»µÄÃû×Ö" value="ÆÚÍûÖµ" />   | 
| def ConditionType_Check_Friend_Count(curPlayer, curMission, curConditionNode):  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|       | 
|     return QuestRunnerValue.GetEval(conditionType, curPlayer.GetFriendCount(), conditionValue)  | 
|   | 
|   | 
| ##ÅжÏVIPµÈ¼¶  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢   | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Check_Vip_Lv" type="Ìæ»»µÄÃû×Ö" value="ÆÚÍûÖµ" />   | 
| def ConditionType_Check_Vip_Lv(curPlayer, curMission, curConditionNode):  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     vipLv = curPlayer.GetVIPLv()  | 
|     GameWorld.Log("ÅжÏVIPµÈ¼¶:%s" % (curPlayer.GetVIPLv()))  | 
|     return QuestRunnerValue.GetEval(conditionType, vipLv, conditionValue)  | 
|   | 
|   | 
| ##ÅжϷ¨±¦¾Ñé  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢   | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Check_Magicweapon_Lv" mwid="·¨±¦ID" value="ÆÚÍûÖµ" />   | 
| def ConditionType_Check_Magicweapon_Lv(curPlayer, curMission, curConditionNode):  | 
|     mwid = GameWorld.ToIntDef(curConditionNode.GetAttribute("mwid"), 0)  | 
|     conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     return PlayerMagicWeapon.GetIsActiveMagicWeapon(curPlayer, mwid, conditionValue)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓµÓÐ×ã¹»µÄ¾º¼¼µã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Have_Vspoint value="ÊýÖµ", result="ÆÚÍûµÄ½á¹û" />   | 
| def ConditionType_Have_Vspoint(curPlayer, curMission, curConditionNode):  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     value = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|       | 
|     if PlayerControl.GetVsSportsPoint(curPlayer) >= value:  | 
|         return 1 == result  | 
|       | 
|     return 0 == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñ¼Ò×峤  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ÊÇ·ñ¼Ò×峤  | 
| def __IsFamilyLeader(curPlayer):  | 
|     curMember = curPlayer.GetFamilyMemberLV()  | 
|     if curMember == None:  | 
|         GameWorld.Log("¼Ò×å³ÉÔ±µÈ¼¶->·â°üÒì³£->Î޴˳ÉÔ±" , curPlayer.GetPlayerID())  | 
|         return False  | 
|       | 
|     if curMember != IPY_GameWorld.fmlLeader:  | 
|         return False  | 
|       | 
|     return True  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÆÚÍûµÄÐÔ±ð  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Player_Sex id="ÎïÆ·ID" sex="ÆÚÍûµÄÐÔ±ð" result="ÆÚÍûµÄ½á¹û" />   | 
| def ConditionType_Player_Sex(curPlayer, curMission, curConditionNode):  | 
|     #<player_sex sex="" result=""/>  | 
|     sex = GameWorld.ToIntDef(curConditionNode.GetAttribute("sex"), 0)  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     playerSex = curPlayer.GetSex()  | 
|     if playerSex != sex:  | 
|         return False == result  | 
|       | 
|     return True == result  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐмÒ×åË;Ñé  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Send_Family_Exp />   | 
| def DoType_Send_Family_Exp(curPlayer, curMission, curActionNode):  | 
|     #²»ÊÇ×峤²»´¦Àí  | 
|     if not __IsFamilyLeader(curPlayer):  | 
|         return  | 
|       | 
|     playerFamily = []      | 
|     #±éÀú±¾µØÍ¼µÄ¼Ò×å³ÉÔ±  | 
|     playerCount = GameWorld.GetMapCopyPlayerManager().GetPlayerCount()  | 
|     for i in range(0, playerCount):  | 
|         curMapPlayer = GameWorld.GetMapCopyPlayerManager().GetPlayerByIndex(i)  | 
|         if not curMapPlayer:  | 
|             continue  | 
|         if curMapPlayer.GetFamilyID() != curPlayer.GetFamilyID():  | 
|             continue  | 
|           | 
|         playerFamily.append(curMapPlayer)  | 
|       | 
|     #×峤·¢²¼³É¹¦Ìáʾ  | 
|     PlayerControl.NotifyCode(curPlayer , "1B53C689-828E-48B9-B3E580E10FF551D2")  | 
|       | 
|     #¸øÓè±¾µØÍ¼¼Ò×åÍæ¼Ò½±Àø      | 
|     for player in playerFamily:  | 
|         familyMemberLV = player.GetFamilyMemberLV()  | 
|         familyLV = player.GetFamilyLV()  | 
|         mapFamilyCount = len(playerFamily)  | 
|         playerLV = player.GetLV()  | 
|         reExp = 0  | 
|           | 
|         resultExp = int(eval(ReadChConfig.GetChConfig('Def_Send_Family_Exp')))  | 
|           | 
|         playerControl = PlayerControl.PlayerControl(player)  | 
|         playerControl.AddExp(resultExp)  | 
|         PlayerControl.NotifyCode(player , "F3489D28-04F1-4222-99F28A7AE808AA09", [resultExp])  | 
|                                     | 
|   | 
| ##Ö´ÐмÒ×åËÍÎï×Ê  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Send_Family_Item pubID="ÈÎÎñID"/>   | 
| def DoType_Send_Family_Item(curPlayer, curMission, curActionNode):  | 
|     missionID = curMission.GetMissionID()  | 
|     pubID = GameWorld.ToIntDef(curActionNode.GetAttribute("pubID"), 0)  | 
|     #¶Á±í»ñµÃ·¢²¼ID¶ÔÓ¦µÄ¼Ò×å×ʽð  | 
|     pubDict = ReadChConfig.GetEvalChConfig('Def_Send_Family_Item')  | 
|     if not pubDict.has_key(pubID):  | 
|         GameWorld.Log("###¼Ò×åËÍÎï×ÊÒì³££¬Ã»ÓдËÈÎÎñID£º%s" % pubID)  | 
|         return  | 
|     #ÏûºÄµÄ×ʽð  | 
|     needMoney = pubDict.get(pubID)  | 
|       | 
|     #ÇëÇó·¢²¼¼Ò×åËÍÎï×ÊÈÎÎñ(ÈÎÎñID£¬ÐèÒª×ʽð)  | 
|     sendMsg = '%s,%s,%s' % (pubID, needMoney, missionID)  | 
|     curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_sqtSend_Family_Item,  | 
|                   curPlayer.GetPlayerID(), 'Send_Family_Item', sendMsg, len(sendMsg))     | 
|   | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´Ðн«Íæ¼Ò´ò»ØÖØÉúµã  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Set_Reborn_Pos />   | 
| def DoType_Set_Reborn_Pos(curPlayer, curMission, curActionNode):  | 
|     #<Set_Reborn_Pos/>  | 
|     mapID = curPlayer.GetRebornMapID()  | 
|     bornX = curPlayer.GetRebornPosX()  | 
|     bornY = curPlayer.GetRebornPosY()  | 
|       | 
|     __NPCAllowResetWorldPos(curPlayer, mapID, bornX, bornY, False)  | 
|       | 
|     return  | 
|   | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐÐÍæ¼ÒתÉú  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Player_Reincarnation />   | 
| def DoType_Player_Reincarnation(curPlayer, curMission, curActionNode):  | 
|     PlayerReincarnation.DoPlayerReincarnation(curPlayer)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÍæ¼ÒÊÇ·ñתÉú  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Player_Is_Reincarnation result="ÆÚÍûµÄ½á¹û" />   | 
| def ConditionType_Player_Is_Reincarnation(curPlayer, curMission, curConditionNode):  | 
|     #<Player_Is_Reincarnation result="">  0:ûת£¬1£ºÓÐת  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     #תÉúµÈ¼¶  | 
|     curReinLV = curPlayer.GetReincarnationLv()  | 
|     if curReinLV > 0:  | 
|         return True == result  | 
|     else:  | 
|         return False == result  | 
|       | 
|     return  | 
|   | 
| ##ÅжÏÍæ¼ÒתÉúÊý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Player_Reincarnation result="ÆÚÍûµÄ½á¹û" />   | 
| def ConditionType_Player_Reincarnation(curPlayer, curMission, curConditionNode):  | 
|     #<Player_Reincarnation result="1"> # Íæ¼ÒÊÇ·ñ1ת  | 
|     result = GameWorld.ToIntDef(curConditionNode.GetAttribute("result"), 0)  | 
|     #תÉúµÈ¼¶  | 
|     curReinLV = curPlayer.GetReincarnationLv()  | 
|     return curReinLV == result  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##¸øÓèÍæ¼Ò¼¼ÄÜ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ÎÞÒâÒå  | 
| # @remarks  <Give_Player_Skill skillid="¼¼ÄÜID"/>   | 
| def DoType_Give_Player_Skill(curPlayer, curMission, curActionNode):  | 
|     giveSkillIDStr = curActionNode.GetAttribute("skillid")  | 
|       | 
|     if giveSkillIDStr == '':  | 
|         GameWorld.ErrLog('DoType_GivePlayerSkill NoFindSkillID')  | 
|         return  | 
|       | 
|     __DogLoic_GivePlayerSkill(curPlayer, int(giveSkillIDStr))  | 
|       | 
|     return  | 
|   | 
| ##Ö´ÐÐÂß¼¸øÓèÍæ¼Ò¼¼ÄÜ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param giveSkillID ¼¼ÄÜID  | 
| # @return ÎÞÒâÒå  | 
| # @remarks Ö´ÐÐÂß¼¸øÓèÍæ¼Ò¼¼ÄÜ  | 
| def __DogLoic_GivePlayerSkill(curPlayer, giveSkillID):  | 
|     #ÈÎÎñ¸øµÄ¼¼ÄÜ  | 
|     giveSkill = GameWorld.GetGameData().GetSkillBySkillID(giveSkillID)  | 
|       | 
|     if giveSkill == None:  | 
|         GameWorld.ErrLog("DoType_GivePlayerSkillErr, Î޴˼¼ÄÜ = %s" % (giveSkillID), curPlayer.GetID())  | 
|         return  | 
|       | 
|     #ѧϰÌõ¼þ¼ì²é  | 
|     if not CheckLearnSkill(curPlayer, giveSkill):  | 
|         return  | 
|       | 
|     giveSkillTypeID = giveSkill.GetSkillTypeID()  | 
|     giveSkillLV = giveSkill.GetSkillLV()  | 
|       | 
|     skillManager = curPlayer.GetSkillManager()  | 
|       | 
|     #×ÔÉí´æÔÚ¼¼ÄÜ  | 
|     hasSkill = skillManager.FindSkillBySkillTypeID(giveSkillTypeID)  | 
|       | 
|     #---ÒÑÓм¼ÄÜ---  | 
|     if hasSkill != None:  | 
|           | 
|         hasSkillLV = hasSkill.GetSkillLV()  | 
|           | 
|         #ÑéÖ¤¼¼Äܵȼ¶  | 
|         if not(hasSkillLV < giveSkillLV <= hasSkill.GetSkillMaxLV()):  | 
|             GameWorld.ErrLog('DoType_GivePlayerSkillErr skillLV = %s, giveSkillLV = %s, skillID = %s'\  | 
|                              % (hasSkillLV, giveSkillLV, giveSkillTypeID))  | 
|             return  | 
|           | 
|         #Éý¼¶Õâ¸ö¼¼ÄÜ  | 
|         skillManager.LearnSkillByID(giveSkillID)  | 
|           | 
|         DataRecordPack.DR_LearnORUPSkill(curPlayer, giveSkillTypeID, giveSkillLV)  | 
|         PlayerControl.PlayerControl(curPlayer).RefreshSkillFightPowerEx(giveSkillID, hasSkill.GetFightPower())  | 
|         return  | 
|       | 
|     #---δÓм¼ÄÜ---  | 
|     #Ö§³ÖÌø¼¶, ÈçÖ±½Ó»ñµÃ5¼¶¼¼ÄÜ  | 
|     skillManager.LearnSkillByID(giveSkillID)  | 
|       | 
|     DataRecordPack.DR_LearnORUPSkill(curPlayer, giveSkillTypeID, giveSkillLV)  | 
|     PlayerControl.PlayerControl(curPlayer).RefreshSkillFightPowerEx(giveSkillID, 0)  | 
|     return  | 
| #---------------------------------------------------------------------  | 
| ##ѧϰ¼¼Äܼì²é  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param learnSkill Ñ§Ï°¼¼ÄÜ  | 
| # @return ²¼¶ûÖµ  | 
| # @remarks Ñ§Ï°¼¼Äܼì²é  | 
| def CheckLearnSkill(curPlayer, learnSkill):  | 
|     #Íæ¼ÒµÈ¼¶ÑéÖ¤Ö»Ñé֤δתÉúǰ  | 
|     if not curPlayer.GetReincarnationLv() and curPlayer.GetLV() < learnSkill.GetLVReq():  | 
|         #Íæ¼ÒµÈ¼¶²»¹»Éý¼¶  | 
|         PlayerControl.NotifyCode(curPlayer, "UseMagicLost12", [learnSkill.GetLVReq()])  | 
|         return False  | 
|       | 
|     #ѧϰÌõ¼þ¼ì²é  | 
|     if not SkillShell.CheckLearnSkillCondition(curPlayer, learnSkill):  | 
|         return False  | 
|       | 
|     return True  | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñÓÐÆÚÍûµÄ¼¼ÄÜ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñͨ¹ý¼ì²é  | 
| # @remarks  <Superskill_Lv type='Equal' skillid="¼¼ÄÜID"/>   | 
| def ConditionType_Superskill_Lv(curPlayer, curMission, curConditionNode):  | 
|     skillID = int(curConditionNode.GetAttribute("skillid"))  | 
|       | 
|     conditionSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)  | 
|       | 
|     if not conditionSkill:  | 
|         GameWorld.ErrLog("Êý¾Ý¿âÖÐûÓиü¼ÄÜ %s" % skillID)  | 
|         return False  | 
|       | 
|     conditionSkillTypeID = conditionSkill.GetSkillTypeID()  | 
|       | 
|     curSkill = curPlayer.GetSkillManager().FindSkillBySkillTypeID(conditionSkillTypeID)  | 
|     #¸ÃÍæ¼ÒûÓд˼¼ÄÜ  | 
|     if not curSkill:  | 
|         return False  | 
|   | 
|     conditionLV = conditionSkill.GetSkillLV()  | 
|     curSkillLV = curSkill.GetSkillLV()  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|       | 
|     return QuestRunnerValue.GetEval(conditionType, curSkillLV, conditionLV)  | 
| #---------------------------------------------------------------------  | 
| ##Ö´ÐжÁÌõʱ¼ä£¬ÉèÖÃNPCÉËѪ£¬ÓÃÓÚ¶àÈ˲ɼ¯  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <Collect_Time />   | 
| def DoType_Collect_Time(curPlayer, curMission, curConditionNode):  | 
|     #¿ªÊ¼²É¼¯  | 
|     PlayerMissionCollect.BeginMissionCollect(curPlayer, curMission, curConditionNode)  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##Ôö¼ÓÍæ¼ÒÀëÏßʱ¼ä²¢Í¨Öª¿Í»§¶Ë  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ÎÞÒâÒå  | 
| # @remarks <Add_Offline_Time time='30'> ·ÖÖÓ  | 
| def DoType_Add_Offline_Time(curPlayer, curMission, curActionNode):  | 
|     addOfflineTime = GameWorld.ToIntDef(curActionNode.GetAttribute("time"), 0)  | 
|   | 
|     allOfflineMinutes = min(curPlayer.GetOfflineMinutes() + addOfflineTime,  | 
|                             ChConfig.Def_UpperLimit_DWord)  | 
|       | 
|     curPlayer.SetOfflineMinutes(int(allOfflineMinutes))  | 
|       | 
|     #֪ͨ¿Í»§¶ËÀëÏß×Üʱ¼äˢР | 
|     curPlayer.Syn_OfflineTimeQueryResult()  | 
|       | 
|     PlayerControl.NotifyCode(curPlayer, "GeRen_hwj35_671654", [addOfflineTime])  | 
|   | 
|   | 
| ##ÈÎÎñ»ñµÃ¼Ò×å»îÔ¾¶È  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode½ÚµãÐÅÏ¢  | 
| # @return ÎÞÒâÒå  | 
| # <Add_Family_Active_Value value="">  | 
| def DoType_Add_Family_Active_Value(curPlayer, curMission, curActionNode):  | 
|     if curPlayer.GetFamilyID() == 0:  | 
|         #ÎÞ¼Ò×å²»¿¼ÂÇ  | 
|         return  | 
|       | 
|     addValue = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|       | 
|     if addValue == 0:  | 
|         GameWorld.ErrLog("ÈÎÎñ %s »ñµÃµÄ¼Ò×å½±ÀøÎª0" % curMission.GetMissionID(), curPlayer.GetID())  | 
|         return  | 
|       | 
|     PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addValue, True, ShareDefine.Def_AddFAVReason_DoFamilyMisson)  | 
|       | 
|     PlayerControl.NotifyCode(curPlayer , "GeRen_admin_425673", [addValue])  | 
|       | 
|   | 
|       | 
| ##ÅжÏÍæ¼Òµ±Ç°Ïß·  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| def ConditionType_Check_Jxd_Line(curPlayer, curMission, curConditionNode):  | 
|     lineID = GameWorld.GetGameWorld().GetLineID() + 1  | 
|     if lineID not in eval(curConditionNode.GetAttribute("linelist")):  | 
|         return False  | 
|       | 
|     return True  | 
|       | 
|   | 
| ##¼ì²éµ±Ç°GetActionObjµÄNPCÊÇ·ñÊÇÈÎÎñÖ¸¶¨×ÖµäµÄNPC  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curConditionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµ, ÊÇ·ñÅжϳɹ¦  | 
| def ConditionType_Check_Npc_By_Dict(curPlayer, curMission, curConditionNode):  | 
|     playerID = curPlayer.GetPlayerID()  | 
|     curObj = curPlayer.GetActionObj()  | 
|     if curObj == None:  | 
|         GameWorld.ErrLog("ConditionType_Check_Npc_by_Dict ÎÞ¶ÔÏó", playerID)  | 
|         return False  | 
|       | 
|     npcIndex = curObj.GetIndex()  | 
|     curNPC = GameWorld.GetNPCManager().GetNPCByIndex(npcIndex)  | 
|       | 
|     if curNPC == None:  | 
|         #ûÓÐÕâ¸öNPC  | 
|         GameWorld.ErrLog("ConditionType_Check_Npc_by_Dict index=%s, ÕÒ²»µ½NPC" % npcIndex, playerID)  | 
|         return False  | 
|       | 
|     #²»ÊǸÃÈÎÎñÖ¸¶¨NPC  | 
|     if curNPC.GetNPCID() != curMission.GetProperty(curConditionNode.GetAttribute("dict")):  | 
|         return False  | 
|       | 
|     return True  | 
|   | 
| ##Ìí¼ÓÕæÆø  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return None  | 
| def DoType_Add_Zhenqi(curPlayer, curMission, curActionNode):  | 
|     addValue = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|       | 
|     if addValue == 0:  | 
|         return  | 
|   | 
|     missionID = QuestCommon.GetMissionID(curMission)  | 
|     PlayerControl.PlayerAddZhenQi(curPlayer, addValue, True, True, "Mission", {"MissionID":missionID})  | 
|     PlayerControl.NotifyCode(curPlayer, "GetSP", [addValue])  | 
|     DataRecordPack.DR_ChangeZhenQi(curPlayer, "Event_Add", addValue, {"MissionID":missionID})  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÅжÏÕæÆøÊÇ·ñΪÂú  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return ÕæÆøÒÑÂú£º1£¬ÕæÆøÎ´Âú£º0  | 
| # @remarks None  | 
| def ConditionType_Check_Zhenqi(curPlayer, curMission, curConditionNode):  | 
|     return 0  | 
|   | 
| ## Ìض¨ÈÎÎñ¸øÓèÎïÆ·Ìáʾ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return None  | 
| # @remarks None  | 
| def DoType_Task_Give_Item(curPlayer, curMission, curActionNode):  | 
|       | 
|     itemType = GameWorld.ToIntDef(curActionNode.GetAttribute("type"), 0)        | 
|     itemID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|       | 
|     if itemID <= 0 or itemType < 0:  | 
|         return  | 
|       | 
|     # ·¢ËÍÎïÆ·ÐÅÏ¢°ü  | 
|     tagTaskGiveItem = ChPyNetSendPack.tagMCItemShowInTask()  | 
|     tagTaskGiveItem.Clear()  | 
|       | 
|     tagTaskGiveItem.Type = itemType  | 
|     tagTaskGiveItem.ID = itemID  | 
|       | 
|     NetPackCommon.SendFakePack(curPlayer, tagTaskGiveItem)  | 
|       | 
|     return  | 
|   | 
|   | 
|   | 
| ##¹¦ÄÜ¿ªÆô  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return None  | 
| # @remarks <Open_Func sign = "¹¦ÄÜÏÞÖÆÎ»Êý±êʶ"/>  | 
| def DoType_Open_Func(curPlayer, curMission, curConditionNode):  | 
|     return  | 
|   | 
|   | 
| ##¹¦ÄÜ¹Ø±Õ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode½ÚµãÐÅÏ¢  | 
| # @return None  | 
| # @remarks <Close_Func sign = "¹¦ÄÜÏÞÖÆÎ»Êý±êʶ"/>  | 
| def DoType_Close_Func(curPlayer, curMission, curConditionNode):  | 
|     return  | 
|   | 
|   | 
| ## ÅжÏÍþÍû½±ÀøÁìÈ¡Çé¿ö  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return ÊÇ·ñÒѾÁìÈ¡ÍþÍû½±ÀøÁìÈ¡Çé¿ö  | 
| #  @remarks <ConditionType_Prestige_Reward_Give_State sign="µÈ¼¶½±Àø±êʶ"/>  | 
| def ConditionType_Prestige_Reward_Give_State(curPlayer, curMission, curConditionNode):  | 
|     awardMark = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PrestigeAwardMark)  | 
|     sign = GameWorld.ToIntDef(curConditionNode.GetAttribute("sign"))  | 
|       | 
|     return awardMark & sign != 0  | 
|   | 
|   | 
| ## ÅжϻñÈ¡¼Ò×åµÈ¼¶  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return   | 
| #  @remarks <Get_Family_Lv, type="Åж¨ÀàÐÍ", familylv="¼Ò×åµÈ¼¶"/>  | 
| def ConditionType_Get_Family_Lv(curPlayer, curMission, curConditionNode):  | 
|     familyLv = GameWorld.ToIntDef(curConditionNode.GetAttribute("familylv"), 0)  | 
|       | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|       | 
|     curFamilyLV = curPlayer.GetFamilyLV()  | 
|     if curFamilyLV <= 0:  | 
|         curFamilyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyLV)  | 
|           | 
|     return  QuestRunnerValue.GetEval(conditionType, curFamilyLV, familyLv)  | 
|   | 
| ## ¸Ä±äÍæ¼Ò×ÖµäÖµ  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return None  | 
| #  @remarks <Change_Player_Dict, key="×Öµäkey", value=ÊýÖµ/>  | 
| def DoType_Change_Player_Dict(curPlayer, curMission, curConditionNode):  | 
|     value = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     key = curConditionNode.GetAttribute("key")  | 
|       | 
|     curPlayer.SetDict(key, value)  | 
|     return  | 
|   | 
|   | 
| ## Åж¨Íæ¼Ò×Öµä  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return None  | 
| def ConditionType_Player_Dict(curPlayer, curMission, curConditionNode):  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     key = curConditionNode.GetAttribute("key")  | 
|     cmpValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|       | 
|     value = curPlayer.GetDictByKey(key)  | 
|     #GameWorld.DebugAnswer(curPlayer, 'Åж¨¼Ò×åÌõ¼þ %s %s %s %s'%(conditionType, key, value, cmpValue))  | 
|     return QuestRunnerValue.GetEval(conditionType, value, cmpValue)  | 
|   | 
|   | 
| ## ÅжÏÍæ¼ÒµÇÈ뷽ʽ  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return bool  | 
| def ConditionType_Check_Login_Type(curPlayer, curMission, curConditionNode):  | 
|       | 
|     checkLoginType = GameWorld.ToIntDef(curConditionNode.GetAttribute("loginType"), -1)  | 
|     curLoginType = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_LoginType)  | 
|     return checkLoginType == curLoginType  | 
|   | 
|   | 
| ## ÉèÖùºÂòÎïÆ·ÊýÁ¿  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return None  | 
| #  @remarks <Buy_Item_Count, type="Åж¨ÀàÐÍ", key="´æ·Å¹ºÂòÊýÁ¿µÄkey", value="Åж¨Öµ"/>  | 
| def ConditionType_Buy_Item_Count(curPlayer, curMission, curConditionNode):  | 
|     conditionType = curConditionNode.GetAttribute("type")  | 
|     key = curConditionNode.GetAttribute("key")  | 
|     value = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|       | 
|     buyItemCnt = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_BuyItemCnt)  | 
|     curMission.SetProperty(key, curMission.GetProperty(key) + buyItemCnt)  | 
|       | 
|     curPlayer.SetDict(ChConfig.Def_PlayerKey_BuyItemCnt, 0)  | 
|     return QuestRunnerValue.GetEval(conditionType, curMission.GetProperty(key), value)  | 
|   | 
|   | 
| ## Ôö¼ÓÿÈÕ»îÔ¾¶È  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return None  | 
| #  @remarks <Add_Activity_Value, value="Ìí¼ÓµÄ»îÔ¾Öµ"/>  | 
| def DoType_Add_Activity_Value(curPlayer, curMission, curConditionNode):  | 
|     value = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)  | 
|     if value <= 0:  | 
|         return  | 
|       | 
|     curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ActivityValueDay)  | 
|     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ActivityValueDay, curValue + value)  | 
|     return  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ## ¸øÍæ¼Ò½±ÀøµÄ½ðÇ®(¸ù¾Ý¹«Ê½)  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return None  | 
| #  @remarks  <Add_Money_Expressions value="½ðÇ®¹«Ê½" type="»õ±ÒÀàÐÍ" />   | 
| def DoType_Add_Money_Expressions(curPlayer, curMission, curActionNode):  | 
|       | 
|     vipLV = curPlayer.GetVIPLv()  # vipµÈ¼¶  | 
|     playerLv = curPlayer.GetLV()  # Íæ¼ÒµÈ¼¶  | 
|       | 
|     moneyCount = int(eval(curActionNode.GetAttribute("value")))  | 
|     moneyType = curActionNode.GetAttribute("type")  | 
|       | 
|     moneyType = GameWorld.ToIntDef(moneyType, IPY_GameWorld.TYPE_Price_Silver_Paper)  | 
|     addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Expressions"}  | 
|     if not PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount, ChConfig.Def_GiveMoney_Mission, addDataDict):  | 
|         return  | 
|       | 
|     #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         missionID = QuestCommon.GetMissionID(curMission)  | 
|         DataRecordPack.DR_EventAddMoney(curPlayer, "Add_Money_Expressions", missionID, moneyType, moneyCount)  | 
|   | 
|       | 
| ## ¸øÍæ¼Ò¾Ñé(¸ù¾Ý¹«Ê½)  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return ·µ»ØÖµÎÞÒâÒå  | 
| #  @remarks  <Add_Exp_Expressions value="¾Ñ鹫ʽ" />   | 
| def DoType_Add_Exp_Expressions(curPlayer, curMission, curActionNode):  | 
|       | 
|     vipLV = curPlayer.GetVIPLv()  # vipµÈ¼¶  | 
|     playerLv = curPlayer.GetLV()  # Íæ¼ÒµÈ¼¶  | 
|     reExp = PlayerControl.GetPlayerReExp(curPlayer)  | 
|       | 
|     exp = int(eval(curActionNode.GetAttribute("value")))  | 
|       | 
|     playerControl = PlayerControl.PlayerControl(curPlayer)  | 
|     playerControl.AddExp(exp)  | 
|     #PlayerControl.NotifyCode(curPlayer, 'GeRen_lhs_0', [exp])  | 
|     #curPlayer.Sync_ExpGetView(exp)  | 
|       | 
|     #µÈ¼¶´¥·¢OSS¼Ç¼  | 
|     if GameWorld.IsMissonDR(curPlayer):  | 
|         missionID = QuestCommon.GetMissionID(curMission)  | 
|         DataRecordPack.DR_EventAddExp(curPlayer, missionID, exp)  | 
|   | 
|   | 
| ## ÅжÏÍæ¼ÒÊÇ·ñ¿ÉÒԲμӼÒ×å»î¶¯  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @param curMission ÈÎÎñʵÀý  | 
| #  @param curActionNode½ÚµãÐÅÏ¢  | 
| #  @return bool  | 
| def ConditionType_Check_Forbid_Family_Action(curPlayer, curMission, curConditionNode):  | 
|       | 
|     checkState = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 1)  | 
|     curState = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ForbidFamilyAction)  | 
|     return checkState == curState  | 
|   | 
|   | 
|   | 
| ##¸±±¾»î¶¯ÊÇ·ñÔÚ½øÐÐ  | 
| # @param None  | 
| # @return None  | 
| def ConditionType_Fb_Underway(curPlayer, curMission, curActionNode):  | 
|     mapID = GameWorld.ToIntDef(curActionNode.GetAttribute("mapid"), 0)  | 
|     if curPlayer.GetMapID() != mapID:  | 
|         return False  | 
|       | 
|     return FBLogic.IsFBActivityUnderway()  | 
|   | 
|   | 
| ##дÈëËæ»úÖµ  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @param curMission ÈÎÎñʵÀý  | 
| # @param curActionNode ½ÚµãÐÅÏ¢  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks  <random_mission_id list="ÈÎÎñIDÁбí" key="Ëæ»úÖµ´æ´¢key" is_id="ÊÇ·ñÈÎÎñID"/>      | 
| def DoType_Random_Value(curPlayer, curMission, curActionNode):  | 
|     #<random_mission_id list = ""/>  | 
|     if not curMission:  | 
|         return  | 
|     missionKey = curActionNode.GetAttribute("key")  | 
|     valueListStr = curActionNode.GetAttribute("list")  | 
|     if not missionKey or not valueListStr:  | 
|         return  | 
|     valueList = eval(valueListStr)  | 
|       | 
|     if GameWorld.ToIntDef(curActionNode.GetAttribute("is_id"), 0):  | 
|         for i in range(curPlayer.GetMissionCount()):  | 
|             curTagMission = curPlayer.GetMissionByIndex(i)  | 
|             if not curTagMission:  | 
|                 continue  | 
|               | 
|             curTagMissionId = curTagMission.GetMissionID()  | 
|             curTrigMission = FindQuestFunc(curTagMissionId)  | 
|             if not curTrigMission:  | 
|                 continue  | 
|               | 
|             if curTagMissionId not in valueList:  | 
|                 continue  | 
|               | 
|             valueList.remove(curTagMissionId)  | 
|           | 
|     if not valueList:  | 
|         return  | 
|       | 
|     index = random.randint(0, len(valueList) - 1)  | 
|     newMissionId = valueList[index]  | 
|     curMission.SetProperty(missionKey, newMissionId)  | 
|     return  | 
|   | 
|   | 
|   | 
| ##ÈÎÒâ×øÆïÊÇ·ñÓÐX¼¶  | 
| # @param None  | 
| # @return None <Horselv value="×øÆïµÈ¼¶"/>  | 
| def ConditionType_Horselv(curPlayer, curMission, curActionNode):  | 
|     horseLV = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     return PlayerHorse.GetHorseCurMaxLV(curPlayer) >= horseLV  | 
|   | 
| ##ÊÇ·ñÒѹºÂòVIPÀñ°ü  | 
| # @param None  | 
| # @return None <Buyvipitem value="viplv"/>  | 
| def ConditionType_Buyvipitem(curPlayer, curMission, curActionNode):  | 
|     vipLV = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     record = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_VipAwardRecord)  | 
|     hasBuy = record & pow(2, vipLV)  | 
|     return bool(hasBuy)  | 
|   | 
| ##°ËØÔ¯ÊÇ·ñ´ïµ½X¼¶  | 
| # @param None  | 
| # @return None <Refinestovelv value="stoveLV"/>  | 
| def ConditionType_Refinestovelv(curPlayer, curMission, curActionNode):  | 
|     stoveLV = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     alchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)  | 
|     return alchemyLV >= stoveLV  | 
|   | 
| ##¾³½çÊÇ·ñ´ïµ½X¼¶  | 
| # @param None  | 
| # @return None <Realmlv value="Realmlv"/>  | 
| def ConditionType_Realmlv(curPlayer, curMission, curActionNode):  | 
|     realmlv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     return curPlayer.GetOfficialRank() >= realmlv  | 
|   | 
| ##·¨±¦Ö®»êÊÇ·ñ¼¤»î  | 
| # @param None  | 
| # @return None <Mwsoul value="id"/>  | 
| def ConditionType_Mwsoul(curPlayer, curMission, curActionNode):  | 
|     soulID = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     return bool(PlayerMagicWeapon.GetIsActiveMWSoul(curPlayer, soulID))  | 
|   | 
| ##X¼¶Í¨¹ØX²ãæ´»ÊÒż£  | 
| # @param None  | 
| # @return None <Passqueenrelecs value="lineID" grade="grade"/>  | 
| def ConditionType_Passqueenrelecs(curPlayer, curMission, curActionNode):  | 
|     lineID = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [ChConfig.Def_FBMapID_QueenRelics])  | 
|     needGrade = GameWorld.ToIntDef(curActionNode.GetAttribute("grade"), 0)  | 
|     return grade >=needGrade  | 
|   | 
| ##×øÆï×ܵȼ¶  | 
| # @param None  | 
| # @return None <Horsetotallv value="lv"/>  | 
| def ConditionType_Horsetotallv(curPlayer, curMission, curActionNode):  | 
|     totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv  | 
|   | 
| ##2½×Ç¿»¯·À¾ßÌ××°¼þÊý  | 
| # @param None  | 
| # @return None <Suitplus value="cnt"/>  | 
| def ConditionType_Suitplus(curPlayer, curMission, curActionNode):  | 
|     needCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|       | 
|     equipSuitTypeDict = IpyGameDataPY.GetFuncEvalCfg('EquipSuitType')  | 
|     groupCnt = 0 #2½×Ç¿»¯·À¾ßÌ××°¼þÊý  | 
|     for groupType, equipIndexList in equipSuitTypeDict.items():  | 
|         for i in equipIndexList:  | 
|             suiteInfo = ChEquip.GetSuiteInfoByPlace(curPlayer, i)  | 
|             for suiteType, lv in suiteInfo.items():  | 
|                 if lv >= 2 and int(groupType) == 1 and suiteType == 2:  | 
|                     groupCnt +=1  | 
|     return groupCnt >= needCnt  | 
|   | 
| ##·¨±¦¼¤»î¸öÊý  | 
| # @param None  | 
| # @return None <Mwcnt value="cnt"/>  | 
| def ConditionType_Mwcnt(curPlayer, curMission, curActionNode):  | 
|     totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     return PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer) >= totalcnt  | 
|   | 
| ##×ÜÇ¿»¯µÈ¼¶  | 
| # @param None  | 
| # @return None <Totalpluslv value="cnt"/>  | 
| def ConditionType_Totalpluslv(curPlayer, curMission, curActionNode):  | 
|     totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     return ChEquip.GetTotalPlusLV(curPlayer, False) >= totalcnt  | 
|   | 
| ##×°±¸×ÜÐǼ¶  | 
| # @param None  | 
| # @return None <Equiptotalstar value="cnt"/>  | 
| def ConditionType_Equiptotalstar(curPlayer, curMission, curActionNode):  | 
|     totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     return ChEquip.GetTotalEquipStars(curPlayer) >= totalcnt  | 
|   | 
| ##¼¤»î·¨±¦,È·ÈÏÓë³É¾ÍÂß¼ºóʹÓà  | 
| # @param None  | 
| # @return None <Active_Magicweapon id="·¨±¦ID"/>  | 
| def DoType_Active_Magicweapon(curPlayer, curMission, curActionNode):  | 
|     mwID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|     PlayerMagicWeapon.DoActiveMW(curPlayer, mwID)  | 
|     PlayerMagicWeapon.NotifyMagicWeapon(curPlayer)  | 
|       | 
|     return  | 
|   | 
| ## ÈËÎïÒþÉí <Visible id="0ÒþÉí1ÏÖÉí"/>  | 
| def DoType_Visible(curPlayer, curMission, curActionNode):  | 
|     visible = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)  | 
|     if visible:  | 
|         curPlayer.SetVisible(True)  | 
|         curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)  | 
|     else:  | 
|         curPlayer.SetVisible(False)  | 
|         curPlayer.SetSight(0)  | 
|     return  | 
|   | 
|   | 
| # ±»¶¯¼¼ÄÜ¿×  | 
| def DoType_Open_Skill_Slots(curPlayer, curMission, curActionNode):  | 
|     # ¿ª¿×  | 
|     slotIndex = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)  | 
|     mission_1 = QuestCommon.GetCommonMission(curPlayer)  | 
|     if not mission_1:  | 
|         return  | 
|   | 
|     mission_1.SetProperty("OpenSkillSlots", pow(2, slotIndex)|mission_1.GetProperty("OpenSkillSlots"))  | 
|       | 
|     return  | 
|   | 
|   |