From 68e048256ca3e40cbc6e73cfd0937663cd41d63c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 27 十二月 2019 20:50:44 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.173on.com:10010/r/SnxxServerCode

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py
index 169a3ae..e0d7c0b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerAssist.py
@@ -19,6 +19,8 @@
 import IpyGameDataPY
 import PlayerControl
 import NPCHurtManager
+import ChPyNetSendPack
+import NetPackCommon
 import IPY_GameWorld
 import ItemControler
 import ItemCommon
@@ -32,6 +34,9 @@
         ipyData = ipyDataMgr.GetAssistThanksGiftByIndex(index)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GetThanksGiftCount % ipyData.GetGiftID(), 0)
         
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoney, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoneySocial, 0)
+    Sync_TodayAssistMoneyInfo(curPlayer)
     return
 
 #// B0 10 请求协助Boss #tagCMRequestAssistBoss
@@ -185,4 +190,39 @@
         
     return
 
+def AddTodayAssistMoney(curPlayer, moneyType, addMoney, isSocialEx):
+    ''' 增加今日协助货币奖励    
+    @param moneyType: 货币类型
+    @param addMoney: 常规增加,有每日上限
+    @param isSocialEx: 是否社交加成,不计入常规上限
+    '''
+    
+    todayAssistMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoney)
+    socialMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoneySocial)
+    todayAssistMoneyMax = IpyGameDataPY.GetFuncCfg("AssistAward", 4)
+    if todayAssistMoney >= todayAssistMoneyMax:
+        return 0
+    
+    addValue = min(addMoney, todayAssistMoneyMax - todayAssistMoney)
+    socialEx = 0
+    if isSocialEx:
+        friendAddAssistMoneyPer = IpyGameDataPY.GetFuncCfg("AssistAward", 3)
+        socialEx = int(addValue * friendAddAssistMoneyPer / 100.0)
+        
+    realAdd = addValue + socialEx
+    PlayerControl.GiveMoney(curPlayer, moneyType, realAdd)
+    
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoney, todayAssistMoney + addValue)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayAssistMoneySocial, socialMoney + socialEx)
+    
+    Sync_TodayAssistMoneyInfo(curPlayer)
+    return realAdd
+
+def Sync_TodayAssistMoneyInfo(curPlayer):
+    ## 通知今日已获得协助货币信息
+    infoPack = ChPyNetSendPack.tagMCTodayAssistMoneyInfo()
+    infoPack.TodayAssistMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoney)
+    infoPack.SocialMoney = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayAssistMoneySocial)
+    NetPackCommon.SendFakePack(curPlayer, infoPack)
+    return
 

--
Gitblit v1.8.0