Jump to content
goddameit

Dedicated NPC [v.3]

Recommended Posts

Preview :

 

http://bit.ly/Z0ECZx

 

Introduction :

 

You can hire this npc, it will follow you and give you buff.

 

Download :

 

dedicated_npc_3.txt

 

More NPC :

 

First add new npc like this:

,,,duplicate(DedicatedNPCMain)
Add new name define into .npc_name$
setarray .npc_name$[0],"Dedicated Poring AAA","Dedicated Poring BBB","Dedicated Poring CCC";
Time Set :

 

60 seconds

set getvariableofnpc(.npc_time[@id_use],"DedicatedNPCTimer"),gettimetick(2)+60;
Update :

 

2014/02/27 : http://herc.ws/board/topic/4107-dedicated-npc-v2/?p=27298

 

http://rathena.org/board/topic/74607-dedicated-npc-v2/?p=244414

 

2014/01/24 : Rewrite timer and npc runner.

 

Edit :

 

No repairall? >> reply

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

Hi.

 

It seems I can't download the NPC for giving it a peek. Could you please solve it?

 

Thanks!

 

Edit: What? Now I go back to the topic and it works? Witchcraft!

 

I'll give it a peek right now. Thanks!

Edited by jaBote

Share this post


Link to post
Share on other sites

Great use of unit related commands. The only problem I can see is that there is a limited number of 'servants', maybe using the mercenary system to replace the npc as servant... Or even using a mob as servant, one mob = one npc instance to control it, and then use whisper commands to get buffs and such.

Share this post


Link to post
Share on other sites

No there isn't, sleep2 is an actual function:

*sleep {<milliseconds>};*sleep2 {<milliseconds>};*awake "<NPC name>";These commands are used to control the pause of a NPC.sleep and sleep2 will pause the script for the given amount of milliseconds.Awake is used to cancel a sleep. When awake is called on a NPC it will run as if the sleep timer ran out, and thus making the script continue. Sleep and sleep2 basically do the same, but the main difference is that sleep will not keep the rid, while sleep2 does.Examples:	// This will pause the script for 10 seconds and ditch the RID 	// (so no player is attached anymore)	sleep 10000; 	// Pauses the script for 5 seconds, and continue with the RID attached.	sleep2 5000; 	//Cancels any running sleep timers on the NPC 'NPC'.	awake "NPC"; 

Share this post


Link to post
Share on other sites

Great use of unit related commands. The only problem I can see is that there is a limited number of 'servants', maybe using the mercenary system to replace the npc as servant... Or even using a mob as servant, one mob = one npc instance to control it, and then use whisper commands to get buffs and such.

modify core will be more easy, but I don't want to and need "click for some service", that's why I use npc

Share this post


Link to post
Share on other sites

how to fix this error.

 

[Error]: script_add_str: detected possible use of wrong case in a script. Found'hp', probably meant to be 'Hp' (in 'npccustomAleconROdedicated_npc_2.txt').[Error]: script_add_str: detected possible use of wrong case in a script. Found'maxhp', probably meant to be 'MaxHp' (in 'npccustomAleconROdedicated_npc_2.txt').[Error]: script:op_2num: division by zero detected op=C_DIV i1=0 i2=0[Debug]: Source (NPC): DedicatedNPCTimer (invisible/not on a map)

Share this post


Link to post
Share on other sites

Solve the first two instances of the error first:

 

[Error]: script_add_str: detected possible use of wrong case in a script. Found
'hp', probably meant to be 'Hp' (in 'npccustomAleconROdedicated_npc_2.txt').
[Error]: script_add_str: detected possible use of wrong case in a script. Found
'maxhp', probably meant to be 'MaxHp' (in 'npccustomAleconROdedicated_npc_2.t
xt'
).

 

Then try to see if that 0/0 error is gone.

Share this post


Link to post
Share on other sites

Script loads with this error:

[Error]: script:op_2num: division by zero detected op=C_DIV i1=0 i2=0[Debug]: Source (NPC): DedicatedNPCTimer (invisible/not on a map)

How  to fix this error?

Edited by schan

Share this post


Link to post
Share on other sites

Script loads with this error:

[Error]: script:op_2num: division by zero detected op=C_DIV i1=0 i2=0[Debug]: Source (NPC): DedicatedNPCTimer (invisible/not on a map)

How  to fix this error?

find

if(maxhp/hp>=4)

chage to

if(MaxHp/4>=Hp)

Edited by Angelmelody

Share this post


Link to post
Share on other sites

EDIT: I was somehow able to make it work by separating the script into two file, one for healer and one for buffer. Again, thanks for the great script! :)

I really like your work sir but I think you can make it better. I noticed that when using the heal functionality the npc stops following the character after death and becomes stuck to its last position even if you dismiss it. And even if npc is dismissed, you also still can't hire a new clone since it too seem stuck. Below are some of my observations....

 

if(MaxHp/Hp>=2)
{
percentheal 10,0;
specialeffect2 312;
}
 
 
 
set getvariableofnpc(.npc_hprecover[@id_use],"DedicatedNPCTimer"),2;  ----> Why must this be set higher than hprecover_delay? Setting it to too high or same as hprecover_delay causes the same error.
 
 

//NPC follows and respawns successfully but no heal

if(.npc_hprecover[.@i]>=.hprecover_delay)
.hprecover_delay = 1;
.npc_hprecover[.@i] = 0;
 
 

//NPC heals but stops following after you die and stuck after dismiss

if(.npc_hprecover[.@i]>=.hprecover_delay)
.hprecover_delay = 1; 
.npc_hprecover[.@i] = 1 or more;
 
Edited by iskoy.flores

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.