EOSERV Forum > EOSERV > item to change race (skin)
Topic is locked.
Page: << 1 >>
item to change race (skin)
Author Message
Post #52002 item to change race (skin)

can anyone help me i wana make it so a player uses a item and they become another race (for race scrolls)


i no the start would be like


if(id == 61)

               {

// this part

                }

                {

                  this->player->character->Save(); //i dunnos about this part :(
                  character->Refresh();

                 }

13 years, 28 weeks ago
Post #52108 Re: item to change race (skin)

just a tip instead of having refresh use this 

this->player->character->Warp(this->character->mapid, this->player->character->x, this->player->character->y, Warp_ANIMATION_none 

so then a player don't have to hit f12 every time


* Edit: No need to do this if you use the most update rev *

---
http://www.torn.com/478456
13 years, 28 weeks ago
Post #52445 Re: item to change race (skin)

thanx for the info can anyone else help me with the actual changing of skin?

13 years, 27 weeks ago
Post #52446 Re: item to change race (skin)

If you want to hard code it into the server u can do this

After this in item.cpp

EIF_Data *item = this->server->world->eif->Get(id);

reply.SetID(PACKET_ITEM, PACKET_REPLY);

reply.AddChar(item->type);

reply.AddShort(id);


Put 

if (id == #) //*

            {

                this->player->character->race = SKIN_PANDA;

this->player->character->DelItem(id, #); // *    remove if you want the item to not be removed

                this->player->character->Refresh();//Only use this if you have the up to date rev.

                break;

            }


*Make sure you replace # with the id you want the item to be

also set the item in the pub to a potion


If you want all races then add these

SKIN_WHITE

SKIN_TAN

SKIN_YELLOW

SKIN_ORC

SKIN_SKELETON

SKIN_PANDA

SKIN_FISH


edit:stupid copy and pasting font

---
http://www.torn.com/478456
13 years, 27 weeks ago
Post #52498 Re: item to change race (skin)

perfect cheers

13 years, 27 weeks ago
Post #52506 Re: item to change race (skin)

If you don't want to hard code it then you can do this.

Replace this:

if (id ==#)


With:

if (id == static_cast<int>(this->server->world->config["white_id"]))


Then in config.ini 

make a new line and add

white_id = #


make sure you replace # with the id you want.


here i posted the it into a pastebin

http://pastebin.com/caJNzm4c

---
http://www.torn.com/478456
13 years, 27 weeks ago
Post #52507 Re: item to change race (skin)

And how is this not hard coding as well. Because you direct each race config to a config file line does not make it any less hard coded, it just gives you the ability to change without rebooting the server. What you should do is to use some of the other 30 lines and tag the item type an effect potion. For instance sp2 could hold your race value. You could easily code in which race to change to using the sp2 value (1-8).

You could theoretically code the Effect item to handle just about everything. Use your brain, not your "else if's". 

13 years, 27 weeks ago
Post #52509 Re: item to change race (skin)

why should i spend more time on something that I'm not going to add to a server. I was just helping him with what he asked for.

---
http://www.torn.com/478456
13 years, 27 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > item to change race (skin)