Subversion Repository Public Repository

fonline_sdk

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
// FOS Common

#ifdef __CLIENT
# include "ClientCore"
#endif
#ifdef __MAPPER
# include "ClientCore"
# include "MapperCore"
#endif

#ifdef __SERVER
# pragma event "EventInit()"
# pragma event "EventStart()"
# pragma event "EventGenerateWorld( uint16& multiplier, uint16& year, uint16& month, uint16& day, uint16& hour, uint16& minute )"
# pragma event "EventFinish()"
# pragma event "EventLoop()"
# pragma event "EventItemsBarter( Item@[]& saleItems, uint[]& saleItemsCount, Item@[]& buyItems, uint[]& buyItemsCount, Critter& player, Critter& npc )"
# pragma event "EventWorldSave( uint saveIndex, uint[]& deleteIndicies )"
# pragma event "EventGlobalMapCritterIn( Critter@ critter )"
# pragma event "EventGlobalMapCritterOut( const Critter@ critter )"

# pragma event "EventLocationEnter( Location& location, bool firstTime )"
# pragma event "EventLocationFinish( Location& location, bool toDelete )"

# pragma event "EventMapLoop( Map& map )"
# pragma event "EventMapFinish( Map& map, bool toDelete )"
# pragma event "EventMapCritterIn( Map& map, Critter& critter )"
# pragma event "EventMapCritterOut( const Map& map, const Critter& critter )"
# pragma event "EventMapCheckLook( const Map& map, const Critter& critter, const Critter& target )"
# pragma event "EventMapCheckTrapLook( const Map& map, const Critter& critter, const Item& item )"

# pragma event "EventCritterInit( Critter& critter, bool firstTime )"
# pragma event "EventCritterFinish( Critter& critter, bool toDelete )"
# pragma event "EventCritterIdle( Critter& critter )"
# pragma event "EventCritterGlobalMapIdle( Critter& critter )"
# pragma event "EventCritterAttack( Critter& critter, Critter& target, Item& weapon, uint8 weaponMode, const Item@ ammo )"
# pragma event "EventCritterDead( Critter& critter, Critter@ killer )"
# pragma event "EventCritterRespawn( Critter& critter )"
# pragma event "EventCritterStealing( Critter& critter, Critter& thief, Item& item, uint itemCount )"
# pragma event "EventCritterUseItem( Critter& critter, Item& item, Critter@ onCritter, Item@ onItem, const Item@ onScenery, uint param )"
# pragma event "EventCritterUseSkill( Critter& critter, CritterProperty skill, Critter@ onCritter, Item@ onItem, const Item@ onScenery )"
# pragma event "EventCritterReloadWeapon( Critter& critter, Item& weapon, Item@ ammo )"
# pragma event "EventCritterCheckMoveItem( const Critter& critter, const Item& item, uint8 toSlot, const Item@ swapItem )"
# pragma event "EventCritterMoveItem( Critter& critter, Item& item, uint8 fromSlot ) deferred"
# pragma event "EventCritterShow( Critter& critter, Critter& showCritter ) deferred"
# pragma event "EventCritterShowDist1( Critter& critter, Critter& showCritter ) deferred"
# pragma event "EventCritterShowDist2( Critter& critter, Critter& showCritter ) deferred"
# pragma event "EventCritterShowDist3( Critter& critter, Critter& showCritter ) deferred"
# pragma event "EventCritterHide( Critter& critter, Critter& hideCritter ) deferred"
# pragma event "EventCritterHideDist1( Critter& critter, Critter& hideCritter ) deferred"
# pragma event "EventCritterHideDist2( Critter& critter, Critter& hideCritter ) deferred"
# pragma event "EventCritterHideDist3( Critter& critter, Critter& hideCritter ) deferred"
# pragma event "EventCritterShowItemOnMap( Critter& critter, Item& item, bool added, Critter@ fromCritter ) deferred"
# pragma event "EventCritterHideItemOnMap( Critter& critter, Item& item, bool removed, Critter@ toCritter ) deferred"
# pragma event "EventCritterChangeItemOnMap( Critter& critter, Item& item ) deferred"
# pragma event "EventCritterDropItem( Critter& critter, Item& item ) deferred"
# pragma event "EventCritterMessage( Critter& critter, Critter& receiver, int num, int value )"
# pragma event "EventCritterTalk( Critter& critter, Critter& who, bool begin, uint talkers )"
# pragma event "EventCritterBarter( Critter& critter, Critter& who, bool begin, uint barterCount )"
# pragma event "EventCritterKnockout( Critter& critter, uint lostAp, uint dist )"
# pragma event "EventCritterGetUseApCost( const Critter& critter, const Item& item, uint8 itemMode, uint& apCost )"
# pragma event "EventCritterGetAttackDistantion( const Critter& critter, const Item& item, uint8 itemMode, uint& dist )"
# pragma event "EventNpcPlaneBegin( Critter& npc, NpcPlane& plane, int, Critter@, Item@ )"
# pragma event "EventNpcPlaneEnd( Critter& npc, NpcPlane& plane, int, Critter@, Item@ )"
# pragma event "EventNpcPlaneRun( Critter& npc, NpcPlane& plane, int, uint&, uint&, uint& )"
# pragma event "EventPlayerRegistration( uint, string&, uint&, uint&, string& )"
# pragma event "EventPlayerLogin( uint, string&, uint, uint&, uint&, string& )"
# pragma event "EventPlayerGetAccess( Critter& player, int, string& )"
# pragma event "EventPlayerAllowCommand( Critter@ player, string@, uint8 )"

# pragma event "EventItemFinish( Item& item, bool toDelete )"
# pragma event "EventItemWalk( Item& item, Critter& critter, bool isIn, uint8 dir ) deferred"
# pragma event "EventItemCheckMove( const Item& item, uint count, const Entity& from, const Entity& to )"
#endif

