Register for your free account! | Forgot your password?

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

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

Advertisement



Offline TG Trinity source

Discussion on Offline TG Trinity source within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
zoro7070's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 144
Received Thanks: 18
Lightbulb Offline TG Trinity source

how can i Forbidden players from go to OfflineTG from some map like war jail
my idea but did not work
Code:
#region Offline TG (2044)
                case 2044:
                    {
                        OfflineTGRequest otgr = new OfflineTGRequest(false);
                        otgr.Deserialize(packet);
                        switch (otgr.ID)
                        {
                            case OfflineTGRequest.OnTrainingTimeRequested:
                                {
                                    otgr.Minutes = 900;
                                    client.Send(otgr);
                                    break;
                                }
                            case OfflineTGRequest.OnConfirmation:
                                {
                                    client.Entity.PreviousMapID = client.Entity.MapID;
                                    client.Entity.PrevX = client.Entity.X;
                                    client.Entity.PrevY = client.Entity.Y;
                                    client.Entity.MapID = 601;
                                    client.Entity.X = 64;
                                    client.Entity.Y = 56;
                                    client.OfflineTGEnterTime = DateTime.Now;

                                    client.Disconnect();
                                    break;
                                }
                            case OfflineTGRequest.ClaimExperience:
                                {
                                    var T1 = new TimeSpan(DateTime.Now.Ticks);
                                    var T2 = new TimeSpan(client.OfflineTGEnterTime.Ticks);
                                    ushort minutes = (ushort)(T1.TotalMinutes - T2.TotalMinutes);
                                    minutes = (ushort)Math.Min((ushort)900, minutes);
                                    double expballGain = (double)300 * (double)minutes / (double)900;
                                    while (expballGain >= 100)
                                    {
                                        expballGain -= 100;
                                        client.IncreaseExperience(client.ExpBall, false);
                                    }
                                    if (expballGain != 0)
                                        client.IncreaseExperience((uint)(client.ExpBall * (expballGain / 100)), false);

                                    client.Entity.SetLocation(client.Entity.PreviousMapID, client.Entity.PrevX, client.Entity.PrevY);
                                    if (client.Map.ID == 1036 || client.Map.ID == 1039 || client.Map.ID == 1730 || client.Map.ID == 1731 || client.Map.ID == 1732 || client.Map.ID == 1733 || client.Map.ID == 1734 || client.Map.ID == 1735 || client.Map.ID == 1736 || client.Map.ID == 1737 || client.Map.ID == 1950 || client.Map.ID == 3580 || client.Map.ID == 3581 || client.Map.ID == 3582 || client.Map.ID == 3583 || client.Map.ID == 3584 || client.Map.ID == 3585 || client.Map.ID == 3586)
                                        client.Entity.Teleport(1002, 430, 378);
                                    else if (Game.ConquerStructures.Society.GuildWar.IsWar == true && client.Map.ID == 1038 || client.Map.ID == 6001)
                                        client.Entity.Teleport(6001, 31, 74);
                                    else if (client.Map.ID == 6000)
                                        client.Entity.Teleport(6000, 31, 74);
                                    else 
                                    {
                                        switch (client.Map.ID)
                                        {
                                            default:
                                                {
                                                    client.Entity.Teleport(1002, 429, 378);
                                                    break;
                                                }
                                            case 1000:
                                                {
                                                    client.Entity.Teleport(1000, 500, 650);
                                                    break;
                                                }
                                            case 1020:
                                                {
                                                    client.Entity.Teleport(1020, 565, 562);
                                                    break;
                                                }
                                            case 1011:
                                                {
                                                    client.Entity.Teleport(1011, 188, 264);
                                                    break;
                                                }
                                            case 1015:
                                                {
                                                    client.Entity.Teleport(1015, 717, 571);
                                                    break;
                                                }
                                            case 6001:
                                                {
                                                    client.Entity.Teleport(6001, 31, 74);
                                                    break;
                                                }
                                            case 6000:
                                                {
                                                    client.Entity.Teleport(6000, 31, 74);
                                                    break;
                                                }
                                        }
                                    }
                                    client.OfflineTGEnterTime = DateTime.Now;
                                    break;
                                }
                            default:
                                client.Send(otgr);
                                break;
                        }
                        break;
                    }
                #endregion
