-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCompletelyCustomizableVendor(2).cs
3654 lines (3026 loc) · 109 KB
/
CompletelyCustomizableVendor(2).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
//Completely Customizable Vendor
//Cleaned up by Tresdni
//Original Author: krazeykow
#region References
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Server;
using Server.ContextMenus;
using Server.Engines.XmlSpawner2;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
#endregion
namespace System.CustomizableVendor
{
public class Currency : Item
{
private Payment m_Payment;
private PropertyInfo m_PropertyInfo;
public Type XMLType { get; private set; }
public Type PaymentType { get; private set; }
public string PayName { get; private set; }
public int PayID { get; private set; }
public int CurrHue { get; private set; }
private enum Payment
{
ByGold,
ByItem,
ByProperty,
ByXMLAttachment
}
//default
public Currency()
{
m_Payment = Payment.ByGold;
PaymentType = typeof(Gold);
m_PropertyInfo = null;
PayID = 3823;
PayName = "Gold";
}
public Currency(object bindedTo, Type attachType, PropertyInfo attachProp)
{
XMLType = attachType;
m_Payment = Payment.ByXMLAttachment;
PaymentType = bindedTo.GetType();
m_PropertyInfo = attachProp;
if (bindedTo is Mobile)
{
PayID = 8461;
PayName = "Player " + attachProp.Name;
}
else if (bindedTo is Item)
{
PayID = ((Item)bindedTo).ItemID;
PayName = GetName((Item)bindedTo) + "'s " + attachProp.Name;
CurrHue = ((Item)bindedTo).Hue;
}
}
//consume by item
public Currency(Item i)
{
m_Payment = i.GetType() == typeof(Gold) ? Payment.ByGold : Payment.ByItem;
PaymentType = i.GetType();
m_PropertyInfo = null;
PayID = CoinID(i.ItemID);
PayName = GetName(i);
CurrHue = i.Hue;
}
//consume property on player
public Currency(IEntity m, PropertyInfo pi)
{
m_Payment = Payment.ByProperty;
PaymentType = m.GetType();
m_PropertyInfo = pi;
PayID = 8461;
PayName = "Player " + pi.Name;
}
//consume by item's number based property
public Currency(Item i, PropertyInfo pi)
{
m_Payment = Payment.ByProperty;
PaymentType = i.GetType();
m_PropertyInfo = pi;
PayID = CoinID(i.ItemID);
PayName = GetName(i) + "'s " + pi.Name;
CurrHue = i.Hue;
}
private void Modify(Type t, string append)
{
if ((t == typeof(PlayerMobile) || append == null))
{
return;
}
Item i = (Item)Activator.CreateInstance(t, null);
PayName = GetName(i) + append;
CurrHue = i.Hue;
PayID = CoinID(PayID);
}
private static int CoinID(int itemID)
{
if (itemID == 3821)
{
return 3823;
}
return itemID == 3824 ? 3826 : itemID;
}
private void VOneUpdate()
{
switch (m_Payment)
{
case Payment.ByGold:
case Payment.ByItem:
{
Modify(PaymentType, "");
break;
}
case Payment.ByProperty:
{
if (!(PaymentType == typeof(PlayerMobile)))
{
Modify(PaymentType, "'s " + m_PropertyInfo.Name);
}
break;
}
}
}
private static string GetName(Item i)
{
return String.IsNullOrEmpty(i.Name) ? i.GetType().Name : i.Name;
}
public bool Purchase(Mobile m, int cost)
{
int remain = Value(m) - cost;
if (remain < 0 || m.Backpack == null)
{
return false;
}
Charge(m, cost, remain);
return true;
}
private static void Charge(Container pack, Container bank, Type t, int cost)
{
if (pack == null || bank == null)
{
return;
}
cost = cost - pack.ConsumeUpTo(t, cost);
if (cost > 0)
{
bank.ConsumeUpTo(t, cost);
}
}
private void Charge(Mobile m, Type t, PropertyInfo pi, int cost, int remain)
{
try
{
if (t.BaseType == typeof(Mobile) || t == typeof(PlayerMobile))
{
SetPropertyValue(m, remain);
}
else
{
if (m.Backpack == null || m.FindBankNoCreate() == null)
{
return;
}
var packItems = m.Backpack.FindItemsByType(t);
var bankItems = m.FindBankNoCreate().FindItemsByType(t);
var items = new Item[packItems.Length + bankItems.Length];
packItems.CopyTo(items, 0);
bankItems.CopyTo(items, packItems.Length);
int i = 0;
//account for multiple objects
while (cost > 0 && i < items.Length)
{
int value = GetPropertyValue(items[i]);
int dif = value - cost;
//one item has enough
if (dif >= 0)
{
SetPropertyValue(items[i], dif);
}
//take what amount item has (the amount has already been confirmed by Value(m))
else // assert (dif < 0)
{
cost -= GetPropertyValue(items[i]);
SetPropertyValue(items[i], 0);
}
i++;
}
}
}
catch
{
}
}
private static void Charge(Mobile m, Container pack, Container bank, int cost)
{
if (pack == null || bank == null)
{
return;
}
cost = cost - pack.ConsumeUpTo(typeof(Gold), cost);
if (cost > 0)
{
Banker.Withdraw(m, cost);
}
}
private void Charge(Mobile m, int cost, int remain)
{
switch (m_Payment)
{
case Payment.ByGold:
Charge(m, m.Backpack, m.FindBankNoCreate(), cost);
break;
case Payment.ByItem:
Charge(m.Backpack, m.FindBankNoCreate(), PaymentType, cost);
break;
case Payment.ByXMLAttachment:
case Payment.ByProperty:
Charge(m, PaymentType, m_PropertyInfo, cost, remain);
break;
}
}
public int Value(Mobile m)
{
switch (m_Payment)
{
case Payment.ByGold:
return ProcessByGold(m);
case Payment.ByItem:
return ProcessByItem(m, PaymentType);
case Payment.ByXMLAttachment:
case Payment.ByProperty:
return ProcessByProperty(m, PaymentType, m_PropertyInfo);
}
return 0;
}
private static int ProcessByGold(Mobile m)
{
if (m.Backpack == null)
{
return 0;
}
int totalGold = 0;
totalGold += m.Backpack.GetAmount(typeof(Gold));
totalGold += Banker.GetBalance(m);
return totalGold;
}
private static int ProcessByItem(Mobile m, Type t)
{
Container pack = m.Backpack;
Container bank = m.FindBankNoCreate();
if (pack == null || bank == null)
{
return 0;
}
int amount = (pack.GetAmount(t) + bank.GetAmount(t));
return amount;
}
private int ProcessByProperty(Container pack, Container bank, Type t, PropertyInfo pi)
{
if (pack == null || bank == null)
{
return 0;
}
var packItems = pack.FindItemsByType(t);
var bankItems = bank.FindItemsByType(t);
var items = new Item[packItems.Length + bankItems.Length];
packItems.CopyTo(items, 0);
bankItems.CopyTo(items, packItems.Length);
return items.Sum(o => GetPropertyValue(o));
}
private int GetPropertyValue(object o)
{
int val;
if (m_Payment == Payment.ByXMLAttachment)
{
val = GetXMLValue(o);
}
else
{
val = (int)m_PropertyInfo.GetValue(o, null);
}
return val;
}
private void SetPropertyValue(object o, int val)
{
if (m_Payment == Payment.ByXMLAttachment)
{
SetXMLValue(o, val);
}
else
{
m_PropertyInfo.SetValue(o, val, null);
}
}
private int GetXMLValue(object o)
{
int val = 0;
if (XMLType == null)
{
return val;
}
XmlAttachment attach = XmlAttach.FindAttachment(o, XMLType);
if (attach != null)
{
val = (int)m_PropertyInfo.GetValue(attach, null);
}
return val;
}
private void SetXMLValue(object o, int val)
{
if (XMLType == null)
{
return;
}
XmlAttachment attach = XmlAttach.FindAttachment(o, XMLType);
if (attach != null)
{
m_PropertyInfo.SetValue(attach, val, null);
}
}
//Master
private int ProcessByProperty(Mobile m, Type t, PropertyInfo pi)
{
try
{
if (t.BaseType == typeof(Mobile) || t == typeof(Mobile))
{
return GetPropertyValue(m);
}
return ProcessByProperty(m.Backpack, m.FindBankNoCreate(), t, pi);
}
catch
{
}
return 0;
}
public Currency(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(2);
//version 2
writer.Write(XMLType == null ? "" : XMLType.Name);
//version 1
writer.Write(CurrHue);
//explicit casts are given for clarification
writer.Write((int)m_Payment);
writer.Write(PaymentType.Name);
writer.Write(m_PropertyInfo == null ? "" : m_PropertyInfo.Name);
writer.Write(PayID);
writer.Write(PayName);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 2:
{
try
{
string name = reader.ReadString();
XMLType = name.Equals("") ? null : ScriptCompiler.FindTypeByName(name);
}
catch
{
}
goto case 1;
}
case 1:
{
CurrHue = reader.ReadInt();
goto case 0;
}
case 0:
{
m_Payment = (Payment)reader.ReadInt();
try
{
string name = reader.ReadString();
PaymentType = ScriptCompiler.FindTypeByName(name);
}
catch
{
}
try
{
string propName = reader.ReadString();
if (propName.Equals("")) //never set
{
m_PropertyInfo = null;
}
else if (m_Payment == Payment.ByXMLAttachment && XMLType != null)
//XML requires find property by the XML Class type (m_XML_Type)
{
m_PropertyInfo = XMLType.GetProperty(propName);
}
else
{
m_PropertyInfo = PaymentType.GetProperty(propName);
}
}
catch
{
}
PayID = reader.ReadInt();
PayName = reader.ReadString();
break;
}
}
if (version != 0)
{
return;
}
try
{
VOneUpdate();
}
catch
{
}
}
}
public class Reward : Item, ICloneable
{
private int m_Cost;
private string m_Title;
private string m_Description;
private ObjectPropertyList m_Display;
private RestockInfo m_RestockInfo;
private int m_BuyCount;
public int BuyCount
{
get { return m_BuyCount; }
set { m_BuyCount = value; }
}
public RestockInfo Restock
{
get { return m_RestockInfo; }
set { m_RestockInfo = value; }
}
public ObjectPropertyList Display
{
get
{
if (m_Display != null)
{
return m_Display;
}
m_Display = new ObjectPropertyList(this);
RewardInfo.GetProperties(m_Display);
RewardInfo.AppendChildProperties(m_Display);
m_Display.Terminate();
m_Display.SetStatic();
return m_Display;
}
}
public void Void_RestockInfo()
{
m_RestockInfo = null;
}
//returns ((-1) -> no restockInfo) or current count
public int Try_Restock()
{
if (m_RestockInfo == null)
{
return -1;
}
TimeSpan dif = DateTime.UtcNow - m_RestockInfo.LastRestock;
if (dif <= (m_RestockInfo.RestockRate) || !(m_RestockInfo.RestockRate.TotalMinutes > 0))
{
return m_RestockInfo.Count;
}
int cycles = (int)(dif.TotalMinutes / m_RestockInfo.RestockRate.TotalMinutes);
for (int i = 0; i < cycles; ++i)
{
if (m_RestockInfo.Restock())
{
continue;
}
}
return m_RestockInfo.Count;
}
public bool InStock(int amount)
{
return (m_RestockInfo == null || (m_RestockInfo.Count - amount >= 0));
}
public void RegisterBuy(int amount)
{
if (m_RestockInfo != null && InStock(amount))
{
m_RestockInfo.Count -= amount;
}
this.m_BuyCount += amount;
}
//for retrieving information only
public Item RewardInfo { get; private set; }
//use only when creating Reward for player
public Item RewardCopy
{
get { return GetReward(); }
}
public int Cost
{
get { return m_Cost; }
set { m_Cost = value; }
}
public string Title
{
get { return m_Title; }
set { m_Title = value; }
}
public string Description
{
get { return m_Description; }
set { m_Description = value; }
}
object ICloneable.Clone()
{
return new Reward(this);
}
public Reward()
{
RewardInfo = new Item();
m_Cost = 0;
m_Title = "";
m_Description = "";
m_RestockInfo = null;
}
private Reward(Reward r)
{
RewardInfo = r.RewardCopy;
m_Cost = r.Cost;
m_Title = r.Title;
m_Description = r.Description;
m_RestockInfo = null;
}
public Reward(Item i)
{
RewardInfo = i;
m_Cost = 0;
m_Title = (i.Name ?? i.GetType().Name);
m_Description = "None.";
m_RestockInfo = null;
}
public Reward(Item i, int cost)
{
RewardInfo = i;
m_Cost = cost;
m_Title = (i.Name ?? i.GetType().Name);
m_Description = "None.";
m_RestockInfo = null;
}
public Reward(Item i, int cost, string title)
{
RewardInfo = i;
m_Cost = cost;
m_Title = title;
m_Description = "None.";
m_RestockInfo = null;
}
public Reward(Item i, int cost, string title, string desc)
{
RewardInfo = i;
m_Cost = cost;
m_Title = title;
m_Description = desc;
m_RestockInfo = null;
}
public class RestockInfo
{
private TimeSpan m_RestockRate;
private DateTime m_LastRestock;
private readonly int m_RestockAmnt;
private int m_Count;
private int? m_Maximum;
public TimeSpan RestockRate
{
get { return m_RestockRate; }
}
public DateTime LastRestock
{
get { return m_LastRestock; }
}
public int RestockAmnt
{
get { return m_RestockAmnt; }
}
public int Count
{
get { return m_Count; }
set { m_Count = value; }
}
public int Maximum
{
get { return m_Maximum.GetValueOrDefault(-1); }
}
public int Hours
{
get { return m_RestockRate.Hours; }
}
public int Minutes
{
get { return m_RestockRate.Minutes; }
}
private RestockInfo()
{
m_RestockRate = new TimeSpan();
m_RestockAmnt = 0;
m_Count = 0;
m_Maximum = null;
m_LastRestock = DateTime.UtcNow;
}
public RestockInfo(int count)
: this()
{
m_Count = count;
}
public RestockInfo(int hour, int minute, int count, int RestockNum)
{
m_RestockRate = new TimeSpan(hour, minute, 0);
m_Count = count;
m_RestockAmnt = RestockNum;
m_Maximum = null;
m_LastRestock = DateTime.UtcNow;
}
public RestockInfo(int hour, int minute, int count, int RestockNum, int maxNum)
: this(hour, minute, count, RestockNum)
{
m_Maximum = maxNum;
}
public bool Equals(RestockInfo info)
{
return (this.m_RestockRate.Equals(info.RestockRate) && (this.m_RestockAmnt == info.RestockAmnt) &&
(this.m_Count == info.Count)
&& (this.m_Maximum == info.Maximum));
}
public bool Restock()
{
m_LastRestock = DateTime.UtcNow;
if (m_Maximum != null) //Restock to a limit
{
if ((m_Count + m_RestockAmnt) > m_Maximum)
{
m_Count = m_Maximum.Value;
return false;
}
m_Count += m_RestockAmnt;
return true;
}
m_Count += m_RestockAmnt;
return true;
}
public void Serialize(GenericWriter writer)
{
writer.Write(m_RestockRate);
writer.Write(m_RestockAmnt);
writer.Write(m_Count);
writer.Write(m_Maximum.GetValueOrDefault(-1));
}
public RestockInfo(GenericReader reader)
{
m_RestockRate = reader.ReadTimeSpan();
m_LastRestock = DateTime.UtcNow;
m_RestockAmnt = reader.ReadInt();
m_Count = reader.ReadInt();
int? max = reader.ReadInt();
m_Maximum = ((max < 0) ? null : max);
}
}
public void Edit(int cost, string title, string desc)
{
if (cost < 0 || title == null || desc == null)
{
return;
}
m_Cost = cost;
m_Title = title;
m_Description = desc;
}
private Item GetReward()
{
return ItemClone.Clone(RewardInfo);
}
public Reward(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(1);
writer.Write(m_BuyCount);
if (m_RestockInfo == null)
{
writer.Write(false);
}
else
{
writer.Write(true);
m_RestockInfo.Serialize(writer);
}
writer.WriteItem(RewardInfo);
writer.Write(m_Cost);
writer.Write(m_Title);
writer.Write(m_Description);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
{
m_BuyCount = reader.ReadInt();
if (reader.ReadBool())
{
m_RestockInfo = new RestockInfo(reader);
}
goto case 0;
}
case 0:
{
RewardInfo = reader.ReadItem();
m_Cost = reader.ReadInt();
m_Title = reader.ReadString();
m_Description = reader.ReadString();
break;
}
}
}
}
public class RewardCollection : List<Reward>, ICloneable
{
object ICloneable.Clone()
{
RewardCollection clone = new RewardCollection();
clone.AddRange(this.Select(r => ((Reward)(r as ICloneable).Clone())));
return clone;
}
}
public static class WorldRewardVendors
{
private static readonly List<IRewardVendor> m_Vendors = new List<IRewardVendor>();
public static List<IRewardVendor> Vendors
{
get { return m_Vendors; }
}
public static void RegisterVendor(IRewardVendor vendor)
{
m_Vendors.Add(vendor);
}
public static void RemoveVendor(IRewardVendor vendor)
{
m_Vendors.Remove(vendor);
}
}
public class EditItemGump : Gump
{
private readonly IRewardVendor m_Vendor;
private readonly Reward m_Reward;
private readonly Reward.RestockInfo m_Restock;
private readonly bool m_RestockOpen;
private readonly bool m_IsAdd;
private readonly Storage m_Entries;
public EditItemGump(IRewardVendor vendor, Reward r, Storage entries, bool openRestockInfo, bool addingItem)
: base(0, 0)
{
m_Vendor = vendor;
m_Reward = r;
m_Restock = r.Restock;
m_RestockOpen = openRestockInfo;
m_IsAdd = addingItem;
m_Entries = entries;
this.Closable = true;
this.Disposable = true;
this.Dragable = true;
this.Resizable = false;
AddPage(0);
AddImageTiled(227, 46, 329, 518, 2702);
AddImageTiled(252, 291, 280, 217, 5104);
AddLabel(253, 266, 2124, @"Description:");
AddImageTiled(334, 147, 192, 23, 5104);
AddLabel(258, 150, 2124, @"Cost:");
AddImageTiled(336, 107, 192, 23, 5104);
AddLabel(258, 108, 2124, @"Name:");
AddImage(354, 199, 2328);
AddItem(373, 208, r.RewardInfo.ItemID, r.RewardInfo.Hue);
AddImageTiled(330, 54, 138, 16, 5214);
AddLabel(373, 51, 1324, @"Edit Item");
AddButton(465, 222, 5601, 5605, 2, GumpButtonType.Reply, 0); //restock
AddLabel(447, 198, 2120, @"Restock ");
AddLabel(447, 246, 2120, @"(Optional)");
AddButton(324, 523, 4023, 4024, 1, GumpButtonType.Reply, 0); //ok
AddButton(421, 523, 4017, 4018, 0, GumpButtonType.Reply, 0); //cancel
if (entries == null)
{
InitialText();
}
else
{
PacketText();
}
if (!openRestockInfo && r.Restock == null)
{
return;
}
AddRestockMenu();
m_RestockOpen = true;
}
private void InitialText()
{
AddTextEntry(252, 292, 277, 215, 1879, 0, m_Reward.Description);
AddTextEntry(334, 148, 188, 20, 1879, 1, m_Reward.Cost.ToString());
AddTextEntry(336, 108, 188, 20, 1879, 2, m_Reward.Title);
}
private void PacketText()
{
AddTextEntry(252, 292, 277, 215, 1879, 0, m_Entries[0].ToString()); //desc
AddTextEntry(334, 148, 188, 20, 1879, 1, m_Entries[1].ToString()); //cost
AddTextEntry(336, 108, 188, 20, 1879, 2, m_Entries[2].ToString()); //title
}