-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYata_infocraft.cs
2884 lines (2697 loc) · 109 KB
/
Yata_infocraft.cs
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
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Globalization;
namespace yata
{
sealed partial class Yata
{
#region Crafting info
/// <summary>
/// Gets a description of the parameters for a specified IP/EncodedIP.
/// </summary>
/// <param name="ipEncoded">the full IP encode</param>
/// <param name="ip">the IP</param>
/// <param name="pos">position of the first delimiter (after the IP,
/// before the Pars)</param>
/// <returns></returns>
static string GetDecodedDescription(string ipEncoded, int ip, int pos)
{
string info = String.Empty;
string pars = ipEncoded.Substring(pos + 1);
int par;
switch (ip)
{
// Returns Item property ability bonus. You need to specify an
// ability constant(IP_CONST_ABILITY_*) and the bonus. The bonus should
// be a positive integer between 1 and 12.
// itemproperty ItemPropertyAbilityBonus(int nAbility, int nBonus);
// Iprp_Abilities.2da
case 0: // ITEM_PROPERTY_ABILITY_BONUS
// info += "[2](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_ABILITY_STR = 0;
//int IP_CONST_ABILITY_DEX = 1;
//int IP_CONST_ABILITY_CON = 2;
//int IP_CONST_ABILITY_INT = 3;
//int IP_CONST_ABILITY_WIS = 4;
//int IP_CONST_ABILITY_CHA = 5;
case 0: info += "str"; break;
case 1: info += "dex"; break;
case 2: info += "con"; break;
case 3: info += "int"; break;
case 4: info += "wis"; break;
case 5: info += "cha"; break;
default: info += gs.bork; break;
}
if ((par = GetPar(pars, 1)) > 0 && par < 13)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property AC bonus. You need to specify the bonus.
// The bonus should be a positive integer between 1 and 20. The modifier
// type depends on the item it is being applied to.
// itemproperty ItemPropertyACBonus(int nBonus);
case 1: // ITEM_PROPERTY_AC_BONUS
// info += "[1](";
info += "(";
if ((par = GetPar(pars, 0)) > 0 && par < 21)
{
info += "+" + par;
}
else
info += gs.bork;
break;
// Returns Item property AC bonus vs. alignment group. An example of
// an alignment group is Chaotic, or Good. You need to specify the
// alignment group constant(IP_CONST_ALIGNMENTGROUP_*) and the AC bonus.
// The AC bonus should be an integer between 1 and 20. The modifier
// type depends on the item it is being applied to.
// itemproperty ItemPropertyACBonusVsAlign(int nAlignGroup, int nACBonus);
// Iprp_AlignGrp.2da
case 2: // ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP
// info += "[2](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_ALIGNMENTGROUP_ALL = 0;
//int IP_CONST_ALIGNMENTGROUP_NEUTRAL = 1;
//int IP_CONST_ALIGNMENTGROUP_LAWFUL = 2;
//int IP_CONST_ALIGNMENTGROUP_CHAOTIC = 3;
//int IP_CONST_ALIGNMENTGROUP_GOOD = 4;
//int IP_CONST_ALIGNMENTGROUP_EVIL = 5;
case 0: info += "vs all"; break;
case 1: info += "vs neutral"; break;
case 2: info += "vs lawful"; break;
case 3: info += "vs chaotic"; break;
case 4: info += "vs good"; break;
case 5: info += "vs evil"; break;
default: info += gs.bork; break;
}
if ((par = GetPar(pars, 1)) > 0 && par < 21)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property AC bonus vs. Damage type (ie. piercing). You
// need to specify the damage type constant(IP_CONST_DAMAGETYPE_*) and the
// AC bonus. The AC bonus should be an integer between 1 and 20. The
// modifier type depends on the item it is being applied to.
// NOTE: Only the first 3 damage types may be used here, the 3 basic physical types.
// itemproperty ItemPropertyACBonusVsDmgType(int nDamageType, int nACBonus);
// Iprp_CombatDam.2da
case 3: // ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE
// info += "[2](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_DAMAGETYPE_BLUDGEONING = 0;
//int IP_CONST_DAMAGETYPE_PIERCING = 1;
//int IP_CONST_DAMAGETYPE_SLASHING = 2;
//int IP_CONST_DAMAGETYPE_SUBDUAL = 3; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_PHYSICAL = 4; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_MAGICAL = 5; // not valid ->
//int IP_CONST_DAMAGETYPE_ACID = 6;
//int IP_CONST_DAMAGETYPE_COLD = 7;
//int IP_CONST_DAMAGETYPE_DIVINE = 8;
//int IP_CONST_DAMAGETYPE_ELECTRICAL = 9;
//int IP_CONST_DAMAGETYPE_FIRE = 10;
//int IP_CONST_DAMAGETYPE_NEGATIVE = 11;
//int IP_CONST_DAMAGETYPE_POSITIVE = 12;
//int IP_CONST_DAMAGETYPE_SONIC = 13;
case 0: info += "vs bludg"; break;
case 1: info += "vs pierc"; break;
case 2: info += "vs slash"; break;
default: info += gs.bork; break;
}
if ((par = GetPar(pars, 1)) > 0 && par < 21)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property AC bonus vs. Racial group. You need to specify
// the racial group constant(IP_CONST_RACIALTYPE_*) and the AC bonus. The AC
// bonus should be an integer between 1 and 20. The modifier type depends
// on the item it is being applied to.
// itemproperty ItemPropertyACBonusVsRace(int nRace, int nACBonus);
// RacialTypes.2da
case 4: // ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP
// info += "[2](";
info += "(";
if ((par = GetPar(pars, 0)) != -1)
{
if (Info.raceLabels.Count != 0 && par < Info.raceLabels.Count)
{
info += "vs " + Info.raceLabels[par];
}
else
info += "vs " + par;
}
else
info += gs.bork;
if ((par = GetPar(pars, 1)) > 0 && par < 21)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property AC bonus vs. Specific alignment. You need to
// specify the specific alignment constant(IP_CONST_ALIGNMENT_*) and the AC
// bonus. The AC bonus should be an integer between 1 and 20. The
// modifier type depends on the item it is being applied to.
// itemproperty ItemPropertyACBonusVsSAlign(int nAlign, int nACBonus);
// Iprp_Alignment.2da
case 5: // ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT
// info += "[2](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_ALIGNMENT_LG = 0;
//int IP_CONST_ALIGNMENT_LN = 1;
//int IP_CONST_ALIGNMENT_LE = 2;
//int IP_CONST_ALIGNMENT_NG = 3;
//int IP_CONST_ALIGNMENT_TN = 4;
//int IP_CONST_ALIGNMENT_NE = 5;
//int IP_CONST_ALIGNMENT_CG = 6;
//int IP_CONST_ALIGNMENT_CN = 7;
//int IP_CONST_ALIGNMENT_CE = 8;
case 0: info += "vs LG"; break;
case 1: info += "vs LN"; break;
case 2: info += "vs LE"; break;
case 3: info += "vs NG"; break;
case 4: info += "vs TN"; break;
case 5: info += "vs NE"; break;
case 6: info += "vs CG"; break;
case 7: info += "vs CN"; break;
case 8: info += "vs CE"; break;
default: info += gs.bork; break;
}
if ((par = GetPar(pars, 1)) > 0 && par < 21)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property Enhancement bonus. You need to specify the
// enhancement bonus. The Enhancement bonus should be an integer between
// 1 and 20.
// itemproperty ItemPropertyEnhancementBonus(int nEnhancementBonus);
case 6: // ITEM_PROPERTY_ENHANCEMENT_BONUS
// info += "[1](";
info += "(";
if ((par = GetPar(pars, 0)) > 0 && par < 21)
{
info += "+" + par;
}
else
info += gs.bork;
break;
// Returns Item property Enhancement bonus vs. an Alignment group. You
// need to specify the alignment group constant(IP_CONST_ALIGNMENTGROUP_*)
// and the enhancement bonus. The Enhancement bonus should be an integer
// between 1 and 20.
// itemproperty ItemPropertyEnhancementBonusVsAlign(int nAlignGroup, int nBonus);
// Iprp_AlignGrp.2da
case 7: // ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP
// info += "[2](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_ALIGNMENTGROUP_ALL = 0;
//int IP_CONST_ALIGNMENTGROUP_NEUTRAL = 1;
//int IP_CONST_ALIGNMENTGROUP_LAWFUL = 2;
//int IP_CONST_ALIGNMENTGROUP_CHAOTIC = 3;
//int IP_CONST_ALIGNMENTGROUP_GOOD = 4;
//int IP_CONST_ALIGNMENTGROUP_EVIL = 5;
case 0: info += "vs all"; break;
case 1: info += "vs neutral"; break;
case 2: info += "vs lawful"; break;
case 3: info += "vs chaotic"; break;
case 4: info += "vs good"; break;
case 5: info += "vs evil"; break;
default: info += gs.bork; break;
}
if ((par = GetPar(pars, 1)) > 0 && par < 21)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property Enhancement bonus vs. Racial group. You need
// to specify the racial group constant(IP_CONST_RACIALTYPE_*) and the
// enhancement bonus. The enhancement bonus should be an integer between
// 1 and 20.
// itemproperty ItemPropertyEnhancementBonusVsRace(int nRace, int nBonus);
// RacialTypes.2da
case 8: // ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP
// info += "[2](";
info += "(";
if ((par = GetPar(pars, 0)) != -1)
{
if (Info.raceLabels.Count != 0 && par < Info.raceLabels.Count)
{
info += "vs " + Info.raceLabels[par];
}
else
info += "vs " + par;
}
else
info += gs.bork;
if ((par = GetPar(pars, 1)) > 0 && par < 21)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property Enhancement bonus vs. a specific alignment. You
// need to specify the alignment constant(IP_CONST_ALIGNMENT_*) and the
// enhancement bonus. The enhancement bonus should be an integer between
// 1 and 20.
// itemproperty ItemPropertyEnhancementBonusVsSAlign(int nAlign, int nBonus);
// Iprp_Alignment.2da
case 9: // ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT
// info += "[2](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_ALIGNMENT_LG = 0;
//int IP_CONST_ALIGNMENT_LN = 1;
//int IP_CONST_ALIGNMENT_LE = 2;
//int IP_CONST_ALIGNMENT_NG = 3;
//int IP_CONST_ALIGNMENT_TN = 4;
//int IP_CONST_ALIGNMENT_NE = 5;
//int IP_CONST_ALIGNMENT_CG = 6;
//int IP_CONST_ALIGNMENT_CN = 7;
//int IP_CONST_ALIGNMENT_CE = 8;
case 0: info += "vs LG"; break;
case 1: info += "vs LN"; break;
case 2: info += "vs LE"; break;
case 3: info += "vs NG"; break;
case 4: info += "vs TN"; break;
case 5: info += "vs NE"; break;
case 6: info += "vs CG"; break;
case 7: info += "vs CN"; break;
case 8: info += "vs CE"; break;
default: info += gs.bork; break;
}
if ((par = GetPar(pars, 1)) > 0 && par < 21)
{
info += " +" + par;
}
else
info += gs.Space + gs.bork;
break;
// Returns Item property Enhancment penalty. You need to specify the
// enhancement penalty. The enhancement penalty should be a POSITIVE
// integer between 1 and 5 (ie. 1 = -1).
// itemproperty ItemPropertyEnhancementPenalty(int nPenalty);
case 10: // ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER
// info += "[1](";
info += "(";
if ((par = GetPar(pars, 0)) > 0 && par < 6)
{
info += "-" + par;
}
else
info += gs.bork;
break;
// Returns Item property weight reduction. You need to specify the weight
// reduction constant(IP_CONST_REDUCEDWEIGHT_*).
// itemproperty ItemPropertyWeightReduction(int nReduction);
case 11: // ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION
// info += "[1](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_REDUCEDWEIGHT_80_PERCENT = 1;
//int IP_CONST_REDUCEDWEIGHT_60_PERCENT = 2;
//int IP_CONST_REDUCEDWEIGHT_40_PERCENT = 3;
//int IP_CONST_REDUCEDWEIGHT_20_PERCENT = 4;
//int IP_CONST_REDUCEDWEIGHT_10_PERCENT = 5;
//int IP_CONST_REDUCEDWEIGHT_50_PERCENT = 6;
//int IP_CONST_REDUCEDWEIGHT_30_PERCENT = 7;
//int IP_CONST_REDUCEDWEIGHT_01_PERCENT = 8;
//int IP_CONST_REDUCEDWEIGHT_70_PERCENT = 9;
case 1: info += "80%"; break;
case 2: info += "60%"; break;
case 3: info += "40%"; break;
case 4: info += "20%"; break;
case 5: info += "10%"; break;
case 6: info += "50%"; break;
case 7: info += "30%"; break;
case 8: info += "1%"; break;
case 9: info += "70%"; break;
default: info += gs.bork; break;
}
break;
// Returns Item property Bonus Feat. You need to specify the the feat
// constant(IP_CONST_FEAT_*).
// itemproperty ItemPropertyBonusFeat(int nFeat);
// Iprp_Feats.2da
case 12: // ITEM_PROPERTY_BONUS_FEAT
// info += "[1](";
info += "(";
if ((par = GetPar(pars, 0)) != -1)
{
if (Info.ipfeatLabels.Count != 0 && par < Info.ipfeatLabels.Count)
{
info += Info.ipfeatLabels[par];
}
else
info += par.ToString(CultureInfo.InvariantCulture);
}
else
info += gs.bork;
break;
// Returns Item property Bonus level spell (Bonus spell of level). You must
// specify the class constant(IP_CONST_CLASS_*) of the bonus spell(MUST BE a
// spell casting class) and the level of the bonus spell. The level of the
// bonus spell should be an integer between 0 and 9.
// itemproperty ItemPropertyBonusLevelSpell(int nClass, int nSpellLevel);
// Classes.2da
case 13: // ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N
// info += "[2](";
info += "(";
if ((par = GetPar(pars, 0)) != -1) // TODO: Check if 'nClass' has "SpellCaster" enabled in Classes.2da
{
if (Info.classLabels.Count != 0 && par < Info.classLabels.Count)
{
info += Info.classLabels[par];
}
else
info += par.ToString(CultureInfo.InvariantCulture);
}
else
info += gs.bork;
if ((par = GetPar(pars, 1)) > -1 && par < 10)
{
info += " L" + par;
}
else
info += gs.Space + gs.bork;
break;
// case 14: // no case 14 in nwscript: "Boomerang" in ItemPropDef.2da
// Returns Item property Cast spell. You must specify the spell constant
// (IP_CONST_CASTSPELL_*) and the number of uses constant(IP_CONST_CASTSPELL_NUMUSES_*).
// NOTE: The number after the name of the spell in the constant is the level
// at which the spell will be cast. Sometimes there are multiple copies
// of the same spell but they each are cast at a different level. The higher
// the level, the more cost will be added to the item.
// NOTE: The list of spells that can be applied to an item will depend on the
// item type. For instance there are spells that can be applied to a wand
// that cannot be applied to a potion. Below is a list of the types and the
// spells that are allowed to be placed on them. If you try to put a cast
// spell effect on an item that is not allowed to have that effect it will
// not work.
// NOTE: Even if spells have multiple versions of different levels they are only
// listed below once.
// itemproperty ItemPropertyCastSpell(int nSpell, int nNumUses);
// Iprp_Spells.2da
case 15: // ITEM_PROPERTY_CAST_SPELL
// info += "[2](";
info += "(";
if ((par = GetPar(pars, 0)) != -1)
{
if (Info.ipspellLabels.Count != 0 && par < Info.ipspellLabels.Count)
{
info += Info.ipspellLabels[par] + " L" + Info.ipspellLevels[par];
}
else
info += par.ToString(CultureInfo.InvariantCulture);
}
else
info += gs.bork;
switch (GetPar(pars, 1))
{
//int IP_CONST_CASTSPELL_NUMUSES_SINGLE_USE = 1;
//int IP_CONST_CASTSPELL_NUMUSES_5_CHARGES_PER_USE = 2;
//int IP_CONST_CASTSPELL_NUMUSES_4_CHARGES_PER_USE = 3;
//int IP_CONST_CASTSPELL_NUMUSES_3_CHARGES_PER_USE = 4;
//int IP_CONST_CASTSPELL_NUMUSES_2_CHARGES_PER_USE = 5;
//int IP_CONST_CASTSPELL_NUMUSES_1_CHARGE_PER_USE = 6;
//int IP_CONST_CASTSPELL_NUMUSES_0_CHARGES_PER_USE = 7;
//int IP_CONST_CASTSPELL_NUMUSES_1_USE_PER_DAY = 8;
//int IP_CONST_CASTSPELL_NUMUSES_2_USES_PER_DAY = 9;
//int IP_CONST_CASTSPELL_NUMUSES_3_USES_PER_DAY = 10;
//int IP_CONST_CASTSPELL_NUMUSES_4_USES_PER_DAY = 11;
//int IP_CONST_CASTSPELL_NUMUSES_5_USES_PER_DAY = 12;
//int IP_CONST_CASTSPELL_NUMUSES_UNLIMITED_USE = 13;
case 1: info += " / 1 use"; break;
case 2: info += " / 5 per use"; break;
case 3: info += " / 4 per use "; break;
case 4: info += " / 3 per use"; break;
case 5: info += " / 2 per use"; break;
case 6: info += " / 1 per use"; break;
case 7: info += " / 0 per use"; break;
case 8: info += " / 1 per day"; break;
case 9: info += " / 2 per day"; break;
case 10: info += " / 3 per day"; break;
case 11: info += " / 4 per day"; break;
case 12: info += " / 5 per day"; break;
case 13: info += " / infinite"; break;
default: info += gs.Space + gs.bork; break;
}
break;
// Returns Item property damage bonus. You must specify the damage type constant
// (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*).
// NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning,
// Cold, Electrical, Fire, Piercing, Slashing, Sonic.
// itemproperty ItemPropertyDamageBonus(int nDamageType, int nDamage);
// Iprp_DamageType.2da
case 16: // ITEM_PROPERTY_DAMAGE_BONUS
// info += "[2](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_DAMAGETYPE_BLUDGEONING = 0;
//int IP_CONST_DAMAGETYPE_PIERCING = 1;
//int IP_CONST_DAMAGETYPE_SLASHING = 2;
//int IP_CONST_DAMAGETYPE_SUBDUAL = 3; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_PHYSICAL = 4; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_MAGICAL = 5; // not valid
//int IP_CONST_DAMAGETYPE_ACID = 6;
//int IP_CONST_DAMAGETYPE_COLD = 7;
//int IP_CONST_DAMAGETYPE_DIVINE = 8; // not valid
//int IP_CONST_DAMAGETYPE_ELECTRICAL = 9;
//int IP_CONST_DAMAGETYPE_FIRE = 10;
//int IP_CONST_DAMAGETYPE_NEGATIVE = 11; // not valid
//int IP_CONST_DAMAGETYPE_POSITIVE = 12; // not valid
//int IP_CONST_DAMAGETYPE_SONIC = 13;
case 0: info += "bludg"; break;
case 1: info += "pierc"; break;
case 2: info += "slash"; break;
case 5: info += "magical^"; break;
case 6: info += "acid"; break;
case 7: info += "cold"; break;
case 8: info += "divine^"; break;
case 9: info += "electrical"; break;
case 10: info += "fire"; break;
case 11: info += "negative^"; break;
case 12: info += "positive^"; break;
case 13: info += "sonic"; break; // TODO: Test other damage-types.
default: info += gs.bork; break;
}
switch (GetPar(pars, 1))
{
//int IP_CONST_DAMAGEBONUS_1 = 1;
//int IP_CONST_DAMAGEBONUS_2 = 2;
//int IP_CONST_DAMAGEBONUS_3 = 3;
//int IP_CONST_DAMAGEBONUS_4 = 4;
//int IP_CONST_DAMAGEBONUS_5 = 5;
//int IP_CONST_DAMAGEBONUS_1d4 = 6;
//int IP_CONST_DAMAGEBONUS_1d6 = 7;
//int IP_CONST_DAMAGEBONUS_1d8 = 8;
//int IP_CONST_DAMAGEBONUS_1d10 = 9;
//int IP_CONST_DAMAGEBONUS_2d6 = 10;
//int IP_CONST_DAMAGEBONUS_2d8 = 11;
//int IP_CONST_DAMAGEBONUS_2d4 = 12;
//int IP_CONST_DAMAGEBONUS_2d10 = 13;
//int IP_CONST_DAMAGEBONUS_1d12 = 14;
//int IP_CONST_DAMAGEBONUS_2d12 = 15;
//int IP_CONST_DAMAGEBONUS_6 = 16;
//int IP_CONST_DAMAGEBONUS_7 = 17;
//int IP_CONST_DAMAGEBONUS_8 = 18;
//int IP_CONST_DAMAGEBONUS_9 = 19;
//int IP_CONST_DAMAGEBONUS_10 = 20;
//int IP_CONST_DAMAGEBONUS_3d10 = 51;
//int IP_CONST_DAMAGEBONUS_3d12 = 52;
//int IP_CONST_DAMAGEBONUS_4d6 = 53;
//int IP_CONST_DAMAGEBONUS_4d8 = 54;
//int IP_CONST_DAMAGEBONUS_4d10 = 55;
//int IP_CONST_DAMAGEBONUS_4d12 = 56;
//int IP_CONST_DAMAGEBONUS_5d6 = 57;
//int IP_CONST_DAMAGEBONUS_5d12 = 58;
//int IP_CONST_DAMAGEBONUS_6d12 = 59;
//int IP_CONST_DAMAGEBONUS_3d6 = 60;
//int IP_CONST_DAMAGEBONUS_6d6 = 61;
case 1: info += " +1"; break;
case 2: info += " +2"; break;
case 3: info += " +3"; break;
case 4: info += " +4"; break;
case 5: info += " +5"; break;
case 6: info += " +1d4"; break;
case 7: info += " +1d6"; break;
case 8: info += " +1d8"; break;
case 9: info += " +1d10"; break;
case 10: info += " +2d6"; break;
case 11: info += " +2d8"; break;
case 12: info += " +2d4"; break;
case 13: info += " +2d10"; break;
case 14: info += " +1d12"; break;
case 15: info += " +2d12"; break;
case 16: info += " +6"; break;
case 17: info += " +7"; break;
case 18: info += " +8"; break;
case 19: info += " +9"; break;
case 20: info += " +10"; break;
case 51: info += " +3d10"; break;
case 52: info += " +3d12"; break;
case 53: info += " +4d6"; break;
case 54: info += " +4d8"; break;
case 55: info += " +4d10"; break;
case 56: info += " +4d12"; break;
case 57: info += " +5d6"; break;
case 58: info += " +5d12"; break;
case 59: info += " +6d12"; break;
case 60: info += " +3d6"; break;
case 61: info += " +6d6"; break;
default: info += gs.Space + gs.bork; break;
}
break;
// Returns Item property damage bonus vs. Alignment groups. You must specify the
// alignment group constant(IP_CONST_ALIGNMENTGROUP_*) and the damage type constant
// (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*).
// NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning,
// Cold, Electrical, Fire, Piercing, Slashing, Sonic.
// itemproperty ItemPropertyDamageBonusVsAlign(int nAlignGroup, int nDamageType, int nDamage);
// Iprp_AlignGrp.2da
case 17: // ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP
// info += "[3](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_ALIGNMENTGROUP_ALL = 0;
//int IP_CONST_ALIGNMENTGROUP_NEUTRAL = 1;
//int IP_CONST_ALIGNMENTGROUP_LAWFUL = 2;
//int IP_CONST_ALIGNMENTGROUP_CHAOTIC = 3;
//int IP_CONST_ALIGNMENTGROUP_GOOD = 4;
//int IP_CONST_ALIGNMENTGROUP_EVIL = 5;
case 0: info += "vs all"; break;
case 1: info += "vs neutral"; break;
case 2: info += "vs lawful"; break;
case 3: info += "vs chaotic"; break;
case 4: info += "vs good"; break;
case 5: info += "vs evil"; break;
default: info += gs.bork; break;
}
switch (GetPar(pars, 1))
{
//int IP_CONST_DAMAGETYPE_BLUDGEONING = 0;
//int IP_CONST_DAMAGETYPE_PIERCING = 1;
//int IP_CONST_DAMAGETYPE_SLASHING = 2;
//int IP_CONST_DAMAGETYPE_SUBDUAL = 3; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_PHYSICAL = 4; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_MAGICAL = 5; // not valid
//int IP_CONST_DAMAGETYPE_ACID = 6;
//int IP_CONST_DAMAGETYPE_COLD = 7;
//int IP_CONST_DAMAGETYPE_DIVINE = 8; // not valid
//int IP_CONST_DAMAGETYPE_ELECTRICAL = 9;
//int IP_CONST_DAMAGETYPE_FIRE = 10;
//int IP_CONST_DAMAGETYPE_NEGATIVE = 11; // not valid
//int IP_CONST_DAMAGETYPE_POSITIVE = 12; // not valid
//int IP_CONST_DAMAGETYPE_SONIC = 13;
case 0: info += " bludg"; break;
case 1: info += " pierc"; break;
case 2: info += " slash"; break;
case 5: info += " magical^"; break;
case 6: info += " acid"; break;
case 7: info += " cold"; break;
case 8: info += " divine^"; break;
case 9: info += " electrical"; break;
case 10: info += " fire"; break;
case 11: info += " negative^"; break;
case 12: info += " positive^"; break;
case 13: info += " sonic"; break; // TODO: Test other damage-types.
default: info += gs.Space + gs.bork; break;
}
switch (GetPar(pars, 2))
{
//int IP_CONST_DAMAGEBONUS_1 = 1;
//int IP_CONST_DAMAGEBONUS_2 = 2;
//int IP_CONST_DAMAGEBONUS_3 = 3;
//int IP_CONST_DAMAGEBONUS_4 = 4;
//int IP_CONST_DAMAGEBONUS_5 = 5;
//int IP_CONST_DAMAGEBONUS_1d4 = 6;
//int IP_CONST_DAMAGEBONUS_1d6 = 7;
//int IP_CONST_DAMAGEBONUS_1d8 = 8;
//int IP_CONST_DAMAGEBONUS_1d10 = 9;
//int IP_CONST_DAMAGEBONUS_2d6 = 10;
//int IP_CONST_DAMAGEBONUS_2d8 = 11;
//int IP_CONST_DAMAGEBONUS_2d4 = 12;
//int IP_CONST_DAMAGEBONUS_2d10 = 13;
//int IP_CONST_DAMAGEBONUS_1d12 = 14;
//int IP_CONST_DAMAGEBONUS_2d12 = 15;
//int IP_CONST_DAMAGEBONUS_6 = 16;
//int IP_CONST_DAMAGEBONUS_7 = 17;
//int IP_CONST_DAMAGEBONUS_8 = 18;
//int IP_CONST_DAMAGEBONUS_9 = 19;
//int IP_CONST_DAMAGEBONUS_10 = 20;
//int IP_CONST_DAMAGEBONUS_3d10 = 51;
//int IP_CONST_DAMAGEBONUS_3d12 = 52;
//int IP_CONST_DAMAGEBONUS_4d6 = 53;
//int IP_CONST_DAMAGEBONUS_4d8 = 54;
//int IP_CONST_DAMAGEBONUS_4d10 = 55;
//int IP_CONST_DAMAGEBONUS_4d12 = 56;
//int IP_CONST_DAMAGEBONUS_5d6 = 57;
//int IP_CONST_DAMAGEBONUS_5d12 = 58;
//int IP_CONST_DAMAGEBONUS_6d12 = 59;
//int IP_CONST_DAMAGEBONUS_3d6 = 60;
//int IP_CONST_DAMAGEBONUS_6d6 = 61;
case 1: info += " +1"; break;
case 2: info += " +2"; break;
case 3: info += " +3"; break;
case 4: info += " +4"; break;
case 5: info += " +5"; break;
case 6: info += " +1d4"; break;
case 7: info += " +1d6"; break;
case 8: info += " +1d8"; break;
case 9: info += " +1d10"; break;
case 10: info += " +2d6"; break;
case 11: info += " +2d8"; break;
case 12: info += " +2d4"; break;
case 13: info += " +2d10"; break;
case 14: info += " +1d12"; break;
case 15: info += " +2d12"; break;
case 16: info += " +6"; break;
case 17: info += " +7"; break;
case 18: info += " +8"; break;
case 19: info += " +9"; break;
case 20: info += " +10"; break;
case 51: info += " +3d10"; break;
case 52: info += " +3d12"; break;
case 53: info += " +4d6"; break;
case 54: info += " +4d8"; break;
case 55: info += " +4d10"; break;
case 56: info += " +4d12"; break;
case 57: info += " +5d6"; break;
case 58: info += " +5d12"; break;
case 59: info += " +6d12"; break;
case 60: info += " +3d6"; break;
case 61: info += " +6d6"; break;
default: info += gs.Space + gs.bork; break;
}
break;
// Returns Item property damage bonus vs. specific race. You must specify the
// racial group constant(IP_CONST_RACIALTYPE_*) and the damage type constant
// (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*).
// NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning,
// Cold, Electrical, Fire, Piercing, Slashing, Sonic.
// itemproperty ItemPropertyDamageBonusVsRace(int nRace, int nDamageType, int nDamage);
// RacialTypes.2da
case 18: // ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP
// info += "[3](";
info += "(";
if ((par = GetPar(pars, 0)) != -1)
{
if (Info.raceLabels.Count != 0 && par < Info.raceLabels.Count)
{
info += "vs " + Info.raceLabels[par];
}
else
info += "vs " + par;
}
else
info += gs.bork;
switch (GetPar(pars, 1))
{
//int IP_CONST_DAMAGETYPE_BLUDGEONING = 0;
//int IP_CONST_DAMAGETYPE_PIERCING = 1;
//int IP_CONST_DAMAGETYPE_SLASHING = 2;
//int IP_CONST_DAMAGETYPE_SUBDUAL = 3; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_PHYSICAL = 4; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_MAGICAL = 5; // not valid
//int IP_CONST_DAMAGETYPE_ACID = 6;
//int IP_CONST_DAMAGETYPE_COLD = 7;
//int IP_CONST_DAMAGETYPE_DIVINE = 8; // not valid
//int IP_CONST_DAMAGETYPE_ELECTRICAL = 9;
//int IP_CONST_DAMAGETYPE_FIRE = 10;
//int IP_CONST_DAMAGETYPE_NEGATIVE = 11; // not valid
//int IP_CONST_DAMAGETYPE_POSITIVE = 12; // not valid
//int IP_CONST_DAMAGETYPE_SONIC = 13;
case 0: info += " bludg"; break;
case 1: info += " pierc"; break;
case 2: info += " slash"; break;
case 5: info += " magical^"; break;
case 6: info += " acid"; break;
case 7: info += " cold"; break;
case 8: info += " divine^"; break;
case 9: info += " electrical"; break;
case 10: info += " fire"; break;
case 11: info += " negative^"; break;
case 12: info += " positive^"; break;
case 13: info += " sonic"; break; // TODO: Test other damage-types.
default: info += gs.Space + gs.bork; break;
}
switch (GetPar(pars, 2))
{
//int IP_CONST_DAMAGEBONUS_1 = 1;
//int IP_CONST_DAMAGEBONUS_2 = 2;
//int IP_CONST_DAMAGEBONUS_3 = 3;
//int IP_CONST_DAMAGEBONUS_4 = 4;
//int IP_CONST_DAMAGEBONUS_5 = 5;
//int IP_CONST_DAMAGEBONUS_1d4 = 6;
//int IP_CONST_DAMAGEBONUS_1d6 = 7;
//int IP_CONST_DAMAGEBONUS_1d8 = 8;
//int IP_CONST_DAMAGEBONUS_1d10 = 9;
//int IP_CONST_DAMAGEBONUS_2d6 = 10;
//int IP_CONST_DAMAGEBONUS_2d8 = 11;
//int IP_CONST_DAMAGEBONUS_2d4 = 12;
//int IP_CONST_DAMAGEBONUS_2d10 = 13;
//int IP_CONST_DAMAGEBONUS_1d12 = 14;
//int IP_CONST_DAMAGEBONUS_2d12 = 15;
//int IP_CONST_DAMAGEBONUS_6 = 16;
//int IP_CONST_DAMAGEBONUS_7 = 17;
//int IP_CONST_DAMAGEBONUS_8 = 18;
//int IP_CONST_DAMAGEBONUS_9 = 19;
//int IP_CONST_DAMAGEBONUS_10 = 20;
//int IP_CONST_DAMAGEBONUS_3d10 = 51;
//int IP_CONST_DAMAGEBONUS_3d12 = 52;
//int IP_CONST_DAMAGEBONUS_4d6 = 53;
//int IP_CONST_DAMAGEBONUS_4d8 = 54;
//int IP_CONST_DAMAGEBONUS_4d10 = 55;
//int IP_CONST_DAMAGEBONUS_4d12 = 56;
//int IP_CONST_DAMAGEBONUS_5d6 = 57;
//int IP_CONST_DAMAGEBONUS_5d12 = 58;
//int IP_CONST_DAMAGEBONUS_6d12 = 59;
//int IP_CONST_DAMAGEBONUS_3d6 = 60;
//int IP_CONST_DAMAGEBONUS_6d6 = 61;
case 1: info += " +1"; break;
case 2: info += " +2"; break;
case 3: info += " +3"; break;
case 4: info += " +4"; break;
case 5: info += " +5"; break;
case 6: info += " +1d4"; break;
case 7: info += " +1d6"; break;
case 8: info += " +1d8"; break;
case 9: info += " +1d10"; break;
case 10: info += " +2d6"; break;
case 11: info += " +2d8"; break;
case 12: info += " +2d4"; break;
case 13: info += " +2d10"; break;
case 14: info += " +1d12"; break;
case 15: info += " +2d12"; break;
case 16: info += " +6"; break;
case 17: info += " +7"; break;
case 18: info += " +8"; break;
case 19: info += " +9"; break;
case 20: info += " +10"; break;
case 51: info += " +3d10"; break;
case 52: info += " +3d12"; break;
case 53: info += " +4d6"; break;
case 54: info += " +4d8"; break;
case 55: info += " +4d10"; break;
case 56: info += " +4d12"; break;
case 57: info += " +5d6"; break;
case 58: info += " +5d12"; break;
case 59: info += " +6d12"; break;
case 60: info += " +3d6"; break;
case 61: info += " +6d6"; break;
default: info += gs.Space + gs.bork; break;
}
break;
// Returns Item property damage bonus vs. specific alignment. You must specify the
// specific alignment constant(IP_CONST_ALIGNMENT_*) and the damage type constant
// (IP_CONST_DAMAGETYPE_*) and the amount of damage constant(IP_CONST_DAMAGEBONUS_*).
// NOTE: not all the damage types will work, use only the following: Acid, Bludgeoning,
// Cold, Electrical, Fire, Piercing, Slashing, Sonic.
// itemproperty ItemPropertyDamageBonusVsSAlign(int nAlign, int nDamageType, int nDamage);
// Iprp_Alignment.2da
case 19: // ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT
// info += "[3](";
info += "(";
switch (GetPar(pars, 0))
{
//int IP_CONST_ALIGNMENT_LG = 0;
//int IP_CONST_ALIGNMENT_LN = 1;
//int IP_CONST_ALIGNMENT_LE = 2;
//int IP_CONST_ALIGNMENT_NG = 3;
//int IP_CONST_ALIGNMENT_TN = 4;
//int IP_CONST_ALIGNMENT_NE = 5;
//int IP_CONST_ALIGNMENT_CG = 6;
//int IP_CONST_ALIGNMENT_CN = 7;
//int IP_CONST_ALIGNMENT_CE = 8;
case 0: info += "vs LG"; break;
case 1: info += "vs LN"; break;
case 2: info += "vs LE"; break;
case 3: info += "vs NG"; break;
case 4: info += "vs TN"; break;
case 5: info += "vs NE"; break;
case 6: info += "vs CG"; break;
case 7: info += "vs CN"; break;
case 8: info += "vs CE"; break;
default: info += gs.bork; break;
}
switch (GetPar(pars, 1))
{
//int IP_CONST_DAMAGETYPE_BLUDGEONING = 0;
//int IP_CONST_DAMAGETYPE_PIERCING = 1;
//int IP_CONST_DAMAGETYPE_SLASHING = 2;
//int IP_CONST_DAMAGETYPE_SUBDUAL = 3; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_PHYSICAL = 4; // don't use this dType at all.
//int IP_CONST_DAMAGETYPE_MAGICAL = 5; // not valid
//int IP_CONST_DAMAGETYPE_ACID = 6;
//int IP_CONST_DAMAGETYPE_COLD = 7;
//int IP_CONST_DAMAGETYPE_DIVINE = 8; // not valid
//int IP_CONST_DAMAGETYPE_ELECTRICAL = 9;
//int IP_CONST_DAMAGETYPE_FIRE = 10;
//int IP_CONST_DAMAGETYPE_NEGATIVE = 11; // not valid
//int IP_CONST_DAMAGETYPE_POSITIVE = 12; // not valid
//int IP_CONST_DAMAGETYPE_SONIC = 13;
case 0: info += " bludg"; break;
case 1: info += " pierc"; break;
case 2: info += " slash"; break;
case 5: info += " magical^"; break;
case 6: info += " acid"; break;
case 7: info += " cold"; break;
case 8: info += " divine^"; break;
case 9: info += " electrical"; break;
case 10: info += " fire"; break;
case 11: info += " negative^"; break;
case 12: info += " positive^"; break;
case 13: info += " sonic"; break; // TODO: Test other damage-types.
default: info += gs.Space + gs.bork; break;
}
switch (GetPar(pars, 2))
{
//int IP_CONST_DAMAGEBONUS_1 = 1;
//int IP_CONST_DAMAGEBONUS_2 = 2;
//int IP_CONST_DAMAGEBONUS_3 = 3;
//int IP_CONST_DAMAGEBONUS_4 = 4;
//int IP_CONST_DAMAGEBONUS_5 = 5;
//int IP_CONST_DAMAGEBONUS_1d4 = 6;
//int IP_CONST_DAMAGEBONUS_1d6 = 7;
//int IP_CONST_DAMAGEBONUS_1d8 = 8;
//int IP_CONST_DAMAGEBONUS_1d10 = 9;
//int IP_CONST_DAMAGEBONUS_2d6 = 10;
//int IP_CONST_DAMAGEBONUS_2d8 = 11;
//int IP_CONST_DAMAGEBONUS_2d4 = 12;
//int IP_CONST_DAMAGEBONUS_2d10 = 13;
//int IP_CONST_DAMAGEBONUS_1d12 = 14;
//int IP_CONST_DAMAGEBONUS_2d12 = 15;
//int IP_CONST_DAMAGEBONUS_6 = 16;
//int IP_CONST_DAMAGEBONUS_7 = 17;
//int IP_CONST_DAMAGEBONUS_8 = 18;
//int IP_CONST_DAMAGEBONUS_9 = 19;
//int IP_CONST_DAMAGEBONUS_10 = 20;
//int IP_CONST_DAMAGEBONUS_3d10 = 51;
//int IP_CONST_DAMAGEBONUS_3d12 = 52;
//int IP_CONST_DAMAGEBONUS_4d6 = 53;
//int IP_CONST_DAMAGEBONUS_4d8 = 54;
//int IP_CONST_DAMAGEBONUS_4d10 = 55;
//int IP_CONST_DAMAGEBONUS_4d12 = 56;
//int IP_CONST_DAMAGEBONUS_5d6 = 57;
//int IP_CONST_DAMAGEBONUS_5d12 = 58;
//int IP_CONST_DAMAGEBONUS_6d12 = 59;
//int IP_CONST_DAMAGEBONUS_3d6 = 60;
//int IP_CONST_DAMAGEBONUS_6d6 = 61;
case 1: info += " +1"; break;
case 2: info += " +2"; break;
case 3: info += " +3"; break;
case 4: info += " +4"; break;
case 5: info += " +5"; break;
case 6: info += " +1d4"; break;
case 7: info += " +1d6"; break;
case 8: info += " +1d8"; break;
case 9: info += " +1d10"; break;
case 10: info += " +2d6"; break;
case 11: info += " +2d8"; break;
case 12: info += " +2d4"; break;
case 13: info += " +2d10"; break;
case 14: info += " +1d12"; break;
case 15: info += " +2d12"; break;
case 16: info += " +6"; break;
case 17: info += " +7"; break;
case 18: info += " +8"; break;
case 19: info += " +9"; break;
case 20: info += " +10"; break;
case 51: info += " +3d10"; break;
case 52: info += " +3d12"; break;
case 53: info += " +4d6"; break;
case 54: info += " +4d8"; break;
case 55: info += " +4d10"; break;
case 56: info += " +4d12"; break;
case 57: info += " +5d6"; break;
case 58: info += " +5d12"; break;
case 59: info += " +6d12"; break;
case 60: info += " +3d6"; break;
case 61: info += " +6d6"; break;
default: info += gs.Space + gs.bork; break;
}
break;
// Returns Item property damage immunity. You must specify the damage type constant