Ananas
Moderator
Joined: 22nd Apr 2009
Posts: 2190
Ananas Weapon Effect System
EDIT: During the fact that we can't claim our own work. Or deserve the credits for it. I'm forced to remove it. Incase you do want it then contact me. (Don't reply in this topic or don't create a new topic asking for it. Smart people will know how to do it.)
Hello guys and girls!
As I promised. If I did promise..
Here is a tutorial how to add Weapon Effects!
This has been done on my way without the packet_effect, packet_agree.
You're probably thinking, "Why so ananas?". Well..
PACKET_EFFECT, PACKET_AGREE only places an effect on the spot.
So lets say an epic fast monster chases you and you shoot it.
The effect stays on the tile wile the monster moves.
So I made my own function. In NPC.CPP!(And NPC.HPP)
Ok Lets get started.
What do we need?
----------------
You'd need some copy+pasting skills.
Some common sense.
Lets start with npc.cpp.
------------------------
Search for;
-----------
bool NPC::Walk(Direction direction)
{
return this->map->Walk(this, direction);
}
Place below that;
-----------------
<Code it yourself ^^> Or ask me if you really want it.
Done with npc.cpp!
-----------------------------------------
Go to npc.hpp
-------------
Search for;
-----------
void Die(bool show = true);
Place below that;
-----------------
<Code it yourself ^^> Or ask me if you really want it.
Done with npc.hpp!
------------------
Now.. if you don't got the spells in your server etc. then you would need to add the packets (PACKET_SPELLATT)
Open packet.hpp
---------------
Search for;
-----------
PACKET_BOARD = 43,
Place below that;
-----------------
<Code it yourself ^^> Or ask me if you really want it.
Nice! Done with packet.hpp.
Now! we go to world.cpp.
------------------------
Search for;
-----------
this->home_config.Read(this->config["HomeFile"]);
Place below that;
-----------------
<Code it yourself ^^> Or ask me if you really want it.
Then search at the rehash() for;
----------------
this->home_config.Read(this->config["HomeFile"]);
Place below that;
-----------------
<Code it yourself ^^> Or ask me if you really want it.
Done with world.cpp!
--------------------
Go to world.hpp
----------------
Search for;
-----------
Config home_config;
Add below that;
---------------
<Code it yourself ^^> Or ask me if you really want it.
----------------------
Done with world.hpp.
--------------------
Go to your config.ini and search for;
-------------------------------------
## HomeFile (string)
# Spawn point and innkeeper data
HomeFile = ./data/home.ini
Add below that;
----------------
<Code it yourself ^^> Or ask me if you really want it.
Done with the config.ini!
-------------------------
Now go to your data folder and create an effects.ini
And fill it with the following file;
<Code it yourself ^^> Or ask me if you really want it.
Done!
-----
Now we go to map.cpp
And we search for;
------------------
npc->Damage(from, amount);
Add ABOVE that add;
---------------
<Code it yourself ^^> Or ask me if you really want it.
Now we search for;
------------------
character_ptr->hp -= limitamount;
Add BELOW that;
---------------
<Code it yourself ^^> Or ask me if you really want it.
Done!!!!!!
Enjoy your weapon effects! If I forgot something then please let me know! Errors? Please post below!
No need to make seperated topics.
---
"Pineapples and shit."
14 years, 35 weeks ago
|
Miksu

Joined: 4th Jun 2009
Posts: 1457
Re: Ananas Weapon Effect System
Okay, this pwns ;P Thanks for sharing this. this might come handy too :P
Edit; I test it right away =)
---
Eoserv classes: Forum ghost, test player, ex-server owner, TOP 50, mapper & an
oldbie
14 years, 35 weeks ago
|
Klutz

Joined: 14th Jul 2009
Posts: 1737
Re: Ananas Weapon Effect System
Here's an interesting thought, Ananas, Have you thought about making a weapon effect for transferring the enemy HP to your own? =p
---
Web developer, currently looking for graphic artists / designers.
14 years, 35 weeks ago
|
Ananas
Moderator
Joined: 22nd Apr 2009
Posts: 2190
Re: Ananas Weapon Effect System
Now thats something to look at :] Good idea. If no one else figured it yet then I will release it.
---
"Pineapples and shit."
14 years, 35 weeks ago
|
lewis999

Joined: 27th Aug 2010
Posts: 368
Re: Ananas Weapon Effect System
Klutz posted: (5th Sep 2010 05:46 pm)
Here's an interesting thought, Ananas, Have you thought about making a weapon effect for transferring the enemy HP to your own? =p
That's a good idea :)
I might work on this if I have the time.
14 years, 35 weeks ago
|
Re: Ananas Weapon Effect System
Wow, This is nice, I'll add this right away!
Okay, I get this error C:\Documents and Settings\Owner\Desktop\Rev 189 Compiled\src\handlers\Talk.cpp|1248|error: expected '}' at end of input|
I don't know if this is due to what i've added of yours, I'll see if I can fix this.
EDIT: I don't know if this is my compiler but, when I get those errors ^ It points to the bottom of the page, I was told it's because the newer CodeBlocks Compilers do that.
14 years, 35 weeks ago
|
Ananas
Moderator
Joined: 22nd Apr 2009
Posts: 2190
Re: Ananas Weapon Effect System
xIFearlessIxx posted: (5th Sep 2010 06:39 pm)
Wow, This is nice, I'll add this right away!
Okay, I get this error C:\Documents and Settings\Owner\Desktop\Rev 189 Compiled\src\handlers\Talk.cpp|1248|error: expected '}' at end of input|
I don't know if this is due to what i've added of yours, I'll see if I can fix this.
When I take a good look at my tutorial I can't find the problem. You could be pasting over a "}" and then deleted it. Do note its in talk.cpp :]
---
"Pineapples and shit."
14 years, 35 weeks ago
|
Re: Ananas Weapon Effect System
Read my edited post, and yea, I must have not noticed this, when I compiled it before.
EDIT: Yes I fixed it. Missed a } on mute command.
14 years, 35 weeks ago
|
DanScott

Joined: 19th Aug 2010
Posts: 1212
Re: Ananas Weapon Effect System
find
this->hp -= amount;
in npc.cpp and add
opponent->attacker->hp += amount;
see if that works?
---
If money doesn't grow on trees, then why do banks have branches?
14 years, 35 weeks ago
|
Ananas
Moderator
Joined: 22nd Apr 2009
Posts: 2190
Re: Ananas Weapon Effect System
You would of need the the recover packets etc so just that won't work.
---
"Pineapples and shit."
14 years, 35 weeks ago
|
Re: Ananas Weapon Effect System
just awesome.. i cant wait for more releases :D
14 years, 34 weeks ago
|
clive
Joined: 6th Aug 2009
Posts: 936
Re: Ananas Weapon Effect System
Awesome Ananas people should give you a +1.
---
opensource isometric game engine ~ www.avac-engine.blogspot.com
14 years, 34 weeks ago
|
Wizzle
Joined: 31st Aug 2010
Posts: 64
Re: Ananas Weapon Effect System
1 word Perfect!
tested with both mysql (external) and sqlite
14 years, 34 weeks ago
|
lance317
Joined: 16th Jun 2010
Posts: 48
Re: Ananas Weapon Effect System
Ok i added everything, jus need a point out to where i add the item id, and effect id, pls so i dont mess up anything thx ananas for the release btw
14 years, 34 weeks ago
|
Re: Ananas Weapon Effect System
14 years, 34 weeks ago
| | | | | | | | | | | | | | | |