Beispiel #1
0
        public void AttuneItem(Character ch)                                   // called when an item meets its attuneType requirement
        {
            if (ch != null && (ch.IsPC || ch is Adventurer) && !ch.IsImmortal) // work around to take items that will attune and then attach them to an email, or give them to someone
            {
                this.attuneType = Globals.eAttuneType.None;
                this.attunedID  = ch.UniqueID;
                this.coinValue  = 0; // drop the coin value to 0

                if (ch.IsPC && ch.PCState == Globals.ePlayerState.PLAYING)
                {
                    Utils.Log(ch.GetLogString() + " attuned to " + this.GetLogString() + ".", Utils.LogType.ItemAttuned);
                    ch.WriteToDisplay("You feel a tingling sensation.");
                }
            }
            else if (ch != null && ch.IsImmortal)
            {
                ch.WriteToDisplay("The " + this.name + " did not attune to you because your immortal flag is set to true.");

                if (this.attuneType == Globals.eAttuneType.Slain)
                {
                    ch.WriteToDisplay("The " + this.notes + " attune type is being changed to allow a player to take it.");
                    this.attuneType = Globals.eAttuneType.Take;
                }
            }
        }
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
        public void AttuneItem(int playerID, string comment) // generally called from the code
        {
            this.attuneType = Globals.eAttuneType.None;
            this.attunedID  = playerID;
            this.coinValue  = 0;

            if (comment == null)
            {
                comment = "None.";
            }

            PC pc = PC.GetPC(playerID);

            if (pc != null)
            {
                Utils.Log(PC.GetPC(playerID).GetLogString() + " attuned to " + this.GetLogString() + ". Comment: " + comment, Utils.LogType.ItemAttuned);
            }
        }
Beispiel #5
0
        public void AttuneItemSilently(Character ch)
        {
            if (ch != null && ch is PC && !ch.IsImmortal) // work around to take items that will attune and then attach them to an email, or give them to someone
            {
                this.attuneType = Globals.eAttuneType.None;
                this.attunedID  = ch.UniqueID;
                this.coinValue  = 0; // drop the coin value to 0
                Utils.Log(ch.GetLogString() + " silently attuned to " + this.GetLogString() + ".", Utils.LogType.ItemAttuned);
            }
            else if (ch != null && ch.IsImmortal)
            {
                ch.WriteToDisplay("The " + this.name + " did not attune to you because your immortal flag is set to true.");

                if (this.attuneType == Globals.eAttuneType.Slain)
                {
                    ch.WriteToDisplay("The " + this.notes + " attune type is being changed to allow a player to take it.");
                    this.attuneType = Globals.eAttuneType.Take;
                }
            }
        }