TPlayObject
TPlayObject 属性名称 只读 功能 属性 property HomeMapName: String Y 回城地图 property HomeX: Integer Y 回城地图X坐标 property HomeY: Integer Y 回城地图Y坐标 property Account: String Y 账号 property NewHuman: Boolean Y 是否属于新建角色 property LoginTime: TDateTime Y 登陆时间 property SessionID: Integer Y 会话ID号 property CreditPoint: Integer 声望点 property DearName: String 配偶名 property Married: Boolean Y 是否已婚 property MasterName: String 师傅名字 property ISMaster: Boolean Y 是否是师傅 property MarryCount: Byte Y 结婚次数 property ReNewLevel: Byte 转生等级 property BonusPoint: Integer 未使用属性点 property MemberType: Integer 会员类型 property MemberLevel: Integer 会员等级 property GameGold: Integer 元宝 property GamePoint: Integer 礼券 property GameGlory: Byte 荣誉点 property HGameDiaMond: Integer 金刚石 property GameGird: Integer 灵符 property PaoDianPoint: Integer 泡点值 property Exp: Int64 Y 当前经验 property MaxExp: Int64 最大经验(可读写) property CustomItemCount: Integer Y 在自定义的UI中,如果该UI可以控制物品,则CustomItemCount表示UI上可放入的道具总数,CustomItem[Index: Integer]表示其中的一个道具。假设UI上一共可放入5个道具,而实际只在第1个位置上放入了道具,其他均没放入,则 CustomItemCount=5,CustomItem[0]为第一个位置上的道具,CustomItem[1]-CustomItem[4]均为nil property CustomItem[Index: Integer ]: TUserItem property LogonTick: LongWord Y 在线时长 property IP: String Y IP地址 property PayMent: Integer Y 消费点 property GroupOwner: TPlayObject Y 组队队长 property GroupCount: Integer Y 组队总人数 property Group[Index: Integer ]: TPlayObject Y 取组队当中指定队员 property ISGroupMaster: Boolean Y 是否为队长 property RankLevelName: String 称号 property ShowRankLevelName: Boolean 是否显示称号 property TitleName: String 头顶图片头顶花翎,增加xy 偏移调整Player.TitleName = {I=1;X=5;Y=10} property TitleEffect: Integer 头顶特效(版本管理器->UI设计->自定义特效->ID标识) property Contribution: Word 贡献度 property HNotOnlineAddExp: Boolean Y 是否离线挂机状态 property StationTime: Longword Y 原地站立不动时间 property Feature: Integer Y 角色外观(示例版本中在天下第一用到) property FeatureEx: Integer Y 角色效果 property StoragePwd: String 仓库密码 property AllowDeal: Boolean 是否允许交易 property AllowGuild: Boolean 是否允许加入行会 property AllowGroup: Boolean 是否允许加入组队 property AllowGroupReCall: Boolean 是否允许组队传送 property HAllowGuildReCall: Boolean 是否允许行会传送 property AllowReAlive: Boolean 是否允许复活 property AllowSendMessage: Boolean 是否允许聊天 property AddedAbility: TAddedAbility Y 额外增加的角色属性 property MailCount: Integer Y 邮件总数 property MailUnreadCount: Integer Y 未读邮件总数 property Locked: Boolean 锁定标记,无特殊意义,在脚本中用来做某个操作的锁定标记 property S[index: Integer ]: String 角色的临时字符串变量(index为1-300) property N[index: Integer ]: Integer 角色的整形变量,该变量会保存到数据库(index为1-300) property P[index: Integer ]: Integer 角色的临时整型变量,不存入数据库,下线消失(index为1-300) property StorageItemsCount: Integer Y 仓库存放物品数量 property StorageItem[index: Integer ]: TUserItem Y 仓库存放的第index个物品,如果不存在返回为nil property BigStorageItemsCount: Integer Y 无限仓库物品数量 property BigStorageItem[index: Integer ]: TUserItem Y 无限仓库存放的第index个物品,如果不存在返回为nil property Missions: Missions 玩家的任务信息
函数名称 功能 函数 FunctionState[f:TFunctionFlag]:Boolean 设置TFunctionFlag值状态 property TotalExpRate:Integer 获取人物当前的经验加成 function TPlayObject.GetGameMoney(Type:Byte):Cardinal; 获取对应货币的数量 function TPlayObject.CanAddGameMoney(Type:Byte;Value:Cardinal):Boolean; 是否可以给玩家增加货币 Value 为需要增加的货币数量 function TPlayObject.AddGameMoney(Type:Byte;Value:Cardinal; const Log:String):Boolean; 给玩家增加 对应数量的货币 Log 为日志描述 成功则为返回True 失败返回False; function TPlayObject.TakeGameMoney(Type:Byte;Value:Cardinal;const Log:String):Boolean; 扣除玩家对应数量的货币 成功返回True 失败返回False; procedure TPlayObject.SetGameMoney(Type:Byte;Value:Cardinal;const Log:String); 设置货币的数量,Log 为日志描述 function TPlayObject.CanTakeGameMoney(Type:Byte;Value:Cardinal):Boolean; 是否可以扣减玩家对应数量的货币 Value 为需要增加货币的数量 function VarString (const AVarName: String ): TVarValue; 定义或读取一个字符串变量 function VarInteger (const AVarName: String ): TVarValue; 定义或读取一个整型变量 function VarDateTime(const AVarName: String ): TVarValue; 定义或读取一个日期变量 function VarFloat(const AVarName: String ): TVarValue; 定义或读取一个浮点数变量 function VarBoolean (const AVarName: String ): TVarValue; 定义或读取一个布尔变量 procedure SendMessage(const Msg: String ; const Kind: Integer =0); 发送一个聊天框消息(Kind:0-红 1-绿 2-蓝 3-普通说话) procedure SendGuildMessage(const Msg: String ); 发送行会消息 procedure SendTopMessage(const Message: String ; Mode: Byte ); 发送顶部移动消息(Mode:0-自己 1-所有人 2-行会 3-当前地图) procedure SendCenterMessage(const Message: String ; Mode: Byte; DuraTick:Integer = 2000); 发送屏幕中央消息(Mode:0-自己 1-所有人 2-行会 3-当前地图,DuraTick:时长毫秒) procedure DeleteCountDownMessage(Falg: Integer ); 删除一个底部消息 procedure Say(const Msg: String ); 弹出一个NPC对话框 procedure SayEx(const UIName, Msg: String ); 弹出一个自定义NPC对话框(版本管理器->UI设计->自定义窗口->窗口名称) procedure Messagebox(const Msg: String ); 弹出对话框 procedure GoHome; 回城 procedure CallMethod(Npc: TNormNpc; const Method: String ); 函数调用(Method:单元名.函数名(参数)) procedure ChangeReNewLevel(const Value: Byte ; const NewLevel: Integer =0; const BounsuPoint: Integer =0); 修改转生等级,Value为新的转生等级,NewLevel为转生后的人物等级,BounsuPoint为属性点 procedure ShowEffect(EffectID: Integer ); 客户端显示特效(7-14为烟花效果,其他的值将调用版本管理器->UI设计->自定义特效->特效ID) procedure OpenMarket; 打开市场 procedure OpenBag; 打开背包 procedure OpenShop; 打开商城 procedure OpenMailbox; 打开邮箱 procedure ShowSighIcon(MethodID: Integer ; const Hint: String = ''); 显示一个感叹号,玩家点击感叹号后触发QFunctionNpc的ClickSighIcon函数 procedure ShowSighIcon(const Method: String ; const Hint: String = ''); 显示一个感叹号,玩家点击感叹号后执行Method,Hint:提示信息 procedure Give(const ItemName: String ; const Count: Integer =1; const Upgrade: Boolean =False); 给予物品(ItemName: 物品名,Count为数量,Upgrade指定是否刷新极品属性) function GiveItem(const ItemName: String ; const Upgrade: Boolean =False): TUserItem; 发放物品,并且返回该物品对象,如果刷新失败返回为nil(ItemName: 物品名,Upgrade指定是否刷新极品属性) function GiveItemByIndex(const ItemIndex: Integer ; const Upgrade: Boolean =False): TUserItem; 根据物品数据库ID给予物品并返回该物品对象,如果刷新失败返回为nil procedure OpenBox(BoxID: Integer ); 打开一个指定的宝箱(BoxID: 数据库AniCount编号 ) procedure OpenShuffle(BoxID: Integer ); 翻牌。BoxId为一个宝箱的ID procedure UpdateName; 向客户端发送显示名称更新信息(改名后要更新) procedure OpenURL(const AUrl: String ; Width, Height: Integer ); 打开一个指定的URL网址(AUrl:网址,Width:宽度, Height:高度) procedure RequestURL(const AUrl: String ); 客户端请求URL(不弹出窗口) procedure StartAutoAddGameGold(const APoint, AInterval: Integer ); 开始自动增加元宝,Apoint:增加数量,Ainterval:间隔时间(秒) procedure StopAutoAddGameGold; 停止增加元宝 procedure StartAutoSubGameGold(const APoint, AInterval: Integer ); 开始自动减少元宝,Apoint:增加数量,Ainterval:间隔时间(秒) procedure StopAutoSubGameGold; 停止减少元宝 procedure Kick; 踢出人物 procedure ReAlive; 人物复活 procedure UpdateItem(Item: TUserItem); 向客户端发送物品更新消息(装备属性修改要更新) procedure reloadbag; 从新加载脚本刷新玩家背包 procedure DeleteItem(Item: TUserItem; Count: Integer =0); 删除指定的物品(可叠加物品直接删除指定的数量,数量为0则删除物品本身) procedure UpdateMagic(Item: TUserMagic); 向客户端发送魔法更新消息 procedure GetMonDropItems(const MonName: String ); 将指定名称的爆率直接爆出给到玩家背包 procedure AddExtendButton(const Name, Hint, Command: String; ImageIndex: Integer ; X:Integer = 0 ; Y : Integer = 0); 客户端增加1个扩展按钮,AddExtendButton:位于药品栏下方,AddTopExtendButton:位于小地图左侧(Name为按钮名称 不可重复;Hint:提示信息;Command:点击按钮后要执行的函数;ImageIndex:按钮图片,按钮按下时图片为ImageIndex+1,鼠标经过的 图片为ImageIndex+2,图片从Icons.data中加载)。Command:指向的函数位于ManagerNpc单元中,声明格式为(同常见的入口函数): procedure FuncName(Npc: TNormNpc; Player: TPlayObject; Args: TArgs);查看示例 procedure AddTopExtendButton(const Name, Hint, Command: String; ImageIndex: Integer ; X:Integer = 0 ; Y : Integer = 0); procedure RemoveExtendButton(const Name: String ); 在客户端中移除通过AddExtendButton增加的按钮 function CheckNameList(const ATextFile: String ): Boolean ; 查看角色名字是否包含在指定的文件中(有返回True,无返回False) function CheckTextList(const ATextFile, AText: String ): Boolean ; 查看文本是否包含在指定的文件中(有返回True,无返回False) function CheckAccountList(const ATextFile: String ): Boolean ; 查看账号是否包含在指定的文件中(有返回True,无返回False) procedure ClearList(const ATextFile: String ); 清除指定的文件内容 procedure AddTextList(const ATextFile, AText: String ); 将文本增加到指定的文本中(ATextFile:文件名, AText:内容) procedure AddNameList(const ATextFile: String ); 将角色名增加到指定的文本文件中 procedure AddAccountList(const ATextFile: String ); 将账号增加到指定的文本文件中 procedure AddGuildList(const ATextFile: String ); 将行会增加到指定的文本文件中 procedure AddIPList(const ATextFile: String ); 将IP增加到指定的文本文件中 procedure DelTextList(const ATextFile, AText: String ); 将文本从指定的文件中删除(ATextFile:文件名, AText:内容;只删除最先匹配到的一条记录) procedure DelNameList(const ATextFile: String ); 将角色名从指定的文本文件中删除 procedure DelAccountList(const ATextFile: String ); 将账号从指定的文本文件中删除 procedure DelGuildList(const ATextFile: String ); 将行会从指定的文本文件中删除 procedure DelIPList(const ATextFile: String ); 将IP从指定的文本文件中删除 procedure RestBonusPoint; 重置角色属性点 procedure TakeCastGold(const AGold: Integer ); 从角色所在的城堡拿走指定数量的金币(建议直接通过城堡对象操作) procedure AutoGetExp(const AMap: String ; const ATime, APoint: Integer ; IsSafeZone: Boolean =True); 设置角色在指定的地图增加经验值(Amap:地图ID Atime:间隔时间,单位秒 Apoint:每次增加经验值 IsSafeZone:是否只在安全 区有效) procedure OffLinePlay(const AIntervalTime, AExpPoint: Integer ); 设置离线挂机( AIntervalTime:时间 AExpPoint:经验值; 间隔时间以分钟为单位) procedure KickOffLine; 开始离线挂机,人物离线 function DelayGoto(ID, AIntervalTime: Integer ; AChangeMapDelete: Boolean =True; Once: Boolean =False): Boolean ; 设置个人时钟。ID:时钟标志 AIntervalTime:间隔时间(秒) ChangeMapDelete:离开地图删是否除本时钟 Once:是否指执行 一次。个人时钟执行时候调用TimeManageNpc单元的PrivyEventExecute函数,个人时钟移除时调用TimeManageNpc的PrivyEventRemove 函数 procedure ClearDelayGoto(ID: Integer ); 移除一个个人时钟,通过此函数移除的时钟不触发PrivyEventRemove函数 procedure PlaySound(const ASoundFile: String ); 客户端播放声音文件(ASoundFile:文件名) procedure RecallHuman(const AumName: String ); 将指定角色传送到自己身边(AumName:角色名) procedure Recallmob(const AMonName: String ; MonLvl: Integer =3; const RoyaltySec: Integer =86400; X: Integer =0; Y:Integer =0); 召唤一个怪物作为宝宝(AMonName: 怪物名 ; MonLvl: 等级; RoyaltySec: 叛变时间(秒); X: 坐标X; Y:坐标Y) procedure SetTimeRecall(const Value: Boolean ; const ATick: Integer ); 指定的时间之后回到当前所在的位置(Value为False则取消此功能) procedure MapMove(const MapName: String ; const MapX, MapY: Integer ); 传送(MapName:地图名; MapX:地图X坐标 MapY:地图Y坐标) procedure MapMoveEx(Envir: TEnvirnoment; const MapX, MapY: Integer ); 传送(MapName:地图对象; MapX:地图X坐标 MapY:地图Y坐标) procedure GroupMapMove(const MapName: String ; const MapX: Integer =0; const MapY: Integer =0); 组队传送(MapName:地图名; MapX:地图X坐标 MapY:地图Y坐标) procedure GroupMapMoveEx(Envir: TEnvirnoment; const MapX: Integer = 0; const MapY: Integer = 0 ;ForceMove:Boolean = false); 是否强制组队传送(MapName:地图对象;MapX:地图X坐标, MapY:地图Y坐标,ForceMove:False(否)或者True(是)) procedure GuildMapMove(const MapName: String ; const MapX: Integer =0; const MapY: Integer =0); 行会传送(MapName:地图名; MapX:地图X坐标 MapY:地图Y坐标) procedure GuildMapMoveEx(Envir: TEnvirnoment; const MapX: Integer =0; const MapY: Integer =0); 行会传送(MapName:地图对象; MapX:地图X坐标 MapY:地图Y坐标) procedure RandomMove(const MapName=' ' ); 在指定的地图上随机传送,当MapName为空时则在当前地图上随机传送 procedure RandomMoveEx(AEnvir: TEnvirnoment=nil); 在指定的地图对象上随机传送,当AEnvir为nil时则在当前地图上随机传送 procedure MoveTo(const DestX, DestY: Integer ); 角色从当前位置自动移动到指定的位置 function ShowProgress(const Caption: String ; ATime, EventID: Integer ; ActCancel: Boolean = True): Boolean ; 显示一个进度条(Caption:进度条显示信息;Atime:进度条显示的时间,单位秒;EventID:进度条标记;ActCancel:是否在角色 移动、攻击或被被攻击的时候取消进度条事件。进度条计时结束后调用QFunctionNpc单元中的ProgressEvent函数,其中可根据EventID 进行事件处理) function ShowProgressEx(const Caption: String ; ATime: Integer ; NPC: TNormNpc;const SucessFunction,FailFunction:String ; ActCancel: Boolean = True): Boolean ; 显示一个进度条(Caption:进度条显示信息;Atime:进度条显示的时间,单位秒;Npc:Npc对象;SucessFunction:成功后执行函 数名(可调用任意单元);FailFunction:失败后执行函数名(可调用任意单元);ActCancel:是否在角色移动、攻击或被被攻击的 时候取消进度条事件)如果当前存在进度条则返回True,不存在返回False procedure CloseProgress; 关闭当前的进度条 procedure CheckItemSoulLevelUp(Item: TUserItem); 给物品升级魂炼(如果魂炼经验足够则升级,反之则不做任何处理) function AddItemToStorage(AItem: TUserItem): Boolean ; 将一个指定的物品存到仓库。成功返回True,失败返回False function DeleteStorageItem(Index: Integer ): Boolean ; 删除仓库指定位置的物品(Index: 编号)成功返回True,失败返回False function DeleteStorageItemEx(AItem: TUserItem): Boolean ; 删除仓库指定位置的物品(AItem: 物品名称)成功返回True,失败返回False function TakebackStorageItem(Index: Integer ): Boolean ; 取出仓库指定位置的物品(Index: 编号)成功返回True,失败返回False function AddItemToBigStorage(AItem: TUserItem): Boolean ; 将一个指定的物品存到无限仓库(AItem: 物品名称)成功返回True,失败返回False function DeleteBigStorageItem(Index: Integer ): Boolean ; 删除无限仓库指定位置的物品(Index: 编号)成功返回True,失败返回False function DeleteBigStorageItemEx(AItem: TUserItem): Boolean ; 删除无限仓库指定位置的物品(AItem: 物品名称)成功返回True,失败返回False function TakebackBigStorageItem(Index: Integer ): Boolean ; 取出无限仓库指定位置的物品(Index: 编号)成功返回True,失败返回False procedure SetState(const Value: Integer ); 例:Target.SetState(0,5,10);中绿毒5秒,数值10 设置人物状态如下:0: 中绿毒;1: 中红毒;2: 禁止释放魔法;3: 不能移动(蛛网);4: 不能移动;5: 麻痹;6: 陷阱(不能移 动);7: 护体神盾;8: 隐身;9: 神圣战甲术;10: 幽灵盾;11: 魔法盾 function GetFunctionState(f:TFunctionFlag):Boolean ; 取出TFunctionFlag值状态 procedure SetFunctionState(f:TFunctionFlag;boState:Boolean ); 设置TFunctionFlag值状态 procedure AddSidebarButton(const ACaption, AName: String ); 在客户端左侧增加一个按钮(ACaption:按钮显示文字, AName: 名称 ) 例:Player.AddSidebarButton(' 实验按钮', 'AAA');在QFunctionNpc文件OnSideBarButtonClick里的 'AAA': Q1.Main (Npc,Player,Args); procedure SendClientUIVisible(const UIName: String ; Visible : Boolean ; Auto : Boolean = false); 设置客户端UI是否可视(UIName:UI名称,Visible:True显示,False不显示) procedure LockClient(const Caption,CallBackProc: String); 锁定客户端 procedure UnLockClient(); 解锁客户端 procedure SetClientUIProperty(Const UIName,UIProperty:String); 可以一次性修改多个UI的多个属性。分隔符为@。 例子 :PLAYER.SetClientUIProperty('UINAME1@UINAME2@UINAME3','UIProperty1@UIProperty2@UIProperty3'); 注意:每个UIProperty都可以设置多个属性,每个属性设置用分号;分开,属性值用=赋值。 具体例子:
Player.SetClientUIProperty('活动提示框@NPC大对话框','Visible=True;Caption.text=BOSS来袭@visible=False'); 客户端将会为相应的UI控件赋值。 procedure MoveItemToUIContainer(UniTag:Integer;Item: TUserItem;Count:Integer =1) ; 用于脚本内放置物品到自定义物品框中(UniTag:自定义UI可控道具唯一值不可冲突,Item:物品对象,Count:数量)