EOSERV Forum > EOSERV > weapon effects repost
Topic is locked.
Page: << 1 >>
weapon effects repost
Author Message
Post #58327 weapon effects repost

 no credits for me just reposting so you have access to ananas weapon effect system! If you look at his original topic that he deleted for unknown reasons he said he didnt want credits either well he got um from me heres his guide..

Lets start with npc.cpp.
------------------------
Search for;
-----------

bool NPC::Walk(Direction direction)
{
    return this->map->Walk(this, direction);
}

Place below that;
-----------------

void NPC::Effect(Character *from, int effect, int damage)
{
    UTIL_PTR_LIST_FOREACH(this->map->characters, Character, character)
    {
        PacketBuilder builder;
    builder.SetID(PACKET_SPELLATT, PACKET_REPLY);
        builder.AddShort(effect);
        builder.AddShort(from->player->id);
        builder.AddChar(from->player->character->direction);
        builder.AddShort(this->index);//NPC map index number
       // builder.AddThree(damage);
        builder.AddShort(int(double(this->hp) / double(this->Data()->hp) * 100.0));
        builder.AddShort(0);

            if (character->InRange(this))
            {
                character->player->client->SendBuilder(builder);
            }
        }
}

Done with npc.cpp!
-----------------------------------------

Go to npc.hpp
-------------

Search for;
-----------

void Die(bool show = true);

Place below that;
-----------------

 void Effect(Character *from, int effect, int damage);

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;
-----------------

PACKET_SPELLATT = 44,

Nice! Done with packet.hpp.


Now! we go to world.cpp.
------------------------

Search for;
-----------
this->home_config.Read(this->config["HomeFile"]);

Place below that;
-----------------
this->effects_config.Read(this->config["EffectsFile"]);

Then search at the rehash() for;
----------------
this->home_config.Read(this->config["HomeFile"]);

Place below that;
-----------------
this->effects_config.Read(static_cast<std::string>(this->config["EffectsFile"]));

Done with world.cpp!
--------------------


Go to world.hpp
----------------

Search for;
-----------
Config home_config;

Add below that;
---------------

Config effects_config;
----------------------

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;
----------------
## Effects1File (string)
# Weapon Effects1 file
Effects1File = ./data/effects1.ini

Done with the config.ini!
-------------------------

Now go to your data folder and create an effects.ini

And fill it with the following file;

# Ananas his Weapon Effects #
# Goes like;
# (number).ItemID = (ItemID)
# (number).EffectID = (EffectID)
# (number).PlayerEffect = (EffectID)
#
#
# 1 = Small heal effect
# 2 = Small Heal Effect
# 3 = Small Heal Effect
# 4 = Small Fire
# 5 = Small Thunder
# 6 = Small Heal Effect
# 7 = Small Heal Effect
# 8 = Small Heal Effect
# 9 = Ultima Blast
# 10 = Fire from the sky
# 11 = Shield Effect
# 12 = Shield Effect
# 13 = Fire Ring
# 14 = Blizzard
# 15 = Energy Ball
# 16 = Tornado
# 17 = Small Fire
# 18 = Protection
# 19 = Boulders
# 20 = Admin Heal
# 21 = Ice from the sky
# 22 = Darkness Beam
# 23 = Darkness Hand
# 24 = Darkness Skull
# 25 = Fire Explosion
# 26 = Vines
# 27 = Darkness Wind
# 28 = Blue Magic Whirl
# 29 = Darkness Bite
# 30 = Shell
# 31 = Green Flame
# 32 = Spark
 
WAmount = 4
 
#Dagger doing energy ball
1.ItemID = 21
1.EffectID = 15
1.PlayerEffect = 27
 
#Gun doing explosion
2.ItemID = 365
2.EffectID = 13
2.PlayerEffect = 31

#Gun doing explosion
3.ItemID = 543
3.EffectID = 21
3.PlayerEffect = 27

Gun doing explosion
4.ItemID = 30
4.EffectID = 4
4.PlayerEffect = 17

Done!
-----

Now we go to map.cpp
And we search for;
------------------
npc->Damage(from, amount);

Add ABOVE that add;
---------------


