Example #1
0
        private void RemovePerkFeat(Data.Entity.Perk perk)
        {
            if (perk.FeatID == null || perk.FeatID <= 0)
            {
                return;
            }

            _nwnxCreature.RemoveFeat(GetPC(), (int)perk.FeatID);
        }
Example #2
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_OPPORTUNIST);
 }
Example #3
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, (int)CustomFeatType.Provoke);
 }
Example #4
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_ZEN_ARCHERY);
 }
 private void RemoveAllFeats(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_BASTARD_SWORD);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_BATTLE_AXE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_CLUB);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_DAGGER);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_DART);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_DIRE_MACE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_DOUBLE_AXE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_DWAXE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_GREAT_AXE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_GREAT_SWORD);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_HALBERD);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_HAND_AXE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_HEAVY_CROSSBOW);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_HEAVY_FLAIL);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_KAMA);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_KATANA);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_KUKRI);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_LIGHT_CROSSBOW);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_LIGHT_FLAIL);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_LIGHT_HAMMER);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_LIGHT_MACE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_LONGBOW);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_LONG_SWORD);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_MORNING_STAR);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_RAPIER);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SCIMITAR);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SCYTHE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SHORTBOW);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SHORT_SWORD);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SHURIKEN);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SICKLE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SLING);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_SPEAR);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_STAFF);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_THROWING_AXE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_TRIDENT);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_TWO_BLADED_SWORD);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_UNARMED_STRIKE);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_WAR_HAMMER);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_CRITICAL_WHIP);
 }
Example #6
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_CALLED_SHOT);
 }
Example #7
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_DODGE);
 }
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_WEAPON_FINESSE);
 }
Example #9
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_POWER_ATTACK);
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_IMPROVED_POWER_ATTACK);
 }
Example #10
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_POINT_BLANK_SHOT);
 }
Example #11
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_DEFLECT_ARROWS);
 }
Example #12
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_CLEAVE);
 }
Example #13
0
        public void InitializePlayer(NWPlayer player)
        {
            if (player == null)
            {
                throw new ArgumentNullException(nameof(player));
            }
            if (player.Object == null)
            {
                throw new ArgumentNullException(nameof(player.Object));
            }
            if (!player.IsPlayer)
            {
                return;
            }

            if (!player.IsInitializedAsPlayer)
            {
                player.DestroyAllInventoryItems();
                player.InitializePlayer();
                _.AssignCommand(player.Object, () => _.TakeGoldFromCreature(_.GetGold(player.Object), player.Object, 1));

                player.DelayCommand(() =>
                {
                    _.GiveGoldToCreature(player.Object, 100);
                }, 0.5f);


                NWItem knife = NWItem.Wrap(_.CreateItemOnObject("survival_knife", player.Object));
                knife.Name          = player.Name + "'s Survival Knife";
                knife.IsCursed      = true;
                knife.MaxDurability = 5;
                knife.Durability    = 5;

                NWItem darts = NWItem.Wrap(_.CreateItemOnObject("nw_wthdt001", player.Object, 50)); // 50x Dart
                darts.Name     = "Starting Darts";
                darts.IsCursed = true;

                NWItem book = NWItem.Wrap(_.CreateItemOnObject("player_guide", player.Object));
                book.Name     = player.Name + "'s Player Guide";
                book.IsCursed = true;

                NWItem dyeKit = NWItem.Wrap(_.CreateItemOnObject("tk_omnidye", player.Object));
                dyeKit.IsCursed = true;

                int numberOfFeats = _nwnxCreature.GetFeatCount(player);
                for (int currentFeat = numberOfFeats; currentFeat >= 0; currentFeat--)
                {
                    _nwnxCreature.RemoveFeat(player, _nwnxCreature.GetFeatByIndex(player, currentFeat - 1));
                }

                _nwnxCreature.SetClassByPosition(player, 0, CLASS_TYPE_FIGHTER);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_LIGHT, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_MEDIUM, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_HEAVY, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_SHIELD_PROFICIENCY, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_EXOTIC, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_MARTIAL, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_SIMPLE, 1);
                _nwnxCreature.AddFeatByLevel(player, (int)CustomFeatType.StructureTool, 1);
                _nwnxCreature.AddFeatByLevel(player, (int)CustomFeatType.OpenRestMenu, 1);

                for (int iCurSkill = 1; iCurSkill <= 27; iCurSkill++)
                {
                    _nwnxCreature.SetSkillRank(player, iCurSkill - 1, 0);
                }
                _.SetFortitudeSavingThrow(player.Object, 0);
                _.SetReflexSavingThrow(player.Object, 0);
                _.SetWillSavingThrow(player.Object, 0);

                int classID = _.GetClassByPosition(1, player.Object);

                for (int index = 0; index <= 255; index++)
                {
                    _nwnxCreature.RemoveKnownSpell(player, classID, 0, index);
                }

                PlayerCharacter entity = player.ToEntity();
                _db.PlayerCharacters.Add(entity);
                _db.SaveChanges();

                _db.StoredProcedure("InsertAllPCSkillsByID",
                                    new SqlParameter("PlayerID", player.GlobalID));

                _skill.ApplyStatChanges(player, null, true);

                _.DelayCommand(1.0f, () => _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(999), player.Object));

                InitializeHotBar(player);
            }
        }
