EOSERV Forum > EOSERV > EOJobs: Update
Topic is locked.
Page: << 1 >>
EOJobs: Update
Author Message
Post #120372 EOJobs: Update

Couldn't find the old topic, lost the link to it. The real string to getting jobs working is where Apollo said it would be in paperdoll.cpp.

Use this for now, until I find the right Hex code for the lazy l;

reply.AddBreakString("~" + this->server->world->GetHome(character)->name + "¬" + character->job)

Screenshot

Credits to: Bart, Apollo


Delete the A infront of the lazy l for the code to work

---
Create your own destiny, don't let someone else do it for you.
13 years, 32 weeks ago
Post #120375 Re: EOJobs: Update

So how exactly does this work? I haven't looked at the paste bin, an I don't use eoserv so I was just wondering is this some thing like title where it has to be given to you?

---
http://www.ctronic.ga
http://www.tsu.co/Deltro
https://www.reverbnation.com/deltro9
13 years, 32 weeks ago
Post #120376 Re: EOJobs: Update
kodyt posted: (30th Dec 2011, 09:28 pm)

So how exactly does this work? I haven't looked at the paste bin, an I don't use eoserv so I was just wondering is this some thing like title where it has to be given to you?


You could make a command; $job (name) (job) to set this->player->character->job. Do note you have to have Sordie's EOJobs EO.Addon for this to work.
I'm just going to go ahead and tell you, in paperdoll.cpp, look for the string the loads homes for the paperdoll. It should look like the string that i posted, just without the tilde, the lazy l, and the character->job. It's not that hard, just figuring it out in the first place was an ass.
---
Create your own destiny, don't let someone else do it for you.
13 years, 32 weeks ago
Post #120377 Re: EOJobs: Update

Very interesting. nvm. didnt know you needed EO addons. i'd rather have 20 libs in my eoserv folder than using EO addons.

13 years, 32 weeks ago
Post #120378 Re: EOJobs: Update

You should use the hex code of the lazy l (0xAC I think) to avoid the character encoding issues. The code would look like this:

reply.AddString("~" + this->server->world->GetHome(character)->name);
reply.addChar(0xAC);
reply.AddBreakString(character->job);
13 years, 32 weeks ago
Post #120379 Re: EOJobs: Update

Alright. Apollo just told me to use the lazy l. I'll update the first post.

---
Create your own destiny, don't let someone else do it for you.
13 years, 32 weeks ago
Post #120381 Re: EOJobs: Update

Would this also be able without EO addons? Since eo addons is really, really shit.

13 years, 32 weeks ago
Post #120382 Re: EOJobs: Update
Hollow posted: (30th Dec 2011, 09:35 pm)

Would this also be able without EO addons? Since eo addons is really, really shit.


Nope. It's not supported in EOMains client.
---
Create your own destiny, don't let someone else do it for you.
13 years, 32 weeks ago
Post #120383 Re: EOJobs: Update

mk, no need to add this than.

13 years, 32 weeks ago
Post #120385 Re: EOJobs: Update

That's your choice, I find this very useful

EDIT: 0xAC isn't the code for the lazy l, finding it now.

---
Create your own destiny, don't let someone else do it for you.
13 years, 32 weeks ago
Post #120395 Re: EOJobs: Update

paperdoll.cpp I cant find that in eosource. Or is that within eo.addons

13 years, 32 weeks ago
Post #120425 Re: EOJobs: Update
RooRoo posted: (31st Dec 2011, 01:52 am)

paperdoll.cpp I cant find that in eosource. Or is that within eo.addons


EOSource is a closed source for some reason..
---
Create your own destiny, don't let someone else do it for you.
13 years, 32 weeks ago
Post #120453 Re: EOJobs: Update
AustinB posted: (31st Dec 2011, 05:22 am)

RooRoo posted: (31st Dec 2011, 01:52 am)

paperdoll.cpp I cant find that in eosource. Or is that within eo.addons


EOSource is a closed source for some reason..
I know, thats what bugs me about it. EOSOURCE

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
13 years, 32 weeks ago
Post #120479 Re: EOJobs: Update

Good stuff man gave me some interest in my server again so I decided to find the hex codes link for this, add some commands,  database and  quest stuff Ill post as I make it!

I couldnt use the hex value as Bart suggested and make it work. This works in my paperdoll dont get the  at the end of your home "compiled in a Rev 189"

Remove the "A" looken sucker before you compile

reply.AddBreakString("~" + this->server->world->GetHome(character)->name + "¬" + character->job);

Talk commands: If you want a player command link, admin command link

Quest stuff: In quest.cpp find 

else if (action->name.compare("addnpcinput") == 0 && action->args.size() != 3)
                            SyntaxError("AddNpcInput requires three parameters");
 

add this under it 

else if (action->name.compare("setjob") == 0 && action->args.size() != 1)
                            SyntaxError("SetJob requires one parameter");

go to character.cpp in bool Character::PerformQuestActions(int id)  find  

else if (action->name.compare("setstate") == 0)

{
          quest->state = (*action->args[0]).GetString();
          return false;

}

add this under

else if (action->name.compare("setjob") == 0)
        {
            std::string njob = (static_cast<std::string>((*action->args[0])));

            if(njob.length() > 21)
            {
                njob = util::lowercase(njob);
                njob = njob.substr(0, 21);
            }
            this->job = njob;
        }

and in your quest use this action. I cant figure out how to get a 2+word title through quests ) : if you add say pickle farmer it becomes pickle farmer.

action   SetJob(Farmer);

database stuff: in character.cpp in Character::Character(std::string name, World *world) find 

Database_Result res = this->world->db.Query("SELECT `name`, `job`,
its hard to explain but just add job where you see it. Then a little lower find

this->name = GetRow<std::string>(row, "name");

add this under

 this->job = GetRow<std::string>(row,"job");

then go way to the bottom in void Character::Save() find

this->world->db.Query("UPDATE `characters` SET `title` = '$', `job` = '$',

add job how you see it then find

this->title.c_str(),

add this right beside it

this->job.c_str(),

Now open your database to create a new table

Name = job

Type = varchar

Length = 32

Null = yes


Now Im wondering what would be the best way to implement the jobs in to the game Im thinking of providing each job with a workload and a level. So say you are a level 1 farmer, your workload for the day or "selected time frame" would be harvesting 100 lbs of pickles and pay would be 100 gold. Implementing a boss will be kinda tough maybe through the quest system or another npc type. Ill try and put together some quest scripts based of your job and job lvl.


Also I have a question , what the fuck is up with the "Ã" that keeps appearing thats what threw me off when I started working on this days ago, I thought that "Ã" was part of the code but its not so take it out before you compile.

13 years, 32 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > EOJobs: Update