Register for your free account! | Forgot your password?

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

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

Advertisement



How to make it one time only?

Discussion on How to make it one time only? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2008
Posts: 65
Received Thanks: 1
How to make it one time only?

Hello,

I made a new NPC that gives the player 1000 CPs, but it keeps giving him CPs everytime he speaks to him, I want it to give him 1000 CPs one time only for the new player, how can I do that?
Here is the code:

#region GiftGiver
case 9030:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Welcome to Conquer Online, please take this gift."));
GC.AddSend(Packets.NPCLink("Thank you so much!", 1));
GC.AddSend(Packets.NPCLink("No, I don't need it.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.MyChar.CPs+ 1000;
}
break;
}
#endregion
BlackCitadel is offline  
Old 04/12/2011, 01:44   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Character variable saved/loaded controlling if it's been used already and then just check that variable inside your script.

There are tons of examples all over the forum if you'd search.

So a new variable say... ClaimedTimes = 0;. On load character read it from the character database. On change/logout save to character database.

Simple stuff.
pro4never is offline  
Old 04/12/2011, 05:02   #3
 
elite*gold: 0
Join Date: Oct 2008
Posts: 65
Received Thanks: 1
Just tell me how, I can't do it, here is the code:

#region QuestGiver
case 9040:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello, if you can give me a RedRose I will give you a nice reward, what reward it is you say? It's a surprise!"));
GC.AddSend(Packets.NPCLink("I collected them.", 1));
GC.AddSend(Packets.NPCLink("Ok I will go.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.InventoryContains(723454, 1))
{
GC.MyChar.RemoveItem(GC.MyChar.NextItem(723454));

GC.MyChar.CPs += 50000;
GC.MyChar.MyClient.LocalMessage(2000, "You have got 50k CPS For The Quest Please Say Thx For Xabi!");
}
}
break;
}
#endregion

I keep doing the quest many times, I want it only one time a day, or during the quest period.
BlackCitadel is offline  
Old 04/12/2011, 05:08   #4
 
elite*gold: 0
Join Date: Feb 2007
Posts: 320
Received Thanks: 17
Quote:
Originally Posted by BlackCitadel View Post
Just tell me how, I can't do it, here is the code:

#region QuestGiver
case 9040:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello, if you can give me a RedRose I will give you a nice reward, what reward it is you say? It's a surprise!"));
GC.AddSend(Packets.NPCLink("I collected them.", 1));
GC.AddSend(Packets.NPCLink("Ok I will go.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.InventoryContains(723454, 1))
{
GC.MyChar.RemoveItem(GC.MyChar.NextItem(723454));

GC.MyChar.CPs += 50000;
GC.MyChar.MyClient.LocalMessage(2000, "You have got 50k CPS For The Quest Please Say Thx For Xabi!");
}
}
break;
}
#endregion

I keep doing the quest many times, I want it only one time a day, or during the quest period.
not to be mean but people arent always going to do your stuff. So its best if you try it ^^
royboy01 is offline  
Old 04/12/2011, 13:46   #5
 
elite*gold: 0
Join Date: Oct 2008
Posts: 65
Received Thanks: 1
This forums is useless as you are , I am out of this forum, Thanks for being soooooo helpful, seems you don't want to share your info to others, that's it!!! this is your life guys!!
You didn't even tell me HOW TO DO IT? Not a 1 2 3 4 5 (10 years old child) guide. Heh.
BlackCitadel is offline  
Old 04/12/2011, 16:21   #6
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
The reason we aren't just 'doing it for you' is because you should be learning this stuff. The answer has been posted in a number of guides across the forum. If you did some simple searching (say for 10 exp ***** per day... lotto plays per day... etc) you'd find all sorts of answers.

Leading you to those (including how to find basic information yourself without being spoon fed) is the best thing we can do to help you LEARN.

Epvp is not (or at least should not) be about just getting other people to solve your problems for you. They should be pointing you in the right direction and when needed posting some of their knowledge to help you along the way.


Best of luck,
P4N
pro4never is offline  
Old 04/12/2011, 16:46   #7
 
elite*gold: 0
Join Date: Oct 2008
Posts: 65
Received Thanks: 1
You guys always have the same problem suffering from it, You always say this word (10 exp ***** per day) you didn't even say, for example 10 exp ***** the characyer use per day, or 10 exp ***** getting it from doing a quest........
BlackCitadel is offline  
Old 04/12/2011, 17:03   #8
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
What you should be asking yourself when you face this sort of a problem is... "what common things need to be limited use per day"... well the obvious answer would be exp ball usage, lotto usage or gw rewards... those are some of the main ones.

You then try searching those sorts of things and dig through the results till you find an example, someone else asking the question or a release.

