/// <summary> /// internal function /// Check quest links to BaseCreature.Id /// </summary> private static void CheckQuest(Hashtable _cArr, int _cId, BaseQuest bq, bool addQuest, string nameVar) { if (_cId > 0) //CreatureId - link from quest (npcId, SpeakToId, DeliveryId ) { if (_cArr.ContainsKey(_cId)) // creatures array have this CreatureId { if (((BaseCreature)_cArr[_cId]) is BaseNPC) //this Id is BaseNPC class old { if (addQuest) { AddQuest(_cId, bq.Id); //add int Id to array } } else { string text = string.Format("* {0} have bad \"{1} = {2};\" link", bq.GetType().Name, nameVar, _cId); string data1 = string.Format("\t> Need change \"BaseCreature\" to \"BaseNPC\" in inherite (header) area."); string data2 = string.Format("\t-> Ex: \"public class {0}: BaseNPC\"", ((BaseCreature)_cArr[_cId]).GetType().Name); AddErr(text, data1, data2); } } else { string text = string.Format("* {0} have bad \"{1}\" link ( Creature \"Id = {2}\" is not exist: need remark this and use questisBugged or write this creature script )", bq.GetType().Name, nameVar, _cId); string data1 = string.Format("\t> Need create this creature \"Id = {0};\"", _cId); string data2 = string.Format("\t> Or Remark line \"//{1} = {0};\" and use \"questIsBugged = true;\"", _cId, nameVar); AddErr(text, data1, data2); } } else { if (addQuest) //if this is a npcId { string text = string.Format("* {0} have bad \"{1} = ?;\" link ( need use Id from NPC questOwner )", bq.GetType().Name, nameVar); string data1 = string.Format("\t> Need search and find this creature questOwner and then use Id number to \"npcId = (Id);\""); string data2 = string.Format("\t> Or create this creature and then use it number.."); AddErr(text, data1, data2); } } }
/// <summary> /// internal function /// Check quest links to BaseCreature.Id /// </summary> private static void CheckQuest( Hashtable _cArr, int _cId, BaseQuest bq, bool addQuest, string nameVar ) { if ( _cId > 0 )//CreatureId - link from quest (npcId, SpeakToId, DeliveryId ) { if ( _cArr.ContainsKey( _cId ) )// creatures array have this CreatureId { if ( ((BaseCreature)_cArr[ _cId ]) is BaseNPC )//this Id is BaseNPC class old { if ( addQuest ) AddQuest( _cId, bq.Id );//add int Id to array } else { string text = string.Format( "* {0} have bad \"{1} = {2};\" link", bq.GetType().Name, nameVar, _cId ); string data1 = string.Format( "\t> Need change \"BaseCreature\" to \"BaseNPC\" in inherite (header) area." ); string data2 = string.Format( "\t-> Ex: \"public class {0}: BaseNPC\"", ((BaseCreature)_cArr[ _cId ]).GetType().Name ); AddErr( text, data1, data2 ); } } else { string text = string.Format( "* {0} have bad \"{1}\" link ( Creature \"Id = {2}\" is not exist: need remark this and use questisBugged or write this creature script )", bq.GetType().Name, nameVar, _cId ); string data1 = string.Format( "\t> Need create this creature \"Id = {0};\"", _cId ); string data2 = string.Format( "\t> Or Remark line \"//{1} = {0};\" and use \"questIsBugged = true;\"", _cId, nameVar ); AddErr( text, data1, data2 ); } } else { if ( addQuest )//if this is a npcId { string text = string.Format( "* {0} have bad \"{1} = ?;\" link ( need use Id from NPC questOwner )", bq.GetType().Name, nameVar ); string data1 = string.Format( "\t> Need search and find this creature questOwner and then use Id number to \"npcId = (Id);\"" ); string data2 = string.Format( "\t> Or create this creature and then use it number.." ); AddErr( text, data1, data2 ); } } }
private bool completed; // ( quest is done ) #region Constructors ( public ), changed: 24.09.05 /// <summary> /// Constructor /// 24.09.05: Removed initialisations of arrays /// </summary> public ActiveQuest(BaseQuest bq) { ConstructorInfo [] ct = bq.GetType().GetConstructors(); activeQuest = (BaseQuest)ct[0].Invoke(null); }
private Hashtable npcobj = new Hashtable(); // Changed 24.09.05 ( format: npcobj[int]=int ) #endregion Fields #region Constructors /// <summary> /// Constructor /// 24.09.05: Removed initialisations of arrays /// </summary> public ActiveQuest( BaseQuest bq ) { ConstructorInfo []ct = bq.GetType().GetConstructors(); activeQuest = (BaseQuest)ct[ 0 ].Invoke( null ); }