Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Help] NPC's

Newbie Spellweaver
Joined
Mar 16, 2007
Messages
7
Reaction score
0
Does anyone have a guide to setting NPC's to do certain things like compose items and teleport you to the training ground ect ect?
 
Newbie Spellweaver
Joined
Mar 18, 2007
Messages
5
Reaction score
0
YEAHH !! i need too !! =/ ..my NPC's dont say anything .. PLEASE HELP ! =)
 
Junior Spellweaver
Joined
Apr 24, 2006
Messages
173
Reaction score
2
Lol .
CoEmu is working hard on NPC's coding them,so you should wait,and not couple of weeks,these stuff take time ...
 
Newbie Spellweaver
Joined
Mar 18, 2007
Messages
5
Reaction score
0
ahh .. but .. just say were i find the codes =) please ^^
 
Last edited:
Joined
Apr 28, 2005
Messages
6,969
Reaction score
2,490
Well if you know C#, then you should be able to figure out how to work with this code.

Its the code for the Conductress to teleport you to the Market.

Code:
if (CLNPC == 10050) //Conductress 435,440
{
if (_NPCcontrol == 0)
{
CmdNPC.Face(01);
CmdNPC.Say("Where are you heading for? I can teleport you for a price");
CmdNPC.Say("of 100 silver.");
CmdNPC.Link("Market", 1);
CmdNPC.Link("Just passing by.", 255);
CmdNPC.Finish();
}
if (_NPCcontrol == 1)
{
if (_client.Char.Money > Convert.ToInt32(99))
{
int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 100);
_client.Char.Money = Teleport_Gold;

_client.SendData(PacketBuilder.CharacterInfo(_clie nt.Char));
byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
int x = 211; int y = 196; // Cordinates x & y
_char.CurrentLoc = new Location(x, y);
uint Teleport_Map = 1036; // Map
_char.Map = (World.Maps)Teleport_Map;
World.SpawnCharacter(_client);
}
else if (_client.Char.Money < Convert.ToInt32(100))
{
CmdNPC.Say("Sorry, you do not have 100 silver.");
CmdNPC.Link("I see.", 255);
CmdNPC.Finish();
}
}
}

To code the other NPCs, use this as an example and you should be able to get pretty far.
 
Newbie Spellweaver
Joined
Mar 18, 2007
Messages
5
Reaction score
0
thanks men =D
were i save the codes ? .. on c3/npc ?
 
Newbie Spellweaver
Joined
Feb 27, 2007
Messages
53
Reaction score
0
thanks men =D
were i save the codes ? .. on c3/npc ?
u should put it in ur NPCdialog.cs and then compile that file i believe
(NPCdialog.cs is located in COfullDB -> Instances)
 
Newbie Spellweaver
Joined
Mar 30, 2007
Messages
30
Reaction score
0
im sorry i know its not right to laugh but this is funny
 
Newbie Spellweaver
Joined
Apr 4, 2007
Messages
14
Reaction score
0
i wanna ask does there is possible just copy files from conquer gameand try to put it in server?
 
Junior Spellweaver
Joined
Jan 19, 2006
Messages
102
Reaction score
0
Traning ground :

