Jump to content
  • 0

Fishing using usable


GM Winter

Question


  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

hello is there possible to change the lure into an usable or misc item that will be delete in the inventory while fishing 

 

Quote

sec_in02,150,165,0    script    Fishing Hole    10065,{
    
//Fishing rod
set .@Rod,2764;
//Fishing Lure
set .@Lure,2775;
//Auto-Fish
set .@Auto,1;
//Auto-Fish on Fail
set .@AutoFail,1;
Fish:
    if (isequipped(.@Rod)) && (isequipped(.@Lure)){
        specialeffect EF_BUBBLE,"Fishing Hole";
        soundeffect "fishingrod.wav",0;
        dispbottom "[Fishing] Casting...";
        set .@fcast,15;
            if (isequipped(2550)) { //Fisher's Muffler
                set .@fcast,.@fcast - 2;
            }
            if (isequipped(2443)) { //Fisher's Boots
                set .@fcast,.@fcast - 2;
            }
            if (isequipped(2764)) { //Fishing Pole
                set .@fcast,.@fcast - 3;
            }
            if (isequipped(2775)) { //Fishing Lure
                set .@fcast,.@fcast - 1;
            }
        progressbar "ffffff",.@fcast;
        if (rand(1,20) == 2){
        getitem 6096,1; //Fish with Blue Back
        specialeffect2 EF_TEMP_OK;
        soundeffectall "success.wav",0,strcharinfo(3);
        mapannounce strcharinfo(3),strcharinfo(0)+" has caught a Blue Fish!",bc_map,"0xff77ff";
        if(.@Auto==1){
        goto Fish;}else{
        end;}
        }
            if (rand(1,6) == 1) ||(rand(1,6) == 3) || (rand(1,6) == 6){
            setarray .@Catch[0],579,908,909,963,956,6049,918,960,910,938,624;// List of Junk/Other
            set .@CatchRand,.@Catch[rand(getarraysize(.@Catch))];
            getitem .@CatchRand,1;
            }
            else {
            dispbottom "[Fishing] Nothing was caught...";
            if(.@AutoFail == 1){
            goto Fish;} else{
            end;}
            }
        if (rand(1,100) == 3){
        setarray .@Rare[0],644,603,617;
        set .@RareCatch, .@Rare[rand(getarraysize(.@Rare))];
        getitem .@RareCatch,1; //Reward
        mapannounce strcharinfo(3),strcharinfo(0)+" has caught a "+getitemname(.@RareCatch)+"!",bc_map,"0x33CC00";
        }
        if(.@Auto == 1){
        goto Fish;} else{
        end;}
        }
    else {
    dispbottom "[Fishing] You need a Rod and Lure.";
    end;
    }
}

 

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

prontera, 150, 165, 0	script	Fishing Hole	10065,{
    Fish:
        if(!isequipped(.rod) || countitem(.lure) == 0) {
            dispbottom("[Fishing] You need a Rod and Lure.");
            end;
        }

        specialeffect(EF_BUBBLE, "Fishing Hole");
        soundeffect("fishingrod.wav", 0);
        dispbottom("[Fishing] Casting...");
        
        delitem(.lure, 1);

        .@fishing_cast_time = .default_fishing_cast_time;
        for(.@i = 0; .@i < getarraysize(.fishing_items); .@i += 2)
            if (isequipped(.fishing_items[.@i]))
                .@fishing_cast_time += .fishing_items[.@i + 1];

        progressbar("ffffff", .@fishing_cast_time);

        .@rand = rand(1, 100);

        if(.@rand > 56) {
            dispbottom("[Fishing] Nothing was caught...");
            specialeffect2(EF_TEMP_FAIL);

            if(.auto_fail == 1)
                goto Fish;
            
            end;
        }

        if(.@rand == 1) {
            .@catch = .rare_catches[rand(getarraysize(.rare_catches))];
            mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00");
        } else if(.@rand > 1 && .@rand <= 6) {
            .@catch = .blueback;
            mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Blue Fish!", bc_map, "0xff77ff");
        } else if(.@rand > 6)
            .@catch = .normal_catches[rand(getarraysize(.normal_catches))];

        getitem(.@catch, 1);
        specialeffect2(EF_TEMP_OK);

        if(.auto == 1) 
            goto Fish;
        
        end;

    OnInit:
        // Fishing rod
        .rod = 2764;

        // Fishing Lure
        .lure = 2775;
        
        // Auto-Fish
        .auto = 1;
        
        // Auto-Fish on Fail
        .auto_fail = 1;

        // Default Cast Time 
        .default_fishing_cast_time = 15;

        // Fishing Items
        setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1);

        // Blueback
        .blueback = 6096;

        // Catches
        setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624);

        // Rare Catches
        setarray(.rare_catches[0], 644, 603, 617);
}