zoro7070 is offline  
Old 06/03/2012, 20:52   #2
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
MAPSTATUS!
-Shunsui- is offline  
Old 06/03/2012, 21:11   #3
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 706
try this
Code:
 case OfflineTGRequest.OnConfirmation:
                                {
                                 if (client.Entity.MapID != 6003) { // 6003 is botjail if im right you can basically use this idea though
                                    client.Entity.PreviousMapID = client.Entity.MapID;
                                    client.Entity.PrevX = client.Entity.X;
                                    client.Entity.PrevY = client.Entity.Y;
                                    client.Entity.MapID = 601;
                                    client.Entity.X = 64;
                                    client.Entity.Y = 56;
                                    client.OfflineTGEnterTime = DateTime.Now;

                                    client.Disconnect();
                                    break;
                                }
}
turk55 is offline  
Thanks
1 User
Old 06/03/2012, 21:18   #4
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
If they're getting to TG without speaking to (and being withing "seeing" range of the NPC that sends them there) they should not be teleported to begin with.
Zeroxelli is offline  
Old 06/04/2012, 08:05   #5
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by turk55 View Post
try this
Code:
 case OfflineTGRequest.OnConfirmation:
                                {
                                 if (client.Entity.MapID != 6003) { // 6003 is botjail if im right you can basically use this idea though
                                    client.Entity.PreviousMapID = client.Entity.MapID;
                                    client.Entity.PrevX = client.Entity.X;
                                    client.Entity.PrevY = client.Entity.Y;
                                    client.Entity.MapID = 601;
                                    client.Entity.X = 64;
                                    client.Entity.Y = 56;
                                    client.OfflineTGEnterTime = DateTime.Now;
                                    client.Disconnect();
                                    break;
                                }
}
dude ur code is less efficient Cuz he might die In GW Map which is 1038 and then when he become ghost he use it .. so Lets Say it would be Like that

Code:
                       case OfflineTGRequest.OnConfirmation:
                                {
                                 if (client.Entity.MapID != 6003 || client.Entity.MapID != 1038) { // 6003 is botjail if im right you can basically use this idea though
                                    client.Entity.PreviousMapID = client.Entity.MapID;
                                    client.Entity.PrevX = client.Entity.X;
                                    client.Entity.PrevY = client.Entity.Y;
                                    client.Entity.MapID = 601;
                                    client.Entity.X = 64;
                                    client.Entity.Y = 56;
                                    client.OfflineTGEnterTime = DateTime.Now;
                                    client.Disconnect();
                                    break;
                                }
                                else
                                {
                                    client.send(new NpcReply(6, " You Cant Use Offline Training While u r in GuildWar Maps  ") { OptionID = 87 });
                                }
}
shadowman123 is offline  
Thanks
1 User
Old 06/04/2012, 11:37   #6
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 706
Quote:
Originally Posted by shadowman123 View Post
.

I know, it was just a example.
turk55 is offline  
Old 06/04/2012, 13:01   #7
 
zoro7070's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 144
Received Thanks: 18
Thumbs up

the code works with my source
Code:
case OfflineTGRequest.OnConfirmation:
                                {
                                    if (client.Entity.MapID != 6003 || client.Entity.MapID != 1038 || client.Entity.MapID != 6001 || client.Entity.MapID != 6002)
                                    { 
                                        client.Entity.PreviousMapID = client.Entity.MapID;
                                        client.Entity.PrevX = client.Entity.X;
                                        client.Entity.PrevY = client.Entity.Y;
                                        client.Entity.MapID = 601;
                                        client.Entity.X = 64;
                                        client.Entity.Y = 56;
                                        client.OfflineTGEnterTime = DateTime.Now;
                                        client.Disconnect();
                                        break;
                                    }
                                    else
                                    {
                                        client.Send(new NpcReply(NpcReply.MessageBox, " You can't use Offline Training While you are in GuildWar Maps"));
                                        break;
                                    }
                                }
but i go to 1038 and send my account to offline TG without any problem
zoro7070 is offline  
Old 06/04/2012, 15:21   #8
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Quote:
Originally Posted by shadowman123 View Post
dude ur code is less efficient Cuz he might die In GW Map which is 1038 and then when he become ghost he use it .. so Lets Say it would be Like that

Code:
                       case OfflineTGRequest.OnConfirmation:
                                {
                                 if (client.Entity.MapID != 6003 || client.Entity.MapID != 1038) { // 6003 is botjail if im right you can basically use this idea though
                                    client.Entity.PreviousMapID = client.Entity.MapID;
                                    client.Entity.PrevX = client.Entity.X;
                                    client.Entity.PrevY = client.Entity.Y;
                                    client.Entity.MapID = 601;
                                    client.Entity.X = 64;
                                    client.Entity.Y = 56;
                                    client.OfflineTGEnterTime = DateTime.Now;
                                    client.Disconnect();
                                    break;
                                }
                                else
                                {
                                    client.send(new NpcReply(6, " You Cant Use Offline Training While u r in GuildWar Maps  ") { OptionID = 87 });
                                }
}
Because it would be less efficient, What the **** does having the wrong id have to do with efficiency? Nubs these days.
_DreadNought_ is offline  
Old 06/04/2012, 17:16   #9
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by _DreadNought_ View Post
Because it would be less efficient, What the **** does having the wrong id have to do with efficiency? Nubs these days.
Well i maybe Phrased it wrongly i meant it didnt Fix the Whole Problem ..Thats it
shadowman123 is offline  
Old 06/04/2012, 19:28   #10
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
Did anyone notice something extremely obvious?

