Register for your free account! | Forgot your password?

You last visited: Today at 05:02

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

Advertisement



[FIRST Release]PK Quest 5165

Discussion on [FIRST Release]PK Quest 5165 within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
xScott's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
[FIRST Release]PK Quest 5165

I thought this small quest i made was a decent idea.


What you have to do is if you get 200PKPoints, you get rewarded 21500 CPs
After you have claimed the reward your PKPoints are reduced down to 0 and can only be claimed once a day

(Im unsure about adding the variable in Character.cs? Do i have to add it anywhere else? or is that right? im still learning C# >.>)

In Character.cs under

Code:
        public byte LotteryUsed = 0;
Put this
Code:
        public byte PKPQuestUsed = 0;
Now in NPCDialog.cs

Search for

Code:
default:
Above that put this

Code:
                            #region PKPQuest
                            case 66437:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Hey, Do you enjoy Pking? Why not get rewarded for it? "));
                                        GC.AddSend(Packets.NPCSay("Go get 200 Pk Points and ill give you some CPs! "));
                                        GC.AddSend(Packets.NPCSay("This quest is only available Once a day!"));
                                        GC.AddSend(Packets.NPCLink("Lets do it!", 1));
                                        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    if(Control == 1)

                                    {
                                        if (GC.MyChar.PKPoints >= 200 && GC.MyChar.PKPQuestUsed == 0)
                                        {
                                                GC.MyChar.PKPQuestUsed++;
                                                GC.MyChar.CPs += 21500;
                                                GC.MyChar.PKPoints = 0;
                                                GC.AddSend(Packets.NPCSay("There you go! Go kill some more people and comeback tommorow for more CPs!"));
                                                GC.AddSend(Packets.NPCLink("Thanks!", 255));
                                                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You havent got 200 PK Points or already have done this quest!"));
                                            GC.AddSend(Packets.NPCLink("Sorry.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }                                       
                                    break;
                                }
                                
                            #endregion
In OldCODB in NPC.txt add this

Code:
66437 8110 2 0 1002 422 367
xScott is offline  
Thanks
8 Users
Old 01/15/2010, 01:29   #2
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
pretty good i'll give a thanks but i'm not using it.
coreymills is offline  
Thanks
1 User
Old 01/15/2010, 01:37   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Dumb question: Why are you using pk points instead of another score system?

By using pk points (and then lowering to 0) you make it possible for black name/high pk point characters to instantly go back to 0 pk points every day making pk points completely pointless...

Personally I would use a hashtable to link character uid to a score and add to that score every time they kill someone while the quest is active. I assume this is across the entire game? If so you could simply have pk points not be added if they are pking while the quest is active but it still seems to me like this would destroy the pvp system controlling behavior in non free pk zones...


*note* Nvm after actually checking over the code (I thought there was more under what I saw :P) I realize that this is intended for a full pvp/command server to reward pking in non-pk free zones... still seems a bit odd to me but hopefully people will enjoy it.

<note> You will need a system to reset the quest daily.. I would, instead of using a int to control if quest has been done or not, add to the character table saving the date/time when the quest was last done, then do a datetime + day check to see if it has been more than a day since it was last finished, if so allow quest and reset the datetime in the database...

as it is right now, you are using an int for a primarily bool function (true/false) and not resetting it (meaning char can only ever do it once)

Not flaming, just offering some constructive criticism.
pro4never is offline  
Thanks
1 User
Old 01/15/2010, 01:44   #4
 
xScott's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
Quote:
Originally Posted by pro4never View Post
Dumb question: Why are you using pk points instead of another score system?

By using pk points (and then lowering to 0) you make it possible for black name/high pk point characters to instantly go back to 0 pk points every day making pk points completely pointless...

Personally I would use a hashtable to link character uid to a score and add to that score every time they kill someone while the quest is active. I assume this is across the entire game? If so you could simply have pk points not be added if they are pking while the quest is active but it still seems to me like this would destroy the pvp system controlling behavior in non free pk zones...


*note* Nvm after actually checking over the code (I thought there was more under what I saw :P) I realize that this is intended for a full pvp/command server to reward pking in non-pk free zones... still seems a bit odd to me but hopefully people will enjoy it.

<note> You will need a system to reset the quest daily.. I would, instead of using a int to control if quest has been done or not, add to the character table saving the date/time when the quest was last done, then do a datetime + day check to see if it has been more than a day since it was last finished, if so allow quest and reset the datetime in the database...

as it is right now, you are using an int for a primarily bool function (true/false) and not resetting it (meaning char can only ever do it once)

Not flaming, just offering some constructive criticism.
Haha thanks for the feedback, you mentioned a hashtable? were talking to a noob at coding here xD ive seen hashtables from one of the tutorials by Infamous i think,

the lottery NPC uses the same system? resets everyday?
ill see if i can use that as a template or something.

thanks for your feedback =]
xScott is offline  
Old 01/15/2010, 01:47   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Hashtables are a very simple structure to hold values.

Eg: Link player id with a number

That way when you invoke one, you get the other. It's useful for holding scores and all sorts of other systems

I have some examples in my siggy that you may find useful (it's not for 5165 but they are the same thing really, just need to change around a few things)

<Edit> *** I hate dictionaries sooo much >.< I just can't seem to understand them atm.
pro4never is offline  
Old 01/15/2010, 01:51   #6
 
xScott's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
Quote:
Originally Posted by pro4never View Post
Hashtables are a very simple structure to hold values.

Eg: Link player id with a number

That way when you invoke one, you get the other. It's useful for holding scores and all sorts of other systems

I have some examples in my siggy that you may find useful (it's not for 5165 but they are the same thing really, just need to change around a few things)

<Edit> *** I hate dictionaries sooo much >.< I just can't seem to understand them atm.
alright ill look into it and rerelease it if i manage to sort it out =]
xScott is offline  
Old 01/15/2010, 02:03   #7
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
yeah, Like Pro4Never said your gona need something to Restart the PkQuestUsed Per Day, Check Arround where the spot on wich your Pk points Drop Per Each minutes or w,e and take the code from arround there or the idea and add it in. you can work something out by looking at the Code for pkp points drop
-Shunsui- is offline  
Thanks
1 User
Old 01/15/2010, 02:41   #8
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
Good job =P
.Ryu is offline  
Old 01/15/2010, 05:25   #9
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
Good release.
Glad to see you are improving xScott.
Arcо is offline  
Old 01/15/2010, 14:08   #10
 
ImmuneOne's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Code:
[B]bool PkQuestUsed = false;
if (PkQuestUsed)
{

}[/B]
Why use an integer instead of a boolean?
ImmuneOne is offline  
Old 01/15/2010, 21:08   #11
 
xScott's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
Quote:
Originally Posted by ImmuneOne View Post
Code:
[B]bool PkQuestUsed = false;
if (PkQuestUsed)
{

}[/B]
Why use an integer instead of a boolean?
thats a good point, after seeing the lottery Int i thought use int, but cos its only allowed once Bool is probs better :S
xScott is offline  
Old 01/16/2010, 01:25   #12
 
spare2's Avatar
 
elite*gold: 20
Join Date: Oct 2009
Posts: 1,009
Received Thanks: 621
Quote:
Originally Posted by ImmuneOne View Post
Code:
[B]bool PkQuestUsed = false;
if (PkQuestUsed)
{

}[/B]
Why use an integer instead of a boolean?
I think he wants to count how many PK Quest the character did.
spare2 is offline  
Old 01/16/2010, 01:35   #13
 
xScott's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
Quote:
Originally Posted by spare2 View Post
I think he wants to count how many PK Quest the character did.
nah that was to check if the reward has already been claimed lol
ive been looking up hashtables gonna see if i can do what pro suggested.
xScott is offline  
Reply


Similar Threads Similar Threads
[Release] Mining Quest (5165)
12/09/2010 - CO2 PServer Guides & Releases - 5 Replies
Hello This is a simple quest I made that took about 10 minutes to make It's pretty cool I guess I have tested it and it does work Objectives: Go to Phoenix Castle at the coordinates (179, 225) and talk to "Alchemist". He will tell you to go mine 3 Rate1GoldOres. After you get them, bring them to him and he will give you a reward of 10kk cp's.
[Release]5165 +12 fan & tower quest
06/19/2010 - CO2 PServer Guides & Releases - 7 Replies
This is my first release so please don`t flame ,is just my 2nd day of coding This is a quest that gives u super +12 heaven fan and star tower OldCODB > NPCs.txt 300009 9800 2 67 1002 423 389 300010 9750 2 67 1000 508 630 300011 1067 2 67 1011 226 259 Now go to NPCdialog.cs and add these above default:
[RELEASE] My homemade quest [5165]
04/26/2010 - CO2 PServer Guides & Releases - 10 Replies
Hello all :) I have not much experience in C# but i atleast made this quest which are not done yet but i will give you all a taste on it so dont flame me for incorrect coordinates for npc and so on .... Go into C:\OldCODB\NPCs.txt and add this First of all we add the NPC that teleports you into the area And then the NPC that will give you the reward
[Release] Moon Spring Quest (5165)
02/23/2010 - CO2 PServer Guides & Releases - 8 Replies
#request close
[Release] Rat Fang Quest (5165)
02/23/2010 - CO2 PServer Guides & Releases - 3 Replies
#request close



All times are GMT +2. The time now is 05:02.


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.