Jump to content
  • 0

How to change changelook LOOK_HEAD_TOP, # back to 0?


Question

Posted (edited)

Good day! I would like to ask for assistance regarding my fishing script. I added changelook LOOK_HEAD_TOP,102;  changelook LOOK_HEAD_MID,471; changelook LOOK_HEAD_BOTTOM,383; while fishing.
Now, the problem is I dont know how to change it back to 0 when player stops fishing.

 

Thanks in advance!  

image.png

image.png

fishing.txt

Edited by agamanaros
grammar check only

12 answers to this question

Recommended Posts

  • 0
Posted

Thanks for the reply @Mabuhay. Do you mind showing me how? I'm kinda new at scripting. Thanks!

 

5 hours ago, Mabuhay said:

store the original looks to a temporary character var then set it again when player finishes fishing

I tried adding changelook  0 to every end;  but apparently its not working ?

 

image.png

  • 0
Posted (edited)
*getlook(<type>{,<char_id>})

This function will return the number for the current character look value
specified by type. See 'setlook' for valid look types.

This can be used to make a certain script behave differently for characters
dressed in black.
@var = getlook(LOCATION);

 

Try using setlook instead of changelook

Edited by Mabuhay
  • 0
Posted
6 minutes ago, Mabuhay said:

*getlook(<type>{,<char_id>})

This function will return the number for the current character look value
specified by type. See 'setlook' for valid look types.

This can be used to make a certain script behave differently for characters
dressed in black.

@var = getlook(LOCATION);

 

Try using setlook instead of changelook

Do you mind showing me how sir? I can't trigger the changelook, Also Im not getting any errors in maps.

  • 0
Posted
12 minutes ago, Mabuhay said:

*getlook(<type>{,<char_id>})

This function will return the number for the current character look value
specified by type. See 'setlook' for valid look types.

This can be used to make a certain script behave differently for characters
dressed in black.

@var = getlook(LOCATION);

 

Try using setlook instead of changelook

brasilis,253,60,0	script	Fishing Hole	844,{
	
//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";
		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;
			}
		changelook LOOK_HEAD_TOP,102;
		changelook LOOK_HEAD_MID,471;
		changelook LOOK_HEAD_BOTTOM,383;
		sc_start SC_SUMMER,7500,0;
		progressbar "ffffff",.@fcast;
		if (rand(1,80) == 2){
		getitem 32552,1; //Fish with Blue Back
		specialeffect2 EF_TEMP_OK;
		announce "Wow! What a lucky bastard, "+strcharinfo(0)+" has caught a Blue Fish! Go to @fish to join now!",8;
		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
		}
		if(.@Auto == 1){
		goto Fish;} else{
		end;}
		}
	else {
	dispbottom "[Fishing] You need a Rod and Lure.";
	end;
	}
}

brasilis,251,56,0	duplicate(Fishing Hole)	Fishing Hole #1	844,
brasilis,251,58,0	duplicate(Fishing Hole)	Fishing Hole #2	844,
brasilis,251,60,0	duplicate(Fishing Hole)	Fishing Hole #3	844,
brasilis,251,62,0	duplicate(Fishing Hole)	Fishing Hole #4	844,
brasilis,251,64,0	duplicate(Fishing Hole)	Fishing Hole #5	844,

brasilis,253,56,0	duplicate(Fishing Hole)	Fishing Hole #6	844,
brasilis,253,58,0	duplicate(Fishing Hole)	Fishing Hole #7	844,
brasilis,253,60,0	duplicate(Fishing Hole)	Fishing Hole #8	844,
brasilis,253,62,0	duplicate(Fishing Hole)	Fishing Hole #9	844,
brasilis,253,64,0	duplicate(Fishing Hole)	Fishing Hole #10	844,

brasilis,255,56,0	duplicate(Fishing Hole)	Fishing Hole #11	844,
brasilis,255,58,0	duplicate(Fishing Hole)	Fishing Hole #12	844,
brasilis,255,60,0	duplicate(Fishing Hole)	Fishing Hole #13	844,
brasilis,255,62,0	duplicate(Fishing Hole)	Fishing Hole #14	844,
brasilis,255,64,0	duplicate(Fishing Hole)	Fishing Hole #15	844,

