Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getRand(pid)
- {
- local rand = rand() % 200 + 1;
- return rand;
- }
- function harvestBonus(pid, resource_id, rewardItem)
- {
- local rand = rand() % 100 + 1;
- local miner = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_01);
- local agronom = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_02);
- local lesorub = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_03);
- local ribak = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_04);
- local sobiratel = GetPlayerBuff(pid, BuffID.BUFF_PERM_EXPERT_05);
- local pos = getPlayerPosition(pid);
- local world = getPlayerWorld(pid);
- if(resource_id == 0 ||
- resource_id == 1 ||
- resource_id == 11 ||
- resource_id == 13 ||
- resource_id == 28)
- {
- local getrand = getRand(pid)
- local rand2 = rand + getrand
- if (rand >= 8 && rand <= 10)
- {
- local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_QUARTZ"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: кварц");
- }
- if (rand >= 11 && rand <= 13)
- {
- local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_ROCKCRYSTAL"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: горный хрусталь");
- }
- if (rand >= 14 && rand <= 16)
- {
- local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_SULFUR"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: сера");
- }
- if (rand2 >= 100 && rand2 <= 106)
- {
- local dropReward = ItemsGround.spawn(Items.id("ITMI_AMBER"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: янтарь");
- }
- if (rand2 >= 106 && rand2 <= 111)
- {
- local dropReward = ItemsGround.spawn(Items.id("ITMI_TOPAZ"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: топаз");
- }
- if (rand2 >= 112 && rand2 <= 116)
- {
- local dropReward = ItemsGround.spawn(Items.id("ITMI_SAPPHIRE"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: сапфир");
- }
- if (rand2 >= 117 && rand2 <= 120)
- {
- local dropReward = ItemsGround.spawn(Items.id("ITMI_DIAMOND"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: алмаз");
- }
- if (rand2 >= 121 && rand2 <= 122)
- {
- local dropReward = ItemsGround.spawn(Items.id("ITMI_RUBY"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: Рубин");
- }
- if (miner != null && getPlayerRangedWeapon(pid) != "BAG_3")
- {
- if (rand <= 5)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача +1");
- }
- if (rand >= 6 && rand <= 8)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача +2");
- }
- }
- }
- if(resource_id == 2 ||
- resource_id == 25 ||
- resource_id == 26 ||
- resource_id == 29)
- {
- if (rand <= 10)
- {
- callClientFunc(pid, "showNotification", "Вы нашли сорняк");
- local dropReward = ItemsGround.spawn(Items.id("PLANTS_WEED"), 1, pos.x, pos.y, pos.z, world);
- }
- if (agronom != null && getPlayerRangedWeapon(pid) != "BAG_4")
- {
- if (rand <= 5)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- if (rand >= 6 && rand <= 8)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- }
- }
- if(resource_id == 4)
- {
- if (rand <= 20)
- {
- callClientFunc(pid, "showNotification", "Вы нашли смолу");
- local dropReward = ItemsGround.spawn(Items.id("OOLTYB_ITMI_PITCH"), 1, pos.x, pos.y, pos.z, world);
- }
- if (lesorub != null && getPlayerRangedWeapon(pid) != "BAG_2")
- {
- if (rand <= 5)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- if (rand >= 6 && rand <= 8)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- }
- }
- if(resource_id == 6 ||
- resource_id == 7 ||
- resource_id == 9 ||
- resource_id == 10 ||
- resource_id == 8)
- {
- if (sobiratel != null && getPlayerRangedWeapon(pid) != "BAG_6")
- {
- if (rand <= 5)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- if (rand >= 6 && rand <= 8)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- }
- }
- if(resource_id == 27)
- {
- if (rand >= 79 && rand <= 89)
- {
- local dropReward = ItemsGround.spawn(Items.id("RAKUSHKA"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: Ракушка");
- }
- if (rand >= 90 && rand <= 100)
- {
- local dropReward = ItemsGround.spawn(Items.id("USTRICA"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: Моллюск");
- }
- if (ribak != null && getPlayerRangedWeapon(pid) != "BAG_1")
- {
- if (rand <= 5)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- if (rand <= 3)
- {
- local dropReward = ItemsGround.spawn(Items.id(rewardItem), 2, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Удача");
- }
- if (rand >= 6 && rand <= 10)
- {
- local dropReward = ItemsGround.spawn(Items.id("RAKUSHKA"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: Ракушка");
- }
- if (rand >= 11 && rand <= 15)
- {
- local dropReward = ItemsGround.spawn(Items.id("RAKUSHKA"), 1, pos.x, pos.y, pos.z, world);
- callClientFunc(pid, "showNotification", "Вы нашли: Ракушка");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement