Planeshift
tutorialmanager.h
Go to the documentation of this file.
1 /*
2  * tutorialmanager.h
3  *
4  * Copyright (C) 2006 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 #ifndef __TUTORIALMANAGER_H__
20 #define __TUTORIALMANAGER_H__
21 
22 //=============================================================================
23 // Crystal Space Includes
24 //=============================================================================
25 #include <iutil/document.h>
26 
27 //=============================================================================
28 // Project Includes
29 //=============================================================================
30 
31 //=============================================================================
32 // Local Includes
33 //=============================================================================
34 #include "msgmanager.h" // Parent class
35 
41 class TutorialManager : public MessageManager<TutorialManager>
42 {
43 public:
44 
46  {
47  CONNECT = 0, // First welcome to the game.
48  MOVEMENT = 1, // Sentence on arrow keys and pan up/down. Tell to find npc in front and click on him.
49  NPC_SELECT = 2, // You found our npc. Right-click to select any target, and it shows up in your target window.
50  NPC_TALK = 3, // Whenever you have an intelligent npc targeted, you can talk to it and he will try to respond. Say hello to him now.
51  QUEST_ASSIGN = 4, // You have now been assigned a task by the npc. Click the Q button to see your list of active quests. Now find a rat to your right.
52  DAMAGE_SELF = 5, // You just got attacked and hit by a monster. Your percent of health (hit points) is shown in the red bar in your info window.
53  DAMAGE_FALL = 6, // You just fell too far and hurt yourself. Don't take too much damage or you can die just from falling.
54  DEATH_SELF = 7, // You have just died. In a few seconds, you will be transported to the Death Realm and you will have to escape it to come back to Yliakum.
55  SPAWN_MOVE = 8, // gives various informations about the server like general rules for rp
56  // ENEMY_SELECT = 9, // Now that you have a monster selected, you can attack it by pressing 'A' and watching it die.
57  // ENEMY_DEATH = 10, // When you kill a monster, it is often carrying things you can use. Right-click and select the Hand to loot the monster.
58  // LOOT_COMPLETE = 11 // Now that you picked up your loot, check your inventory by pressing 'I' and see that you have those items now.
60  };
61 
63  virtual ~TutorialManager();
64 
71  void HandleScriptMessage(uint32_t client, unsigned int which);
72 
73 protected:
75  void HandleConnect(MsgEntry* pMsg, Client* client);
76 
78  void HandleMovement(MsgEntry* pMsg, Client* client);
79 
81  void HandleTarget(MsgEntry* pMsg, Client* client);
82 
84  void HandleDamage(MsgEntry* pMsg, Client* client);
85 
87  void HandleDeath(MsgEntry* pMsg, Client* client);
88 
90  void HandleGeneric(MsgEntry* pMsg, Client* client);
91 
93  bool LoadTutorialStrings();
94 
96  void SendTutorialMessage(int which, Client* client, const char* instrs);
97  void SendTutorialMessage(int which, uint32_t clientnum, const char* instrs);
98 
100 
107  csArray<csString> tutorialMsg;
108 };
109 
110 #endif
111 
ClientConnectionSet * clients
TutorialManager(ClientConnectionSet *pCCS)
bool LoadTutorialStrings()
Preload all tutorial strings from the Tips db table.
This manager catches events posted by the rest of the server and decides whether each client needs to...
void HandleMovement(MsgEntry *pMsg, Client *client)
Specifically handle the Movement event in the tutorial.
void HandleDeath(MsgEntry *pMsg, Client *client)
Specifically handle the Death event in the tutorial.
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
csArray< csString > tutorialMsg
Stores all the messages in the database above id 1001 (biased to 1001 so 1001 is 0).
void HandleConnect(MsgEntry *pMsg, Client *client)
Specifically handle the Connect event in the tutorial.
This class collects data of a netclient.
Definition: client.h:95
void HandleDamage(MsgEntry *pMsg, Client *client)
Specifically handle the Damage event in the tutorial.
virtual ~TutorialManager()
void HandleTarget(MsgEntry *pMsg, Client *client)
Specifically handle the Target event in the tutorial.
This class is a list of several CLient objects, it&#39;s designed for finding clients very fast based on ...
Definition: clients.h:58
void HandleScriptMessage(uint32_t client, unsigned int which)
Specifically handle the message sent by a script.
void HandleGeneric(MsgEntry *pMsg, Client *client)
Handle tutorial events which come from events which do not have specific msgtypes.
void SendTutorialMessage(int which, Client *client, const char *instrs)
Package up the current event string for the client receiving the tutorial.
Provides a manager to facilitate subscriptions.
Definition: msgmanager.h:106