Lol
It pretty much IS written that way already.
The way it is now
- //Adventure's Plains
- case 350:
-
- if( thisclient->Stats->Level < 1 )
- {
- SendPM(thisclient,"You do not meet the required level to use this item.");
- return NULL;
- }
- useitem->usetype = 22;
- useitem->usevalue = 56525198;
- break;
the way you want it
- if(loc == 1) // Adventure Plains
- {
- map = 22;
- x = 5644; //old map
- y = 5174; // old map
- //x = 5098; // new map
- //y = 5322; // new map
- }
just take a good look at the values from the scroll
useitem->usetype = 22; this is the map id
useitem->usevalue = 56525198; and this is both coordinates. 5625 and 5198 just concatenated together.
To add a new case all you will need to do is find an open item number in the STB and just copy the format of one of the other scrolls but leave the skill blank (or just put a skill id in too then go edit the skills STB)
I may have been wrong before. After looking through the useitems STB it looks like all the 313s call a skill so you might need to add something to the skills STB anyway even if it doesn't really do a lot.
What I mean by that is that the skills associated with the scrolls have some data related to warp zone and warp X,Y coordinates but they don't coincide with anything that we use in the existing scrolls anyway. The server side code for warping will override the client STB values anyhow. Whatever we code into the server is where the teleport will take you. NOT what it says in the STB.
So the steps to add a custom scroll are as follows
1) add the entry to LIST_USEITEMS.STB (and STL of course)
2) add an entry in the corresponding row in LIST_SKILL.STB (no STL entry required as these skills have no names) Just copy down the data from the row above. Just match what you can. things like the first column after the name "skill number" which obviously needs to be the same as the STB row number. Set the warp zone (map id) correctly and make some sort of educated guess about warp X.Y. I don't think they matter in the slightest but can't hurt to put something in there. Don't bother putting any values in the stat1, value1 and ratio1 fields where there are data that appears to be a copy of the warp data. These fields are not used for scrolls and are just legacy crap from older STB versions.
3) add a case into the code. it's really easy. just use the STB item number in the case then set useitem->usetype = your map id and the usevalue equal to your chosen coordinates.
recompile, add in your two modified STBs ans the STL then launch server and client
It should all work fine
Icon's method would work fine if you were using an arc server but it probably won't work in osprose at all.
I'm pretty sure we don't have any code to handle event scrolls in the way that he describes.
Possibly that kind of thing needs to be written.