Exemple #1
0
        private void ProcessSpecialTileProps(int x, int y, byte tileId, SCTileDef tileDef)
        {
            var poi = new SCPointOfInterest
            {
                Coords  = new SCCoords(x, y),
                TileDef = tileDef,
                TileId  = tileId
            };

            if ((tileDef.OWBitFlags & SCBitFlags.Enter) > 0)
            {
                var overworldTeleport = (OverworldTeleportIndex)(tileDef.TileProp.Byte2 & 0x3F);
                var teleDef           = enter[(int)overworldTeleport];
                var t = new SCTeleport {
                    Coords = poi.Coords, Type = SCPointOfInterestType.OwEntrance, TargetMap = teleDef.Map, TargetCoords = new SCCoords {
                        X = teleDef.X, Y = teleDef.Y
                    }, OverworldTeleport = overworldTeleport
                };
                Exits.Add(t);

                poi.Type     = SCPointOfInterestType.Tele;
                poi.Teleport = t;
                PointsOfInterest.Add(poi);
            }
            else if ((tileDef.OWBitFlags & SCBitFlags.Caravan) > 0)
            {
                poi.Type   = SCPointOfInterestType.Shop;
                poi.ShopId = 69;
                PointsOfInterest.Add(poi);
            }
        }
Exemple #2
0
        public void AddPoi(PointOfInterest poi)
        {
            var so = new SelectableObject <PointOfInterest>(poi);

            so.ObjectSelectionChanged += So_ObjectSelectionChanged;
            PointsOfInterest.Add(so);
            so.IsSelected = true;
        }
Exemple #3
0
 private void ProcessTeleporters()
 {
     foreach (var t in exit)
     {
         PointsOfInterest.Add(new SCPointOfInterest {
             Coords = new SCCoords {
                 X = t.X, Y = t.Y
             }, Type = SCPointOfInterestType.Exit
         });
     }
 }
Exemple #4
0
 private void ProcessNormalTeleporters()
 {
     foreach (var t in tele)
     {
         if (t.Map == MapId)
         {
             PointsOfInterest.Add(new SCPointOfInterest {
                 Coords = new SCCoords {
                     X = t.X, Y = t.Y
                 }.SmClamp, Type = SCPointOfInterestType.SmEntrance
             });
         }
     }
 }
Exemple #5
0
        private void ProcessQuestNpc(ref NPC npc)
        {
            var routine   = npcdata.GetRoutine(npc.ObjectId);
            var talkArray = npcdata.GetTalkArray(npc.ObjectId);

            var poi = new SCPointOfInterest
            {
                Coords      = new SCCoords(npc.Coord.x, npc.Coord.y),
                Type        = SCPointOfInterestType.QuestNpc,
                Npc         = npc,
                TalkRoutine = routine,
                TalkArray   = talkArray
            };

            PointsOfInterest.Add(poi);

            //if (blocked) Tiles[poi.Coords.X, poi.Coords.Y].Tile |= SCBitFlags.Blocked;
        }
Exemple #6
0
        private void ProcessSpecialTileProps(int x, int y, byte tileId, SCTileDef tileDef)
        {
            var poi = new SCPointOfInterest
            {
                Coords  = new SCCoords(x, y),
                TileDef = tileDef,
                TileId  = tileId
            };

            if (tileDef.TileProp.TilePropFunc == (TilePropFunc.TP_NOMOVE | TilePropFunc.TP_SPEC_DOOR) && tileDef.TileProp.ShopId > 0)
            {
                poi.Type   = SCPointOfInterestType.Shop;
                poi.ShopId = tileDef.TileProp.ShopId;
                PointsOfInterest.Add(poi);
            }
            else if (tileDef.SpBitFlags == SCBitFlags.Warp)
            {
                if ((CFlags & SCMapCheckFlags.NoWarp) > 0)
                {
                    return;
                }

                var t = new SCTeleport {
                    Coords = poi.Coords, Type = SCPointOfInterestType.Warp
                };
                Exits.Add(t);

                poi.Type     = SCPointOfInterestType.Warp;
                poi.Teleport = t;
                PointsOfInterest.Add(poi);
            }
            else if (tileDef.SpBitFlags == SCBitFlags.Teleport)
            {
                var teleDef = tele[tileDef.TileProp.Byte2];
                var t       = new SCTeleport {
                    Coords = poi.Coords, Type = SCPointOfInterestType.Tele, TargetMap = teleDef.Map, TargetCoords = new SCCoords {
                        X = teleDef.X, Y = teleDef.Y
                    }.SmClamp
                };
                Exits.Add(t);

                poi.Type     = SCPointOfInterestType.Tele;
                poi.Teleport = t;
                PointsOfInterest.Add(poi);
            }
            else if ((tileDef.SpBitFlags & SCBitFlags.Exit) == SCBitFlags.Exit)
            {
                var teleDef = exit[tileDef.TileProp.Byte2];
                var t       = new SCTeleport {
                    Coords = poi.Coords, Type = SCPointOfInterestType.Exit, TargetMap = teleDef.Map, TargetCoords = new SCCoords {
                        X = teleDef.X, Y = teleDef.Y
                    }
                };
                Exits.Add(t);

                poi.Type     = SCPointOfInterestType.Exit;
                poi.Teleport = t;
                PointsOfInterest.Add(poi);
            }
            else if (tileDef.SpBitFlags == SCBitFlags.Treasure)
            {
                poi.Type       = SCPointOfInterestType.Treasure;
                poi.TreasureId = tileDef.TileProp.Byte2;
                PointsOfInterest.Add(poi);

                Tiles[x, y].Tile |= SCBitFlags.Blocked;
            }
            else if (tileDef.SpBitFlags == SCBitFlags.EarthOrb)
            {
                poi.Type   = SCPointOfInterestType.Orb;
                poi.ItemId = Item.EarthOrb;
                PointsOfInterest.Add(poi);
            }
            else if (tileDef.SpBitFlags == SCBitFlags.FireOrb)
            {
                poi.Type   = SCPointOfInterestType.Orb;
                poi.ItemId = Item.FireOrb;
                PointsOfInterest.Add(poi);
            }
            else if (tileDef.SpBitFlags == SCBitFlags.WaterOrb)
            {
                poi.Type   = SCPointOfInterestType.Orb;
                poi.ItemId = Item.WaterOrb;
                PointsOfInterest.Add(poi);
            }
            else if (tileDef.SpBitFlags == SCBitFlags.AirOrb)
            {
                poi.Type   = SCPointOfInterestType.Orb;
                poi.ItemId = Item.AirOrb;
                PointsOfInterest.Add(poi);
            }
        }