``` procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); begin if Player.Wepon <> nil then //如果玩家穿戴了武器 begin Gamelib.RandomUpgrade(Player.Wepon); //随机刷新武器属性 Gamelib.RandomUpgradePoint(Player.Wepon); //随机刷新武器极品属性 Gamelib.RandomUpgradeLevel(Player.Wepon); //随机刷新武器强化属性 Player.UpdateItem(Player.Wepon); //发送到客户端 end; end; ```