Example #14
0
        public void InitializePlayer(NWPlayer player)
        {
            if (player == null)
            {
                throw new ArgumentNullException(nameof(player));
            }
            if (player.Object == null)
            {
                throw new ArgumentNullException(nameof(player.Object));
            }
            if (!player.IsPlayer)
            {
                return;
            }

            // Player is initialized but not in the DB. Wipe the tag and rerun them through initialization - something went wrong before.
            if (player.IsInitializedAsPlayer)
            {
                if (_data.GetAll <Player>().SingleOrDefault(x => x.ID == player.GlobalID) == null)
                {
                    _.SetTag(player, string.Empty);
                }
            }

            if (!player.IsInitializedAsPlayer)
            {
                player.DestroyAllInventoryItems();
                player.InitializePlayer();
                _.AssignCommand(player, () => _.TakeGoldFromCreature(_.GetGold(player), player, 1));

                _.DelayCommand(0.5f, () =>
                {
                    _.GiveGoldToCreature(player, 100);
                });

                // Capture original stats before we level up the player.
                int str  = _nwnxCreature.GetRawAbilityScore(player, ABILITY_STRENGTH);
                int con  = _nwnxCreature.GetRawAbilityScore(player, ABILITY_CONSTITUTION);
                int dex  = _nwnxCreature.GetRawAbilityScore(player, ABILITY_DEXTERITY);
                int @int = _nwnxCreature.GetRawAbilityScore(player, ABILITY_INTELLIGENCE);
                int wis  = _nwnxCreature.GetRawAbilityScore(player, ABILITY_WISDOM);
                int cha  = _nwnxCreature.GetRawAbilityScore(player, ABILITY_CHARISMA);

                // Take player to level 5 in NWN levels so that we have access to more HP slots
                _.GiveXPToCreature(player, 10000);

                for (int level = 1; level <= 5; level++)
                {
                    _.LevelUpHenchman(player, player.Class1);
                }

                // Set stats back to how they were on entry.
                _nwnxCreature.SetRawAbilityScore(player, ABILITY_STRENGTH, str);
                _nwnxCreature.SetRawAbilityScore(player, ABILITY_CONSTITUTION, con);
                _nwnxCreature.SetRawAbilityScore(player, ABILITY_DEXTERITY, dex);
                _nwnxCreature.SetRawAbilityScore(player, ABILITY_INTELLIGENCE, @int);
                _nwnxCreature.SetRawAbilityScore(player, ABILITY_WISDOM, wis);
                _nwnxCreature.SetRawAbilityScore(player, ABILITY_CHARISMA, cha);

                NWItem knife = (_.CreateItemOnObject("survival_knife", player));
                knife.Name     = player.Name + "'s Survival Knife";
                knife.IsCursed = true;
                _durability.SetMaxDurability(knife, 5);
                _durability.SetDurability(knife, 5);

                NWItem book = (_.CreateItemOnObject("player_guide", player));
                book.Name     = player.Name + "'s Player Guide";
                book.IsCursed = true;

                NWItem dyeKit = (_.CreateItemOnObject("tk_omnidye", player));
                dyeKit.IsCursed = true;

                int numberOfFeats = _nwnxCreature.GetFeatCount(player);
                for (int currentFeat = numberOfFeats; currentFeat >= 0; currentFeat--)
                {
                    _nwnxCreature.RemoveFeat(player, _nwnxCreature.GetFeatByIndex(player, currentFeat - 1));
                }

                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_LIGHT, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_MEDIUM, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_HEAVY, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_SHIELD_PROFICIENCY, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_EXOTIC, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_MARTIAL, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_SIMPLE, 1);
                _nwnxCreature.AddFeatByLevel(player, (int)CustomFeatType.StructureManagementTool, 1);
                _nwnxCreature.AddFeatByLevel(player, (int)CustomFeatType.OpenRestMenu, 1);
                _nwnxCreature.AddFeatByLevel(player, (int)CustomFeatType.RenameCraftedItem, 1);
                _nwnxCreature.AddFeatByLevel(player, (int)CustomFeatType.ChatCommandTargeter, 1);

                for (int iCurSkill = 1; iCurSkill <= 27; iCurSkill++)
                {
                    _nwnxCreature.SetSkillRank(player, iCurSkill - 1, 0);
                }
                _.SetFortitudeSavingThrow(player, 0);
                _.SetReflexSavingThrow(player, 0);
                _.SetWillSavingThrow(player, 0);

                int classID = _.GetClassByPosition(1, player);

                for (int index = 0; index <= 255; index++)
                {
                    _nwnxCreature.RemoveKnownSpell(player, classID, 0, index);
                }

                Player entity = CreateDBPCEntity(player);
                _data.SubmitDataChange(entity, DatabaseActionType.Insert);

                var skills = _data.GetAll <Skill>();
                foreach (var skill in skills)
                {
                    var pcSkill = new PCSkill
                    {
                        IsLocked = false,
                        SkillID  = skill.ID,
                        PlayerID = entity.ID,
                        Rank     = 0,
                        XP       = 0
                    };

                    _data.SubmitDataChange(pcSkill, DatabaseActionType.Insert);
                }

                _race.ApplyDefaultAppearance(player);
                _nwnxCreature.SetAlignmentLawChaos(player, 50);
                _nwnxCreature.SetAlignmentGoodEvil(player, 50);
                _background.ApplyBackgroundBonuses(player);

                _stat.ApplyStatChanges(player, null, true);
                _language.InitializePlayerLanguages(player);

                _.DelayCommand(1.0f, () => _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(999), player));

                InitializeHotBar(player);
            }
        }
