Author Topic: [Guide] How to not post each time I have a question!  (Read 1786 times)

Offline Asmodeus

  • Inner Circle
  • Mirror
  • *
  • Posts: 494
  • Zaken
  • Awards Searched by gold diggers, loved by Mama Tryskell. Half russian, half greek.
[Guide] How to not post each time I have a question!
« on: September 16, 2015, 10:33:55 AM »
Ok guys, I've been sick seeing posts all over the forum(and not only this forum) asking easy-as-fuck stuff to be made per request.

First of all none, inner circle or not, is not obligated to create your customs. If you're starting a server you're obligated to:
  • Knowing enough english to understand guides or describing exactly the problem to avoid wasting time.
  • Being able to maintain the gameserver you host(that brings money to most of you).

You don't have to be a proffesional programmer to create simple custom stuff, since most of your requests are done already inside the acis code. You just have to use your brain and find the similar methods, copy them and make a few tweaks.

Eclipse has a powerful search tool that helps a lot with finding stuff.

I'll make a basic tutorial on how to use it:

Let's say I want to make a custom drop rate for a specific item... Hmmmm, let's think what is already using a specific drop rate for an item? OH! Adena uses a drop rate for the item!

Let's check how it works, I'll "open" file and find the configuration line for adena.

Okay, so let's use eclipse to find out what this configuration represents.

Go to your acis_gameserver project and click on "java". Then place your mouse over "Search" and click "File.."

As you can see, "Selected resources" tab is selected because you have clicked on "java". That means your search will look for the selected string in all files included in java folder. In our case RateDropAdena

Looks like we found a result. Click on it.

It takes you to the line
Code: [Select]
RATE_DROP_ADENA = server.getProperty("RateDropAdena", 1.);
server.getProperty reads variables from and the code reads the RateDropAdena line. the second parameter is the default value, the default value is used if nothing is setted in the .properties file.

So when the file is read, it sets RATE_DROP_ADENA from the file.

Let's use again the search function, this time looking for "RATE_DROP_ADENA"

L2Attackable is about npc's that can be killed so we will look into it. We got 2 results which are actually the same but are included in different drop/reward methods.

However the code is the same for both cases:

Code: [Select]
		if (drop.getItemId() == 57)
dropChance *= Config.RATE_DROP_ADENA;

Now you know how adena drop rate works.. All you have to do is to copy the stuff we looked for, and change "adena" to something else. Let's say Event Glitering Medal(ID:6393).

So you make a configuration option and add bellow the adena drop rate a new check like
Code: [Select]
		if (drop.getItemId() == 57)
dropChance *= Config.RATE_DROP_ADENA;
else if (drop.getItemId() == 6393)

This guide is not to make a new configurable drop rate but to show you how to use eclipse and not begging around for simple codes.
« Last Edit: September 16, 2015, 12:35:06 PM by Asmodeus »
"Scissors are fine, please nerf Paper" -Rock