#ifdef __CLIENT
# pragma event "EventStart()"
# pragma event "EventFinish()"
# pragma event "EventLoop()"
# pragma event "EventGetActiveScreens( int[]& screens )"
# pragma event "EventScreenChange( bool show, int screen, dictionary@ params )"
# pragma event "EventRenderIface( uint layer )"
# pragma event "EventRenderMap()"
# pragma event "EventMouseDown( int button )"
# pragma event "EventMouseUp( int button )"
# pragma event "EventMouseMove()"
# pragma event "EventKeyDown( uint8 key, string@ text )"
# pragma event "EventKeyUp( uint8 key )"
# pragma event "EventInputLost()"
# pragma event "EventCritterIn( Critter& critter )"
# pragma event "EventCritterOut( Critter& critter )"
# pragma event "EventItemMapIn( Item& item )"
# pragma event "EventItemMapChanged( Item& item, Item& oldItem )"
# pragma event "EventItemMapOut( Item& item )"
# pragma event "EventItemInvAllIn()"
# pragma event "EventItemInvIn( Item& item )"
# pragma event "EventItemInvChanged( Item& item, Item& oldItem )"
# pragma event "EventItemInvOut( Item& item )"
# pragma event "EventContainerChanged()"
# pragma event "EventMapMessage( string& text, uint16& hexX, uint16& hexY, uint& color, uint& delay )"
# pragma event "EventInMessage( string& text, int& sayType, uint& critterId, uint& delay )"
# pragma event "EventOutMessage( string& text, int& sayType )"
# pragma event "EventMessageBox( string& text, int type, bool scriptCall )"
# pragma event "EventCombatResult( uint[]& result )"
# pragma event "EventItemCheckMove( const Item& item, uint count, const Entity& from, const Entity& to )"
# pragma event "EventCritterAction( bool, Critter&, int, int, Item@ )"
# pragma event "EventAnimation2dProcess( bool, Critter&, uint, uint, Item@ )"
# pragma event "EventAnimation3dProcess( bool, Critter&, uint, uint, Item@ )"
# pragma event "EventItemsCollection( int, Item@[]& )"
# pragma event "EventCritterAnimation( hash, uint, uint, uint&, uint&, int&, int&, string& )"
# pragma event "EventCritterAnimationSubstitute( hash, uint, uint, hash&, uint&, uint& )"
# pragma event "EventCritterAnimationFallout( hash, uint&, uint&, uint&, uint&, uint& )"
# pragma event "EventCritterCheckMoveItem( const Critter&, const Item&, uint8, const Item@ )"
# pragma event "EventCritterGetUseApCost( const Critter&, const Item&, uint8, uint& )"
# pragma event "EventCritterGetAttackDistantion( const Critter&, const Item&, uint8, uint& )"
#endif

#ifdef __MAPPER
# pragma event "EventStart()"
# pragma event "EventFinish()"
# pragma event "EventLoop()"
# pragma event "EventConsoleMessage( string& text )"
# pragma event "EventRenderIface( uint layer )"
# pragma event "EventRenderMap()"
# pragma event "EventMouseDown( int button )"
# pragma event "EventMouseUp( int button )"
# pragma event "EventMouseMove( int mouseX, int mouseY )"
# pragma event "EventKeyDown( uint8 key, string& text )"
# pragma event "EventKeyUp( uint8 key, string& text )"
# pragma event "EventInputLost()"
# pragma event "EventCritterAnimation( hash, uint, uint, uint&, uint&, int&, int&, string& )"
# pragma event "EventCritterAnimationSubstitute( hash, uint, uint, hash&, uint&, uint& )"
# pragma event "EventCritterAnimationFallout( hash, uint&, uint&, uint&, uint&, uint& )"
# pragma event "EventMapLoad( MapperMap& map )"
# pragma event "EventMapSave( MapperMap& map )"
# pragma event "EventInspectorProperties( Entity& entity, int[]& properties )"
#endif

#define MIN                                # ( a, b )( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
#define MAX                                # ( a, b )( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
#define CLAMP                              # ( x, low, high )( ( ( x ) > ( high ) ) ? ( high ) : ( ( ( x ) < ( low ) ) ? ( low ) : ( x ) ) )
#define ABS                                # (val)                ( ( ( val ) > 0 ) ? ( val ) : -( val ) )

#define HASH                               # (name) GetStrHash( name )
#define AP_DIVIDER                         ( 100 )

// Say types
#define SAY_NORM                           ( 1 )
#define SAY_NORM_ON_HEAD                   ( 2 )
#define SAY_SHOUT                          ( 3 )
#define SAY_SHOUT_ON_HEAD                  ( 4 )
#define SAY_EMOTE                          ( 5 )
#define SAY_EMOTE_ON_HEAD                  ( 6 )
#define SAY_WHISP                          ( 7 )
#define SAY_WHISP_ON_HEAD                  ( 8 )
#define SAY_SOCIAL                         ( 9 )
#define SAY_RADIO                          ( 10 )
#define SAY_NETMSG                         ( 11 )
#define SAY_DIALOG                         ( 12 )
#define SAY_APPEND                         ( 13 )
#define SAY_FLASH_WINDOW                   ( 41 )                       // Only flash window in tray and beep

