Quote:
Originally Posted by scottdavey
Yeah i know, i'm coding at 3am and i forgot to reload the debug. My fault lol.
Rewritten most npcs and made market/tg save your previous map, probably gonna be lots of typos atm i can barely see lol.
|
i think u dont need to rewrite any NPCs to do it , u may simply add a new variable to the character named PrevMap containing the current map be4 teleporting to Market or TG then when asking to leave them u retrieve that prevmap , it would also be better if u create a new func retrieving the coords and call it by that prevmap it will also be usefull to call a rev point when asking for revive
i will try to give a sample for it
if u gonna put it at NpcTalk.cs
Code:
private static int[] GetCords(int Map_)
{
int []MapCoords=new int[2];
switch (Map_)
{
case 1002:
{
MapCoords[0] = 438; MapCoords[1] = 377;
break;
}
case 1011:
{
MapCoords[0] = 232; MapCoords[1] = 260;
break;
}
case 1020:
{
MapCoords[0] = 565; MapCoords[1] = 565;
break;
}
case 1000:
{
MapCoords[0] = 496; MapCoords[1] = 649;
break;
}
case 1015:
{
MapCoords[0] = 723; MapCoords[1] = 573;
break;
}
}
return MapCoords;
}
then when u ask any teleporter to get u to Market or TG add this be4 the teleport line
Code:
CSocket.Client.PrevMap = Convert.ToInt32(CSocket.Client.Map);
for example
Code:
else if (LinkBack == 2)//Market
{
CSocket.Client.PrevMap = Convert.ToInt32(CSocket.Client.Map);
Teleport(1036, 211, 196, 0, CSocket);
}
then at the Market/Tg controller section put this
Code:
else if (LinkBack == 1)
{
int Map_ = CSocket.Client.PrevMap;
int[] Coords = GetCords(Map_);
Teleport(Map_, Coords[0], Coords[1], 0, CSocket);
}
hehe , that was a complete code for it , anyhow u will also need to add this to be a real complete code
at Character.cs
Code:
public int PrevMap = 1002;
now u have a complete restore previous map code