Register for your free account! | Forgot your password?

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

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

Advertisement



i need some idea about change npc spot

Discussion on i need some idea about change npc spot within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2011
Posts: 24
Received Thanks: 1
i need some idea about change npc spot

hello guys
i try to make some think
in npcs
but every time i miss
i need npc to change his spot
like when i talk to him
and get buy some think he move and go another spot

see my code

Code:
new Conquer_Online_Server.Database.MySqlCommand(Conquer_Online_Server.Database.MySqlCommandType.UPDATE)
                               .Update("sobnpcs").Set("cellx",433 ).Set("celly", 387).Where("id", 74125)
but this code need to restart server
to reload database
so i make code to reload
only table "sobnpcs"
but npc he never change spot
must restart
anyway
can anyone help me in this
or some one give me idea


sorry i add this in wrong section
can pleas moved to
CO2 PServer - Discussions / Questions
asdalhog is offline  
Old 09/29/2012, 16:57   #2
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
i can't really understand your problem
your problem is with changing a value in the database ?
or your problem is that you want this to take effect without restarting the server ?
if you suffer from the first problem try the next piece of code i made it for the same reason
Code:
                                    MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
                                    cmd.Update("npcs").Set("mapid", Npc_Map).Set("cellx", Npc_X).Set("celly", Npc_Y).Where("id", npctochangeid).Execute();
if you suffer from the second problem then i think you need to respawen all npcs again so he move to his new coords

well there is an advanced way to do that which it's used at the bluemouse quest which ill check now cuz i was working on something similar to that

if i found something useful ill edit this post
but tell me if your problem was the first case i mentioned above
go for it is offline  
Thanks
1 User
Old 09/29/2012, 17:56   #3
 
JohnHeatz's Avatar
 
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,981
Arrow CO2 Main - Discussions / Questions -> CO2 PServer - Discussions / Questions

#Moved to the right section
JohnHeatz is offline  
Old 09/29/2012, 18:53   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
You're already moving it in the database

now you need to move them in the server memory


to do that just look up the npc in memory and update its location (alternatively just re-load all the npcs but that's a horrible way of handling it)
pro4never is offline  
Thanks
1 User
Old 10/01/2012, 16:35   #5
 
elite*gold: 0
Join Date: Feb 2011
Posts: 24
Received Thanks: 1
Quote:
Originally Posted by go for it View Post
i can't really understand your problem
your problem is with changing a value in the database ?
or your problem is that you want this to take effect without restarting the server ?
if you suffer from the first problem try the next piece of code i made it for the same reason
Code:
                                    MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
                                    cmd.Update("npcs").Set("mapid", Npc_Map).Set("cellx", Npc_X).Set("celly", Npc_Y).Where("id", npctochangeid).Execute();
if you suffer from the second problem then i think you need to respawen all npcs again so he move to his new coords

well there is an advanced way to do that which it's used at the bluemouse quest which ill check now cuz i was working on something similar to that

if i found something useful ill edit this post
but tell me if your problem was the first case i mentioned above
its second problem and i try to respawen all npcs nothink done
and i try to reload all database no think happen
must restart so what i can do if u have some think can help me ?

Quote:
Originally Posted by pro4never View Post
You're already moving it in the database

now you need to move them in the server memory


to do that just look up the npc in memory and update its location (alternatively just re-load all the npcs but that's a horrible way of handling it)
i reload all memory of server and no think happen
must restart
asdalhog is offline  
Old 10/01/2012, 17:40   #6
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
well i understood what do u mean or what do u want to do u would like to change the cords of the npc when sm1 click on it like ctf or blue mouse quest anyways its peice of cake .. first u should remove the npc from the clicker screen and any other players in the same screen distance .. then u should send npc spawn packet 2030 to every1 in the screen nearby the new npc cords then u should update this on the database so that when restarting server it become in the last location it was at and dont forget to add the npc in client's screen
shadowman123 is offline  
Thanks
1 User
Old 10/01/2012, 22:16   #7
 
elite*gold: 0
Join Date: Feb 2011
Posts: 24
Received Thanks: 1
Quote:
Originally Posted by shadowman123 View Post
well i understood what do u mean or what do u want to do u would like to change the cords of the npc when sm1 click on it like ctf or blue mouse quest anyways its peice of cake .. first u should remove the npc from the clicker screen and any other players in the same screen distance .. then u should send npc spawn packet 2030 to every1 in the screen nearby the new npc cords then u should update this on the database so that when restarting server it become in the last location it was at and dont forget to add the npc in client's screen
okay i understand what u need to say
but if it peice of cake like u say
tell me cuz am beginner in .net
so tell me how i can remove the npc from the clicker screen and any other players in the same screen distance
or give me the path to be followed
asdalhog is offline  
Old 10/01/2012, 22:48   #8
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
well to be Honest as a beginer u cant do smthing like that cuz u are going too deep for these stuffs .. u need to know how things go inside the source then ask question about the concept
shadowman123 is offline  
Old 10/04/2012, 01:06   #9
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
npc spawn packet 2030

try sending the same id with different coords and it should remove the old and show the new
but this is really poor way of doing it
personally i couldn't get to a decent way to get it done
and couldn't change it in memory then send a packet updating it's coords

cuz here
when you update it's coords now for players in the range , if you gone out range the back to the range it will be on the old coords which is in the memory which it got it from the database

im trying the method pro4never mentioned , didn't give it a try yet but personally i think it's the best way to get it done
go for it is offline  
Thanks
1 User
Old 10/04/2012, 01:19   #10
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by go for it View Post
npc spawn packet 2030

try sending the same id with different coords and it should remove the old and show the new
but this is really poor way of doing it
personally i couldn't get to a decent way to get it done
and couldn't change it in memory then send a packet updating it's coords

cuz here
when you update it's coords now for players in the range , if you gone out range the back to the range it will be on the old coords
thats y i said you should work on screen part with adding / removing npcs / entities
shadowman123 is offline  
Old 10/04/2012, 01:32   #11
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
so you mean that everytime player try to access it you will send another 2030 packet with a "Fake location" then save this location to the database
not a proper way , right ?
go for it is offline  
Thanks
1 User
Old 10/06/2012, 16:20   #12
 
elite*gold: 0
Join Date: Feb 2011
Posts: 24
Received Thanks: 1
Quote:
Originally Posted by shadowman123 View Post
well to be Honest as a beginer u cant do smthing like that cuz u are going too deep for these stuffs .. u need to know how things go inside the source then ask question about the concept

why u say that
programming language never end
so we all beginer everything possible to do
If there insistence u will do any think
and my npc is done
and appear for all ppls
in screen

"go for it"
he help from his heart
thanks go for it
For your interest in the Topic

this my npc video

asdalhog is offline  
Thanks
1 User
Old 10/07/2012, 11:25   #13
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by asdalhog View Post
why u say that
programming language never end
so we all beginer everything possible to do
If there insistence u will do any think
and my npc is done
and appear for all ppls
in screen
your npc is done cuz of our help and no it isnt about just Programming its about understanding stuffs in sources to be able to add / remove / update systems
shadowman123 is offline  
Old 10/07/2012, 11:34   #14
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
why u say that
programming language never end
so we all beginer everything possible to do
If there insistence u will do any think
and my npc is done
and appear for all ppls
in screen

"go for it"
he help from his heart
thanks go for it
For your interest in the Topic

this my npc video

BigBoS EveNT Drop Cps 5639 - YouTube
aww happy it worked now pm me the code source for this npc i want to try it out jajajja XD XD XD
go for it is offline  
Reply


Similar Threads Similar Threads
[Questions] How i Change the spot that new acc enter it ?
05/07/2012 - EO PServer Hosting - 5 Replies
'Hello Every one & thy so much for enter and read it in Reall EO when some one new come to the game he enter smal map and from this map he can lvl him self some lvl before he enter to the game and play with every one ..My Questions is how i make all all new ppl when thay come to the game enter this map and stay in this map untill he be 30 lvl at lest . if any one know how share it with us or tell me :D Thank you for read it
[Help] Any Idea's How To Change FONT In S4L?
07/21/2011 - S4 League - 2 Replies
Hi, I am just curious, anyone figured out or know's how to change the "Font" in S4L Europe. Cause the current one is very, very ugly x_X
Searching for an idea...auto back to spot
05/09/2009 - Archlord - 11 Replies
Hi all, i am working on a bot atm with pixel detection. So far i managed to get those things running: a) recognize mob & mob's hp b) using skills untill mob's hp = 0



All times are GMT +1. The time now is 14:18.


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.