// Msg nums
#define TEXTMSG_TEXT                       ( 0 )
#define TEXTMSG_DLG                        ( 1 )
#define TEXTMSG_ITEM                       ( 2 )
#define TEXTMSG_GAME                       ( 3 )
#define TEXTMSG_GM                         ( 4 )
#define TEXTMSG_COMBAT                     ( 5 )
#define TEXTMSG_QUEST                      ( 6 )
#define TEXTMSG_HOLO                       ( 7 )
#define TEXTMSG_CRAFT                      ( 8 )
#define TEXTMSG_INTERNAL                   ( 9 )
#define TEXTMSG_LOCATIONS                  ( 10 )
#define DLGSTR                             # ( dialogId, strNum )( ( ( dialogId ) & 0xFFFFC000 ) | ( ( 12000 + ( strNum ) ) & ~0xFFFFC000 ) )
#define LOCSTR                             # ( locPid, strNum )( ( ( locPid ) & 0xFFFFF000 ) | ( ( strNum ) & ~0xFFFFF000 ) )
#define ITEMSTR                            # ( itemPid, strNum )( ( ( itemPid ) & 0xFFFFFFF0 ) | ( ( strNum ) & ~0xFFFFFFF0 ) )
#define CRSTR                              # ( crPid, strNum )( ( ( crPid ) & 0xFFFFFFF0 ) | ( ( strNum ) & ~0xFFFFFFF0 ) )

// Critter conditions
#pragma enum CritterCondition Unknown = 0
#pragma enum CritterCondition Alive = 1
#pragma enum CritterCondition Knockout = 2
#pragma enum CritterCondition Dead = 3

// Items accessory
#pragma enum ItemOwnership Nowhere = 0
#pragma enum ItemOwnership CritterInventory = 1
#pragma enum ItemOwnership MapHex = 2
#pragma enum ItemOwnership ItemContainer = 3

// Items types
#pragma enum ItemType None = 0
#pragma enum ItemType Armor = 1
#pragma enum ItemType Drug = 2
#pragma enum ItemType Weapon = 3
#pragma enum ItemType Ammo = 4
#pragma enum ItemType Misc = 5
#pragma enum ItemType Key = 7
#pragma enum ItemType Container = 8
#pragma enum ItemType Door = 9
#pragma enum ItemType Grid = 10
#pragma enum ItemType Generic = 11
#pragma enum ItemType Wall = 12
#pragma enum ItemType Car = 13

// Return values for CRITTER_EVENT_PLANE_ BEGIN/END/RUN events
#define PLANE_KEEP                         ( 1 )
#define PLANE_DISCARD                      ( 2 )

// In SendMessage
#define MESSAGE_TO_WHO_SEES_ME             ( 0 )          // Отослать сообщения всем кто видет криттера.
#define MESSAGE_TO_I_SEE                   ( 1 )          // Отослать сообщения всем кого видит криттер.
#define MESSAGE_TO_ALL_ON_MAP              ( 2 )          // Отослать всем на карте.

// Critter actions
// Flags for chosen:
// l - hardcoded local call
// s - hardcoded server call
// for all others critters actions call only server
//                                          flags    actionExt                                                      item
#define ACTION_MOVE                        ( 0 )         // l
#define ACTION_RUN                         ( 1 )         // l
#define ACTION_MOVE_ITEM                   ( 2 )         // l s      from slot                                                      +
#define ACTION_MOVE_ITEM_SWAP              ( 3 )         // l s      from slot                                                      +
#define ACTION_USE_ITEM                    ( 4 )         // l s                                                                     +
#define ACTION_DROP_ITEM                   ( 5 )         // l s      from slot                                                      +
#define ACTION_USE_WEAPON                  ( 6 )         // l        fail attack 8 bit, use index (0-2) 4-7 bits, aim 0-3 bits      +
#define ACTION_RELOAD_WEAPON               ( 7 )         // l s                                                                     +
#define ACTION_USE_SKILL                   ( 8 )         // l s      skill index (see SK_*)
#define ACTION_PICK_ITEM                   ( 9 )         // l s                                                                     +
#define ACTION_PICK_CRITTER                ( 10 )        // l        0 - loot, 1 - steal, 2 - push
#define ACTION_OPERATE_CONTAINER           ( 11 )        // l s      transfer type * 10 + [0 - get, 1 - get all, 2 - put]           + (exclude get all)
#define ACTION_BARTER                      ( 12 )        //   s      0 - item taken, 1 - item given                                 +
#define ACTION_DODGE                       ( 13 )        //          0 - front, 1 - back
#define ACTION_DAMAGE                      ( 14 )        //          0 - front, 1 - back
#define ACTION_DAMAGE_FORCE                ( 15 )        //          0 - front, 1 - back
#define ACTION_KNOCKOUT                    ( 16 )        //   s      0 - knockout anim2begin
#define ACTION_STANDUP                     ( 17 )        //   s      0 - knockout anim2end
#define ACTION_FIDGET                      ( 18 )        // l
#define ACTION_DEAD                        ( 19 )        //   s      dead type anim2 (see Anim2 in _animation.fos)
#define ACTION_CONNECT                     ( 20 )        //
#define ACTION_DISCONNECT                  ( 21 )        //
#define ACTION_RESPAWN                     ( 22 )        //   s
#define ACTION_REFRESH                     ( 23 )        //   s

// Slots
#define SLOT_INV                           ( 0 )         // Inventory
#define SLOT_HAND1                         ( 1 )         // Weapon slot
#define SLOT_HAND2                         ( 2 )         // Extended slot
#define SLOT_ARMOR                         ( 3 )         // Armor slot
#define SLOT_GROUND                        ( 255 )       // Ground slot, used when critter drop/pick item

// Planes types
#define AI_PLANE_MISC                      ( 0 )
#define AI_PLANE_ATTACK                    ( 1 )
#define AI_PLANE_WALK                      ( 2 )
#define AI_PLANE_PICK                      ( 3 )
#define AI_PLANE_PATROL                    ( 4 )       // WIP
#define AI_PLANE_COURIER                   ( 5 )       // WIP

// Planes deault priority
#define AI_PLANE_MISC_PRIORITY             ( 10 )
#define AI_PLANE_ATTACK_PRIORITY           ( 50 )
#define AI_PLANE_WALK_PRIORITY             ( 20 )
#define AI_PLANE_PICK_PRIORITY             ( 35 )
#define AI_PLANE_PATROL_PRIORITY           ( 25 )
#define AI_PLANE_COURIER_PRIORITY          ( 30 )

