Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 11:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help] Spawning NPC Via Command.

Discussion on [Help] Spawning NPC Via Command. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2008
Posts: 15
Received Thanks: 1
[Help] Spawning NPC Via Command.

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);
             }
                                            
}
yoshmoma is offline  
Old 08/24/2009, 04:44   #2
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
I gotta give you props about the idea it is pretty custom
hunterman01 is offline  
Old 08/24/2009, 04:59   #3
 
elite*gold: 0
Join Date: Feb 2008
Posts: 15
Received Thanks: 1
Quote:
Originally Posted by hunterman01 View Post
I gotta give you props about the idea it is pretty custom
Yeah I intend to put a random number generator in there and pick like 10 map spots so it spawns randomly. But sadly I can't get it to spawn/disappear properly.
yoshmoma is offline  
Old 08/24/2009, 05:06   #4
 
raidenx123's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 1,705
Received Thanks: 441
Im not a coder, but dont you need a packet to update the NPCSpawn
raidenx123 is offline  
Old 08/24/2009, 05:16   #5
 
elite*gold: 0
Join Date: Nov 2006
Posts: 160
Received Thanks: 15
lol emme released something to activate a npc but this npc wont spawn right away you most liekyl either have to restart or like send a few packets like raiden said
rubenz is offline  
Old 08/24/2009, 05:19   #6
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
You have to send the Npc Spawn Packet.
kinshi88 is offline  
Old 08/24/2009, 05:21   #7
 
raidenx123's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 1,705
Received Thanks: 441
so i was right
raidenx123 is offline  
Old 08/24/2009, 05:32   #8
 
elite*gold: 0
Join Date: Feb 2008
Posts: 15
Received Thanks: 1
So instead of:
Code:
World.NPCSpawns(EventNPC);
I should be using:
Code:
General.MyPackets.SpawnNPC(EventNPC)
Correct?

Edit: Obviously not, gates wont even show up now lol xD. Am I forgetting a packet?
yoshmoma is offline  
Old 08/25/2009, 19:53   #9
 
elite*gold: 0
Join Date: Feb 2008
Posts: 15
Received Thanks: 1
I'm still having troubles with this and would really like some insight into which packets I should be sending other than:
Code:
General.MyPackets.SpawnNPC(EventNPC);
yoshmoma is offline  
Old 08/25/2009, 20:22   #10
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
I just send the Spawn Npc Packet (ID 2030)

And the Npc appeared.
Seems pretty simple. =P
kinshi88 is offline  
Old 08/26/2009, 20:20   #11
 
elite*gold: 0
Join Date: Feb 2008
Posts: 15
Received Thanks: 1
Quote:
Originally Posted by kinshi88 View Post
I just send the Spawn Npc Packet (ID 2030)

And the Npc appeared.
Seems pretty simple. =P
Yeah I got that working fine now, but my current problem is it disappears if I leave the area. Or if I'm not in it to begin with. Say I spawn the npc, leave the screen just so that npc isn't in it anymore, then walk back and it's gone. If I'm not in the screen when it spawns it looks like it never spawned. Any ideas on how to fix this?
yoshmoma is offline  
Reply


Similar Threads Similar Threads
Mob Spawning
01/02/2016 - Cabal Private Server - 5 Replies
Hello communty, Can one tell me how I can create in the game mobs. wenns goes with the id's Thanks in advance than in! MFG: <ZeroCool> GERMAN: Hallo kann mir vielleicht einer sagen wie ich im game mob spawne? und hat vielleicht jemand die idīs Danke als im vorraus."!"
[HELP]Spawning a NPC
05/24/2010 - CO2 Private Server - 3 Replies
Hey guys I was wondering if you can help me to spawn a single NPC like this... I'm using LOTF 5017... I'm trying to add Blue Mouse Quest and spawn the Blue Mouses.... What I know: Spawn the mob(s) at a certain time after click. What I don't know:
Need Spawning
12/19/2009 - Dekaron - 13 Replies
Hi Guys I Need Spawning Code :confused:
Monster Spawning
07/19/2009 - CO2 Private Server - 13 Replies
Could someone give me the command to spawn a monster?
Db spawning????
03/17/2008 - Conquer Online 2 - 2 Replies
Hi! I have 117 archer on eagle server, and i want to know , when the db spawns and what places ( min maks, thunder apes, sand elfs etc.) When is the server maintenances and how many hours i need to wait for db spawn on the right place:) Waiting for replies. Thank you.



All times are GMT +1. The time now is 11:29.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.