writeField Function (adding and editing PT fields)

Server version is ready, I will upload it today after beta tests, I fixed few things I broke and changed structure of files and folders, now you need to edit only one 2 files to add new FIELD and you will have server and client .dll.
Till now I see that exit from SoD in KPT-ET-2.2 is working (because its writing correct X Y in correct place), SoD is working to ofc, events like babel spawning... everything is OK, same as it was B4 but easier to edit now.
Server don't really need much, correct XY for /sod_enter, and XY for navisko spawn, fields names and numbers... rest is controlled by client O_o
I still need check Skills Block (client sided), strange way of disabling skills DMG on monsters but might be useful in some cases, somehow this is working on magical attacks and not on physical.

After that I will probably finish tutorial and start some other project... I don't see any interest in this one :(
 
After that I will probably finish tutorial and start some other project... I don't see any interest in this one :(
I doubt that is true.

We need server side DLL to gain true leverage of this, but with that done I can see lots of potential.

I certainly intend to include this in the next Butchered client.:thumbup:

It's about time I integrated (International) into the main Butchered line, which means it's time to take the plunge and mess with the IATs and re-factor the PE (in as clean and safe a way as possible.

That's going to take some doing, but in the process I will disable the alteration to the timed quest area... thus removing that bug (and translation for timed quests) until a specific translation fix for that area can be found.

Additionally, this project has started other people looking at what they may be able to do with DLLs and high level code. It's raised questions about what languages are suitable etc.

I think this release has been very successful.:thumbup:
 
BIG UPDATE
Server version added!


See 1st post for details.


We have writeClientField.dll and writeServerField.dll now.
Add them to client and server and you can drop items on your field!
Add new_field.ASE.spm for your field and you can spawn monsters on it!

I need to write tutorial for that too ;)
Or maybe anyone here would like to write it?


Many fixes where made since last version so don't bother with old releases (I deleted them). Just download new version and start dev new maps :)


I am not planing any big changes soon so if anyone would like to port it to other lang or start writing some new fields for real than now is time, you have green light!

:thumbup:

PS. I also uploaded patched client and server .exe's

...if anyone need them.
 
So much to do, so little time. Thanks for this Vormav, I can't wait to get started. :D:
 
Compile C++ ....
Code:
writeGlobalField.c(15) : error C2664: 'field' : cannot convert parameter 1 from 'PBYTE' to 'char *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
 
Compile C++ ....
Code:
writeGlobalField.c(15) : error C2664: 'field' : cannot convert parameter 1 from 'PBYTE' to 'char *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast


I wrote it in C(thinking about gcc as compiler) and thats why I recommended gcc (Dev-C++ project) as compiler ;)

To compile it in MSVC you can add:
Code:
#define PBYTE char *
and code should compile.

GL with this :)



What I don't get is why everyone is trying to change language to different one... its not like you will get more speed... can you really speed up function that take 1 millisecond of your time and run just once? XD
 
@Sheen & Zahara
Please remember that Visual C++ will compile C code, and this source in particular without alteration, provided you set the project / make file correctly.

I am working on projects / solutions / workspaces / make files for this new source on a number of compilers, and have had great success with Code::Blocks (and most of the compilers it supports, but watcom and GCC - Debug build are being arsey)... when I have a complete set of projects for IDEs and compilers I will post them.

The point of the project is NOT to be C++, because (I presume) that is just a git to link into your game.exe and so it should remain C. (At least the exported function.)

If you make C++ code to use with it, I recommend compiling your C++ to a .lib that you link into this project. :wink:
 
I checked "fields security" on official servers and here are results:
- all official servers have similar security lvl when comes to fields

- its possible to load your own new field (all is client sided), very good for developers who would like to share maps with official PT community and maybe even make official servers support players custom maps. However moving teleport, respawn etc can give some players some advantage.

- change lvl of map working and I can go anywhere with lvl 1 character, however on official PT you will DC when: someone will try to party you, you kill monster, crystal kill monster (special crystals like chaos etc. can DC right after first hit). So protection is good here, even lvl spoofing change nothing (extend time to DC but nothing else) and even if you AFK somewhere I still DC after some time.

- only BR pplz still asking for 10K, even lvl 1 chara XD (not offending anyone here, but test results speak for themselves =P)

Summary: protection of fields is good. Could be better by protecting client sided fields information and doing DC faster.

____________________________________


Our servers security:
- with write field dll or without it, results are the same
NO DC! O___o so before anyone will ask... it have nothing to do with my dlls
- unless its a some hotuk.ini *fieldprotection that in need to enable this could be a big security issue!

