Add infos into target window
[ryzomcore.git] / ryzom / server / src / server_share / msg_brick_service.h
blob6351929b81bb871dad51da911bd12c414f2aad5c
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef RY_MSG_BRICK_SERVICE_H
20 #define RY_MSG_BRICK_SERVICE_H
22 #include "nel/misc/types_nl.h"
23 #include "nel/misc/time_nl.h"
24 #include "nel/misc/sheet_id.h"
25 #include "nel/misc/entity_id.h"
27 #include "game_share/synchronised_message.h"
28 #include "game_share/ryzom_entity_id.h"
30 #include "game_share/base_types.h"
31 #include "ai_share/ai_event_report.h"
34 /**
35 * Class CEGSExecutePhraseMsg, message class used by npcs to execute a phrase
36 * \author David Fleury
37 * \author Nevrax France
38 * \date 2002
40 class CEGSExecutePhraseMsg : public CMirrorTransportClass
42 public:
43 CEGSExecutePhraseMsg () : CMirrorTransportClass()
46 CEGSExecutePhraseMsg (const TDataSetRow &actorRowId, const TDataSetRow &targetRowId, const NLMISC::CSheetId &phraseId ) :
47 CMirrorTransportClass(), ActorRowId(actorRowId), TargetRowId(targetRowId), PhraseId(phraseId)
50 TDataSetRow ActorRowId;
51 TDataSetRow TargetRowId;
52 NLMISC::CSheetId PhraseId;
54 virtual void description ()
56 className ("CEGSExecutePhraseMsg");
57 property ("actorRowId", PropDataSetRow, TDataSetRow(), ActorRowId);
58 property ("targetRowId", PropDataSetRow, TDataSetRow(), TargetRowId);
59 property ("phrase", PropSheetId, NLMISC::CSheetId::Unknown, PhraseId);
62 virtual void callback (const std::string &name, NLNET::TServiceId id);
65 /**
66 * Class CEGSExecuteAiActionMsg, message class used by npcs to execute an ai action
67 * \author David Fleury
68 * \author Nevrax France
69 * \date 2002
71 class CEGSExecuteAiActionMsg : public CMirrorTransportClass
73 public:
74 CEGSExecuteAiActionMsg () : CMirrorTransportClass()
77 CEGSExecuteAiActionMsg (const TDataSetRow &actorRowId, const TDataSetRow &targetRowId, const NLMISC::CSheetId &actionId, float damageCoef=1, float damageSpeedCoef=1)
78 :CMirrorTransportClass()
79 ,ActorRowId(actorRowId)
80 ,TargetRowId(targetRowId)
81 ,ActionId(actionId)
82 ,DamageCoef(damageCoef)
83 ,DamageSpeedCoef(damageSpeedCoef)
86 TDataSetRow ActorRowId;
87 TDataSetRow TargetRowId;
88 NLMISC::CSheetId ActionId;
89 float DamageCoef;
90 float DamageSpeedCoef;
92 virtual void description ()
94 className ("CEGSExecuteAiActionMsg");
95 property ("actorRowId", PropDataSetRow, TDataSetRow(), ActorRowId);
96 property ("targetRowId", PropDataSetRow, TDataSetRow(), TargetRowId);
97 property ("actionId", PropSheetId, NLMISC::CSheetId::Unknown, ActionId);
98 property ("damageCoef", PropFloat, 1.f, DamageCoef);
99 property ("damageSpeedCoef", PropFloat, 1.f, DamageSpeedCoef);
102 virtual void callback (const std::string &name, NLNET::TServiceId id) {}
107 * Class CEGSExecuteMsg, message class used to execute a phrase
108 * \author David Fleury
109 * \author Nevrax France
110 * \date 2003
112 class CEGSExecuteMsg : public CMirrorTransportClass
114 public:
115 TDataSetRow ActorRowId;
116 TDataSetRow TargetRowId;
117 std::vector<NLMISC::CSheetId> BrickIds;
118 bool Cyclic;
120 uint8 Index; // index of the phrase in the player memorized phrase interface if != 0xff
122 CEGSExecuteMsg() : Cyclic(false), Index(0xff)
125 virtual void description ()
127 className ("CEGSExecuteMsg");
128 property ("actorRowId", PropDataSetRow, TDataSetRow(), ActorRowId);
129 property ("targetRowId", PropDataSetRow, TDataSetRow(), TargetRowId);
130 propertyCont ("brickIds", PropSheetId, BrickIds);
131 property ("cyclic", PropBool, false, Cyclic);
132 property ("index", PropUInt8, (uint8)0xff, Index);
135 virtual void callback (const std::string &name, NLNET::TServiceId id) {}
140 * Class CBSAIEventReportMsg
141 * \author David Fleury
142 * \author Nevrax France
143 * \date 2002
145 class CBSAIEventReportMsg : public CMirrorTransportClass
147 public:
148 std::vector<TDataSetRow> Originator;
149 std::vector<TDataSetRow> Target;
150 std::vector<uint8> AffectedStat;
151 std::vector<sint32> DeltaValue;
152 std::vector<float> AggroAdd;
153 // std::vector<float> AggroMul;
154 std::vector<uint8> ActionType;
156 CBSAIEventReportMsg()
159 //void pushBack( const TDataSetRow& originator, const TDataSetRow& target, const CAiEventReport &report)
160 void pushBack( const CAiEventReport &report)
162 const uint size = (uint)Originator.size();
163 const uint nbElts = report.AffectedStats.empty() ? 1 : (uint)report.AffectedStats.size();
165 Originator.resize(size+nbElts);
166 Target.resize(size+nbElts);
167 AffectedStat.resize(size+nbElts);
168 DeltaValue.resize(size+nbElts,0);
169 AggroAdd.resize(size+nbElts,0.0f);
170 // AggroMul.resize(size+nbElts,1.0f);
171 ActionType.resize(size+nbElts,0);
173 for (uint i = 0 ; i < nbElts ; ++i)
175 Originator[size + i] = report.Originator;
176 Target[size + i] = report.Target;
177 ActionType[size + i] = (uint8)report.Type;
179 if ( i < report.AffectedStats.size() )
181 AffectedStat[size + i] = (uint8) report.AffectedStats[i];
182 DeltaValue[size + i] = report.DeltaValue[i];
185 if (i == 0)
187 AggroAdd[size + i] = report.AggroAdd;
188 // AggroMul[size + i] = report.AggroMul;
190 else
192 AggroAdd[size + i] = 0.0f;
193 // AggroMul[size + i] = 1.0f;
198 void clear()
200 Originator.clear();
201 Target.clear();
202 AffectedStat.clear();
203 DeltaValue.clear();
204 AggroAdd.clear();
205 // AggroMul.clear();
206 ActionType.clear();
209 virtual void description()
211 className ("CBSAIEventReportMsg");
212 propertyCont ("Originator", PropDataSetRow, Originator );
213 propertyCont ("Target", PropDataSetRow, Target );
214 propertyCont ("AffectedStat", PropUInt8, AffectedStat );
215 propertyCont ("DeltaValue", PropSInt32, DeltaValue );
216 propertyCont ("AggroAdd", PropFloat, AggroAdd );
217 // propertyCont ("AggroMul", PropFloat, AggroMul );
218 propertyCont ("ActionType", PropUInt8, ActionType );
221 virtual void callback (const std::string &name, NLNET::TServiceId id);
225 * Class CBSAIDeathReport
226 * \author Stephane le Dorze
227 * \author Nevrax France
228 * \date 2003
229 * \Class sent from EGS to AIS to set AIS bots to dead mode.
232 class CBSAIDeathReport : public CMirrorTransportClass
234 public:
235 std::vector<TDataSetRow> Bots; // Bots to mark as dead.
236 std::vector<TDataSetRow> Killers; // killer of each bot
237 std::vector<bool> Zombies; // if true indicate this bot is detected as zombie
239 CBSAIDeathReport ()
243 virtual void description ()
245 className ("CBSAIDeathReport");
246 propertyCont ("Bots", PropDataSetRow, Bots);
247 propertyCont ("Killers", PropDataSetRow, Killers);
248 propertyVector ("Zombies", PropBool, Zombies);
250 virtual void callback (const std::string &name, NLNET::TServiceId id);
253 #endif // RY_MSG_BRICK_SERVICE_H
255 /* End of msg_brick_service.h */