EOSERV Forum > EOSERV > Law and Marriage[Release]
Page: << 1 2 3 4 >>
Law and Marriage[Release]
Author Message
Post #44568 Law and Marriage[Release]

Decided to finish marriages, and lawbob while I try finishing quests. I will try giving a detailed guide to adding this, but if you can't; I don't want useless posts on having me clarify. If you get errors, first recheck that you added everything, then post.

Add this to config.ini
http://pastebin.com/4AZPkdNr

Goto main.cpp and paste this under the function main:
        eoserv_config_default(config, "LawMarriageCost"    , 500);
        eoserv_config_default(config, "LawDivorceCost"     , 10000);
        eoserv_config_default(config, "WeddingArmorFemale" , 163);
        eoserv_config_default(config, "WeddingArmorMale"   , 133);
        eoserv_config_default(config, "WeddingLevelNeeded" , 5);
        eoserv_config_default(config, "WeddingStartDelay"  , 20);
        eoserv_config_default(config, "PriestDialogInterval", 7);
        eoserv_config_default(config, "WeddingRing"        , 374);
        eoserv_config_default(config, "WeddingEffects"     , "1,11,4");
        eoserv_config_default(config, "WeddingMusic"       , 10);


Create a new file in "handlers" called Priest.cpp and Law.cpp
Add this into the file Priest.cpp: http://pastebin.com/ymupbGSA
Add this into the file Law.cpp: http://pastebin.com/tYeHXpcc


This next part could be confusing, since it deals with adding the packets. You will be jumping around from lots of files. Try to keep up.

In eoclient.cpp around lines 90-128 add these lines:
        CLIENT_F_HANDLE(PACKET_PRIEST,Priest);
        CLIENT_F_HANDLE(PACKET_LAW,Law);

In eoclient.hpp around lines 124-163 add these lines:
        CLIENT_F_FUNC(Priest);
        CLIENT_F_FUNC(Law);

In eoserver.cpp around lines 79-118 add these lines:
                QUEUE_F_HANDLE(PACKET_PRIEST,Priest);
                QUEUE_F_HANDLE(PACKET_LAW,Law);

In packet.cpp around lines 18-63 add these lines:
        case PACKET_PRIEST: return "Priest";
        case PACKET_LAW: return "Law";
        case PACKET_MUSIC: return "Music";
then in packet.cpp around lines 71-103 add this line:
        case PACKET_STOCK: return "Stock";

In packet.hpp around lines 14-60 add these lines:
    PACKET_PRIEST = 46,
    PACKET_LAW = 47,
    PACKET_MUSIC = 40,
then in packet.hpp around lines 65-102 add this line:
    PACKET_STOCK = 26,

Add this to eoconst.hpp: http://pastebin.com/f90mfn8Z

Add this into npc.hpp: http://pastebin.com/aK9hV42Q
In npc.hpp, go into the NPC class, and right under this line:
NPC_Citizenship *citizenship;
Add:
NPC_Marriage *marriage;

Also in npc.hpp under NPC class add this line:
void ShowDialog(std::string message);

Then in npc.cpp, under the function NPC::NPC(...) add this line:
this->marriage = 0;

Also add this into npc.cpp: http://pastebin.com/mFc7A0cH

Go to "headers>fwd>npc.hpp" and add this code:
struct NPC_Marriage;

Add this into world.cpp, towards the top: http://pastebin.com/ntczruRZ

If you want marriages to require you put your wedding rings on when the priest asks, put this into world.cpp, towards the top instead of the other:

http://pastebin.com/d1xjryVG


In world.cpp, under the function World::World(...) around lines 368-378(should look similar to this code) add:
    event = new TimeEvent(world_execute_weddings, this, 1.0, Timer::FOREVER);
    this->timer.Register(event);
    event->Release();

Add this code into character.hpp, under the class Character:
std::string fiance;

Add these codes into character.cpp:

Under the function Character::Character(...) add:
this->fiance = GetRow<std::string>(row, "fiance");

This will be a bit difficult to explain. I will give an example so you understand
Look under Character::Save() and try finding this peice of code:
"UPDATE `characters` SET `title` = '$', `home` = '$', `fiance` = '$', `partner` = '$', `class` = #, `gender` = #, `race` = #, "
One thing will be different from mine, to yours; it's that I have "`fiance = '$', ". Add this into the exact same spot I have it. Do not copy/paste this code into your save, if you have edited this before.

Now look for this peice of code(it will be a little bit under what you just added)
this->title.c_str(), this->home.c_str(), this->fiance.c_str(), this->partner.c_str(), this->clas, this->gender, this->race,
Once again, there will be somethng different between mine and yours. Add "this->fiance.c_str(), " into there, exactly like I have it. Do not copy/paste this code into your save, if you have edited this before.



Credit to Apollo and Bart for having the packet info for marriages. They have helped out a lot.


Note: I have heard that there should be wedding music playing, I'm not sure if the packet is working correctly. The WeddingMusic config value is just a random number, change if you know the correct one.


Errors post here. I may have forgotten something, so don't be afraid to post.

---
http://www.addipop.com
14 years, 24 weeks ago
Post #44569 Re: Law and Marriage[Release]

Lovely release, Adding it now. Ill edit this post with what happens!


Edit : Fixed it

Edit2 : Testing it now.

---
Create your own destiny, don't let someone else do it for you.
14 years, 24 weeks ago
Post #44574 Re: Law and Marriage[Release]

Almost done compiling no errors so far :]

---
Fate-Gaming/Forgotten Memories Owner.
14 years, 24 weeks ago
Post #44575 Re: Law and Marriage[Release]

Just added it, i will let you know if it works with my server once i get this updating map thing sorted.

