Jump to content

Question

Posted
sec_in02,145,166,3	script	Sala de MVP	767,{
// ================== Settings ============================================
set .@n$,"^0000FF[ Sala de MVP ]^000000";
// ============= End of Settings ==========================================
mes .@n$;
mes "Olá ^FFA500"+strcharinfo(0)+"^000000!";
mes "Escolha uma sala de MVP!";
next;
switch(select("Sala 1:Sala 2:Sala 3")){
	case 1:
		mes "Boa sorte!";
		warp "que_moon",33,24;
		close;
	case 2:
		mes "Boa sorte!";
		warp "que_moon",99,24;
		close;
	case 3:
		mes "Boa sorte!";
		warp "que_moon",165,24;
		close;
	}
}
//========================= First Script End =============//
//================== MVP Summoner ========================//
que_moon,33,24,4	script	NPC Summoner	767,{
set .@nsummon$,"^0000FF[ NPC Summoner ]^000000";
mes .@nsummon$;
mes "Olá ^FFA500"+strcharinfo(0)+"^000000!";
mes "Cada MVP custa "+.zeny[1]+" Zeny";
next;
set .@m,select(.smenu$) - 1;
if( Zeny < .zeny[.mobze[.@m]] ) {
	mes .@nsummon$;
	mes "Voce não tem zeny suficiente.";
	close;
} else {
	mes .@nsummon$;
	mes "Boa Sorte!";
	close2;
	set Zeny, Zeny - .zeny[.mobze[.@m]];
	atcommand "@spawn "+.mobid[.@m] + " "+.mobam[.@m];
	npctalk "[ MVP Summoner]: "+getmonsterinfo(.mobid[.@m],0) +" Sumonado!";
	end;
}
OnInit:
setarray .zeny[1],15000000; // 50m,250m Zeny
// Mob IDs
setarray .mobid[0],1511,1785,1630,1039,1272,1719,1046,1389,1112,1115,1418,1252,1885,1251,1688,1373,1147,1059,1150,1087,1190,1038,1157,1159,1623,1312,1492;
// Mob Spawn Amount
setarray .mobam[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
// Price: Entry as Index from .zeny
// 1 = .zeny[1] - 2 = .zeny[2]
setarray .mobze[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
set .smenu$,"";
for( set .@s,0; .@s < getarraysize(.mobid); set .@s,.@s + 1) {
	// Skips an Monster if it does not exist in the db
	if(getmonsterinfo(.mobid[.@s],0) == "" || getmonsterinfo(.mobid[.@s],0) == "null") continue;
	// else adding it to the menu
	set .smenu$,.smenu$ + "- "+getmonsterinfo(.mobid[.@s],0) + ( (.mobid[.@s+1] == 0)?"":":");
}
end;
}
que_moon,99,24,4	duplicate(NPC Summoner)	NPC Summoner#8	767
que_moon,165,24,4	duplicate(NPC Summoner)	NPC Summoner#9	767

que_moon,24,14,5	script	Retornar para prontera#1	837,{
	warp "prontera",156,191;
	end;

}

que_moon,90,14,5	script	Retornar para prontera#2	837,{
	warp "prontera",156,191;
	end;

}

que_moon,156,14,5	script	Retornar para prontera#3	837,{
	warp "prontera",156,191;
	end;

}


que_moon	mapflag	nowarpto
que_moon	mapflag	nowarp
que_moon	mapflag	nodrop
que_moon	mapflag	nomemo
que_moon	mapflag	nobranch
que_moon	mapflag	noteleport
que_moon	mapflag	monster_noteleport
Good evening, can anyone help me with this NPC.
I need to add an option to summon the last mvp summoned.
Thanks ;*

2 answers to this question

Recommended Posts

  • 0
Posted

First we need to save in a variable which mvp was summoned.
Find this line

set Zeny, Zeny - .zeny[.mobze[.@m]];

And add below it:

ultimo_mvp_invocado = .mobid[.@m];

 

Then insert it in the menu options when the player talks to NPC again.
Find this line

set .@m,select(.smenu$) - 1;

And add above it:

	.@last = inarray(.mobid, ultimo_mvp_invocado);
	if (.@last  > -1) {
		.@t$ = "^0000FF(Último) " +  strmobinfo(1,.mobid[.@last]) + "^000000";
		.@m = select(.@t$, .smenu$) - 2;
		if (.@m == -1) .@m = .@last;
	}
	else

 

  • Love 1
  • 0
Posted
15 minutes ago, Racaae said:

First we need to save in a variable which mvp was summoned.
Find this line

set Zeny, Zeny - .zeny[.mobze[.@m]];

And add below it:

ultimo_mvp_invocado = .mobid[.@m];

 

Then insert it in the menu options when the player talks to NPC again.
Find this line

set .@m,select(.smenu$) - 1;

And add above it:

	.@last = inarray(.mobid, ultimo_mvp_invocado);
	if (.@last  > -1) {
		.@t$ = "^0000FF(Último) " +  strmobinfo(1,.mobid[.@last]) + "^000000";
		.@m = select(.@t$, .smenu$) - 2;
		if (.@m == -1) .@m = .@last;
	}
	else

 

Thank you ;*

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