ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameObj.py
@@ -17,47 +17,50 @@
import IPY_GameWorld
import IpyGameDataPY
import SkillCommon
import PlayerControl
# 关于血量的函数这里只包装最简单的超DWORD处理
def GetMaxHP(gameObj):
    if not hasattr(gameObj, "GetMaxHPEx"):
        return gameObj.GetMaxHP()
    else:
        return gameObj.GetMaxHPEx()*ShareDefine.Def_PerPointValue + gameObj.GetMaxHP()
    return gameObj.GetMaxHPEx() * ShareDefine.Def_PerPointValue + gameObj.GetMaxHP()
def SetMaxHP(gameObj, value):
    if not hasattr(gameObj, "SetMaxHPEx"):
        gameObj.SetMaxHP(value)
    else:
        gameObj.SetMaxHPEx(value/ShareDefine.Def_PerPointValue)
        gameObj.SetMaxHP(value%ShareDefine.Def_PerPointValue)
    gameObj.SetMaxHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
    return
def GetHP(gameObj):
    if not hasattr(gameObj, "GetHPEx"):
        return gameObj.GetHP()
    else:
        return gameObj.GetHPEx()*ShareDefine.Def_PerPointValue + gameObj.GetHP()
    return gameObj.GetHPEx() * ShareDefine.Def_PerPointValue + gameObj.GetHP()
def SetHP(gameObj, value, isNotify=True, isByTime=False):
def SetHP(gameObj, value, isNotify=None, isByTime=False):
    if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
        gameObj.SetHP(value, isNotify)
        if isNotify == None:
            isNotify = True
        gameObj.SetHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue, isNotify)
    else:
        if isNotify == None:
            isNotify = False
        if gameObj.GetGameObjType() == IPY_GameWorld.gotNPC:
            npcID = gameObj.GetNPCID()
            if IpyGameDataPY.GetIpyGameDataNotLog("NPCTimeLostHP", npcID) and not isByTime and value not in [GetMaxHP(gameObj), 0]:
                #GameWorld.DebugLog("不能设置按时间掉血的怪物血量! id=%s,npciD=%s,value=%s,isByTime=%s" % (gameObj.GetID(), gameObj.GetNPCID(), value, isByTime))
                return
        gameObj.SetHPEx(value/ShareDefine.Def_PerPointValue)
        gameObj.SetHP(value%ShareDefine.Def_PerPointValue)
        gameObj.SetHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue, isNotify)
    return
def SetHPFull(gameObj):
    SetHP(gameObj, GetMaxHP(gameObj))
    return
def SetBaseMaxHP(gameObj, value):
    gameObj.SetBaseMaxHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
    return
def GetAngryValue(curAngry):
    return curAngry.GetAngryValue() + curAngry.GetAngryValueEx() * ShareDefine.Def_PerPointValue
def SetAngryValue(curAngry, value):
    curAngry.SetAngryValue(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
    return
## 设置buff状态(脚本自定义枚举)
#  @param pyState ״̬
#  @param isTrue 是否设置该状态
@@ -95,7 +98,7 @@
# #  目前当目标身上多个buff都有同一效果时(如定身),在一个buff消失时会解除该状态
# #  故该状态标记仅为一个非精确的标记,应用中请注意!!!(当且仅当多个buff有同一个效果时会提前结束该状态)
#===============================================================================
def GetPyPlayerState(gameObj, pyState, ownerID = 0, ownerType = 0):
def GetPyPlayerState(gameObj, pyState, ownerID=0, ownerType=0):
    if not gameObj:
        return False
    if pyState == 0:
@@ -153,4 +156,25 @@
def SetPetDamPer(gameObj, value): 
    gameObj.SetDict(ChConfig.Def_PlayerKey_AttrPetDamPer, value)
    if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
        gameObj.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_PetDamPer, value, False)
        PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_PetDamPer, value)
    return
def GetLastHurtValue(gameObj):
    ## 最后一击伤害值
    hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValue)
    hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValueEx)
    return hurtEx * ShareDefine.Def_PerPointValue + hurt
def SetLastHurtValue(gameObj, value):
    gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValue, value % ShareDefine.Def_PerPointValue)
    gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValueEx, value / ShareDefine.Def_PerPointValue)
    return
def GetBloodShiledHurt(gameObj):
    ## 伤害值用于血盾抵消
    hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
    hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurtEx)
    return hurtEx * ShareDefine.Def_PerPointValue + hurt
def SetBloodShiledHurt(gameObj, value):
    gameObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, value % ShareDefine.Def_PerPointValue)
    gameObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurtEx, value / ShareDefine.Def_PerPointValue)
    return