Anyone can say me why i cant connect to the server?
It give me errors with list_skills :p
Would anyone give me pls the right STB folder?
Printable View
Anyone can say me why i cant connect to the server?
It give me errors with list_skills :p
Would anyone give me pls the right STB folder?
Your placement is not correct put the item update inventory lines on the left
Zad67 add it on ur server! (don't worry i already do it my server and it work ^^)
I have another probleme but i think u all have the same probleme: the size of the world server is now 90+ ko . More the size is more the lag is X_X
omg no that's wrong X_X
the spaces are not correct but but is just to see u what have u to put in:
// -- ITEM --
thisclient->c_zuly += thisdrop->amount;
BEGINPACKET( pak, 0x7a7 );
ADDWORD( pak, thisdrop->clientid );
ADDWORD( pak, 0 );
ADDBYTE( pak, 0 );
ADDDWORD( pak, 0xccccccdf );
ADDDWORD( pak, thisdrop->amount );
thisclient->SendPacket( &pak );
}elseif (thisdrop->type==2) {
BEGINPACKET( pak, 0x7a7 );
ADDWORD( pak, thisdrop->clientid );
if (thisdrop->owner==0 || thisdrop->owner==thisclient->clientid || time(NULL)-thisdrop->droptime>=30) {
unsigned newslot=thisclient->GetNewItemSlot( thisdrop->item );
if (newslot!=0xffff) {
ADDBYTE( pak, 1 ); // OK, NO ITEM, NO ITEM, OTHER USER, NOSPACE
thisclient->items[newslot] = thisdrop->item;
ADDBYTE( pak, newslot );
thisclient->SendPacket( &pak );
// update client inventory
BEGINPACKET(pak, 0x718);
ADDBYTE(pak, 1); // ITEMS TO UPDATE
ADDBYTE(pak, newslot);
ADDDWORD(pak, BuildItemHead(thisclient->items[newslot]));
ADDDWORD(pak, BuildItemData(thisclient->items[newslot]));
thisclient->SendPacket(&pak);
}else{
ADDBYTE( pak, 5 );
thisclient->SendPacket( &pak );
}
}else{
ADDBYTE( pak, 4 );
thisclient->SendPacket( &pak );
}
}
for(std::vector<CDrop*>::iterator itvdata = DropsList.begin(); itvdata != DropsList.end(); itvdata++) {
if( (*itvdata)==thisdrop ) { DropsList.erase( itvdata ); break; }
}
dont' forget the spaces on the lefts and under the lines^^''''
I would suggest making a ChangeLog file for each server. The Revision system is pretty good, but after so many modifications we tend to get lost.It would also help people to contribute with their own code.
I would also advise coders to comment wherever you can, if we want to make this server good and fast we must share more knownledge, not only code.
thanks
Joe
Thanks Tohma =) i've fixed the drop pick up code thanks to you...
i'm trying to learn how to connect my code to mysql database and a monster would drop a random item from the list_items table...
i get a lot of errors XD
well again, thanks anyways...
yeah because the other code doesn't work... when u pick up the items nothing shows up in your inventory... or the items doesn't go into you inventory...
well i tried to put it in(not exactly how its showed lol)
and i cant seem to get it right but could you send me a link to a txt doc that has the correct format please thanks
Nobody can tell how to make a Pig up in my inventory? xDDDDDD
that pick up so easly ><
i cant share it cuz its not mine but its easly xD
any one can upload the source code plzz?
The only brain here, it's you Caali, and you know it
I will try to fix it too
lol caali
did u come to msn or no?
i know my english is very bad =(
but you understand me with many fantasy :D
i diden`t need a code for pig up ^^ i need the code for consumables. But i diden`t understand much from c++ .. but i hope that i can write a code.. or somone is shared it ^^
Don't worry my english is the badest u ever see xD
For the consumable i think it's fixed on the svn.
But i'm not sure,i stop the svn to release 49 because the config.ini don't work(hawer tell me it's fixed on the last release) and drop bug is not fixed i'm waiting for a nice update to make my config and compile a new world^^
nope the consumable not fixed =(
Arf sorry X_X
uhm caali can u help me with something... i don't know how to code in c++ and i wanna make every monster drop 1 random item (any item from masks to carts)
i just edited the codes that were already in there but i get a lot of errors... =( something like cannot define and stuff...
i making my own programming language lol XD
so it would be like, after the monster is killed, it gets a random number from the itemid(not id) in list_items table... and then result... i just don't know how T__T
the current code thats in this revision gets monster id from the list_drops and then reads the dropitem rows which then gets the result from the item_list...
Quote:
// DROP ITEMS :TODO: GET DROPRATE FOR THE ITEM FROM MySQL !! :/TODO:
for(int i = 1; i <= 50; i++) {
if(rand() * (50 / DROPRATE) / RAND_MAX < 0.5) {
MYSQL_RES *result;
MYSQL_ROW row;
DoSQL("SELECT monid FROM list_drops WHERE monid=%i", thismon->montype);
result = mysql_store_result(mysql);
if(mysql_num_rows(result) != 0) {
char i2[50];
if(i < 10) { sprintf_s(i2, 50, "dropitem0%i", i); }
else { sprintf_s(i2, 50, "dropitem%i", i); }
DoSQL("SELECT %s FROM list_drops WHERE monid=%i", i2, thismon->montype);
result = mysql_store_result(mysql);
row = mysql_fetch_row(result);
if(atoi(row[0]) != 0) {
DoSQL("SELECT type,id FROM list_items WHERE itemid=%i", atoi(row[0]));
result = mysql_store_result(mysql);
row = mysql_fetch_row(result);
CDrop* thisdrop = new CDrop;
thisdrop->clientid = GetNewClientID();
thisdrop->type = 2; //ITEM
thisdrop->pos.x = thismon->pos.x;
thisdrop->pos.y = thismon->pos.y;
thisdrop->posMap = thismon->posMap;
thisdrop->droptime = time(NULL);
thisdrop->amount = 1;
thisdrop->owner = thismon->targetid;
thisdrop->item.appraised = 0; //:MAKE IT RANDOM:
thisdrop->item.count = 1;
thisdrop->item.durability = 40; //:MAKE IT RANDOM:
thisdrop->item.itemnum = atoi(row[1]);
thisdrop->item.itemtype = atoi(row[0]);
thisdrop->item.lifespan = 100; //:MAKE IT RANDOM:
thisdrop->item.refine = 0; //:MAKE IT RANDOM:
thisdrop->item.socketed = 0;
thisdrop->item.stats = 0; //:MAKE IT RANDOM:
DropsList.push_back(thisdrop);
}
}
}
}
bleh this is the noob oRose code stolen from some of my very beginning drop codes lol... since you're using it i wont help you. anyways, this is buggy, and not really good droprates
i didnt steal it, it was already in this revision i downloaded in this topic
mean tsk tsk
yeah you already know a lot of things
yes ur a really good guy
yeah people worship you here
yes i am a n00b yeah
happy?
ok nvm... it would probably take me a year to figure this out... learn c++ by myself learn LEARN!!
this is one reason why there is war... pride...
and btw i don't take credits and i don't steal... i was asking for help not stealing... u couldve gave ideas on how to do it... i wasnt asking for the exact codes...