Jump to content
  • 0

Disguise Npc


Oraios

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  11/06/12
  • Last Seen:  

Hello community,

can someone write me a script like this :

- Disguise Cost 500.000 Zeny

- Disguise Monsters : Zombie, Familiar, Skeleton

 

Best regards,

Oraios

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Nope it wasn't about the kName, I thought that query_sql would delete all the values of the array but that's not the case. The compiled menu held the previous data if the new array had less data than the previous array

prontera,157,179,0	script	Sample	75,{
	if ( Zeny < 500000 ) {
		mes "You don't have 500,000 zeny";
		close;
	}
	mes "What monster would you like to disguise?";
	next;
L_back:
	.@s = select( .alphabet_menu$ ) -1;
	.@mob = select( getd( ".letter_"+ .@s +"$" ) ) -2;
	if ( .@mob == -1 ) goto L_back;
	disguise getd( ".mobid_"+ .@s +"["+ .@mob +"]" );
	close2;
	Zeny -= 500000;
	end;
OnInit:
	.@count = query_sql( "select distinct left( kName,1 ) as a from mob_db order by a", .@alphabet$ );
	.alphabet_menu$ = implode( .@alphabet$, ":" );
	for ( .@i = 0; .@i < .@count; .@i++ ) {
		.@string$ = ".mobid_"+ .@i;
		.@size = query_sql( "select kName,`ID` from mob_db where left( kName,1 ) = '"+ .@alphabet$[.@i] +"' group by kName asc limit 128", .@tmp$, getd( .@string$ ) );
		setd ".letter_"+ .@i +"$", ( .@i ? "^777777Back^000000:" : ":" ) + implode( .@tmp$, ":" );
		deletearray .@tmp$, .@size;
		// debugmes "check len "+ .@alphabet$[.@i] +" : "+ getarraysize( getd( .@string$ ) );
	}
}
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Try

prontera,150,150,0    script    Sample    -1,{
    if ( Zeny < 500000 ) {
        mes "You don't have 500,000 zeny";
        close;
    }
    mes "What monster would you like to disguise?";
    next;
    switch(select("Zombie:Skeleton:Familiar")) {
        case 1: disguise 1015; break;
        case 2: disguise 1076; break;
        case 3: disguise 1005; break;
        default: break;
    }
    close2;
    Zeny -= 500000;
    end;
}
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

another (you need to load mob_db sql)

prontera,157,179,0	script	Sample	75,{
	if ( Zeny < 500000 ) {
		mes "You don't have 500,000 zeny";
		close;
	}
	mes "What monster would you like to disguise?";
	next;
L_back:
	.@s = select( .alphabet_menu$ ) -1;
	.@mob = select( getd( ".letter_"+ .@s +"$" ) ) -2;
	if ( .@s && .@mob == -1 ) goto L_back;
	disguise getd( ".mobid_"+ .@s +"["+ .@mob +"]" );
	close2;
	Zeny -= 500000;
	end;
OnInit:
	.@count = query_sql( "select distinct left( kName,1 ) as a from mob_db order by a", .@alphabet$ );
	.alphabet_menu$ = implode( .@alphabet$, ":" );
	for ( .@i = 0; .@i < .@count; .@i++ ) {
		.@string$ = ".mobid_"+ .@i;
		query_sql( "select kName,`ID` from mob_db where left( kName,1 ) = '"+ .@alphabet$[.@i] +"' group by kName asc limit 128", .@tmp$, getd( .@string$ ) );
		setd ".letter_"+ .@i +"$", ( .@i ? "^777777Back^000000:" : ":" ) + implode( .@tmp$, ":" );
		// debugmes "check len "+ .@alphabet$[.@i] +" : "+ getarraysize( getd( .@string$ ) );
	}
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

@capuche.

there are some problem on your script.

there are alphabet A on B list.

there are alphabet A on C list

there are alphabet D on E list

there are alphabet D on F list

until alphabet W,T and S are on list Z

please fix it sir...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

This is due to pulling names from the kList. As in the Korean/Japanese names, not the english ones you see ingame. You'd have to configure the sql query to fit your needs.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

@capuche. thx now its fix :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Ahh, now that I looked at the full script yea, that is the case lol, I just saw kName the first time, and made the assumption based on my experience with Mob_db.txt. *Note to self, don't make assumptions lol*

  • Upvote 1
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...