Code:
                    if (CLNPC == 104797) //Boxer 351,334 
                    {                    //TrainingGround Map meeds to be added to World.cs, 1039
                        if (_NPCcontrol == 0)
                        {
                            CmdNPC.Say("If you are level 20 or above, you may train in the training");
                            CmdNPC.Say("ground. Would you like me to teleport you there for 1000");
                            CmdNPC.Say("silver.");
                            CmdNPC.Link("Yes, please.", 1);
                            CmdNPC.Link("No, thanks.", 255);
                            CmdNPC.Finish();
                        }

                        if (_NPCcontrol == 1)
                        {
                            CmdNPC.Say("In the training ground, you will not lose any HP or MP. And");
                            CmdNPC.Say("no items nor durability will be consumed.");
                            CmdNPC.Link("Please teleport me there.", 2);
                            CmdNPC.Link("No, I changed my mind", 255);
                            CmdNPC.Finish();
                        }
                        if (_NPCcontrol == 2)
                        {
                            if (_client.Char.Money > Convert.ToInt32(999))
                            {
                                int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 1000);
                                _client.Char.Money = Teleport_Gold;

                                _client.SendData(PacketBuilder.CharacterInfo(_client.Char));
                                byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
                                int x = 217; int y = 215; // Cordinates x & y
                                _char.CurrentLoc = new Location(x, y);
                                uint Teleport_Map = 1039; // Map
                                _char.Map = (World.Maps)Teleport_Map;
                                World.SpawnCharacter(_client);
                                CmdNPC.Say("The stake or scarecrow is level 20 or above. If its level");
                                CmdNPC.Say("is higher than yours, you cannot attack it.");
                                CmdNPC.Link("I see.", 255);
                                CmdNPC.Finish();
                            }
                            else if (_client.Char.Money < Convert.ToInt32(1000))
                            {
                                CmdNPC.Say("Sorry, you do not have 1000 silver.");
                                CmdNPC.Link("I see.", 255);
                                CmdNPC.Finish();
                            }

                        }
                    }

Twin City Teleporter :

