Register for your free account! | Forgot your password?

You last visited: Today at 04:56

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

Advertisement



Recoded GW gate NPc

Discussion on Recoded GW gate NPc within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2006
Posts: 52
Received Thanks: 25
Recoded GW gate NPc

FOR 5165

Replece in NPCDialog.cs
Code:
 #region GWNPCs
                            case 6700:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("What do you want to do?"));
                                        GC.AddSend(Packets.NPCLink("Heal the pole", 1));
                                        GC.AddSend(Packets.NPCLink("Nothing", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        if (GC.MyChar.MyGuild != null && GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader || GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.DeputyMgr))
                                        {
                                            GC.AddSend(Packets.NPCSay("How much of your guild fund are you going to waste?"));
                                            GC.AddSend(Packets.NPCLink2("Heal", 2));
                                            GC.AddSend(Packets.NPCLink("I changed my mind.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to do that."));
                                            GC.AddSend(Packets.NPCLink("Ahh okay.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 2)
                                    {
                                        if (GC.MyChar.MyGuild != null && GC.MyChar.MyGuild == Features.GuildWars.LastWinner && (GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader || GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.DeputyMgr))
                                        {
                                            uint Amount = 0;
                                            try
                                            {
                                                Amount = uint.Parse(ReadString(Data));
                                            }
                                            catch { }

                                            if (Amount > 0 && Amount <= GC.MyChar.MyGuild.Fund)
                                            {
                                                uint ToHeal = Features.GuildWars.ThePole.MaxHP - Features.GuildWars.ThePole.CurHP;
                                                if (Amount > ToHeal / 10) Amount = ToHeal / 10;
                                                GC.MyChar.MyGuild.Fund -= Amount;
                                                Features.GuildWars.ThePole.CurHP += Amount * 10;
                                                Features.GuildWars.ThePole.ReSpawn();
                                            }
                                        }
                                    }
                                    break;
                                }
                            case 6701:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("What do you want to do?"));
                                        GC.AddSend(Packets.NPCLink("Open/close the gate.", 1));
                                        GC.AddSend(Packets.NPCLink("RepairGate.", 2));
                                        GC.AddSend(Packets.NPCLink("GetIn.", 3));
                                        GC.AddSend(Packets.NPCLink("Nothing", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Control == 1)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild)
                                        {
                                            Features.GuildWars.TheLeftGate.Opened = !Features.GuildWars.TheLeftGate.Opened;
                                            Features.GuildWars.TheLeftGate.ReSpawn();
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 2)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild && (Features.GuildWars.TheLeftGate.Opened = true))
                                        {
                                            Features.GuildWars.TheLeftGate.CurHP = Features.GuildWars.TheLeftGate.MaxHP;
                                            Features.GuildWars.TheLeftGate.Opened = false;
                                            Features.GuildWars.TheLeftGate.ReSpawn() ;
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if ( Control == 3)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild )
                                         {
                                            GC.MyChar.Teleport(1038, 160, 193);
                                         }
                                    else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                  break;
                                }
                            case 6702:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("What do you want to do?"));
                                        GC.AddSend(Packets.NPCLink("Open/close the gate.", 1));
                                        GC.AddSend(Packets.NPCLink("RepairGate", 2));
                                        GC.AddSend(Packets.NPCLink("GetIn", 3));
                                        GC.AddSend(Packets.NPCLink("Nothing", 255));
                                        GC.AddSend(Packets.NPCSetFace(0));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Control == 1)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild)
                                        {
                                            Features.GuildWars.TheRightGate.Opened = !Features.GuildWars.TheRightGate.Opened;
                                            Features.GuildWars.TheRightGate.ReSpawn();
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 2)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild && (Features.GuildWars.TheRightGate.Opened = true))
                                        {
                                            Features.GuildWars.TheRightGate.CurHP = Features.GuildWars.TheRightGate.MaxHP;
                                            Features.GuildWars.TheRightGate.Opened = false;
                                            Features.GuildWars.TheRightGate.ReSpawn();
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 3)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild)
                                        {
                                            GC.MyChar.Teleport(1038, 206, 173);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                } 
                            #endregion
The repair is still bugles because we need to have the gate opened .. i will tra later to make if gate hp = 0 to have 2 states
open and destryed
no in source the gate is wen gate is gate become opened .. and this is not ok .. should be opened and a second state as destryed because if np check if is open wen u click repair with gate opened the gate will close and get repaired
Is Still a nice feature a had some fun on my test server

All Thx go to all on this forum idk i just leach and try to modify i dont remember what source i get!
intel_ro is offline  
Thanks
3 Users
Old 01/13/2010, 15:25   #2
 
Huseby's Avatar
 
elite*gold: 106
Join Date: Oct 2006
Posts: 6,047
Received Thanks: 1,164
Wrong forum

