[Release] Return scroll to...

Newbie Spellweaver
Joined
Apr 5, 2008
Messages
9
Reaction score
0
I'm quitting TitanMS for a while and don't want to be a leecher so I release what I've done so far...

Here: A manual how to install the return to [Ellinia/nearst town/Perion/Ludibrium/whatever] scrolls.


Open Player.cpp
Find:
Code:
        case 0x89: Drops::lootItem(this ,buf+2); break;
Add after:
Code:
    case 0x64: Inventory::useTScroll(this, buf+2); break;
Open Inventory.h
Find:
Code:
    static void stopChair(Player* player, unsigned char* packet);
Add after:
Code:
   static void useTScroll(Player* player, unsigned char* packet);
Open Inventory.cpp
Add at the end of file:

Code:
void Inventory::useTScroll(Player *player, unsigned char *packet) {
  short slot = getShort(packet+4);
  int itemid = getInt(packet+6);
  switch (itemid) {
    case 2030000: // Next town
    case 2030008: // Next town (coffee-thingy)
      Maps::changeMap(player, Maps::info[player->getMap()].rm, 0);
      break;
    case 2030001: // Lith
      Maps::changeMap(player, 104000000, 0);
      break;
    case 2030002: // Ellinia
      Maps::changeMap(player, 101000000, 0);
      break;
    case 2030003: // Perion
      Maps::changeMap(player, 102000000, 0);
      break;
    case 2030004: // Henesys
      Maps::changeMap(player, 100000000, 0);
      break;
    case 2030005: // Kerning
      Maps::changeMap(player, 103000000, 0);
      break;
    case 2030006: // Sleepy
      Maps::changeMap(player, 105040300, 0);
      break;
    case 2030007: // Dead Mine
      Maps::changeMap(player, 211041500, 0);
      break;
    case 2030009: // Mushroom shrine
      Maps::changeMap(player, 800000000, 0);
      break;
    case 2030010: // Showa
      Maps::changeMap(player, 801000000, 0);
      break;
    case 2030011: // Omega
      Maps::changeMap(player, 221000000, 0);
      break;
    case 2030012: // Ludibrium
      Maps::changeMap(player, 220000000, 0);
      break;
    default: return; break;
  }
  takeItemSlot(player, slot, 2, 1);
}
That's it. Tested & works with 0.53 and Rev 007 (or higher, I guess).

Including all of the scrolls that I can think of (tried with !item untill nothing spawned). Please don't scam it, you can use it however you want, you can modify it like you want, but please give credits to me.

Notice: It's not needed to check if the player can go there (same continent) because the client is doing that for us.

Edit: It seems like this doesn't work with any repacks or older versions than 007 - if you get an error, please post it here and the line it belongs to. Also please post the revision you use (and maybe add if you're using some repack). Else, we can't help you.
 
Last edited:
Hm, I just saw that I've written "Player *player" - that's the same syntax like in useItem, shouldn't that be "Player* player"? (~everywhere it's Player* and not *player. Hm.)
 
hmmm, my maplestoryserver.exe stops responding while i have this code implamented. it compiled fine though, any ideas?
 
im getting this error..
can u help me with it please?

Code:
1>------ Build started: Project: MapleStoryServer, Configuration: Release Win32 ------
1>Compiling...
1>Inventory.cpp
1>.\Inventory.cpp(411) : error C2601: 'Inventory::useTScroll' : local function definitions are illegal
1>        .\Inventory.cpp(407): this line contains a '{' which has not yet been matched
1>Build log was saved at "file://c:\Users\Vi3tSheezy\Desktop\krytical\MapleStoryServer\Release\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

here's the line that the error mentioned

Code:
  for(int i=0; i<player->inv->getItemNum(); i++) {
        if(player->inv->getItem(i)->id == item){
            return 1;
        }
		void Inventory::useTScroll(Player *player, unsigned char *packet) {
 
you forgot an } maybe you should read the error ....

Code:
for(int i=0; i<player->inv->getItemNum(); i++) { <-- Opend 1
if(player->inv->getItem(i)->id == item){ <- Opend 2
return 1;
} Closed 2
??? <-- Closed 1 ?

you forgot to close your for loop.
 
im getting this error..
can u help me with it please?

Code:
1>------ Build started: Project: MapleStoryServer, Configuration: Release Win32 ------
1>Compiling...
1>Inventory.cpp
1>.\Inventory.cpp(411) : error C2601: 'Inventory::useTScroll' : local function definitions are illegal
1>        .\Inventory.cpp(407): this line contains a '{' which has not yet been matched
1>Build log was saved at "file://c:\Users\Vi3tSheezy\Desktop\krytical\MapleStoryServer\Release\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
here's the line that the error mentioned

Code:
  for(int i=0; i<player->inv->getItemNum(); i++) {
        if(player->inv->getItem(i)->id == item){
            return 1;
        }
        void Inventory::useTScroll(Player *player, unsigned char *packet) {

edit nvm i got it fine compiling^^
ty for this

you forgot an } maybe you should read the error ....

Code:
for(int i=0; i<player->inv->getItemNum(); i++) { <-- Opend 1
if(player->inv->getItem(i)->id == item){ <- Opend 2
return 1;
} Closed 2
??? <-- Closed 1 ?
you forgot to close your for loop.

nope wasnt that.
i admit that im such a noob that i didn't actually pasted it @ the end of the file =P
changed that and it worked ^^
 
Please help me its give me this error i tried to rebuild- not work yet...
the error:
Code:
[SIZE=1]
3>Player.obj : error LNK2001: unresolved external symbol "public: static void __cdecl Inventory::useTScroll(class Player *,unsigned char *)" (?useTScroll@Inventory@@SAXPAVPlayer@@PAE@Z)
[/SIZE]
 
hey good job one this but i only got one error when i compiled
Code:
c:\documents and settings\kid\my documents\server files\weedstory_0.0.1\maplestoryserver\inventory.cpp(432) : error C2660: 'Inventory::takeItemSlot' : function does not take 4 arguments
 
Inventory.cpp
c:\documents and settings\owner\desktop\maplestoryserver\maplestoryserver\inventory.cpp(431) : error C2660: 'Inventory::takeItemSlot' : function does not take 4 arguments

That's what i have.
 
Back