Portal trap and more

03/30/2010 20:45 DragoNLegacY#1
Ok so i know i'm asking alot but i'm pretty new at the coding part of Pservers, I got a server running on my Pc to start some testing and what not (later on it well be released) but i got a few questions since i havn't done this part before..

First, while looking around though the server for bugs and npc i might wanna change, i jumped into the portal in the frozen grotto, now i have no clue as how to release the char from this problem, although i do know it's possible since the last server i was a part of i got stuck in the portal in the gm map lol, but i'm not on speaking terms with the owner of that server, so i need help here.

Second, Where can i add atribute points to an account? OldCOdb or rikardo updated? and what file exactly since i've looked for some time now

I guess this is it for now and thanks, PS i'm using a 5165 source :-)
03/30/2010 21:35 PeTe Ninja#2
Change the characters coordinates and map..
03/30/2010 21:56 DragoNLegacY#3
Well, ya i guess thanks, but problem is where do i change that? :-)
03/30/2010 23:02 -NewDawn-#4
Hold on a second! I can fix this- give me a minute to write the code.

EDIT:
ok, find this code in Teleport.cs:
Code:
if (GC.MyChar.Loc.Map == 1036)
                    GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 30));
                else
                    GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 32));
and add this under it:

Code:
if (GC.MyChar.Loc.X <= 5 && GC.MyChar.Loc.Y <= 5)
                    GC.MyChar.Teleport(1002, 439, 397);
thanks Korvacs. lol- forgot to put the next lines of code.


Actually... hold on- I have a better idea to fix this...
I have to go though to fix a client's laptop connection.
I'll be back in a few- the code above should work for now.
03/30/2010 23:38 DragoNLegacY#5
@-NewDawn- I tried out you code, and it even made sense to me, hopefully i put it in the place you intended, but it still didn't working, i'm still getting the black screen you get when you jump portals

Code:
if (GC.MyChar.Loc.Map == 1036)
                    GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 30));
                if (GC.MyChar.Loc.X <= 5 && GC.MyChar.Loc.Y <= 5)
                    GC.MyChar.Teleport(1002, 439, 397);
                else
                    GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 32));
was this your suggestion?

well it's late, i'll check back for a reply tomorrow and thanks alot :-)

@ Everyone else
I'm still looking for the file to edit the aps :-) and thanks again all
03/30/2010 23:55 -NewDawn-#6
Quote:
Originally Posted by DragoNLegacY View Post
@-NewDawn- I tried out you code, and it even made sense to me, hopefully i put it in the place you intended, but it still didn't working, i'm still getting the black screen you get when you jump portals

[code]if (GC.MyChar.Loc.Map == 1036)
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 30));
if (GC.MyChar.Loc.X <= 5 && GC.MyChar.Loc.Y <= 5)
GC.MyChar.Teleport(1002, 439, 397);
else
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map, 32));[code]

was this your suggestion?

well it's late, i'll check back for a reply tomorrow and thanks alot :-)

@ Everyone else
I'm still looking for the file to edit the aps :-) and thanks again all
Yah, to fix the portals:
Look in the portal.txt file and add the portal's map and coords, then add the portal's output map and coords. to one line. Do the same to the other side and restart the server. That's how you fix a portal system.

Imported from my old account's release:
Quote:
Go into OldCODB and open "Portals.txt"
Add the following two lines to the bottom:

Code:
Code:
1762 060 250 1762 637 375
1762 638 373 1762 060 253
Save it and run a guy through the two portals! I hope you enjoy not having your players get stuck =P

EDIT:
If you're using a 7001 Map instead of a 1762 Map (like you should), use this:

Code:
Code:
7001 060 250 7001 638 375
7001 638 372 7001 060 252
I'm going to code a backup that sees if the portal isn't registered and if it isn't then it'll spit you out into the Previous Map and the Character's previous X and Y. Hold on though.


EDIT: Hm... by the look of it, the current portal system runs blind. There is no checker but yourself. The code I added before on my first post should be helpful though so when you log on you transport back to Twin City. If the Fps goes down hill just make my code disconnect the character. Sorry I should be of much greater help =\ Good Luck!
03/31/2010 00:00 Korvacs#7
PHP Code:
if (GC.MyChar.Loc.Map == 1036)
     
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map30));
else
     
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map32));

if (
GC.MyChar.Loc.<= && GC.MyChar.Loc.<= 5)
     
GC.MyChar.Teleport(1002439397); 
Is how it should look for the quick fix.
03/31/2010 00:42 -NewDawn-#8
Quote:
Originally Posted by Korvacs View Post
PHP Code:
if (GC.MyChar.Loc.Map == 1036)
     
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map30));
else
     
GC.AddSend(Packets.MapStatus(GC.MyChar.Loc.Map32));

if (
GC.MyChar.Loc.<= && GC.MyChar.Loc.<= 5)
     
GC.MyChar.Teleport(1002439397); 
Is how it should look for the quick fix.
Oh yah, that makes sense. Wow, that was a stupid mistake. lol
#edited first post.
03/31/2010 18:41 DragoNLegacY#9
Ok, let's go parts,
@-NewDawn- the portal.txt i already edited After my chars got stuck lol, and i havn't tested yet if it works, but i will after i get the npc working cuz my npcs changed after i download paralysers source, anyway i double checked the portal.txt, and it's correct

@Korvacs, i changed the code dawn gave me to where you told me, chars still stuck =/,

Well if you guys are out of ideias it's cool, I'll just use some other char, and give thanks for trying, but if you guys can thank of anything else let me know :-), anyway can either of you tell me where i can edit the atribute points a char has from one of the files? thanks guys :-)
04/01/2010 00:36 -NewDawn-#10
Well, my code is supposed to transport them is their coords are messed up... you can fixed them manually though. Here's how:

1. Disconnect all characters.
2. Do NOT shut down the server. If you edit characters while the server is ready to be closed then your character will be wiped out.
3. Type in "/characters" and add 1 CP to the character's account. Save and log in.
4. Buy a scroll and use it to go to Twin City.
5. Disconnect and log back in to fix fps.

If the character is being transported still and it says "Connecting to Server", then the portal.txt file isn't correct. Good luck! I hope this helps =P