I've been working at this for a bit and I'm at a loss as to why this wont work. I'm essentially trying to make an event NPC that will appear when I type in "/event on" and then disappear when I type "/event off". At the moment nothing will show up unless the type of NPC is a guild gate (I've tried like 5 or 6 different IDs), and it wont disappear if I type "/event off", however if I leave the area and come back the gate is gone. I'm assuming it has something to do with not storing anything in the DB or with not refreshing/spawning correctly. Any insight would be great:
Code:
if (Splitter[0] == "/event")
{
if (Splitter[1] == "on")
{
World.Event = true;
EventNPC = new SingleNPC(97979, 290, 2, 0, 447, 386, 1002, 0);
World.NPCSpawns(EventNPC);
foreach (DictionaryEntry DE in World.AllChars)
{
Character Chaar = (Character)DE.Value;
World.SendMsgToAll("The event NPC has been activated, find him and answer his questions for a reward!", "SYSTEM", 2011);
}
}
if (Splitter[1] == "off")
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Chaar = (Character)DE.Value;
World.SendMsgToAll("The event is over, hope everyone had fun!", "SYSTEM", 2011);
}
World.Event = false;
EventNPC.Map = 999;
EventNPC.X = 999;
EventNPC.Y = 999;
World.NPCSpawns(EventNPC);
}
}