#Moved
Huseby is offline  
Old 01/13/2010, 19:01   #3
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
It would be allot easier if you use the [code]
[ /code] for that....
.Ryu is offline  
Old 01/13/2010, 20:52   #4
 
elite*gold: 188
Join Date: Dec 2009
Posts: 79
Received Thanks: 36
Good release man!
Fleaman is offline  
Old 01/13/2010, 22:10   #5
 
bart2712's Avatar
 
elite*gold: 0
Join Date: Jul 2005
Posts: 112
Received Thanks: 12
ya it works, only thing is the Bomb item is unusable ATM so anyone attacking the gate would be standing there forever to get the gate open.

I just used my PM char with max everything to break thru the gate then took the pole...that way once i get the server up and running for real, all i have to do is go open the gates for the first GW
bart2712 is offline  
Old 01/14/2010, 10:27   #6
 
elite*gold: 0
Join Date: May 2006
Posts: 52
Received Thanks: 25
Quote:
Originally Posted by Fleaman View Post
Good release man!
I will try today to make more like real gates
I need to work on GuildWars.cs to to a second state of gates if CurHP = 0 gate = broken
intel_ro is offline  
Old 01/14/2010, 10:58   #7
 
elite*gold: 0
Join Date: May 2006
Posts: 52
Received Thanks: 25
Gw working Repair

Edit GuildWars.cs

