EOSERV Forum > EOSERV > Making a spell doing more than 1 thing?
Page: << 1 >>
Making a spell doing more than 1 thing?
Author Message
Post #201745 Making a spell doing more than 1 thing?

So I have some ideas for spells. Not too sure how the editpub works and what restrictions there are.

I want to have a spell such as boulders, do damage while also lowering an enemies armor/defense, or something like mana.

Another I have thought of, is a spell that can steal an enemies HP, such as a quarter of it.

Is this possible? How hard would it be?

Also, what do you know about PVP in EO? Does PVP work well with spells?

What about up-close-only spells? Where spells can only be performed when you are attacking an NPC/person?

7 years, 19 weeks ago
Post #201749 Re: Making a spell doing more than 1 thing?

You'd have to modify your rev if you want to do those things. I'll write up a system for it now if you want

---
stay tuned.
7 years, 19 weeks ago
Post #201756 Re: Making a spell doing more than 1 thing?

I would recommend useing some of the unk values this was compiled in an old source "189" so you will need to modify it a bit to work with newer reversions this is my ESF::Read function in eodata.cpp with all unk values working https://tehsausage.com/paste/eodata-cpp-spells-7a62 and my esf_data struct in eodata.hpp https://tehsausage.com/paste/eodata-hpp-spells-7c76 . I wrote a function to steal hp along time back but im not able to find it atm.. basicly in your spell handler or Map spell functions just check

//hp absorbtion spell

 if ((spell->unka == chosen_value)
{
     if ((npc->Data()->type == ENF::Aggressive || npc->Data()->type == ENF::Passive)&& npc->alive)
     {
          int amount = util::rand(spell->mindam, spell->maxdam);
          npc->SpellDamage(from, amount, spellid, targetid);
       
         bool updated = false;
         if (character->hp < character->maxhp)
        {
            character->hp += character->maxhp * double(amount);
            character->hp = std::min(character->hp, character->maxhp);
            updated = true;
        }
       
        if (updated)
        {
            if (character->party)
            {
                character->party->UpdateHP(*character);
            }

            PacketBuilder builder(PACKET_RECOVER, PACKET_PLAYER);
            builder.AddShort(character->hp);
            builder.AddShort(character->tp);
            builder.AddShort(0); // ?
            character->Send(builder);
        }
     }
 }

If you were to use a function like this I would recommend placeing it in a function a returning it before the rest of the code executes or just go inside your existing spell function and after it checks the npc types spell types calculates damage then run if (spell->unkvalue == value) { character hpgain ect ect update recover packet ect}
7 years, 19 weeks ago
Page: << 1 >>

EOSERV Forum > EOSERV > Making a spell doing more than 1 thing?