Code:
                    else if (CLNPC == 10050)
                    {
                    	if (_NPCcontrol == 0)
                    	{
                    		CmdNPC.Face(12);
                    	    CmdNPC.Say("Where are you heading for? I can teleport you for a price");
                    		CmdNPC.Say("of 100 silver.");
                    		CmdNPC.Link("Phoenix Castle", 1);
                    		CmdNPC.Link("Desert City", 2);
                    		CmdNPC.Link("Ape Mountain", 3);
                    		CmdNPC.Link("Bird Island", 4);
                    		CmdNPC.Link("Mine Cave", 5);
                    		CmdNPC.Link("Market", 6);
                    		CmdNPC.Finish();
                    	}
                    	if (_NPCcontrol == 1)
                    	{
                    		if (_client.Char.Money > Convert.ToInt32(99))
                    		{
                    			int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 100);
                    			_client.Char.Money = Teleport_Gold;
                    			
                    			_client.SendData(PacketBuilder.CharacterInfo(_client.Char));
                    			byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
                    			int x = 958; int y = 555; // Cordinates x & y
                    			_char.CurrentLoc = new Location(x, y);
                    			uint Teleport_Map = 1002; // Map
                    			_char.Map = (World.Maps)Teleport_Map;
                    			World.SpawnCharacter(_client);
                    		}
                    		else if (_client.Char.Money < Convert.ToInt32(100))
                    		{
                    			CmdNPC.Say("Sorry, you do not have 100 silver.");
                    			CmdNPC.Link("I see.", 255);
                    			CmdNPC.Finish();
                    		}
                    	}
                    	if (_NPCcontrol == 2)
                    	{
                    		if (_client.Char.Money > Convert.ToInt32(99))
                    		{
                    			int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 100);
                    			_client.Char.Money = Teleport_Gold;
                    			
                    			_client.SendData(PacketBuilder.CharacterInfo(_client.Char));
                    			byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
                    			int x = 069; int y = 473; // Cordinates x & y
                    			_char.CurrentLoc = new Location(x, y);
                    			uint Teleport_Map = 1002; // Map
                    			_char.Map = (World.Maps)Teleport_Map;
                    			World.SpawnCharacter(_client);
                    		}
                    		else if (_client.Char.Money < Convert.ToInt32(100))
                    		{
                    			CmdNPC.Say("Sorry, you do not have 100 silver.");
                    			CmdNPC.Link("I see.", 255);
                    			CmdNPC.Finish();
                    		}
                    	}
                    	if (_NPCcontrol == 3)
                    	{
                    		if (_client.Char.Money > Convert.ToInt32(99))
                    		{
                    			int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 100);
                    			_client.Char.Money = Teleport_Gold;
                    			
                    			_client.SendData(PacketBuilder.CharacterInfo(_client.Char));
                    			byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
                    			int x = 555; int y = 957; // Cordinates x & y
                    			_char.CurrentLoc = new Location(x, y);
                    			uint Teleport_Map = 1002; // Map
                    			_char.Map = (World.Maps)Teleport_Map;
                    			World.SpawnCharacter(_client);
                    		}
                    		else if (_client.Char.Money < Convert.ToInt32(100))
                    		{
                    			CmdNPC.Say("Sorry, you do not have 100 silver.");
                    			CmdNPC.Link("I see.", 255);
                    			CmdNPC.Finish();
                    		}
                    	}
                    	if (_NPCcontrol == 4)
                    	{
                    		if (_client.Char.Money > Convert.ToInt32(99))
                    		{
                    			int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 100);
                    			_client.Char.Money = Teleport_Gold;
                    			
                    			_client.SendData(PacketBuilder.CharacterInfo(_client.Char));
                    			byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
                    			int x = 232; int y = 190; // Cordinates x & y
                    			_char.CurrentLoc = new Location(x, y);
                    			uint Teleport_Map = 1002; // Map
                    			_char.Map = (World.Maps)Teleport_Map;
                    			World.SpawnCharacter(_client);
                    		}
                    		else if (_client.Char.Money < Convert.ToInt32(100))
                    		{
                    			CmdNPC.Say("Sorry, you do not have 100 silver.");
                    			CmdNPC.Link("I see.", 255);
                    			CmdNPC.Finish();
                    		}
                    	}
                    	if (_NPCcontrol == 5)
                    	{
                    		if (_client.Char.Money > Convert.ToInt32(99))
                    		{
                    			int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 100);
                    			_client.Char.Money = Teleport_Gold;
                    			
                    			_client.SendData(PacketBuilder.CharacterInfo(_client.Char));
                    			byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
                    			int x = 053; int y = 399; // Cordinates x & y
                    			_char.CurrentLoc = new Location(x, y);
                    			uint Teleport_Map = 1002; // Map
                    			_char.Map = (World.Maps)Teleport_Map;
                    			World.SpawnCharacter(_client);
                    		}
                    		else if (_client.Char.Money < Convert.ToInt32(100))
                    		{
                    			CmdNPC.Say("Sorry, you do not have 100 silver.");
                    			CmdNPC.Link("I see.", 255);
                    			CmdNPC.Finish();
                    		}
                    	}
                    	if (_NPCcontrol == 6)
                    	{
                    		if (_client.Char.Money > Convert.ToInt32(99))
                    		{
                    			int Teleport_Gold = Convert.ToInt32(_client.Char.Money - 100);
                    			_client.Char.Money = Teleport_Gold;
                    			
                    			_client.SendData(PacketBuilder.CharacterInfo(_client.Char));
                    			byte[] SpawnData = PacketBuilder.SpawnEntity(_char);
                    			int x = 211; int y = 196; // Cordinates x & y
                    			_char.CurrentLoc = new Location(x, y);
                    			uint Teleport_Map = 1036; // Map
                    			_char.Map = (World.Maps)Teleport_Map;
                    			World.SpawnCharacter(_client);
                    		}
                    		else if (_client.Char.Money < Convert.ToInt32(100))
                    		{
                    			CmdNPC.Say("Sorry, you do not have 100 silver.");
                    			CmdNPC.Link("I see.", 255);
                    			CmdNPC.Finish();
                    		}
                    	}
                    }
 
Newbie Spellweaver
Joined
Apr 4, 2007
Messages
14
Reaction score
0
can any1 insert server backups with all these npc's plzzz
 
Junior Spellweaver
Joined
Jan 19, 2006
Messages
102
Reaction score
0
Its not in database its in server source
 
Back
Top