So ive seen alot of you wanted this, well here it is, coded this in about 4minutes total and never tested it,so you will probably be the first one.
So, all you actually do is to make the server check if xxx is activated, if it is, it shows the real npc chat, if it isnt, it tells you that it isnt. And you activate/unactivate the xxx with a command. Well here you are:
In General.cs , under : public static System.Timers.Timer Thetimer;
Search for : if (Splitter[0] == "/ServerRestart")
Above that , add:
This is how the command works:
If you type /startnpc , it will check if the npc is activated. If the npc(s) is activated, they will be un activated, and vice versa. Also it announce the status of the npc.
And this is an example of how to NPC code work:
Search for : if (CurrentNPC == 12)
Until you get to the NPC TALK
Above, add this:
Now that is an example how it could look like.
Hope it gave you any ideas or/and knowledge. Atleast I hope I helped someone.
Emme
So, all you actually do is to make the server check if xxx is activated, if it is, it shows the real npc chat, if it isnt, it tells you that it isnt. And you activate/unactivate the xxx with a command. Well here you are:
In General.cs , under : public static System.Timers.Timer Thetimer;
Code:
public static bool CanTalkToNPC = false;
Search for : if (Splitter[0] == "/ServerRestart")
Above that , add:
Code:
if (Splitter[0] == "/startnpc")
{
string K = "";
if (General.CanTalkToNPC)
{
K = "un-activated!";
General.CanTalkToNPC = false;
}
if (!General.CanTalkToNPC)
{
K = "activated!";
General.CanTalkToNPC = true;
}
World.SendMsgToAll("The xxxx NPC has been " + K, "NPCHandeler", 2005);
}
If you type /startnpc , it will check if the npc is activated. If the npc(s) is activated, they will be un activated, and vice versa. Also it announce the status of the npc.
And this is an example of how to NPC code work:
Search for : if (CurrentNPC == 12)
Until you get to the NPC TALK
Above, add this:
Code:
if (CurrentNPC == 1339)
{
if (!General.CanTalkToNPC)
{
SendPacket(General.MyPackets.NPCSay("This NPC is not started yet. Please wait for an announcment!"));
SendPacket(General.MyPackets.NPCLink("Okay.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else
{
SendPacket(General.MyPackets.NPCSay("Hello there! Want me to teleport you to xxxx?"));
SendPacket(General.MyPackets.NPCLink("Sure", 1));
SendPacket(General.MyPackets.NPCLink("Just passing by..", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
Hope it gave you any ideas or/and knowledge. Atleast I hope I helped someone.
Emme