So question for everyone hows field security on your server?
What I need to add to hotuk.ini to make players DC when players are on map with too big lvl for them? (working on simplest hotuk.ini here... dev mode =P)


PS. tested on GM account and on normal account.
 
Last edited:
I know there used to be none on the official servers. There was an injector that would let you party a level 80 when you where level 1, then get them sign a Uni-core, and go out to lvl 80 field, then you core to them, they kill stuff, you don't die because you have patched out health drain, and level really really fast.

That used to work on all the official servers. So I guess they have "added" code to stop people using that one, and what you are doing is close enough for it to catch you too.
 
Too bad that we don't have any protection in this case, maybe creation of some packet that compare player lvl and field with server field lvl would fix problem.


This thread is empty as my server...
Just added more info to tutorial, and because some people where asking:

Sometimes code you added in writeGlobalField.c is not compiled into server/client .dll... just press "space bar" somewhere in writeClientField.c/writeServerField.c and delete that space, than "save file" and than compile.
 
This could be easily done with my emulator. Packet 13 just contains char level, and current map. :)

---------- Post added at 11:06 PM ---------- Previous post was at 09:11 PM ----------

Packet 13, decripted contains these infos:

int X = BitConverter.ToInt32(msg, 0x30) >> 8;
int Y = BitConverter.ToInt32(msg, 0x34) >> 8;
int Z = BitConverter.ToInt32(msg, 0x38) >> 8;
int mapa = BitConverter.ToInt32(msg, 0x20);
You could see the swtich in server, look for 48470013, probably server will push charlevel + map. then, you just do a few CMPS, and then, CALL DC4 routine. I guess it should work.

---------- Post added at 11:10 PM ---------- Previous post was at 11:06 PM ----------

004468E2 |. 8B4E 10 MOV ECX,DWORD PTR DS:[ESI+10] ; Case 48470013 of switch 004468D1
004468E5 |. 8D0C89 LEA ECX,DWORD PTR DS:[ECX+ECX*4]
004468E8 |. 8B54CE 08 MOV EDX,DWORD PTR DS:[ESI+ECX*8+8]
004468EC |. 8D4CCE 04 LEA ECX,DWORD PTR DS:[ESI+ECX*8+4]
004468F0 |. 8990 DC010000 MOV DWORD PTR DS:[EAX+1DC],EDX
004468F6 |. 8B51 08 MOV EDX,DWORD PTR DS:[ECX+8]
004468F9 |. 8990 E0010000 MOV DWORD PTR DS:[EAX+1E0],EDX
004468FF |. 8B51 0C MOV EDX,DWORD PTR DS:[ECX+C]
00446902 |. 8990 E4010000 MOV DWORD PTR DS:[EAX+1E4],EDX
00446908 |. 0FBF51 14 MOVSX EDX,WORD PTR DS:[ECX+14]
0044690C |. 8990 E8010000 MOV DWORD PTR DS:[EAX+1E8],EDX
00446912 |. 0FBF51 16 MOVSX EDX,WORD PTR DS:[ECX+16]
00446916 |. 8990 EC010000 MOV DWORD PTR DS:[EAX+1EC],EDX
0044691C |. 0FBF49 18 MOVSX ECX,WORD PTR DS:[ECX+18]
00446920 |. 8988 F0010000 MOV DWORD PTR DS:[EAX+1F0],ECX
00446926 |. 8B56 08 MOV EDX,DWORD PTR DS:[ESI+8]
00446929 |. 5F POP EDI
0044692A |. 8990 D8010000 MOV DWORD PTR DS:[EAX+1D8],EDX
00446930 |. 8B4E 08 MOV ECX,DWORD PTR DS:[ESI+8]
00446933 |. 8988 A8000000 MOV DWORD PTR DS:[EAX+A8],ECX
00446939 |. 66:8B88 2E0100>MOV CX,WORD PTR DS:[EAX+12E]
00446940 |. 5E POP ESI
00446941 |. 66:8988 2C0100>MOV WORD PTR DS:[EAX+12C],CX
00446948 |. 5B POP EBX
00446949 |. C3 RETN
 
This could be easily done with my emulator. Packet 13 just contains char level, and current map. :)

---------- Post added at 11:06 PM ---------- Previous post was at 09:11 PM ----------

Packet 13, decripted contains these infos:

