[How to] implement Act 7 main quest + teleport

12/15/2019 00:34 ZzFedeStorMzZ#1
First you need to go and add 2 Map npc in the database

Port Alveus Npc (where you get main act 7 quest):

MapNpcId: 9308
Dialog: 11017
Effect: 0
EffectDelay:4750
IsDisabled: False
IsMoving: Flase
IsSitting: False
MapId: 145 -> Port Alveus
MapX: 50
MapY: 28
NpcVNum: 3093
Position: 2

Mortaz Npc (the one you need to talk with):

MapNpcId: Id you want (I used 20001) -> There's no n_run for this npc
Dialog: 11007
Effect: 0
EffectDelay:4750
IsDisabled: False
IsMoving: Flase
IsSitting: False
MapId: 170-> Mortaz
MapX: 91
MapY: 68
NpcVNum: 3109
Position: 0

Then add in Teleporters:

//Tp to map

Index: 0
MapId: 2631
MapNpcId: 20001 -> (the Mortaz one)
MapX: 7
MapY: 47

//Tps back

Index: 170
MapId: 170
MapNpcId: 14924 -> (Npc to tp back)
MapX: 91
MapY: 64

Index: 145
MapId: 145
MapNpcId: 14924 -> (Npc to tp back)
MapX: 53
MapY: 28

-----------------

For Importing Teleports from packet.txt:
In the Source search for -> ImportTeleporters()
Change:
Code:
o[1].Equals("16") || o[1].Equals("26") || o[1].Equals("45") || o[1].Equals("301") || o[1].Equals("132") || o[1].Equals("5002") || o[1].Equals("5012")
To:
Code:
o[1].Equals("335") || o[1].Equals("336") || o[1].Equals("16") || o[1].Equals("26") || o[1].Equals("45") || o[1].Equals("301") || o[1].Equals("132") || o[1].Equals("5002") || o[1].Equals("5012")
-----------------

After this go to the source OpenNos.GameObject -> Npc -> NRunHandler.cs

add these cases before the default one:

Code:
case 332:
                    if (npc == null)
                    {
                        return;
                    }

                    Session.Character.AddQuest(6500);
                    break;

case 334:
                    tp = npc?.Teleporters?.FirstOrDefault(s => s.Index == packet.Type);
                    if (tp != null)
                    {
                        ServerManager.Instance.ChangeMap(Session.Character.CharacterId, tp.MapId, tp.MapX, tp.MapY);
                    }
                    break;

case 335:
                    tp = npc?.Teleporters?.FirstOrDefault(s => s.Index == packet.Type);
                    if (tp != null)
                    {
                        ServerManager.Instance.ChangeMap(Session.Character.CharacterId, tp.MapId, tp.MapX, tp.MapY);
                    }
                    break;
                    
case 336:
                    tp = npc?.Teleporters?.FirstOrDefault(s => s.Index == packet.Type);
                    if (tp != null)
                    {
                        ServerManager.Instance.ChangeMap(Session.Character.CharacterId, tp.MapId, tp.MapX, tp.MapY);
                    }
                    break;
12/21/2019 13:10 ZzFedeStorMzZ#2
I made a mess before but now It's fixed >.<
12/24/2019 17:56 Cucalon#3
The ship of act7 don't work bro
12/24/2019 21:57 orgi100#4
Quote:
Originally Posted by Cucalon View Post
The ship of act7 don't work bro
is working bro ^^