public bool OnCommand(Character chr, string args)
        {
            if (String.IsNullOrEmpty(args))
            {
                chr.WriteToDisplay("impgiveskillxp <skillType> <amount> <target>");
            }
            else
            {
                try
                {
                    string[] sArgs = args.Split(" ".ToCharArray());

                    int amount = Convert.ToInt32(sArgs[1]);

                    Character target = null;

                    Globals.eSkillType skillType = Globals.eSkillType.None;
                    Enum.TryParse <Globals.eSkillType>(sArgs[0], true, out skillType);

                    if (skillType == Globals.eSkillType.None)
                    {
                        chr.WriteToDisplay("Check skill type value. Remember to use underscores for spaces.");
                        return(false);
                    }

                    foreach (PC pc in Character.PCInGameWorld)
                    {
                        if (pc.Name.ToLower() == sArgs[2].ToLower())
                        {
                            target = pc;
                        }
                    }

                    if (target != null && target.Name != "Nobody")
                    {
                        Skills.GiveSkillExp(target, amount, skillType);
                    }
                    else if (target == null)
                    {
                        target = GameSystems.Targeting.TargetAquisition.FindTargetInView(chr, sArgs[2], false, true);

                        if (target != null)
                        {
                            Skills.GiveSkillExp(target, amount, skillType);
                        }
                        else
                        {
                            chr.WriteToDisplay("Could not find target: " + sArgs[2] + ".");
                        }
                    }
                }
                catch (Exception e)
                {
                    Utils.LogException(e);
                }
            }

            return(true);
        }
Beispiel #2
0
 public Item(System.Data.DataRow dr)
 {
     this.UniqueID         = World.GetNextWorldItemID();
     this.catalogID        = Convert.ToInt32(dr["catalogID"]);
     this.notes            = dr["notes"].ToString();
     this.combatAdds       = Convert.ToInt32(dr["combatAdds"]);
     this.itemID           = Convert.ToInt32(dr["itemID"]);
     this.itemType         = (Globals.eItemType)Enum.Parse(typeof(Globals.eItemType), dr["itemType"].ToString());
     this.baseType         = (Globals.eItemBaseType)Enum.Parse(typeof(Globals.eItemBaseType), dr["baseType"].ToString());
     this.name             = dr["name"].ToString();
     this.visualKey        = dr["visualKey"].ToString();
     this.unidentifiedName = dr["unidentifiedName"].ToString();
     this.identifiedName   = dr["identifiedName"].ToString();
     this.shortDesc        = dr["shortDesc"].ToString();
     this.longDesc         = dr["longDesc"].ToString();
     this.wearLocation     = (Globals.eWearLocation)Enum.Parse(typeof(Globals.eWearLocation), dr["wearLocation"].ToString());
     this.weight           = Convert.ToDouble(dr["weight"]);
     this.coinValue        = Convert.ToInt32(dr["coinValue"]);
     this.size             = (Globals.eItemSize)Enum.Parse(typeof(Globals.eItemSize), dr["size"].ToString());
     this.effectType       = dr["effectType"].ToString();
     this.effectAmount     = dr["effectAmount"].ToString();
     this.effectDuration   = dr["effectDuration"].ToString();
     this.special          = dr["special"].ToString();
     this.minDamage        = Convert.ToInt32(dr["minDamage"]);
     this.maxDamage        = Convert.ToInt32(dr["maxDamage"]);
     this.skillType        = (Globals.eSkillType)Enum.Parse(typeof(Globals.eSkillType), dr["skillType"].ToString());
     this.vRandLow         = Convert.ToInt32(dr["vRandLow"]);
     this.vRandHigh        = Convert.ToInt32(dr["vRandHigh"]);
     this.key        = dr["key"].ToString();
     this.isRecall   = Convert.ToBoolean(dr["recall"]);
     this.alignment  = (Globals.eAlignment)Enum.Parse(typeof(Globals.eAlignment), dr["alignment"].ToString());
     this.spell      = Convert.ToInt16(dr["spell"]);
     this.spellPower = Convert.ToInt16(dr["spellPower"]);
     this.charges    = Convert.ToInt16(dr["charges"]);
     try
     {
         this.attackType = (Globals.eAttackType)Enum.Parse(typeof(Globals.eAttackType), dr["attackType"].ToString());
     }
     catch { this.attackType = Globals.eAttackType.None; }
     this.blueglow   = Convert.ToBoolean(dr["blueglow"]);
     this.flammable  = Convert.ToBoolean(dr["flammable"]);
     this.fragile    = Convert.ToBoolean(dr["fragile"]);
     this.lightning  = Convert.ToBoolean(dr["lightning"]);
     this.returning  = Convert.ToBoolean(dr["returning"]);
     this.silver     = Convert.ToBoolean(dr["silver"]);
     this.attuneType = (Globals.eAttuneType)Enum.Parse(typeof(Globals.eAttuneType), dr["attuneType"].ToString());
     this.figExp     = Convert.ToInt32(dr["figExp"]);
     this.armorClass = Convert.ToDouble(dr["armorClass"]);
     this.armorType  = (Globals.eArmorType)Enum.Parse(typeof(Globals.eArmorType), dr["armorType"].ToString());
     this.lootTable  = dr["lootTable"].ToString();
 }
Beispiel #3
0
 public Item(Item item) : base()
 {
     //TODO iterate through variables in Reflection and set them that way
     this.catalogID        = item.catalogID;
     this.UniqueID         = World.GetNextWorldItemID();
     this.notes            = item.notes;
     this.combatAdds       = item.combatAdds;
     this.itemID           = item.itemID;
     this.itemType         = item.itemType;
     this.baseType         = item.baseType;
     this.name             = item.name;
     this.unidentifiedName = item.unidentifiedName;
     this.identifiedName   = item.identifiedName;
     this.identifiedList   = item.identifiedList;
     this.shortDesc        = item.shortDesc;
     this.longDesc         = item.longDesc;
     this.visualKey        = item.visualKey;
     this.wearLocation     = item.wearLocation;
     this.weight           = item.weight;
     this.coinValue        = item.coinValue;
     this.size             = item.size;
     this.effectType       = item.effectType;
     this.effectAmount     = item.effectAmount;
     this.effectDuration   = item.effectDuration;
     this.special          = item.special;
     this.minDamage        = item.minDamage;
     this.maxDamage        = item.maxDamage;
     this.skillType        = item.skillType;
     this.vRandLow         = item.vRandLow;
     this.vRandHigh        = item.vRandHigh;
     this.key        = item.key;
     this.isRecall   = item.isRecall;
     this.alignment  = item.alignment;
     this.spell      = item.spell;
     this.spellPower = item.spellPower;
     this.charges    = item.charges;
     this.attackType = item.attackType;
     this.blueglow   = item.blueglow;
     this.flammable  = item.flammable;
     this.fragile    = item.fragile;
     this.lightning  = item.lightning;
     this.returning  = item.returning;
     this.silver     = item.silver;
     this.attuneType = item.attuneType;
     this.figExp     = item.figExp;
     this.armorClass = item.armorClass;
     this.armorType  = item.armorType;
     this.lootTable  = item.lootTable;
 }
Beispiel #4
0
 /// <summary>
 /// Current mechanics are rather simple. Roll d100, if result is less than or equal to (skill level of Weapon) PLUS (experience level of Character) = success.
 /// </summary>
 /// <returns></returns>
 public bool WeaponPassFailCheck(Character chr, Globals.eSkillType skillType)
 {
     return(Rules.RollD(1, 100) <= (Skills.GetSkillLevel(chr, skillType) + chr.Level));
 }