In this script version, on each fish, a .lure item will be removed from the inventory.

You can either change the lure item 2775 to a misc or etc. item via the item db, or you can leave it as equip, which will reduce the cast time as intended and use something else as lure.

Edited by Winterfox
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

5 hours ago, Winterfox said:
prontera, 150, 165, 0	script	Fishing Hole	10065,{
    Fish:
        if(!isequipped(.rod) || countitem(.lure) == 0) {
            dispbottom("[Fishing] You need a Rod and Lure.");
            end;
        }

        specialeffect(EF_BUBBLE, "Fishing Hole");
        soundeffect("fishingrod.wav", 0);
        dispbottom("[Fishing] Casting...");
        
        delitem(.lure, 1);

        .@fishing_cast_time = .default_fishing_cast_time;
        for(.@i = 0; .@i < getarraysize(.fishing_items); .@i += 2)
            if (isequipped(.fishing_items[.@i]))
                .@fishing_cast_time += .fishing_items[.@i + 1];

        progressbar("ffffff", .@fishing_cast_time);

        .@rand = rand(1, 100);

        if(.@rand > 56) {
            dispbottom("[Fishing] Nothing was caught...");
            specialeffect2(EF_TEMP_FAIL);

            if(.auto_fail == 1)
                goto Fish;
            
            end;
        }

        if(.@rand == 1) {
            .@catch = .rare_catches[rand(getarraysize(.rare_catches))];
            mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00");
        } else if(.@rand > 1 && .@rand <= 6) {
            .@catch = .blueback;
            mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Blue Fish!", bc_map, "0xff77ff");
        } else if(.@rand > 6)
            .@catch = .normal_catches[rand(getarraysize(.normal_catches))];

        getitem(.@catch, 1);
        specialeffect2(EF_TEMP_OK);

        if(.auto == 1) 
            goto Fish;
        
        end;

    OnInit:
        // Fishing rod
        .rod = 2764;

        // Fishing Lure
        .lure = 2775;
        
        // Auto-Fish
        .auto = 1;
        
        // Auto-Fish on Fail
        .auto_fail = 1;

        // Default Cast Time 
        .default_fishing_cast_time = 15;

        // Fishing Items
        setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1);

        // Blueback
        .blueback = 6096;

        // Catches
        setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624);

        // Rare Catches
        setarray(.rare_catches[0], 644, 603, 617);
}

In this script version, on each fish, a .lure item will be removed from the inventory.

You can either change the lure item 2775 to a misc or etc. item via the item db, or you can leave it as equip, which will reduce the cast time as intended and use something else as lure.

thank you so much dude this is what im looking for , anyway can i adjust the rates of the chances ?

Edited by GM Winter
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

