Invoking an NPC

NekoNova

New member
Messages
5
Points
0
Hello,

I'm currently looking for an elegant solution to the following problem:

Take any NPC on the server. You want to "upgrade" that NPC by giving him a special dialog during a quest, but retain all his other functionality.

At the moment we duplicate the NPC's source script into our custom folder and make all changes there, then disable the original one and load ours.

I was wondering, is it possible to make a new NPC, and invoke the code from another NPC?

I know you have doevent etc, but that only invokes a specific label, I want to be able for example to invoke the complete logic from the refine NPC in a if-else statement based on whether the user is on the quest or not.

 
Hello!

I'm sorry to say it isn't possible as of now since server just reads and parses the contents on the .txt file, no more.

It could be possible with some server-side modifications.

 
Okay,

Thanks for the reply.

Will look into the source code then to see if we can't enable such a command on our side.

 
Make a function , example named "xyz", put the codes there, (pass 1 var with func so that func. Can identify which npc invoked it) and let it do the work, you only need to put callfunc on every script.

limitation:

* It cannot delete any message or functions

*cannot edit messages by npc

* cannot remove original functionality.

 
@datsjir

how bout resseting npc ? or variablenpc ? 

cuz im having a little problem with the script i found back from 2011 it doesnt reset the whole script example in BG it reset all npcvariable.
on 2011script it doesnt and u need to reloadscript just to work again with that npc 
default_tongue.png


 
If the condition depends on whether or not the invoking player is on a quest, why not structure your script logic around checks for a permanent character or account variable?

 
Last edited by a moderator:
This might be kinda sloppy because I'm on mobile, but here's an example:

switch (quest_variable) { case 1: // first stage break; case 2: // second stage break; case 3: // third stage break; default: // not on quest break;}
sorryfordoubleposting(:

 
Back
Top