Dedicated NPC [v.3]

goddameit

New member
Messages
59
Points
0
Age
34
Emulator
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$
Code:
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

 

Attachments

Last edited by a moderator:
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!

 
Last edited by a moderator:
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.

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

Code:
*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";
 
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

 
how to fix this error.

Code:
[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)
 
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.

 
Last edited by a moderator:
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?

 
Last edited by a moderator:
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)

 
Last edited by a moderator:
wew, ive been thinking of this 4 years from now ago. thanks for this /no1

 
Last edited by a moderator:
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!
default_smile.png


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;
 




 
Last edited by a moderator:
Is there a way to add foodbuffs to this? I'm having a hard time with it. When I click on the npc it freezes me in place and does not add the food buffs.

 
Back
Top