is this bad? cps drop way

12/19/2013 18:35 marcbacor6666#1
Code:
 if (killer.MapID == 1000)
                    {
                        killer.Money += 500;
                        killer.ConquerPoints += 90;
                        killer.Owner.Send(new Network.GamePackets.Message("You killed " + Name + " and earned 90 cps and 500 silver!", System.Drawing.Color.Red, 2005));
                    }
Code:
if (killer.MapID == 1002)
                    {
                        killer.Money += 600;
                        killer.ConquerPoints += 100;
                        killer.Owner.Send(new Network.GamePackets.Message("You killed " + Name + " and earned 100 cps and 600 silver!", System.Drawing.Color.Red, 2005));
                    }

and

soon
12/19/2013 19:06 abdoumatrix#2
i prefer this
12/19/2013 19:06 killersub#3
What are you trying to ask?

Seems to me like you're just giving money/CPs to the character after killing a monster in a specific map.

That looks about right but maybe you can make it better.
12/19/2013 19:32 Aceking#4
If it was me, I would add a field to the map database and populate that field with the drop amount.

Then you would simply do something like:

Player.CP += Player.Map.CPDrop

Would save going through switches or a bunch of if statements
12/19/2013 19:34 marcbacor6666#5
Quote:
What are you trying to ask?

Seems to me like you're just giving money/CPs to the character after killing a monster in a specific map.

That looks about right but maybe you can make it better.
yup :) im asking if its bad if i make the drops like that. "will it affects the server performance" like stability, memoryusage, cpuusage , something like that."
12/19/2013 20:31 Super Aids#6
Why do you hardcode it?
Store it in a table in your database and make it dynamic.
12/19/2013 21:05 pro4never#7
As ^ said. Your system is pretty difficult to edit and not overly scalable.

In redux I just create a drop rule. It lets you add a line to database to control as many drops or gains as you want for a specific ID. Can be easily expanded to link up with quests as well!


EG:
On killing mob Id X there's Y percent chance to drop a(n) Z

It uses types so it supports ground items (drops), inventory items (quest items), inventory cp and inventory gold.

Take a look at that source if you want an example of how to handle it.
12/19/2013 21:20 marcbacor6666#8
Thank you very much for the reply guys :)
12/20/2013 03:06 .Light#9
Yeah isn't this how its coded by default in all the egypt sources. Super Aids is right, if I were you I would definitely make it changeable from the database. Should be pretty simple to code if you look at some of the sources released here.

On another note, if this source is just for you and you don't mind having to edit the code to change everything, keep it how it is.

If you're planing on releasing it, as sad as it is, most people won't know how to edit that stuff anyway so you'd have to either make a guide for everything or put it in the database (:
12/20/2013 16:21 marcbacor6666#10
i will try to make some tutorials if im done on my server im currently making a quest base on SwordARtOnline movie. the 100 room bosses.

i did that cps implementation cuz i want the map have different cps drops depends on map level sample the twincity is mostly level 1 + map. so it have the lowest cps drop something like that.

i will try to look at the public sources that been sticked here :) thanks guys for helping