Jump to content
  • 0

HIRE NPC


xienne15

Question


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

NPC that enables you to rent a Arch Bishop for certain hours

 

What does it do

+Follow you wherever you are.

+Buff you when the buff is already off.

+heal you when your HP is less than 70%

+Resurrect you when you died

 

If it is also possible it will make me and the arch bishop in party (if possible)

More like a Bot,since i dont know how to use a bot for 2013 clients. T_T

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/07/23
  • Last Seen:  

its not showing the hired npc i used an existing mob 1802 - High Priest Mob

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

NPC that enables you to rent a Arch Bishop for certain hours

 

What does it do

+Follow you wherever you are.

+Buff you when the buff is already off.

+heal you when your HP is less than 70%

+Resurrect you when you died

 

If it is also possible it will make me and the arch bishop in party (if possible)

 

I can do all but add it to party.

 

First add this NPC:

prontera,119,162,3	script	Hired Help	56,{
//Dialogue
	if(@hired){ mes .npcn$; mes "It Looks like you two are having fun. Well don't let me stop you- carry on!"; close; }
	mes .npcn$; mes "Hello, would you be interested in purchasing some of my lovely ladies?";
	mes "They buff you, heal you, and even revive you!!";
	mes "So what do you say, huh?"; next;
	if(select("Yes:No")&2) { mes .npcn$; mes "You're missing out!"; close; }
	mes .npcn$; mes "It's 1z per-second with these beautiful gals."; input(.@time);
	if(.@time>Zeny) { mes .npcn$; mes "You don't have enough. That's just too bad. Oh well better luck next time."; close; }
	close2;
//End

//Working parts
	set .@gid,bg_monster(.@bg,.npcm$,0,0,"Ellsie",.mobid,"Hired Help::OnFoobar");
	summon("[Hired Help] "+.hhnm$[rand(1,getarraysize(.hhnm$))],.mobid,.@time*1000,"Hired Help::OnBroken");
	set @hired,1; set Zeny,Zeny-.@time;
	killmonster .npcm$,"Hired Help::OnFoobar";
	set .@gid,.@gid+1; .@usrid=getcharid(3);
	query_sql("SELECT ROUND(("+MaxHp+"*"+((.hpat>9)?"0."+(.hpat/10):"0.0"+(.hpat))+"));",.@hp);
	while( set(.@i,.@i+1)&&playerattached()&&.@i<=.@time ) {
		set .@map$,strcharinfo(3); sleep2 1000;
		if(!((.@i%240)-1)) {//Example of mob used buff.
			while(.buffs[((set(.@i,.@i+2)-2)%240)]) {
				unitskilluseid .@gid,.buffs[((.@i%240)-2)],.buffs[(((.@i%240)+1)-2)],.@usrid;
				sleep2 2000;
			}
			sc_start 32,240000,10,.@gid; //Increase her speed so she can keep up with us.
		}
		if(!Hp) unitskilluseid .@gid,54,4,.@usrid;
		if(Hp<.@hp&&Hp) unitskilluseid .@gid,28,99,.@usrid;
	}
	killmonster .@map$,"Hired Help::OnBroken";
	set @hired,0;
	end;
//End

//NPC Variables
	OnInit:
		set .hpat, 70; //Heals the player when HP drops below this percent. You want this below 100 at all times.
		set .mobid,4000; //ID of your custom mob.
		set .npcn$,"[^0000FFGreg^000000]";
		set .npcm$,strnpcinfo(4);
		setarray .buffs[1], 29, 10, 34, 10; // Skill_id, Skill_lv, Etc.
		setarray .hhnm$[1], "Ellsie", "Jenny", "Ashley", "Meghan", "Wenndy", "Anna"; //Hired npc will be randomly named from these values.
}

 

To make it look like an ArchBishop:

Second Create a new Monster: (It will be the place holder for your ArchBishop)

'4000', 'MOB', 'MOB', 'MOB', '255', '0', '0', '0', '0', '1', '0', '0', '99', '99', '255', '255', '255', '255', '255', '255', '10', '12', '1', '2', '62', '1', '120', '320', '2040', '336', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'

Some values I used for my sql mob_db.

 

Third Open mob_avail.txt in your db folder and at the end add:

4000,4063

