Author | Message | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ![]() This is a basic fishing system that I wrote. It uses the .ini file settings from Ananas' harvesting system. I have only tested this on r187 so you can try on other revisions if you would like. What this does is, if you are on a specific coordination facing a specific direction with a fishing rod, and you press ctrl it will say "Waiting for a bite.." then after 10 seconds (im going to make it a random time between 10-60seconds when i could be bothered) it will either say "Youhave caught a fish +name+" and give u the item or "You failed to catch a fish +name+". This probably will be a long process that you are going to follow very closely. First we will edit the "character.cpp" file. Now find this line (around about line 131):
And ADD BELOW it:
This is the end of editing "character.cpp" Now to edit "character.hpp" Find this line (around about line 91):
And ADD BELOW it:
This is the end of editing "character.hpp" Now to edit "Attack.cpp". Find this line (around about line 42):
And ADD BELOW it:
This is the end of editing "Attack.cpp". Now to edit "World.cpp" Find these lines (around about 49-64):
And ADD BELOW them:
Now find this line:
And ADD BELOW it:
Now find these lines:
And ADD BELOW them:
Now find this line:
And ADD BELOW it:
This is the end of editing "world.cpp" Now to edit "world.hpp" Find this line:
And ADD BELOW it:
Find this line:
And ADD BELOW it:
This is the end of editing "world.hpp" You can now compile your source. If it doesn't compile successfully please post with your errors. Not finished yet :P Now to make an .ini file You will need to go to your trunk/data directory and either Create a new text document and rename it to "fish.ini", or you could copy and paste one of the existing .ini files and rename it to "fish.ini". Once you have an .ini file you will need to add the contents. Open up your "fish.ini" file and put this inside it.
Now save your "fish.ini" file. Now you will need to open your config.ini file. Find this:
And BELOW ADD this:
Now save your "config.ini" file. Your server should now have a working fishing system. If anything goes wrong ill try my hardest to fix it. Please tell me if any of the tutorial doesn't make sence. Thanks, Grazza
|
| ![]() So far so good, untill I reach the Config.ini for the formulas can't find that at all, But I do remember needing it before and finding it, but i cant seem to find it now, Where exactly is this located?
|
| ![]() Just to make sure, What does the fishing column in your database do? --- "Pineapples and shit."
|
| ![]() @helper, Go to your config.ini and press ctrl+F for the search box to pop up and type in FormulasFile, it will lead you straight to what your looking for.
|
| ![]() Okay But where is this at: Open your databas file manager and execute this query:
|
| ![]() Ananas posted: (1st May 2010 06:23 am) It checks if the player is fishing.. im not sure if it actually works.. that code is pretty buggy as u can probably see lol @Helper You must execute that line of code in you database manager (sqliteman or heidisql or whatever) or just make another column in the characters table called fishing with integer status and default is 0.. if you understand that
|
| ![]() Ya I can see that. Enplanes maybe why He just Released another Fishing code the a 1/3 of urs XD.
|
| ![]() Grazza, Its very easy to do that without adding it to the database. It cost space. this->fishing = 0; Character.hpp int fishing; Then do an if statement (You probably have that one) --- "Pineapples and shit."
|
| ![]() im pretty sure his doesnt have a timer in his but i havent looked at it ahh ok thanks ananas ill stick that in now and change it
|
| ![]()
..\src/npc.hpp:170: error: call of overloaded 'NPC(Map*&, short int&, unsigned char&, unsigned char&, unsigned char&, short int&, unsigned char&, bool&)' is ambiguous
|
| ![]() Uhm i dont think he says edit the npc one. It looks like your fishing has compiled erm i dont know thats not a error related to the stuff u just added though.
|
| ![]() hey guys im at this part
--- stay tuned.
|
| ![]() You don't change anything. You just add that into attack.cpp and done. The weapon and (dir)ection can be added in the .ini file you create later on. --- "Pineapples and shit."
|
| ![]()
--- stay tuned.
|
| ![]() andrewbob1 posted: (16th Sep 2010 10:26 pm)To do that you need to edit the "fishcatch" function in world.cpp Replace it with this code to be able to catch two fish(it will load "ItemID2" from the fish config), I don't think it's the best way but it still works.
|