hxp
2024-10-18 33d7639758f71890d81d37cc17a787c0214a98ed
10287 【英文】1折活动
7个文件已修改
1个文件已添加
261 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuperDiscount.py 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -17364,6 +17364,66 @@
#------------------------------------------------------
# AA 02 推金币 #tagCMTuijinbi
class  tagCMTuijinbi(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("OpType", c_ubyte),    # 操作类型: 0-抽奖;1-获得金币;2-激活至尊卡
                  ("Value1", c_int),    # 类型1时为货币类型
                  ("Value2", c_int),    # 类型1时为货币数值
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xAA
        self.SubCmd = 0x02
        return
    def ReadData(self, stringData, _pos=0, _len=0):
        self.Clear()
        memmove(addressof(self), stringData[_pos:], self.GetLength())
        return _pos + self.GetLength()
    def Clear(self):
        self.Cmd = 0xAA
        self.SubCmd = 0x02
        self.OpType = 0
        self.Value1 = 0
        self.Value2 = 0
        return
    def GetLength(self):
        return sizeof(tagCMTuijinbi)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// AA 02 推金币 //tagCMTuijinbi:
                                Cmd:%s,
                                SubCmd:%s,
                                OpType:%d,
                                Value1:%d,
                                Value2:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.OpType,
                                self.Value1,
                                self.Value2
                                )
        return DumpString
m_NAtagCMTuijinbi=tagCMTuijinbi()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTuijinbi.Cmd,m_NAtagCMTuijinbi.SubCmd))] = m_NAtagCMTuijinbi
#------------------------------------------------------
# AB 0B 购买天神经验 #tagCMBuySkyGodExp
class  tagCMBuySkyGodExp(Structure):
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1150,7 +1150,8 @@
CDBPlayerRefresh_HorsePetTrainScore, # 骑宠养成积分 265
CDBPlayerRefresh_GubaoTrainScore, # 古宝养成积分 266
CDBPlayerRefresh_TiandaoFruit, # 天道果 267
) = range(146, 268)
CDBPlayerRefresh_Tuijinbi, # 推金币次数 268
) = range(146, 269)
TYPE_Price_Gold_Paper_Money = 5    # 金钱类型,(先用礼券,再用金子)
TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
@@ -1186,6 +1187,7 @@
TYPE_Price_HorsePetTrainScore = 45    # 骑宠养成积分
TYPE_Price_GubaoTrainScore = 46    # 古宝养成积分
TYPE_Price_TiandaoFruit = 47    # 天道果
TYPE_Price_Tuijinbi = 48    # 推金币次数
TYPE_Price_PayCoin = 99    # 代币
#key可用于遍历所有货币,value仅GM相关会用到
@@ -1193,7 +1195,8 @@
                 1:"仙玉", 2:"绑玉", 3:"铜钱", 6:"战盟贡献度", 10:"战盟仓库积分", 13:"境界修行点", 14:"符印融合石", 15:"仙盟活跃令", 
                 16:"助战积分", 18:"荣誉", 19:"Boss积分", 23:"符印精华", 24:"符印碎片", 25:"寻宝积分", 26:"集市额度", 27:"丹精", 28:"魂尘", 
                 29:"聚魂碎片", 30:"核心环", 31:"功能特权令", 32:"环保值", 33:"GM令", 34:"古神币", 35:"功德点", 
                 39:"成就积分", 40:"万界积分", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 99:"代币"
                 39:"成就积分", 40:"万界积分", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 48:"推金币次数",
                 99:"代币"
                 }
#需要记录累计消耗的货币类型
@@ -1233,6 +1236,7 @@
                           TYPE_Price_HorsePetTrainScore:CDBPlayerRefresh_HorsePetTrainScore,
                           TYPE_Price_GubaoTrainScore:CDBPlayerRefresh_GubaoTrainScore,
                           TYPE_Price_TiandaoFruit:CDBPlayerRefresh_TiandaoFruit,
                           TYPE_Price_Tuijinbi:CDBPlayerRefresh_Tuijinbi,
                           }
