Jump to content
  • 0

Disguise Npc


Question

Posted

Hello community,

can someone write me a script like this :

- Disguise Cost 500.000 Zeny

- Disguise Monsters : Zombie, Familiar, Skeleton

 

Best regards,

Oraios

7 answers to this question

Recommended Posts

  • 1
Posted

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
Posted

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;
}
Posted

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$ ) );
	}
}
Posted

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

Posted

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

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