// Plane begin/end/run reasons
// Begin
#define REASON_GO_HOME                     ( 10 )
#define REASON_FOUND_IN_ENEMY_STACK        ( 11 )
#define REASON_FROM_DIALOG                 ( 12 )
#define REASON_FROM_SCRIPT                 ( 13 )
#define REASON_RUN_AWAY                    ( 14 )
// End
#define REASON_SUCCESS                     ( 30 )
#define REASON_HEX_TOO_FAR                 ( 31 )
#define REASON_HEX_BUSY                    ( 32 )
#define REASON_HEX_BUSY_RING               ( 33 )
#define REASON_DEADLOCK                    ( 34 )
#define REASON_TRACE_FAIL                  ( 35 )
#define REASON_POSITION_NOT_FOUND          ( 36 )
#define REASON_FIND_PATH_ERROR             ( 37 )
#define REASON_CANT_WALK                   ( 38 )
#define REASON_TARGET_DISAPPEARED          ( 39 )
#define REASON_USE_ITEM_NOT_FOUND          ( 40 )
#define REASON_GAG_CRITTER                 ( 41 )
#define REASON_GAG_ITEM                    ( 42 )
#define REASON_NO_UNARMED                  ( 43 )
// Run
#define REASON_ATTACK_TARGET               ( 50 )
#define REASON_ATTACK_WEAPON               ( 51 )
#define REASON_ATTACK_DISTANTION           ( 52 )
#define REASON_ATTACK_USE_AIM              ( 53 )

// Timeouts in real seconds, generic values
#define IS_TURN_BASED_TIMEOUT              # (cr) ( cr.TimeoutBattle > __FullSecond && cr.TimeoutBattle - __FullSecond > 10000000 )
#define MAXIMUM_TIMEOUT                    ( REAL_HOUR( 5 ) )                                                        // Doctor timeout with min skill
#define IS_TIMEOUT                         # (to) ( ( to ) > __FullSecond )

// Transfer types
#define TRANSFER_CLOSE                     ( 0 )
#define TRANSFER_HEX_CONT_UP               ( 1 )
#define TRANSFER_HEX_CONT_DOWN             ( 2 )
#define TRANSFER_SELF_CONT                 ( 3 )
#define TRANSFER_CRIT_LOOT                 ( 4 )
#define TRANSFER_CRIT_STEAL                ( 5 )
#define TRANSFER_CRIT_BARTER               ( 6 )
#define TRANSFER_FAR_CONT                  ( 7 )
#define TRANSFER_FAR_CRIT                  ( 8 )

// Dilalog functions
#define IS_DIALOG_END                      # (str)        ( not valid( str ) )
#define IS_DIALOG_GENERATED                # (str)  ( valid( str ) && str.length() == 0 )
#define IS_DIALOG_SAY_MODE                 # (str)   ( valid( str ) && str.length() > 0 )

// Time
#define IS_MORNING                         # (hour)          ( ( hour ) >= 7 && ( hour ) <= 11 )         // 5 hours
#define IS_AFTERNOON                       # (hour)        ( ( hour ) >= 12 && ( hour ) <= 21 )          // 10 hours
#define IS_NIGHT                           # (hour)            ( ( hour ) >= 22 || ( hour ) <= 6 )       // 9 hours

// Combat modes
#define COMBAT_MODE_ANY                    ( 0 )
#define COMBAT_MODE_REAL_TIME              ( 1 )
#define COMBAT_MODE_TURN_BASED             ( 2 )

// Global map fog
#define FOG_FULL                           ( 0 )
#define FOG_HALF                           ( 1 )
#define FOG_HALF_EX                        ( 2 )
#define FOG_NONE                           ( 3 )

// Critter find types
// Combine groups with | operator
#define FIND_LIFE                          ( 0x01 )       // First group
#define FIND_KO                            ( 0x02 )
#define FIND_DEAD                          ( 0x04 )
#define FIND_LIFE_AND_KO                   ( 0x03 )
#define FIND_LIFE_AND_DEAD                 ( 0x05 )
#define FIND_KO_AND_DEAD                   ( 0x06 )
#define FIND_ALL                           ( 0x0F )
#define FIND_ONLY_PLAYERS                  ( 0x10 )       // Second group
#define FIND_ONLY_NPC                      ( 0x20 )

// Dialog links
#define DIALOG_END                         uint( -1 )
#define DIALOG_BACK                        uint( -2 )
#define DIALOG_BARTER                      uint( -3 )
#define DIALOG_ATTACK                      uint( -4 )

// Access levels
#define ACCESS_CLIENT                      ( 0 )
#define ACCESS_TESTER                      ( 1 )
#define ACCESS_MODER                       ( 2 )
#define ACCESS_ADMIN                       ( 3 )

// Skills
#define MAX_SKILL_VAL                      ( __SkillMaxValue )

// Special skill values
#define SKILL_PICK_ON_GROUND               CritterProperty( -1 )
#define SKILL_PUT_CONT                     CritterProperty( -2 )
#define SKILL_PUT_ALL_CONT                 CritterProperty( -3 )
#define SKILL_TAKE_CONT                    CritterProperty( -4 )
#define SKILL_TAKE_ALL_CONT                CritterProperty( -5 )
#define SKILL_LOOT_CRITTER                 CritterProperty( -6 )
#define SKILL_PUSH_CRITTER                 CritterProperty( -7 )
#define SKILL_TALK                         CritterProperty( -8 )

