gmsv石器单机研究论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
楼主: genggen885

一转140级宠物LUA

[复制链接]

1

主题

33

帖子

60

积分

注册会员

Rank: 2

积分
60
发表于 2021-10-23 00:01:37 | 显示全部楼层
看看,支持楼主

134

主题

338

帖子

986

积分

中级会员

Rank: 3Rank: 3

积分
986
发表于 2021-10-29 19:52:05 | 显示全部楼层
function ITEM_ItemCard(charaindex,toindex,haveitemindex)  --可以开始物品的来吉卡
--来吉卡的物品抽中率   
   rand = math.floor(math.random(1, 100));
--60%的几率抽中此处的物品,之后在随机这5个物品中随机一件
    if rand > 40 then
    num1 = math.floor(math.random(1, 5));
    local item_list = {30000,30001,30002,30003,30004}
    itemid1 = item_list[num1]

    NLG.GiveItem( charaindex,itemid1);
    NLG.DelItemByIndex(charaindex,haveitemindex);

--40%的几率抽中此处的物品,之后在随机这5个物品中随机一件
    else if rand <= 40 then

    num2 = math.floor(math.random(1, 5));
    local item_list = {30005,30006,30007,30008,30009}
    itemid2 = item_list[num2]

    NLG.GiveItem( charaindex,itemid2);
    NLG.DelItemByIndex(charaindex,haveitemindex);
    end
  end
end

function ITEM_PetCard(charaindex,toindex,haveitemindex)   --可以开始宠物的来吉卡
--来吉卡的宠物抽中率   
   rand = math.floor(math.random(1, 100));
--60%的几率抽中此处的宠物,之后在随机这5个宠物中随机一件
    if rand > 40 then
    num1 = math.floor(math.random(1, 5));
    local pet_list = {2500,2501,2502,2503,2504} --宠物ID为enemy1.txt里的ID

    petid1 = pet_list[num1]
    NLG.GivePet( charaindex,petid1);
    NLG.DelItemByIndex(charaindex,haveitemindex);

--40%的几率抽中此处的宠物,之后在随机这5个宠物中随机一件
    else if rand <= 40 then

    num2 = math.floor(math.random(1, 5));
    local pet_list = {2505,2506,2507,2508,2509}

    petid2 = pet_list[num2]
    NLG.GivePet( charaindex,petid2);
    NLG.DelItemByIndex(charaindex,haveitemindex);
    end
  end
end

0

主题

54

帖子

93

积分

注册会员

Rank: 2

积分
93
发表于 2021-10-29 21:52:36 | 显示全部楼层
我来看看是什么好东西~~~~~~~

19

主题

92

帖子

93

积分

注册会员

Rank: 2

积分
93
发表于 2021-11-16 12:54:44 | 显示全部楼层
66666666666

0

主题

69

帖子

76

积分

注册会员

Rank: 2

积分
76
发表于 2021-12-2 16:33:30 | 显示全部楼层
新UI能用吗

0

主题

32

帖子

32

积分

新手上路

Rank: 1

积分
32
发表于 2021-12-5 10:54:20 | 显示全部楼层
66666666666666666666

1

主题

106

帖子

183

积分

注册会员

Rank: 2

积分
183
发表于 2022-10-8 16:29:41 | 显示全部楼层
干嘛用的?

1

主题

27

帖子

59

积分

注册会员

Rank: 2

积分
59
发表于 2023-1-20 05:19:30 | 显示全部楼层
感谢大大分享 这样宠物就方便转生了

3

主题

30

帖子

56

积分

注册会员

Rank: 2

积分
56
发表于 2023-3-14 21:41:15 | 显示全部楼层

留个脚印!!不知道有没有用!

0

主题

180

帖子

300

积分

中级会员

Rank: 3Rank: 3

积分
300
发表于 2023-3-17 00:50:06 | 显示全部楼层
学习一下~~~~~~~~~~~~~~~~~~~~~~~~~~
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|gmsv石器单机研究论坛

JS of wanmeiff.com and vcpic.com Please keep this copyright information, respect of, thank you!JS of wanmeiff.com and vcpic.com Please keep this copyright information, respect of, thank you!

GMT+8, 2024-4-26 23:26 , Processed in 0.160620 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表