prontera, 150, 165, 0	script	Fishing Hole	10065,{
    Fish:
        if(!isequipped(.rod) || countitem(.lure) == 0) {
            dispbottom("[Fishing] You need a Rod and Lure.");
            end;
        }

        specialeffect(EF_BUBBLE, "Fishing Hole");
        soundeffect("fishingrod.wav", 0);
        dispbottom("[Fishing] Casting...");
        
        .@fishing_cast_time = .default_fishing_cast_time;
        for(.@i = 0; .@i < getarraysize(.fishing_items); .@i += 2)
            if (isequipped(.fishing_items[.@i]))
                .@fishing_cast_time += .fishing_items[.@i + 1];

        progressbar("ffffff", .@fishing_cast_time);
        delitem(.lure, 1);

        .@pull = rand(1, 100);
        .@catch = 0;
        .@chance = 0;

        for(.@i = 0; .@i < 3; .@i++) {
            .@chance += .chances[.@i];

            if(.@pull <= .@chance) {
                switch(.@i) {
                    case 0:
                        .@catch = .rare_catches[rand(getarraysize(.rare_catches))];
                        mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00");
                        break;
                    case 1:
                        .@catch = .blueback;
                        mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Blue Fish!", bc_map, "0xff77ff");
                        break;
                    case 2:
                        .@catch = .normal_catches[rand(getarraysize(.normal_catches))];
                        break;
                }
                
                break;
            }
        }

        if(.@catch == 0) {
            dispbottom("[Fishing] Nothing was caught...");
            specialeffect2(EF_TEMP_FAIL);

            if(.auto_fail == 1)
                goto Fish;
            
            end;
        }

        getitem(.@catch, 1);
        specialeffect2(EF_TEMP_OK);

        if(.auto == 1) 
            goto Fish;
        
        end;

    OnInit:
        // Fishing rod
        .rod = 2764;

        // Fishing Lure
        .lure = 2775;
        
        // Auto-Fish
        .auto = 1;
        
        // Auto-Fish on Fail
        .auto_fail = 1;

        // Default Cast Time 
        .default_fishing_cast_time = 15;

        // Chances for catch rareties: <rare>, <blueback>, <normal>
        // All chances together can't exceed 100.
        // If all chances sum up to 100, fishing doesn't fail. 
        setarray(.chances[0], 1, 5, 50);

        // Fishing Items
        setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1);

        // Blueback
        .blueback = 6096;

        // Catches
        setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624);

        // Rare Catches
        setarray(.rare_catches[0], 644, 603, 617);
}

 

  • MVP 1
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

21 minutes ago, Winterfox said:
prontera, 150, 165, 0	script	Fishing Hole	10065,{
    Fish:
        if(!isequipped(.rod) || countitem(.lure) == 0) {
            dispbottom("[Fishing] You need a Rod and Lure.");
            end;
        }

        specialeffect(EF_BUBBLE, "Fishing Hole");
        soundeffect("fishingrod.wav", 0);
        dispbottom("[Fishing] Casting...");
        
        .@fishing_cast_time = .default_fishing_cast_time;
        for(.@i = 0; .@i < getarraysize(.fishing_items); .@i += 2)
            if (isequipped(.fishing_items[.@i]))
                .@fishing_cast_time += .fishing_items[.@i + 1];

        progressbar("ffffff", .@fishing_cast_time);
        delitem(.lure, 1);

        .@pull = rand(1, 100);
        .@catch = 0;
        .@chance = 0;

        for(.@i = 0; .@i < 3; .@i++) {
            .@chance += .chances[.@i];

            if(.@pull <= .@chance) {
                switch(.@i) {
                    case 0:
                        .@catch = .rare_catches[rand(getarraysize(.rare_catches))];
                        mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00");
                        break;
                    case 1:
                        .@catch = .blueback;
                        mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Blue Fish!", bc_map, "0xff77ff");
                        break;
                    case 2:
                        .@catch = .normal_catches[rand(getarraysize(.normal_catches))];
                        break;
                }
                
                break;
            }
        }

        if(.@catch == 0) {
            dispbottom("[Fishing] Nothing was caught...");
            specialeffect2(EF_TEMP_FAIL);

            if(.auto_fail == 1)
                goto Fish;
            
            end;
        }

        getitem(.@catch, 1);
        specialeffect2(EF_TEMP_OK);

        if(.auto == 1) 
            goto Fish;
        
        end;

    OnInit:
        // Fishing rod
        .rod = 2764;

        // Fishing Lure
        .lure = 2775;
        
        // Auto-Fish
        .auto = 1;
        
        // Auto-Fish on Fail
        .auto_fail = 1;

        // Default Cast Time 
        .default_fishing_cast_time = 15;

        // Chances for catch rareties: <rare>, <blueback>, <normal>
        // All chances together can't exceed 100.
        // If all chances sum up to 100, fishing doesn't fail. 
        setarray(.chances[0], 1, 5, 50);

        // Fishing Items
        setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1);

        // Blueback
        .blueback = 6096;

        // Catches
        setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624);

        // Rare Catches
        setarray(.rare_catches[0], 644, 603, 617);
}

 