// Look checks
#define LOOK_CHECK_DIR                     ( 0x01 )     // Nerfe look by directions of look
#define LOOK_CHECK_SNEAK_DIR               ( 0x02 )     // Nerfe opponent sneak by directions of look
#define LOOK_CHECK_SNEAK_WEIGHT            ( 0x04 )     // Nerfe sneak by current weight
#define LOOK_CHECK_TRACE                   ( 0x08 )     // Tracing for wall aviablility
#define LOOK_CHECK_SCRIPT                  ( 0x10 )     // Allow bool check_look(...) in main.fos, all other defines ignored
#define LOOK_CHECK_ITEM_SCRIPT             ( 0x20 )     // Allow bool check_trap_look(...) in main.fos, for items with ITEM_TRAP flag

// AngelScript properties
#define AS_ALLOW_UNSAFE_REFERENCES         ( 1 )        // true
#define AS_OPTIMIZE_BYTECODE               ( 2 )        // true
#define AS_COPY_SCRIPT_SECTIONS            ( 3 )        // true
#define AS_MAX_STACK_SIZE                  ( 4 )        // 0 (unlimited)
#define AS_USE_CHARACTER_LITERALS          ( 5 )        // false
#define AS_ALLOW_MULTILINE_STRINGS         ( 6 )        // false
#define AS_ALLOW_IMPLICIT_HANDLE_TYPES     ( 7 )        // false
#define AS_BUILD_WITHOUT_LINE_CUES         ( 8 )        // false
#define AS_INIT_GLOBAL_VARS_AFTER_BUILD    ( 9 )        // true
#define AS_REQUIRE_ENUM_SCOPE              ( 10 )       // false
#define AS_SCRIPT_SCANNER                  ( 11 )       // 0
#define AS_INCLUDE_JIT_INSTRUCTIONS        ( 12 )       // false
#define AS_STRING_ENCODING                 ( 13 )       // 0 (ascii)
#define AS_PROPERTY_ACCESSOR_MODE          ( 14 )       // 0 disable, 1 app registered only, 2 app and script created (default)

// Radio
// Flags, Item::RadioFlags
#define RADIO_DISABLE_SEND                 ( 0x0001 )       // Hardcoded
#define RADIO_DISABLE_RECV                 ( 0x0002 )       // Hardcoded
#define RADIO_DISABLE_SHIFT_SEND           ( 0x0100 )
#define RADIO_DISABLE_SHIFT_RECV           ( 0x0200 )
#define RADIO_DISABLE_SHIFT_BC_SEND        ( 0x0400 )
#define RADIO_DISABLE_SHIFT_BC_RECV        ( 0x0800 )
#define RADIO_DISABLE_SHIFT_CHANNEL        ( 0x1000 )
// Broadcast, Item::RadioBroadcastSend/RadioBroadcastRecv, Hardcoded
#define RADIO_BROADCAST_WORLD              ( 0 )                         // Send/recv in all world
#define RADIO_BROADCAST_MAP                ( 20 )                        // Send/recv only on one map
#define RADIO_BROADCAST_LOCATION           ( 40 )                        // Send/recv only on one location
#define RADIO_BROADCAST_ZONE               # (x)   ( 100 + ( x ) )       // Send/recv only in x (1..100) zones radius on global map
#define RADIO_BROADCAST_FORCE_ALL          ( 250 )                       // Force send/recv in any place

// Internal server commands
#define COMMAND_EXIT                       ( 1 )
#define COMMAND_MYINFO                     ( 2 )
#define COMMAND_GAMEINFO                   ( 3 )
#define COMMAND_CRITID                     ( 4 )
#define COMMAND_MOVECRIT                   ( 5 )
#define COMMAND_KILLCRIT                   ( 6 )
#define COMMAND_DISCONCRIT                 ( 7 )
#define COMMAND_TOGLOBAL                   ( 8 )
#define COMMAND_RESPAWN                    ( 9 )
#define COMMAND_PARAM                      ( 10 )
#define COMMAND_GETACCESS                  ( 11 )
#define COMMAND_ADDITEM                    ( 12 )
#define COMMAND_CRASH                      ( 13 )
#define COMMAND_ADDITEM_SELF               ( 14 )
#define COMMAND_ADDNPC                     ( 15 )
#define COMMAND_ADDLOCATION                ( 16 )
#define COMMAND_RELOADSCRIPTS              ( 17 )
#define COMMAND_LOADSCRIPT                 ( 18 )
#define COMMAND_RELOAD_CLIENT_SCRIPTS      ( 19 )
#define COMMAND_RUNSCRIPT                  ( 20 )
#define COMMAND_RELOAD_PROTOS              ( 21 )
#define COMMAND_REGENMAP                   ( 25 )
#define COMMAND_RELOADDIALOGS              ( 26 )
#define COMMAND_LOADDIALOG                 ( 27 )
#define COMMAND_RELOADTEXTS                ( 28 )
#define COMMAND_RELOADAI                   ( 29 )
#define COMMAND_CHECKVAR                   ( 30 )
#define COMMAND_SETVAR                     ( 31 )
#define COMMAND_SETTIME                    ( 32 )
#define COMMAND_BAN                        ( 33 )
#define COMMAND_DELETE_ACCOUNT             ( 34 )
#define COMMAND_CHANGE_PASSWORD            ( 35 )
#define COMMAND_DROP_UID                   ( 36 )
#define COMMAND_LOG                        ( 37 )
#define COMMAND_DEV_EXEC                   ( 38 )
#define COMMAND_DEV_FUNC                   ( 39 )
#define COMMAND_DEV_GVAR                   ( 40 )

// Item uses
#define USE_PRIMARY                        ( 0 )
#define USE_SECONDARY                      ( 1 )
#define USE_THIRD                          ( 2 )
#define USE_RELOAD                         ( 3 )
#define USE_USE                            ( 4 )
#define MAX_USES                           ( 3 )

