Pol  Revision:4b29d2b
uomod.h
Go to the documentation of this file.
1 
30 #ifndef H_UOMOD_H
31 #define H_UOMOD_H
32 
33 #include "../../bscript/execmodl.h"
34 #include "../../clib/rawtypes.h"
35 #include "../poltype.h"
36 #include "../reftypes.h"
37 
38 namespace Pol
39 {
40 namespace Bscript
41 {
42 class BObjectImp;
43 class ObjArray;
44 } // namespace Bscript
45 } // namespace Pol
46 
47 namespace Pol
48 {
49 namespace Realms
50 {
51 class Realm;
52 }
53 namespace Core
54 {
55 class Menu;
56 class UContainer;
57 class UOExecutor;
58 class UObject;
59 } // namespace Core
60 namespace Mobile
61 {
62 class Character;
63 }
64 namespace Items
65 {
66 class Item;
67 }
68 namespace Multi
69 {
70 class UBoat;
71 }
72 namespace Module
73 {
74 class UOExecutorModule : public Bscript::TmplExecutorModule<UOExecutorModule>
75 {
76 public:
77  Bscript::BObjectImp* mf_SendStatus( /* mob */ );
78 
79  Bscript::BObjectImp* mf_MoveObjectToLocation();
80  Bscript::BObjectImp* mf_SendCharacterRaceChanger( /* Character */ );
81  Bscript::BObjectImp* mf_SendHousingTool();
82  Bscript::BObjectImp* mf_SendOpenBook();
83  Bscript::BObjectImp* mf_SelectColor();
84  Bscript::BObjectImp* mf_AddAmount();
85 
86  Bscript::BObjectImp* mf_SendViewContainer();
87  Bscript::BObjectImp* mf_GetObjPropertyNames();
88  Bscript::BObjectImp* mf_CreateItemCopyAtLocation( /* x,y,z,item */ );
89  Bscript::BObjectImp* mf_SendInstaResDialog();
90  Bscript::BObjectImp* mf_FindAccount();
91  Bscript::BObjectImp* mf_ListAccounts();
92  Bscript::BObjectImp* mf_SendStringAsTipWindow();
93  Bscript::BObjectImp* mf_GetCommandHelp();
94  Bscript::BObjectImp* mf_PlaySoundEffectPrivate();
95  Bscript::BObjectImp* mf_ConsumeSubstance();
96  Bscript::BObjectImp* mf_FindSubstance();
97  Bscript::BObjectImp* mf_Shutdown();
98  Bscript::BObjectImp* mf_OpenPaperdoll();
99  Bscript::BObjectImp* mf_SendSkillWindow();
100  Bscript::BObjectImp* mf_ReserveItem();
101  Bscript::BObjectImp* mf_ReleaseItem();
102  Bscript::BObjectImp* mf_GetStandingHeight();
103  Bscript::BObjectImp* mf_GetStandingLayers( /* x, y, flags, realm */ );
104  Bscript::BObjectImp* mf_AssignRectToWeatherRegion();
105  Bscript::BObjectImp* mf_SetRegionWeatherLevel();
106  Bscript::BObjectImp* mf_CreateAccount();
107  Bscript::BObjectImp* mf_SetScriptController();
108  Bscript::BObjectImp* mf_PolCore();
109  Bscript::BObjectImp* mf_GetWorldHeight();
110  Bscript::BObjectImp* mf_StartSpellEffect();
111  Bscript::BObjectImp* mf_GetSpellDifficulty();
112  Bscript::BObjectImp* mf_SpeakPowerWords();
113 
114  Bscript::BObjectImp* mf_GetMultiDimensions();
115  Bscript::BObjectImp* mf_DestroyMulti();
116  Bscript::BObjectImp* mf_SendTextEntryGump();
117  Bscript::BObjectImp* mf_SendGumpMenu();
118  Bscript::BObjectImp* mf_CloseGump();
119  Bscript::BObjectImp* mf_CloseWindow( /* chr, type, who */ );
120  Bscript::BObjectImp* mf_SendEvent();
121  Bscript::BObjectImp* mf_PlayMovingEffectXyz();
122  Bscript::BObjectImp* mf_GetEquipmentByLayer();
123  Bscript::BObjectImp* mf_GetObjtypeByName();
124 
125  Bscript::BObjectImp* mf_ListHostiles();
126  Bscript::BObjectImp* mf_DisconnectClient();
127  Bscript::BObjectImp* mf_GetRegionName( /* objref */ );
128  Bscript::BObjectImp* mf_GetRegionNameAtLocation( /* x, y, realm */ );
129  Bscript::BObjectImp* mf_GetRegionString();
130  Bscript::BObjectImp* mf_GetRegionLightLevelAtLocation( /* x, y, realm */ );
131 
132  Bscript::BObjectImp* mf_PlayStationaryEffect();
133  Bscript::BObjectImp* mf_GetMapInfo();
134  Bscript::BObjectImp* mf_ListObjectsInBox( /* x1, y1, z1, x2, y2, z2, realm */ );
135  Bscript::BObjectImp* mf_ListMobilesInBox( /* x1, y1, z1, x2, y2, z2, realm */ );
136  Bscript::BObjectImp* mf_ListMultisInBox( /* x1, y1, z1, x2, y2, z2, realm */ );
137  Bscript::BObjectImp* mf_ListStaticsInBox( /* x1, y1, z1, x2, y2, z2, flags, realm */ );
138  Bscript::BObjectImp* mf_ListEquippedItems();
139  Bscript::BObjectImp* mf_ConsumeReagents();
140 
141  Bscript::BObjectImp* mf_SendPacket();
142  Bscript::BObjectImp* mf_SendQuestArrow();
143 
144  Bscript::BObjectImp* mf_PromptInput();
145 
146  Bscript::BObjectImp* mf_ReadGameClock();
147 
148  Bscript::BObjectImp* mf_GrantPrivilege();
149  Bscript::BObjectImp* mf_RevokePrivilege();
150 
151  Bscript::BObjectImp* mf_EquipFromTemplate();
152 
153  Bscript::BObjectImp* mf_GetHarvestDifficulty();
154  Bscript::BObjectImp* mf_HarvestResource();
155 
156  Bscript::BObjectImp* mf_RestartScript();
157  Bscript::BObjectImp* mf_EnableEvents();
158  Bscript::BObjectImp* mf_DisableEvents();
159  Bscript::BObjectImp* mf_EquipItem();
160  Bscript::BObjectImp* mf_MoveItemToContainer();
161  Bscript::BObjectImp* mf_MoveItemToSecureTradeWin( /* item, character */ );
162  Bscript::BObjectImp* mf_FindObjtypeInContainer();
163  Bscript::BObjectImp* mf_SendOpenSpecialContainer();
164  Bscript::BObjectImp* mf_SecureTradeWin( /* who, who2 */ );
165  Bscript::BObjectImp* mf_CloseTradeWindow();
166 
167 
168  Bscript::BObjectImp* mf_SendBuyWindow( /* character, container, vendor, items, flags */ );
169  Bscript::BObjectImp* mf_SendSellWindow( /* character, vendor, i1, i2, i3, flags */ );
170  Bscript::BObjectImp* mf_ListMobilesNearLocationEx( /* x, y, z, range, flags, realm */ );
171  Bscript::BObjectImp* mf_CreateItemInContainer();
172  Bscript::BObjectImp* mf_CreateItemInInventory();
173  Bscript::BObjectImp* mf_SystemFindObjectBySerial();
174  Bscript::BObjectImp* mf_ListItemsNearLocationOfType();
175  Bscript::BObjectImp* mf_ListGhostsNearLocation();
176  Bscript::BObjectImp* mf_ListMobilesInLineOfSight();
177  Bscript::BObjectImp* mf_Distance();
178  Bscript::BObjectImp* mf_DistanceEuclidean();
179  Bscript::BObjectImp* mf_CoordinateDistance();
180  Bscript::BObjectImp* mf_CoordinateDistanceEuclidean();
181  Bscript::BObjectImp* mf_GetCoordsInLine();
182  Bscript::BObjectImp* mf_GetFacing();
183  Bscript::BObjectImp* mf_SetRegionLightLevel();
184  Bscript::BObjectImp* mf_EraseObjProperty();
185  Bscript::BObjectImp* mf_GetGlobalProperty();
186  Bscript::BObjectImp* mf_SetGlobalProperty();
187  Bscript::BObjectImp* mf_EraseGlobalProperty();
188  Bscript::BObjectImp* mf_GetGlobalPropertyNames();
189  Bscript::BObjectImp* mf_SaveWorldState();
190  Bscript::BObjectImp* mf_CreateMultiAtLocation();
191  Bscript::BObjectImp* mf_TargetMultiPlacement();
192 
193  Bscript::BObjectImp* mf_Resurrect();
194  Bscript::BObjectImp* mf_CreateNpcFromTemplate();
195  Bscript::BObjectImp* mf_RegisterForSpeechEvents();
196  Bscript::BObjectImp* mf_EnumerateOnlineCharacters();
197  Bscript::BObjectImp* mf_PrintTextAbove();
198  Bscript::BObjectImp* mf_PrivateTextAbove();
199 
200  Bscript::BObjectImp* mf_Attach( /* Character */ );
201  Bscript::BObjectImp* mf_Detach();
202 
204 
205  Bscript::BObjectImp* send_open_special_container();
206  Bscript::BObjectImp* create_item_in_container();
207  Bscript::BObjectImp* find_objtype_in_container();
208 
209  Bscript::BObjectImp* mf_Accessible(); // Character, Item
210  Bscript::BObjectImp* mf_ApplyConstraint(); // ObjArray, ConfigFile, propname, minvalue
211 
212  Bscript::BObjectImp* mf_CheckLineOfSight(); // Character, Object
213  Bscript::BObjectImp* mf_CheckLosAt();
214  Bscript::BObjectImp* mf_CreateItemInBackpack(); // Character, ObjectType, Amount
215 
216  Bscript::BObjectImp* mf_CreateItemAtLocation( /* x,y,z,objtype,amount */ );
217 
218  Bscript::BObjectImp* mf_DestroyItem();
219  Bscript::BObjectImp* mf_FindPath(); // x1, y1, z1, x2, y2, z2
220  Bscript::BObjectImp* mf_GetAmount(); // Item
221  Bscript::BObjectImp* mf_GetMenuObjTypes(); // MenuName
222  Bscript::BObjectImp* mf_GetObjProperty();
223  Bscript::BObjectImp* mf_GetObjType(); // Item
224  Bscript::BObjectImp* mf_GetPosition();
225  Bscript::BObjectImp* mf_GetStats();
226  Bscript::BObjectImp* mf_GetStatus();
227 
228  Bscript::BObjectImp* mf_ListItemsAtLocation(); // x,y,z
229  Bscript::BObjectImp* mf_ListMobilesNearLocation( /* x, y, z, range, realm */ );
230  Bscript::BObjectImp* mf_ListItemsNearLocationWithFlag(); // DAVE - flag is a tiledata.mul flag
231  Bscript::BObjectImp* mf_ListStaticsAtLocation( /* x, y, flags, realm */ );
232  Bscript::BObjectImp* mf_ListStaticsNearLocation( /* x, y, range, flags, realm */ );
233  Bscript::BObjectImp* mf_ListOfflineMobilesInRealm( /*realm*/ );
234 
235  Bscript::BObjectImp* mf_PerformAction(); // character, action
236  Bscript::BObjectImp* mf_PlayAnimation();
237  Bscript::BObjectImp* mf_PlayLightningBoltEffect(); // center
238  Bscript::BObjectImp* mf_PlayMovingEffect(); // src dst effect speed loop explode
239  Bscript::BObjectImp* mf_PlayObjectCenteredEffect();
240  Bscript::BObjectImp* mf_PlaySoundEffect();
241  Bscript::BObjectImp* mf_Range(); // Object, Object
242  Bscript::BObjectImp* mf_SetName();
243  Bscript::BObjectImp* mf_SetObjProperty();
244 
245  Bscript::BObjectImp* mf_SelectMenuItem(); // character, menuname
246  Bscript::BObjectImp* mf_SendSysMessage(); // Character, Text
247  Bscript::BObjectImp* mf_SubtractAmount(); // Item, Amount
248  Bscript::BObjectImp* mf_Target(); // Character to choose
249  Bscript::BObjectImp* mf_TargetCancel(); // Character to cancel for
250 
251  Bscript::BObjectImp* mf_ListItemsNearLocation();
252  Bscript::BObjectImp* mf_EnumerateItemsInContainer();
253  Bscript::BObjectImp* mf_TargetCoordinates();
254 
255  Bscript::BObjectImp* mf_CreateMenu();
256  Bscript::BObjectImp* mf_AddMenuItem();
257 
258  Bscript::BObjectImp* mf_UseItem();
259 
260  Bscript::BObjectImp* mf_IsStackable(); // item1, item2
261 
262  Bscript::BObjectImp* mf_PlayMovingEffect_Ex(
263  /*src,dst,effect,speed,duration,hue,render,direction,explode,effect3d*/ );
264  Bscript::BObjectImp* mf_PlayMovingEffectXyz_Ex(
265  /*sx,sy,sz,dx,dy,dz,realm,effect,speed,duration,hue,render,direction,explode,effect3d*/ );
266  Bscript::BObjectImp* mf_PlayObjectCenteredEffect_Ex(
267  /*src,effect,speed,duration,hue,render,layer,explode,effect3d*/ );
268  Bscript::BObjectImp* mf_PlayStationaryEffect_Ex(
269  /*x,y,z,realm,effect,speed,duration,hue,render,layer,explode,effect3d*/ );
270 
271  Bscript::BObjectImp* mf_UpdateMobile( /*mob*/ );
272  Bscript::BObjectImp* mf_UpdateItem( /*item*/ );
273  Bscript::BObjectImp* mf_CheckLosBetween( /*x1,y1,z1,x2,y2,z2,realm*/ );
274 
275  Bscript::BObjectImp* mf_PlaySoundEffectXYZ( /*x,y,z,effect,realm*/ );
276  Bscript::BObjectImp* mf_PlayMusic( /*char, musicid*/ );
277 
278  Bscript::BObjectImp* mf_CanWalk( /*movemode, x1, y1, z1, x2_or_dir, y2 := -1, realm := DEF*/ );
279  Bscript::BObjectImp* mf_SendCharProfile(
280  /*chr, of_who, title, uneditable_text := array, editable_text := array*/ );
281  Bscript::BObjectImp* mf_SendOverallSeason( /*season_id, playsound := 1*/ );
282  Bscript::BObjectImp* mf_GetMidpointCircleCoords( /* xcenter, ycenter, radius */ );
283 
284  Bscript::BObjectImp* mf_SendPopUpMenu( /* to_whom, above, menu */ );
285  Bscript::BObjectImp* mf_SingleClick( /*who, what*/ );
286 
287  Bscript::BObjectImp* mf_ListStaticsNearLocationOfType(
288  /* x, y, z, range, objtype, flags, realm */ );
289  Bscript::BObjectImp* mf_ListStaticsNearLocationWithFlag( /* x, y, z, range, flags, realm */ );
290 
292 
293  /* If we're asking a character for a target, who is it?
294  that character's target_cursor_ex points to us,
295  so clean up on destruct
296  Same for menu selection.
297  perhaps a single Character*, and an enum task?
298  */
308 
310 
315 
316  bool is_reserved_to_me( Items::Item* item );
317  std::vector<Core::ItemRef> reserved_items_;
318 
320 
321  explicit UOExecutorModule( Core::UOExecutor& exec );
322  ~UOExecutorModule();
323 
324 protected:
325  // bool getStaticMenuParam( unsigned param, Menu*& menu );
326  bool getDynamicMenuParam( unsigned param, Core::Menu*& menu );
327  bool getStaticOrDynamicMenuParam( unsigned param, Core::Menu*& menu );
328 
329 protected:
330  Bscript::BObjectImp* internal_MoveItem( Items::Item* item, Core::xcoord x, Core::ycoord y,
331  Core::zcoord z, int flags, Realms::Realm* newrealm );
332  Bscript::BObjectImp* internal_MoveCharacter( Mobile::Character* chr, Core::xcoord x,
333  Core::ycoord y, Core::zcoord z, int flags,
334  Realms::Realm* newrealm );
335  Bscript::BObjectImp* internal_MoveBoat( Multi::UBoat* boat, Core::xcoord x, Core::ycoord y,
336  Core::zcoord z, int flags, Realms::Realm* newrealm );
337  Bscript::BObjectImp* internal_MoveContainer( Core::UContainer* container, Core::xcoord x,
338  Core::ycoord y, Core::zcoord z, int flags,
339  Realms::Realm* newrealm );
340  static void internal_InBoxAreaChecks( unsigned short& x1, unsigned short& y1, int& z1,
341  unsigned short& x2, unsigned short& y2, int& z2,
342  Realms::Realm* realm );
343  Bscript::BObjectImp* internal_SendUnCompressedGumpMenu( Mobile::Character* chr,
344  Bscript::ObjArray* layout_arr,
345  Bscript::ObjArray* data_arr, int x, int y,
346  u32 gumpid );
347  Bscript::BObjectImp* internal_SendCompressedGumpMenu( Mobile::Character* chr,
348  Bscript::ObjArray* layout_arr,
349  Bscript::ObjArray* data_arr, int x, int y,
350  u32 gumpid );
351 
352 private: // not implemented
354  UOExecutorModule& operator=( const UOExecutorModule& );
355 };
356 } // namespace Module
357 } // namespace Pol
358 #endif
void broadcast(const char *text, unsigned short font, unsigned short color, unsigned short requiredCmdLevel)
Definition: ufunc.cpp:1213
short zcoord
Definition: poltype.h:21
Mobile::Character * gump_chr
Definition: uomod.h:304
Mobile::Character * prompt_chr
Definition: uomod.h:303
unsigned short ycoord
Definition: poltype.h:20
Core::UOExecutor & uoexec
Definition: uomod.h:291
Mobile::Character * resurrect_chr
Definition: uomod.h:306
Core::CharacterRef controller_
Definition: uomod.h:314
unsigned int u32
Definition: rawtypes.h:27
Mobile::Character * target_cursor_chr
Definition: uomod.h:299
Mobile::Character * attached_chr_
Definition: uomod.h:311
ref_ptr< Mobile::Character > CharacterRef
Definition: reftypes.h:42
Items::Item * attached_item_
Definition: uomod.h:313
Core::UObject * popup_menu_selection_above
Definition: uomod.h:302
Mobile::Character * popup_menu_selection_chr
Definition: uomod.h:301
Mobile::Character * menu_selection_chr
Definition: uomod.h:300
Mobile::Character * selcolor_chr
Definition: uomod.h:307
std::vector< Core::ItemRef > reserved_items_
Definition: uomod.h:317
Definition: berror.cpp:12
Mobile::Character * attached_npc_
Definition: uomod.h:312
unsigned short xcoord
Definition: poltype.h:19
Mobile::Character * textentry_chr
Definition: uomod.h:305