and add what i mark with red
Code:
public struct Gate
        {
            public Location Loc;
            public uint MaxHP;
            public uint CurHP;
            public uint EntityID;
            public uint Mesh;
           [COLOR="Red"] public uint Broken;[/COLOR]
Code:
 public void TakeAttack(Character C, uint Damage, byte AtkType)
            {
                if (AtkType != 21)
                    World.Action(C, Packets.AttackPacket(C.EntityID, EntityID, Loc.X, Loc.Y, Damage, AtkType).Get);
                if (Damage >= CurHP)
                {
                    C.AtkMem.Attacking = false;
                    C.AtkMem.Target = 0;
                    World.Action(C, Packets.AttackPacket(C.EntityID, EntityID, Loc.X, Loc.Y, 0, 14).Get);
                    Opened = true;
                    [COLOR="Red"]Broken = 1;[/COLOR]
                    ReSpawn();
                }
                else
                    CurHP -= Damage;
            }
Code:
  public static void Init()
        {
            War = false;
            Scores = new Hashtable();
            LastScores = DateTime.Now;

            ThePole = new Pole();
            ThePole.EntityID = 6700;
            ThePole.Mesh = 1137;
            ThePole.CurHP = 20000000;
            ThePole.MaxHP = 20000000;
            ThePole.Loc = new Location();
            ThePole.Loc.Map = 1038;
            ThePole.Loc.X = 84;
            ThePole.Loc.Y = 99;
         
            TheLeftGate = new Gate();
            TheLeftGate.EntityID = 6701;
            TheLeftGate.Opened = false;
            TheLeftGate.MaxHP = 10000000;
            TheLeftGate.CurHP = 10000000;
            TheLeftGate.Loc = new Location();
            TheLeftGate.Loc.Map = 1038;
            TheLeftGate.Loc.X = 163;
            TheLeftGate.Loc.Y = 210;
            TheLeftGate.ReSpawn();
            [COLOR="Red"]TheLeftGate.Broken = 0;[/COLOR]

            TheRightGate = new Gate();
            TheRightGate.EntityID = 6702;
            TheRightGate.Opened = false;
            TheRightGate.MaxHP = 10000000;
            TheRightGate.CurHP = 10000000;
            TheRightGate.Loc = new Location();
            TheRightGate.Loc.Map = 1038;
            TheRightGate.Loc.X = 222;
            TheRightGate.Loc.Y = 177;
            TheRightGate.ReSpawn();
            [COLOR="Red"]TheRightGate.Broken = 0;[/COLOR]
        }
and now here the npc just replace
Code:
case 6701:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("What do you want to do?"));
                                        GC.AddSend(Packets.NPCLink("Open/close the gate.", 1));
                                        GC.AddSend(Packets.NPCLink("RepairGate.", 2));
                                        GC.AddSend(Packets.NPCLink("GetIn.", 3));
                                        GC.AddSend(Packets.NPCLink("Nothing", 255));
                                        GC.AddSend(Packets.NPCSetFace(30));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Control == 1)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild)
                                        {
                                            Features.GuildWars.TheLeftGate.Opened = !Features.GuildWars.TheLeftGate.Opened;
                                            Features.GuildWars.TheLeftGate.ReSpawn();
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 2)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild && ( Features.GuildWars.TheLeftGate.Broken == 1 && (Features.GuildWars.TheLeftGate.Opened = true)))
                                        {
                                            Features.GuildWars.TheLeftGate.CurHP = Features.GuildWars.TheLeftGate.MaxHP;
                                            Features.GuildWars.TheLeftGate.Opened = false;
                                            Features.GuildWars.TheLeftGate.Broken = 0;
                                            Features.GuildWars.TheLeftGate.ReSpawn() ;
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if ( Control == 3)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild )
                                         {
                                            GC.MyChar.Teleport(1038, 160, 193);
                                         }
                                    else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                  break;
                                }
                            case 6702:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("What do you want to do?"));
                                        GC.AddSend(Packets.NPCLink("Open/close the gate.", 1));
                                        GC.AddSend(Packets.NPCLink("RepairGate", 2));
                                        GC.AddSend(Packets.NPCLink("GetIn", 3));
                                        GC.AddSend(Packets.NPCLink("Nothing", 255));
                                        GC.AddSend(Packets.NPCSetFace(0));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Control == 1)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild)
                                        {
                                            Features.GuildWars.TheRightGate.Opened = !Features.GuildWars.TheRightGate.Opened;
                                            Features.GuildWars.TheRightGate.ReSpawn();
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 2)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild && ( Features.GuildWars.TheRightGate.Broken == 1 && (Features.GuildWars.TheRightGate.Opened = true)))
                                        {
                                            Features.GuildWars.TheRightGate.CurHP = Features.GuildWars.TheRightGate.MaxHP;
                                            Features.GuildWars.TheRightGate.Opened = false;
                                        Features.GuildWars.TheRightGate.Broken = 0;    
                                           Features.GuildWars.TheRightGate.ReSpawn();
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 3)
                                    {
                                        if (Features.GuildWars.LastWinner == GC.MyChar.MyGuild)
                                        {
                                            GC.MyChar.Teleport(1038, 206, 173);
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You are not authorized to to that."));
                                            GC.AddSend(Packets.NPCLink("Ok.", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    break;
                                } 
                            #endregion
intel_ro is offline  
Thanks
1 User
Old 01/14/2010, 10:59   #8
 
elite*gold: 0
Join Date: May 2006
Posts: 52
Received Thanks: 25
I can put to check if rank to
But is enough for now
intel_ro is offline  
Old 01/14/2010, 16:39   #9


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Why didnt you use a bool instead of a uint?

Then you can do:

Code:
if(Destroyed)
Its alot neater and more efficient.
Korvacs is offline  
Thanks
2 Users
Old 01/14/2010, 21:15   #10
 
elite*gold: 188
Join Date: Dec 2009
Posts: 79
Received Thanks: 36
good job
Fleaman is offline  
Old 01/14/2010, 21:17   #11
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Quote:
Originally Posted by Korvacs View Post
Why didnt you use a bool instead of a uint?

Then you can do:

Code:
if(Destroyed)
Its alot neater and more efficient.
True, And Grats on Mod, : )
-Shunsui- is offline  
Old 01/14/2010, 21:19   #12
 
elite*gold: 188
Join Date: Dec 2009
Posts: 79
Received Thanks: 36
I don't think he should be moderator.
He is very rude.
Fleaman is offline  
Old 01/14/2010, 21:25   #13
 
elite*gold: 0
Join Date: May 2006
Posts: 52
Received Thanks: 25
Quote:
Originally Posted by Fleaman View Post
I don't think he should be moderator.
He is very rude.
I don't wana be mode i wana just be friendly .. and help what i learn .. this is just the begining
next relase will be TFB skill adjust .. is attaking to fast but that will ne a new topic .. or real dmg as real server based on rb
intel_ro is offline  
Old 01/14/2010, 21:29   #14
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
Quote:
Originally Posted by Fleaman View Post
I don't think he should be moderator.
He is very rude.
#Reported off topic

@Intel Goodjob ima use it =P
.Ryu is offline  
Old 01/15/2010, 08:20   #15
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
I gave you a thanks coz i never found that issue
I might use your code in my server after a bit tweaking ( i dont like If - else i use cases i think its faster but meh)
~Yuki~ is offline  
Reply


Similar Threads Similar Threads
Perfect World Bot PWI-Prophet Bot Recoded
05/03/2023 - PW Hacks, Bots, Cheats, Exploits - 1641 Replies
-------------------------------------------------- --------------------------- -Thanks to everyone that has made this possible. ------------------------------------------------- ---------------------------- New Release on September 25, 2010 Official 3.1 Release
recoded blizzbot 1.5 for rogues /v1.5 -update!
07/10/2006 - World of Warcraft - 48 Replies
ich hoffe damit wären die nervtötenden bugs behoben, hf jungs ;) recoded blizzbot for rouges /v1.5 - by langweiler - better performance - fast binds with macros ( no &"%§&%"§ key typing ) - starting bot when you are dead - automaticly walking if you are in the near of ANY corpse wp - changed registry entries / less detectable - never changes window titles / less detectable



All times are GMT +2. The time now is 04:56.


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.