Code:
if (client.Entity.MapID != 6003 || client.Entity.MapID != 1038 || client.Entity.MapID != 6001 || client.Entity.MapID != 6002)
You're using OR (||) instead of AND (&&) for this check.

Anywho, simpler way?
Code:
List<int> NonTGMaps = new List<int>() { 1038, 6000, 6001, 6002, 6003 }; // Add more here
// ... 
if (!NonTGMaps.Contains(client.Entity.MapID))
{
    // Teleport code here
}
else
{
    // Tell them they can't go to TG from here..
}
or something like that.

Edit: Also, why are you disconnecting them? If you actually send the ConfirmLocation and Map packets, you don't have to do that.
Edit2: Ah, "offline" TG. Silly newer patches.
Zeroxelli is offline  
Thanks
1 User
Old 06/04/2012, 20:39   #11
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by Zeroxelli View Post
Did anyone notice something extremely obvious?

Code:
if (client.Entity.MapID != 6003 || client.Entity.MapID != 1038 || client.Entity.MapID != 6001 || client.Entity.MapID != 6002)
You're using OR (||) instead of AND (&&) for this check.

Anywho, simpler way?
Code:
List<int> NonTGMaps = new List<int>() { 1038, 6000, 6001, 6002, 6003 }; // Add more here
// ... 
if (!NonTGMaps.Contains(client.Entity.MapID))
{
    // Teleport code here
}
else
{
    // Tell them they can't go to TG from here..
}
or something like that.

Edit: Also, why are you disconnecting them? If you actually send the ConfirmLocation and Map packets, you don't have to do that.
Edit2: Ah, "offline" TG. Silly newer patches.
oh You r Right About that ..btw i liked Using List Methods Awesome
shadowman123 is offline  
Old 06/04/2012, 20:40   #12
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
Quote:
Originally Posted by shadowman123 View Post
oh You r Right About that ..btw i liked Using List Methods Awesome
Yeah, it's just a tad tidier than a bunch of IF statements, and less typing too.
Zeroxelli is offline  
Old 06/05/2012, 22:21   #13
 
zoro7070's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 144
Received Thanks: 18
Lightbulb

Quote:
Originally Posted by Zeroxelli View Post
Did anyone notice something extremely obvious?

Code:
if (client.Entity.MapID != 6003 || client.Entity.MapID != 1038 || client.Entity.MapID != 6001 || client.Entity.MapID != 6002)
You're using OR (||) instead of AND (&&) for this check.

Anywho, simpler way?
Code:
List<int> NonTGMaps = new List<int>() { 1038, 6000, 6001, 6002, 6003 }; // Add more here
// ... 
if (!NonTGMaps.Contains(client.Entity.MapID))
{
    // Teleport code here
}
else
{
    // Tell them they can't go to TG from here..
}
or something like that.

Edit: Also, why are you disconnecting them? If you actually send the ConfirmLocation and Map packets, you don't have to do that.
Edit2: Ah, "offline" TG. Silly newer patches.
thanks for your simpler way
it works fine now
zoro7070 is offline  
Old 06/05/2012, 22:24   #14
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
Quote:
Originally Posted by zoro7070 View Post
thanks for your simpler way
it works fine now
Good to know, good luck with your server.
Zeroxelli is offline  
Reply


Similar Threads Similar Threads
some help with 5517 trinity source
05/25/2012 - CO2 Private Server - 8 Replies
how can i make the autoinvite window don't show in a map and i have problem with that npc the npc upgrade the items above 140 #region Weapon Master case 7050: { switch (npcRequest.OptionID) { case 0: {
a question about trinity 5517 source
09/18/2011 - CO2 Private Server - 3 Replies
Sometimes ,i can't saw another player when the player didn't jump didn't walk ,only sit in a coord or player away!!! but the another player can saw me .... where the error occurred ??? any one fix there ? source Link:source and database.rar
trinity old source. Maps
07/17/2011 - CO2 Private Server - 1 Replies
i wanna convert conquer online dmaps to .map to work on trinity old source :confused: any one have idea ?



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


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