// Client lighting
#define MAX_LIGHT_VALUE                    ( 10000 )
#define MAX_LIGHT_HEX                      ( 200 )
#define MAX_LIGHT_ALPHA                    ( 255 )
// Flags
#define LIGHT_DISABLE_DIR                  # (dir)               ( 1 << CLAMP( dir, 0, 5 ) )
#define LIGHT_GLOBAL                       ( 0x40 )
#define LIGHT_INVERSE                      ( 0x80 )

// Sound types
// Generic <Type Subtype SoundId SoundIdExt X X X X>
// Weapon <Type Subtype SoundId SoundIdExt X X X [Random 1 or 2]>
#define SOUND_WEAPON                       'W'
#define SOUND_WEAPON_USE                   'A'
#define SOUND_WEAPON_FLY                   'F'
#define SOUND_WEAPON_MISS                  'H'
#define SOUND_WEAPON_EMPTY                 'O'
#define SOUND_WEAPON_RELOAD                'R'
// Door <Type Subtype D O O R S SoundId>
#define SOUND_DOOR                         'S'
#define SOUND_DOOR_OPEN                    'O'
#define SOUND_DOOR_LOCK                    'L'
#define SOUND_DOOR_CLOSE                   'C'
#define SOUND_DOOR_NOT_OPEN                'N'

// /
// / Global variables
// /

// Допустимые символы для имени персонажа, указываются в config.fos
// Языковые культуры нужны для того, что бы не смешивали символы с различных языковых раскладок клавиатуры
// Алгоритмы проверки находятся в CheckPlayerName parameters.fos
#pragma globalvar string __ValidNameLettersCommon   // Общие символы
#pragma globalvar string __ValidNameLettersCulture1 // Первая языковая культура
#pragma globalvar string __ValidNameLettersCulture2 // Вторая языковая культура

// Critter
#pragma property Critter Public hash ModelName
#pragma property Critter Protected uint WalkTime
#pragma property Critter Protected uint RunTime
#pragma property Critter Protected const uint Multihex
#pragma property Critter PrivateServer const uint   MapId
#pragma property Critter PrivateServer const hash   MapPid
#pragma property Critter PrivateCommon const uint16 HexX
#pragma property Critter PrivateCommon const uint16 HexY
#pragma property Critter PrivateCommon const uint8  Dir
#pragma property Critter PrivateServer const string PassHash
#pragma property Critter PrivateCommon const CritterCondition Cond
#pragma property Critter PrivateServer const bool   ClientToDelete
#pragma property Critter Protected uint16 WorldX
#pragma property Critter Protected uint16 WorldY
#pragma property Critter Protected const uint GlobalMapLeaderId
#pragma property Critter PrivateServer const uint   GlobalMapTripId
#pragma property Critter PrivateServer const uint16 LastMapHexX
#pragma property Critter PrivateServer const uint16 LastMapHexY
#pragma property Critter PrivateCommon const uint Anim1Life
#pragma property Critter PrivateCommon const uint Anim1Knockout
#pragma property Critter PrivateCommon const uint Anim1Dead
#pragma property Critter PrivateCommon const uint Anim2Life
#pragma property Critter PrivateCommon const uint Anim2Knockout
#pragma property Critter PrivateCommon const uint Anim2Dead
#pragma property Critter PrivateCommon const uint Anim2KnockoutEnd
#pragma property Critter PrivateServer const uint8[] GlobalMapFog
#pragma property Critter PrivateServer const hash[] TE_FuncNum
#pragma property Critter PrivateServer const uint[] TE_Rate
#pragma property Critter PrivateServer const uint[] TE_NextTime
#pragma property Critter PrivateServer const int[] TE_Identifier

#pragma property Critter Protected int ActionPoints
#pragma property Critter VirtualPrivateServer int SneakCoefficient
#pragma property Critter VirtualPrivateServer int BarterCoefficient
#pragma property Critter VirtualProtected uint LookDistance

#pragma property Critter Protected        int   BagId
#pragma property Critter PrivateServer    uint  LastWeaponId
#pragma property Critter PrivateServer    uint8 LastWeaponUse
#pragma property Critter Protected        int   ReplicationTime
#pragma property Critter Public           uint  TalkDistance
#pragma property Critter Protected        int   Level
#pragma property Critter Public           int   ScaleFactor
#pragma property Critter Public           int   CurrentHp
#pragma property Critter PrivateCommon    int   CurrentAp
#pragma property Critter Protected        uint  ApRegenerationTime
#pragma property Critter PrivateCommon    uint  ApRegenerationTick
#pragma property Critter PrivateServer    uint  MaxTalkers
#pragma property Critter Public           hash  DialogId
#pragma property Critter Protected        int   KarmaVoting
#pragma property Critter Protected        uint  FreeBarterPlayer
#pragma property Critter Public           string   Lexems
#pragma property Critter PrivateServer    uint     HomeMapId
#pragma property Critter PrivateServer    uint16   HomeHexX
#pragma property Critter PrivateServer    uint16   HomeHexY
#pragma property Critter PrivateServer    uint8    HomeDir
#pragma property Critter PrivateServer    uint[]   KnownLocations
#pragma property Critter PrivateServer    uint[]   ConnectionIp
#pragma property Critter PrivateServer    uint16[] ConnectionPort
#pragma property Critter PrivateServer    uint     ShowCritterDist1
#pragma property Critter PrivateServer    uint     ShowCritterDist2
#pragma property Critter PrivateServer    uint     ShowCritterDist3
#pragma property Critter PrivateServer    hash     ScriptId
#pragma property Critter PrivateServer    uint[]   EnemyStack
#pragma property Critter PrivateServer    hash[]   InternalBagItemPid
#pragma property Critter PrivateServer    uint[]   InternalBagItemCount
#pragma property Critter PrivateServer    uint8[]  ExternalBagCurrentSet
#pragma property Critter PrivateServer    hash[]   FavoriteItemPid
#pragma property Critter Protected        uint[]   HoloInfo
#pragma property Critter Protected        hash[]   KnownLocProtoId

