Jump to content
  • 0

Quest npc shop


Quesooo

Question


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

good day rathena

 

please help me to change the shop on this npc

- players get only points ( not cash points )

- and players open the shop it show how many points he/she have and can be exchange for items thank you this is the script

 

//===== rAthena Script =======================================
//= sader quests
//===== By: ==================================================
//= Sader1992
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: ===================================== 
//= rAthena Project
//===== Description: =========================================
//=@reloadscript reset the quests but don't reset the time====
//============================================================
prt_in,89,102,4	script	Quest	667,{
		if(!.sader_quest){set .sader_quest,0;}
		.@time_needed = #s_timeq - gettimetick(2);
		if(.@time_needed > 0 && .sader_quest == 0) {
		mes "You can only do the quest once every 24 hours.";
		.@hours   = .@time_needed / 60 / 60;
		.@minutes = (.@time_needed % (60 * 60)) / 60;
		.@seconds = .@time_needed % 60;
		mes "Please come back in " + sprintf("%02d:%02d:%02d", .@hours, .@minutes, .@seconds) + " hours." ;
		next;
			switch(select(""+"shop"+":"+"close"+"")){
						Case 1: callsub Q_shop;
						Case 2: close;
					}
		close;
		}else if(.sader_quest == 1){
			mes "hi, how can i hep you ?";
			next;
			switch(select(""+"My Quest"+":"+"shop"+":"+"close"+"")){
						Case 1: callsub Q_easy;
						Case 2: callsub Q_shop;
						Case 3: close;
					}
		}else if(.sader_quest == 2){
			mes "hi, how can i hep you ?";
			next;
			switch(select(""+"My Quest"+":"+"shop"+":"+"close"+"")){
						Case 1: callsub Q_normal;
						Case 2: callsub Q_shop;
						Case 3: close;
					}
		}else if(.sader_quest == 3){
			mes "hi, how can i hep you ?";
			next;
			switch(select(""+"My Quest"+":"+"shop"+":"+"close"+"")){
						Case 1: callsub Q_hard;
						Case 2: callsub Q_shop;
						Case 3: close;
					}
		}else if(.sader_quest == 4){
			mes "hi, how can i hep you ?";
			next;
			switch(select(""+"My Quest"+":"+"shop"+":"+"close"+"")){
						Case 1: callsub Q_indeterminate;
						Case 2: callsub Q_shop;
						Case 3: close;
					}
		}else{
			mes "hello";
			mes "i will give you a task";
			mes "to kill some monsters";
			mes "can you help us ?";
			next;
					switch(select(""+"easy difficulty"+":"+"normal difficulty"+":"+"hard difficulty"+":"+"indeterminate difficulty"+":"+"shop"+":"+"close"+"")){
						Case 1: callsub Q_easy;
						Case 2: callsub Q_normal;
						Case 3: callsub Q_hard;
						Case 4: callsub Q_indeterminate;
						Case 5: callsub Q_shop;
						Case 6: close;
					}
		}
//============================================================
//=======================Easy Mode============================
//============================================================
Q_easy:
	setarray .easy,1275,1737; //Easy Mode Monsters ID
	setarray .easyc,50,75; //Easy Mode Mosters Count
	.size_easy = getarraysize( .easy );
	.size_easyc = getarraysize( .easyc );
	.@me = rand( .size_easy );
	.@ce = rand( .size_easyc );
	if(.sader_quest == 0){
		mes " plz kill "+ .easyc[.@ce] +" from " + strmobinfo( 1,.easy[.@me]) +".";
		.easymon = .easy[.@me];
		.easycmon = .easyc[.@ce];
		set .sader_quest,1;
		set monster_count,0;
		
		close;
	}else if(.sader_quest == 1){
		if(monster_count == 0){
			mes "you need to kill " + .easycmon + " from " + strmobinfo( 1,.easymon) +".";
			mes " ";
			mes "I'm counting on you.";
			next;
				switch(select(""+"Ok, I will do it!"+":"+"NO, I don't want this quest"+"")){
						Case 1: {
						mes "Thanks!";
						close;
						}
						Case 2: {
						mes "AS YOU WISH";
						set .sader_quest,0;
						set #s_timeq, gettimetick(2) + (24 * 60 *60);
						close;
						}
				}
		}else if(monster_count >= .easycmon){
			mes "Thank you for helping me .";
			//Prize Section for Easy Mode
			set #SdM_PQ,50;//point shop Easy Mode
			//Prize Section for Easy Mode
			set monster_count,0;
			set .sader_quest,0;
			set #s_timeq, gettimetick(2) + (24 * 60 *60);
		}else if(monster_count < .easycmon){
		mes "you have killed "+monster_count+" "+ strmobinfo( 1,.easymon) +".";
		close;
		}else{
			mes"There is an Error plz Check the script.";
			mes"This massage on the line 122";
			close;
		}
	}else{
		mes"There is an Error plz Check the script.";
		mes"This massage on the line 127";
		close;
	}
end;
//============================================================
//=====================Normal Mode============================
//============================================================
Q_normal:
	setarray .normal,1275,1737;//Normal Mode Monsters ID
	setarray .normalc,100,150;//Normal Mode Mosters Count((Random))
	.size_normal = getarraysize( .normal );
	.size_normalc = getarraysize( .normalc );
	.@mn = rand( .size_normal );
	.@cn = rand( .size_normalc );
	if(.sader_quest == 0){
		mes " plz kill "+ .normalc[.@cn] +" from " + strmobinfo( 1,.normal[.@mn]) +".";
		.normalmon = .normal[.@mn];
		.normalcmon = .normalc[.@cn];
		set .sader_quest,2;
		set monster_count,0;
		
		close;
	}else if(.sader_quest == 2){
		if(monster_count == 0){
			mes "you need to kill " + .normalcmon + " from " + strmobinfo( 1,.normalmon) +".";
			mes " ";
			mes "I'm counting on you.";
			next;
				switch(select(""+"Ok, I will do it!"+":"+"NO, I don't want this quest"+"")){
						Case 1: {
						mes "Thanks!";
						close;
						}
						Case 2: {
						mes "AS YOU WISH";
						set .sader_quest,0;
						set #s_timeq, gettimetick(2) + (24 * 60 *60);
						close;
						}
				}
		}else if(monster_count >= .normalcmon){
			mes "Thank you for helping me .";
			//Prize Section for Normal Mode
			set #SdM_PQ,100;//point shop Normal Mode
			//Prize Section for Normal Mode
			set monster_count,0;
			set .sader_quest,0;
			set #s_timeq, gettimetick(2) + (24 * 60 *60);
		}else if(monster_count < .normalcmon){
		mes "you have killed "+monster_count+" "+ strmobinfo( 1,.normalmon) +".";
		close;
		}else{
			mes"There is an Error plz Check the script.";
			mes"This massage on the line 179";
			close;
		}
	}else{
		mes"There is an Error plz Check the script.";
		mes"This massage on the line 184";
		close;
	}
end;
//============================================================
//=======================Hard Mode============================
//============================================================
Q_hard:
	setarray .hard,1735,1736;//Hard Mode Monsters ID
	setarray .hardc,75,100,150;// Hard Mode Mosters Count((Random))
	.size_hard = getarraysize( .hard );
	.size_hardc = getarraysize( .hardc );
	.@mh = rand( .size_hard );
	.@ch = rand( .size_hardc );
	if(.sader_quest == 0){
		mes " plz kill "+ .hardc[.@ch] +" from " + strmobinfo( 1,.hard[.@mh]) +".";
		.hardmon = .hard[.@mh];
		.hardcmon = .hardc[.@ch];
		set .sader_quest,3;
		set monster_count,0;
		
		close;
	}else if(.sader_quest == 3){
		if(monster_count == 0){
			mes "you need to kill " + .hardcmon + " from " + strmobinfo( 1,.hardmon) +".";
			mes " ";
			mes "I'm counting on you.";
			next;
				switch(select(""+"Ok, I will do it!"+":"+"NO, I don't want this quest"+"")){
						Case 1: {
						mes "Thanks!";
						close;
						}
						Case 2: {
						mes "AS YOU WISH";
						set .sader_quest,0;
						set #s_timeq, gettimetick(2) + (24 * 60 *60);
						close;
						}
				}
		}else if(monster_count >= .hardcmon){
			mes "Thank you for helping me .";
			//Prize Section for Hard Mode
			set #SdM_PQ,150;//point shop Hard Mode
			//Prize Section for Hard Mode
			set monster_count,0;
			set .sader_quest,0;
			set #s_timeq, gettimetick(2) + (24 * 60 *60);
		}else if(monster_count < .hardcmon){
		mes "you have killed "+monster_count+" "+ strmobinfo( 1,.hardmon) +".";
		close;
		}else{
			mes"There is an Error plz Check the script.";
			mes"This massage on the line 236";
			close;
		}
	}else{
		mes"There is an Error plz Check the script.";
		mes"This massage on the line 241";
		close;
	}
end;
//============================================================
//===================Indeterminate Mode=======================
//============================================================
Q_indeterminate:
	setarray .indeterminate,1735,1736;//Indeterminate Mode Monsters ID
	setarray .indeterminatec,250,300,350;// Indeterminate Mode Mosters Count((Random))
	.size_indeterminate = getarraysize( .indeterminate );
	.size_indeterminatec = getarraysize( .indeterminatec );	
	.@mi = rand( .size_indeterminate );
	.@ci = rand( .size_indeterminate );
	if(.sader_quest == 0){
		mes " plz kill "+ .indeterminatec[.@ci] +" from " + strmobinfo( 1,.indeterminate[.@mi]) +".";
		.indeterminatemon = .indeterminate[.@mi];
		.indeterminatecmon = .indeterminatec[.@ci];
		set .sader_quest,4;
		set monster_count,0;
		
		close;
	}else if(.sader_quest == 4){
		if(monster_count == 0){
			mes "you need to kill " + .indeterminatecmon + " from " + strmobinfo( 1,.indeterminatemon) +".";
			mes " ";
			mes "I'm counting on you.";
			next;
				switch(select(""+"Ok, I will do it!"+":"+"NO, I don't want this quest"+"")){
						Case 1: {
						mes "Thanks!";
						close;
						}
						Case 2: {
						mes "AS YOU WISH";
						set .sader_quest,0;
						set #s_timeq, gettimetick(2) + (24 * 60 *60);
						close;
						}
				}
		}else if(monster_count >= .indeterminatecmon){
			mes "Thank you for helping me .";
			//Prize Section for Indeterminate Mode
			set #SdM_PQ,200;//point shop Indeterminate Mode
			//Prize Section for Indeterminate Mode
			set monster_count,0;
			set .sader_quest,0;
			set #s_timeq, gettimetick(2) + (24 * 60 *60);
		}else if(monster_count < .indeterminatecmon){
		mes "you have killed "+monster_count+" "+ strmobinfo( 1,.indeterminatemon) +".";
		close;
		}else{
			mes"There is an Error plz Check the script.";
			mes"This massage on the line 293";
			close;
		}
	}else{
		mes"There is an Error plz Check the script.";
		mes"This massage on the line 298";
		close;
	}
end;
//============================================================
//=====================OnNPCKillEvent=========================
//============================================================
OnNPCKillEvent:
if(.sader_quest != 0){
	if( killedrid == .easymon ){
		if(monster_count < .easycmon){
			monster_count++;
			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,.easymon) +".";
		}else{
			dispbottom "Your quest is done";
			//you can add the Prize Section for Easy Mode here but you will also need to set the value here set monster_count,0; set .sader_quest,0;
			//Prize Section for Easy Mode without talkining to the npc
			//set .sader_quest,0;
			//set monster_count,0;
			//set #s_timeq, gettimetick(2) + (24 * 60 *60);
			//set #SdM_PQ,50;//point shop Easy Mode
			//dispbottom "You got points!";
		}
	}else if( killedrid == .normalmon ){
		if(monster_count < .normalcmon){
			monster_count++;
			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,.normalmon) +".";
		}else{
			dispbottom "Your quest is done";
			//see the line 313~318
		}
	}else if( killedrid == .hardmon ){
		if(monster_count < .hardcmon){
			monster_count++;
			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,.hardmon) +".";
		}else{
			dispbottom "Your quest is done";
			//see the line 313~318
		}
	}else if( killedrid == .indeterminatemon ){
		if(monster_count < .indeterminatecmon){
			monster_count++;
			dispbottom "You killed "+monster_count+" "+ strmobinfo( 1,.indeterminatemon) +".";
		}else{
			dispbottom "Your quest is done";
			//see the line 313~318
		}
	}
}
end;
//============================================================
//=========================NPC Shop===========================
//============================================================
Q_shop:
	callshop "sader q s",1;
end;
}
-	pointshop	sader q s	-1,#SdM_PQ,512:50,513:75; //set the items you need in your shop <monster_id>:<price>,<monster_id>:<price>,<monster_id>:<price>...


Credits to the owner of this script it works great

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1678
  • Reputation:   704
  • Joined:  12/21/14
  • Last Seen:  

I would first suggest that you download the v2.0 cuz it have a lot of fixes and more optimized
and it's already use custom points not cash points but the v.1.0 have alot of mistakes

 

Edited by sader1992
  • 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...