コード例 #1
0
 void changeHeadSprite(Helmet helmet)
 {
     if(helmet.disablesBaseHead)
         headsr.enabled = false;
     sr.enabled = true;
     sr.sprite = helmet.getSprite();
 }
コード例 #2
0
    public void removeHelmet()
    {
        if(isPrimarySlotOccupied()){

            primaryHelmet.transform.parent = null;
            primaryHelmet.disablePassive();
            primaryHelmet.enableSprite();
            primaryHelmet.drop(owner.getCollider());
            removeHelmetSprite();
            primaryHelmet = null;
        }
    }
コード例 #3
0
 public void attachHelmet(Helmet helmet)
 {
     if(isPrimarySlotOccupied()){
         removeHelmet();
     }
     primaryHelmet = helmet;
     helmet.enablePassive();
     changeHeadSprite(helmet);
     helmet.disableSprite();
     helmet.pickUp(owner);
     helmet.transform.position = this.transform.position;
     helmet.transform.SetParent(this.transform);
     Debug.Log("Primary helmet sucessfully picked up!");
 }
コード例 #4
0
ファイル: ItemsInventory.cs プロジェクト: OskarCC/ES2014A-1
	public static Helmet getHelmet(int id){
		
		Helmet helmet = new Helmet ();
		helmet.id = ItemsInventory.helmet_list [id].id;
		helmet.name = ItemsInventory.helmet_list [id].name;
		helmet.type = ItemsInventory.helmet_list [id].type;
		helmet.VIT = ItemsInventory.helmet_list [id].VIT;
		helmet.PM = ItemsInventory.helmet_list [id].PM;
		helmet.FRZ = ItemsInventory.helmet_list [id].FRZ;
		helmet.DEF = ItemsInventory.helmet_list [id].DEF;
		helmet.SPD = ItemsInventory.helmet_list [id].SPD;
		helmet.ItemTexture = ItemsInventory.helmet_list [id].ItemTexture;
		helmet.width = ItemsInventory.helmet_list [id].width;
		helmet.height = ItemsInventory.helmet_list [id].height;
		
		return helmet;
	}
コード例 #5
0
ファイル: GetItem.cs プロジェクト: OskarCC/ES2014A-1
	public static Helmet setHelmet(int id, string name, string type, int VIT, int PM, int FRZ,
	                               int DEF, int SPD, string icon_name, int slot_x, int slot_y){
		
		Helmet helmet = new Helmet ();
		helmet.id = id;
		helmet.name = name;
		helmet.type = type;
		helmet.VIT = VIT;
		helmet.PM = PM;
		helmet.FRZ = FRZ;
		helmet.DEF = DEF;
		helmet.SPD = SPD;
		helmet.ItemTexture = Resources.Load<Texture2D>("Inventory/"+type+"/"+icon_name);
		helmet.width = slot_x;
		helmet.height = slot_y;
		
		return helmet;
		
	}
コード例 #6
0
ファイル: EquipWeapons.cs プロジェクト: OskarCC/ES2014A-1
	public static void removeHelmet(Item i){
		
		if(h != null){
			if(i.id == h.id){
				cs.setDEF(-h.DEF);
				cs.setVIT(-h.VIT);
				cs.setPM(-h.PM);
				h = null;
			}
		}
	}
コード例 #7
0
ファイル: EquipWeapons.cs プロジェクト: OskarCC/ES2014A-1
	public static void setHelmet(Helmet helmet){
		
		if(h == null){
			h = helmet;
			cs.setDEF(helmet.DEF);
			cs.setVIT(helmet.VIT);
			cs.setPM(helmet.PM);
		}else{
			cs.setDEF(-helmet.DEF);
			cs.setVIT(-helmet.VIT);
			cs.setPM(-helmet.PM);
			h = helmet;
			cs.setDEF(helmet.DEF);
			cs.setVIT(helmet.VIT);
			cs.setPM(helmet.PM);
		}
		//s.transform.rotation = Quaternion.Euler(new Vector3(20, 160, 0));
	}
コード例 #8
0
 void pickUpHelmet(Helmet helmet)
 {
     helmetSlot.attachHelmet(helmet);
 }