int X = BitConverter.ToInt32(msg, 0x30) >> 8;
int Y = BitConverter.ToInt32(msg, 0x34) >> 8;
int Z = BitConverter.ToInt32(msg, 0x38) >> 8;
int mapa = BitConverter.ToInt32(msg, 0x20);
You could see the swtich in server, look for 48470013, probably server will push charlevel + map. then, you just do a few CMPS, and then, CALL DC4 routine. I guess it should work.

---------- Post added at 11:10 PM ---------- Previous post was at 11:06 PM ----------

004468E2 |. 8B4E 10 MOV ECX,DWORD PTR DS:[ESI+10] ; Case 48470013 of switch 004468D1
004468E5 |. 8D0C89 LEA ECX,DWORD PTR DS:[ECX+ECX*4]
004468E8 |. 8B54CE 08 MOV EDX,DWORD PTR DS:[ESI+ECX*8+8]
004468EC |. 8D4CCE 04 LEA ECX,DWORD PTR DS:[ESI+ECX*8+4]
004468F0 |. 8990 DC010000 MOV DWORD PTR DS:[EAX+1DC],EDX
004468F6 |. 8B51 08 MOV EDX,DWORD PTR DS:[ECX+8]
004468F9 |. 8990 E0010000 MOV DWORD PTR DS:[EAX+1E0],EDX
004468FF |. 8B51 0C MOV EDX,DWORD PTR DS:[ECX+C]
00446902 |. 8990 E4010000 MOV DWORD PTR DS:[EAX+1E4],EDX
00446908 |. 0FBF51 14 MOVSX EDX,WORD PTR DS:[ECX+14]
0044690C |. 8990 E8010000 MOV DWORD PTR DS:[EAX+1E8],EDX
00446912 |. 0FBF51 16 MOVSX EDX,WORD PTR DS:[ECX+16]
00446916 |. 8990 EC010000 MOV DWORD PTR DS:[EAX+1EC],EDX
0044691C |. 0FBF49 18 MOVSX ECX,WORD PTR DS:[ECX+18]
00446920 |. 8988 F0010000 MOV DWORD PTR DS:[EAX+1F0],ECX
00446926 |. 8B56 08 MOV EDX,DWORD PTR DS:[ESI+8]
00446929 |. 5F POP EDI
0044692A |. 8990 D8010000 MOV DWORD PTR DS:[EAX+1D8],EDX
00446930 |. 8B4E 08 MOV ECX,DWORD PTR DS:[ESI+8]
00446933 |. 8988 A8000000 MOV DWORD PTR DS:[EAX+A8],ECX
00446939 |. 66:8B88 2E0100>MOV CX,WORD PTR DS:[EAX+12E]
00446940 |. 5E POP ESI
00446941 |. 66:8988 2C0100>MOV WORD PTR DS:[EAX+12C],CX
00446948 |. 5B POP EBX
00446949 |. C3 RETN

Just for the record I will save it and think about it in the future :)
Also notice that "when you enter 5319009 in a calculator upside down it spells boobies" :lol:
 
Okay... this has bounced back and fourth between Vormav and I, and I'm reasonably happy with it now.

I hope Vormav will want to pin this version on the OP, as it includes tested and proved working builds for:-
  • Bloodshed Dev C++
  • Code::Blocks
  • Pelles C
  • OpenWatcom
  • Visual C++
  • Version 6
  • Version 7 / 7.1 (.NET 2002 / .NET 2003)
  • Version 8 (2005)
  • Version 9 (2008)
  • Version 10 (2010)
  • NMake
Though I've only successfully built with VC 2008 and the PSDK for XP SP2, and Borland C++ 5.5 and the MS PSDK with Code::Blocks. (reasons explained in the documentation) You should be able to use Code::Blocks with Digital Mars or Intels' Optimizing C++ Compiler, (which is nice) if you can figure out the right switches to pass.

All other IDEs and NMake have checked out builds fine.

Documentation is available in HTML. All is licensed under CC BY-SA 3.0 License with 1 additional requirement in line with Vormavs original release conditions of use. (see documentation for details)

For now, you can get a direct download from my DataNest here:
Checksums:-
Adler32: A17220F3
CRC32: 34A9AFF7
MD5: FABBE89C0229EB0654AFD0264CCDBAE4
SHA-1: 30462DD4F7F6F1735ABEE05415FAC74BCBD16288
SHA-256: 2E5B91756221386F0305FFE038E6758F8A11A934D015FFD60B8FCCD382F2FF65
Tiger: EB017F5FB7D477A078669C6D6314452C2CF013EA6EB57F26
Whirlpool: 28E914FBB97BCAB95827B691FBFB07B9BF368FA74AC74265650FFD54519B81D803E3F956292F5DDB2DE806D26CB3091A51ECA90BB2D64CC6B218E8A8DD6438E8​
And I included a FileCheck.sfv into the released archive at the last minuet, so you can be sure if anything inside has changed.

