Example #1
0
 public static PacketWriter StartChatDialog(MapEntityIndex npcIndex, NPCChatDialogID dialogID)
 {
     var pw = GetWriter(ServerPacketID.StartChatDialog);
     pw.Write(npcIndex);
     pw.Write(dialogID);
     return pw;
 }
Example #2
0
        /// <summary>
        /// Provides the extra text for the <see cref="AdvancedPropertyDescriptor"/> for a
        /// <see cref="NPCChatDialogID"/>.
        /// </summary>
        /// <param name="v">The value.</param>
        /// <returns>The extra text to display.</returns>
        static string ExtraTextProvider_NPCChatDialogID(NPCChatDialogID v)
        {
            var dialog = ClientNPCChatManager.Instance[v];

            if (dialog == null)
            {
                return(null);
            }

            return(dialog.Title);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateTable"/> class.
 /// </summary>
 /// <param name="aIID">The initial value for the corresponding property.</param>
 /// <param name="allianceID">The initial value for the corresponding property.</param>
 /// <param name="bodyID">The initial value for the corresponding property.</param>
 /// <param name="chatDialog">The initial value for the corresponding property.</param>
 /// <param name="exp">The initial value for the corresponding property.</param>
 /// <param name="giveCash">The initial value for the corresponding property.</param>
 /// <param name="giveExp">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="level">The initial value for the corresponding property.</param>
 /// <param name="moveSpeed">The initial value for the corresponding property.</param>
 /// <param name="name">The initial value for the corresponding property.</param>
 /// <param name="respawn">The initial value for the corresponding property.</param>
 /// <param name="shopID">The initial value for the corresponding property.</param>
 /// <param name="statPoints">The initial value for the corresponding property.</param>
 /// <param name="statAgi">The initial value for the corresponding property.</param>
 /// <param name="statDefence">The initial value for the corresponding property.</param>
 /// <param name="statInt">The initial value for the corresponding property.</param>
 /// <param name="statMaxhit">The initial value for the corresponding property.</param>
 /// <param name="statMaxhp">The initial value for the corresponding property.</param>
 /// <param name="statMaxmp">The initial value for the corresponding property.</param>
 /// <param name="statMinhit">The initial value for the corresponding property.</param>
 /// <param name="statStr">The initial value for the corresponding property.</param>
 public CharacterTemplateTable(AIID? @aIID, AllianceID @allianceID, BodyID @bodyID, NPCChatDialogID? @chatDialog,
                               Int32 @exp, UInt16 @giveCash, UInt16 @giveExp, CharacterTemplateID @iD, Byte @level,
                               UInt16 @moveSpeed, String @name, UInt16 @respawn, ShopID? @shopID, Int32 @statPoints,
                               Int16 @statAgi, Int16 @statDefence, Int16 @statInt, Int16 @statMaxhit, Int16 @statMaxhp,
                               Int16 @statMaxmp, Int16 @statMinhit, Int16 @statStr)
 {
     AIID = @aIID;
     AllianceID = @allianceID;
     BodyID = @bodyID;
     ChatDialog = @chatDialog;
     Exp = @exp;
     GiveCash = @giveCash;
     GiveExp = @giveExp;
     ID = @iD;
     Level = @level;
     MoveSpeed = @moveSpeed;
     Name = @name;
     Respawn = @respawn;
     ShopID = @shopID;
     StatPoints = @statPoints;
     SetStat(StatType.Agi, @statAgi);
     SetStat(StatType.Defence, @statDefence);
     SetStat(StatType.Int, @statInt);
     SetStat(StatType.MaxHit, @statMaxhit);
     SetStat(StatType.MaxHP, @statMaxhp);
     SetStat(StatType.MaxMP, @statMaxmp);
     SetStat(StatType.MinHit, @statMinhit);
     SetStat(StatType.Str, @statStr);
 }
Example #4
0
 /// <summary>
 /// When overridden in the derived class, sets the values read from the Read method.
 /// </summary>
 /// <param name="id">The ID.</param>
 /// <param name="title">The title.</param>
 /// <param name="items">The dialog items.</param>
 protected abstract void SetReadValues(NPCChatDialogID id, string title, IEnumerable<NPCChatDialogItemBase> items);
        /// <summary>
        /// Gets the <see cref="EditorNPCChatDialog"/> at the specified <paramref name="id"/>.
        /// </summary>
        /// <param name="id">The ID of the <see cref="EditorNPCChatDialog"/> to get.</param>
        /// <returns>The <see cref="EditorNPCChatDialog"/> at the specified <paramref name="id"/>.</returns>
        public static EditorNPCChatDialog GetDialog(NPCChatDialogID id)
        {
            if (!_instance.DialogExists(id))
            {
                _instance.Reorganize();
                if (!_instance.DialogExists(id))
                    return null;
            }

            var ret = _instance[id];

            // If we grabbed the wrong one, or nothing, try reorganizing
            if (ret == null || ret.ID != id)
            {
                _instance.Reorganize();
                ret = _instance[id];
            }

            // Return whatever we found, since its not like we can do anything else even if it is invalid
            return (EditorNPCChatDialog)ret;
        }
        /// <summary>
        /// When overridden in the derived class, sets the values read from the Read method.
        /// </summary>
        /// <param name="id">The ID.</param>
        /// <param name="title">The title.</param>
        /// <param name="items">The dialog items.</param>
        protected override void SetReadValues(NPCChatDialogID id, string title, IEnumerable<NPCChatDialogItemBase> items)
        {
            Debug.Assert(_id == default(NPCChatDialogID) && _items == default(IEnumerable<NPCChatDialogItemBase>),
                "Values were already set?");

            _id = id;
            _items = items.ToArray();
        }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewNpcCharacterTable"/> class.
 /// </summary>
 /// <param name="aIID">The initial value for the corresponding property.</param>
 /// <param name="bodyID">The initial value for the corresponding property.</param>
 /// <param name="cash">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="chatDialog">The initial value for the corresponding property.</param>
 /// <param name="exp">The initial value for the corresponding property.</param>
 /// <param name="hP">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="level">The initial value for the corresponding property.</param>
 /// <param name="loadMapID">The initial value for the corresponding property.</param>
 /// <param name="loadX">The initial value for the corresponding property.</param>
 /// <param name="loadY">The initial value for the corresponding property.</param>
 /// <param name="moveSpeed">The initial value for the corresponding property.</param>
 /// <param name="mP">The initial value for the corresponding property.</param>
 /// <param name="name">The initial value for the corresponding property.</param>
 /// <param name="respawnMapID">The initial value for the corresponding property.</param>
 /// <param name="respawnX">The initial value for the corresponding property.</param>
 /// <param name="respawnY">The initial value for the corresponding property.</param>
 /// <param name="shopID">The initial value for the corresponding property.</param>
 /// <param name="statPoints">The initial value for the corresponding property.</param>
 /// <param name="statAgi">The initial value for the corresponding property.</param>
 /// <param name="statDefence">The initial value for the corresponding property.</param>
 /// <param name="statInt">The initial value for the corresponding property.</param>
 /// <param name="statMaxhit">The initial value for the corresponding property.</param>
 /// <param name="statMaxhp">The initial value for the corresponding property.</param>
 /// <param name="statMaxmp">The initial value for the corresponding property.</param>
 /// <param name="statMinhit">The initial value for the corresponding property.</param>
 /// <param name="statStr">The initial value for the corresponding property.</param>
 public ViewNpcCharacterTable(AIID? @aIID, BodyID @bodyID, Int32 @cash, CharacterTemplateID? @characterTemplateID,
                              NPCChatDialogID? @chatDialog, Int32 @exp, SPValueType @hP, Int32 @iD, Byte @level,
                              MapID @loadMapID, UInt16 @loadX, UInt16 @loadY, UInt16 @moveSpeed, SPValueType @mP,
                              String @name, MapID? @respawnMapID, Single @respawnX, Single @respawnY, ShopID? @shopID,
                              Int32 @statPoints, Int16 @statAgi, Int16 @statDefence, Int16 @statInt, Int16 @statMaxhit,
                              Int16 @statMaxhp, Int16 @statMaxmp, Int16 @statMinhit, Int16 @statStr)
 {
     AIID = @aIID;
     BodyID = @bodyID;
     Cash = @cash;
     CharacterTemplateID = @characterTemplateID;
     ChatDialog = @chatDialog;
     Exp = @exp;
     HP = @hP;
     ID = @iD;
     Level = @level;
     LoadMapID = @loadMapID;
     LoadX = @loadX;
     LoadY = @loadY;
     MoveSpeed = @moveSpeed;
     MP = @mP;
     Name = @name;
     RespawnMapID = @respawnMapID;
     RespawnX = @respawnX;
     RespawnY = @respawnY;
     ShopID = @shopID;
     StatPoints = @statPoints;
     StatAgi = @statAgi;
     StatDefence = @statDefence;
     StatInt = @statInt;
     StatMaxhit = @statMaxhit;
     StatMaxhp = @statMaxhp;
     StatMaxmp = @statMaxmp;
     StatMinhit = @statMinhit;
     StatStr = @statStr;
 }
        /// <summary>
        /// Provides the extra text for the <see cref="AdvancedPropertyDescriptor"/> for a
        /// <see cref="NPCChatDialogID"/>.
        /// </summary>
        /// <param name="v">The value.</param>
        /// <returns>The extra text to display.</returns>
        static string ExtraTextProvider_NPCChatDialogID(NPCChatDialogID v)
        {
            var dialog = ClientNPCChatManager.Instance[v];
            if (dialog == null)
                return null;

            return dialog.Title;
        }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTable"/> class.
 /// </summary>
 /// <param name="aIID">The initial value for the corresponding property.</param>
 /// <param name="bodyID">The initial value for the corresponding property.</param>
 /// <param name="cash">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="chatDialog">The initial value for the corresponding property.</param>
 /// <param name="exp">The initial value for the corresponding property.</param>
 /// <param name="hP">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="level">The initial value for the corresponding property.</param>
 /// <param name="loadMapID">The initial value for the corresponding property.</param>
 /// <param name="loadX">The initial value for the corresponding property.</param>
 /// <param name="loadY">The initial value for the corresponding property.</param>
 /// <param name="moveSpeed">The initial value for the corresponding property.</param>
 /// <param name="mP">The initial value for the corresponding property.</param>
 /// <param name="name">The initial value for the corresponding property.</param>
 /// <param name="respawnMapID">The initial value for the corresponding property.</param>
 /// <param name="respawnX">The initial value for the corresponding property.</param>
 /// <param name="respawnY">The initial value for the corresponding property.</param>
 /// <param name="shopID">The initial value for the corresponding property.</param>
 /// <param name="statPoints">The initial value for the corresponding property.</param>
 /// <param name="statAgi">The initial value for the corresponding property.</param>
 /// <param name="statDefence">The initial value for the corresponding property.</param>
 /// <param name="statInt">The initial value for the corresponding property.</param>
 /// <param name="statMaxhit">The initial value for the corresponding property.</param>
 /// <param name="statMaxhp">The initial value for the corresponding property.</param>
 /// <param name="statMaxmp">The initial value for the corresponding property.</param>
 /// <param name="statMinhit">The initial value for the corresponding property.</param>
 /// <param name="statStr">The initial value for the corresponding property.</param>
 public CharacterTable(AIID? @aIID, BodyID @bodyID, Int32 @cash, CharacterTemplateID? @characterTemplateID,
                       NPCChatDialogID? @chatDialog, Int32 @exp, SPValueType @hP, CharacterID @iD, Byte @level,
                       MapID @loadMapID, UInt16 @loadX, UInt16 @loadY, UInt16 @moveSpeed, SPValueType @mP, String @name,
                       MapID? @respawnMapID, Single @respawnX, Single @respawnY, ShopID? @shopID, Int32 @statPoints,
                       Int16 @statAgi, Int16 @statDefence, Int16 @statInt, Int16 @statMaxhit, Int16 @statMaxhp,
                       Int16 @statMaxmp, Int16 @statMinhit, Int16 @statStr)
 {
     AIID = @aIID;
     BodyID = @bodyID;
     Cash = @cash;
     CharacterTemplateID = @characterTemplateID;
     ChatDialog = @chatDialog;
     Exp = @exp;
     HP = @hP;
     ID = @iD;
     Level = @level;
     LoadMapID = @loadMapID;
     LoadX = @loadX;
     LoadY = @loadY;
     MoveSpeed = @moveSpeed;
     MP = @mP;
     Name = @name;
     RespawnMapID = @respawnMapID;
     RespawnX = @respawnX;
     RespawnY = @respawnY;
     ShopID = @shopID;
     StatPoints = @statPoints;
     SetStat(StatType.Agi, @statAgi);
     SetStat(StatType.Defence, @statDefence);
     SetStat(StatType.Int, @statInt);
     SetStat(StatType.MaxHit, @statMaxhit);
     SetStat(StatType.MaxHP, @statMaxhp);
     SetStat(StatType.MaxMP, @statMaxmp);
     SetStat(StatType.MinHit, @statMinhit);
     SetStat(StatType.Str, @statStr);
 }