07.07.2018 Whats a Point of Interest? - Spikeone/WaS_Server GitHub Wiki

07.07.2018 - Whats a Point of Interest?

Hello everyone, well actually nobody as nobody reads this at the moment anyway. Currently I'm working on the first "real" type of gameobject which is not just... an object. Actually I wanted to add a teleporter. So what is that good for? Simple question simple answer: a lot. For example this will be used to create a feature that is known as a flight route in an other game. This means rather than interacting with a NPC to get from Point A to Point Sausage you will use teleporters. This has two major advantages: You won't get motion sickness and it's faster. But there is always a downside which is just as obvious: on shall not use those fancy tools shortly after one after an other.
Also those objects will be used to change zones which in some games is done by just walking around (e.g. World of Warcraft) but in other games quite similar (e.g. Skyrim). As I'm not sure how performant my server will be (program) I want to make sure players only get stuff on their map. This shouldn't really make a difference with the grid system so that might be changed later. Also they are good for instance entrances. Players may not meet the conditions, the instance is full and stuff like that.
So, teleporters yes, I get it but what about those Points of Interest? It's simple: where should a gameobject teleport you? Right, to a point of interest. For teleporters those are just target coordinates (with map) but they can be used for other stuff. For example this is important for quests where you have to scout something or items that should be used in specific locations. Every single point will be a point of interest. And as they are used for different things and are not mandatory, those became an extra table in the database and will be referenced depending on the object type.
So for example the gameobject_template table as 8 non specific rows which become meaningful when using the type. Type 1 means it's a teleporter you can use. That means that in the first data field, the number indicates the point of interest id where the second datafield indicates the key id.
How does a teleport work now? There are the following simple steps:

  1. Physical player uses the gameobect
  2. Client does some checks (distance, isincombat, key -> everything TOOD)
  3. Client can't find any problem, so it sends the "use gameobject" command to the server (TODO)
  4. Server receives a "use gameobject" command which contains the GUID of the target gameobject (TOOD)
  5. Server checks if the gameobject exists, if no player will receive an error
  6. Server checks if the gameobject_template exists, if no player will receive an error
  7. Server checks gameobject_template type, if can't use player will receive an error
  8. It's a telporter, Server checks if point of interest exists, if no player will receive an error
  9. Everything is fine, Server changes map of player and thus the grid and sends him the new position
  10. if one of those steps failed which set an error which is now sent to the player

And now the player changes his position - if I implement that function.