int itemid, effectid;
for(int i = 0 ; i < static_cast<int>(this->world->effects_config["WAmount"]) ; i++){
itemid = static_cast<int>(this->world->effects_config[util::to_string(i+1) + ".ItemID"]);
effectid = static_cast<int>(this->world->effects_config[util::to_string(i+1) + ".EffectID"]);
    if(from->paperdoll[Character::Weapon] == itemid){
                npc->Effect(from, effectid, amount);
                    }
                }

Now we search for;
------------------
character_ptr->hp -= limitamount;

Add BELOW that;
---------------

    int itemid, effectid;
for(int i = 0 ; i < static_cast<int>(this->world->effects_config["WAmount"]) ; i++){
itemid = static_cast<int>(this->world->effects_config[util::to_string(i+1) + ".ItemID"]);
effectid = static_cast<int>(this->world->effects_config[util::to_string(i+1) + ".PlayerEffect"]);
       if(from->paperdoll[Character::Weapon] == itemid)
       {
           character_ptr->Effect(effectid, true);
       }
Done!!!!!!

13 years, 16 weeks ago
Post #58328 Re: weapon effects repost

I removed it because its basically copy and pasting bytes and data, as apollo likes to call it that way. You can only say its your own work if you create your own emulator.


I don't see the use of releasing anything which you can't even claim to have made your own, so there is no need to share this with the community. It just shows you're wasting time to help others.

---
"Pineapples and shit."
13 years, 16 weeks ago
Post #58332 Re: weapon effects repost

I found this in my trunk license

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software.


Ananas you havnt copy and pasted bytes after 1052 posts on the eoserv community most of which were helping someone/guides/tutorials skill masters or some other sick release you are the man!

Makes me feal like i am the copy and paste king of the world then and i might never be smart enough to build my own emulator! Ive looked up to you since I started with eoserv over a year ago and I dont care what anyone says this is an example of one of your works!

13 years, 16 weeks ago
Post #58351 Re: weapon effects repost
Ananas posted: (12th Jan 2011 10:59 am)

I removed it because its basically copy and pasting bytes and data, as apollo likes to call it that way. You can only say its your own work if you create your own emulator.


I don't see the use of releasing anything which you can't even claim to have made your own, so there is no need to share this with the community. It just shows you're wasting time to help others.


I like the fact he's releasing code. There should be a resources sub forum or something specifically made for code. :)
13 years, 16 weeks ago
Post #78872 Re: weapon effects repost

after i add all the code do i save it or wat?

my first time doing code thingy :)

12 years, 49 weeks ago
Post #79272 Re: weapon effects repost

Great guide!

And no you don't "save" it :p.

You have to compile and Insom, I wish all your guides and other people's guides were as detailed as this :P

Btw 2 errors 1 warning:

C:\Documents and Settings\TaetmM\Desktop\trunk189\src\map.cpp||In member function 'bool Map::AttackPK(Character*, Direction)':|
C:\Documents and Settings\TaetmM\Desktop\trunk189\src\map.cpp|1549|error: a function-definition is not allowed here before '{' token|
C:\Documents and Settings\TaetmM\Desktop\trunk189\src\map.cpp|1995|error: expected '}' at end of input|
C:\Documents and Settings\TaetmM\Desktop\trunk189\src\map.cpp|1995|warning: control reaches end of non-void function|
||=== Build finished: 2 errors, 1 warnings ===|

Edit : Fixed

12 years, 49 weeks ago
Post #79310 Re: weapon effects repost

Very nice guide Insomniac

12 years, 49 weeks ago
Post #79341 Re: weapon effects repost

If you use the search bar and type in (Feature Release) or something like (Adding effects) then stuff as cool and old as this will show up. :D

12 years, 49 weeks ago
Post #87691 Re: weapon effects repost

Nice but
command = arguments.front().substr(1);
There was a Y or something in there xD

12 years, 42 weeks ago
Post #90975 Re: weapon effects repost

I followed the guide perfectly, and weapon effects still do not work. Any reason on why that could be?

12 years, 40 weeks ago
Post #123815 Re: weapon effects repost

Any update for new Revision, Having some troubles with packet.hpp being completely changed. and having issues., 

C:\Users\....\EOSERV\trunk\src\npc.cpp:516:57: error: declaration of 'void NPC::Effect(Character*, int, int)' outside of class is not definition [-fpermissive]

C:\Users\....\EOSERV\trunk\src\npc.cpp:517:1: error: expected unqualified-id before '{' token

12 years, 15 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > weapon effects repost