Jump to content

Question

23 answers to this question

Recommended Posts

  • 0
Posted
10 minutes ago, Giant Whisper said:

how to solve this problem

2heajwl.jpg

Morpho.txt

Hey,

clear; is script function:

*clear;

This command will clear the dialog text and continue the script without player interaction.

Just rename it.

  • 0
Posted (edited)
13 minutes ago, Giant Whisper said:

the error is corrected but the script does not work

morpho.gif

The script itself 100% working you just have to set-up properly the "OnInit: part.

I don't see any problems at the script at all.
Example:

set .top_morpho,2220; // That is Hat

Then try it in-game see if it works.

Keep in mind there are some ranges of headgears are allowed to be used in-game.

if( (.@var1 >= 5001 && .@var1 <= 5859) || (.@var1 >= 60000 && .@var1 <= 61196) ) { // 5001 && 5859 - Check them at RateMyServer 6000 && 61996 It's a Custom Headgears


 

Capture.PNG

Edited by Royr
  • 0
Posted

Well tell me how this one goes. I put the keywords var outside of OnInit, if it works it means OnInit wasn't being executed or something.

//Morphogenic Hat Script
//Allows a player to change their look to absolutely any hat available or to a defined upper limit. Check the "OnInit" label for information on this.
//
//By Slam

-	script	Morpho	-1,{
OnWhisperGlobal:
	//Array of keywords for the script
	setarray .@keywords$[0],"help","upper","middle","lower","clear","info","upperdawn","middledawn","lowerdawn";
	set .@var0$, @whispervar0$;
	set .@var1, atoi(@whispervar1$);
	if(inarray(.morpho_disallowed, .@var1) != -1){
		dispbottom "Sorry, you cannot change your Morpho into this headgear. Please try another.";
		end;
	}
	set .@i,inarray(.@keywords$, .@var0$);
	if(.@i == -1) {
		dispbottom "---------------[Morpho Helper]---------------";
		dispbottom " ";
		dispbottom "Sorry, I didn't understand the option you have";
		dispbottom "have given me. Please type 'help' for more info";
		dispbottom " ";
		end;
	} else {
		switch(.@i){

		case 0:

			goto help;

		case 1:

			goto tophead;

		case 2:

			goto midhead;

		case 3:

			goto lowhead;

		case 4:

			goto clear_h;

		case 5:

			goto info;

		case 6:

			goto topheadlow;
		case 7:

			goto midheadlow;

		case 8:

			goto lowheadlow;
		}
	}

	help:

		dispbottom "---------------[Morpho Helper]---------------";
		dispbottom " ";
		dispbottom "Welcome to the Morpho Settings NPC!";
		dispbottom "I can help you set what your Morphohat looks like";
		dispbottom " ";
		dispbottom "To use this NPC, whisper NPC:Morpho (you should";
		dispbottom "know this already) with upper/middle/lower or ";
		dispbottom "wing. The wing section is not yet implemented";
		dispbottom "however. Now, to set your Morphohat use the ";
		dispbottom "following layout:";
		dispbottom " ";
		dispbottom "upper#5232 - This will make it a Pink Kitty";
		dispbottom " ";
		dispbottom "Protip: Use RateMyServer.net for item IDs.";
		end;

	tophead:

		if(!isequipped(.top_morpho)){
			goto wrong_headgear;
		}
		if((.@var1 >= 5001 && .@var1 <= 5859) || (.@var1 >= 60000 && .@var1 <= 61196)){
			set .@viewid,getiteminfo(.@var1,11);
			set .@equipslot,getiteminfo(.@var1,5);
//			if(.@equipslot != 256 && .@equipslot != 768){ //Upper and Upper+Mid Only. Comment out this line and the two below it to remove this functionality.
//				goto denied_wrongslot;
//			}
			set viewid_top,.@viewid;
			dispbottom "Selected headgear ID: "+.@viewid;
			setlook 4,.@viewid;
			end;
		}
		dispbottom "Unavailable ID";
		end;

	midhead:

        if(!isequipped(.mid_morpho)){
            goto wrong_headgear;
        }
	if((.@var1 >= 5001 && .@var1 <= 5859) || (.@var1 >= 60000 && .@var1 <= 61196)){
        	set .@viewid,getiteminfo(.@var1,11);
		set .@equipslot,getiteminfo(.@var1,5);
//        	if(.@equipslot != 512 && .@equipslot != 513){ //Mid and Mid+Lower only. Comment out this line and the two below it to remove this functionality.
//           		goto denied_wrongslot;
//        	}
        	set viewid_mid,.@viewid;
		dispbottom "Selected headgear ID: "+.@viewid;
        	setlook 5,.@viewid;
		end;
	}
	dispbottom "Unavailable ID";
	end;

	lowhead:

	if(!isequipped(.low_morpho)){
		goto wrong_headgear;
	}
	if((.@var1 >= 5001 && .@var1 <= 5859) || (.@var1 >= 60000 && .@var1 <= 61196)){
		set .@viewid,getiteminfo(.@var1,11);
		set .@equipslot,getiteminfo(.@var1,5);
//		if(.@equipslot != 1){ // Lower Only. Comment out this line and the two below it to remove this functionality.
//			goto denied_wrongslot;
//		}
		set viewid_low,.@viewid;
		dispbottom "Selected headgear ID: "+.@viewid;
		setlook 3,.@viewid;
		end;
	}
	dispbottom "Unavailable ID";
	end;

	topheadlow:

		if(!isequipped(.top_morphos)){
			goto wrong_headgear;
		}
		if((.@var1 >= 5001 && .@var1 <= 5859) || (.@var1 >= 60000 && .@var1 <= 61196)){
			set .@viewid,getiteminfo(.@var1,11);
			set .@equipslot,getiteminfo(.@var1,5);
//			if(.@equipslot != 256 && .@equipslot != 768){ //Upper and Upper+Mid Only. Comment out this line and the two below it to remove this functionality.
//				goto denied_wrongslot;
//			}
			set viewid_tops,.@viewid;
			dispbottom "Selected headgear ID: "+.@viewid;
			setlook 4,.@viewid;
			end;
		}
		dispbottom "Unavailable ID";
		end;

	midheadlow:
	if((.@var1 >= 5001 && .@var1 <= 5859) || (.@var1 >= 60000 && .@var1 <= 61196)){
		if(!isequipped(.mid_morphos)){
			goto wrong_headgear;
		}
        	set .@viewid,getiteminfo(.@var1,11);
		set .@equipslot,getiteminfo(.@var1,5);
//      	if(.@equipslot != 512){ // Lower Only. Comment out this line and the two below it to remove this functionality.
//           		goto denied_wrongslot;
//        	}
       		set viewid_mids,.@viewid;
		dispbottom "Selected headgear ID: "+.@viewid;
        	setlook 5,.@viewid;
       		end;
	}
	dispbottom "Unavailable ID";
	end;

	lowheadlow:
	if((.@var1 >= 5001 && .@var1 <= 5859) || (.@var1 >= 60000 && .@var1 <= 61196)){
        	if(!isequipped(.low_morphos)){
             	goto wrong_headgear;
        	}
        	set .@viewid,getiteminfo(.@var1,11);
		set .@equipslot,getiteminfo(.@var1,5);
//      	if(.@equipslot != 1){ // Lower Only. Comment out this line and the two below it to remove this functionality.
//          		 goto denied_wrongslot;
//        	}
        	set viewid_lows,.@viewid;
		dispbottom "Selected headgear ID: "+.@viewid;
        	setlook 3,.@viewid;
        	end;
	}
	dispbottom "Unavailable ID";
	end;

	clear_h:

		set viewid_low, 1;
		set viewid_mid, 2;
		set viewid_top, 3;
		if (getequipid(1) == .top_morpho)
			setlook 5,0;
		if (getequipid(9) == .mid_morpho)
			setlook 4,0;
		if (getequipid(10) == .low_morpho)
			setlook 3,0;
		dispbottom "Your Morphing Hats list has been cleared.";
		end;

	info:

		dispbottom "---------------[Morpho Helper]---------------";
		dispbottom " ";
		dispbottom "You currently have the following items set for your Morpho hat:";
		dispbottom "Upper - "+getitemname(viewid_top);
		dispbottom "Middle - "+getitemname(viewid_mid);
		dispbottom "Lower - "+getitemname(viewid_low);
		end;

	denied_wrongslot:
		dispbottom "Sorry, this headgear was not designed for this headgear slot.";
		end;

	wrong_headgear:

		dispbottom "Sorry, you do not currently have your Morpho equipped. Please equip it and try again!";

		end;

	OnInit:

		//Change this to the upper limit of the headgears that you wish to make available
		setarray .morpho_disallowed[0], 9001; //inb4OVERNINETHOUSAND

		//Equip IDs - Change these to the ID numbers of the hat you wish to designate as the Morphing hat
		set .top_morpho,60683;
		set .mid_morpho,60684;
		set .low_morpho,60685;
		end;
}

//Use 'callfunc "MorphoEquip",<1,2,3>;' for the "OnEquip" script to let people know that they need to set the view ID or to set the viewid if the person has already set one.
//If you wish to make the "Morph" an Account bound variable, simply change all instances of "viewid_" with "#viewid_"
function	script	MorphoEquip	{
	set .@equipslot,getarg(0);
	switch(.@equipslot) {
		case 1:  //Upper
			if (!viewid_top) {
				dispbottom "No headgear set for upper. PM \"NPC:Morpho\" with the word \"help\" for more information.";
				end;
			}
			setlook LOOK_HEAD_TOP,viewid_top;
			break;
		case 2: //Mid
			if (!viewid_mid) {
				dispbottom "No headgear set for middle. PM \"NPC:Morpho\" with the word \"help\" for more information.";
				end;
			}
			setlook LOOK_HEAD_MID,viewid_mid;
			break;
		case 3: //Lower
			if (!viewid_low) {
				dispbottom "No headgear set for lower. PM \"NPC:Morpho\" with the word \"help\" for more information.";
				end;
			}
			setlook LOOK_HEAD_BOTTOM,viewid_low;
			break;
    }
}

 

  • 0
Posted

I understood now.

Try changing the MorphoUnequip function to:

function	script	MorphoUnEquip	{
	set .@equipslot,getarg(0);
	switch(.@equipslot) {
		case 1: // Top
			if(!getequipisequiped(EQI_HEAD_TOP))
				changelook LOOK_HEAD_TOP,0;
			break;
		case 2: //Mid
			if(!getequipisequiped(EQI_HEAD_MID))
				changelook LOOK_HEAD_MID,0;
			break;
		case 3: //Lower
			if(!getequipisequiped(EQI_HEAD_LOW))
				changelook LOOK_HEAD_BOTTOM,0;
			break;
	}
}

 

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...