コード例 #9
0
        public List<BaseItem> GetAllItemsInBag(byte bag, int characterId)
        {
            DbParameter bagIdParameter = _db.CreateParameter(DbNames.GETALLITEMSBYBAGID_BAGID_PARAMETER, bag);
            bagIdParameter.DbType = DbType.Byte;

            DbParameter characterIdParameter = _db.CreateParameter(DbNames.GETALLITEMSBYBAGID_CHARACTERID_PARAMETER, characterId);
            characterIdParameter.DbType = DbType.Int32;

            List<BaseItem> items = new List<BaseItem>();

            _db.Open();

            DbDataReader reader = _db.ExcecuteReader(DbNames.GETALLITEMSBYBAGID_STOREDPROC, CommandType.StoredProcedure, bagIdParameter, characterIdParameter);

            int ordinalITEM_ITEMID = reader.GetOrdinal(DbNames.ITEM_ITEMID);
            int ordinalITEM_OWNERID = reader.GetOrdinal(DbNames.ITEM_OWNERID);
            int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFERENCEID);
            int ordinalITEM_BTYPE = reader.GetOrdinal(DbNames.ITEM_BTYPE);
            int ordinalITEM_BKIND = reader.GetOrdinal(DbNames.ITEM_BKIND);
            int ordinalITEM_VISUALID = reader.GetOrdinal(DbNames.ITEM_VISUALID);
            int ordinalITEM_COST = reader.GetOrdinal(DbNames.ITEM_COST);
            int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS);
            int ordinalITEM_AMOUNT = reader.GetOrdinal(DbNames.ITEM_AMOUNT);
            int ordinalITEM_LEVEL = reader.GetOrdinal(DbNames.ITEM_LEVEL);
            int ordinalITEM_DEX = reader.GetOrdinal(DbNames.ITEM_DEX);
            int ordinalITEM_STR = reader.GetOrdinal(DbNames.ITEM_STR);
            int ordinalITEM_STA = reader.GetOrdinal(DbNames.ITEM_STA);
            int ordinalITEM_ENE = reader.GetOrdinal(DbNames.ITEM_ENE);
            int ordinalITEM_MAXIMBUES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES);
            int ordinalITEM_MAXDURA = reader.GetOrdinal(DbNames.ITEM_MAXDURA);
            int ordinalITEM_CURDURA = reader.GetOrdinal(DbNames.ITEM_CURDURA);
            int ordinalITEM_DAMAGE = reader.GetOrdinal(DbNames.ITEM_DAMAGE);
            int ordinalITEM_DEFENCE = reader.GetOrdinal(DbNames.ITEM_DEFENCE);
            int ordinalITEM_ATTACKRATING = reader.GetOrdinal(DbNames.ITEM_ATTACKRATING);
            int ordinalITEM_ATTACKSPEED = reader.GetOrdinal(DbNames.ITEM_ATTACKSPEED);
            int ordinalITEM_ATTACKRANGE = reader.GetOrdinal(DbNames.ITEM_ATTACKRANGE);
            int ordinalITEM_INCMAXLIFE = reader.GetOrdinal(DbNames.ITEM_INCMAXLIFE);
            int ordinalITEM_INCMAXMANA = reader.GetOrdinal(DbNames.ITEM_INCMAXMANA);
            int ordinalITEM_LIFEREGEN = reader.GetOrdinal(DbNames.ITEM_LIFEREGEN);
            int ordinalITEM_MANAREGEN = reader.GetOrdinal(DbNames.ITEM_MANAREGEN);
            int ordinalITEM_CRITICAL = reader.GetOrdinal(DbNames.ITEM_CRITICAL);
            int ordinalITEM_PLUS = reader.GetOrdinal(DbNames.ITEM_PLUS);
            int ordinalITEM_SLVL = reader.GetOrdinal(DbNames.ITEM_SLVL);
            int ordinalITEM_IMBUETRIES = reader.GetOrdinal(DbNames.ITEM_IMBUETRIES);
            int ordinalITEM_DRAGONSUCCESSIMBUETRIES = reader.GetOrdinal(DbNames.ITEM_DRAGONSUCCESSIMBUETRIES);
            int ordinalITEM_DISCOUNTREPAIRFEE = reader.GetOrdinal(DbNames.ITEM_DISCOUNTREPAIRFEE);
            int ordinalITEM_TOTALDRAGONIMBUES = reader.GetOrdinal(DbNames.ITEM_TOTALDRAGONIMBUES);
            int ordinalITEM_DRAGONDAMAGE = reader.GetOrdinal(DbNames.ITEM_DRAGONDAMAGE);
            int ordinalITEM_DRAGONDEFENCE = reader.GetOrdinal(DbNames.ITEM_DRAGONDEFENCE);
            int ordinalITEM_DRAGONATTACKRATING = reader.GetOrdinal(DbNames.ITEM_DRAGONATTACKRATING);
            int ordinalITEM_DRAGONLIFE = reader.GetOrdinal(DbNames.ITEM_DRAGONLIFE);
            int ordinalITEM_MAPPEDSTUFF = reader.GetOrdinal(DbNames.ITEM_MAPPEDSTUFF);
            int ordinalITEM_FORCENUMBER = reader.GetOrdinal(DbNames.ITEM_FORCENUMBER);
            int ordinalITEM_REBIRTHHOLE = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLE);
            int ordinalITEM_REBIRTHHOLESTAT = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLESTAT);
            int ordinalITEM_TOMAPID = reader.GetOrdinal(DbNames.ITEM_TOMAPID);
            int ordinalITEM_IMBUERATE = reader.GetOrdinal(DbNames.ITEM_IMBUERATE);
            int ordinalITEM_IMBUEINCREASE = reader.GetOrdinal(DbNames.ITEM_IMBUEINCREASE);
            int ordinalITEM_IMBUEDATA = reader.GetOrdinal(DbNames.ITEM_IMBUEDATA);
            int ordinalITEM_BOOKSKILLID = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLID);
            int ordinalITEM_BOOKSKILLLEVEL = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLLEVEL);
            int ordinalITEM_BOOKSKILLDATA = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLDATA);
            int ordinalITEM_MAXPOLISHTRIES = reader.GetOrdinal(DbNames.ITEM_MAXPOLISHTRIES);
            int ordinalITEM_POLISHTRIES = reader.GetOrdinal(DbNames.ITEM_POLISHTRIES);
            int ordinalITEM_VIGISTAT1 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT1);
            int ordinalITEM_VIGISTAT2 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT2);
            int ordinalITEM_VIGISTAT3 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT3);
            int ordinalITEM_VIGISTAT4 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT4);
            int ordinalITEM_VIGISTATADD1 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD1);
            int ordinalITEM_VIGISTATADD2 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD2);
            int ordinalITEM_VIGISTATADD3 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD3);
            int ordinalITEM_VIGISTATADD4 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD4);
            int ordinalITEM_PETID = reader.GetOrdinal(DbNames.ITEM_PETID);
            int ordinalITEM_DAMAGEABSORB = reader.GetOrdinal(DbNames.ITEM_DAMAGEABSORB);
            int ordinalITEM_DEFENSEABSORB = reader.GetOrdinal(DbNames.ITEM_DEFENSEABSORB);
            int ordinalITEM_ATTACKRATINGABSORB = reader.GetOrdinal(DbNames.ITEM_ATTACKRATINGABSORB);
            int ordinalITEM_LIFEABSORB = reader.GetOrdinal(DbNames.ITEM_LIFEABSORB);
            int ordinalITEM_BAG = reader.GetOrdinal(DbNames.ITEM_BAG);
            int ordinalITEM_SLOT = reader.GetOrdinal(DbNames.ITEM_SLOT);
            int ordinalITEM_SIZEX = reader.GetOrdinal(DbNames.ITEM_SIZEX);
            int ordinalITEM_SIZEY = reader.GetOrdinal(DbNames.ITEM_SIZEY);

            while (reader.Read())
            {
                BaseItem b = null;

                int BType = reader.GetByte(ordinalITEM_BTYPE);
                int BKind = reader.GetByte(ordinalITEM_BKIND);

                if (BType == (byte)bType.Weapon || BType == (byte)bType.Clothes || BType == (byte)bType.Hat || BType == (byte)bType.Necklace
                    || BType == (byte)bType.Ring || BType == (byte)bType.Shoes || BType == (byte)bType.Cape || BType == (byte)bType.Mirror)
                {

                    if (BKind == (byte)bKindWeapons.Sword && BType == (byte)bType.Weapon)
                    {
                        b = new Sword();
                    }
                    if (BKind == (byte)bKindWeapons.Blade && BType == (byte)bType.Weapon)
                    {
                        b = new Blade();
                    }
                    if (BKind == (byte)bKindWeapons.Fan && BType == (byte)bType.Weapon)
                    {
                        b = new Fan();
                    }
                    if (BKind == (byte)bKindWeapons.Brush && BType == (byte)bType.Weapon)
                    {
                        b = new Brush();
                    }
                    if (BKind == (byte)bKindWeapons.Claw && BType == (byte)bType.Weapon)
                    {
                        b = new Claw();
                    }
                    if (BKind == (byte)bKindWeapons.Axe && BType == (byte)bType.Weapon)
                    {
                        b = new Axe();
                    }
                    if (BKind == (byte)bKindWeapons.Talon && BType == (byte)bType.Weapon)
                    {
                        b = new Talon();
                    }
                    if (BKind == (byte)bKindWeapons.Tonfa && BType == (byte)bType.Weapon)
                    {
                        b = new Tonfa();
                    }
                    if (BKind == (byte)bKindArmors.SwordMan && BType == (byte)bType.Clothes)
                    {
                        b = new Clothes();
                    }
                    if (BKind == (byte)bKindArmors.Mage && BType == (byte)bType.Clothes)
                    {
                        b = new Dress();
                    }
                    if (BKind == (byte)bKindArmors.Warrior && BType == (byte)bType.Clothes)
                    {
                        b = new Armor();
                    }
                    if (BKind == (byte)bKindArmors.GhostFighter && BType == (byte)bType.Clothes)
                    {
                        b = new LeatherClothes();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Hat)
                    {
                        b = new Hood();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Hat)
                    {
                        b = new Tiara();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Hat)
                    {
                        b = new Helmet();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Hat)
                    {
                        b = new Hat();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Shoes)
                    {
                        b = new SmBoots();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Shoes)
                    {
                        b = new MageBoots();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Shoes)
                    {
                        b = new WarriorShoes();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Shoes)
                    {
                        b = new GhostFighterShoes();
                    }
                    if (BKind == 0 && BType == (byte)bType.Ring)
                    {
                        b = new Ring();
                    }
                    if (BKind == 0 && BType == (byte)bType.Necklace)
                    {
                        b = new Necklace();
                    }
                    if (BType == (byte)bType.Cape)
                    {
                        b = new Cape();
                        Cape c = b as Cape;
                        c.MaxPolishImbueTries = reader.GetInt16(ordinalITEM_MAXPOLISHTRIES);
                        c.PolishImbueTries = reader.GetByte(ordinalITEM_POLISHTRIES);
                        c.VigiStat1 = reader.GetInt16(ordinalITEM_VIGISTAT1);
                        c.VigiStatAdd1 = reader.GetInt16(ordinalITEM_VIGISTATADD1);
                        c.VigiStat2 = reader.GetInt16(ordinalITEM_VIGISTAT2);
                        c.VigiStatAdd2 = reader.GetInt16(ordinalITEM_VIGISTATADD2);
                        c.VigiStat3 = reader.GetInt16(ordinalITEM_VIGISTAT3);
                        c.VigiStatAdd3 = reader.GetInt16(ordinalITEM_VIGISTATADD3);
                        c.VigiStat4 = reader.GetInt16(ordinalITEM_VIGISTAT4);
                        c.VigiStatAdd4 = reader.GetInt16(ordinalITEM_VIGISTATADD4);
                    }
                    if (BType == (byte)bType.Mirror)
                    {
                        // bkind 4 = mirror, 0 = jar
                        b = new Mirror();
                        Mirror m = b as Mirror;

                        m.PetID = reader.GetInt32(ordinalITEM_PETID);
                        m.LifeAbsorb = reader.GetInt16(ordinalITEM_LIFEABSORB);
                        m.DamageAbsorb = reader.GetInt16(ordinalITEM_DAMAGEABSORB);
                        m.DefenseAbsorb = reader.GetInt16(ordinalITEM_DEFENSEABSORB);
                        m.AttackRatingAbsorb = reader.GetInt16(ordinalITEM_ATTACKRATINGABSORB);
                    }

                    Equipment e = b as Equipment;
                    e.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    e.RequiredDexterity = reader.GetInt16(ordinalITEM_DEX);
                    e.RequiredStrength = reader.GetInt16(ordinalITEM_STR);
                    e.RequiredStamina = reader.GetInt16(ordinalITEM_STA);
                    e.RequiredEnergy = reader.GetInt16(ordinalITEM_ENE);
                    e.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUES);
                    e.Durability = reader.GetInt16(ordinalITEM_CURDURA);
                    e.MaxDurability = reader.GetInt16(ordinalITEM_MAXDURA);
                    e.Damage = reader.GetInt32(ordinalITEM_DAMAGE);
                    e.Defence = reader.GetInt32(ordinalITEM_DEFENCE);
                    e.AttackRating = reader.GetInt32(ordinalITEM_ATTACKRATING);
                    e.AttackSpeed = reader.GetInt16(ordinalITEM_ATTACKSPEED);
                    e.AttackRange = reader.GetInt16(ordinalITEM_ATTACKRANGE);
                    e.IncMaxLife = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    e.IncMaxMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                    e.IncLifeRegen = reader.GetInt16(ordinalITEM_LIFEREGEN);
                    e.IncManaRegen = reader.GetInt16(ordinalITEM_MANAREGEN);
                    e.Critical = reader.GetInt16(ordinalITEM_CRITICAL);
                    e.Plus = reader.GetByte(ordinalITEM_PLUS);
                    e.Slvl = reader.GetByte(ordinalITEM_SLVL);
                    e.ImbueTries = reader.GetByte(ordinalITEM_IMBUETRIES);
                    e.DragonSuccessImbueTries = reader.GetInt16(ordinalITEM_DRAGONSUCCESSIMBUETRIES);
                    e.DiscountRepairFee = reader.GetByte(ordinalITEM_DISCOUNTREPAIRFEE);
                    e.TotalDragonImbueTries = reader.GetInt16(ordinalITEM_TOTALDRAGONIMBUES);
                    e.DragonDamage = reader.GetInt32(ordinalITEM_DRAGONDAMAGE);
                    e.DragonDefence = reader.GetInt32(ordinalITEM_DRAGONDEFENCE);
                    e.DragonAttackRating = reader.GetInt32(ordinalITEM_DRAGONATTACKRATING);
                    e.DragonLife = reader.GetInt16(ordinalITEM_DRAGONLIFE);
                    e.MappedData = reader.GetByte(ordinalITEM_MAPPEDSTUFF);
                    e.ForceSlot = reader.GetByte(ordinalITEM_FORCENUMBER);
                    e.RebirthHole = reader.GetInt16(ordinalITEM_REBIRTHHOLE);
                    e.RebirthHoleStat = reader.GetInt16(ordinalITEM_REBIRTHHOLESTAT);
                }

                if (BType == (byte)bType.ImbueItem)
                {
                    if (BKind == (byte)bKindStones.Black)
                    {
                        b = new Black();
                    }
                    if (BKind == (byte)bKindStones.White)
                    {
                        b = new White();
                    }
                    if (BKind == (byte)bKindStones.Red)
                    {
                        b = new Red();
                    }
                    if (BKind == (byte)bKindStones.Dragon)
                    {
                        b = new Dragon();
                    }
                    if (BKind == (byte)bKindStones.RbItem)
                    {
                        b = new RbHoleItem();
                    }

                    ImbueItem im = b as ImbueItem;
                    im.ImbueChance = reader.GetInt16(ordinalITEM_IMBUERATE);
                    im.IncreaseValue = reader.GetInt16(ordinalITEM_IMBUEINCREASE);
                    im.ImbueData = reader.GetByte(ordinalITEM_IMBUEDATA);
                }

                if (BType == (byte)bType.Potion)
                {
                    if (BKind == (byte)bKindPotions.Normal)
                    {
                        b = new Potion();
                    }
                    if (BKind == (byte)bKindPotions.Elixir)
                    {
                        b = new Elixir();
                    }

                    PotionItem pot = b as PotionItem;
                    pot.HealHp = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    pot.HealMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                }
                if (BType == (byte)bType.Book)
                {
                    if (BKind == (byte)bKindBooks.SoftBook)
                    {
                        b = new SoftBook();
                    }
                    if (BKind == (byte)bKindBooks.HardBook)
                    {
                        b = new HardBook();
                    }
                    if (BKind == (byte)bKindBooks.RebirdBook)
                    {
                        b = new RebirthBook();
                    }
                    if (BKind == (byte)bKindBooks.FourthBook)
                    {
                        b = new FourthBook();
                    }
                    if (BKind == (byte)bKindBooks.FeSkillBook)
                    {
                        b = new FeSkillBook();
                    }
                    if (BKind == (byte)bKindBooks.FeBook)
                    {
                        b = new FiveElementBook();
                    }
                    if (BKind == (byte)bKindBooks.FocusBook)
                    {
                        b = new FocusBook();
                    }

                    BookItem book = b as BookItem;
                    book.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                    book.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    book.SkillID = reader.GetInt32(ordinalITEM_BOOKSKILLID);
                    book.SkillLevel = reader.GetByte(ordinalITEM_BOOKSKILLLEVEL);
                    book.SkillData = reader.GetInt32(ordinalITEM_BOOKSKILLDATA);
                }
                if (BType == (byte)bType.Bead)
                {
                    if (BKind == (byte)bKindBeads.Normal)
                    {
                        b = new Bead();
                    }
                    BeadItem bead = b as BeadItem;
                    bead.ToMapID = reader.GetInt32(ordinalITEM_TOMAPID);
                }
                if (BType == (byte)bType.StoreTag)
                {
                    b = new StoreTag();

                    StoreTag tag = b as StoreTag;
                    tag.TimeLeft = reader.GetInt16(ordinalITEM_CURDURA);
                    tag.TimeMax = reader.GetInt16(ordinalITEM_MAXDURA);
                }
                if (BType == (byte)bType.PetItem)
                {
                    if (BKind == (byte)bKindPetItems.Taming)
                        b = new TameItem();
                    if (BKind == (byte)bKindPetItems.Food)
                        b = new PetFood();
                    if (BKind == (byte)bKindPetItems.Potion)
                        b = new PetPotion();
                    if (BKind == (byte)bKindPetItems.Resurect)
                        b = new PetResurrectItem();

                    PetItem p = b as PetItem;
                    p.TameChance = reader.GetInt16(ordinalITEM_IMBUERATE);
                    p.DecreaseWildness = reader.GetInt16(ordinalITEM_IMBUEINCREASE);
                    p.HealLife = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                }
                if (BType == (byte)bType.Pill)
                {
                    if (BKind == (byte)bKindPills.Rebirth)
                        b = new RebirthPill();

                    RebirthPill p = b as RebirthPill;
                    p.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    p.RequiredRebirth = reader.GetByte(ordinalITEM_CLASS);
                    p.ToRebirth = (byte)(p.RequiredRebirth + 1);
                    p.IncreaseSp = reader.GetInt16(ordinalITEM_DEX);
                }

                b.ItemID = reader.GetInt32(ordinalITEM_ITEMID);
                b.OwnerID = reader.GetInt32(ordinalITEM_OWNERID);
                b.ReferenceID = reader.GetInt16(ordinalITEM_REFERENCEID);
                b.VisualID = reader.GetInt16(ordinalITEM_VISUALID);
                b.Bag = reader.GetByte(ordinalITEM_BAG);
                b.Slot = reader.GetByte(ordinalITEM_SLOT);
                b.bType = reader.GetByte(ordinalITEM_BTYPE);
                b.bKind = reader.GetByte(ordinalITEM_BKIND);
                b.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                b.Amount = reader.GetInt16(ordinalITEM_AMOUNT);
                b.SizeX = reader.GetByte(ordinalITEM_SIZEX);
                b.SizeY = reader.GetByte(ordinalITEM_SIZEY);
                b.Price = reader.GetInt32(ordinalITEM_COST);

                items.Add(b);
            }

            reader.Close();
            _db.Close();

            return items;
        }