# 支持负值的货币及对应0418刷新类型
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -46,6 +46,18 @@
PacketSubCMD_1=0x32
PacketCallFunc_1=OnFaQiLVUp
;推金币
[PlayerSuperDiscount]
ScriptName = Player\PlayerSuperDiscount.py
Writer = hxp
Releaser = hxp
RegType = 0
RegisterPackCount = 1
PacketCMD_1=0xAA
PacketSubCMD_1=0x02
PacketCallFunc_1=OnTuijinbi
;坐骑培养
[PlayerHorse]
ScriptName = Player\PlayerHorse.py
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4296,6 +4296,9 @@
Def_PDict_InvestRewardTime = "InvestRewardTime_%s"  # 投资最后一次领奖时间,参数为(投资类型)
Def_PDict_InvestKeyCount = 3 # key编号数
# 至尊卡1折折扣,英文版专用
Def_PDict_TuiJinbiMoney = "TuiJinbiMoney_%s"  # 推金币累计获得货币数,参数(货币类型)
# 成就 Def_PDictType_Success
Def_PDict_Success_AwardRecord = "Succ_AwardRecord_%s" # 成就领奖记录,参数(key编号),按索引位存储0-未领,1-已领
Def_PDict_Success_LastDay = "Succ_LastDay_%s" # 连续类型上一次更新进度时的开服天数,参数(成就编号)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -17364,6 +17364,66 @@
#------------------------------------------------------
# AA 02 推金币 #tagCMTuijinbi
class  tagCMTuijinbi(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("OpType", c_ubyte),    # 操作类型: 0-抽奖;1-获得金币;2-激活至尊卡
                  ("Value1", c_int),    # 类型1时为货币类型
                  ("Value2", c_int),    # 类型1时为货币数值
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xAA
        self.SubCmd = 0x02
        return
    def ReadData(self, stringData, _pos=0, _len=0):
        self.Clear()
        memmove(addressof(self), stringData[_pos:], self.GetLength())
        return _pos + self.GetLength()
    def Clear(self):
        self.Cmd = 0xAA
        self.SubCmd = 0x02
        self.OpType = 0
        self.Value1 = 0
        self.Value2 = 0
        return
    def GetLength(self):
        return sizeof(tagCMTuijinbi)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// AA 02 推金币 //tagCMTuijinbi:
                                Cmd:%s,
                                SubCmd:%s,
                                OpType:%d,
                                Value1:%d,
                                Value2:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.OpType,
                                self.Value1,
                                self.Value2
                                )
        return DumpString
m_NAtagCMTuijinbi=tagCMTuijinbi()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTuijinbi.Cmd,m_NAtagCMTuijinbi.SubCmd))] = m_NAtagCMTuijinbi
#------------------------------------------------------
# AB 0B 购买天神经验 #tagCMBuySkyGodExp
class  tagCMBuySkyGodExp(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -62,6 +62,7 @@
import PlayerFeastTravel
import PlayerWeekParty
import PlayerGoldInvest
import PlayerSuperDiscount
import PlayerActTurntable
import PlayerTongTianLing
import PlayerZhanling
@@ -83,7 +84,7 @@
PayOrderType_PayCoin, # 代币 6
) = range(1, 1 + 6)
PayOrderType_Default = PayOrderType_VND
PayOrderType_Default = PayOrderType_USD
# 充值类型定义
PayType_Gold = 2  # 常规仙玉充值
@@ -440,16 +441,18 @@
        DataRecordPack.DR_CTGError(curPlayer, "Can not found the orderInfo.", addDRDict)
        return
    
    # 越南版本配表及coin均使用越南盾原值,但是验证用美元验证
    GameWorld.Log("越南充值验证美元: orderInfo=%s,orderCoin=%s,orderID=%s" % (orderInfo, orderCoin, orderID), curPlayer.GetPlayerID())
    # 英文1折版两种奖励,根据至尊卡判断, GetPayRMBNum-原价;GetUsdMoney-1折价格
    discountState = PlayerSuperDiscount.GetSuperDiscountState(curPlayer)
    GameWorld.Log("英文1折充值验证至尊卡: orderInfo=%s,orderCoin=%s,orderID=%s" % (orderInfo, orderCoin, orderID), curPlayer.GetPlayerID())
    orderCoinUsd = orderCoin # 入库的是美元分
    orderCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum()) # 游戏内orderCoin转化为越南盾
    usdMoney = ipyData.GetUsdMoney()
    orderCoin = CommFunc.RMBToCoin(ipyData.GetPayRMBNum()) # 游戏内orderCoin为原价
    usdMoney = ipyData.GetUsdMoney() if discountState else ipyData.GetPayRMBNum()
    GameWorld.Log("    转化后: orderInfo=%s,orderCoin=%s,orderCoinUsd=%s" % (orderInfo, orderCoin, orderCoinUsd), curPlayer.GetPlayerID())
    addDRDict["orderCoin"] = orderCoin
    addDRDict["orderCoinUsd"] = orderCoinUsd
    GameWorld.Log("    充值验证: orderCoinUsd=%s,usdMoney=%s,discountState=%s" % (orderCoinUsd, usdMoney, discountState), curPlayer.GetPlayerID())
    if orderCoinUsd != CommFunc.RMBToCoin(usdMoney, 100):
        DataRecordPack.DR_CTGError(curPlayer, "The orderCoinUsd is not equal to the ipyData's UsdMoney(%s)!" % usdMoney, addDRDict)
        DataRecordPack.DR_CTGError(curPlayer, "The orderCoinUsd is not equal to the ipyData's UsdMoney(%s)! discountState=%s" % (usdMoney, discountState), addDRDict)
        return
    
    if payOrderType == PayOrderType_PayCoin:
