From 24e0c6911a3aaeb033e7b704910311bc422d472a Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 10 十月 2018 21:04:03 +0800
Subject: [PATCH] 1 清开服天命令增加通知开服星期
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
index 03abf41..c13c132 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
@@ -25,11 +25,14 @@
import IpyGameDataPY
import ChConfig
import PlayerSuccess
+import DataRecordPack
import PlayerWing
import PlayerDogz
+import EventShell
import random
import math
+
#//A3 03 物品合成 #tagCMItemCompound
@@ -125,11 +128,12 @@
fixedItemIndexDict, fixedItemNeedCntDict, compoundBindCnt = fixedItemInfo
# 检查附加道具增加成功率消耗
- addSuccRate = 0
+ addSuccRate, addSuccRateItemInfo = 0, []
if addonsCountMax > 0:
- addSuccRate = __CheckAddonsItem(playerID, compoundID, itemPack, addonsItemIndexList, addonsItemCountList, addonsCountMax)
- if addSuccRate == None:
+ addSuccRateInfo = __CheckAddonsItem(playerID, compoundID, itemPack, addonsItemIndexList, addonsItemCountList, addonsCountMax)
+ if addSuccRateInfo == None:
return
+ addSuccRate, addSuccRateItemInfo = addSuccRateInfo
# 扣铜钱
PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, totalNeedMoney, ChConfig.Def_Cost_ItemProduce,
@@ -180,7 +184,20 @@
GameWorld.DebugLog("首次合成一代翅膀,必定成功!totalSuccRate=%s" % totalSuccRate, playerID)
# 合成成功
- if GameWorld.CanHappen(totalSuccRate, ShareDefine.Def_MaxRateValue):
+ maxRateValue = ShareDefine.Def_MaxRateValue
+ randValue = random.randint(1, maxRateValue)
+ canHappen = randValue <= totalSuccRate
+ GameWorld.DebugLog("canHappen=%s,randValue=%s,totalSuccRate=%s,maxRateValue=%s"
+ % (canHappen, randValue, totalSuccRate, maxRateValue), playerID)
+ # 不是百分百成功的记录合成流向
+ if successRate != maxRateValue:
+ drDict = {"PlayerID":curPlayer.GetPlayerID(), "AccID":curPlayer.GetAccID(), "ID":compoundID, "MakeItemID":makeItemID, "IsSuccess":canHappen,
+ "RateInfo":{"totalSuccRate":"%s(%s+%s)" % (totalSuccRate, successRate, addSuccRate), "randValue":randValue, "maxRateValue":maxRateValue},
+ "AddSuccRateItemInfo":addSuccRateItemInfo
+ }
+ DataRecordPack.SendEventPack("ItemCompound", drDict, curPlayer)
+
+ if canHappen:
GameWorld.DebugLog("合成成功: makeItemID=%s,compoundCnt=%s,compoundBindCnt=%s" % (makeItemID, compoundCnt, compoundBindCnt), playerID)
userData = GiveNewCompoundItem(curPlayer, makeItemID, compoundCnt, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp)
@@ -201,7 +218,7 @@
itemColor = makeItemData.GetItemColor()
itemQuality = makeItemData.GetItemQuality()
PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CompoundEquip, compoundCnt, [classLV, itemColor, itemQuality])
-
+ EventShell.EventRespons_CompoundEquip(curPlayer, itemColor, itemQuality)
# 合成失败
else:
GameWorld.DebugLog("合成失败!")
@@ -377,6 +394,7 @@
# ComposeAddonsQuality 4|2 0 0 0 0 阶数和颜色
# ComposeAddonsFormula level*10 0 0 0 0 计算合成时附加材料增加的几率公式
+ addSuccRateItemInfo = []
composeAddonsTypeList = IpyGameDataPY.GetFuncEvalCfg("ComposeAddonsType")
classLV, color = IpyGameDataPY.GetFuncEvalCfg("ComposeAddonsQuality", 1)
ComposeAddonsFormula = IpyGameDataPY.GetFuncCfg("ComposeAddonsFormula")
@@ -428,8 +446,9 @@
addSuccRate = eval(FormulaControl.GetCompileFormula("ComposeAddonsFormula", ComposeAddonsFormula))
addTotalSuccRate += (addSuccRate*costCount)
+ addSuccRateItemInfo.append({"ItemID":itemID, "ItemColor":itemColor, "ItemClassLV":itemClassLV, "addSuccRate":addSuccRate, "costCount":costCount})
- return int(addTotalSuccRate)
+ return int(addTotalSuccRate), addSuccRateItemInfo
def __CheckItemCanUseCompound(playerID, index, curItem):
--
Gitblit v1.8.0