コード例 #10
0
        private static void FillHeroProperties(WorldOfSoftUniRPG.Models.User currentUser)
        {
            Field.Hero.Attack     = currentUser.Hero.Attack;
            Field.Hero.Defence    = currentUser.Hero.Deffence;
            Field.Hero.Experience = currentUser.Hero.Experience;
            Field.Hero.Gold       = currentUser.Hero.Gold;
            Field.Hero.Health     = currentUser.Hero.Health;
            Field.Hero.Kills      = currentUser.Hero.Kills;
            Field.Hero.Level      = currentUser.Hero.Level;
            var items = currentUser.Hero.Inventory.Items;

            foreach (var item in items)
            {
                switch (item.Part)
                {
                case "Sword":
                    IItem sword = new Sword()
                    {
                        ItemType = (ItemType)Enum.Parse(typeof(ItemType), item.ItemType, true)
                    };
                    Field.Hero.Inventory.Items.Add(sword);
                    break;

                case "Helmet":
                    IItem helmet = new Helmet()
                    {
                        ItemType = (ItemType)Enum.Parse(typeof(ItemType), item.ItemType, true)
                    };
                    Field.Hero.Inventory.Items.Add(helmet);
                    break;

                case "Belt":
                    IItem belt = new Belt()
                    {
                        ItemType = (ItemType)Enum.Parse(typeof(ItemType), item.ItemType, true)
                    };
                    Field.Hero.Inventory.Items.Add(belt);
                    break;

                case "Boots":
                    IItem boots = new Boots()
                    {
                        ItemType = (ItemType)Enum.Parse(typeof(ItemType), item.ItemType, true)
                    };
                    Field.Hero.Inventory.Items.Add(boots);
                    break;

                case "Chest":
                    IItem chest = new Chest()
                    {
                        ItemType = (ItemType)Enum.Parse(typeof(ItemType), item.ItemType, true)
                    };
                    Field.Hero.Inventory.Items.Add(chest);
                    break;

                case "Pants":
                    IItem pants = new Pants()
                    {
                        ItemType = (ItemType)Enum.Parse(typeof(ItemType), item.ItemType, true)
                    };
                    Field.Hero.Inventory.Items.Add(pants);
                    break;
                }
            }
        }
コード例 #11
0
 public void ChangeCh(Face face, HandL handL, HandR handR, Helmet helmet, Mask mask, Dress dress, ShoesAll shoes)
 {
     CharacterSetChange(face, handL, handR, helmet, mask, dress, shoes);
 }
コード例 #12
0
ファイル: NpcManager.cs プロジェクト: zarut/xiah-gcf-emulator
        public List<BaseItem> GetAllItemsInNpcBag(byte bag, int npcId)
        {
            DbParameter bagIdParameter = _db.CreateParameter(DbNames.GETALLNPCITEMSBYBAGID_BAGID_PARAMETER, bag);
            bagIdParameter.DbType = DbType.Byte;

            DbParameter characterIdParameter = _db.CreateParameter(DbNames.GETALLNPCITEMSBYBAGID_NPCID_PARAMETER, npcId);
            characterIdParameter.DbType = DbType.Int32;

            List<BaseItem> items = new List<BaseItem>();

            _db.Open();

            DbDataReader reader = _db.ExcecuteReader(DbNames.GETALLNPCITEMSBYBAGID_STOREDPROC, CommandType.StoredProcedure, bagIdParameter, characterIdParameter);

            int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFID);
            int ordinalITEM_BTYPE = reader.GetOrdinal(DbNames.ITEM_BTYPE);
            int ordinalITEM_BKIND = reader.GetOrdinal(DbNames.ITEM_BKIND);
            int ordinalITEM_VISUALID = reader.GetOrdinal(DbNames.ITEM_VISUALID);
            int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS);
            int ordinalITEM_AMOUNT = reader.GetOrdinal(DbNames.ITEM_AMOUNT);
            int ordinalITEM_PRICE = reader.GetOrdinal(DbNames.ITEM_PRICE);
            int ordinalITEM_LEVEL = reader.GetOrdinal(DbNames.ITEM_LEVEL);
            int ordinalITEM_DEX = reader.GetOrdinal(DbNames.ITEM_DEX);
            int ordinalITEM_STR = reader.GetOrdinal(DbNames.ITEM_STR);
            int ordinalITEM_STA = reader.GetOrdinal(DbNames.ITEM_STA);
            int ordinalITEM_ENE = reader.GetOrdinal(DbNames.ITEM_ENE);
            int ordinalITEM_DURABILITY = reader.GetOrdinal(DbNames.ITEM_DURABILITY);
            int ordinalITEM_DAMAGE = reader.GetOrdinal(DbNames.ITEM_DAMAGE);
            int ordinalITEM_DEFENCE = reader.GetOrdinal(DbNames.ITEM_DEFENCE);
            int ordinalITEM_ATTACKRATING = reader.GetOrdinal(DbNames.ITEM_ATTACKRATING);
            int ordinalITEM_ATTACKSPEED = reader.GetOrdinal(DbNames.ITEM_ATTACKSPEED);
            int ordinalITEM_ATTACKRANGE = reader.GetOrdinal(DbNames.ITEM_ATTACKRANGE);
            int ordinalITEM_INCMAXLIFE = reader.GetOrdinal(DbNames.ITEM_INCMAXLIFE);
            int ordinalITEM_INCMAXMANA = reader.GetOrdinal(DbNames.ITEM_INCMAXMANA);
            int ordinalITEM_LIFEREGEN = reader.GetOrdinal(DbNames.ITEM_LIFEREGEN);
            int ordinalITEM_MANAREGEN = reader.GetOrdinal(DbNames.ITEM_MANAREGEN);
            int ordinalITEM_CRITICAL = reader.GetOrdinal(DbNames.ITEM_CRITICAL);
            int ordinalITEM_TOMAPID = reader.GetOrdinal(DbNames.ITEM_TOMAPID);
            int ordinalITEM_IMBUERATE = reader.GetOrdinal(DbNames.ITEM_IMBUERATE);
            int ordinalITEM_IMBUEINCREASE = reader.GetOrdinal(DbNames.ITEM_IMBUEINCREASE);
            int ordinalITEM_BOOKSKILLID = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLID);
            int ordinalITEM_BOOKSKILLLEVEL = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLLEVEL);
            int ordinalITEM_BOOKSKILLDATA = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLDATA);
            int ordinalITEM_MAXPOLISHTRIES = reader.GetOrdinal(DbNames.ITEM_MAXPOLISHTRIES);
            int ordinalITEM_MAXIMBUETRIES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES);
            int ordinalITEM_BAG = reader.GetOrdinal(DbNames.ITEM_BAG);
            int ordinalITEM_SLOT = reader.GetOrdinal(DbNames.ITEM_SLOT);
            int ordinalITEM_SIZEX = reader.GetOrdinal(DbNames.ITEM_SIZEX);
            int ordinalITEM_SIZEY = reader.GetOrdinal(DbNames.ITEM_SIZEY);

            while (reader.Read())
            {
                BaseItem b = null;

                int BType = reader.GetByte(ordinalITEM_BTYPE);
                int BKind = reader.GetByte(ordinalITEM_BKIND);

                if (BType == (byte)bType.Weapon || BType == (byte)bType.Clothes || BType == (byte)bType.Hat || BType == (byte)bType.Necklace
                    || BType == (byte)bType.Ring || BType == (byte)bType.Shoes || BType == (byte)bType.Cape)
                {

                    if (BKind == (byte)bKindWeapons.Sword && BType == (byte)bType.Weapon)
                    {
                        b = new Sword();
                    }
                    if (BKind == (byte)bKindWeapons.Blade && BType == (byte)bType.Weapon)
                    {
                        b = new Blade();
                    }
                    if (BKind == (byte)bKindWeapons.Fan && BType == (byte)bType.Weapon)
                    {
                        b = new Fan();
                    }
                    if (BKind == (byte)bKindWeapons.Brush && BType == (byte)bType.Weapon)
                    {
                        b = new Brush();
                    }
                    if (BKind == (byte)bKindWeapons.Claw && BType == (byte)bType.Weapon)
                    {
                        b = new Claw();
                    }
                    if (BKind == (byte)bKindWeapons.Axe && BType == (byte)bType.Weapon)
                    {
                        b = new Axe();
                    }
                    if (BKind == (byte)bKindWeapons.Talon && BType == (byte)bType.Weapon)
                    {
                        b = new Talon();
                    }
                    if (BKind == (byte)bKindWeapons.Tonfa && BType == (byte)bType.Weapon)
                    {
                        b = new Tonfa();
                    }
                    if(BKind == (byte)bKindWeapons.Hammer && BType == (byte)bType.Weapon)
                    {
                        b = new Hammer();
                    }
                    if (BKind == (byte)bKindArmors.SwordMan && BType == (byte)bType.Clothes)
                    {
                        b = new Clothes();
                    }
                    if (BKind == (byte)bKindArmors.Mage && BType == (byte)bType.Clothes)
                    {
                        b = new Dress();
                    }
                    if (BKind == (byte)bKindArmors.Warrior && BType == (byte)bType.Clothes)
                    {
                        b = new Armor();
                    }
                    if (BKind == (byte)bKindArmors.GhostFighter && BType == (byte)bType.Clothes)
                    {
                        b = new LeatherClothes();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Hat)
                    {
                        b = new Hood();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Hat)
                    {
                        b = new Tiara();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Hat)
                    {
                        b = new Helmet();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Hat)
                    {
                        b = new Hat();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Shoes)
                    {
                        b = new SmBoots();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Shoes)
                    {
                        b = new MageBoots();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Shoes)
                    {
                        b = new WarriorShoes();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Shoes)
                    {
                        b = new GhostFighterShoes();
                    }
                    if (BKind == 0 && BType == (byte)bType.Ring)
                    {
                        b = new Ring();
                    }
                    if (BKind == 0 && BType == (byte)bType.Necklace)
                    {
                        b = new Necklace();
                    }
                    if (BType == (byte)bType.Cape)
                    {
                        b = new Cape();
                        Cape c = b as Cape;
                        c.MaxPolishImbueTries = reader.GetInt16(ordinalITEM_MAXPOLISHTRIES);
                    }

                    Equipment e = b as Equipment;
                    e.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    e.RequiredDexterity = reader.GetInt16(ordinalITEM_DEX);
                    e.RequiredStrength = reader.GetInt16(ordinalITEM_STR);
                    e.RequiredStamina = reader.GetInt16(ordinalITEM_STA);
                    e.RequiredEnergy = reader.GetInt16(ordinalITEM_ENE);
                    e.Durability = reader.GetInt32(ordinalITEM_DURABILITY);
                    e.MaxDurability = e.Durability;
                    e.Damage = reader.GetInt16(ordinalITEM_DAMAGE);
                    e.Defence = reader.GetInt16(ordinalITEM_DEFENCE);
                    e.AttackRating = reader.GetInt16(ordinalITEM_ATTACKRATING);
                    e.AttackSpeed = reader.GetInt16(ordinalITEM_ATTACKSPEED);
                    e.AttackRange = reader.GetInt16(ordinalITEM_ATTACKRANGE);
                    e.IncMaxLife = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    e.IncMaxMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                    e.IncLifeRegen = reader.GetInt16(ordinalITEM_LIFEREGEN);
                    e.IncManaRegen = reader.GetInt16(ordinalITEM_MANAREGEN);
                    e.Critical = reader.GetInt16(ordinalITEM_CRITICAL);
                    e.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUETRIES);
                }

                if (BType == (byte)bType.ImbueItem)
                {
                    if (BKind == (byte)bKindStones.Black)
                    {
                        b = new Black();
                    }
                    if (BKind == (byte)bKindStones.White)
                    {
                        b = new White();
                    }
                    if (BKind == (byte)bKindStones.Red)
                    {
                        b = new Red();
                    }
                    if (BKind == (byte)bKindStones.Dragon)
                    {
                        b = new Dragon();
                    }

                    ImbueItem im = b as ImbueItem;
                    im.ImbueChance = reader.GetInt16(ordinalITEM_IMBUERATE);
                    im.IncreaseValue = reader.GetInt16(ordinalITEM_IMBUEINCREASE);
                }

                if (BType == (byte)bType.Potion)
                {
                    if (BKind == (byte)bKindPotions.Normal)
                    {
                        b = new Potion();
                    }
                    if (BKind == (byte)bKindPotions.Elixir)
                    {
                        b = new Elixir();
                    }

                    PotionItem pot = b as PotionItem;
                    pot.HealHp = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    pot.HealMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                }
                if (BType == (byte)bType.Book)
                {
                    if (BKind == (byte)bKindBooks.SoftBook)
                    {
                        b = new SoftBook();
                    }
                    if (BKind == (byte)bKindBooks.HardBook)
                    {
                        b = new HardBook();
                    }

                    BookItem book = b as BookItem;
                    book.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                    book.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    book.SkillID = reader.GetInt32(ordinalITEM_BOOKSKILLID);
                    book.SkillLevel = reader.GetByte(ordinalITEM_BOOKSKILLLEVEL);
                    book.SkillData = reader.GetInt32(ordinalITEM_BOOKSKILLDATA);
                }
                if (BType == (byte)bType.Bead)
                {
                    if (BKind == (byte)bKindBeads.Normal)
                    {
                        b = new Bead();
                    }
                    BeadItem bead = b as BeadItem;
                    bead.ToMapID = reader.GetInt32(ordinalITEM_TOMAPID);
                }

                b.ReferenceID = reader.GetInt16(ordinalITEM_REFERENCEID);
                b.VisualID = reader.GetInt16(ordinalITEM_VISUALID);
                b.Bag = reader.GetByte(ordinalITEM_BAG);
                b.Slot = reader.GetByte(ordinalITEM_SLOT);
                b.bType = reader.GetByte(ordinalITEM_BTYPE);
                b.bKind = reader.GetByte(ordinalITEM_BKIND);
                b.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                b.Amount = reader.GetInt16(ordinalITEM_AMOUNT);
                b.SizeX = reader.GetByte(ordinalITEM_SIZEX);
                b.SizeY = reader.GetByte(ordinalITEM_SIZEY);
                b.Price = reader.GetInt32(ordinalITEM_PRICE);

                items.Add(b);
            }

            reader.Close();
            _db.Close();

            return items;
        }