Example #15
0
        private void RemoveAllFeats(NWPlayer oPC)
        {
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_BASTARD_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_BATTLE_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_CLUB);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_DAGGER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_DART);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_DIRE_MACE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_DOUBLE_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_DWAXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_GREAT_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_GREAT_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_HALBERD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_HAND_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_HEAVY_CROSSBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_HEAVY_FLAIL);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_KAMA);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_KATANA);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_KUKRI);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_LIGHT_CROSSBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_LIGHT_FLAIL);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_LIGHT_HAMMER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_LIGHT_MACE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_LONGBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_LONG_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_MORNING_STAR);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_RAPIER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SCIMITAR);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SCYTHE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SHORTBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SHORT_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SHURIKEN);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SICKLE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SLING);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_SPEAR);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_STAFF);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_THROWING_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_TRIDENT);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_TWO_BLADED_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_UNARMED_STRIKE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_WAR_HAMMER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_FOCUS_WHIP);


            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_BASTARD_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_BATTLE_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_CLUB);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_DAGGER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_DART);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_DIRE_MACE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_DOUBLE_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_DWAXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_GREAT_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_GREAT_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_HALBERD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_HAND_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_HEAVY_CROSSBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_HEAVY_FLAIL);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_KAMA);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_KATANA);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_KUKRI);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_LIGHT_CROSSBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_LIGHT_FLAIL);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_LIGHT_HAMMER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_LIGHT_MACE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_LONGBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_LONG_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_MORNING_STAR);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_RAPIER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SCIMITAR);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SCYTHE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SHORTBOW);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SHORT_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SHURIKEN);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SICKLE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SLING);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_SPEAR);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_STAFF);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_THROWING_AXE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_TRIDENT);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_TWO_BLADED_SWORD);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_UNARMED_STRIKE);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_WAR_HAMMER);
            _nwnxCreature.RemoveFeat(oPC, FEAT_WEAPON_SPECIALIZATION_WHIP);
        }