I'd like to get a GIT repo up and add Make files for DMC and GNU Make, BCB projects and maybe make separate Code::Blocks workspaces for different underlying compilers... but for now you have quite a wide range of build environments in case you really feel the need to go with one or the other.
I'm having trouble initiating a GIT repo for the first time. Weird because I use other peoples all the time, and I can create it, but can't make the initial commit.:glare:
I'm open to adding other compilers. I may not know them all, but I'd prefer to give the "free" ones first priority.:wink:

Oh yea... there's also some maintenance scripts (.cmd files) in there to help you "keep it tidy".

Again, being me, the documentation is the biggest file in the archive. I've checked it out, and had it certified with WC3 both for html 4.01 strict and css 2.1 - 3, and made sure it reads okay in everything from IE6 to 8, FF3 (so, I presume most Geko browsers) and WebKit (using Arora, but that should mean Safari and Chrome will be fine too).
 
Last edited:
LOL I was looking for my thread till last page and now its sticked >=P

Ty bobsobol,

I was sure that you will create new thread for this but I guess this way is OK too, I linked to your post too, on first page. I hope this will help people and make this release even easier to use.

I will quote my favorite part from bobsobol release too (yes I like it that much :) )
We don't want a restrictive license prohibiting commercial, or non-commercial use. We don't want to force you to submit back to us any changes you make for your server (as GPL would do) but we do insist that if you use this, you give something back to the forum that made it possible.
I hope I can use it in future releases? :D

The reason why its not GPL or any open source license is because I never add any license to code I reverse engineered. It could look exactly the same on source "owner" side and that would make me feel stupid.
 
I haven't made anything "new" to release, I've simply given people a unified access to your source from whatever compiler they like to use. So it wouldn't seem right for me to make a re-release.

Of course you are welcome to re-use that, or any other part of the document. It's placed under the same Creative Commons "Share Alike" license as the rest of the files in the archive.

CC licenses aren't part of the , because they are aimed at creative / artistic works like music, sound effects, pictures and 3D models given to the public domain with the expectation that they will be re-mixed or incorporated into larger works.

They are often applied to videos and fictional writing as well however, and there is no reason why they cannot be applied to code. When they are, it is often to small utilities or "code fragments".

I'm no lawyer, and never know what I should write in order to legally ensure someone else doesn't claim all the credit for work I've done, but I do try to look for something in legalese. Otherwise people who do have the need for lawyers and would like to use what I have given are left in an unfortunate (and possibly expensive) situation of not knowing if they are allowed to use it or not. And that alone can lead them to "reinvent the wheel" just so they play it safe.

This license seems very open and permissive, and prohibits nothing, except the removal of attribution. In my distribution that means that anywhere attribution is stated, you, me and RaGEZONE must be credited, along with anyone else who adds to it after us.

You don't have to give any credit at all, so long as you don't put your name in and take ours out. If your name goes in, ours must also stay. And as I read the comments in your code, that seems to be the spirit of what you where asking for.

Also of note: None of the projects or solutions include the "writeGlobalField.c" file... however, it is included via the source code it's self. Confusingly (for me) part way down the file, so it's not instantly obvious.

All the IDEs wanted to create a new DLL out of it if I included it in their workspace / project, so it cannot show up in your IDE. It must remain in the folders though, and all of them can open it and edit it if you drop it on them from explorer, or File -> Open.
 
Yes... I don't understand how the maps are worked internally (because of my lack of understanding of 3D programming), but I wondered how the particle effects are positioned on the character selection screen, (clearly nothing to do with the map files, and everything to do with the game.exe) and also what the deciding factor on "Rain" in Ricarten is.

I know the effect of "rain" is still in the folders, and the code has been removed from the executable, but wonder what the normal "weather control" code is, of which "rain" has presumably been removed.

I wondered if we could remove the actual beginning and ending of weather events to the DLL, so we could add other custom events, like electrical storms and sandstorms. (I know I have seen sandstorms in Refuge of the Ancients and Lost Castle in one of the older [post AOR pre-Pay2Play] clients)

Being able to add partial generators to maps would mean pollen blowing from flowers, leaves falling from trees, lava blows from volcanic pools and such would all be possible with a little C. :D:
 
Back