Again... these are basic skills you should be learning as you develop your coding skills.
pro4never is offline  
Old 04/12/2011, 20:32   #9
 
{ Angelius }'s Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 991
Received Thanks: 1,107
@BlackCitadel

if (whatever)// = if !

so if you know at least the basics you'll figure whats wrong here is some info about it

so we know (if) is checking weather the answer is yes or no
so....
if (YourName == "BlackCitadel")
{
than the answer is YES and you are the thread creator Tadam!
}
else {}// what does it means !

else Means else !

however this way you are checking weather the answer was yes or no

so to check if the answer was YES you need something to check something to fill this if (EMPTY SPACE)

and that could be (bool, int , uint . etc )

in your case the closest answer wold be a bool !

public bool FreeToClaim = true;// gose to the Character.cs/Character Class

so now we should have something like

Quote:
if (GC.MyChar.FreeToClaim)
{
GC.MyChar.FreeToClaim = false;// changes the FreeToClaim that we added earlier to false ;
Give him the cps
}
else{Message("GO TO HELL you already claimed the free cps !");}
so far we did a check on that bullshit but dont you think that we need to save that FreeToClaim bool to make sure that the client want be able to claim the cps again on the next server restart !
yep we do but i think thats enough so far ,

and your code should look like

Quote:
if (Control == 1 && GC.MyChar.FreeToClaim)
{
GC.MyChar.FreeToClaim = false;
GC.MyChar.CPs+ 1000;
}
and so far you did make sure that the client well be able to claim it only 1 time each server restart

other ways you need to save it to the database where you are storing the characters info

and yep pro has already told you how to do it QE.(ladyLuck) take some time and try to figure how is it saving the lottouesd today and you'll find the answer .

Good Luck
{ Angelius } is offline  
Old 04/12/2011, 21:49   #10
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Actually what you showed is part of the character class so it will reset every time they re-log... but yes, decent start.


I'd strongly recommend looking at some coding tutorials such as mine that I did for coemu/cofuture sources ages back. They are far from perfect but basically what I tried to do was take basic coding concepts (Such as... dictionaries...) and then apply them to conquer servers so like "when do I use these, what are they for, how do I use them" etc.

There's a link in my 5095 coemu linklist in my siggy.
pro4never is offline  
Old 04/12/2011, 22:24   #11
 
elite*gold: 0
Join Date: Oct 2008
Posts: 65
Received Thanks: 1
OK, Thanks pro4never, I checked your link now, I am going to learn them carefully!!
But is this tutorial only for CoEmu 5095??? Doesn't work for 5165??
BlackCitadel is offline  
Old 04/13/2011, 01:21   #12
 
{ Angelius }'s Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 991
Received Thanks: 1,107
Quote:
Originally Posted by pro4never View Post
Actually what you showed is part of the character class so it will reset every time they re-log... but yes, decent start.
How Did i miss that one
{ Angelius } is offline  
Reply


Similar Threads Similar Threads
[Guide] how to make business with no time..
08/20/2023 - EO PServer Guides & Releases - 11 Replies
Here i will explain how to make your server business time =Zero it is so easy just follow the steps 1-open your Navicat 2-open cq_business 3-choose view for the bar on the top of the window 4-choose show/hide Columns 5-you will see alist containing all of columns of the tables 6-UNChECK the column Named time 7- you r done
How To Make a Person Go Red In No Time!
11/15/2008 - CO2 Guides & Templates - 70 Replies
Well Im New Here So Ill Do it As Simply And As Easy As I Can :) Step 1:get a hight lvl char as ur main & get a lv 70+ water to rev & get a lv 65+ warrior to dash with newb items Step 2 : go to adv zone choose eny spawn u like there step 3: make sure no1 knows its u on ur noobs Step 4: Now when u have choosen The Spawn Use The Warrior To Dash The Stack Apart The Archer Will Obviously Kill u Since u Flash Then Get Ur Water And Rev Ur Warrior,Run Few Screens Away With Ur Water...
Time to make a bot
07/14/2005 - Conquer Online 2 - 1 Replies
Okay guys... Let's all fire up our COPAC, or COPROXY, or whatever packet editor you use. Let's get those packets, Think of anything and everything you can and put the packets in here. I will start us off..... Walk down 1 step 0C 00 ED 03 46 09 12 00 AF 01 00 00 Walk Left 1 step 0C 00 ED 03 46 09 12 00 71 01 00 00 Walk Right 1 step 0C 00 ED 03 46 09 12 00 1D 01 00 00 Walk Up 1 step 0C 00 ED 03 46 09 12 00 03 01 00 00



All times are GMT +2. The time now is 16:13.


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.