/// <summary>
 /// Initializes a new instance of the <see cref="QueryArgs"/> struct.
 /// </summary>
 /// <param name="characterID">The character ID.</param>
 /// <param name="questID">The quest ID.</param>
 /// <param name="characterTemplateID">The character template ID.</param>
 /// <param name="count">The count.</param>
 public QueryArgs(CharacterID characterID, QuestID questID, CharacterTemplateID characterTemplateID, ushort count)
 {
     _characterID         = characterID;
     _questID             = questID;
     _characterTemplateID = characterTemplateID;
     _count = count;
 }
 /// <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);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateEquippedTable"/> class.
 /// </summary>
 /// <param name="chance">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="itemTemplateID">The initial value for the corresponding property.</param>
 public CharacterTemplateEquippedTable(ItemChance @chance, CharacterTemplateID @characterTemplateID, Int32 @iD,
                                       ItemTemplateID @itemTemplateID)
 {
     Chance = @chance;
     CharacterTemplateID = @characterTemplateID;
     ID             = @iD;
     ItemTemplateID = @itemTemplateID;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterQuestStatusKillsTable"/> class.
 /// </summary>
 /// <param name="characterID">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="count">The initial value for the corresponding property.</param>
 /// <param name="questID">The initial value for the corresponding property.</param>
 public CharacterQuestStatusKillsTable(CharacterID @characterID, CharacterTemplateID @characterTemplateID, UInt16 @count,
                                       QuestID @questID)
 {
     CharacterID         = @characterID;
     CharacterTemplateID = @characterTemplateID;
     Count   = @count;
     QuestID = @questID;
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsCountNpcKillUserTable"/> class.
 /// </summary>
 /// <param name="count">The initial value for the corresponding property.</param>
 /// <param name="lastUpdate">The initial value for the corresponding property.</param>
 /// <param name="nPCTemplateID">The initial value for the corresponding property.</param>
 /// <param name="userID">The initial value for the corresponding property.</param>
 public WorldStatsCountNpcKillUserTable(Int32 @count, DateTime @lastUpdate, CharacterTemplateID @nPCTemplateID,
                                        CharacterID @userID)
 {
     Count         = @count;
     LastUpdate    = @lastUpdate;
     NPCTemplateID = @nPCTemplateID;
     UserID        = @userID;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateInventoryTable"/> class.
 /// </summary>
 /// <param name="chance">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="itemTemplateID">The initial value for the corresponding property.</param>
 /// <param name="max">The initial value for the corresponding property.</param>
 /// <param name="min">The initial value for the corresponding property.</param>
 public CharacterTemplateInventoryTable(ItemChance @chance, CharacterTemplateID @characterTemplateID, Int32 @iD,
                                        ItemTemplateID @itemTemplateID, Byte @max, Byte @min)
 {
     Chance = @chance;
     CharacterTemplateID = @characterTemplateID;
     ID             = @iD;
     ItemTemplateID = @itemTemplateID;
     Max            = @max;
     Min            = @min;
 }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnValues"/> class.
 /// </summary>
 /// <param name="dbController">The DbController used to synchronize changes to the values.</param>
 /// <param name="id">The unique ID of this MapSpawnValues.</param>
 /// <param name="mapID">The index of the Map that these values are for.</param>
 /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param>
 /// <param name="spawnAmount">The maximum number of Characters that will be spawned by this MapSpawnValues.</param>
 /// <param name="spawnRect">The area on the map the spawning will take place at.</param>
 MapSpawnValues(IDbController dbController, MapSpawnValuesID id, MapID mapID, CharacterTemplateID characterTemplateID,
                byte spawnAmount, MapSpawnRect spawnRect)
 {
     _dbController = dbController;
     _id = id;
     _mapID = mapID;
     _characterTemplateID = characterTemplateID;
     _spawnAmount = spawnAmount;
     _spawnArea = spawnRect;
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnValues"/> class.
 /// </summary>
 /// <param name="dbController">The DbController used to synchronize changes to the values.</param>
 /// <param name="id">The unique ID of this MapSpawnValues.</param>
 /// <param name="mapID">The index of the Map that these values are for.</param>
 /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param>
 /// <param name="spawnAmount">The maximum number of Characters that will be spawned by this MapSpawnValues.</param>
 /// <param name="spawnRect">The area on the map the spawning will take place at.</param>
 MapSpawnValues(IDbController dbController, MapSpawnValuesID id, MapID mapID, CharacterTemplateID characterTemplateID,
                byte spawnAmount, MapSpawnRect spawnRect)
 {
     _dbController        = dbController;
     _id                  = id;
     _mapID               = mapID;
     _characterTemplateID = characterTemplateID;
     _spawnAmount         = spawnAmount;
     _spawnArea           = spawnRect;
 }
예제 #9
0
        /// <summary>
        /// Provides the extra text for the <see cref="AdvancedPropertyDescriptor"/> for a
        /// <see cref="CharacterTemplateID"/>.
        /// </summary>
        /// <param name="v">The value.</param>
        /// <returns>The extra text to display.</returns>
        static string ExtraTextProvider_CharacterTemplateID(CharacterTemplateID v)
        {
            var character = CharacterTemplateManager.Instance[v];

            if (character == null || character.TemplateTable == null)
            {
                return(null);
            }

            return(character.TemplateTable.Name);
        }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnValues"/> class.
 /// </summary>
 /// <param name="dbController">The DbController used to synchronize changes to the values.</param>
 /// <param name="id">The unique ID of this MapSpawnValues.</param>
 /// <param name="mapID">The index of the Map that these values are for.</param>
 /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param>
 /// <param name="spawnAmount">The maximum number of Characters that will be spawned by this MapSpawnValues.</param>
 /// <param name="spawnRect">The area on the map the spawning will take place at.</param>
 /// <param name="spawnDirection">The direction on this map to spawn the NPCs.</param>
 /// <param name="spawnRespawn">The time it takes for an NPC to spawn.</param>
 MapSpawnValues(IDbController dbController, MapSpawnValuesID id, MapID mapID, CharacterTemplateID characterTemplateID,
                byte spawnAmount, MapSpawnRect spawnRect, Direction spawnDirection, ushort spawnRespawn)
 {
     _dbController = dbController;
     _id = id;
     _mapID = mapID;
     _characterTemplateID = characterTemplateID;
     _spawnAmount = spawnAmount;
     _spawnArea = spawnRect;
     _spawnDirection = spawnDirection;
     _spawnRespawn = spawnRespawn;
 }
예제 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnTable"/> class.
 /// </summary>
 /// <param name="amount">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="height">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="mapID">The initial value for the corresponding property.</param>
 /// <param name="width">The initial value for the corresponding property.</param>
 /// <param name="x">The initial value for the corresponding property.</param>
 /// <param name="y">The initial value for the corresponding property.</param>
 public MapSpawnTable(Byte @amount, CharacterTemplateID @characterTemplateID, ushort? @height, MapSpawnValuesID @iD,
                      MapID @mapID, ushort? @width, ushort? @x, ushort? @y)
 {
     Amount = @amount;
     CharacterTemplateID = @characterTemplateID;
     Height = @height;
     ID     = @iD;
     MapID  = @mapID;
     Width  = @width;
     X      = @x;
     Y      = @y;
 }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnValues"/> class.
 /// </summary>
 /// <param name="dbController">The DbController used to synchronize changes to the values.</param>
 /// <param name="id">The unique ID of this MapSpawnValues.</param>
 /// <param name="mapID">The index of the Map that these values are for.</param>
 /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param>
 /// <param name="spawnAmount">The maximum number of Characters that will be spawned by this MapSpawnValues.</param>
 /// <param name="spawnRect">The area on the map the spawning will take place at.</param>
 /// <param name="spawnDirection">The direction on this map to spawn the NPCs.</param>
 /// <param name="spawnRespawn">The time it takes for an NPC to spawn.</param>
 MapSpawnValues(IDbController dbController, MapSpawnValuesID id, MapID mapID, CharacterTemplateID characterTemplateID,
                byte spawnAmount, MapSpawnRect spawnRect, Direction spawnDirection, ushort spawnRespawn)
 {
     _dbController        = dbController;
     _id                  = id;
     _mapID               = mapID;
     _characterTemplateID = characterTemplateID;
     _spawnAmount         = spawnAmount;
     _spawnArea           = spawnRect;
     _spawnDirection      = spawnDirection;
     _spawnRespawn        = spawnRespawn;
 }
        /// <summary>
        /// Checks if the CharacterTemplate with the given CharacterTemplateID exists in the database.
        /// </summary>
        /// <param name="id">CharacterTemplateID to check.</param>
        /// <returns>True if a CharacterTemplate with the given id exists; otherwise false.</returns>
        public static bool TemplateExists(this CharacterTemplateID id)
        {
            IDbController dbController = DbControllerBase.GetInstance();
            var           query        = dbController.GetQuery <SelectCharacterTemplateQuery>();

            try
            {
                var result = query.Execute(id);
                if (result == null)
                {
                    return(false);
                }
            }
            catch (ArgumentException)
            {
                return(false);
            }

            return(true);
        }
예제 #14
0
        public void Thrall(CharacterTemplateID id, int amount)
        {
            var charTemplate = CharacterTemplateManager.Instance[id];

            if (charTemplate == null)
            {
                UserChat("Invalid character template `{0}`.", id);
                return;
            }

            if (amount < 1)
            {
                UserChat("Must thrall 1 or more characters.");
                return;
            }

            var thrallArea    = new Rectangle();
            var useThrallArea = false;

            // When standing on top of something, also spawn the NPCs on the thing the User is standing on,
            // and spread them out a bit on it without exceeding the size of it
            var userStandingOn = User.StandingOn;

            if (userStandingOn != null)
            {
                useThrallArea = true;

                var minX = userStandingOn.Position.X;
                var maxX = userStandingOn.Max.X;
                var y    = userStandingOn.Position.Y;

                minX = Math.Max(minX, User.Position.X - 96);
                maxX = Math.Min(maxX, User.Position.X + 96);

                thrallArea = new Rectangle(minX, y, maxX - minX + 1, 1);
            }

            for (var i = 0; i < amount; i++)
            {
                // Create a ThralledNPC and add it to the world
                var npc = new ThralledNPC(World, charTemplate, User.Map, User.Position);

                // When using the thrallArea, move the NPC to the correct area
                if (useThrallArea)
                {
                    var npcSize = npc.Size;
                    var minX    = thrallArea.Left;
                    var maxX    = thrallArea.Right - (int)npcSize.X;
                    int x;

                    if (maxX <= minX)
                    {
                        x = minX;
                    }
                    else
                    {
                        x = RandomHelper.NextInt(minX, maxX);
                    }

                    var y = thrallArea.Y - (int)npc.Size.Y;
                    npc.Position = new Vector2(x, y);
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsNpcKillUserTable"/> class.
 /// </summary>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="mapID">The initial value for the corresponding property.</param>
 /// <param name="nPCTemplateID">The initial value for the corresponding property.</param>
 /// <param name="npcX">The initial value for the corresponding property.</param>
 /// <param name="npcY">The initial value for the corresponding property.</param>
 /// <param name="userID">The initial value for the corresponding property.</param>
 /// <param name="userLevel">The initial value for the corresponding property.</param>
 /// <param name="userX">The initial value for the corresponding property.</param>
 /// <param name="userY">The initial value for the corresponding property.</param>
 /// <param name="when">The initial value for the corresponding property.</param>
 public WorldStatsNpcKillUserTable(UInt32 @iD, MapID? @mapID, CharacterTemplateID? @nPCTemplateID, UInt16 @npcX,
                                   UInt16 @npcY, CharacterID @userID, Byte @userLevel, UInt16 @userX, UInt16 @userY,
                                   DateTime @when)
 {
     ID = @iD;
     MapID = @mapID;
     NPCTemplateID = @nPCTemplateID;
     NpcX = @npcX;
     NpcY = @npcY;
     UserID = @userID;
     UserLevel = @userLevel;
     UserX = @userX;
     UserY = @userY;
     When = @when;
 }
 public void Execute(QuestID questID, CharacterTemplateID reqCharID, ushort amount)
 {
     Execute(new QuestRequireKillTable(amount, reqCharID, questID));
 }
예제 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateSkillTable"/> class.
 /// </summary>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="skillID">The initial value for the corresponding property.</param>
 public CharacterTemplateSkillTable(CharacterTemplateID @characterTemplateID, SkillType @skillID)
 {
     CharacterTemplateID = @characterTemplateID;
     SkillID             = @skillID;
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnValues"/> class.
 /// </summary>
 /// <param name="dbController">The IDbController used to synchronize changes to the values.</param>
 /// <param name="mapID">The index of the Map that these values are for.</param>
 /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param>
 public MapSpawnValues(IDbController dbController, MapID mapID, CharacterTemplateID characterTemplateID)
     : this(dbController, GetFreeID(dbController), mapID, characterTemplateID, 1, new MapSpawnRect(null, null, null, null))
 {
     DbController.GetQuery<InsertMapSpawnQuery>().Execute(this);
 }
 /// <summary>
 /// Executes the query on the database using the specified parameters.
 /// </summary>
 /// <param name="characterID">The character ID.</param>
 /// <param name="questID">The quest ID.</param>
 /// <param name="characterTemplateID">The character template ID.</param>
 /// <param name="count">The count.</param>
 public void Execute(CharacterID characterID, QuestID questID, CharacterTemplateID characterTemplateID, ushort count)
 {
     Execute(new QueryArgs(characterID, questID, characterTemplateID, count));
 }
예제 #20
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);
 }
예제 #21
0
        /// <summary>
        /// Provides the extra text for the <see cref="AdvancedPropertyDescriptor"/> for a
        /// <see cref="CharacterTemplateID"/>.
        /// </summary>
        /// <param name="v">The value.</param>
        /// <returns>The extra text to display.</returns>
        static string ExtraTextProvider_CharacterTemplateID(CharacterTemplateID v)
        {
            var character = CharacterTemplateManager.Instance[v];
            if (character == null || character.TemplateTable == null)
                return null;

            return character.TemplateTable.Name;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateInventoryTable"/> class.
 /// </summary>
 /// <param name="chance">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="itemTemplateID">The initial value for the corresponding property.</param>
 /// <param name="max">The initial value for the corresponding property.</param>
 /// <param name="min">The initial value for the corresponding property.</param>
 public CharacterTemplateInventoryTable(ItemChance @chance, CharacterTemplateID @characterTemplateID, Int32 @iD,
                                        ItemTemplateID @itemTemplateID, Byte @max, Byte @min)
 {
     Chance = @chance;
     CharacterTemplateID = @characterTemplateID;
     ID = @iD;
     ItemTemplateID = @itemTemplateID;
     Max = @max;
     Min = @min;
 }
예제 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QuestRequireKillTable"/> class.
 /// </summary>
 /// <param name="amount">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="questID">The initial value for the corresponding property.</param>
 public QuestRequireKillTable(UInt16 @amount, CharacterTemplateID @characterTemplateID, QuestID @questID)
 {
     Amount = @amount;
     CharacterTemplateID = @characterTemplateID;
     QuestID = @questID;
 }
예제 #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QuestRequireKillTable"/> class.
 /// </summary>
 /// <param name="amount">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="questID">The initial value for the corresponding property.</param>
 public QuestRequireKillTable(UInt16 @amount, CharacterTemplateID @characterTemplateID, QuestID @questID)
 {
     Amount = @amount;
     CharacterTemplateID = @characterTemplateID;
     QuestID             = @questID;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsCountNpcKillUserTable"/> class.
 /// </summary>
 /// <param name="count">The initial value for the corresponding property.</param>
 /// <param name="lastUpdate">The initial value for the corresponding property.</param>
 /// <param name="nPCTemplateID">The initial value for the corresponding property.</param>
 /// <param name="userID">The initial value for the corresponding property.</param>
 public WorldStatsCountNpcKillUserTable(Int32 @count, DateTime @lastUpdate, CharacterTemplateID @nPCTemplateID,
                                        CharacterID @userID)
 {
     Count = @count;
     LastUpdate = @lastUpdate;
     NPCTemplateID = @nPCTemplateID;
     UserID = @userID;
 }
예제 #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnTable"/> class.
 /// </summary>
 /// <param name="amount">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="height">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="mapID">The initial value for the corresponding property.</param>
 /// <param name="width">The initial value for the corresponding property.</param>
 /// <param name="x">The initial value for the corresponding property.</param>
 /// <param name="y">The initial value for the corresponding property.</param>
 public MapSpawnTable(Byte @amount, CharacterTemplateID @characterTemplateID, ushort? @height, MapSpawnValuesID @iD,
                      MapID @mapID, ushort? @width, ushort? @x, ushort? @y)
 {
     Amount = @amount;
     CharacterTemplateID = @characterTemplateID;
     Height = @height;
     ID = @iD;
     MapID = @mapID;
     Width = @width;
     X = @x;
     Y = @y;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateQuestProviderTable"/> class.
 /// </summary>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="questID">The initial value for the corresponding property.</param>
 public CharacterTemplateQuestProviderTable(CharacterTemplateID @characterTemplateID, QuestID @questID)
 {
     CharacterTemplateID = @characterTemplateID;
     QuestID             = @questID;
 }
예제 #28
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;
 }
        public void Thrall(CharacterTemplateID id, int amount)
        {
            var charTemplate = CharacterTemplateManager.Instance[id];
            if (charTemplate == null)
            {
                UserChat("Invalid character template `{0}`.", id);
                return;
            }

            if (amount < 1)
            {
                UserChat("Must thrall 1 or more characters.");
                return;
            }

            var thrallArea = new Rectangle();
            var useThrallArea = false;

            // When standing on top of something, also spawn the NPCs on the thing the User is standing on,
            // and spread them out a bit on it without exceeding the size of it
            var userStandingOn = User.StandingOn;
            if (userStandingOn != null)
            {
                useThrallArea = true;

                var minX = userStandingOn.Position.X;
                var maxX = userStandingOn.Max.X;
                var y = userStandingOn.Position.Y;

                minX = Math.Max(minX, User.Position.X - 96);
                maxX = Math.Min(maxX, User.Position.X + 96);

                thrallArea = new Rectangle((int)minX, (int)y, (int)(maxX - minX + 1), 1);
            }

            for (var i = 0; i < amount; i++)
            {
                // Create a ThralledNPC and add it to the world
                var npc = new ThralledNPC(World, charTemplate, User.Map, User.Position);

                // When using the thrallArea, move the NPC to the correct area
                if (useThrallArea)
                {
                    var npcSize = npc.Size;
                    var minX = thrallArea.Left;
                    var maxX = thrallArea.Right - (int)npcSize.X;
                    int x;

                    if (maxX <= minX)
                        x = minX;
                    else
                        x = RandomHelper.NextInt(minX, maxX);

                    var y = thrallArea.Y - (int)npc.Size.Y;
                    npc.Position = new Vector2(x, y);
                }
            }
        }
예제 #30
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventCountersNpcTable"/> class.
 /// </summary>
 /// <param name="counter">The initial value for the corresponding property.</param>
 /// <param name="nPCEventCounterID">The initial value for the corresponding property.</param>
 /// <param name="nPCTemplateID">The initial value for the corresponding property.</param>
 public EventCountersNpcTable(Int64 @counter, Byte @nPCEventCounterID, CharacterTemplateID @nPCTemplateID)
 {
     Counter           = @counter;
     NPCEventCounterID = @nPCEventCounterID;
     NPCTemplateID     = @nPCTemplateID;
 }
예제 #31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateSkillTable"/> class.
 /// </summary>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="skillID">The initial value for the corresponding property.</param>
 public CharacterTemplateSkillTable(CharacterTemplateID @characterTemplateID, SkillType @skillID)
 {
     CharacterTemplateID = @characterTemplateID;
     SkillID = @skillID;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateEquippedTable"/> class.
 /// </summary>
 /// <param name="chance">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="iD">The initial value for the corresponding property.</param>
 /// <param name="itemTemplateID">The initial value for the corresponding property.</param>
 public CharacterTemplateEquippedTable(ItemChance @chance, CharacterTemplateID @characterTemplateID, Int32 @iD,
                                       ItemTemplateID @itemTemplateID)
 {
     Chance = @chance;
     CharacterTemplateID = @characterTemplateID;
     ID = @iD;
     ItemTemplateID = @itemTemplateID;
 }
예제 #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapSpawnValues"/> class.
 /// </summary>
 /// <param name="dbController">The IDbController used to synchronize changes to the values.</param>
 /// <param name="mapID">The index of the Map that these values are for.</param>
 /// <param name="characterTemplateID">The CharacterTemplateID of the CharacterTemplate to spawn.</param>
 public MapSpawnValues(IDbController dbController, MapID mapID, CharacterTemplateID characterTemplateID)
     : this(dbController, GetFreeID(dbController), mapID, characterTemplateID, 1, new MapSpawnRect(null, null, null, null))
 {
     DbController.GetQuery <InsertMapSpawnQuery>().Execute(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterQuestStatusKillsTable"/> class.
 /// </summary>
 /// <param name="characterID">The initial value for the corresponding property.</param>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="count">The initial value for the corresponding property.</param>
 /// <param name="questID">The initial value for the corresponding property.</param>
 public CharacterQuestStatusKillsTable(CharacterID @characterID, CharacterTemplateID @characterTemplateID, UInt16 @count,
                                       QuestID @questID)
 {
     CharacterID = @characterID;
     CharacterTemplateID = @characterTemplateID;
     Count = @count;
     QuestID = @questID;
 }
예제 #35
0
 /// <summary>
 /// Gets a <see cref="ICharacterTemplateEquippedTable"/> from this struct.
 /// </summary>
 /// <param name="charID">The <see cref="CharacterTemplateID"/>.</param>
 /// <param name="rowID">The database table row ID.</param>
 /// <returns>The <see cref="ICharacterTemplateEquippedTable"/></returns>
 public ICharacterTemplateEquippedTable ToTableRow(CharacterTemplateID charID, int rowID)
 {
     return(new CharacterTemplateEquippedTable(iD: rowID, chance: Chance, characterTemplateID: charID, itemTemplateID: ID));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateQuestProviderTable"/> class.
 /// </summary>
 /// <param name="characterTemplateID">The initial value for the corresponding property.</param>
 /// <param name="questID">The initial value for the corresponding property.</param>
 public CharacterTemplateQuestProviderTable(CharacterTemplateID @characterTemplateID, QuestID @questID)
 {
     CharacterTemplateID = @characterTemplateID;
     QuestID = @questID;
 }
예제 #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventCountersNpcTable"/> class.
 /// </summary>
 /// <param name="counter">The initial value for the corresponding property.</param>
 /// <param name="nPCEventCounterID">The initial value for the corresponding property.</param>
 /// <param name="nPCTemplateID">The initial value for the corresponding property.</param>
 public EventCountersNpcTable(Int64 @counter, Byte @nPCEventCounterID, CharacterTemplateID @nPCTemplateID)
 {
     Counter = @counter;
     NPCEventCounterID = @nPCEventCounterID;
     NPCTemplateID = @nPCTemplateID;
 }
예제 #38
0
 /// <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);
 }
 /// <summary>
 /// Gets a <see cref="ICharacterTemplateInventoryTable"/> from this struct.
 /// </summary>
 /// <param name="charID">The <see cref="CharacterTemplateID"/>.</param>
 /// <param name="rowID">The database table row ID.</param>
 /// <returns>The <see cref="ICharacterTemplateInventoryTable"/></returns>
 public ICharacterTemplateInventoryTable ToTableRow(CharacterTemplateID charID, int rowID)
 {
     return(new CharacterTemplateInventoryTable(iD: rowID, chance: Chance, characterTemplateID: charID, itemTemplateID: ID,
                                                min: (byte)Min, max: (byte)Max));
 }