thank you so much for your help sir ❤️ 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.07
  • Content Count:  106
  • Reputation:   5
  • Joined:  11/15/22
  • Last Seen:  

Hi, may I ask what fishing version this is? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

 

47 minutes ago, namerpus18 said:

Hi, may I ask what fishing version this is? 

Fishing v1.2 

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.07
  • Content Count:  106
  • Reputation:   5
  • Joined:  11/15/22
  • Last Seen:  

On 8/12/2023 at 8:57 PM, GM Winter said:

 

Fishing v1.2 

 

Thanks mate 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  898
  • Reputation:   119
  • Joined:  05/23/12
  • Last Seen:  

U can create a Status Effect like SC_FISHING and when ur using the item the status effect start for a few minutes or else. On unequip sc_end SC_FISHING;

But it's need SRC modification. It's not complicated.

 

Rynbef~

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

As per a user's request, I added the possibility to modify the chance to catch certain fish based on the rod used.
 

sec_in02, 150, 165, 0	script	Fishing Hole	10065,{
    Fish:
        for(.@i = 0; .@i < .rods_size; .@i += .next_rod_step) {
            if(isequipped(.rods[.@i])) {
                .@rod_equipped = 1;
                .@rod_type = .@i;
                break;
            }
        }

        if(.@rod_equipped == 0 || countitem(.lure) == 0) {
            dispbottom("[Fishing] You need a Rod and Lure.");
            end;
        }

        specialeffect(EF_BUBBLE, "Fishing Hole");
        soundeffect("fishingrod.wav", 0);
        dispbottom("[Fishing] Casting...");

        .@fishing_cast_time = .default_fishing_cast_time;
        for(.@i = 0; .@i < .fishing_items_size; .@i += 2)
            if (isequipped(.fishing_items[.@i]))
                .@fishing_cast_time += .fishing_items[.@i + 1];

        progressbar("ffffff", .@fishing_cast_time);
        delitem(.lure, 1);

        .@chance_sum = 0;
        cleararray(.@current_chances[0], 0, .chances_size);

        for(.@i = 0; .@i < .chances_size; .@i++) {
            .@modifier = .chances[.@i] * .rods[.@rod_type + (.@i + 1)];
            .@current_chances[.@i] += .chances[.@i] * 100 + .@modifier;
            .@chance_sum += .@current_chances[.@i];
        }

        .@pull = rand(1, .@chance_sum);
        .@catch = 0;

        for(.@i = 0; .@i < .chances_size; .@i++) {
            .@pull -= .@current_chances[.@i];

            if(.@pull <= 0) {
                switch(.@i) {
                    case 0:
                        .@catch = .rare_catches[rand(.rare_catches_size)];
                        mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a " + getitemname(.@catch) + "!", bc_map, "0x33CC00");
                        break;
                    case 1:
                        .@catch = .magic_fish;
                        mapannounce(strcharinfo(3), strcharinfo(0) + " has caught a Magical Fish!", bc_map, "0xff77ff");
                        break;
                    case 2:
                        .@catch = .normal_catches[rand(.normal_catches_size)];
                        break;
                    case 3:
                        break;
                }
                
                break;
            }
        }

        if(.@catch == 0) {
            dispbottom("[Fishing] Nothing was caught...");
            specialeffect2(EF_TEMP_FAIL);

            if(.auto_fail == 1)
                goto Fish;
            
            end;
        }

        getitem(.@catch, 1);
        specialeffect2(EF_TEMP_OK);

        if(.auto == 1) 
            goto Fish;
        
        end;

    OnInit:
        // Fishing rod <id, rare, magic fish, normal, nothing>
        // + 1 = 1% increase
        // - 1 = 1% decrease
        setarray(.rods, 2764, 0, 0, 0, -25, 2763, 0, 0, 0, -50);

        // Fishing Lure
        .lure = 2775;
        
        // Auto-Fish
        .auto = 1;
        
        // Auto-Fish on Fail
        .auto_fail = 1;

        // Default Cast Time 
        .default_fishing_cast_time = 15;

        // Chances for catch rarities: <rare>, <magic fish>, <normal>, <nothing>
        setarray(.chances[0], 5, 3, 55, 37);

        // Fishing Items
        setarray(.fishing_items, 2550, -2, 2443, -2, 2764, -3, 2775, -1);

        // Magic Fish
        .magic_fish = 6096;

        // Catches
        setarray(.normal_catches[0], 579, 908, 909, 963, 956, 6049, 918, 960, 910, 938, 624);

        // Rare Catches
        setarray(.rare_catches[0], 644, 603, 617);

        // CONFIG END //
        .chances_size = getarraysize(.chances);
        .rods_size = getarraysize(.rods);
        .fishing_items_size = getarraysize(.fishing_items);
        .normal_catches_size = getarraysize(.normal_catches);
        .rare_catches_size = getarraysize(.rare_catches);

        .next_rod_step = .chances_size + 1;
}