Where 4000 is the id of the mob you just created.

 

Last:

Enjoy!

 

P.S: Make sure to replace all instances of 4000 with your custom mob id.

 

Prototype:

	while( .@i++ ) {
		sleep2 100;
		getmapxy(.@map1$,.@x1,.@y1,0);
		if(sqrt(pow(.@x1-.@tmpx,2 )+pow(.@y1-.@tmpy,2 ) )){ unitwalk .@gid,.@tmpx,.@tmpy; .@lstx=.@tmpx; .@lsty=.@tmpy;}
		else unitwalk .@gid,.@lstx,.@lsty;
		if(!(.@i%5)){ .@tmpm$=.@map1$;.@tmpx=.@x1;.@tmpy=.@y1; }
		if(!Hp) unitskilluseid .@gid,54,4,getcharid(3);
		if(Hp<MaxHp&&Hp) unitskilluseid .@gid,28,99,getcharid(3);
		if(.@map1$!=.@map$) {
			.@map$=strcharinfo(3);
			unitwarp .@gid,.@map1$,.@x1,.@y1;
		}
	}
Edited by Skorm
  • Upvote 1
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:  

or this?

prontera,160,160,2	script	Arch Bishop	1002,{
function giveBuff;

	if ( .is_renting ) end;
	if ( select( "Rent", "Leave" ) -1 ) end;

	.is_renting = getcharid(3);
	.name_isrenting$ = strcharinfo(0);
	addtimer ( .rent_time * 1000 ), strnpcinfo(3) +"::OnPCLogoutEvent";
	doevent strnpcinfo(3) +"::OnStart";
	npctalk "I will follow you for "+ .rent_time +" secs.";
	end;
function giveBuff {
	.@name$ = getarg( 0,.name_isrenting$ );
	.@account_id = getarg( 1,.is_renting );
	if ( readparam( 5,.@name$ ) *100 < 70 * readparam( 6,.@name$ ) )
		recovery 0, .@account_id;
	for ( .@i = 0; .@i < .size_effects; .@i++ )
		if ( getstatus( .effects[.@i] ) == 0 )// on player attached status
			sc_start .effects[.@i], 60000,10,100,15,.@account_id;
}
OnStart:
	while ( .is_renting ) {
		if ( getcharid(1) ) {
			.@party_id = getcharid(1);
			getpartymember .@party_id;
			getpartymember .@party_id,1;
			getpartymember .@party_id,2;
			for ( .@i = 0; .@i < $@partymembercount; .@i++ )
				if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
					giveBuff(  $@partymembername$[.@i], $@partymemberaid[.@i] );
		}
		else
			giveBuff;
		for ( .@i = 0; .@i < 3; .@i++ ) {
			if ( !.is_renting ) break;
			getmapxy .@map$, .@x, .@y, 0;
			getmapxy .@map_npc$, .@x_npc, .@y_npc, 1;
			if ( .@map$ != .@map_npc$ || distance( .@x, .@y, .@x_npc, .@y_npc ) > 10 )
				unitwarp .npc_id, .@map$, .@x, .@y;
			else if ( distance( .@x, .@y, .@x_npc, .@y_npc ) > 5 ) {
				.@x = .@x + rand(3);
				.@y = .@y + rand(3);
				npcwalkto .@x, .@y;
			}
			sleep2 1000;
		}
	}
	npctalk "Goodbye~.";
	unitwarp .npc_id, .map_npc$, .x_npc, .y_npc;
	end;
OnPCLogoutEvent:
	if ( getcharid(3) == .is_renting ) {
		.name_isrenting$ = "";
		.is_renting = 0;
	}
	end;
OnInit:
// settings
	setarray .effects, SC_BLESSING, SC_INCREASEAGI;	// sc effect in const.txt
	.rent_time = 3600;	// in secs
//
	.size_effects = getarraysize( .effects );
	getmapxy .map_npc$, .x_npc, .y_npc, 1;
	.npc_id = getnpcid(0);
	npcspeed 50;
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

To the first script why if the master dies the summoned helper also dies, thus not able to resurrect me.

 

 

To the second script it has error on line 17

		recovery 0, .@account_id;

parse line ";" thingy and i dont know what to do.

 

 

 

Is it possible that the summoned monster will not die at all when master died?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

prontera,119,162,3	script	Hired Help	56,{
//Dialogue
	if(@hired){ mes .npcn$; mes "It Looks like you two are having fun. Well don't let me stop you- carry on!"; close; }
	mes .npcn$; mes "Hello, would you be interested in purchasing some of my lovely ladies?";
	mes "They buff you, heal you, and even revive you!!";
	mes "So what do you say, huh?"; next;
	if(select("Yes:No")&2) { mes .npcn$; mes "You're missing out!"; close; }
	mes .npcn$; mes "It's 1z per-second with these beautiful gals."; input(.@time);
	if(.@time>Zeny||.@time<=0) { mes .npcn$; mes "You don't have enough. That's just too bad. Oh well better luck next time."; close; }
	close2;
//End

//Working parts
	set .@gid,bg_monster(.@bgid,.npcm$,.npcx,.npcy,"[Hired Help] "+.hhnm$[rand(1,getarraysize(.hhnm$))],.mobid,"Hired Help::OnBroken");
	set @hired,1; set Zeny,Zeny-.@time;
	set .@usrid, getcharid(3);
	set .@map$,strcharinfo(3);
	while( set(.@i,.@i+1)&&playerattached()&&.@i<=.@time*20 ) {
		sleep2 1;
		if(!playerattached()) break;
		if((.@i%(.btym*20))==1) {
			while(.buffs[((set(.@i,.@i+2)-2)%(.btym*20))]) {
				unitskilluseid .@gid,.buffs[((.@i%(.btym*20))-2)],.buffs[(((.@i%(.btym*20))+1)-2)],.@usrid;
				sleep2 1000;
			}
			sc_start 32,240000,10,.@gid;
		}
		getmapxy(.@map1$,.@x1,.@y1,0);
		set .@dis, sqrt(pow(.@x1-.@tmpx,2 )+pow(.@y1-.@tmpy,2 ) );
		if(.@dis&&.@dis<.wlkd){ unitwalk .@gid,.@tmpx,.@tmpy; .@lstx=.@tmpx; .@lsty=.@tmpy;}
		else if(.@dis>=.wlkd) unitwarp .@gid,.@map1$,.@x1,.@y1;
		else unitwalk .@gid,.@lstx,.@lsty;
		if(!(.@i%5)){ .@tmpm$=.@map1$;.@tmpx=.@x1;.@tmpy=.@y1; }
		if(.@map1$!=.@map$) {
			set .@map$, strcharinfo(3);
			unitwarp .@gid,.@map1$,.@x1,.@y1;
		}
		if(!Hp) unitskilluseid .@gid,54,4,.@usrid;
		if(Hp*100<MaxHp*.hpat) unitskilluseid .@gid,28,99,.@usrid;
	}
	killmonster .@map1$,"Hired Help::OnBroken";
	if(playerattached()) set @hired,0;
	end;
//End

OnBroken:
	end;

//NPC Variables
	OnInit:
		set .hpat, 70; //Heals the player when HP drops below this percent. You want this below 100 at all times.
		set .mobid,4000; //ID of your custom mob.
		set .btym, 240; //Rebuff in seconds.
		set .wlkd, 6; //Character speed before mobs warps to him.
		set .npcn$,"[^0000FFGreg^000000]";
		getmapxy( .npcm$,.npcx,.npcy,1 );
		setarray .buffs[1], 29, 10, 34, 10; // Skill_id, Skill_lv, Etc.
		setarray .hhnm$[1], "Ellsie", "Jenny", "Ashley", "Meghan", "Wenndy", "Anna"; //Hired npc will be randomly named from these values.
}

 

 

The only thing now is that each hired Arch Bishop is an independent monster. Meaning it can be attacked by players... including yourself. You can add healing skills to the monster in your mobskill_db2 and give it really high HP making make it extremely hard to kill, but ultimately without the proper commands I'm unable to return valid information in the safe keeping of the monster, and making it full out invincible doesn't work either because then not even the NPC that summoned it can kill it.

 

Mercenary Based:

prontera,119,162,3	script	Hired Help	56,{
//Dialogue
	if(hired){ mes .npcn$; mes "It Looks like you two are having fun. Well don't let me stop you- carry on!"; close; }
	mes .npcn$; mes "Hello, would you be interested in purchasing some of my lovely ladies?";
	mes "They buff you, heal you, and even revive you!!";
	mes "So what do you say, huh?"; next;
	if(select("Yes:No")&2) { mes .npcn$; mes "You're missing out!"; close; }
	mes .npcn$; mes "It's 1z per-second with these beautiful gals."; input(.@time);
	if(.@time>Zeny||.@time<=0) { mes .npcn$; mes "You don't have enough. That's just too bad. Oh well better luck next time."; close; }
	set hired,1; set Zeny,Zeny-.@time;
	close2;
//End

mercenary_create .mobid,.@time*1000;
sleep2 1000;

//Working parts
Start:
	set .@gid,bg_monster(.@bg,.npcm$,0,0,"Ellsie",.mobid,"Hired Help::OnFoobar");
	killmonster .npcm$,"Hired Help::OnFoobar";
	set .@gid,.@gid-1; .@usrid=getcharid(3);
	while( set(.@i,.@i+1)&&playerattached() ) {
		set .@map$,strcharinfo(3); sleep2 1000;
		if(!((.@i%240)-1)) {//Example of mob used buff.
			while(.buffs[((set(.@i,.@i+2)-2)%240)]) {
				unitskilluseid .@gid,.buffs[((.@i%240)-2)],.buffs[(((.@i%240)+1)-2)],.@usrid;
				sleep2 2000;
			}
			sc_start 32,240000,10,.@gid; //Increase her speed so she can keep up with us.
		}
		if(!Hp) unitskilluseid .@gid,54,4,.@usrid;
		if(Hp*100<MaxHp*.hpat) unitskilluseid .@gid,28,99,.@usrid;
		if(!(.@i%5)) mercenary_heal 100,100;
		if(!getmercinfo(0)){ set hired,0; break; }
	}
	end;
//End

OnPCLoginEvent:
	sleep2 1000;
	if(hired&&getmercinfo(0)) goto Start;
	else set hired,0;
	end;

//NPC Variables
	OnInit:
		set .hpat , 70; //Heals the player when HP drops below this percent. You want this below 100 at all times.
		set .mobid, 4000; //ID of your custom mob.
		set .npcn$, "[^0000FFGreg^000000]";
		set .npcm$, strnpcinfo(4);
		setarray .buffs[1], 29, 10, 34, 10; // Skill_id, Skill_lv, Etc.
		setarray .hhnm$[1], "Ellsie", "Jenny", "Ashley", "Meghan", "Wenndy", "Anna"; //Hired npc will be randomly named from these values.
}

 

Edited by Skorm
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

prontera,119,162,3	script	Hired Help	56,{
//Dialogue
	if(@hired){ mes .npcn$; mes "It Looks like you two are having fun. Well don't let me stop you- carry on!"; close; }
	mes .npcn$; mes "Hello, would you be interested in purchasing some of my lovely ladies?";
	mes "They buff you, heal you, and even revive you!!";
	mes "So what do you say, huh?"; next;
	if(select("Yes:No")&2) { mes .npcn$; mes "You're missing out!"; close; }
	mes .npcn$; mes "It's 1z per-second with these beautiful gals."; input(.@time);
	if(.@time>Zeny||.@time<=0) { mes .npcn$; mes "You don't have enough. That's just too bad. Oh well better luck next time."; close; }
	close2;
//End

//Working parts
	set .@gid,bg_monster(.@bgid,.npcm$,.npcx,.npcy,"[Hired Help] "+.hhnm$[rand(1,getarraysize(.hhnm$))],.mobid,"Hired Help::OnBroken");
	set @hired,1; set Zeny,Zeny-.@time;
	set .@usrid, getcharid(3);
	set .@map$,strcharinfo(3);
	while( set(.@i,.@i+1)&&playerattached()&&.@i<=.@time*20 ) {
		sleep2 1;
		if(!playerattached()) break;
		if((.@i%(.btym*20))==1) {
			while(.buffs[((set(.@i,.@i+2)-2)%(.btym*20))]) {
				unitskilluseid .@gid,.buffs[((.@i%(.btym*20))-2)],.buffs[(((.@i%(.btym*20))+1)-2)],.@usrid;
				sleep2 1000;
			}
			sc_start 32,240000,10,.@gid;
		}
		getmapxy(.@map1$,.@x1,.@y1,0);
		set .@dis, sqrt(pow(.@x1-.@tmpx,2 )+pow(.@y1-.@tmpy,2 ) );
		if(.@dis&&.@dis<.wlkd){ unitwalk .@gid,.@tmpx,.@tmpy; .@lstx=.@tmpx; .@lsty=.@tmpy;}
		else if(.@dis>=.wlkd) unitwarp .@gid,.@map1$,.@x1,.@y1;
		else unitwalk .@gid,.@lstx,.@lsty;
		if(!(.@i%5)){ .@tmpm$=.@map1$;.@tmpx=.@x1;.@tmpy=.@y1; }
		if(.@map1$!=.@map$) {
			set .@map$, strcharinfo(3);
			unitwarp .@gid,.@map1$,.@x1,.@y1;
		}
		if(!Hp) unitskilluseid .@gid,54,4,.@usrid;
		if(Hp*100<MaxHp*.hpat) unitskilluseid .@gid,28,99,.@usrid;
	}
	killmonster .@map1$,"Hired Help::OnBroken";
	if(playerattached()) set @hired,0;
	end;
//End

OnBroken:
	end;

//NPC Variables
	OnInit:
		set .hpat, 70; //Heals the player when HP drops below this percent. You want this below 100 at all times.
		set .mobid,4000; //ID of your custom mob.
		set .btym, 240; //Rebuff in seconds.
		set .wlkd, 6; //Character speed before mobs warps to him.
		set .npcn$,"[^0000FFGreg^000000]";
		getmapxy( .npcm$,.npcx,.npcy,1 );
		setarray .buffs[1], 29, 10, 34, 10; // Skill_id, Skill_lv, Etc.
		setarray .hhnm$[1], "Ellsie", "Jenny", "Ashley", "Meghan", "Wenndy", "Anna"; //Hired npc will be randomly named from these values.
}

 

 

The only thing now is that each hired Arch Bishop is an independent monster. Meaning it can be attacked by players... including yourself. You can add healing skills to the monster in your mobskill_db2 and give it really high HP making make it extremely hard to kill, but ultimately without the proper commands I'm unable to return valid information in the safe keeping of the monster, and making it full out invincible doesn't work either because then not even the NPC that summoned it can kill it.

 

Super thanks~! i will make this for npc, but i made a script too using callfunc when item is used.

I just want to add the resurrection when master dies and limit the resurrection 3x per hour, if greater than 3 revive dispbottom will say You can only be revived 3x per hour.

 

i havemy skills for this mob on my mobskill_db

 

//Pony callfunc
function	script	ponysupport	{
	if ( mobcount( strcharinfo(3), strnpcinfo(0) +"::On"+ getcharid(0) ) ) {
        dispbottom "You cannot Hire another Support Pony";
        close;
    	}
	mes "[Pony Contract]";
	mes "What type do you want for your Pony?";
	menu "Male",-,"Female",pfemale;

	mes "[Pony Contract]";
	mes "I will be calling him now from the Church.";
	next;
	mes "[Pony Contract]";
	mes "He will be here in 10 seconds,just wait for him.";
	next;
	mes "[Pony Contract]";
	mes "Goodbye~";
	close2;
	sleep2 5000;
	specialeffect2 897;
	sleep2 5000;
	summon "Apple Jack",2502,30000, strnpcinfo(0) +"::On"+ getcharid(0);
	specialeffect2 41;
	sleep2 1000;
	dispbottom "Apple Jack: Hello my son~!, Let's go!~";
	end;

pfemale:

	mes "[Pony Contract]";
	mes "I will be calling her now from the Church.";
	next;
	mes "[Pony Contract]";
	mes "She will be here in 10 seconds,just wait for her.";
	next;
	mes "[Pony Contract]";
	mes "Goodbye~";
	close2;
	sleep2 5000;
	specialeffect2 897;
	sleep2 5000;
	summon "Apple Bloom",2501,30000, strnpcinfo(0) +"::On"+ getcharid(0);
	specialeffect2 41;
	sleep2 1000;
	dispbottom "Apple Bloom: Hello dear~!, Let's go!~";
	end;
}

 

 

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