14 years, 24 weeks ago
Post #44582 Re: Law and Marriage[Release]

You've forgot about rings equipment check...

14 years, 24 weeks ago
Post #44583 Re: Law and Marriage[Release]

Also if you don't have 500 gold and you talk with Law Bob about the person you wan't to marry and you enter his/her name then it agrees.

---
"Pineapples and shit."
14 years, 24 weeks ago
Post #44595 Re: Law and Marriage[Release]


..\obj\Release\src\eoclient.o:eoclient.cpp:(.text+0x100d)||undefined reference to `EOClient::Handle_Priest(PacketFamily, PacketAction, PacketReader&, int)'|
..\obj\Release\src\eoclient.o:eoclient.cpp:(.text+0x103e)||undefined reference to `EOClient::Handle_Law(PacketFamily, PacketAction, PacketReader&, int)'|
..\obj\Release\src\eoserver.o:eoserver.cpp:(.text+0x923)||undefined reference to `EOClient::Handle_Law(PacketFamily, PacketAction, PacketReader&, int)'|
..\obj\Release\src\eoserver.o:eoserver.cpp:(.text+0x971)||undefined reference to `EOClient::Handle_Priest(PacketFamily, PacketAction, PacketReader&, int)'|
||=== Build finished: 4 errors, 9 warnings ===|

14 years, 24 weeks ago
Post #44607 Re: Law and Marriage[Release]


 

C:\Documents and Settings\Administrator\Desktop\R189\trunk\src\handlers\Priest.cpp|22|error: no 'bool EOClient::Handle_Priest(PacketFamily, PacketAction, PacketReader&, int)' member function declared in class 'EOClient'|
||=== Build finished: 1 errors, 0 warnings ===|

 

 

---
My skins dying because you're under it-
I’m done lying to myself for this.
For all the wonder in believing man it’s making me weak-
I’ll fade away & classify myself as Obsolete!
14 years, 24 weeks ago
Post #44609 Re: Law and Marriage[Release]

@Charizard and Evildark:

You both have left out a step. Recheck your work. (btw, different steps... obviously)

14 years, 24 weeks ago
Post #44614 Re: Law and Marriage[Release]

I get these two errors, They don't seem big issue, but i've tried and couldn't fix them.

\src\packet.hpp|444|error: duplicate case value|

\src\packet.hpp|407|error: previously used here|

14 years, 24 weeks ago
Post #44625 Re: Law and Marriage[Release]

I've got a small fix in Law.cpp (Law Bob)

As he doesn't check if you have the right amount of money.

Anyways, The case LAW_ACTION_MARRIAGE:


Add the bold lines in between;


case LAW_ACTION_MARRIAGE:
                    {
                        if (!this->player->character->partner.empty())
                        {
                            reply.SetID(PACKET_LAW, PACKET_REPLY);
                            reply.AddChar(LAW_ALREADY_MARRIED);
                            CLIENT_SEND(reply);
                        }

                        else if (this->player->character->HasItem(1) < static_cast<int>(this->server->world->config["LawMarriageCost"]))
                        {
                            reply.SetID(PACKET_LAW, PACKET_REPLY);
                            reply.AddChar(LAW_NO_GOLD);
                            CLIENT_SEND(reply);
                        }

                        else
                        {
                            this->player->character->DelItem(1, static_cast<int>(this->server->world->config["LawMarriageCost"]));

                            reply.SetID(PACKET_LAW, PACKET_REPLY);
                            reply.AddChar(LAW_FIANCE);
                            CLIENT_SEND(reply);

                            reply.Reset();
                            reply.SetID(PACKET_ITEM, PACKET_STOCK);
                            reply.AddShort(1);
                            reply.AddThree(this->player->character->HasItem(1));
                            CLIENT_SEND(reply);
                            this->player->character->fiance = partner;
                        }
                    }


A small fix, Tell me if I'm wrong about this.

---
"Pineapples and shit."
14 years, 24 weeks ago
Post #44629 Re: Law and Marriage[Release]

i got these errors- 


\src\packet.hpp: In static member function 'static std::string PacketProcessor::GetFamilyName(PacketFamily)':

\src\packet.hpp:444: error: duplicate case value

\src\packet.hpp:440: error: previously used here

Process terminated with status 1 (0 minutes, 39 seconds)

2 errors, 17 warnings

 

---
I noticed when I walked in the room went dark somebody better call the police there's a guy here
with no heart he said he goes by the name of TechNo he's on a war path and he said if anybody
touches the crown he's gonna tear them apart and a grime MC was telling me I kill them and i put
them in a cemetery!
14 years, 24 weeks ago
Post #44687 Re: Law and Marriage[Release]

It worked perfect for me nice release addison

---
Fate-Gaming/Forgotten Memories Owner.
14 years, 24 weeks ago
Post #44703 Re: Law and Marriage[Release]
techNo posted: (23rd Jul 2010 10:53 am)

i got these errors- 


\src\packet.hpp: In static member function 'static std::string PacketProcessor::GetFamilyName(PacketFamily)':

\src\packet.hpp:444: error: duplicate case value

\src\packet.hpp:440: error: previously used here

Process terminated with status 1 (0 minutes, 39 seconds)

2 errors, 17 warnings

 


You probably have already removed a priest packet from Packet.hpp? So you need to remove it from Packet.cpp Search for this line

case PACKET_PRIEST: return "Priest";

You should have two if your getting that error.
Thanks to Apollo. for pointing it out
14 years, 24 weeks ago
Post #44728 Re: Law and Marriage[Release]

The code for Priest.cpp has all these #'s Anyone have a clean one?

14 years, 24 weeks ago
Page: << 1 2 3 4 >>

EOSERV Forum > EOSERV > Law and Marriage[Release]