@@ -763,6 +766,7 @@
    #投资
    if ctgIpyData:
        ctgID = ctgIpyData.GetRecordID()
        PlayerSuperDiscount.ActSuperDiscountByCTG(curPlayer, ctgID)
        PlayerGoldInvest.InvestByCTG(curPlayer, ctgID)
        PlayerGoldGift.OnGiftByCTGID(curPlayer, ctgID)
        PlayerZhanling.OnActiviteByCTGID(curPlayer, ctgID)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuperDiscount.py
New file
@@ -0,0 +1,94 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Player.PlayerSuperDiscount
#
# @todo:至尊卡折扣
# @author hxp
# @date 2024-10-18
# @version 1.0
#
# 详细描述: 至尊卡折扣,将充值原价购买变成1折,英文版专用
#
#-------------------------------------------------------------------------------
#"""Version = 2024-10-18 15:00"""
#-------------------------------------------------------------------------------
import GameWorld
import IpyGameDataPY
import PlayerControl
import ShareDefine
import ChConfig
def GetSuperDiscountState(curPlayer):
    ## 至尊折扣卡激活状态
    return curPlayer.GetLV2() == 1
def ActSuperDiscountByCTG(curPlayer, ctgID):
    ## 充值激活
    ctgList = IpyGameDataPY.GetFuncEvalCfg("EnSuperDiscount", 1)
    if ctgID in ctgList:
        __DoActiveSuperDiscount(curPlayer, ctgID)
    return
def __DoActiveSuperDiscount(curPlayer, ctgID=0):
    ## 激活至尊卡
    if GetSuperDiscountState(curPlayer):
        GameWorld.DebugLog("至尊卡已激活!")
        return
    if not ctgID:
        needCreateRoleDays = IpyGameDataPY.GetFuncCfg("EnSuperDiscount", 2)
        createRoleDays = GameWorld.GetCreateRoleDays(curPlayer)
        if createRoleDays < needCreateRoleDays:
            GameWorld.ErrLog("创角天数不足,无法免费激活至尊卡! createRoleDays=%s < %s" % (createRoleDays, needCreateRoleDays), curPlayer.GetPlayerID())
            return
    GameWorld.DebugLog("激活至尊卡: ctgID=%s" % (ctgID), curPlayer.GetPlayerID())
    curPlayer.SetLV2(1)
    return
