hxp
2019-05-10 6018c2872ce2e6d7a22fcc09d39ff4267a42c746
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipStone.py
@@ -30,14 +30,15 @@
import PlayerSuccess
import PlayerWeekParty
import ShareDefine
import EventShell
#import EquipZhuXian
g_stoneCanPlaceList = [] #可镶嵌的位置
def OnLogin(curPlayer):
    ###登录发包同步客户端宝石信息
    Sycn_StoneHoleInfo(curPlayer)
    return
#def OnLogin(curPlayer):
#    ###登录发包同步客户端宝石信息
#    Sycn_StoneHoleInfo(curPlayer)
#    return
def GetAllStoneEquipIndexList():
    ###得到所有可镶嵌宝石装备位列表
@@ -95,9 +96,31 @@
def SetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex, changeStoneID, isBind):
    ### 保存装备位孔位宝石ID和绑定信息
    befStoneID, befIsBind = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)
    if befStoneID == changeStoneID and befIsBind == isBind:
        return
    isBind = 0 #现绑定无用,默认存0
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartStoneID % (equipIndex, holeIndex),
                                       changeStoneID * ChConfig.Def_Stone_SaveStoneInfoXNumber + isBind)
                                       changeStoneID * ChConfig.Def_Stone_SaveStoneInfoXNumber + isBind)
    # 同步更新宝石总等级
    gameData = GameWorld.GetGameData()
    befStoneLV = 0
    if befStoneID:
        befGem = gameData.GetItemByTypeID(befStoneID)
        befStoneLV = 0 if not befGem else befGem.GetEffectByIndex(0).GetEffectValue(1)
    aftStoneLV = 0
    if changeStoneID:
        aftGem = gameData.GetItemByTypeID(changeStoneID)
        aftStoneLV = 0 if not aftGem else aftGem.GetEffectByIndex(0).GetEffectValue(1)
    befTotalStoneLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalStoneLV)
    updTotalStoneLV = max(0, befTotalStoneLV + aftStoneLV - befStoneLV)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalStoneLV, updTotalStoneLV)
    GameWorld.DebugLog("设置宝石等级: equipIndex=%s,holeIndex=%s,befStoneLV=%s,aftStoneLV=%s,befTotalStoneLV=%s,updTotalStoneLV=%s"
                       % (equipIndex, holeIndex, befStoneLV, aftStoneLV, befTotalStoneLV, updTotalStoneLV))
    return
def GetPackTypeByEquipPlace(equipPlace):
@@ -191,6 +214,8 @@
    Sycn_StoneHoleInfo(curPlayer, [equipPackIndex])
    #成就
    DoStoneSuccess(curPlayer)
    EventShell.EventRespons_InlayStone(curPlayer)
    return
def DoStoneSuccess(curPlayer):
@@ -284,23 +309,7 @@
def GetTotalStoneLV(curPlayer):
    ##宝石总等级
    totalStoneLV = 0
    holeIndexList = GetAllEquipPlaceHoleIndex()
    gameData = GameWorld.GetGameData()
    playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
    for equipIndex in xrange(playerEquip.GetCount()):
        if equipIndex not in ShareDefine.RoleEquipType :
            continue
        for holeIndex in holeIndexList:
            curGemID = GetEquipIndexStoneIDAndIsBand(curPlayer, equipIndex, holeIndex)[0]
            if curGemID == 0:
                continue
            curGem = gameData.GetItemByTypeID(curGemID)
            if not curGem:
                continue
            gemLV = curGem.GetEffectByIndex(0).GetEffectValue(1)
            totalStoneLV += gemLV
    return totalStoneLV
    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalStoneLV)
#// A3 06 宝石升级 #tagCMEquipStoneUpgrade
#struct    tagCMEquipStoneUpgrade