-
Notifications
You must be signed in to change notification settings - Fork 36
/
function.c
797 lines (667 loc) · 25.6 KB
/
function.c
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
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
#include "version.h"
#include <string.h>
#include "common.h"
#include "util.h"
#include "char_event.h"
#include "char.h"
#include "item_event.h"
#include "magic.h"
#include "pet_event.h"
#include "npc_townpeople.h"
#include "npc_Dengon.h"
#include "npc_door.h"
#include "npc_healer.h"
#include "npc_oldman.h"
#include "npc_warp.h"
#include "npc_storyteller.h"
#include "npc_msg.h"
#include "npc_npcenemy.h"
#include "npc_action.h"
#include "npc_windowman.h"
#include "npc_savepoint.h"
#include "npc_windowhealer.h"
#include "npc_itemshop.h"
#include "npc_sysinfo.h"
#include "npc_duelranking.h"
#include "npc_petskillshop.h"
#include "npc_petshop.h"
#include "npc_signboard.h"
#include "npc_warpman.h"
#include "npc_exchangeman.h"
#include "petmail.h"
#include "npc_timeman.h"
#include "npc_bodylan.h"
#include "npc_mic.h"
#include "npc_luckyman.h"
#include "npc_bus.h"
#include "npc_charm.h"
#include "npc_poolitemshop.h"
#include "npc_quiz.h"
#include "npc_checkman.h"
#include "npc_janken.h"
#include "npc_transmigration.h"
#include "battle_event.h"
#include "enemy.h"
// Robin 0517
#include "npc_familyman.h"
#include "npc_bankman.h"
// add code by shan
#include "npc_fmdengon.h"
#include "npc_fmhealer.h"
#include "npc_petmaker.h"
// CoolFish: Family 2001/6/4
#include "npc_fmwarpman.h"
#include "npc_fmpkman.h"
#include "npc_fmpkcallman.h"
// Arminius 7.7 Airplane
#include "npc_airplane.h"
// Arminius 7.13 Scheduleman
#include "npc_scheduleman.h"
// Arminius 7.24 manor scheduleman
#include "npc_manorsman.h"
// Robin 0725
#include "npc_riderman.h"
#include "npc_fmletter.h"
#ifdef _SERVICE
// Terry 2001/09/01
#include "npc_stoneserviceman.h"
#endif
#ifdef _NPC_SELLSTH
#include "npc_sellsthman.h"
#endif
//andy
#ifdef _GAMBLE_BANK
#include "npc_gamblebank.h"
#endif
#ifdef _NEW_WARPMAN
#include "npc_newnpcman.h"
#endif
#ifdef _MARKET_TRADE
#include "npc_mtradenpcman.h"
#endif
#ifdef _GAMBLE_ROULETTE
#include "npc_gambleroulette.h"
#include "npc_gamblemaster.h"
#endif
#ifdef _TRANSER_MAN
#include "npc_transerman.h"
#endif
#ifdef _JZ_NEW_ADDMEMBERPOINT
#include "npc_memberman.h"
#endif
#ifdef _PAUCTION_MAN
#include "npc_pauctionman.h"
#endif
#ifdef _CFREE_petskill
#include "npc_freepetskillshop.h"
#endif
#ifdef _PETRACE
#include "npc_petracemaster.h"
#include "npc_petracepet.h"
#endif
#ifdef _AUCTIONEER
#include "npc_auctioneer.h"
#endif
#ifdef _BLACK_MARKET
#include "npc_blackmarket.h"
#endif
#ifdef _ITEM_NPCCHANGE
#include "npc_itemchange.h"
#endif
#ifdef _NPC_MAKEPAIR
#include "npc_makepair.h"
#endif
#ifdef _NPC_FUSION
#include "npc_petfusion.h"
#endif
#ifdef _ALLDOMAN // (不可开) Syu ADD 排行榜NPC
#include "npc_alldoman.h"
#endif
#ifdef _NPC_WELFARE
#include "npc_welfare.h"
#endif
#ifdef _NPC_WELFARE_2 // WON ADD 职业NPC-2
#include "npc_welfare2.h"
#endif
#ifdef _NPC_VERYWELFARE
#include "npc_verywelfare.h"
#endif
#ifdef _RACEMAN
#include "npc_raceman.h"
#endif
#define DEBUG
typedef struct tagCorrespondStringAndFunctionTable
{
STRING32 functionName;
void* functionPointer;
int hashcode;
}CorrespondStringAndFunctionTable;
static CorrespondStringAndFunctionTable
correspondStringAndFunctionTable[]=
{
/* 动票反扔□田□ 戊□玉匹烂聒今木化中月楮醒分[NPC手仇木
毛勾井丹午五互丐月*/
{ {"core_PreWalk"}, CHAR_allprewalk, 0 },
{ {"core_PostWalk"}, CHAR_allpostwalk, 0 },
{ {"core_Loop"}, CHAR_loopFunc, 0 },
{ {"core_Dying"}, CHAR_die, 0 },
{ {"core_PlayerWatch"}, CHAR_playerWatchfunc, 0 },
{ {"core_PlayerTalked"}, CHAR_playerTalkedfunc, 0 },
/* 动票反失奶 丞毛银丹午五迕及楮醒分[ */
{ {"MedicineInit"}, ITEM_MedicineInit, 0 },
{ {"MedicineUsed"}, ITEM_MedicineUsed, 0 },
{ {"SandClockDetach"}, ITEM_SandClockDetach, 0 },
{ {"addTitleAttach"}, ITEM_addTitleAttach, 0 },
{ {"delTitleDetach"}, ITEM_delTitleDetach, 0 },
{ {"ITEM_DeleteByWatched"}, ITEM_DeleteByWatched, 0 },
{ {"ITEM_DeleteTimeWatched"}, ITEM_DeleteTimeWatched, 0 },
{ {"ITEM_useEffectTohelos"}, ITEM_useEffectTohelos, 0 },
// { {"ITEM_useHpRecovery"}, ITEM_useHpRecovery, 0 },
{ {"ITEM_useRecovery"}, ITEM_useRecovery, 0 },
#ifdef _ITEM_MAGICRECOVERY
{ {"ITEM_useMRecovery"}, ITEM_useMRecovery, 0 },
#endif
#ifdef _ITEM_USEMAGIC
{ {"ITEM_useMagic"}, ITEM_useMagic, 0 },
#endif
{ {"ITEM_useStatusChange"}, ITEM_useStatusChange, 0 },
{ {"ITEM_useStatusRecovery"}, ITEM_useStatusRecovery, 0 },
{ {"ITEM_useMagicDef"}, ITEM_useMagicDef, 0 },
{ {"ITEM_useParamChange"}, ITEM_useParamChange, 0 },
{ {"ITEM_useFieldChange"}, ITEM_useFieldChange, 0 },
{ {"ITEM_useAttReverse"}, ITEM_useAttReverse, 0 },
{ {"ITEM_useRessurect"}, ITEM_useRessurect, 0 },
{ {"ITEM_useMic"}, ITEM_useMic, 0 },
{ {"ITEM_dropMic"}, ITEM_dropMic, 0 },
{ {"ITEM_useCaptureUp"}, ITEM_useCaptureUp, 0 },
{ {"ITEM_useRenameItem"}, ITEM_useRenameItem, 0 },
{ {"ITEM_pickupDice"}, ITEM_pickupDice, 0 },
{ {"ITEM_dropDice"}, ITEM_dropDice, 0 },
{ {"ITEM_initLottery"}, ITEM_initLottery, 0 },
{ {"ITEM_useLottery"}, ITEM_useLottery, 0 },
{ {"ITEM_useWarp"}, ITEM_useWarp, 0 },
{ {"ITEM_petFollow"}, ITEM_petFollow, 0 },
{ {"ITEM_useSkup"}, ITEM_useSkup, 0 }, // Nuke 0624: Hero's bless
{ {"ITEM_useNoenemy"}, ITEM_useNoenemy, 0 }, // Nuke 0626: Dragon's help
{ {"ITEM_equipNoenemy"},ITEM_equipNoenemy, 0 }, // Arminius 7.2 Ra's amulet
{ {"ITEM_remNoenemy"}, ITEM_remNoenemy, 0 }, // Arminius 7.2 Ra's amulet
{ {"ITEM_useEncounter"}, ITEM_useEncounter, 0}, // Arminius 7.31 cursed stone
{ {"ITEM_AddPRSkillPoint"}, ITEM_AddPRSkillPoint, 0},
{ {"ITEM_AddPRSkillPercent"}, ITEM_AddPRSkillPercent, 0},
#ifdef _ITEM_METAMO
{ {"ITEM_metamo"}, ITEM_metamo, 0 },
#endif
#ifdef _USEWARP_FORNUM
{ {"ITEM_useWarpForNum"}, ITEM_useWarpForNum, 0 },
#endif
#ifdef _IMPRECATE_ITEM
{ {"ITEM_useImprecate"}, ITEM_useImprecate, 0 },
#endif
#ifdef _ITEM_FIRECRACKER //Terry add 2001/12/21
{ {"ITEM_firecracker"}, ITEM_firecracker, 0 },
#endif
#ifdef _ITEM_CRACKER //vincent 拉炮
{ {"ITEM_Cracker"}, ITEM_Cracker, 0 },
#endif
#ifdef _ITEM_ADDEXP //vincent 经验提升
{ {"ITEM_Addexp"}, ITEM_Addexp, 0 },
#endif
#ifdef _ITEM_REFRESH //vincent 解除异常状态道具
{ {"ITEM_Refresh"}, ITEM_Refresh, 0 },
#endif
#ifdef _JZ_NEW_ITEM1
{ {"ITEM_AddFame"}, ITEM_AddFame, 0 },
#ifdef _JZ_NEW_ADDMEMBERPOINT
{ {"ITEM_AddMemberPoint"}, ITEM_AddMemberPoint, 0 },
#endif
#endif
{ {"ITEM_WearEquip"}, ITEM_WearEquip, 0 },
{ {"ITEM_ReWearEquip"}, ITEM_ReWearEquip, 0 },
#ifdef _ITEM_CONSTITUTION
{ {"ITEM_Constitution"}, ITEM_Constitution, 0 },
#endif
#ifdef _Item_ReLifeAct
{ {"ITEM_DIErelife"}, ITEM_DIErelife, 0 },
#endif
#ifdef _ITEM_ORNAMENTS
{ {"ITEM_PutOrnaments"}, ITEM_PutOrnaments, 0},
#endif
#ifdef _CHIKULA_STONE
{ {"ITEM_ChikulaStone"}, ITEM_ChikulaStone, 0},
#endif
#ifdef _THROWITEM_ITEMS
{ {"ITEM_ThrowItemBox"}, ITEM_ThrowItemBox, 0},
#endif
#ifdef _ITEM_WATERWORDSTATUS
{ {"ITEM_WaterWordStatus"}, ITEM_WaterWordStatus, 0},
#endif
#ifdef _ITEM_LOVERPARTY
{ {"ITEM_LoverSelectUser"}, ITEM_LoverSelectUser, 0},
#endif
#ifdef _Item_MoonAct
{ {"ITEM_randEnemyEquipOne"}, ITEM_randEnemyEquipOne, 0 },
{ {"ITEM_randEnemyEquip"}, ITEM_randEnemyEquip, 0 },
{ {"ITEM_RerandEnemyEquip"}, ITEM_RerandEnemyEquip, 0},
#endif
#ifdef _SUIT_ITEM
{ {"ITEM_suitEquip"}, ITEM_suitEquip, 0 },
{ {"ITEM_ResuitEquip"}, ITEM_ResuitEquip, 0 },
#endif
#ifdef _Item_DeathAct
{ {"ITEM_useDeathcounter"}, ITEM_UseDeathCounter, 0 },
#endif
#ifdef _DEATH_CONTENDWATCH
{ {"ITEM_useWatchBattle"}, ITEM_useWatchBattle, 0 },
#endif
#ifdef _FEV_ADD_NEW_ITEM // FEV ADD 增加复活守精
{ {"ITEM_ResAndDef"} , ITEM_ResAndDef, 0 },
#endif
#ifdef _CHRISTMAS_REDSOCKS
{ {"ITEM_useMaxRedSocks"}, ITEM_useMaxRedSocks, 0 },
#endif
#ifdef _CHRISTMAS_REDSOCKS_NEW
{ {"ITEM_useMaxRedSocksNew"}, ITEM_useMaxRedSocksNew, 0 },
#endif
#ifdef _PETSKILL_CANNEDFOOD
{ {"ITEM_useSkillCanned"}, ITEM_useSkillCanned, 0},
#endif
#ifdef _NEW_RIDEPETS
{ {"ITEM_useLearnRideCode"}, ITEM_useLearnRideCode, 0 },
#endif
#ifdef _EQUIT_DEFMAGIC
{ {"ITEM_MagicEquitWear"}, ITEM_MagicEquitWear, 0 },
{ {"ITEM_MagicEquitReWear"}, ITEM_MagicEquitReWear, 0 },
#endif
#ifdef _EQUIT_RESIST
{ {"ITEM_MagicResist"}, ITEM_MagicResist, 0 },
{ {"ITEM_MagicReResist"}, ITEM_MagicReResist, 0 },
#endif
#ifdef _MAGIC_RESIST_EQUIT // WON ADD 职业抗性装备
{ {"ITEM_P_MagicEquitWear"}, ITEM_P_MagicEquitWear, 0 },
{ {"ITEM_P_MagicEquitReWear"}, ITEM_P_MagicEquitReWear, 0 },
#endif
#ifdef _ANGEL_SUMMON
{ {"ITEM_AngelToken"}, ITEM_AngelToken, 0 },
{ {"ITEM_HeroToken"}, ITEM_HeroToken, 0 },
#endif
#ifdef _HALLOWEEN_EFFECT
{ {"ITEM_MapEffect"}, ITEM_MapEffect, 0 },
#endif
{ {"ITEM_changePetOwner"}, ITEM_changePetOwner, 0 },
{ {"core_PetWatch"}, PET_Watchfunc, 0 },
{ {"PETMAIL_Loop"}, PETMAIL_Loopfunc, 0 },
#ifdef _USER_CHARLOOPS
{ {"CHAR_BattleStayLoop"}, CHAR_BattleStayLoop, 0 },
{ {"PET_CheckIncubateLoop"}, PET_CheckIncubate, 0 },
#endif
#ifdef _PETSKILL_PROPERTY
{ {"PET_PetskillPropertyEvent"}, PET_PetskillPropertyEvent, 0 },
#endif
{ {"core_PetTalk"}, PET_Talkfunc, 0}, // Arminius 8.14 pet talk
/* warp */
{ {"WarpInit"}, NPC_WarpInit, 0 },
{ {"WarpPostOver"}, NPC_WarpPostOver, 0 },
{ {"WarpWatch"}, NPC_WarpWatch, 0 },
/* Dengon */
{ {"DengonInit"}, NPC_DengonInit, 0 },
{ {"DengonWindowTalked"}, NPC_DengonWindowTalked, 0 },
{ {"DengonLooked"}, NPC_DengonLooked, 0 },
/* FmDengon add code by shan */
{ {"FmDengonInit"}, NPC_FmDengonInit, 0 },
{ {"FmDengonWindowTalked"}, NPC_FmDengonWindowTalked, 0 },
{ {"FmDengonLooked"}, NPC_FmDengonLooked, 0 },
/* Healer */
{ {"HealerInit"} , NPC_HealerInit, 0 },
{ {"HealerTalked"} , NPC_HealerTalked , 0 },
/* FMHealer add code by shan */
{ {"FmHealerInit"} , NPC_FmHealerInit, 0 },
{ {"FmHealerTalked"} , NPC_FmHealerTalked , 0 },
/* petmaker add code by shan */
{ {"PetMakerInit"} , NPC_PetMakerInit, 0 },
{ {"PetMakerTalked"} , NPC_PetMakerTalked , 0 },
/* TownPeople */
{ {"TownPeopleTalked"}, NPC_TownPeopleTalked, 0 },
{ {"TownPeopleInit"}, NPC_TownPeopleInit, 0 },
/* TownPeople */
{ {"MsgLooked"}, NPC_MsgLooked , 0 },
{ {"MsgInit"}, NPC_MsgInit, 0 },
/* Oldman */
{ {"OldmanInit"} , NPC_OldmanInit , 0 },
{ {"OldmanTalked"} , NPC_OldmanTalked , 0 },
/* SavePOint */
{ {"SavePointInit"} , NPC_SavePointInit , 0 },
{ {"SavePointTalked"} , NPC_SavePointTalked , 0 },
{ {"SavePointWindowTalked"}, NPC_SavePointWindowTalked, 0 },
/* StoryTeller */
{ {"StoryTellerInit"} , NPC_StoryTellerInit , 0 },
{ {"StoryTellerTalked"} , NPC_StoryTellerTalked , 0 },
/* NPCEnemy */
{ {"NPCEnemyInit"} , NPC_NPCEnemyInit , 0 },
{ {"NPCEnemyTalked"} , NPC_NPCEnemyTalked , 0 },
{ {"NPCEnemyWatch"} , NPC_NPCEnemyWatch , 0 },
{ {"NPCEnemyLoop"}, NPC_NPCEnemyLoop, 0 },
{ {"NPCEnemyWindowTalked"}, NPC_NPCEnemyWindowTalked, 0 },
/* 失弁扑亦件楝 */
{ {"ActionInit"} , NPC_ActionInit , 0 },
{ {"ActionTalked"} , NPC_ActionTalked , 0 },
{ {"ActionWatch"} , NPC_ActionWatch , 0 },
/* 它奴件玉它楝 */
{ {"WindowmanInit"} , NPC_WindowmanInit , 0 },
{ {"WindowmanTalked"} , NPC_WindowmanTalked , 0 },
{ {"WindowmanLooked"}, NPC_WindowmanLooked, 0 },
{ {"WindowmanWindowTalked"}, NPC_WindowmanWindowTalked, 0 },
/* 它奴件玉它甲□仿□ */
{ {"WindowHealerInit"} , NPC_WindowHealerInit , 0 },
{ {"WindowHealerTalked"} , NPC_WindowHealerTalked, 0 },
{ {"WindowHealerLooked"} , NPC_WindowHealerLooked, 0 },
{ {"WindowHealerWindowTalked"}, NPC_WindowHealerWindowTalked, 0 },
/* 失奶 丞盒 */
{ {"ItemShopInit"} , NPC_ItemShopInit , 0 },
{ {"ItemShopTalked"} , NPC_ItemShopTalked , 0 },
{ {"ItemShopWindowTalked"}, NPC_ItemShopWindowTalked, 0 },
/* Sysinfo */
{ {"SysinfoInit"}, NPC_SysinfoInit, 0 },
{ {"SysinfoLoop"}, NPC_SysinfoLoop, 0 },
{ {"SysinfoTalked"} , NPC_SysinfoTalked , 0 },
/* Duel仿件平件弘 憎NPC */
{ {"DuelrankingInit"} , NPC_DuelrankingInit , 0 },
{ {"DuelrankingLooked"}, NPC_DuelrankingLooked, 0 },
{ {"DuelrankingWindowTalked"}, NPC_DuelrankingWindowTalked, 0 },
#ifdef _DEATH_CONTEND
{ {"Duelrankingloop"}, NPC_Duelrankingloop, 0 },
#endif
/* 它奴件玉它矢永玄及 盒 */
{ {"PetSkillShopInit"} , NPC_PetSkillShopInit , 0 },
{ {"PetSkillShopTalked"} , NPC_PetSkillShopTalked, 0 },
{ {"PetSkillShopLooked"} , NPC_PetSkillShopLooked, 0 },
{ {"PetSkillShopWindowTalked"}, NPC_PetSkillShopWindowTalked, 0 },
/* 它奴件玉它矢永玄 中潸曰盒 */
{ {"PetShopInit"} , NPC_PetShopInit, 0 },
{ {"PetShopTalked"} , NPC_PetShopTalked, 0 },
{ {"PetShopLooked"} , NPC_PetShopLooked, 0 },
{ {"PetShopWindowTalked"}, NPC_PetShopWindowTalked,0 },
/* 枣 */
{ {"SignBoardInit"} , NPC_SignBoardInit, 0 },
{ {"SignBoardLooked"} , NPC_SignBoardLooked, 0 },
{ {"SignBoardWindowTalked"}, NPC_SignBoardWindowTalked, 0 },
/*伐□皿穴件 */
{ {"WarpManInit"}, NPC_WarpManInit, 0 },
{ {"WarpManTalked"}, NPC_WarpManTalked, 0 },
{ {"WarpManWatch"}, NPC_WarpManWatch, 0 },
{ {"WarpManLoop"} , NPC_WarpManLoop, 0 },
{ {"WarpManWindowTalked"}, NPC_WarpManWindowTalked,0 },
/*奶矛件玄楝 exchangeman) */
{ {"ExChangeManInit"}, NPC_ExChangeManInit, 0 },
{ {"ExChangeManTalked"}, NPC_ExChangeManTalked, 0 },
{ {"ExChangeManWindowTalked"}, NPC_ExChangeManWindowTalked,0 },
/*正奶丞穴件 */
{ {"TimeManInit"}, NPC_TimeManInit, 0 },
{ {"TimeManTalked"}, NPC_TimeManTalked, 0 },
{ {"TimeManWatch"} , NPC_TimeManWatch , 0 },
/* 示犯奴仿件必□斥 */
{ {"BodyLanInit"}, NPC_BodyLanInit, 0 },
{ {"BodyLanTalked"}, NPC_BodyLanTalked, 0 },
{ {"BodyLanWatch"} , NPC_BodyLanWatch , 0 },
{ {"BodyLanWindowTalked"} , NPC_BodyLanWindowTalked,0 },
/* 穴奶弁 */
{ {"MicInit"}, NPC_MicInit, 0 },
{ {"MicTalked"}, NPC_MicTalked, 0 },
/* 仿永平□穴件 */
{ {"LuckyManInit"} , NPC_LuckyManInit , 0 },
{ {"LuckyManTalked"} , NPC_LuckyManTalked, 0 },
{ {"LuckyManWindowTalked"}, NPC_LuckyManWindowTalked, 0 },
/* 楝 */
{ {"BusInit"} , NPC_BusInit , 0 },
{ {"BusTalked"} , NPC_BusTalked , 0 },
{ {"BusLoop"} , NPC_BusLoop , 0 },
/* 加美航空 */ // Arminius 7.7 Airplane
{ {"AirInit"} , NPC_AirInit , 0 },
{ {"AirTalked"} , NPC_AirTalked , 0 },
{ {"AirLoop"} , NPC_AirLoop , 0 },
/* 楝 */
{ {"CharmInit"} , NPC_CharmInit , 0 },
{ {"CharmTalked"} , NPC_CharmTalked, 0 },
{ {"CharmWindowTalked"}, NPC_CharmWindowTalked, 0 },
{ {"PoolItemShopInit"} , NPC_PoolItemShopInit , 0 },
{ {"PoolItemShopLoop"} , NPC_PoolItemShopLoop , 0 },
{ {"PoolItemShopTalked"} , NPC_PoolItemShopTalked , 0 },
{ {"PoolItemShopWindowTalked"}, NPC_PoolItemShopWindowTalked, 0 },
{ {"QuizInit"} , NPC_QuizInit , 0 },
{ {"QuizTalked"} , NPC_QuizTalked, 0 },
{ {"QuizWindowTalked"}, NPC_QuizWindowTalked, 0 },
/* 切之匀仁引氏 */
{ {"CheckManInit"} , NPC_CheckManInit , 0 },
{ {"CheckManTalked"} , NPC_CheckManTalked, 0 },
{ {"CheckManWindowTalked"}, NPC_CheckManWindowTalked, 0 },
/* 元扎氏仃氏楝 */
{ {"JankenInit"} , NPC_JankenInit , 0 },
{ {"JankenTalked"} , NPC_JankenTalked, 0 },
{ {"JankenWindowTalked"}, NPC_JankenWindowTalked, 0 },
/* 鳖戏谛 */
{ {"TransmigrationInit"} , NPC_TransmigrationInit , 0 },
{ {"TransmigrationTalked"} , NPC_TransmigrationTalked, 0 },
{ {"TransmigrationWindowTalked"}, NPC_TransmigrationWindowTalked, 0 },
/* Family man */
{ {"FamilymanInit"} , NPC_FamilymanInit , 0 },
{ {"FamilymanTalked"} , NPC_FamilymanTalked, 0 },
{ {"FamilymanLooked"}, NPC_FamilymanLooked,0 },
{ {"FamilymanWindowTalked"}, NPC_FamilymanWindowTalked, 0 },
/* CoolFish: Family WarpMan 2001/6/6 */
{ {"FMWarpManInit"}, NPC_FMWarpManInit, 0 },
{ {"FMWarpManTalked"}, NPC_FMWarpManTalked, 0 },
{ {"FMWarpManLoop"} , NPC_FMWarpManLoop, 0 },
{ {"FMWarpManWindowTalked"}, NPC_FMWarpManWindowTalked, 0 },
/* CoolFish: Family PKMan 2001/7/4 */
{ {"FMPKManInit"}, NPC_FMPKManInit, 0 },
{ {"FMPKManTalked"}, NPC_FMPKManTalked, 0 },
{ {"FMPKManWindowTalked"}, NPC_FMPKManWindowTalked, 0 },
/* CoolFish: Family PKCallMan 2001/7/13 */
{ {"FMPKCallManInit"}, NPC_FMPKCallManInit, 0 },
{ {"FMPKCallManTalked"}, NPC_FMPKCallManTalked, 0 },
{ {"FMPKCallManWindowTalked"}, NPC_FMPKCallManWindowTalked, 0 },
/* Bank man */
{ {"BankmanInit"} , NPC_BankmanInit , 0 },
{ {"BankmanTalked"} , NPC_BankmanTalked, 0 },
{ {"BankmanLooked"}, NPC_BankmanLooked,0 },
{ {"BankmanWindowTalked"}, NPC_BankmanWindowTalked, 0 },
/* Arminius 7.13 scheduleman */
{ {"SchedulemanInit"}, NPC_SchedulemanInit, 0},
{ {"SchedulemanTalked"}, NPC_SchedulemanTalked, 0},
{ {"SchedulemanWindowTalked"}, NPC_SchedulemanWindowTalked, 0},
{ {"SchedulemanLoop"}, NPC_SchedulemanLoop, 0},
/* Arminius 7.24 manor scheduleman */
{ {"ManorSmanInit"}, NPC_ManorSmanInit, 0},
{ {"ManorSmanTalked"}, NPC_ManorSmanTalked, 0},
{ {"ManorSmanWindowTalked"}, NPC_ManorSmanWindowTalked, 0},
{ {"ManorSmanLoop"}, NPC_ManorSmanLoop, 0},
/* Rider man */
{ {"RidermanInit"} , NPC_RidermanInit , 0 },
{ {"RidermanTalked"} , NPC_RidermanTalked, 0 },
{ {"RidermanLooked"}, NPC_RidermanLooked,0 },
{ {"RidermanWindowTalked"}, NPC_RidermanWindowTalked, 0 },
/* FmLetter man */
{ {"FmLetterInit"} , NPC_FmLetterInit , 0 },
{ {"FmLetterTalked"} , NPC_FmLetterTalked, 0 },
{ {"FmLetterLooked"}, NPC_FmLetterLooked,0 },
{ {"FmLetterWindowTalked"}, NPC_FmLetterWindowTalked, 0 },
#ifdef _SERVICE
// Terry 2001/08/31
// 石器服务员 StoneServiceMan
{ {"StoneServiceManInit"}, NPC_StoneServiceManInit,0},
{ {"StoneServiceManLoop"}, NPC_StoneServiceManLoop,0},
{ {"StoneServiceManTalked"}, NPC_StoneServiceManTalked,0},
{ {"StoneServiceManWindowTalked"}, NPC_StoneServiceManWindowTalked,0},
#endif
#ifdef _GAMBLE_BANK //银行
{ {"GambleBankInit"}, NPC_GambleBankInit, 0},
{ {"GambleBankLoop"}, NPC_GambleBankLoop,0},
{ {"GambleBankTalked"}, NPC_GambleBankTalked,0},
{ {"GambleBankWindowTalked"}, NPC_GambleBankWindowTalked,0},
#endif
#ifdef _PET_LIMITLEVEL
{ {"ITEM_useOtherEditBase"}, ITEM_useOtherEditBase, 0},
#endif
#ifdef _ITEM_EDITBASES
{ {"ITEM_useFusionEditBase"}, ITEM_useFusionEditBase, 0},
#endif
#ifdef _GAMBLE_ROULETTE //赌场轮盘
{ {"GambleRouletteInit"}, NPC_Gamble_RouletteInit, 0},
{ {"GambleRouletteLoop"}, NPC_Gamble_RouletteLoop, 0},
{ {"GambleRouletteTalked"}, NPC_Gamble_RouletteTalked, 0},
{ {"GambleRouletteWindowTalked"}, NPC_Gamble_RouletteWindowTalked, 0},
{ {"GambleMasterInit"}, NPC_Gamble_MasterInit, 0},
{ {"GambleMasterLoop"}, NPC_Gamble_MasterLoop, 0},
{ {"GambleMasterTalked"}, NPC_Gamble_MasterTalked, 0},
{ {"GambleMasterWindowTalked"}, NPC_Gamble_MasterWindowTalked, 0},
#endif
#ifdef _TRANSER_MAN
{ {"TranserManInit"}, NPC_TranserManInit, 0 },
{ {"TranserManTalked"}, NPC_TranserManTalked, 0 },
{ {"TranserManLoop"} , NPC_TranserManLoop, 0 },
{ {"TranserManWindowTalked"}, NPC_TranserManWindowTalked, 0 },
#endif
#ifdef _JZ_NEW_ADDMEMBERPOINT
{ {"MemberManInit"}, NPC_MemberManInit, 0 },
{ {"MemberManTalked"}, NPC_MemberManTalked, 0 },
{ {"MemberManWindowTalked"}, NPC_MemberManWindowTalked, 0 },
#endif
#ifdef _NPC_SELLSTH
{ {"SellsthManInit"}, NPC_SellsthManInit, 0 },
{ {"SellsthManTalked"}, NPC_SellsthManTalked, 0 },
{ {"SellsthManLoop"} , NPC_SellsthManLoop, 0 },
{ {"SellsthManWindowTalked"}, NPC_SellsthManWindowTalked, 0 },
#endif
#ifdef _NPC_MAKEPAIR
{ {"MakePairManInit"}, NPC_MakePairManInit, 0 },
{ {"MakePairManTalked"}, NPC_MakePairManTalked, 0 },
{ {"MakePairManLoop"} , NPC_MakePairManLoop, 0 },
{ {"MakePairManWindowTalked"}, NPC_MakePairManWindowTalked,0 },
#endif
#ifdef _NPC_FUSION
{ {"PetFusionManInit"}, NPC_PetFusionManInit, 0 },
{ {"PetFusionManTalked"}, NPC_PetFusionManTalked, 0 },
{ {"PetFusionManLoop"} , NPC_PetFusionManLoop, 0 },
{ {"PetFusionManWindowTalked"}, NPC_PetFusionManWindowTalked,0 },
#endif
#ifdef _PAUCTION_MAN
{ {"PauctionManInit"}, NPC_PauctionManInit, 0 },
{ {"PauctionManTalked"}, NPC_PauctionManTalked, 0 },
{ {"PauctionManLoop"} , NPC_PauctionManLoop, 0 },
{ {"PauctionManWindowTalked"}, NPC_PauctionManWindowTalked, 0 },
#endif
#ifdef _ITEM_NPCCHANGE
{ {"ItemchangeManInit"}, NPC_ItemchangeManInit, 0 },
{ {"ItemchangeManTalked"}, NPC_ItemchangeManTalked, 0 },
{ {"ItemchangeManLoop"} , NPC_ItemchangeManLoop, 0 },
{ {"ItemchangeManWindowTalked"}, NPC_ItemchangeManWindowTalked, 0 },
#endif
#ifdef _CFREE_petskill
{ {"FreePetSkillInit"} , NPC_FreePetSkillShopInit, 0 },
{ {"FreePetSkillTalked"} , NPC_FreePetSkillShopTalked, 0 },
{ {"FreePetSkillWindowTalked"}, NPC_FreePetSkillShopWindowTalked, 0 },
#endif
#ifdef _PETRACE // 宠物竞速
{ {"PetRaceMasterInit"}, NPC_PetRaceMasterInit, 0},
{ {"PetRaceMasterLoop"}, NPC_PetRaceMasterLoop, 0},
{ {"PetRaceMasterTalked"}, NPC_PetRaceMasterTalked, 0},
{ {"PetRaceMasterWindowTalked"}, NPC_PetRaceMasterWindowTalked, 0},
{ {"PetRacePetInit"}, NPC_PetRacePetInit, 0},
{ {"PetRacePetLoop"}, NPC_PetRacePetLoop, 0},
{ {"PetRacePetTalked"}, NPC_PetRacePetTalked, 0},
#endif
#ifdef _NEW_WARPMAN
{ {"NewNpcManInit"}, NPC_NewNpcManInit, 0},
{ {"NewNpcManLoop"}, NPC_NewNpcManLoop, 0},
{ {"NewNpcManTalked"}, NPC_NewNpcManTalked, 0},
{ {"NewNpcManWindowTalked"}, NPC_NewNpcManWindowTalked, 0},
#endif
#ifdef _MARKET_TRADE
{ {"MapTradeManInit"}, MapTradeManInit, 0},
{ {"MapTradeManLoop"}, MapTradeManLoop, 0},
{ {"MapTradeManTalked"}, MapTradeManTalked, 0},
{ {"MapTradeManWindowTalked"}, MapTradeManWindowTalked, 0},
#endif
#ifdef _AUCTIONEER
{ {"AuctioneerInit"}, NPC_AuctioneerInit, 0},
{ {"AuctioneerTalked"}, NPC_AuctioneerTalked, 0},
{ {"AuctioneerWindowTalked"}, NPC_AuctioneerWindowTalked, 0},
{ {"AuctioneerLoop"}, NPC_AuctioneerLoop, 0},
#endif
#ifdef _BLACK_MARKET
{ {"BlackMarketInit"}, NPC_BlackMarketInit, 0},
{ {"BlackMarketTalked"}, NPC_BlackMarketTalked, 0},
{ {"BlackMarketWindowTalked"}, NPC_BlackMarketWindowTalked, 0},
#endif
#ifdef _ALLDOMAN // (不可开) Syu ADD 排行榜NPC
{ {"AlldomanInit"} , NPC_AlldomanInit, 0 },
{ {"AlldomanTalked"} , NPC_AlldomanTalked , 0 },
{ {"AlldomanWindowTalked"}, NPC_AlldomanWindowTalked , 0},
#endif
#ifdef _NPC_WELFARE
{ {"WelfareInit"} , NPC_WelfareInit, 0 },
{ {"WelfareTalked"} , NPC_WelfareTalked , 0 },
{ {"WelfareWindowTalked"}, NPC_WelfareWindowTalked , 0},
#endif
#ifdef _NPC_WELFARE_2 // WON ADD 职业NPC-2
{ {"WelfareInit2"} , NPC_WelfareInit2, 0 },
{ {"WelfareTalked2"} , NPC_WelfareTalked2, 0 },
{ {"WelfareWindowTalked2"}, NPC_WelfareWindowTalked2, 0},
#endif
#ifdef _NPC_VERYWELFARE
{ {"VeryWelfareInit"} , NPC_VeryWelfareInit, 0 },
{ {"VeryWelfareTalked"} , NPC_VeryWelfareTalked , 0 },
{ {"VeryWelfareWindowTalked"}, NPC_VeryWelfareWindowTalked , 0},
#endif
#ifdef _CONTRACT
{ {"ITEM_contract"}, ITEM_contract, 0},
#endif
#ifdef _TIME_TICKET
{ {"ITEM_timeticket"}, ITEM_timeticket, 0},
#endif
#ifdef _RACEMAN
{ {"RacemanInit"} , NPC_RacemanInit, 0 },
{ {"RacemanTalked"} , NPC_RacemanTalked, 0 },
{ {"RacemanWindowTalked"}, NPC_RacemanWindowTalked ,0 },
#endif
};
BOOL initFunctionTable( void )
{
int i;
{
char* strings[arraysizeof(correspondStringAndFunctionTable)];
int stringnum=0;
for( i=0 ; i<arraysizeof(correspondStringAndFunctionTable) ; i++ )
strings[stringnum++] =
correspondStringAndFunctionTable[i].functionName.string;
if( ! checkStringsUnique( strings, stringnum , 1 ) ){
fprint("Function Name Table is overlapped.\n" );
fprint("It is not allowed\n");
return FALSE;
}
}
for(i = 0; i < arraysizeof(correspondStringAndFunctionTable) ; i ++ ){
correspondStringAndFunctionTable[i].hashcode =
hashpjw( correspondStringAndFunctionTable[i].
functionName.string);
}
return TRUE;
}
void* getFunctionPointerFromName( char* funcname )
{
int i;
int hashcode;
if( funcname == NULL || funcname[0] == '\0' ){
return NULL;
}
hashcode = hashpjw( funcname );
for( i=0 ; i<arraysizeof(correspondStringAndFunctionTable) ; i++ )
if( correspondStringAndFunctionTable[i].hashcode == hashcode )
if( strcmp( correspondStringAndFunctionTable[i].functionName.string,funcname ) == 0 ){
DebugFunctionName = correspondStringAndFunctionTable[i].functionName.string;
return correspondStringAndFunctionTable[i].functionPointer;
}
#ifdef DEBUG
print("No such Function: %s\n" ,funcname );
#endif
return NULL;
}