brasilis,257,56,0	duplicate(Fishing Hole)	Fishing Hole #16	844,
brasilis,257,58,0	duplicate(Fishing Hole)	Fishing Hole #17	844,
brasilis,257,60,0	duplicate(Fishing Hole)	Fishing Hole #18	844,
brasilis,257,62,0	duplicate(Fishing Hole)	Fishing Hole #19	844,
brasilis,257,64,0	duplicate(Fishing Hole)	Fishing Hole #20	844,

Here's the sourcecode sir.

  • 0
Posted
brasilis,253,60,0	script	Fishing Hole	844,{
	
//Fishing rod
set .@Rod,2764;
//Fishing Lure
set .@Lure,2775;
//Auto-Fish
set .@Auto,0;
//Auto-Fish on Fail
set .@AutoFail,0;
Fish:
	if (isequipped(.@Rod)) && (isequipped(.@Lure)){
		specialeffect EF_BUBBLE,"Fishing Hole";
		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;
			}
		setarray @var[0],  getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_HEAD_BOTTOM);
		changelook LOOK_HEAD_TOP,102;
		changelook LOOK_HEAD_MID,471;
		changelook LOOK_HEAD_BOTTOM,383;
		sc_start SC_SUMMER,7500,0;
		progressbar "ffffff",.@fcast;
		if (rand(1,80) == 2){
		getitem 32552,1; //Fish with Blue Back
		specialeffect2 EF_TEMP_OK;
		announce "Wow! What a lucky bastard, "+strcharinfo(0)+" has caught a Blue Fish! Go to @fish to join now!",8;
		mapannounce strcharinfo(3),strcharinfo(0)+" has caught a Blue Fish!",bc_map,"0xff77ff";
		changelook LOOK_HEAD_TOP,@var[0];
		changelook LOOK_HEAD_MID,@var[1];
		changelook LOOK_HEAD_BOTTOM,@var[2];
		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;
			changelook LOOK_HEAD_TOP,@var[0];
			changelook LOOK_HEAD_MID,@var[1];
			changelook LOOK_HEAD_BOTTOM,@var[2];
			}
			else {
			dispbottom "[Fishing] Nothing was caught...";
			changelook LOOK_HEAD_TOP,@var[0];
			changelook LOOK_HEAD_MID,@var[1];
			changelook LOOK_HEAD_BOTTOM,@var[2];
			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
		changelook LOOK_HEAD_TOP,@var[0];
		changelook LOOK_HEAD_MID,@var[1];
		changelook LOOK_HEAD_BOTTOM,@var[2];
		}
		if(.@Auto == 1){
		goto Fish;} else{
		end;}
		}
	else {
	dispbottom "[Fishing] You need a Rod and Lure.";
	end;
	}
}

brasilis,251,56,0	duplicate(Fishing Hole)	Fishing Hole #1	844,

Try this

  • 0
Posted

I try to use autofish and work 
i think the issue for this script if player on casting and then their move the look still will be display like their on fishing

you must block to player when casting

  • 0
Posted
3 hours ago, agamanaros said:

I really appreciate the response @LearningRO, I think this requires source modification. I'll update you once I tried your advise. Thanks again man!

 

actually you can use setpcblock PCBLOCK_MOVE,True; when talk to npc
and then add setpcblock PCBLOCK_MOVE,False; when finish

but You must disable autofishing when fail to use this

  • 0
Posted
4 hours ago, LearningRO said:

actually you can use setpcblock PCBLOCK_MOVE,True; when talk to npc
and then add setpcblock PCBLOCK_MOVE,False; when finish

but You must disable autofishing when fail to use this

Is it possible sir to add like a 2 seconds delay time once the progress bar is complete before it executes the script again? Then adding setpcblock PCBLOCK_MOVE while progressbar is still casting? so they'll have time to move before the progressbar recast again? Thanks sir!

  • 0
Posted
12 minutes ago, agamanaros said:

Is it possible sir to add like a 2 seconds delay time once the progress bar is complete before it executes the script again? Then adding setpcblock PCBLOCK_MOVE while progressbar is still casting? so they'll have time to move before the progressbar recast again? Thanks sir!

I tried adding mes " "; before the end; however that doesn't seem to do the trick. ?

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...