コード例 #13
0
ファイル: Enemy.cs プロジェクト: OOP-Team-Tapani/RPG-Game
        public IItem DropRandomItem()
        {
            Random rnd = new Random();
            int itemNumber = rnd.Next(1, 7);
            IItem itemForDrop;
            switch (this.EnemyType)
            {
                case EnemyType.Ghoul:
                    switch (itemNumber)
                    {
                        case 1:
                            itemForDrop = new Belt();
                            break;
                        case 2:
                            itemForDrop = new Boots();
                            break;
                        case 3:
                            itemForDrop = new Chest();
                            break;
                        case 4:
                            itemForDrop = new Helmet();
                            break;
                        case 5:
                            itemForDrop = new Pants();
                            break;
                        case 6:
                            itemForDrop = new Sword();
                            break;
                        default:
                            itemForDrop = null;
                            break;
                    }

                    break;
                case EnemyType.Hydra:
                    switch (itemNumber)
                    {
                        case 1:
                            itemForDrop = new Belt(ItemType.Uncommon);
                            break;
                        case 2:
                            itemForDrop = new Boots(ItemType.Uncommon);
                            break;
                        case 3:
                            itemForDrop = new Chest(ItemType.Uncommon);
                            break;
                        case 4:
                            itemForDrop = new Helmet(ItemType.Uncommon);
                            break;
                        case 5:
                            itemForDrop = new Pants(ItemType.Uncommon);
                            break;
                        case 6:
                            itemForDrop = new Sword(ItemType.Uncommon);
                            break;
                        default:
                            itemForDrop = null;
                            break;
                    }

                    break;
                case EnemyType.Supremus:
                    switch (itemNumber)
                    {
                        case 1:
                            itemForDrop = new Belt(ItemType.Rare);
                            break;
                        case 2:
                            itemForDrop = new Boots(ItemType.Rare);
                            break;
                        case 3:
                            itemForDrop = new Chest(ItemType.Rare);
                            break;
                        case 4:
                            itemForDrop = new Helmet(ItemType.Rare);
                            break;
                        case 5:
                            itemForDrop = new Pants(ItemType.Rare);
                            break;
                        case 6:
                            itemForDrop = new Sword(ItemType.Rare);
                            break;
                        default:
                            itemForDrop = null;
                            break;
                    }

                    break;
                case EnemyType.Rotface:
                    switch (itemNumber)
                    {
                        case 1:
                            itemForDrop = new Belt(ItemType.Magic);
                            break;
                        case 2:
                            itemForDrop = new Boots(ItemType.Magic);
                            break;
                        case 3:
                            itemForDrop = new Chest(ItemType.Magic);
                            break;
                        case 4:
                            itemForDrop = new Helmet(ItemType.Magic);
                            break;
                        case 5:
                            itemForDrop = new Pants(ItemType.Magic);
                            break;
                        case 6:
                            itemForDrop = new Sword(ItemType.Magic);
                            break;
                        default:
                            itemForDrop = null;
                            break;
                    }

                    break;
                case EnemyType.Lichking:
                    switch (itemNumber)
                    {
                        case 1:
                            itemForDrop = new Belt(ItemType.Legendary);
                            break;
                        case 2:
                            itemForDrop = new Boots(ItemType.Legendary);
                            break;
                        case 3:
                            itemForDrop = new Chest(ItemType.Legendary);
                            break;
                        case 4:
                            itemForDrop = new Helmet(ItemType.Legendary);
                            break;
                        case 5:
                            itemForDrop = new Pants(ItemType.Legendary);
                            break;
                        case 6:
                            itemForDrop = new Sword(ItemType.Legendary);
                            break;
                        default:
                            itemForDrop = null;
                            break;
                    }

                    break;
                case EnemyType.Deathwing:
                    itemForDrop = new Sword(ItemType.Legendary);
                    break;
                default:
                    itemForDrop = null;
                    break;
            }

            return itemForDrop;
        }
コード例 #14
0
        public static void Main(string[] args)
        {
            //////  PLAYERS  //////

            Player player1 = new Player("Daniel", "SMITH", "Dany");
            Player player2 = new Player("Ryan", "JOHNSON", "RJ");
            Player player3 = new Player("James", "WILLIAMS", "Jimy");
            Player player4 = new Player("Kyle", "BROWN", "Kyle");

            //////  WEAPONS  //////

            Equipment petitBouclierRond     = new SmallRoundShield();
            Equipment bouclierRectangulaire = new RectangularShield();
            Equipment casque  = new Helmet();
            Equipment dague   = new Dagger();
            Equipment epee    = new Sword();
            Equipment trident = new Trident();
            Equipment lance   = new Lance();
            Equipment filet   = new Net();

            //////  TEAMS  //////

            Team teamRed    = new Team("teamRed", "La teamRed est la plus forte.");
            Team teamBlue   = new Team("teamBlue", "La teamBlue est la plus forte.");
            Team teamGreen  = new Team("teamGreen", "La teamGreen est la plus forte.");
            Team teamYellow = new Team("teamYellow", "La teamYellow est la plus forte.");

            player1.AddTeam(teamRed);
            player2.AddTeam(teamBlue);
            player3.AddTeam(teamGreen);
            player4.AddTeam(teamYellow);

            /// TEAM RED
            Gladiator gladiatorR1 = new Gladiator("gladiatorR1");

            gladiatorR1.Equip(casque);
            gladiatorR1.Equip(trident);
            gladiatorR1.Equip(trident);
            gladiatorR1.Equip(casque);
            Gladiator gladiatorR2 = new Gladiator("gladiatorR2");

            gladiatorR2.Equip(filet);
            gladiatorR2.Equip(lance);
            Gladiator gladiatorR3 = new Gladiator("gladiatorR3");

            gladiatorR3.Equip(epee);
            gladiatorR3.Equip(petitBouclierRond);

            gladiatorR1.SetInitiativeTo(1);
            gladiatorR2.SetInitiativeTo(2);
            gladiatorR3.SetInitiativeTo(3);

            teamRed.AddGladiator(gladiatorR1);
            teamRed.AddGladiator(gladiatorR3);
            teamRed.AddGladiator(gladiatorR2);


            /// TEAM BLUE
            Gladiator gladiatorB1 = new Gladiator("gladiatorB1");

            gladiatorB1.Equip(dague);
            gladiatorB1.Equip(dague);
            gladiatorB1.Equip(petitBouclierRond);
            Gladiator gladiatorB2 = new Gladiator("gladiatorB2");

            gladiatorB2.Equip(dague);
            gladiatorB2.Equip(bouclierRectangulaire);
            Gladiator gladiatorB3 = new Gladiator("gladiatorB3");

            gladiatorB3.Equip(epee);
            gladiatorB3.Equip(casque);

            gladiatorB1.SetInitiativeTo(1);
            gladiatorB2.SetInitiativeTo(2);
            gladiatorB3.SetInitiativeTo(3);

            teamBlue.AddGladiator(gladiatorB1);
            teamBlue.AddGladiator(gladiatorB2);
            teamBlue.AddGladiator(gladiatorB3);

            /// TEAM GREEN
            Gladiator gladiatorG1 = new Gladiator("gladiatorG1");

            gladiatorG1.Equip(epee);
            gladiatorG1.Equip(petitBouclierRond);
            Gladiator gladiatorG2 = new Gladiator("gladiatorG2");

            gladiatorG2.Equip(dague);
            gladiatorG2.Equip(dague);
            gladiatorG2.Equip(petitBouclierRond);
            Gladiator gladiatorG3 = new Gladiator("gladiatorG3");

            gladiatorG3.Equip(lance);
            gladiatorG3.Equip(casque);

            gladiatorG1.SetInitiativeTo(1);
            gladiatorG2.SetInitiativeTo(2);
            gladiatorG3.SetInitiativeTo(3);

            teamGreen.AddGladiator(gladiatorG1);
            teamGreen.AddGladiator(gladiatorG2);
            teamGreen.AddGladiator(gladiatorG3);

            /// TEAM YELLOW
            Gladiator gladiatorY1 = new Gladiator("gladiatorY1");

            gladiatorY1.Equip(dague);
            gladiatorY1.Equip(dague);
            gladiatorY1.Equip(petitBouclierRond);
            Gladiator gladiatorY2 = new Gladiator("gladiatorY2");

            gladiatorY2.Equip(epee);
            gladiatorY2.Equip(petitBouclierRond);
            Gladiator gladiatorY3 = new Gladiator("gladiatorY3");

            gladiatorY3.Equip(trident);
            gladiatorY3.Equip(casque);

            gladiatorY1.SetInitiativeTo(1);
            gladiatorY2.SetInitiativeTo(2);
            gladiatorY3.SetInitiativeTo(3);

            teamYellow.AddGladiator(gladiatorY1);
            teamYellow.AddGladiator(gladiatorY2);
            teamYellow.AddGladiator(gladiatorY3);

            //////  TOURNAMENT  //////
            Tournament tournois = new Tournament();

            tournois.AddTeam(teamGreen);
            tournois.AddTeam(teamYellow);
            tournois.AddTeam(teamBlue);
            tournois.AddTeam(teamRed);

            //////  TEST  //////

            tournois.Start();

            Console.WriteLine("STATISTIQUES :\r\n");
            Console.WriteLine("teamBlue winrate : " + teamBlue.WinRate);
            Console.WriteLine("teamGreen winrate : " + teamGreen.WinRate);
            Console.WriteLine("teamRed winrate : " + teamRed.WinRate);
            Console.WriteLine("teamYellow winrate : " + teamYellow.WinRate + "\r\n");
            Console.WriteLine("gladiatorB1 winrate : " + gladiatorB1.WinRate);
            Console.WriteLine("gladiatorB2 winrate : " + gladiatorB2.WinRate);
            Console.WriteLine("gladiatorB3 winrate : " + gladiatorB3.WinRate);
            Console.WriteLine("gladiatorR1 winrate : " + gladiatorR1.WinRate);
            Console.WriteLine("gladiatorR2 winrate : " + gladiatorR2.WinRate);
            Console.WriteLine("gladiatorR3 winrate : " + gladiatorR3.WinRate);
            Console.WriteLine("gladiatorG1 winrate : " + gladiatorG1.WinRate);
            Console.WriteLine("gladiatorG2 winrate : " + gladiatorG2.WinRate);
            Console.WriteLine("gladiatorG3 winrate : " + gladiatorG3.WinRate);
            Console.WriteLine("gladiatorY1 winrate : " + gladiatorY1.WinRate);
            Console.WriteLine("gladiatorY2 winrate : " + gladiatorY2.WinRate);
            Console.WriteLine("gladiatorY3 winrate : " + gladiatorY3.WinRate);
        }
