Register for your free account! | Forgot your password?

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

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

Advertisement



[Question] 5375 Teleporting Npc

Discussion on [Question] 5375 Teleporting Npc within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
[Question] 5375 Teleporting Npc

I have a question. I want to know if anyone can (maybe) give me a tip/hint/piece of code as in how to make an NPC teleport to random coords. once you click on an option of the npc.

I have no idea as in how to do this since I just came back from a very long trip and I'm exhausted.

I saw that Elite-Co has something VERY similar to this but I have NO idea on how to convert it.

any help would be very much appreciated
killersub is offline  
Old 06/05/2011, 02:52   #2
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
THIS IS JUST AN EXAMPLE!

Code:
case [COLOR="Red"]YOUR NPC ID[/COLOR]:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("[COLOR="Red"]I can teleport you to TC (might be wrong coords)[/COLOR]");
                                    dialog.Link("[COLOR="#ff0000"]Go ahead.[/COLOR]", 1);
                                    dialog.Link("[COLOR="#ff0000"]No thanks.[/COLOR]", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.[COLOR="#ff0000"]ConquerPoints[/COLOR] >= [COLOR="#ff0000"]1[/COLOR])
                                    {
                                        client.Entity.[COLOR="#ff0000"]ConquerPoints[/COLOR] -= [COLOR="#ff0000"]1[/COLOR];
                                        client.Entity.Teleport([COLOR="#ff0000"]1002[/COLOR], [COLOR="#ff0000"]300[/COLOR], [COLOR="#ff0000"]330[/COLOR]);
                                    }
                                    else
                                    {
                                        dialog.Text("[COLOR="#ff0000"]Not enough cash![/COLOR]");
                                        dialog.Link("[COLOR="#ff0000"]Ok bye.[/COLOR]", 255);
                                        dialog.Avatar(144);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
YOUR NPC ID = Put your NPC ID.

1002 = ID of the map.

300 = X coordinate.

330 = Y coordinate.


ConquerPoints, you could change this with Money, so the player will pay silvers instead of cps.

NOTE: CHANGE THE RED WORDS AS YOU LIKE!
F i n c h i is offline  
Old 06/05/2011, 03:30   #3
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by alexalx View Post
THIS IS JUST AN EXAMPLE!

Code:
case [COLOR="Red"]YOUR NPC ID[/COLOR]:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("[COLOR="Red"]I can teleport you to TC (might be wrong coords)[/COLOR]");
                                    dialog.Link("[COLOR="#ff0000"]Go ahead.[/COLOR]", 1);
                                    dialog.Link("[COLOR="#ff0000"]No thanks.[/COLOR]", 255);
                                    dialog.Send();
                                    break;
                                }
                            case 1:
                                {
                                    if (client.Entity.[COLOR="#ff0000"]ConquerPoints[/COLOR] >= [COLOR="#ff0000"]1[/COLOR])
                                    {
                                        client.Entity.[COLOR="#ff0000"]ConquerPoints[/COLOR] -= [COLOR="#ff0000"]1[/COLOR];
                                        client.Entity.Teleport([COLOR="#ff0000"]1002[/COLOR], [COLOR="#ff0000"]300[/COLOR], [COLOR="#ff0000"]330[/COLOR]);
                                    }
                                    else
                                    {
                                        dialog.Text("[COLOR="#ff0000"]Not enough cash![/COLOR]");
                                        dialog.Link("[COLOR="#ff0000"]Ok bye.[/COLOR]", 255);
                                        dialog.Avatar(144);
                                        dialog.Send();
                                    }
                                    break;
                                }
                        }
YOUR NPC ID = Put your NPC ID.

1002 = ID of the map.

300 = X coordinate.

330 = Y coordinate.


ConquerPoints, you could change this with Money, so the player will pay silvers instead of cps.

NOTE: CHANGE THE RED WORDS AS YOU LIKE!
if he made it like this , thats mean that the NPC will send him to a Specific place , he wants it something like that ("He define 10 coords(x,y) and the npc choose the coords randomly , so it's kinda like the "AutoInvite" not all the players teleporting to the same coordinates, but they all teleport to the same map. I guess that what he ment though!
Mr_PoP is offline  
Old 06/05/2011, 03:36   #4
 
elite*gold: 0
Join Date: May 2011
Posts: 168
Received Thanks: 33
Random R = new Random();
int Nr = R.Next(1, 2);
if (Nr == 1)
{
Teleport()
}
if (Nr == 2)
{
Teleport()
}
}
zTek is offline  
Old 06/05/2011, 04:28   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
I think he wants to have the NPC move, not his char.


It's really not hard at all but the issue with everyone using public sources is that they are completely unaware of how the core systems work such as the map system.

You need to...

1: remove the npc from map (if the map system is good it despawns on .remove else send gendat 135 I think to remove entity from player screens.)

2: pick a random valid coord. This can either be a db or w/e of pre recorded points or you could do a fully random system where it rolls a random number and checks dmap validity (if not valid pull new coords)

3: insert npc at new point on map. Again if a good map system it will send spawn packets to locals else do it yourself.


Boom, npc is now in a new place. I assume you want this for a hunting quest. You could try searching I posted a super old quest for coemu doing this as one of my early coding attempts.
pro4never is offline  
Old 06/05/2011, 04:55   #6
 
elite*gold: 0
Join Date: May 2011
Posts: 168
Received Thanks: 33
Quote:
Originally Posted by pro4never View Post
I think he wants to have the NPC move, not his char.


It's really not hard at all but the issue with everyone using public sources is that they are completely unaware of how the core systems work such as the map system.

You need to...

1: remove the npc from map (if the map system is good it despawns on .remove else send gendat 135 I think to remove entity from player screens.)

2: pick a random valid coord. This can either be a db or w/e of pre recorded points or you could do a fully random system where it rolls a random number and checks dmap validity (if not valid pull new coords)

3: insert npc at new point on map. Again if a good map system it will send spawn packets to locals else do it yourself.


Boom, npc is now in a new place. I assume you want this for a hunting quest. You could try searching I posted a super old quest for coemu doing this as one of my early coding attempts.
Ah, I guess I didn't read it right. Good eyes ;P
zTek is offline  
Old 06/05/2011, 13:33   #7
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,224
Received Thanks: 868
Actually i'm faily sure he wants to do Richard.

Simply manually send the despawn code, normally around Screen.cs and also send that despawn to clients that would've been able to see the npc.

So the npc is gone?

Respawn it!

Find some valid coords, What i'd do if I were doing Richard is, Get about 5 Places for him to goto, do a random, if unable to access the spot, +1+1 to X and Y if still not possible try adding one more X, if STILL not accessable then I'd simply make a new random of the spots and repeat untill its found something.

You then need to simply call a function ex NpcEntity.Respawn(); and dont forget to set its new X and Y;
_DreadNought_ is offline  
Old 06/05/2011, 23:31   #8
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
thanks everyone I figured out a way to do it in my source (:

I found out a way to do a dynamic teleport of the npc into the new coords given.

#request close
killersub is offline  
Closed Thread


Similar Threads Similar Threads
question-teleporting to maze(using wallH) under 105
10/25/2009 - Dekaron - 1 Replies
Hello there, Does any body knows how to teleport into the doomed maze map? well usualy teleporting into maps can be done thourgh other maps like..from draco to python at0,0 or braikan to draco from 0,0 and so on.. any body knows from what map can i teleport to maze?
teleporting at any lvl
03/13/2008 - Dekaron - 2 Replies
i want to know what cheat program to use where u can teleport to anywhre at any lvl. I seen a guy selling pots at crevice at very low lvl.. I heard tmme or uce but i dont know what they are..
teleporting
12/02/2007 - Planetside - 5 Replies
im confused can any body tell me how to do the code cave stuff so things will not be detected? :confused:
No more teleporting?
06/01/2005 - World of Warcraft - 4 Replies
Can any1 use a teleport hack now? bwh doesnt work(disconnected)... did Blizz fix it? Any info would be welcome! thx!



All times are GMT +2. The time now is 22:14.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.