// Modifiable properties
#pragma property Critter ProtectedModifiable hash  HandsItemProtoId
#pragma property Critter ProtectedModifiable uint8 HandsItemMode

// 3d animation
#pragma property Critter PrivateClient int[] Anim3dLayer
// Modes
#pragma property Critter Protected bool IsHide
#pragma property Critter Public    bool IsNoSteal
#pragma property Critter Public    bool IsNoBarter
#pragma property Critter Protected bool IsNoEnemyStack
#pragma property Critter Protected bool IsNoPvp
#pragma property Critter Protected bool IsEndCombat
#pragma property Critter Protected bool IsNoHome
#pragma property Critter Protected bool IsGeck
#pragma property Critter Protected bool IsNoFavoriteItem
#pragma property Critter Protected bool IsNoItemGarbager
#pragma property Critter Protected bool IsDlgScriptBarter
#pragma property Critter Protected bool IsUnlimitedAmmo
#pragma property Critter Protected bool IsNoDrop
#pragma property Critter Protected bool IsNoLooseLimbs
#pragma property Critter Protected bool IsDeadAges
#pragma property Critter Protected bool IsNoHeal
#pragma property Critter Protected bool IsInvulnerable
#pragma property Critter Public    bool IsNoFlatten
#pragma property Critter Protected bool IsSpecialDead
#pragma property Critter Protected bool IsRangeHth
#pragma property Critter Protected bool IsNoKnock
#pragma property Critter Public    bool IsNoLoot
#pragma property Critter Protected bool IsNoSupply
#pragma property Critter Protected bool IsNoKarmaOnKill
#pragma property Critter Protected bool IsBarterOnlyCash
#pragma property Critter Protected bool IsNoPush
#pragma property Critter Protected bool IsNoUnarmed
#pragma property Critter Protected bool IsNoWalk
#pragma property Critter Protected bool IsNoRun
#pragma property Critter Protected bool IsNoRotate
#pragma property Critter Public    bool IsNoTalk
// Timeouts
#pragma property Critter Defaults Group = Timeouts
#pragma property Critter Public    uint TimeoutBattle
#pragma property Critter Protected uint TimeoutTransfer
#pragma property Critter Protected uint TimeoutRemoveFromGame
#pragma property Critter Defaults

// Item
#pragma property Item Public const ItemOwnership Accessory
#pragma property Item Public const uint   MapId
#pragma property Item Public const uint16 HexX
#pragma property Item Public const uint16 HexY
#pragma property Item Public const uint   CritId
#pragma property Item Public const uint8  CritSlot
#pragma property Item Public const uint   ContainerId
#pragma property Item Public const uint   ContainerStack

#pragma property Item Public const ItemType Type
#pragma property Item Public hash   PicMap
#pragma property Item Public hash   PicInv
#pragma property Item Public int16  OffsetX
#pragma property Item Public int16  OffsetY
#pragma property Item Public bool   Stackable
#pragma property Item Public bool   GroundLevel
#pragma property Item Public bool   Opened
#pragma property Item Public int    Corner
#pragma property Item Public uint8  Slot
#pragma property Item Public uint   Weight
#pragma property Item Public uint   Volume
#pragma property Item Public uint8  SoundId
#pragma property Item Public uint8  Material
#pragma property Item Public bool   DisableEgg
#pragma property Item Public uint16 AnimWaitBase
#pragma property Item Public uint16 AnimWaitRndMin
#pragma property Item Public uint16 AnimWaitRndMax
#pragma property Item Public uint8  AnimStay_0
#pragma property Item Public uint8  AnimStay_1
#pragma property Item Public uint8  AnimShow_0
#pragma property Item Public uint8  AnimShow_1
#pragma property Item Public uint8  AnimHide_0
#pragma property Item Public uint8  AnimHide_1
#pragma property Item Public uint8  SpriteCut
#pragma property Item Public int8   DrawOrderOffsetHexY
#pragma property Item Public uint8  IndicatorMax
#pragma property Item Public string BlockLines
#pragma property Item Public hash   ChildPid_0
#pragma property Item Public hash   ChildPid_1
#pragma property Item Public hash   ChildPid_2
#pragma property Item Public hash   ChildPid_3
#pragma property Item Public hash   ChildPid_4
#pragma property Item Public string ChildLines_0
#pragma property Item Public string ChildLines_1
#pragma property Item Public string ChildLines_2
#pragma property Item Public string ChildLines_3
#pragma property Item Public string ChildLines_4
#pragma property Item Public string ScriptModule
#pragma property Item Public string ScriptFunc