コード例 #15
0
ファイル: DropBuilderForm.cs プロジェクト: yelladigga/mir2-1
        // Add the item to the drop list
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            int dropChance;

            int.TryParse(textBoxItemOdds.Text, out dropChance);

            if (dropChance < 1)
            {
                dropChance = 1;
            }

            string quest = QuestOnlyCheckBox.Checked ? "Q" : "";

            try
            {
                switch (tabControlSeperateItems.SelectedTab.Tag.ToString())
                {
                case "Weapon":
                    Weapon.Add(new DropItem {
                        Name = listBoxWeapon.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Armour":
                    Armour.Add(new DropItem {
                        Name = listBoxArmour.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Helmet":
                    Helmet.Add(new DropItem {
                        Name = listBoxHelmet.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Necklace":
                    Necklace.Add(new DropItem {
                        Name = listBoxNecklace.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Bracelet":
                    Bracelet.Add(new DropItem {
                        Name = listBoxBracelet.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Ring":
                    Ring.Add(new DropItem {
                        Name = listBoxRing.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Amulet":
                    Amulet.Add(new DropItem {
                        Name = listBoxAmulet.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Belt":
                    Belt.Add(new DropItem {
                        Name = listBoxBelt.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Boots":
                    Boot.Add(new DropItem {
                        Name = listBoxBoot.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Stone":
                    Stone.Add(new DropItem {
                        Name = listBoxStone.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Torch":
                    Torch.Add(new DropItem {
                        Name = listBoxTorch.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Potion":
                    Potion.Add(new DropItem {
                        Name = listBoxPotion.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Ore":
                    Ore.Add(new DropItem {
                        Name = listBoxOre.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Meat":
                    Meat.Add(new DropItem {
                        Name = listBoxMeat.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "CraftingMaterial":
                    CraftingMaterial.Add(new DropItem {
                        Name = listBoxCraftingMaterial.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}"
                    });
                    break;

                case "Scroll":
                    Scrolls.Add(new DropItem {
                        Name = listBoxScroll.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Gem":
                    Gem.Add(new DropItem {
                        Name = listBoxGem.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Mount":
                    Mount.Add(new DropItem {
                        Name = listBoxMount.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Book":
                    Book.Add(new DropItem {
                        Name = listBoxBook.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Nothing":
                    Nothing.Add(new DropItem {
                        Name = listBoxNothing.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Script":
                    Script.Add(new DropItem {
                        Name = listBoxScript.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Reins":
                    Reins.Add(new DropItem {
                        Name = listBoxReins.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Bells":
                    Bells.Add(new DropItem {
                        Name = listBoxBells.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Saddle":
                    Saddle.Add(new DropItem {
                        Name = listBoxSaddle.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Ribbon":
                    Ribbon.Add(new DropItem {
                        Name = listBoxRibbon.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Mask":
                    Mask.Add(new DropItem {
                        Name = listBoxMask.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Food":
                    Food.Add(new DropItem {
                        Name = listBoxFood.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Hook":
                    Hook.Add(new DropItem {
                        Name = listBoxHook.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Float":
                    Float.Add(new DropItem {
                        Name = listBoxFloat.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Bait":
                    Bait.Add(new DropItem {
                        Name = listBoxBait.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Finder":
                    Finder.Add(new DropItem {
                        Name = listBoxFinder.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Reel":
                    Reel.Add(new DropItem {
                        Name = listBoxReel.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Fish":
                    Fish.Add(new DropItem {
                        Name = listBoxFish.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Quest":
                    Quest.Add(new DropItem {
                        Name = listBoxQuest.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Awakening":
                    Awakening.Add(new DropItem {
                        Name = listBoxAwakening.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Pets":
                    Pets.Add(new DropItem {
                        Name = listBoxPets.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;

                case "Transform":
                    Transform.Add(new DropItem {
                        Name = listBoxTransform.SelectedItem.ToString().Replace(" ", string.Empty), Odds =
                            $"1/{dropChance}", Quest = quest
                    });
                    break;
                }

                UpdateDropFile();
            }
            catch
            {
                //No item selected when trying to add an item to the drop
            }
        }
コード例 #16
0
        public Paladin() : base(AIType.AI_Melee, FightMode.Agressor, 10, 1, 0.45, 0.8)
        {
            Female = Utility.RandomBool();
            Body   = Female ? 401 : 400;
            Title  = "the paladin";
            Name   = NameList.RandomName(Female ? "female" : "male");
            Hue    = Utility.RandomSkinHue();
            SetStr(64, 92);
            SetDex(46, 88);
            SetInt(37, 49);
            Karma = Utility.RandomMinMax(33, -25);


            SetSkill(SkillName.Tactics, 55, 77.5);
            SetSkill(SkillName.MagicResist, 55, 77.5);
            SetSkill(SkillName.Parry, 55, 77.5);
            SetSkill(SkillName.Swords, 55, 77.5);
            SetSkill(SkillName.Macing, 55, 77.5);
            SetSkill(SkillName.Fencing, 55, 77.5);
            SetSkill(SkillName.Wrestling, 55, 77.5);
            SetSkill(SkillName.ArmsLore, 52.5, 75);


            Item item = null;

            if (!Female)
            {
                item     = AddRandomHair();
                item.Hue = Utility.RandomHairHue();
                item     = AddRandomFacialHair(item.Hue);
                item     = new PlateChest();
                AddItem(item);
                item = new PlateLegs();
                AddItem(item);
                item = new PlateArms();
                AddItem(item);
                item = new PlateGloves();
                AddItem(item);
                item = new PlateGorget();
                AddItem(item);
                switch (Utility.Random(5))
                {
                case 0: item = new PlateHelm(); break;

                case 1: item = new Helmet(); break;

                case 2: item = new CloseHelm(); break;

                case 3: item = new Bascinet(); break;

                case 4:
                default: item = new NorseHelm(); break;
                }
                AddItem(item);
                item     = new Tunic();
                item.Hue = Utility.RandomNondyedHue();
                AddItem(item);
                item     = new HeaterShield();
                item.Hue = Utility.RandomNondyedHue();
                AddItem(item);
                item = new VikingSword();
                AddItem(item);
                item = Utility.RandomBool() ? (Item) new Boots() : (Item) new ThighBoots();
                AddItem(item);
                PackGold(15, 100);
            }
            else
            {
                item     = AddRandomHair();
                item.Hue = Utility.RandomHairHue();
                item     = new PlateChest();
                AddItem(item);
                item = new PlateLegs();
                AddItem(item);
                item = new PlateArms();
                AddItem(item);
                item = new PlateGloves();
                AddItem(item);
                item = new PlateGorget();
                AddItem(item);
                switch (Utility.Random(5))
                {
                case 0: item = new PlateHelm(); break;

                case 1: item = new Helmet(); break;

                case 2: item = new CloseHelm(); break;

                case 3: item = new Bascinet(); break;

                case 4:
                default: item = new NorseHelm(); break;
                }
                AddItem(item);
                item     = new Tunic();
                item.Hue = Utility.RandomNondyedHue();
                AddItem(item);
                item     = new HeaterShield();
                item.Hue = Utility.RandomNondyedHue();
                AddItem(item);
                item = new VikingSword();
                AddItem(item);
                item = Utility.RandomBool() ? (Item) new Boots() : (Item) new ThighBoots();
                AddItem(item);
                PackGold(15, 100);
            }
        }
コード例 #17
0
 void Start()
 {
     anim  = general.GetComponent <Animator>();
     anim2 = Helmet.GetComponent <Animator>();
     anim3 = Ordinary.GetComponent <Animator>();
 }
コード例 #18
0
        public void CharacterSetChange(Face face, HandL handL, HandR handR, Helmet helmet, Mask mask, Dress dress, ShoesAll shoes)
        {
            //Debug.Log("옷 갈아입기 실행");
            string faceName = face.ToString();

            for (int i = 0; i < gFace.Length; i++)
            {
                if (faceName == gFace[i].name)
                {
                    gFace[i].SetActive(true);
                }
                else
                {
                    gFace[i].SetActive(false);
                }
            }

            string handLName = handL.ToString();

            for (int i = 0; i < gHandL.Length; i++)
            {
                if (handLName == gHandL[i].name)
                {
                    gHandL[i].SetActive(true);
                }
                else
                {
                    gHandL[i].SetActive(false);
                }
            }

            string handRName = handR.ToString();

            for (int i = 0; i < gHandR.Length; i++)
            {
                if (handRName == gHandR[i].name)
                {
                    gHandR[i].SetActive(true);
                }
                else
                {
                    gHandR[i].SetActive(false);
                }
            }

            string helmetName = helmet.ToString();

            for (int i = 0; i < gHelmet.Length; i++)
            {
                if (helmetName == gHelmet[i].name)
                {
                    gHelmet[i].SetActive(true);
                }
                else
                {
                    gHelmet[i].SetActive(false);
                }
            }

            string maskName = mask.ToString();

            for (int i = 0; i < gMask.Length; i++)
            {
                if (maskName == gMask[i].name)
                {
                    gMask[i].SetActive(true);
                }
                else
                {
                    gMask[i].SetActive(false);
                }
            }

            string dressName = dress.ToString();

            for (int i = 0; i < gDress.Length; i++)
            {
                if (dressName == gDress[i].name)
                {
                    gDress[i].SetActive(true);
                }
                else
                {
                    gDress[i].SetActive(false);
                }
            }

            string shoesName = shoes.ToString();

            for (int i = 0; i < gShoes.Length; i++)
            {
                if (shoesName == gShoes[i].name)
                {
                    gShoes[i].SetActive(true);
                }
                else
                {
                    gShoes[i].SetActive(false);
                }
            }
        }
コード例 #19
0
        public BaseItem GetItemByItemID(int itemID)
        {
            DbParameter itemIdParameter = _db.CreateParameter(DbNames.GETITEMBYITEMID_ITEMID_PARAMETER, itemID);
            itemIdParameter.DbType = DbType.Int32;

            BaseItem b = null;

            _db.Open();

            DbDataReader reader = _db.ExcecuteReader(DbNames.GETITEMBYITEMID_STOREDPROC, CommandType.StoredProcedure, itemIdParameter);

            int ordinalITEM_ITEMID = reader.GetOrdinal(DbNames.ITEM_ITEMID);
            int ordinalITEM_OWNERID = reader.GetOrdinal(DbNames.ITEM_OWNERID);
            int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFERENCEID);
            int ordinalITEM_BTYPE = reader.GetOrdinal(DbNames.ITEM_BTYPE);
            int ordinalITEM_BKIND = reader.GetOrdinal(DbNames.ITEM_BKIND);
            int ordinalITEM_VISUALID = reader.GetOrdinal(DbNames.ITEM_VISUALID);
            int ordinalITEM_COST = reader.GetOrdinal(DbNames.ITEM_COST);
            int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS);
            int ordinalITEM_AMOUNT = reader.GetOrdinal(DbNames.ITEM_AMOUNT);
            int ordinalITEM_LEVEL = reader.GetOrdinal(DbNames.ITEM_LEVEL);
            int ordinalITEM_DEX = reader.GetOrdinal(DbNames.ITEM_DEX);
            int ordinalITEM_STR = reader.GetOrdinal(DbNames.ITEM_STR);
            int ordinalITEM_STA = reader.GetOrdinal(DbNames.ITEM_STA);
            int ordinalITEM_ENE = reader.GetOrdinal(DbNames.ITEM_ENE);
            int ordinalITEM_MAXIMBUES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES);
            int ordinalITEM_MAXDURA = reader.GetOrdinal(DbNames.ITEM_MAXDURA);
            int ordinalITEM_CURDURA = reader.GetOrdinal(DbNames.ITEM_CURDURA);
            int ordinalITEM_DAMAGE = reader.GetOrdinal(DbNames.ITEM_DAMAGE);
            int ordinalITEM_DEFENCE = reader.GetOrdinal(DbNames.ITEM_DEFENCE);
            int ordinalITEM_ATTACKRATING = reader.GetOrdinal(DbNames.ITEM_ATTACKRATING);
            int ordinalITEM_ATTACKSPEED = reader.GetOrdinal(DbNames.ITEM_ATTACKSPEED);
            int ordinalITEM_ATTACKRANGE = reader.GetOrdinal(DbNames.ITEM_ATTACKRANGE);
            int ordinalITEM_INCMAXLIFE = reader.GetOrdinal(DbNames.ITEM_INCMAXLIFE);
            int ordinalITEM_INCMAXMANA = reader.GetOrdinal(DbNames.ITEM_INCMAXMANA);
            int ordinalITEM_LIFEREGEN = reader.GetOrdinal(DbNames.ITEM_LIFEREGEN);
            int ordinalITEM_MANAREGEN = reader.GetOrdinal(DbNames.ITEM_MANAREGEN);
            int ordinalITEM_CRITICAL = reader.GetOrdinal(DbNames.ITEM_CRITICAL);
            int ordinalITEM_PLUS = reader.GetOrdinal(DbNames.ITEM_PLUS);
            int ordinalITEM_SLVL = reader.GetOrdinal(DbNames.ITEM_SLVL);
            int ordinalITEM_IMBUETRIES = reader.GetOrdinal(DbNames.ITEM_IMBUETRIES);
            int ordinalITEM_DRAGONSUCCESSIMBUETRIES = reader.GetOrdinal(DbNames.ITEM_DRAGONSUCCESSIMBUETRIES);
            int ordinalITEM_DISCOUNTREPAIRFEE = reader.GetOrdinal(DbNames.ITEM_DISCOUNTREPAIRFEE);
            int ordinalITEM_TOTALDRAGONIMBUES = reader.GetOrdinal(DbNames.ITEM_TOTALDRAGONIMBUES);
            int ordinalITEM_DRAGONDAMAGE = reader.GetOrdinal(DbNames.ITEM_DRAGONDAMAGE);
            int ordinalITEM_DRAGONDEFENCE = reader.GetOrdinal(DbNames.ITEM_DRAGONDEFENCE);
            int ordinalITEM_DRAGONATTACKRATING = reader.GetOrdinal(DbNames.ITEM_DRAGONATTACKRATING);
            int ordinalITEM_DRAGONLIFE = reader.GetOrdinal(DbNames.ITEM_DRAGONLIFE);
            int ordinalITEM_MAPPEDSTUFF = reader.GetOrdinal(DbNames.ITEM_MAPPEDSTUFF);
            int ordinalITEM_FORCENUMBER = reader.GetOrdinal(DbNames.ITEM_FORCENUMBER);
            int ordinalITEM_REBIRTHHOLE = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLE);
            int ordinalITEM_REBIRTHHOLEITEM = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLEITEM);
            int ordinalITEM_REBIRTHHOLESTAT = reader.GetOrdinal(DbNames.ITEM_REBIRTHHOLESTAT);
            int ordinalITEM_TOMAPID = reader.GetOrdinal(DbNames.ITEM_TOMAPID);
            int ordinalITEM_IMBUERATE = reader.GetOrdinal(DbNames.ITEM_IMBUERATE);
            int ordinalITEM_IMBUEINCREASE = reader.GetOrdinal(DbNames.ITEM_IMBUEINCREASE);
            int ordinalITEM_BOOKSKILLID = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLID);
            int ordinalITEM_BOOKSKILLLEVEL = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLLEVEL);
            int ordinalITEM_BOOKSKILLDATA = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLDATA);
            int ordinalITEM_MAXPOLISHTRIES = reader.GetOrdinal(DbNames.ITEM_MAXPOLISHTRIES);
            int ordinalITEM_POLISHTRIES = reader.GetOrdinal(DbNames.ITEM_POLISHTRIES);
            int ordinalITEM_VIGISTAT1 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT1);
            int ordinalITEM_VIGISTAT2 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT2);
            int ordinalITEM_VIGISTAT3 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT3);
            int ordinalITEM_VIGISTAT4 = reader.GetOrdinal(DbNames.ITEM_VIGISTAT4);
            int ordinalITEM_VIGISTATADD1 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD1);
            int ordinalITEM_VIGISTATADD2 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD2);
            int ordinalITEM_VIGISTATADD3 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD3);
            int ordinalITEM_VIGISTATADD4 = reader.GetOrdinal(DbNames.ITEM_VIGISTATADD4);
            int ordinalITEM_BAG = reader.GetOrdinal(DbNames.ITEM_BAG);
            int ordinalITEM_SLOT = reader.GetOrdinal(DbNames.ITEM_SLOT);
            int ordinalITEM_SIZEX = reader.GetOrdinal(DbNames.ITEM_SIZEX);
            int ordinalITEM_SIZEY = reader.GetOrdinal(DbNames.ITEM_SIZEY);

            while (reader.Read())
            {
                int BType = reader.GetByte(ordinalITEM_BTYPE);
                int BKind = reader.GetByte(ordinalITEM_BKIND);

                if (BType == (byte)bType.Weapon || BType == (byte)bType.Clothes || BType == (byte)bType.Hat || BType == (byte)bType.Necklace
                    || BType == (byte)bType.Ring || BType == (byte)bType.Shoes || BType == (byte)bType.Cape)
                {
                    if (BKind == (byte)bKindWeapons.Sword && BType == (byte)bType.Weapon)
                    {
                        b = new Sword();
                    }
                    if (BKind == (byte)bKindWeapons.Blade && BType == (byte)bType.Weapon)
                    {
                        b = new Blade();
                    }
                    if (BKind == (byte)bKindWeapons.Fan && BType == (byte)bType.Weapon)
                    {
                        b = new Fan();
                    }
                    if (BKind == (byte)bKindWeapons.Brush && BType == (byte)bType.Weapon)
                    {
                        b = new Brush();
                    }
                    if (BKind == (byte)bKindWeapons.Claw && BType == (byte)bType.Weapon)
                    {
                        b = new Claw();
                    }
                    if (BKind == (byte)bKindWeapons.Axe && BType == (byte)bType.Weapon)
                    {
                        b = new Axe();
                    }
                    if (BKind == (byte)bKindWeapons.Talon && BType == (byte)bType.Weapon)
                    {
                        b = new Talon();
                    }
                    if (BKind == (byte)bKindWeapons.Tonfa && BType == (byte)bType.Weapon)
                    {
                        b = new Tonfa();
                    }
                    if (BKind == (byte)bKindArmors.SwordMan && BType == (byte)bType.Clothes)
                    {
                        b = new Clothes();
                    }
                    if (BKind == (byte)bKindArmors.Mage && BType == (byte)bType.Clothes)
                    {
                        b = new Dress();
                    }
                    if (BKind == (byte)bKindArmors.Warrior && BType == (byte)bType.Clothes)
                    {
                        b = new Armor();
                    }
                    if (BKind == (byte)bKindArmors.GhostFighter && BType == (byte)bType.Clothes)
                    {
                        b = new LeatherClothes();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Hat)
                    {
                        b = new Hood();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Hat)
                    {
                        b = new Tiara();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Hat)
                    {
                        b = new Helmet();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Hat)
                    {
                        b = new Hat();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Shoes)
                    {
                        b = new SmBoots();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Shoes)
                    {
                        b = new MageBoots();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Shoes)
                    {
                        b = new WarriorShoes();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Shoes)
                    {
                        b = new GhostFighterShoes();
                    }
                    if (BKind == 0 && BType == (byte)bType.Ring)
                    {
                        b = new Ring();
                    }
                    if (BKind == 0 && BType == (byte)bType.Necklace)
                    {
                        b = new Necklace();
                    }
                    if (BType == (byte)bType.Cape)
                    {
                        b = new Cape();
                        Cape c = b as Cape;
                        c.MaxPolishImbueTries = reader.GetInt16(ordinalITEM_MAXPOLISHTRIES);
                        c.PolishImbueTries = reader.GetByte(ordinalITEM_POLISHTRIES);
                        c.VigiStat1 = reader.GetInt16(ordinalITEM_VIGISTAT1);
                        c.VigiStatAdd1 = reader.GetInt16(ordinalITEM_VIGISTATADD1);
                        c.VigiStat2 = reader.GetInt16(ordinalITEM_VIGISTAT2);
                        c.VigiStatAdd2 = reader.GetInt16(ordinalITEM_VIGISTATADD2);
                        c.VigiStat3 = reader.GetInt16(ordinalITEM_VIGISTAT3);
                        c.VigiStatAdd3 = reader.GetInt16(ordinalITEM_VIGISTATADD3);
                        c.VigiStat4 = reader.GetInt16(ordinalITEM_VIGISTAT4);
                        c.VigiStatAdd4 = reader.GetInt16(ordinalITEM_VIGISTATADD4);
                    }

                    Equipment e = b as Equipment;
                    e.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    e.RequiredDexterity = reader.GetInt16(ordinalITEM_DEX);
                    e.RequiredStrength = reader.GetInt16(ordinalITEM_STR);
                    e.RequiredStamina = reader.GetInt16(ordinalITEM_STA);
                    e.RequiredEnergy = reader.GetInt16(ordinalITEM_ENE);
                    e.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUES);
                    e.Durability = reader.GetInt16(ordinalITEM_CURDURA);
                    e.MaxDurability = reader.GetInt16(ordinalITEM_MAXDURA);
                    e.Damage = reader.GetInt16(ordinalITEM_DAMAGE);
                    e.Defence = reader.GetInt16(ordinalITEM_DEFENCE);
                    e.AttackRating = reader.GetInt16(ordinalITEM_ATTACKRATING);
                    e.AttackSpeed = reader.GetInt16(ordinalITEM_ATTACKSPEED);
                    e.AttackRange = reader.GetInt16(ordinalITEM_ATTACKRANGE);
                    e.IncMaxLife = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    e.IncMaxMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                    e.IncLifeRegen = reader.GetInt16(ordinalITEM_LIFEREGEN);
                    e.IncManaRegen = reader.GetInt16(ordinalITEM_MANAREGEN);
                    e.Critical = reader.GetInt16(ordinalITEM_CRITICAL);
                    e.Plus = reader.GetByte(ordinalITEM_PLUS);
                    e.Slvl = reader.GetByte(ordinalITEM_SLVL);
                    e.ImbueTries = reader.GetByte(ordinalITEM_IMBUETRIES);
                    e.DragonSuccessImbueTries = reader.GetInt16(ordinalITEM_DRAGONSUCCESSIMBUETRIES);
                    e.DiscountRepairFee = reader.GetByte(ordinalITEM_DISCOUNTREPAIRFEE);
                    e.TotalDragonImbueTries = reader.GetInt16(ordinalITEM_TOTALDRAGONIMBUES);
                    e.DragonDamage = reader.GetInt16(ordinalITEM_DRAGONDAMAGE);
                    e.DragonDefence = reader.GetInt16(ordinalITEM_DRAGONDEFENCE);
                    e.DragonAttackRating = reader.GetInt16(ordinalITEM_DRAGONATTACKRATING);
                    e.DragonLife = reader.GetInt16(ordinalITEM_DRAGONLIFE);
                    e.MappedData = reader.GetByte(ordinalITEM_MAPPEDSTUFF);
                    e.ForceSlot = reader.GetByte(ordinalITEM_FORCENUMBER);
                    e.RebirthHole = reader.GetByte(ordinalITEM_REBIRTHHOLE);
                    e.RebirthHoleItem = reader.GetByte(ordinalITEM_REBIRTHHOLEITEM);
                    e.RebirthHoleStat = reader.GetInt16(ordinalITEM_REBIRTHHOLESTAT);
                }

                if (BType == (byte)bType.ImbueItem)
                {
                    if (BKind == (byte)bKindStones.Black)
                    {
                        b = new Black();
                    }
                    if (BKind == (byte)bKindStones.White)
                    {
                        b = new White();
                    }
                    if (BKind == (byte)bKindStones.Red)
                    {
                        b = new Red();
                    }
                    if (BKind == (byte)bKindStones.Dragon)
                    {
                        b = new Dragon();
                    }

                    ImbueItem im = b as ImbueItem;
                    im.ImbueChance = reader.GetInt16(ordinalITEM_IMBUERATE);
                    im.IncreaseValue = reader.GetInt16(ordinalITEM_IMBUEINCREASE);
                }

                if (BType == (byte)bType.Potion)
                {
                    if (BKind == (byte)bKindPotions.Normal)
                    {
                        b = new Potion();
                    }
                    if (BKind == (byte)bKindPotions.Elixir)
                    {
                        b = new Elixir();
                    }

                    PotionItem pot = b as PotionItem;
                    pot.HealHp = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    pot.HealMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                }
                if (BType == (byte)bType.Book)
                {
                    if (BKind == (byte)bKindBooks.SoftBook)
                    {
                        b = new SoftBook();
                    }
                    if (BKind == (byte)bKindBooks.HardBook)
                    {
                        b = new HardBook();
                    }

                    BookItem book = b as BookItem;
                    book.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                    book.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    book.SkillID = reader.GetInt32(ordinalITEM_BOOKSKILLID);
                    book.SkillLevel = reader.GetByte(ordinalITEM_BOOKSKILLLEVEL);
                    book.SkillData = reader.GetInt32(ordinalITEM_BOOKSKILLDATA);
                }
                if (BType == (byte)bType.Bead)
                {
                    if (BKind == (byte)bKindBeads.Normal)
                    {
                        b = new Bead();
                    }
                    BeadItem bead = b as BeadItem;
                    bead.ToMapID = reader.GetInt32(ordinalITEM_TOMAPID);
                }

                b.ItemID = reader.GetInt32(ordinalITEM_ITEMID);
                b.OwnerID = reader.GetInt32(ordinalITEM_OWNERID);
                b.ReferenceID = reader.GetInt16(ordinalITEM_REFERENCEID);
                b.VisualID = reader.GetInt16(ordinalITEM_VISUALID);
                b.Bag = reader.GetByte(ordinalITEM_BAG);
                b.Slot = reader.GetByte(ordinalITEM_SLOT);
                b.bType = reader.GetByte(ordinalITEM_BTYPE);
                b.bKind = reader.GetByte(ordinalITEM_BKIND);
                b.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                b.Amount = reader.GetInt16(ordinalITEM_AMOUNT);
                b.SizeX = reader.GetByte(ordinalITEM_SIZEX);
                b.SizeY = reader.GetByte(ordinalITEM_SIZEY);
                b.Price = reader.GetInt32(ordinalITEM_COST);
            }

            reader.Close();
            _db.Close();

            return b;
        }
コード例 #20
0
 void compraLuce(Helmet typeAcquisto, int costo)
 {
     if (CameraScript.data.Credits >= costo && imbuying)
     {
         CameraScript.data.Credits -= costo;
         switch (typeAcquisto)
         {
             case Helmet.red: CameraScript.data.lightRed = true;
                 break;
             case Helmet.blue: CameraScript.data.lightBlue = true;
                 break;
             case Helmet.green: CameraScript.data.lightGreen = true;
                 break;
             case Helmet.pink: CameraScript.data.lightPink = true;
                 break;
             case Helmet.rainbow: CameraScript.data.lightRainbow = true;
                 break;
         }
         CameraScript.data.Helmet = typeAcquisto;
         CameraScript.SaveData();
         audio.PlayOneShot(cashsound);//SUONA CASSA
     }
     else
         audio.PlayOneShot(noMoney);
 }
コード例 #21
0
        // Load the monster.txt drop file.
        private void LoadDropFile(bool edit)
        {
            var lines = (edit == false) ? File.ReadAllLines(Path.Combine(Settings.DropPath, String.Format("{0}.txt", listBoxMonsters.SelectedItem))) : textBoxDropList.Lines;

            for (int i = 0; i < lines.Length; i++)
            {
                if (lines[i].StartsWith(";Gold"))
                {
                    if (lines[i + 1].StartsWith("1/"))
                    {
                        var workingLine = lines[i + 1].Split(' ');
                        GoldOdds = workingLine[0].Remove(0, 2);
                        Gold     = workingLine[2];
                        break;
                    }
                    else
                    {
                        GoldOdds = "0";
                        Gold     = "0";
                    }
                }
            }

            string[] Headers = new string[34]
            {
                ";Weapons",
                ";Armours",
                ";Helmets",
                ";Necklaces",
                ";Bracelets",
                ";Rings",
                ";Amulets",
                ";Belts",
                ";Boots",
                ";Stones",
                ";Torches",
                ";Potions",
                ";Ores",
                ";Meat",
                ";Crafting Materials",
                ";Scrolls",
                ";Gems",
                ";Mount",
                ";Books",
                ";Nothing",
                ";Script",
                ";Reins",
                ";Bells",
                ";Saddle",
                ";Ribbon",
                ";Mask",
                ";Food",
                ";Hook",
                ";Float",
                ";Bait",
                ";Finder",
                ";Reel",
                ";Fish",
                ";Quest"
            };

            for (int i = 0; i < Headers.Length; i++)
            {
                for (int j = 0; j < lines.Length; j++)
                {
                    if (lines[j].StartsWith(Headers[i]))
                    {
                        for (int k = j + 1; k < lines.Length; k++)
                        {
                            if (lines[k].StartsWith(";"))
                            {
                                break;
                            }

                            var workingLine = lines[k].Split(' ');
                            if (workingLine.Length < 2)
                            {
                                continue;
                            }

                            var quest = "";

                            if (workingLine.Length > 2 && workingLine[2] == "Q")
                            {
                                quest = workingLine[2];
                            }

                            DropItem newDropItem = new DropItem {
                                Odds = workingLine[0], Name = workingLine[1], Quest = quest
                            };
                            switch (i)
                            {
                            case 0:
                                Weapon.Add(newDropItem);
                                break;

                            case 1:
                                Armour.Add(newDropItem);
                                break;

                            case 2:
                                Helmet.Add(newDropItem);
                                break;

                            case 3:
                                Necklace.Add(newDropItem);
                                break;

                            case 4:
                                Bracelet.Add(newDropItem);
                                break;

                            case 5:
                                Ring.Add(newDropItem);
                                break;

                            case 6:
                                Amulet.Add(newDropItem);
                                break;

                            case 7:
                                Belt.Add(newDropItem);
                                break;

                            case 8:
                                Boot.Add(newDropItem);
                                break;

                            case 9:
                                Stone.Add(newDropItem);
                                break;

                            case 10:
                                Torch.Add(newDropItem);
                                break;

                            case 11:
                                Potion.Add(newDropItem);
                                break;

                            case 12:
                                Ore.Add(newDropItem);
                                break;

                            case 13:
                                Meat.Add(newDropItem);
                                break;

                            case 14:
                                CraftingMaterial.Add(newDropItem);
                                break;

                            case 15:
                                Scrolls.Add(newDropItem);
                                break;

                            case 16:
                                Gem.Add(newDropItem);
                                break;

                            case 17:
                                Mount.Add(newDropItem);
                                break;

                            case 18:
                                Book.Add(newDropItem);
                                break;

                            case 19:
                                Nothing.Add(newDropItem);
                                break;

                            case 20:
                                Script.Add(newDropItem);
                                break;

                            case 21:
                                Reins.Add(newDropItem);
                                break;

                            case 22:
                                Bells.Add(newDropItem);
                                break;

                            case 23:
                                Saddle.Add(newDropItem);
                                break;

                            case 24:
                                Ribbon.Add(newDropItem);
                                break;

                            case 25:
                                Mask.Add(newDropItem);
                                break;

                            case 26:
                                Food.Add(newDropItem);
                                break;

                            case 27:
                                Hook.Add(newDropItem);
                                break;

                            case 28:
                                Float.Add(newDropItem);
                                break;

                            case 29:
                                Bait.Add(newDropItem);
                                break;

                            case 30:
                                Finder.Add(newDropItem);
                                break;

                            case 31:
                                Reel.Add(newDropItem);
                                break;

                            case 32:
                                Fish.Add(newDropItem);
                                break;

                            case 33:
                                Quest.Add(newDropItem);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
            }
        }
コード例 #22
0
        public BaseItem GetRebirthPillDrop(Monster m)
        {
            DbParameter levelParameter = _db.CreateParameter(DbNames.GETPILLDROPITEM_LEVEL_PARAMETER, m.Level);
            levelParameter.DbType = DbType.Int32;

            List<BaseItem> items = new List<BaseItem>();

            _db.Open();

            DbDataReader reader = _db.ExcecuteReader(DbNames.GETPILLDROPITEM_STOREDPROC, CommandType.StoredProcedure, levelParameter);

            int ordinalITEM_REFERENCEID = reader.GetOrdinal(DbNames.ITEM_REFERENCEID);
            int ordinalITEM_BTYPE = reader.GetOrdinal(DbNames.ITEM_BTYPE);
            int ordinalITEM_BKIND = reader.GetOrdinal(DbNames.ITEM_BKIND);
            int ordinalITEM_VISUALID = reader.GetOrdinal(DbNames.ITEM_VISUALID);
            int ordinalITEM_COST = reader.GetOrdinal(DbNames.ITEM_COST);
            int ordinalITEM_CLASS = reader.GetOrdinal(DbNames.ITEM_CLASS);
            int ordinalITEM_LEVEL = reader.GetOrdinal(DbNames.ITEM_LEVEL);
            int ordinalITEM_DEX = reader.GetOrdinal(DbNames.ITEM_DEX);
            int ordinalITEM_STR = reader.GetOrdinal(DbNames.ITEM_STR);
            int ordinalITEM_STA = reader.GetOrdinal(DbNames.ITEM_STA);
            int ordinalITEM_ENE = reader.GetOrdinal(DbNames.ITEM_ENE);
            int ordinalITEM_MAXIMBUES = reader.GetOrdinal(DbNames.ITEM_MAXIMBUES);
            int ordinalITEM_MAXDURA = reader.GetOrdinal(DbNames.DROPITEM_DURABILITY);
            int ordinalITEM_DAMAGE = reader.GetOrdinal(DbNames.ITEM_DAMAGE);
            int ordinalITEM_DEFENCE = reader.GetOrdinal(DbNames.ITEM_DEFENCE);
            int ordinalITEM_ATTACKRATING = reader.GetOrdinal(DbNames.ITEM_ATTACKRATING);
            int ordinalITEM_ATTACKSPEED = reader.GetOrdinal(DbNames.ITEM_ATTACKSPEED);
            int ordinalITEM_ATTACKRANGE = reader.GetOrdinal(DbNames.ITEM_ATTACKRANGE);
            int ordinalITEM_INCMAXLIFE = reader.GetOrdinal(DbNames.ITEM_INCMAXLIFE);
            int ordinalITEM_INCMAXMANA = reader.GetOrdinal(DbNames.ITEM_INCMAXMANA);
            int ordinalITEM_LIFEREGEN = reader.GetOrdinal(DbNames.ITEM_LIFEREGEN);
            int ordinalITEM_MANAREGEN = reader.GetOrdinal(DbNames.ITEM_MANAREGEN);
            int ordinalITEM_CRITICAL = reader.GetOrdinal(DbNames.ITEM_CRITICAL);
            int ordinalITEM_TOMAPID = reader.GetOrdinal(DbNames.ITEM_TOMAPID);
            int ordinalITEM_IMBUERATE = reader.GetOrdinal(DbNames.ITEM_IMBUERATE);
            int ordinalITEM_IMBUEINCREASE = reader.GetOrdinal(DbNames.ITEM_IMBUEINCREASE);
            int ordinalITEM_BOOKSKILLID = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLID);
            int ordinalITEM_BOOKSKILLLEVEL = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLLEVEL);
            int ordinalITEM_BOOKSKILLDATA = reader.GetOrdinal(DbNames.ITEM_BOOKSKILLDATA);
            int ordinalITEM_MAXPOLISHTRIES = reader.GetOrdinal(DbNames.ITEM_MAXPOLISHTRIES);
            int ordinalITEM_POLISHTRIES = reader.GetOrdinal(DbNames.ITEM_POLISHTRIES);
            int ordinalITEM_SIZEX = reader.GetOrdinal(DbNames.ITEM_SIZEX);
            int ordinalITEM_SIZEY = reader.GetOrdinal(DbNames.ITEM_SIZEY);
            while (reader.Read())
            {
                BaseItem b = null;

                int BType = reader.GetByte(ordinalITEM_BTYPE);
                int BKind = reader.GetByte(ordinalITEM_BKIND);

                if (BType == (byte)bType.Weapon || BType == (byte)bType.Clothes || BType == (byte)bType.Hat || BType == (byte)bType.Necklace
                    || BType == (byte)bType.Ring || BType == (byte)bType.Shoes || BType == (byte)bType.Cape)
                {

                    if (BKind == (byte)bKindWeapons.Sword && BType == (byte)bType.Weapon)
                    {
                        b = new Sword();
                    }
                    if (BKind == (byte)bKindWeapons.Blade && BType == (byte)bType.Weapon)
                    {
                        b = new Blade();
                    }
                    if (BKind == (byte)bKindWeapons.Fan && BType == (byte)bType.Weapon)
                    {
                        b = new Fan();
                    }
                    if (BKind == (byte)bKindWeapons.Brush && BType == (byte)bType.Weapon)
                    {
                        b = new Brush();
                    }
                    if (BKind == (byte)bKindWeapons.Claw && BType == (byte)bType.Weapon)
                    {
                        b = new Claw();
                    }
                    if (BKind == (byte)bKindWeapons.Axe && BType == (byte)bType.Weapon)
                    {
                        b = new Axe();
                    }
                    if (BKind == (byte)bKindWeapons.Talon && BType == (byte)bType.Weapon)
                    {
                        b = new Talon();
                    }
                    if (BKind == (byte)bKindWeapons.Tonfa && BType == (byte)bType.Weapon)
                    {
                        b = new Tonfa();
                    }
                    if (BKind == (byte)bKindArmors.SwordMan && BType == (byte)bType.Clothes)
                    {
                        b = new Clothes();
                    }
                    if (BKind == (byte)bKindArmors.Mage && BType == (byte)bType.Clothes)
                    {
                        b = new Dress();
                    }
                    if (BKind == (byte)bKindArmors.Warrior && BType == (byte)bType.Clothes)
                    {
                        b = new Armor();
                    }
                    if (BKind == (byte)bKindArmors.GhostFighter && BType == (byte)bType.Clothes)
                    {
                        b = new LeatherClothes();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Hat)
                    {
                        b = new Hood();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Hat)
                    {
                        b = new Tiara();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Hat)
                    {
                        b = new Helmet();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Hat)
                    {
                        b = new Hat();
                    }
                    if (BKind == (byte)bKindHats.SwordMan && BType == (byte)bType.Shoes)
                    {
                        b = new SmBoots();
                    }
                    if (BKind == (byte)bKindHats.Mage && BType == (byte)bType.Shoes)
                    {
                        b = new MageBoots();
                    }
                    if (BKind == (byte)bKindHats.Warrior && BType == (byte)bType.Shoes)
                    {
                        b = new WarriorShoes();
                    }
                    if (BKind == (byte)bKindHats.GhostFighter && BType == (byte)bType.Shoes)
                    {
                        b = new GhostFighterShoes();
                    }
                    if (BKind == 0 && BType == (byte)bType.Ring)
                    {
                        b = new Ring();
                    }
                    if (BKind == 0 && BType == (byte)bType.Necklace)
                    {
                        b = new Necklace();
                    }
                    if (BType == (byte)bType.Cape)
                    {
                        b = new Cape();
                        Cape c = b as Cape;
                        c.MaxPolishImbueTries = reader.GetInt16(ordinalITEM_MAXPOLISHTRIES);
                        c.PolishImbueTries = reader.GetByte(ordinalITEM_POLISHTRIES);
                    }

                    Equipment e = b as Equipment;
                    e.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    e.RequiredDexterity = reader.GetInt16(ordinalITEM_DEX);
                    e.RequiredStrength = reader.GetInt16(ordinalITEM_STR);
                    e.RequiredStamina = reader.GetInt16(ordinalITEM_STA);
                    e.RequiredEnergy = reader.GetInt16(ordinalITEM_ENE);
                    e.MaxImbueTries = reader.GetByte(ordinalITEM_MAXIMBUES);
                    e.Durability = reader.GetInt32(ordinalITEM_MAXDURA);
                    e.MaxDurability = reader.GetInt32(ordinalITEM_MAXDURA);
                    e.Damage = reader.GetInt32(ordinalITEM_DAMAGE);
                    e.Defence = reader.GetInt32(ordinalITEM_DEFENCE);
                    e.AttackRating = reader.GetInt32(ordinalITEM_ATTACKRATING);
                    e.AttackSpeed = reader.GetInt16(ordinalITEM_ATTACKSPEED);
                    e.AttackRange = reader.GetInt16(ordinalITEM_ATTACKRANGE);
                    e.IncMaxLife = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    e.IncMaxMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                    e.IncLifeRegen = reader.GetInt16(ordinalITEM_LIFEREGEN);
                    e.IncManaRegen = reader.GetInt16(ordinalITEM_MANAREGEN);
                    e.Critical = reader.GetInt16(ordinalITEM_CRITICAL);
                }

                if (BType == (byte)bType.ImbueItem)
                {
                    if (BKind == (byte)bKindStones.Black)
                    {
                        b = new Black();
                    }
                    if (BKind == (byte)bKindStones.White)
                    {
                        b = new White();
                    }
                    if (BKind == (byte)bKindStones.Red)
                    {
                        b = new Red();
                    }
                    if (BKind == (byte)bKindStones.Dragon)
                    {
                        b = new Dragon();
                    }
                    if (BKind == (byte)bKindStones.RbItem)
                    {
                        b = new RbHoleItem();
                    }

                    ImbueItem im = b as ImbueItem;
                    im.ImbueChance = reader.GetInt16(ordinalITEM_IMBUERATE);
                    im.IncreaseValue = reader.GetInt16(ordinalITEM_IMBUEINCREASE);
                }

                if (BType == (byte)bType.Potion)
                {
                    if (BKind == (byte)bKindPotions.Normal)
                    {
                        b = new Potion();
                    }
                    if (BKind == (byte)bKindPotions.Elixir)
                    {
                        b = new Elixir();
                    }

                    PotionItem pot = b as PotionItem;
                    pot.HealHp = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                    pot.HealMana = reader.GetInt16(ordinalITEM_INCMAXMANA);
                }
                if (BType == (byte)bType.Book)
                {
                    if (BKind == (byte)bKindBooks.SoftBook)
                    {
                        b = new SoftBook();
                    }
                    if (BKind == (byte)bKindBooks.HardBook)
                    {
                        b = new HardBook();
                    }
                    if (BKind == (byte)bKindBooks.RebirdBook)
                    {
                        b = new RebirthBook();
                    }
                    if (BKind == (byte)bKindBooks.FourthBook)
                    {
                        b = new FourthBook();
                    }
                    if (BKind == (byte)bKindBooks.FeSkillBook)
                    {
                        b = new FeSkillBook();
                    }
                    if (BKind == (byte)bKindBooks.FeBook)
                    {
                        b = new FiveElementBook();
                    }
                    if (BKind == (byte)bKindBooks.FocusBook)
                    {
                        b = new FocusBook();
                    }

                    BookItem book = b as BookItem;
                    book.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                    book.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    book.SkillID = reader.GetInt32(ordinalITEM_BOOKSKILLID);
                    book.SkillLevel = reader.GetByte(ordinalITEM_BOOKSKILLLEVEL);
                    book.SkillData = reader.GetInt32(ordinalITEM_BOOKSKILLDATA);
                }
                if (BType == (byte)bType.Bead)
                {
                    if (BKind == (byte)bKindBeads.Normal)
                    {
                        b = new Bead();
                    }
                    BeadItem bead = b as BeadItem;
                    bead.ToMapID = reader.GetInt32(ordinalITEM_TOMAPID);
                }
                if (BType == (byte)bType.StoreTag)
                {
                    b = new StoreTag();

                    StoreTag tag = b as StoreTag;
                    tag.TimeLeft = reader.GetInt16(ordinalITEM_MAXDURA);
                    tag.TimeMax = reader.GetInt16(ordinalITEM_MAXDURA);
                }
                if (BType == (byte)bType.PetItem)
                {
                    if (BKind == (byte)bKindPetItems.Taming)
                        b = new TameItem();
                    if (BKind == (byte)bKindPetItems.Food)
                        b = new PetFood();
                    if (BKind == (byte)bKindPetItems.Potion)
                        b = new PetPotion();
                    if (BKind == (byte)bKindPetItems.Resurect)
                        b = new PetResurrectItem();

                    PetItem p = b as PetItem;
                    p.TameChance = reader.GetInt16(ordinalITEM_IMBUERATE);
                    p.DecreaseWildness = reader.GetInt16(ordinalITEM_IMBUEINCREASE);
                    p.HealLife = reader.GetInt16(ordinalITEM_INCMAXLIFE);
                }
                if (BType == (byte)bType.Pill)
                {
                    if (BKind == (byte)bKindPills.Rebirth)
                        b = new RebirthPill();

                    RebirthPill p = b as RebirthPill;
                    p.RequiredLevel = reader.GetInt16(ordinalITEM_LEVEL);
                    p.RequiredRebirth = reader.GetByte(ordinalITEM_CLASS);
                    p.ToRebirth = (byte)(p.RequiredRebirth + 1);
                    p.IncreaseSp = reader.GetInt16(ordinalITEM_DEX);
                }

                b.ItemID = 0;
                b.OwnerID = 0;
                b.ReferenceID = reader.GetInt16(ordinalITEM_REFERENCEID);
                b.VisualID = reader.GetInt16(ordinalITEM_VISUALID);
                b.Bag = 0;
                b.Slot = 0;
                b.bType = reader.GetByte(ordinalITEM_BTYPE);
                b.bKind = reader.GetByte(ordinalITEM_BKIND);
                b.RequiredClass = reader.GetByte(ordinalITEM_CLASS);
                b.Amount = 1;
                b.SizeX = reader.GetByte(ordinalITEM_SIZEX);
                b.SizeY = reader.GetByte(ordinalITEM_SIZEY);
                b.Price = reader.GetInt32(ordinalITEM_COST);
                items.Add(b);
            }

            reader.Close();
            _db.Close();

            if (items.Count > 0)
            {
                Random rand = new Random();
                int itemPos = rand.Next(0, items.Count);
                return items[itemPos];
            }
            else
                return null;
        }
コード例 #23
0
 void selectElement(Helmet e)
 {
     if (impressing)
     {
         CameraScript.data.Helmet = e;
         audio.PlayOneShot(equipSound);
     }
 }
コード例 #24
0
 // Use this for initialization
 void Start()
 {
     audioSource = GetComponent <AudioSource>();
     helmet      = GameObject.FindObjectOfType <Helmet>();
 }