Example #16
0
 private void RemoveFeats(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_TWO_WEAPON_FIGHTING);
     _nwnxCreature.RemoveFeat(oPC, FEAT_AMBIDEXTERITY);
     _nwnxCreature.RemoveFeat(oPC, FEAT_IMPROVED_TWO_WEAPON_FIGHTING);
 }
Example #17
0
        public void InitializePlayer(NWPlayer player)
        {
            if (player == null)
            {
                throw new ArgumentNullException(nameof(player));
            }
            if (player.Object == null)
            {
                throw new ArgumentNullException(nameof(player.Object));
            }

            if (!player.IsPlayer)
            {
                return;
            }

            if (!player.IsInitializedAsPlayer)
            {
                player.DestroyAllInventoryItems();
                player.InitializePlayer();

                _.CreateItemOnObject("open_rest_menu", player.Object);
                _.AssignCommand(player.Object, () => _.TakeGoldFromCreature(_.GetGold(player.Object), player.Object, 1));

                NWItem knife = NWItem.Wrap(_.CreateItemOnObject("survival_knife", player.Object));
                knife.Name          = player.Name + "'s Survival Knife";
                knife.IsCursed      = true;
                knife.MaxDurability = 5;
                knife.Durability    = 5;

                NWItem hammer = NWItem.Wrap(_.CreateItemOnObject("basic_hammer", player.Object));
                hammer.Name          = player.Name + "'s Hammer";
                hammer.IsCursed      = true;
                hammer.MaxDurability = 5;
                hammer.Durability    = 5;

                NWItem darts = NWItem.Wrap(_.CreateItemOnObject("nw_wthdt001", player.Object, 50)); // 50x Dart
                darts.Name     = "Starting Darts";
                darts.IsCursed = true;

                NWItem book = NWItem.Wrap(_.CreateItemOnObject("player_guide", player.Object));
                book.Name     = player.Name + "'s Player Guide";
                book.IsCursed = true;

                NWItem dyeKit = NWItem.Wrap(_.CreateItemOnObject("tk_omnidye", player.Object));
                dyeKit.IsCursed = true;

                NWItem shovel = NWItem.Wrap(_.CreateItemOnObject("basic_shovel", player.Object));
                shovel.Name     = player.Name + "'s Shovel";
                shovel.IsCursed = true;

                int numberOfFeats = _nwnxCreature.GetFeatCount(player);
                for (int currentFeat = numberOfFeats; currentFeat >= 0; currentFeat--)
                {
                    _nwnxCreature.RemoveFeat(player, _nwnxCreature.GetFeatByIndex(player, currentFeat - 1));
                }

                _nwnxCreature.SetClassByPosition(player, 0, CLASS_TYPE_FIGHTER);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_LIGHT, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_MEDIUM, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_ARMOR_PROFICIENCY_HEAVY, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_SHIELD_PROFICIENCY, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_EXOTIC, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_MARTIAL, 1);
                _nwnxCreature.AddFeatByLevel(player, FEAT_WEAPON_PROFICIENCY_SIMPLE, 1);

                for (int iCurSkill = 1; iCurSkill <= 27; iCurSkill++)
                {
                    _nwnxCreature.SetSkillRank(player, iCurSkill - 1, 0);
                }
                _.SetFortitudeSavingThrow(player.Object, 0);
                _.SetReflexSavingThrow(player.Object, 0);
                _.SetWillSavingThrow(player.Object, 0);

                int classID = _.GetClassByPosition(1, player.Object);

                for (int index = 0; index <= 255; index++)
                {
                    _nwnxCreature.RemoveKnownSpell(player, classID, 0, index);
                }

                using (DataContext context = new DataContext())
                {
                    PlayerCharacter entity = player.ToEntity();
                    context.PlayerCharacters.Add(entity);
                    context.SaveChanges();
                }

                _skill.ApplyStatChanges(player, null);

                _.DelayCommand(1000, () => _.ApplyEffectToObject(DURATION_TYPE_INSTANT, _.EffectHeal(999), player.Object));

                InitializeHotBar(player);
            }
        }
Example #18
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_CIRCLE_KICK);
 }
Example #19
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, NWScript.FEAT_RAPID_RELOAD);
 }
Example #20
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_EXPERTISE);
 }
Example #21
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_RAPID_SHOT);
 }
Example #22
0
 public void OnRemoved(NWPlayer oPC)
 {
     _nwnxCreature.RemoveFeat(oPC, FEAT_MOBILITY);
 }