1分钟部署网站📞AI智能客服,大模型训练自有数据,简单好用,有效降低客服成本 广告
首先角色升级触发的是函数是QFunctionNPC中的函数PlayerLevelUp,定义如下: ``` procedure PlayerLevelUp(Npc: TNormNpc; Player: TPlayObject; const Level: Integer); ``` 示例: ``` procedure PlayerLevelUp(Npc: TNormNpc; Player: TPlayObject; const Level: Integer); begin case Level of 0..10: Player.BonusPoint := Player.BonusPoint + 5; //10级前每升1级+5点 11..20: Player.BonusPoint := Player.BonusPoint + 7; //11-20级级前每升1级+7点 21..40: Player.BonusPoint := Player.BonusPoint + 10; //21-40级前每升1级+10点 else Player.BonusPoint := Player.BonusPoint + 12; //高于40级每升一级+12点 end; //注意: 当角色升级1级1级递增的时候,上面的处理是正确的;实际上可能还存在代码调整等级 //的情况,这个时候则需要在代码调整等级的地方计算 end; ```