#// AA 02 推金币 #tagCMTuijinbi
#
#struct     tagCMTuijinbi
#{
#    tagHead        Head;
#    BYTE        OpType;    // 操作类型: 0-抽奖;1-获得金币;2-激活至尊卡
#    DWORD        Value1;    // 类型1时为货币类型
#    DWORD        Value2;    // 类型1时为货币数值
#};
def OnTuijinbi(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    playerID = curPlayer.GetPlayerID()
    opType = clientData.OpType
    value1 = clientData.Value1
    value2 = clientData.Value2
    if opType == 0:
        # 直接扣除次数,仅作为记录用,抽奖逻辑前端自己控制
        PlayerControl.PayMoney(curPlayer, ShareDefine.TYPE_Price_Tuijinbi, 1, isNotify=False)
    elif opType == 1:
        moneyType = value1
        moneyValue = value2
        moneyUpperLimitDict = IpyGameDataPY.GetFuncEvalCfg("EnSuperDiscount", 3, {})
        if moneyType not in moneyUpperLimitDict:
            GameWorld.DebugLog("推金币没有配置获得该货币奖励上限! moneyType=%s" % moneyType, playerID)
            return
        moneyUpperLimit = moneyUpperLimitDict[moneyType]
        moneyTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TuiJinbiMoney % moneyType)
        updMoneyTotal = min(moneyTotal + moneyValue, moneyUpperLimit, ChConfig.Def_UpperLimit_DWord)
        giveMoney = updMoneyTotal - moneyTotal
        if giveMoney <= 0:
            GameWorld.ErrLog("推金币已达奖励上限! moneyType=%s,moneyTotal=%s" % (moneyType, moneyTotal), playerID)
            return
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TuiJinbiMoney % moneyType, updMoneyTotal)
        GameWorld.DebugLog("更新推金币奖励: moneyType=%s,moneyValue=%s,giveMoney=%s,updMoneyTotal=%s"
                           % (moneyType, moneyValue, giveMoney, updMoneyTotal), playerID)
        PlayerControl.GiveMoney(curPlayer, moneyType, giveMoney, "Tuijinbi")
    elif opType == 2:
        __DoActiveSuperDiscount(curPlayer)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1150,7 +1150,8 @@
CDBPlayerRefresh_HorsePetTrainScore, # 骑宠养成积分 265
CDBPlayerRefresh_GubaoTrainScore, # 古宝养成积分 266
CDBPlayerRefresh_TiandaoFruit, # 天道果 267
) = range(146, 268)
CDBPlayerRefresh_Tuijinbi, # 推金币次数 268
) = range(146, 269)
TYPE_Price_Gold_Paper_Money = 5    # 金钱类型,(先用礼券,再用金子)
TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
@@ -1186,6 +1187,7 @@
TYPE_Price_HorsePetTrainScore = 45    # 骑宠养成积分
TYPE_Price_GubaoTrainScore = 46    # 古宝养成积分
TYPE_Price_TiandaoFruit = 47    # 天道果
TYPE_Price_Tuijinbi = 48    # 推金币次数
TYPE_Price_PayCoin = 99    # 代币
#key可用于遍历所有货币,value仅GM相关会用到
@@ -1193,7 +1195,8 @@
                 1:"仙玉", 2:"绑玉", 3:"铜钱", 6:"战盟贡献度", 10:"战盟仓库积分", 13:"境界修行点", 14:"符印融合石", 15:"仙盟活跃令", 
                 16:"助战积分", 18:"荣誉", 19:"Boss积分", 23:"符印精华", 24:"符印碎片", 25:"寻宝积分", 26:"集市额度", 27:"丹精", 28:"魂尘", 
                 29:"聚魂碎片", 30:"核心环", 31:"功能特权令", 32:"环保值", 33:"GM令", 34:"古神币", 35:"功德点", 
                 39:"成就积分", 40:"万界积分", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 99:"代币"
                 39:"成就积分", 40:"万界积分", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 48:"推金币次数",
                 99:"代币"
                 }
#需要记录累计消耗的货币类型
@@ -1233,6 +1236,7 @@
                           TYPE_Price_HorsePetTrainScore:CDBPlayerRefresh_HorsePetTrainScore,
                           TYPE_Price_GubaoTrainScore:CDBPlayerRefresh_GubaoTrainScore,
                           TYPE_Price_TiandaoFruit:CDBPlayerRefresh_TiandaoFruit,
                           TYPE_Price_Tuijinbi:CDBPlayerRefresh_Tuijinbi,
                           }
# 支持负值的货币及对应0418刷新类型