仙魔无双SDK
面向策划逻辑制作的游戏开发包

威胁值(仇恨)相关的各种操作 更多...

函数

int ModifyThreatToActor (FxCreature *pTargetActor, unsigned long nCasterID, int nValue)
 在pTargetActor身上增加ID为nCasterID的对象的nValue点威胁值 更多...
 
int ModifyThreatToTarget (FxCreature *pActor, int nValue)
 在pActor的目标身上增加pActor的nValue点威胁值 更多...
 
int RemoveThreatFromActor (FxCreature *pActor, unsigned long nTargetID, bool bBoth=true)
 在pActor的目标身上清除nTargetID的威胁值。 更多...
 
int ClearThreatFromActor (FxCreature *pActor)
 清空pActor身上所有的威胁值。这会导致pActor脱离战斗。这一定是双向清除。 更多...
 
int GetThreatValueFromActor (FxCreature *pActor, unsigned long nActorID)
 获取pActor身上nActorID的威胁值。 更多...
 
int DuplicateThreat (FxCreature *pSrcActor, FxCreature *pDstActor, int nValue=-1)
 把pSrcActor身上的仇恨复制到pDstActor身上。 更多...
 
int GetThreatIndexOnActor (FxCreature *pActor, unsigned long nTargetID)
 查询nTargetID在pActor的身上的仇恨排名 更多...
 
int DuplicateThreatByRange (FxCreature *pActor, unsigned long nRadius)
 角色pActor把自己的仇恨表复制给nRadius半径范围内的其他角色。 更多...
 
int SetThreatDelayTime (FxCreature *pActor, unsigned long nDelayTime)
 设置角色pActor在脱战的时候延迟多久清仇恨。 更多...
 
unsigned long GetActorByThreat (FxCreature *pSrcActor, int nIndex, int nDescend=0)
 获取角色pSrcActor仇恨表中的第nIndex个对象。 更多...
 

详细描述

威胁值(仇恨)相关的各种操作

函数说明

◆ ClearThreatFromActor()

int ClearThreatFromActor ( FxCreature *  pActor)

清空pActor身上所有的威胁值。这会导致pActor脱离战斗。这一定是双向清除。

参数
pActor[角色] 角色对象。
返回
[整数] 忽略

◆ DuplicateThreat()

int DuplicateThreat ( FxCreature *  pSrcActor,
FxCreature *  pDstActor,
int  nValue = -1 
)

把pSrcActor身上的仇恨复制到pDstActor身上。

参数
pSrcActor[角色] 仇恨表来源的角色对象。
pDstActor[角色] 仇恨表目标的角色对象。
nValue[整数] 复制之后的仇恨值。默认-1,使用pSrcActor已有的数值,这样能确保在pDstActor身上仇恨表的顺序。如果是其他,则是输入的数值。
返回
[整数] 忽略

◆ DuplicateThreatByRange()

int DuplicateThreatByRange ( FxCreature *  pActor,
unsigned long  nRadius 
)

角色pActor把自己的仇恨表复制给nRadius半径范围内的其他角色。

参数
pActor[角色] 角色对象。
nRadius[整数] 复制的半径。
返回
[整数] 成功
注解

◆ GetActorByThreat()

unsigned long GetActorByThreat ( FxCreature *  pSrcActor,
int  nIndex,
int  nDescend = 0 
)

获取角色pSrcActor仇恨表中的第nIndex个对象。

参数
pSrcActor[角色] 角色对象
nIndex[整数] 将要选取的仇恨表的索引,0开始
nDescend[整数] 是否反向排序。1: 反向排序(从小到大)0: 正向排序(从大到小)。默认0。
返回
[整数] 对象ID,0标识没有此对象。例如索引越界。
注解
考虑修正返回值的定义,即数组越界的情况下,返回该排序的最后一个节点。

◆ GetThreatIndexOnActor()

int GetThreatIndexOnActor ( FxCreature *  pActor,
unsigned long  nTargetID 
)

查询nTargetID在pActor的身上的仇恨排名

参数
pActor[角色] 角色对象。
nTargetID[整数] 查询的目标ID。
返回
[整数] -1 无记录; 0及以上: 排名
注解
一定要记住,是返回nTargetID在pActor身上仇恨表的排名

◆ GetThreatValueFromActor()

int GetThreatValueFromActor ( FxCreature *  pActor,
unsigned long  nActorID 
)

获取pActor身上nActorID的威胁值。

参数
pActor[角色] 角色对象。
nActorID[整数] 要查看威胁值的对象ID
返回
[整数] pActor身上nActorID的威胁值。0表示没有nActorID的威胁值

◆ ModifyThreatToActor()

int ModifyThreatToActor ( FxCreature *  pTargetActor,
unsigned long  nCasterID,
int  nValue 
)

在pTargetActor身上增加ID为nCasterID的对象的nValue点威胁值

参数
pTargetActor[角色] 角色对象。
nCasterID[整数] 威胁值来源的对象ID。
nValue[整数] 威胁值的数值。
返回
[整数] 忽略

◆ ModifyThreatToTarget()

int ModifyThreatToTarget ( FxCreature *  pActor,
int  nValue 
)

在pActor的目标身上增加pActor的nValue点威胁值

参数
pActor[角色] 角色对象。
nValue[整数] 威胁值的数值。
返回
[整数] 忽略

◆ RemoveThreatFromActor()

int RemoveThreatFromActor ( FxCreature *  pActor,
unsigned long  nTargetID,
bool  bBoth = true 
)

在pActor的目标身上清除nTargetID的威胁值。

参数
pActor[角色] 角色对象。
nTargetID[整数] 要清除威胁值的对象。
bBoth[布尔] 是否双向清除。 true: 双向清除,即在pActor身上清除nTargetID的威胁值的同时,也清除了nTargetID身上pActor的威胁值; false: 仅清除pActor身上nTargetID的威胁值 默认true。
返回
[整数] 忽略
注解
双向逻辑一定要搞清楚

◆ SetThreatDelayTime()

int SetThreatDelayTime ( FxCreature *  pActor,
unsigned long  nDelayTime 
)

设置角色pActor在脱战的时候延迟多久清仇恨。

参数
pActor[角色] 角色对象。
nDelayTime[整数] 延迟的时间。
返回
[整数] 忽略
注解
实际应用于木桩之类的。一般都是脱战立即清楚仇恨,只有木桩需要。