#pragma property Item Public bool IsHidden
#pragma property Item Public bool IsFlat
#pragma property Item Public bool IsNoBlock
#pragma property Item Public bool IsShootThru
#pragma property Item Public bool IsLightThru
#pragma property Item Public bool IsMultiHex
#pragma property Item Public bool IsWallTransEnd
#pragma property Item Public bool IsBigGun
#pragma property Item Public bool IsAlwaysView
#pragma property Item Public bool IsHasTimer
#pragma property Item Public bool IsBadItem
#pragma property Item Public bool IsNoHighlight
#pragma property Item Public bool IsShowAnim
#pragma property Item Public bool IsShowAnimExt
#pragma property Item Public bool IsLight
#pragma property Item Public bool IsGeck
#pragma property Item Public bool IsTrap
#pragma property Item Public bool IsNoLightInfluence
#pragma property Item Public bool IsNoLoot
#pragma property Item Public bool IsNoSteal
#pragma property Item Public bool IsGag
#pragma property Item Public bool IsColorize
#pragma property Item Public bool IsColorizeInv
#pragma property Item Public bool IsCanUseOnSmth
#pragma property Item Public bool IsCanLook
#pragma property Item Public bool IsCanTalk
#pragma property Item Public bool IsCanPickUp
#pragma property Item Public bool IsCanUse
#pragma property Item Public bool IsHolodisk
#pragma property Item Public bool IsRadio
#pragma property Item Public           string Lexems
#pragma property Item PublicModifiable int16  SortValue
#pragma property Item Protected        uint8  Indicator
#pragma property Item Public           uint8  Info
#pragma property Item PublicModifiable uint8  Mode
#pragma property Item Public           int8   LightIntensity
#pragma property Item Public           uint8  LightDistance
#pragma property Item Public           uint8  LightFlags
#pragma property Item Public           uint   LightColor
#pragma property Item PrivateServer    hash   ScriptId
#pragma property Item Public           uint   Count
#pragma property Item Protected        uint   Cost
#pragma property Item Public           int    Val0
#pragma property Item Public           int    Val1
#pragma property Item Public           int    Val2
#pragma property Item Public           int    Val3
#pragma property Item Public           int    Val4
#pragma property Item Public           int    Val5
#pragma property Item Public           int    Val6
#pragma property Item Public           int    Val7
#pragma property Item Public           int    Val8
#pragma property Item Public           int    Val9
#pragma property Item Protected        hash   AmmoPid
#pragma property Item Protected        uint   AmmoCount
#pragma property Item Protected        int16  TrapValue
#pragma property Item Protected        uint   HolodiskNum
#pragma property Item Protected        uint16 RadioChannel
#pragma property Item Protected        uint16 RadioFlags
#pragma property Item Protected        uint8  RadioBroadcastSend
#pragma property Item Protected        uint8  RadioBroadcastRecv
#pragma property Item Protected        uint16 Charge
#pragma property Item PrivateServer    bool   IsQuestItem
#pragma property Item PrivateServer    uint   LastUsedTime
#pragma property Item PrivateServer    bool   CarIsBioEngine
#pragma property Item PrivateServer    bool   CarIsNoLockpick
#pragma property Item PrivateServer    int    TriggerNum

#pragma property Item Public uint Container_Volume
#pragma property Item Public bool Container_Changeble
#pragma property Item Public bool Container_CannotPickUp
#pragma property Item Public bool Container_MagicHandsGrnd
#pragma property Item Public int Grid_Type
#pragma property Item PrivateServer hash Grid_ToMap
#pragma property Item PrivateServer int Grid_ToMapEntire
#pragma property Item PrivateServer uint8 Grid_ToMapDir
#pragma property Item PrivateServer int[] SceneryParams

// Map
#pragma property Map PrivateServer uint LoopTime1
#pragma property Map PrivateServer uint LoopTime2
#pragma property Map PrivateServer uint LoopTime3
#pragma property Map PrivateServer uint LoopTime4
#pragma property Map PrivateServer uint LoopTime5
#pragma property Map PrivateServer const uint16 Width
#pragma property Map PrivateServer const uint16 Height
#pragma property Map PrivateServer const uint16 WorkHexX
#pragma property Map PrivateServer const uint16 WorkHexY
#pragma property Map PrivateServer const uint LocId
#pragma property Map PrivateServer const uint LocMapIndex
#pragma property Map PrivateServer uint8 RainCapacity
#pragma property Map PrivateServer int CurDayTime
#pragma property Map PrivateServer hash ScriptId
#pragma property Map PrivateServer int[] DayTime
#pragma property Map PrivateServer uint8[] DayColor
#pragma property Map PrivateServer bool IsNoLogOut

// Location
#pragma property Location PrivateServer const hash[] MapProtos
#pragma property Location PrivateServer const hash[] MapEntrances
#pragma property Location PrivateServer const hash[] Automaps
#pragma property Location PrivateServer uint MaxPlayers
#pragma property Location PrivateServer bool AutoGarbage
#pragma property Location PrivateServer bool GeckVisible
#pragma property Location PrivateServer hash EntranceScript
#pragma property Location PrivateServer uint16 WorldX
#pragma property Location PrivateServer uint16 WorldY
#pragma property Location PrivateServer uint16 Radius
#pragma property Location PrivateServer bool Hidden
#pragma property Location PrivateServer bool ToGarbage
#pragma property Location PrivateServer uint Color
#pragma property Location PrivateServer bool IsEncounter

Commits for fonline_sdk/Modules/Core/Core.fosh

Diff revisions: vs.
Revision Author Commited Message
644 Diff Diff cvet picture cvet Fri 24 Jun, 2016 10:15:42 +0000

PerkMasterTrader PerkSilentRunning perks was removed from engine.

643 Diff Diff cvet picture cvet Fri 24 Jun, 2016 07:43:46 +0000

Hardcoded turn based stuff was excluded from engine.
Some fixes for drop menu.

642 Diff Diff cvet picture cvet Wed 22 Jun, 2016 16:15:20 +0000

Continued exclusion from engine hardcoded stuff.

640 Diff Diff cvet picture cvet Wed 15 Jun, 2016 15:19:35 +0000

Event fix.

639 Diff Diff cvet picture cvet Wed 15 Jun, 2016 14:58:46 +0000

Engine fixes.

636 Diff Diff cvet picture cvet Fri 10 Jun, 2016 14:27:32 +0000

Вынесены в скрипты работа с открытием дверей и контейнеров. Пока не совсем полностью.

635 Diff Diff cvet picture cvet Thu 09 Jun, 2016 15:02:21 +0000

EventGetStartTime и EventGenerateWorld объединены в одно.

634 Diff Diff cvet picture cvet Thu 09 Jun, 2016 14:13:07 +0000

Loop события вызываются каждый игровой цикл.

633 Diff Diff cvet picture cvet Thu 09 Jun, 2016 13:51:21 +0000

Левелинг вынесен из движка.

631 cvet picture cvet Wed 08 Jun, 2016 13:02:47 +0000

Правка загрузки анимаций фаллаута.
Убраны константы предопределенных путей.