help with quality system

02/24/2013 02:06 LordGragen.#1
hi there i am trying to create my new quality system but i am having little hard time here and any help will be thankful.


so as we know the quality system works with dragon ball, you give 1 db it will make it refine you give 2 it will make it unique etc etc

but i wane make this new system that lets say your item in normal you use this item (121213) to upgrade your normal to refine,

but then to make the refine to unique you use different stone (43343)

but i am having trouble thinking how to make this. anyone can give me idea?

also here is my quality upgrader if need by any chance.

02/24/2013 11:21 go for it#2
simply use that npcs it's all coded there
it does everything you want at the default
at
Code:
var item = client.Equipment.TryGetItem(client.SelectedItem);
var itemdetail = Rise_Of_Medusa.Database.ConquerItemInformation.Bas eInformations[item.ID];
it get the item and it's details
do whatever checks you want
for quality check do a simple method there to check for the last digit for the item id and make a enum so it makes life easier
then do your check
if item.quality = refind
if entity inventory contains whatever
if(entity inventory remove whatever) [i prefer it an if cuz the method is bool , more secure on the long turn]
then clone the old item
remove it
add the new item with better quality
or even update it

p.s that is not the private server discussion , it should be there :)
02/24/2013 21:52 pro4never#3
#reported

This section is for official conquer server discussion. Nothing related to private servers should be in this section.

A mod will move this for you.
02/28/2013 21:49 EgyptianMano#4
Quote:
var item = client.Equipment.TryGetItem(client.SelectedItem);
var itemdetail = Rise_Of_Medusa.Database.ConquerItemInformation.Bas eInformations[item.ID];
byte Quality=item.ID%10;
uint NeededStoneId=121213;// norm-> ref
if(Quality==6) NeededStoneId=43343; //when ref-> uniq
else if(Quality==7) NeededStoneId=??????; //when uniq-> Eli
else if(Quality==8) NeededStoneId=????; //when eli-> super
if(client.hasitem(NeededStoneId))
{
//do ur upgrading codes here
//remove the NeededStoneId item
//u r now good to go
}

Note : as Go for it said , making an enum with quality vals is always a good idea
02/28/2013 22:39 pro4never#5
You may want a bit of extra logic in there.

#1: Fixed items cannot be upgraded, check if it's fixed quality
#2: There are multiple versions of normal items, Math.Max(5, quality) would work if you know it's not fixed already
#3: Personally I feel it's good coding practice to have a helper method to getUpgradeStoneID(quality). It makes your code easier to read and easier to change in the future.
#4: Switch statements are your friends.