|  |  | 
 |  |  | import PlayerGeTui
 | 
 |  |  | import ChEquip
 | 
 |  |  | import QuestCommon
 | 
 |  |  | 
 | 
 |  |  | import random
 | 
 |  |  | 
 | 
 |  |  | # 可吞噬的装备位
 | 
 |  |  | Def_EatItem_EquipPlace = [
 | 
 |  |  | 
 |  |  |         return
 | 
 |  |  |     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, clientData.NPCID)
 | 
 |  |  |     
 | 
 |  |  |     # 先弥补错失的时间
 | 
 |  |  |     LoginFixTJG(curPlayer, True)
 | 
 |  |  |     GameWorld.DebugLog("%s---OnTJGNPC:%s"%(curPlayer.GetName(),clientData.NPCID))
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |     
 | 
 |  |  |     # 2.物品
 | 
 |  |  |     OnTJGDropItems(curPlayer, npcID, killCnt)
 | 
 |  |  |      | 
 |  |  |     #任务道具
 | 
 |  |  |     OnTJGDropTaskItems(curPlayer, npcData.GetLV(), killCnt)
 | 
 |  |  |     # VIP杀怪加攻
 | 
 |  |  |     PlayerVip.DoAddVIPKillLVExp(curPlayer, npcData, killCnt)
 | 
 |  |  |     
 | 
 |  |  | 
 |  |  |     NoteEatEquip(curPlayer, eatCount, giveCnt)
 | 
 |  |  |     CheckPackFull(curPlayer)
 | 
 |  |  |     
 | 
 |  |  | def OnTJGDropTaskItems(curPlayer, npclv, killCnt):
 | 
 |  |  |     #掉落任务道具
 | 
 |  |  |     if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TJGPackFullAfterEat):
 | 
 |  |  |         # 满了不再给物品
 | 
 |  |  |         return
 | 
 |  |  |     dropTaskItemDict = IpyGameDataPY.GetFuncEvalCfg('TJDropTaskItem', 1, {})
 | 
 |  |  |     for missionID, dropInfo in dropTaskItemDict.items():
 | 
 |  |  |         if not curPlayer.FindMission(missionID):
 | 
 |  |  |             continue
 | 
 |  |  |         npclvLimit, itemID, needItemCnt, itemCntFormula = dropInfo
 | 
 |  |  |         if npclv < npclvLimit:
 | 
 |  |  |             continue
 | 
 |  |  |         haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)
 | 
 |  |  |         giveItemCnt = min(needItemCnt-haveCnt, eval(itemCntFormula))
 | 
 |  |  |         if giveItemCnt <= 0:
 | 
 |  |  |             continue
 | 
 |  |  |         packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1)
 | 
 |  |  |         if packSpace < 1:
 | 
 |  |  |             #GameWorld.Log('脱机挂掉落任务道具背包不足! missionID=%s,itemID=%s,giveItemCnt=%s'%(missionID, itemID, giveItemCnt))
 | 
 |  |  |             continue
 | 
 |  |  |         ItemControler.GivePlayerItem(curPlayer, itemID, giveItemCnt, 0, [IPY_GameWorld.rptItem])
 | 
 |  |  |     return
 | 
 |  |  |     
 | 
 |  |  | def CheckPackFull(curPlayer):
 | 
 |  |  |     if not ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem):
 | 
 |  |  | 
 |  |  | def NotifyTJGInfo(curPlayer):
 | 
 |  |  |     
 | 
 |  |  |     if curPlayer.GetIP() == "127.0.0.1":
 | 
 |  |  |         LoginFixTJG(curPlayer, True)
 | 
 |  |  |         return
 | 
 |  |  |     
 | 
 |  |  |     # 脱机挂没有运作情况下 弥补收益
 | 
 |  |  | 
 |  |  | 
 | 
 |  |  |     
 | 
 |  |  |     # 超过5分钟部分补偿
 | 
 |  |  |     seconds = PlayerControl.GetPlayerLeaveServerSecond(curPlayer) - 300
 | 
 |  |  |     seconds = PlayerControl.GetPlayerLeaveServerSecond(curPlayer) - IpyGameDataPY.GetFuncCfg('AutoUseGuardian', 2)
 | 
 |  |  |     if seconds <= 0:
 | 
 |  |  |         return
 | 
 |  |  |     times = min(seconds, tjgTime)
 | 
 |  |  | 
 |  |  |         # 此时由服务端重新找一次挂机NPC
 | 
 |  |  |         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, npcID)
 | 
 |  |  |     
 | 
 |  |  |     GameWorld.DebugLog("弥补脱机----npcid  %s-%s"%(curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC), times))
 | 
 |  |  |     GameWorld.DebugLog("弥补脱机----npcid  %s-%s-%s"%(
 | 
 |  |  |                     curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC), times,
 | 
 |  |  |                     curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)))
 | 
 |  |  |     
 | 
 |  |  |     
 | 
 |  |  |     # 设置脱机登录时的等级, 上线通知清空, 没清空说明多次脱机挂登录 使用旧等级
 |