sec_in02,153,165,0    duplicate(Fishing Hole)    Fishing Hole#1    10065
sec_in02,156,165,0    duplicate(Fishing Hole)    Fishing Hole#2    10065
sec_in02,159,165,0    duplicate(Fishing Hole)    Fishing Hole#3    10065
sec_in02,162,165,0    duplicate(Fishing Hole)    Fishing Hole#4    10065

sec_in02,153,168,0    duplicate(Fishing Hole)    Fishing Hole#5    10065
sec_in02,156,168,0    duplicate(Fishing Hole)    Fishing Hole#6    10065
sec_in02,159,168,0    duplicate(Fishing Hole)    Fishing Hole#7    10065
sec_in02,162,168,0    duplicate(Fishing Hole)    Fishing Hole#8    10065
sec_in02,150,168,0    duplicate(Fishing Hole)    Fishing Hole#9    10065

sec_in02,153,162,0    duplicate(Fishing Hole)    Fishing Hole#10    10065
sec_in02,156,162,0    duplicate(Fishing Hole)    Fishing Hole#11    10065
sec_in02,159,162,0    duplicate(Fishing Hole)    Fishing Hole#12    10065
sec_in02,150,162,0    duplicate(Fishing Hole)    Fishing Hole#14    10065

sec_in02,153,159,0    duplicate(Fishing Hole)    Fishing Hole#15    10065
sec_in02,156,159,0    duplicate(Fishing Hole)    Fishing Hole#16    10065
sec_in02,159,159,0    duplicate(Fishing Hole)    Fishing Hole#17    10065
sec_in02,150,159,0    duplicate(Fishing Hole)    Fishing Hole#18    10065

sec_in02,153,156,0    duplicate(Fishing Hole)    Fishing Hole#19    10065
sec_in02,156,156,0    duplicate(Fishing Hole)    Fishing Hole#20    10065
sec_in02,159,156,0    duplicate(Fishing Hole)    Fishing Hole#21    10065
sec_in02,162,156,0    duplicate(Fishing Hole)    Fishing Hole#22    10065
sec_in02,150,156,0    duplicate(Fishing Hole)    Fishing Hole#23    10065

 

Edited by Winterfox
  • Upvote 2
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

1 hour ago, Winterfox said:

 

hello thank you so much sir! 
 

Edited by GM Winter
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...