示例#1
0
    public void GetSkillInfo(SkillInfo Value)
    {
        skillImage.sprite = Resources.Load<Sprite> ("SkillIcon/" + Value.ICon);
        GetComponent<RectTransform> ().localScale = new Vector3 (1.2f, 1.2f, 1.2f);

        skillText.text = "안녕하세양 \n" + Value.name + "\b" + Value.attribute;
    }
示例#2
0
	public void Init()
	{
		skillDict = new Dictionary<int, SkillInfo>();

		var skillGoHome = new SkillInfo() { 
			Id = 0, Name = "GoHome", AnimationClipName = "Recall",
			ReleaseType = SkillInfo.SkillReleaseType.ToDirection
		};

		var skill1 = new SkillInfo() { 
			Id = 1, Name = "Skill1", AnimationClipName = "Spell1", 
			ReleaseType = SkillInfo.SkillReleaseType.ToPoint
		};
		var skill2 = new SkillInfo() { 
			Id = 2, Name = "Skill2", AnimationClipName = "Spell2",
			ReleaseType = SkillInfo.SkillReleaseType.ToEntity
		};
		var skill3 = new SkillInfo() { 
			Id = 3, Name = "Skill3", AnimationClipName = "Spell3",
			ReleaseType = SkillInfo.SkillReleaseType.ToEntity
		};
		var skill4 = new SkillInfo() { 
			Id = 4, Name = "Skill4", AnimationClipName = "Ult",
			ReleaseType = SkillInfo.SkillReleaseType.ToDirection
		};

		skillDict.Add(skillGoHome.Id, skillGoHome);
		skillDict.Add(skill1.Id, skill1);
		skillDict.Add(skill2.Id, skill2);
		skillDict.Add(skill3.Id, skill3);
		skillDict.Add(skill4.Id, skill4);
	}
示例#3
0
    public SkillInfo readSkillToCode(int code)
    {
        sqlQuery = "select * from BasicSkillTable Where SkillCode = " + code.ToString();

        dbcmd.CommandText = sqlQuery;
        reader = dbcmd.ExecuteReader();

        reader.Read ();

        SkillInfo info = new SkillInfo ();

        info.skillCode 	= reader.GetInt32 (0);
        info.name 		= reader.GetString (1);
        info.prefabName	= reader.GetString (2);
        info.attribute	= reader.GetInt32 (3);
        info.demage 	= reader.GetInt32 (4);
        info.numberOfObject	= reader.GetInt32 (5);
        info.coolTime	= reader.GetFloat (6);
        info.useLimit	= reader.GetInt32 (7);
        info.etc1		= reader.GetInt32(8);
        info.etc2		= reader.GetInt32(9);
        info.etc3		= reader.GetInt32(10);
        info.ICon		= reader.GetString(11);

        reader.Close();
        reader = null;

        return info;
    }
示例#4
0
	protected override void OnDragDropStart()
    {
        base.OnDragDropStart();
        skillinfo = transform.parent.GetComponent<SkillItemUI>().skillinfo;
        transform.parent = transform.root;
        this.GetComponent<UISprite>().depth = 100;
    }
 public GameUIToolTip CreateSkillTooltip(Transform parent, SkillInfo skillInfo)
 {
     Tools.Assert(parent, "Invalid parent");
     this.mStringBuilder.Remove(0, this.mStringBuilder.Length);
     this.mStringBuilder.Append("Tooltip_").Append(skillInfo.ID);
     return this.LoadItemToolTipPerfab(parent, this.mStringBuilder.ToString());
 }
    public SkillInfo AddSkill(int objID,int skillID, int icon,float cooldownTime,bool canSelect = true)
    {
        GameObject panelObj = Utility.AttachUIAsset(panelSkill, prefabSkillIcon, "SkillIcon");

        SkillInfo skill = new SkillInfo();
        skill.icon = panelObj.GetComponent<SkillIconInfo>();
        skill.icon.gameObject.SetActive(true);

        skill.icon.head.sprite = SpriteManager.GetSkillIcon(icon);
        skill.icon.deadMask.gameObject.SetActive(false);
        skill.icon.button.enabled = canSelect;
        skill.objID = objID;
        skill.cooldownTime = cooldownTime;
        skill.skillID = skillID;
        skill.icon.skillIdTxt.text = skillID.ToString();

        skills.Add(skill);
        UIEventTrigger.Get(skill.icon.button).onClick = () => {
            if (!skill.isCoolingDown && !skill.isEmpty) {
                onSelectSkill(objID,skillID);
            }
        };
        RefreshSkillPosition();
        return skill;
    }
示例#7
0
    public void setSkillInfo(SkillInfo info)
    {
        skillinfo = info;

        icon.spriteName = skillinfo.icon;
        namelbl.text = skillinfo.skillname;
        switch(skillinfo.applyType)
        {
            case ApplyType.Buff:
                typelbl.text = "增强";
                break;
            case ApplyType.Passive:
                typelbl.text = "增益";
                break;
            case ApplyType.SingleTarget:
                typelbl.text = "单个目标";
                break;
            case ApplyType.MultiTarget:
                typelbl.text = "多个目标";
                break;
        }

        desclbl.text = skillinfo.des;
        mplbl.text = skillinfo.mp + "MP";
    }
	// Update is called once per frame
	void Update () {
		//Press any keys
		if (Input.GetKeyDown (keyCode)) {
			//key W, add HP skill.
			if (keyCode == KeyCode.W) {
				//set the skill information
				skillInfo = SkillsInfo._instance.GetSkillInfoById(5002);
				//release the skill
				//1.get the skill required mp
				bool success = ps.GetMP(skillInfo.mp);
				if (success) {
					//use the MP,release the skill
					pa.UseSkill(skillInfo);
				} else {
				
				}
			}
			//key E, add MP skill
			else if(keyCode == KeyCode.E){
				skillInfo = SkillsInfo._instance.GetSkillInfoById(5003);
				pa.UseSkill(skillInfo);
			}
			//Key R, buff attack
			else if(keyCode == KeyCode.R){
				skillInfo = SkillsInfo._instance.GetSkillInfoById(5004);
				bool success = ps.GetMP(skillInfo.mp);
				if (success) {
					pa.UseSkill(skillInfo);
				}
			}
			//Key T, buff attack speed
			else if(keyCode == KeyCode.T){
				skillInfo = SkillsInfo._instance.GetSkillInfoById(5005);
				bool success = ps.GetMP(skillInfo.mp);
				if (success) {
					pa.UseSkill(skillInfo);
				}
			}
			//Key Q, magic ball
			else if(keyCode == KeyCode.Q){
				skillInfo = SkillsInfo._instance.GetSkillInfoById(5001);
				bool success = ps.GetMP(skillInfo.mp);
				if (success) {
					pa.UseSkill(skillInfo);
				}
			}
			//Key Y, multi target skill
			else if(keyCode == KeyCode.Y){
				skillInfo = SkillsInfo._instance.GetSkillInfoById(5006);
				bool success = ps.GetMP(skillInfo.mp);
				if (success) {
					pa.UseSkill(skillInfo);
				}
			}
		} 

	

	}
示例#9
0
 public void SetSkills(SkillInfo[] skills)
 {
     if (skills.Length != numskills) { return; }
     for (int i = 0; i < numskills; i++)
     {
         this.PutUInt(skills[i].skillID);
         this.PutUInt(skills[i].exp);
         this.PutByte(skills[i].unknown);
     }
 }
示例#10
0
	//更新显示技能
	public void setskill(int id){
		this.id = id;
		this.skillinfoicon = SkillsInfo._instance.GetSkillInfoById (id);//取出对应id的信息
		//将此id显示出来
		iconsprite.gameObject.SetActive (true);
		iconsprite.spriteName = skillinfoicon.icon_name;
		typexu = shortcuttype.Skill;


	}
示例#11
0
 public override void UseSkill(SkillInfo info)
 {
     info = new SkillInfo(() => { }, PlayerControll.Instance.gameObject, PlayerControll.Instance.transform.position + PlayerControll.Instance.transform.forward * 20);
     //info.SkillUser.GetComponent<MonoBehaviour>().StartCoroutine(PushAnimation(info.SkillUser, info.TargetPosition, info.AfterUsing));
     GlobalEvents.Instance.SlowMotion();
     LinePointer.Instance.ActivateLinePointer(x => {
         info.SkillUser.GetComponent<MonoBehaviour>().StartCoroutine(PushAnimation(info.SkillUser, x, info.AfterUsing));
         GlobalEvents.Instance.UnSlowMotion();
         StartSlowMotion(0.2f, 0.1f);
     });
 }
示例#12
0
 public override void UseSkill(SkillInfo info)
 {
     GlobalEvents.Instance.SlowMotion();
     LinePointer.Instance.ActivateLinePointer(x =>
     {
         FolowObject.Instance.StartShake(0.11f);
         PlayerControll.Instance.transform.rotation = Quaternion.LookRotation((x - PlayerControll.Instance.transform.position).normalized);
         PlayerControll.Instance.StartCoroutine(Tossing());
         GlobalEvents.Instance.UnSlowMotion();
         StartSlowMotion(0.1f, 0.2f);
     });
 }
示例#13
0
 public void ShowSummonSkills(PetDataEx petData, PetInfo petInfo = null)
 {
     if (petData != null)
     {
         this.mActiveSkillInfo = petData.GetPlayerSkillInfo();
         if (this.mActiveSkillInfo != null)
         {
             Texture mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false);
             this.mActiveSkill.mainTexture = mainTexture;
         }
         else
         {
             this.mActiveSkill.mainTexture = null;
         }
     }
     else
     {
         this.mActiveSkill.mainTexture = null;
     }
     if (this.mPassiveSkills[0] != null && petData != null)
     {
         int i = 0;
         for (int j = 0; j < 3; j++)
         {
             this.mPassiveSkillInfos[i] = petData.GetSkillInfo(1 + j);
             if (this.mPassiveSkillInfos[i] != null && this.mPassiveSkillInfos[i].ID != 0)
             {
                 this.mPassiveSkills[i].gameObject.SetActive(true);
                 if (j == 0 || (ulong)petData.Data.Further > (ulong)((long)(j + 1)))
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(true);
                     this.mPassiveSkillIconGreys[i].gameObject.SetActive(false);
                     this.mPassiveSkillIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                 }
                 else
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(false);
                     this.mPassiveSkillIconGreys[i].gameObject.SetActive(true);
                     this.mPassiveSkillIconGreys[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                 }
                 i++;
             }
         }
         while (i < 3)
         {
             this.mPassiveSkillInfos[i] = null;
             this.mPassiveSkills[i].gameObject.SetActive(false);
             i++;
         }
     }
 }
示例#14
0
 public void SetSkills(SkillInfo[] skills)
 {
     if (skills.Length != numskills) { return; }
     for (int i = 0; i < numskills; i++)
     {
         Skills.Skill skill = Skills.SkillFactory.GetSkill(skills[i].skillID);
         for (int j = 0; j < skill.special; j++)
         {
             this.PutUInt(skills[i].skillID, (ushort)(4 + j * 9 + skills[i].slot * 9));
             this.PutUInt(skills[i].exp, (ushort)(8 + j * 9 + skills[i].slot * 9));
             this.PutByte((byte)(skills[i].slot + j), (ushort)(12 + j * 9 + skills[i].slot * 9));
         }
     }
 }
示例#15
0
	//快捷栏是用药品
public void OnDrugUse(){
	bool sucess=	Inventory._instance.minusID (id,1);
		if (sucess) {
						psxu.GetDrug (objectinfoxu.hp, objectinfoxu.mp);		
				}
		//如果不能用
		else {
			typexu=shortcuttype.None;
			iconsprite.gameObject.SetActive(false);
			id=0;
			skillinfoicon=null;
			objectinfoxu=null;

		}
	}
示例#16
0
	    public RewardGump( SkillInfo skill, int currentHue, string name, int itemid ) : base( 100, 100 )
		{
			m_Skill = skill;
			m_CurrentHue = currentHue;
			m_Name = name;
	        m_Itemid = itemid;


			Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = false;
            AddPage(0);
            AddImageTiled(126, 125, 200, 227, 3504);
            AddImageTiled(318, 125, 24, 227, 3505);
            AddImageTiled(105, 125, 23, 227, 3503);
            AddImageTiled(126, 102, 195, 24, 3501);
            AddImageTiled(119, 342, 212, 26, 3507);
            AddImage(105, 102, 3500);
            AddImage(318, 102, 3502);
            AddImage(105, 342, 3506);
            AddImage(318, 342, 3508);
            AddImageTiled(151, 297, 146, 25, 3507);
            AddImage(296, 276, 3502);
            AddImage(296, 297, 3508);
            AddButton(126, 205, 5600, 5604, (int)Buttons.upButton, GumpButtonType.Reply, 0);
            AddButton(126, 225, 5602, 5606, (int)Buttons.downButton, GumpButtonType.Reply, 0);
            AddImageTiled(140, 276, 159, 14, 3501);
            AddImage(126, 276, 3500);
            AddImage(126, 297, 3506);
            AddImageTiled(151, 290, 148, 8, 3504);
            AddButton(161, 333, 2124, 2123, (int)Buttons.applyButton, GumpButtonType.Reply, 0);
            AddButton(237, 333, 2130, 2129, (int)Buttons.okButton, GumpButtonType.Reply, 0);
            AddLabel(150, 121, 347, GetSkillTitle());
            AddLabel(128, 160, 347, @"Congrats! Enter a colour code:");
            AddLabel(147, 263, 347, @"Enter a name in the box:");
            AddImage(311, 113, 2530);
            AddImage(121, 325, 2530);
            AddImage(145, 200, 3500);
            AddImageTiled(170, 220, 55, 26, 3507);
            AddImageTiled(170, 200, 55, 26, 3501);
            AddImage(145, 220, 3506);
            AddImage(218, 220, 3508);
            AddImage(218, 200, 3502);
            AddItem( 268, 211, GetItemId(), m_CurrentHue );
            AddTextEntry( 154, 291, 136, 19, 0, (int)Buttons.nameEntry, m_Name );
            AddTextEntry( 172, 214, 40, 19, 0, (int)Buttons.colorCodeEntry, Convert.ToString( m_CurrentHue ) );
		}
示例#17
0
    //If player attack, calculate damage
    public int BattleDamageCalculate(SkillInfo usedSkill, Student attacker, Student defenser, int[] _battleTempStat)
    {
        if (usedSkill.retGiveStatus() != status.none)
            defenser.giveAStatus(usedSkill.retGiveStatus());
        usedSkill.decChance();
        int attributeRelation1 = (int)attacker.getStuIndex() / 10;
        int attributeRelation2 = (int)defenser.getStuIndex() / 10;

        double AttackRate = 1;   //find attack is special attack or normal attack
        double damage = 0;       //return total damage that defenser have to take
        float AttributeCal = 1; //Calculate damage Changed by AttributeCal
        float[] battleTempStat = new float[12];

        if(usedSkill.retType() == attributeRelation1) //if Attacker type and used Skill type is same, get bonus damage
        {AttributeCal *= 1.5f;}

        int RandomRate  = (int)Random.Range(217,255)*100/255;    //make random damage;

        for (int i = 0; i < 12; i++)
        {
            if (_battleTempStat[i] > 0)
                battleTempStat[i] = (2 + _battleTempStat[i]) / (float)(_battleTempStat[i]);
            else if (_battleTempStat[i] < 0)
                battleTempStat[i] = (float)(2) / (2 + _battleTempStat[i]);
            else
                battleTempStat[i] = 1;
        }

        if (usedSkill.retAtkType() == 0)
        {  //calculate the damage of
            AttackRate = (usedSkill.retDamage())*(attacker.retStuStat(0))*battleTempStat[0]/(defenser.retStuStat(2)/battleTempStat[8]);
        }else        {
            AttackRate = (usedSkill.retDamage())*(attacker.retStuStat(1))*battleTempStat[1]/(defenser.retStuStat(3)/battleTempStat[9]);
        }

        damage =(((
                    (
                        (attacker.retStuStat(6)*2/5)+2  //attackers level
                    )
                    *AttackRate/50                          //used skill damage * attacker,defensers ability
                )+2)
                *RandomRate/100                             //random damage
                *AttributeCal*Attribute.attribute[attributeRelation1,attributeRelation2] //attribute;
                );

        return (int)damage;
    }
示例#18
0
 public SkillList(ServerPacket pck)
     : base(pck)
 {
     int count = ReadInt();
     this.Skills = new List<SkillInfo>(count);
     for (int i = 0; i < count; i++)
     {
         var info = new SkillInfo();
         info.Passive = ReadInt();
         info.Level = ReadInt();
         info.SkillID = ReadInt();
         this.Position += 4;
         info.IsDisabled = ReadByte();
         info.CanEnchant = ReadByte();
         this.Skills.Add(info);
     }
 }
示例#19
0
 public void Refresh(LopetDataEx lopetData)
 {
     if (lopetData == null)
     {
         this.mActive.SetActive(false);
         return;
     }
     this.mActive.SetActive(true);
     this.mActiveSkillInfo = lopetData.GetPlayerSkillInfo();
     if (this.mActiveSkillInfo != null)
     {
         this.mActiveSkill.mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false);
     }
     else
     {
         this.mActiveSkill.mainTexture = null;
     }
 }
示例#20
0
	//show the update skills
	public void SetId(int id) {
		InitProperty();
		this.id = id;
		info = SkillsInfo._instance.GetSkillInfoById(id);
		iconname_sprite.spriteName = info.icon_name;
		name_label.text = info.name;
		switch (info.applyType) {
		case ApplyType.Passive:
			applytype_label.text = "Passive";
			break;
		case ApplyType.Buff:
			applytype_label.text = "Buff";
			break;
		case ApplyType.SingleTarget:
			applytype_label.text = "Single Target";
			break;
		case ApplyType.MultiTarget:
			applytype_label.text = "Multi Target";
			break;
		}
		des_label.text = info.des;
		mp_label.text = info.mp + "MP";
	}
示例#21
0
 public void Refresh()
 {
     PetDataEx curPetDataEx = this.mBaseScene.CurPetDataEx;
     if (curPetDataEx != null)
     {
         this.mActiveSkillInfo = curPetDataEx.GetPlayerSkillInfo();
         if (this.mActiveSkillInfo != null)
         {
             Texture mainTexture = Res.Load<Texture>(string.Format("icon/skill/{0}", this.mActiveSkillInfo.Icon), false);
             this.mActiveSkill.mainTexture = mainTexture;
         }
         else
         {
             this.mActiveSkill.mainTexture = null;
         }
         this.mPassiveUnlock[0] = true;
         this.mSkillArrayIndex[0] = 0;
         int i = 0;
         for (int j = 0; j < 3; j++)
         {
             this.mPassiveSkillInfos[i] = curPetDataEx.GetSkillInfo(1 + j);
             if (this.mPassiveSkillInfos[i] != null && this.mPassiveSkillInfos[i].ID != 0)
             {
                 this.mPassiveSkills[i].gameObject.SetActive(true);
                 this.mSkillArrayIndex[i + 1] = j + 1;
                 if (j == 0 || (ulong)curPetDataEx.Data.Further > (ulong)((long)(j + 1)))
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(true);
                     this.mPassiveSkillGreyIcons[i].gameObject.SetActive(false);
                     this.mPassiveSkillIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                     this.mPassiveUnlock[i + 1] = true;
                 }
                 else
                 {
                     this.mPassiveSkillIcons[i].gameObject.SetActive(false);
                     this.mPassiveSkillGreyIcons[i].gameObject.SetActive(true);
                     this.mPassiveSkillGreyIcons[i].spriteName = this.mPassiveSkillInfos[i].Icon;
                     this.mPassiveUnlock[i + 1] = false;
                 }
                 i++;
             }
         }
         while (i < 3)
         {
             this.mPassiveSkillInfos[i] = null;
             this.mPassiveSkills[i].gameObject.SetActive(false);
             this.mPassiveUnlock[i + 1] = false;
             i++;
         }
         this.SetSkillState();
     }
     this.mBaseScene.ShowPetSkillUpNewMark = Tools.CanPetSkillLvlUp(curPetDataEx);
 }
示例#22
0
	//增强
	IEnumerator  OnBuffUse(SkillInfo info){
		playerattackxu = PlayerAttackState.Skill_attack;
		animation.CrossFade (info.aniname);
		yield return new WaitForSeconds(info.anitime);
		playerattackxu = PlayerAttackState.ControllWalk;
		switch (info.applyPro) {
		case ApplyProperty.Attack:
			psxu.attack*=(info.applyValue/100f);
			break;
		case ApplyProperty.Def:
			psxu.def*=(info.applyValue/100f);
			break;
		case ApplyProperty.AttackSpeed:
			attack_rate*=(info.applyValue/100f);
			break;
		case ApplyProperty.Speed:
			movexu.speed*=(info.applyValue/100f);
			break;
		}
		yield return new WaitForSeconds(info.applyTime);
		switch (info.applyPro) {
		case ApplyProperty.Attack:
			psxu.attack/=(info.applyValue/100f);
			break;
		case ApplyProperty.Def:
			psxu.def/=(info.applyValue/100f);
			break;
		case ApplyProperty.AttackSpeed:
			attack_rate/=(info.applyValue/100f);
			break;
		case ApplyProperty.Speed:
			movexu.speed/=(info.applyValue/100f);
			break;
		}
		//实例化特效
		GameObject prefab = null;
		skillIeffectDict.TryGetValue (info.efx_name, out prefab);
		GameObject.Instantiate (prefab, transform .position, Quaternion.identity);
	}
示例#23
0
		private static void InvokeRewardGump( Mobile from, SkillInfo skillInfo )
		{
            Skills skills = from.Skills;
			switch( skillInfo.SkillID )
			{
				case 0: // Alchemy
				case 7: // Blacksmithy
				case 8: // Bowcraft/fletching
				case 23: // Inscription
				case 25: // Magery
				case 34: // Tailoring
				case 35: // Animal Taming
                case 44: // Lumberjack
                case 45: // Mining
					from.SendGump( new RewardGump( skillInfo, 0, "Name" ) );
					break;
                //Bardic skills, player gets to choose item
                case 9:
                case 15:
                case 22:
                case 29:
                    if (skills.Peacemaking.Base == 100.0 && skills.Discordance.Base == 100.0 && skills.Provocation.Base == 100.0 && skills.Musicianship.Base == 100.0)
			            from.SendGump(new ChooseBardRewardGump());
			        break;
                case 11: // Carpentry
                    from.SendGump(new ChooseCarpRewardGump());
                    break;
                 //"Thieving" skills
                case 21:
                case 28:
                case 33:
                case 47:
                    if (skills.Hiding.Base == 100.0 && skills.Stealth.Base == 100.0 && skills.Snooping.Base == 100.0 && skills.Stealing.Base == 100.0)
                        from.SendGump(new RewardGump(skillInfo, 0, "Name"));
			        break;
			    default:
					break;
			}
		}
示例#24
0
        protected override object this[string index]
        {
            get
            {
                #region
                switch (index)
                {
                case "GeneralID": return(GeneralID);

                case "HeadID": return(HeadID);

                case "PicturesID": return(PicturesID);

                case "GeneralName": return(GeneralName);

                case "GeneralLv": return(GeneralLv);

                case "LifeNum": return(LifeNum);

                case "CareerID": return(CareerID);

                case "PowerNum": return(PowerNum);

                case "SoulNum": return(SoulNum);

                case "IntellectNum": return(IntellectNum);

                case "HitProbability": return(HitProbability);

                case "AbilityID": return(AbilityID);

                case "IsRecruit": return(IsRecruit);

                case "ShowFilter": return(ShowFilter);

                case "RecruitFilter": return(RecruitFilter);

                case "GiftType": return(GiftType);

                case "Description": return(Description);

                case "ReplaceSkills": return(ReplaceSkills);

                case "GeneralType": return(GeneralType);

                case "SoulID": return(SoulID);

                case "DemandNum": return(DemandNum);

                case "Mature": return(Mature);

                case "GeneralQuality": return(GeneralQuality);

                case "ItemID": return(ItemID);

                case "BattleHeadID": return(BattleHeadID);

                case "IsConscribe": return(IsConscribe);

                default: throw new ArgumentException(string.Format("GeneralInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
            set
            {
                #region
                switch (index)
                {
                case "GeneralID":
                    _GeneralID = value.ToInt();
                    break;

                case "HeadID":
                    _HeadID = value.ToNotNullString();
                    break;

                case "PicturesID":
                    _PicturesID = value.ToNotNullString();
                    break;

                case "GeneralName":
                    _GeneralName = value.ToNotNullString();
                    break;

                case "GeneralLv":
                    _GeneralLv = value.ToShort();
                    break;

                case "LifeNum":
                    _LifeNum = value.ToInt();
                    break;

                case "CareerID":
                    _CareerID = value.ToShort();
                    break;

                case "PowerNum":
                    _PowerNum = value.ToShort();
                    break;

                case "SoulNum":
                    _SoulNum = value.ToShort();
                    break;

                case "IntellectNum":
                    _IntellectNum = value.ToShort();
                    break;

                case "HitProbability":
                    _HitProbability = value.ToDecimal();
                    break;

                case "AbilityID":
                    _AbilityID = value.ToInt();
                    break;

                case "IsRecruit":
                    _IsRecruit = value.ToBool();
                    break;

                case "ShowFilter":
                    _ShowFilter = ConvertCustomField <CacheList <ShowFilterInfo> >(value, index);
                    break;

                case "RecruitFilter":
                    _RecruitFilter = ConvertCustomField <CacheList <RecruitFilter> >(value, index);
                    break;

                case "Description":
                    _Description = value.ToNotNullString();
                    break;

                case "GiftType":
                    _GiftType = value.ToEnum <GiftType>();
                    break;

                case "ReplaceSkills":
                    _ReplaceSkills = ConvertCustomField <SkillInfo>(value, index);
                    break;

                case "GeneralType":
                    _GeneralType = value.ToEnum <GeneralType>();
                    break;

                case "SoulID":
                    _SoulID = value.ToInt();
                    break;

                case "DemandNum":
                    _DemandNum = value.ToInt();
                    break;

                case "Mature":
                    _Mature = ConvertCustomField <CacheList <GeneralProperty> >(value, index);
                    break;

                case "GeneralQuality":
                    _GeneralQuality = value.ToEnum <GeneralQuality>();
                    break;

                case "ItemID":
                    _ItemID = value.ToInt();
                    break;

                case "BattleHeadID":
                    _BattleHeadID = value.ToNotNullString();
                    break;

                case "IsConscribe":
                    _IsConscribe = value.ToBool();
                    break;

                default: throw new ArgumentException(string.Format("GeneralInfo index[{0}] isn't exist.", index));
                }
                #endregion
            }
        }
示例#25
0
    private bool CombatHandler(EntityInfo npc, AiStateInfo info, long deltaTime)
    {
        if (npc.GetSkillStateInfo().IsSkillActivated())
        {
            return(true);
        }

        EntityInfo leader = AiLogicUtility.GetLivingCharacterInfoHelper(npc, info.LeaderID);

        ScriptRuntime.Vector3 srcPos  = npc.GetMovementStateInfo().GetPosition3D();
        ScriptRuntime.Vector3 homePos = ScriptRuntime.Vector3.Zero;
        if (null != leader)
        {
            homePos = GetHomePos(npc.GetMovementStateInfo().FormationIndex, leader);
        }
        float distSqrToHome = Geometry.DistanceSquare(srcPos, homePos);

        if (distSqrToHome > npc.GohomeRange * npc.GohomeRange)
        {
            AiCommand.AiStopPursue(npc);
            info.ChangeToState((int)AiStateId.Gohome);
            return(true);
        }

        ///
        EntityInfo     attackTarget = null;
        SkillStateInfo currSkInfo   = npc.GetSkillStateInfo();
        ///找到可以使用的技能
        SkillInfo skInfo = AiLogicUtility.NpcFindCanUseSkill(npc);

        AiCommand.AiSelectSkill(npc, skInfo);
        if (skInfo == null)
        {
            //没有可以使用的技能就切换到Idle状态
            info.ChangeToState((int)PredefinedAiStateId.Idle);
            return(false);
        }

        CharacterRelation relation =
            (skInfo.TargetType == SkillTargetType.Friend ||
             skInfo.TargetType == SkillTargetType.RandFriend) ?
            CharacterRelation.RELATION_FRIEND :
            CharacterRelation.RELATION_ENEMY;

        attackTarget = AiLogicUtility.GetNearstTargetHelper(
            npc, skInfo.Distance, relation);

        if (attackTarget != null && null != skInfo)   //攻击范围内找到可攻击目标
        {
            info.Target = attackTarget.GetId();
            AiCommand.AiStopPursue(npc);
            AiCommand.AiSkill(npc, skInfo.SkillId); //攻击目标
            return(true);
        }
        attackTarget = AiLogicUtility.GetNearstTargetHelper(
            npc, npc.ViewRange, relation);
        if (attackTarget != null)                                                         //视野范围内找到可攻击目标
        {
            AiCommand.AiPursue(npc, attackTarget.GetMovementStateInfo().GetPosition3D()); // 追赶目标
            return(true);
        }

        currSkInfo.SetCurSkillInfo(0);
        AiCommand.AiStopPursue(npc);
        info.ChangeToState((int)AiStateId.Gohome);
        return(true);
    }
示例#26
0
 public void DeleteSkill(ActorPC pc, SkillInfo skill)
 {
 }
示例#27
0
        public static void Gain(Mobile from, Skill skill)
        {
            if (from.Region.IsPartOf <Regions.Jail>())
            {
                return;
            }

            if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
            {
                return;
            }

            if (skill.SkillName == SkillName.Focus && from is BaseCreature && (!PetTrainingHelper.Enabled || !((BaseCreature)from).Controlled))
            {
                return;
            }

            if (skill.Base < skill.Cap && skill.Lock == SkillLock.Up)
            {
                int    toGain = 1;
                Skills skills = from.Skills;

                if (from is PlayerMobile && Siege.SiegeShard)
                {
                    int minsPerGain = Siege.MinutesPerGain(from, skill);

                    if (minsPerGain > 0)
                    {
                        if (Siege.CheckSkillGain((PlayerMobile)from, minsPerGain, skill))
                        {
                            if (from is PlayerMobile)
                            {
                                CheckReduceSkill((PlayerMobile)from, skills, toGain, skill);
                            }

                            if (skills.Total + toGain <= skills.Cap)
                            {
                                skill.BaseFixedPoint += toGain;
                            }
                        }

                        return;
                    }
                }

                if (skill.Base <= 10.0)
                {
                    toGain = Utility.Random(4) + 1;
                }

                #region Mondain's Legacy
                if (from is PlayerMobile && Server.Engines.Quests.QuestHelper.EnhancedSkill((PlayerMobile)from, skill))
                {
                    toGain *= Utility.RandomMinMax(2, 4);
                }
                #endregion

                #region Scroll of Alacrity
                if (from is PlayerMobile && skill.SkillName == ((PlayerMobile)from).AcceleratedSkill && ((PlayerMobile)from).AcceleratedStart > DateTime.UtcNow)
                {
                    ((PlayerMobile)from).SendLocalizedMessage(1077956); // You are infused with intense energy. You are under the effects of an accelerated skillgain scroll.
                    toGain = Utility.RandomMinMax(2, 5);
                }
                #endregion

                #region Skill Masteries
                else if (from is BaseCreature && (((BaseCreature)from).Controlled || ((BaseCreature)from).Summoned))
                {
                    Mobile master = ((BaseCreature)from).GetMaster();

                    if (master != null)
                    {
                        WhisperingSpell spell = SkillMasterySpell.GetSpell(master, typeof(WhisperingSpell)) as WhisperingSpell;

                        if (spell != null && master.InRange(from.Location, spell.PartyRange) && master.Map == from.Map && spell.EnhancedGainChance >= Utility.Random(100))
                        {
                            toGain = Utility.RandomMinMax(2, 5);
                        }
                    }
                }
                #endregion

                if (from is PlayerMobile)
                {
                    CheckReduceSkill((PlayerMobile)from, skills, toGain, skill);
                }

                if (!from.Player || (skills.Total + toGain <= skills.Cap))
                {
                    skill.BaseFixedPoint = Math.Min(skill.CapFixedPoint, skill.BaseFixedPoint + toGain);

                    if (from is PlayerMobile)
                    {
                        UpdateGGS(from, skill);
                    }
                }
            }

            #region Mondain's Legacy
            if (from is PlayerMobile)
            {
                Server.Engines.Quests.QuestHelper.CheckSkill((PlayerMobile)from, skill);
            }
            #endregion

            if (skill.Lock == SkillLock.Up && (!Siege.SiegeShard || !(from is PlayerMobile) || Siege.CanGainStat((PlayerMobile)from)))
            {
                SkillInfo info = skill.Info;

                // Old gain mechanic
                if (!Core.ML)
                {
                    if (from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble())
                    {
                        GainStat(from, Stat.Str);
                    }
                    else if (from.DexLock == StatLockType.Up && (info.DexGain / 33.3) > Utility.RandomDouble())
                    {
                        GainStat(from, Stat.Dex);
                    }
                    else if (from.IntLock == StatLockType.Up && (info.IntGain / 33.3) > Utility.RandomDouble())
                    {
                        GainStat(from, Stat.Int);
                    }
                }
                else
                {
                    TryStatGain(info, from);
                }
            }
        }
示例#28
0
        //void ConnectToDB()
        // {
        //     using (objConn = new SqlConnection(Database.ConnectionString))
        //     {
        //         try
        //         {
        //             objConn.Open();
        //         }
        //         catch (Exception e)
        //         {
        //             Console.WriteLine(e.Message);
        //         }
        //     }
        // }

        public bool CreateSkill(SkillInfo objSkillInfo)
        {
            string   skillName        = objSkillInfo.SkillName;
            string   skillDescription = objSkillInfo.SkillDescription;
            int      categoryId       = objSkillInfo.CategoryId;
            int      createdBy        = objSkillInfo.CreatedBy;
            DateTime createdDate      = DateTime.Now;
            int      lastModifiedBy   = objSkillInfo.LastModifiedBy;
            DateTime lastModifiedDate = DateTime.Now;

            objConn             = new SqlConnection(Database.ConnectionString);
            objComm             = new SqlCommand(Database.CreateSkill, objConn);
            objComm.CommandType = CommandType.StoredProcedure;

            objSP_SkillName        = new SqlParameter("@SkillName", SqlDbType.VarChar, 50);
            objSP_SkillDescription = new SqlParameter("@SkillDescription", SqlDbType.VarChar, 50);
            objSP_CategoryId       = new SqlParameter("@CategoryId", SqlDbType.Int);
            objSP_CreatedBy        = new SqlParameter("@CreatedBy", SqlDbType.Int);
            objSP_CreatedDate      = new SqlParameter("@CreatedDate", SqlDbType.DateTime);
            objSP_LastModifiedBy   = new SqlParameter("@LastModifiedBy", SqlDbType.Int);
            objSP_LastModifiedDate = new SqlParameter("@LastModifiedDate", SqlDbType.DateTime);

            objSP_SkillName.Direction        = ParameterDirection.Input;
            objSP_SkillDescription.Direction = ParameterDirection.Input;
            objSP_CategoryId.Direction       = ParameterDirection.Input;
            objSP_CreatedBy.Direction        = ParameterDirection.Input;
            objSP_CreatedDate.Direction      = ParameterDirection.Input;
            objSP_LastModifiedBy.Direction   = ParameterDirection.Input;
            objSP_LastModifiedDate.Direction = ParameterDirection.Input;

            objComm.Parameters.Add(objSP_SkillName);
            objComm.Parameters.Add(objSP_SkillDescription);
            objComm.Parameters.Add(objSP_CategoryId);
            objComm.Parameters.Add(objSP_CreatedBy);
            objComm.Parameters.Add(objSP_CreatedDate);
            objComm.Parameters.Add(objSP_LastModifiedBy);
            objComm.Parameters.Add(objSP_LastModifiedDate);

            objSP_SkillName.Value        = skillName;
            objSP_SkillDescription.Value = skillDescription;
            objSP_CategoryId.Value       = categoryId;
            objSP_CreatedBy.Value        = createdBy;
            objSP_CreatedDate.Value      = createdDate;
            objSP_LastModifiedBy.Value   = lastModifiedBy;
            objSP_LastModifiedDate.Value = lastModifiedDate;

            try
            {
                objConn.Open();

                int rowsAffected = objComm.ExecuteNonQuery();
                if (rowsAffected > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
            }
            finally
            {
                objConn.Close();
            }
            return(false);
        }
示例#29
0
			public SkillDistribution( SkillInfo skill )
			{
				m_Skill = skill;
			}
示例#30
0
        private void SummonPartner()
        {
            RoleInfo roleself = LobbyClient.Instance.CurrentRole;

            if (null == roleself)
            {
                return;
            }
            roleself.PartnerStateInfo.ActivePartnerHpPercent = 1.0f;
            if (WorldSystem.Instance.IsPveScene())
            {
                UserInfo playerself = WorldSystem.Instance.GetPlayerSelf();
                if (null == playerself)
                {
                    return;
                }
                ///
                // summonpartner
                PartnerInfo partnerInfo = roleself.PartnerStateInfo.GetActivePartner();
                if (null != partnerInfo && (TimeUtility.GetServerMilliseconds() - playerself.LastSummonPartnerTime > partnerInfo.CoolDown || playerself.LastSummonPartnerTime == 0))
                {
                    Data_Unit data = new Data_Unit();
                    data.m_Id         = -1;
                    data.m_LinkId     = partnerInfo.LinkId;
                    data.m_CampId     = playerself.GetCampId();
                    data.m_Pos        = playerself.GetMovementStateInfo().GetPosition3D();
                    data.m_RotAngle   = 0;
                    data.m_AiLogic    = partnerInfo.GetAiLogic();
                    data.m_AiParam[0] = "";
                    data.m_AiParam[1] = "";
                    data.m_AiParam[2] = partnerInfo.GetAiParam().ToString();
                    data.m_IsEnable   = true;
                    NpcInfo npc = WorldSystem.Instance.NpcManager.AddNpc(data);
                    if (null != npc)
                    {
                        AppendAttributeConfig aac       = AppendAttributeConfigProvider.Instance.GetDataById(partnerInfo.GetAppendAttrConfigId());
                        float inheritAttackAttrPercent  = partnerInfo.GetInheritAttackAttrPercent();
                        float inheritDefenceAttrPercent = partnerInfo.GetInheritDefenceAttrPercent();
                        if (null != aac)
                        {
                            // attack
                            npc.GetBaseProperty().SetAttackBase(Operate_Type.OT_Absolute, (int)(playerself.GetActualProperty().AttackBase *inheritAttackAttrPercent));
                            npc.GetBaseProperty().SetFireDamage(Operate_Type.OT_Absolute, playerself.GetActualProperty().FireDamage *inheritAttackAttrPercent);
                            npc.GetBaseProperty().SetIceDamage(Operate_Type.OT_Absolute, playerself.GetActualProperty().IceDamage *inheritAttackAttrPercent);
                            npc.GetBaseProperty().SetPoisonDamage(Operate_Type.OT_Absolute, playerself.GetActualProperty().PoisonDamage *inheritAttackAttrPercent);
                            // defence
                            npc.GetBaseProperty().SetHpMax(Operate_Type.OT_Absolute, (int)(playerself.GetActualProperty().HpMax *inheritDefenceAttrPercent));
                            npc.GetBaseProperty().SetEnergyMax(Operate_Type.OT_Absolute, (int)(playerself.GetActualProperty().EnergyMax *inheritDefenceAttrPercent));
                            npc.GetBaseProperty().SetADefenceBase(Operate_Type.OT_Absolute, (int)(playerself.GetActualProperty().ADefenceBase *inheritDefenceAttrPercent));
                            npc.GetBaseProperty().SetMDefenceBase(Operate_Type.OT_Absolute, (int)(playerself.GetActualProperty().MDefenceBase *inheritDefenceAttrPercent));
                            npc.GetBaseProperty().SetFireERD(Operate_Type.OT_Absolute, playerself.GetActualProperty().FireERD *inheritDefenceAttrPercent);
                            npc.GetBaseProperty().SetIceERD(Operate_Type.OT_Absolute, playerself.GetActualProperty().IceERD *inheritDefenceAttrPercent);
                            npc.GetBaseProperty().SetPoisonERD(Operate_Type.OT_Absolute, playerself.GetActualProperty().PoisonERD *inheritDefenceAttrPercent);
                            // reset hp & energy
                            npc.SetHp(Operate_Type.OT_Absolute, npc.GetBaseProperty().HpMax);
                            npc.SetEnergy(Operate_Type.OT_Absolute, npc.GetBaseProperty().EnergyMax);
                        }
                        npc.SetAIEnable(true);
                        npc.GetSkillStateInfo().RemoveAllSkill();
                        npc.BornTime = TimeUtility.GetServerMilliseconds();
                        List <int> skillList = partnerInfo.GetSkillList();
                        if (null != skillList)
                        {
                            for (int i = 0; i < skillList.Count; ++i)
                            {
                                SkillInfo skillInfo = new SkillInfo(skillList[i]);
                                npc.GetSkillStateInfo().AddSkill(skillInfo);
                            }
                        }
                        playerself.LastSummonPartnerTime = TimeUtility.GetServerMilliseconds();
                        npc.SkillController  = new SwordManSkillController(npc, GfxModule.Skill.GfxSkillSystem.Instance);
                        npc.OwnerId          = playerself.GetId();
                        playerself.PartnerId = npc.GetId();
                        EntityManager.Instance.CreateNpcView(npc.GetId());
                        if (partnerInfo.BornSkill > 0)
                        {
                            SkillInfo skillInfo = new SkillInfo(partnerInfo.BornSkill);
                            npc.GetSkillStateInfo().AddSkill(skillInfo);
                            npc.SkillController.ForceStartSkill(partnerInfo.BornSkill);
                        }
                        CharacterView view = EntityManager.Instance.GetCharacterViewById(npc.GetId());
                        if (null != view)
                        {
                            GfxSystem.SetLayer(view.Actor, "PhysicObj");
                        }
                        GfxSystem.PublishGfxEvent("ge_partner_summon_result", "ui", true);
                    }
                    else
                    {
                        GfxSystem.PublishGfxEvent("ge_partner_summon_result", "ui", false);
                    }
                }
                else
                {
                    GfxSystem.PublishGfxEvent("ge_partner_summon_result", "ui", false);
                }
            }
            if (WorldSystem.Instance.IsPvpScene() || WorldSystem.Instance.IsMultiPveScene())
            {
                NetworkSystem.Instance.SummonPartner();
            }
        }
示例#31
0
 public SkillDistribution(SkillInfo skill)
 {
     m_Skill = skill;
 }
示例#32
0
        public static void Gain(Mobile from, Skill skill)
        {
            if (from.Region.IsPartOf(typeof(Regions.Jail)))
            {
                return;
            }

            if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
            {
                return;
            }

            if (skill.SkillName == SkillName.Focus && from is BaseCreature)
            {
                return;
            }

            if (skill.Base < skill.Cap && skill.Lock == SkillLock.Up)
            {
                int toGain = 1;

                if (skill.Base <= 10.0)
                {
                    toGain = Utility.Random(4) + 1;
                }

                Skills skills = from.Skills;

                if (from.Player && (skills.Total / skills.Cap) >= Utility.RandomDouble())//( skills.Total >= skills.Cap )
                {
                    for (int i = 0; i < skills.Length; ++i)
                    {
                        Skill toLower = skills[i];

                        if (toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain)
                        {
                            toLower.BaseFixedPoint -= toGain;
                            break;
                        }
                    }
                }

                #region Mondain's Legacy
                if (from is PlayerMobile)
                {
                    if (Server.Engines.Quests.QuestHelper.EnhancedSkill((PlayerMobile)from, skill))
                    {
                        toGain *= Utility.RandomMinMax(2, 4);
                    }
                }
                #endregion

                #region Scroll of Alacrity
                PlayerMobile pm = from as PlayerMobile;

                if (from is PlayerMobile)
                {
                    if (pm != null && skill.SkillName == pm.AcceleratedSkill && pm.AcceleratedStart > DateTime.UtcNow)
                    {
                        pm.SendLocalizedMessage(1077956); // You are infused with intense energy. You are under the effects of an accelerated skillgain scroll.
                        toGain = Utility.RandomMinMax(2, 5);
                    }
                }
                #endregion

                if (!from.Player || (skills.Total + toGain) <= skills.Cap)
                {
                    skill.BaseFixedPoint += toGain;
                }
            }

            #region Mondain's Legacy
            if (from is PlayerMobile)
            {
                Server.Engines.Quests.QuestHelper.CheckSkill((PlayerMobile)from, skill);
            }
            #endregion

            if (skill.Lock == SkillLock.Up)
            {
                SkillInfo info = skill.Info;

                if (from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Str);
                }
                else if (from.DexLock == StatLockType.Up && (info.DexGain / 33.3) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Dex);
                }
                else if (from.IntLock == StatLockType.Up && (info.IntGain / 33.3) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Int);
                }
            }
        }
示例#33
0
 public SkillLabel(Control parent, SkillInfo <SkillType> skillInfo, Vector2 position) : base(parent, position)
 {
     SkillInfo = skillInfo;
     Text      = SkillInfo.DisplayName;
 }
示例#34
0
    public override void Update()
    {
        base.Update();
        if (Self.IsActorExit)
        {
            return;                  //当前角色离场
        }
        //TimeToRelive();
        ReliveUI();
        #region Unlock
        if (!Self.CurrentTargetIsDead)
        {//判断距离 清除目标
            float distance = ActorTargetManager.GetTargetDistance(Self.MainPos, Self.CurrentTarget.MainPos);
            if (distance > Self.CurrentTableInfo.UnlockRange)
            {
                Self.CurrentTarget = null;
                Self.DamageSource  = null;
            }
        }
        #endregion
        CheckAllSkill(); //检测可释放技能
        if (Self.CurrentCmd == null)
        {                //当前没有命令
            MoveAction action = Self.ActionControl.LookupAction(ActorAction.ENType.enMoveAction) as MoveAction;
            if ((action == null || action.IsStopMove) &&
                !Self.ActionControl.IsActionRunning(ActorAction.ENType.enAttackAction) &&
                !Self.ActionControl.IsActionRunning(ActorAction.ENType.enRollAction))
            {     //不在移动、攻击、翻滚等位移动作中
                if (!Self.CurrentTargetIsDead)
                { //当前目标没死
                    float distance = ActorTargetManager.GetTargetDistance(Self.RealPos, Self.CurrentTarget.RealPos);
                    if (Self.CurrentTableInfo.AutoAttackRange > distance)
                    {//当前目标在自动攻击范围内
                        //Self.FireNormalSkill();
                        return;
                    }
                }
                else
                {
                    if (m_isAutoAttack)
                    {
                        m_autoAttackInterval -= Time.deltaTime;
                        if (m_autoAttackInterval < 0)
                        {
                            GetRangeTargetList(ENTargetType.enEnemy, Self.CurrentTableInfo.AutoAttackRange);
                            if (m_targetIDList.Count > 0)
                            {
                                Self.TargetManager.CurrentTarget = m_minActor;
                                Self.CurrentCmd           = new Player.Cmd(Player.ENCmdType.enLoopNormalAttack);
                                Self.CurrentCmd.m_skillID = Self.NormalSkillList[0];
                                return;
                            }
                        }
                    }
                }
                //自动反击
                if (m_lastActionTime == 0)
                {
                    m_lastActionTime = Time.time;
                }
                if (!m_isCounterattack && Time.time - m_lastActionTime > GameSettings.Singleton.m_autoCounterattack)
                {//距离最后一次位移动作 已超过3秒 可以反击
                    m_isCounterattack = false;
                }
            }
            if (m_isCounterattack)
            {//可以反击
                if (Self.DamageTime > m_lastActionTime + GameSettings.Singleton.m_autoCounterattack)
                {
                    if (Self.DamageSource != null && !Self.DamageSource.IsDead && ActorTargetManager.IsEnemy(Self, Self.DamageSource))
                    {
                        if (m_counterSkillRange == 0)
                        {
                            SkillInfo info = GameTable.SkillTableAsset.Lookup(Self.NormalSkillList[0]);
                            m_counterSkillRange = info.AttackDistance;
                        }
                        Vector3 distance = Owner.RealPos - Self.DamageSource.RealPos;
                        distance.y = 0;
                        if (distance.magnitude > m_counterSkillRange)
                        {//不在攻击范围内
                            //向技能目标移动
                            ActionMoveTo(Self.DamageSource.RealPos);
                        }
                        else
                        {//在攻击范围内
                            //释放技能
                            if (ActionTryAttack(Self.NormalSkillList[0], Self.DamageSource))
                            {
                                m_curTargetID      = Self.DamageSource.ID;
                                Self.CurrentTarget = ActorManager.Singleton.Lookup(m_curTargetID);
                                m_lastActionTime   = 0;
                                m_isCounterattack  = false;
                                return;
                            }
                        }
                    }
                }
            }
        }
        else
        {
            MainPlayer.Cmd cmd = Self.CurrentCmd;
            if (cmd.m_type != Player.ENCmdType.enSkill && cmd.m_type != Player.ENCmdType.enLoopNormalAttack)
            {//取消自动攻击
                m_isAutoAttack = false;
            }
            //最后一次动作的时间
            m_lastActionTime = 0;
            //清除自动反击
            m_isCounterattack = false;
            if (cmd.m_type != Player.ENCmdType.enSkill)
            {//取消技能高亮
                DelSkillHighlight();
            }

            m_autoAttackInterval = GameSettings.Singleton.m_autoAttackInterval;
            if (!IsCmdExecute())
            {//命令不允许执行
                Self.CurrentCmd = null;
                return;
            }

            m_curTargetID = 0;
            if (!Self.CurrentTargetIsDead)
            {
                m_curTargetID = Self.CurrentTarget.ID;
            }
            switch (cmd.m_type)
            {
            case Player.ENCmdType.enMove:
            {
                //  [8/3/2015 tgame]
                if (cmd.m_isMoveByNoAStar)
                {
                    if (ActionMoveToNotAStar(cmd.m_moveTargetPos))
                    {
                        //点击地面特效
                        Self.IsMoveAfterSwitch = false;
                        Self.CurrentCmd        = null;
                    }
                }
                else
                {
                    if (ActionMoveTo(cmd.m_moveTargetPos))
                    {
                        //点击地面特效
                        Self.IsMoveAfterSwitch = false;
                        Self.CurrentCmd        = null;
                    }
                }
            }
            break;

            case Player.ENCmdType.enStopMove:
            {
                MoveAction ac = Self.ActionControl.LookupAction(ActorAction.ENType.enMoveAction) as MoveAction;
                if (ac != null)
                {
                    Self.ActionControl.RemoveAction(ActorAction.ENType.enMoveAction);
                }
            }
            break;

            case Player.ENCmdType.enRoll:
            {
                RollAction rollAction = Self.ActionControl.AddAction(ActorAction.ENType.enRollAction) as RollAction;
                if (rollAction != null)
                {
                    rollAction.Init(cmd.m_moveTargetPos);
                    Self.CurrentCmd = null;
                }
            }
            break;

            case Player.ENCmdType.enSwitchActor:
            {
                if (!m_isAttacking)
                {
                    if (Self.ActionControl.IsActionRunning(ActorAction.ENType.enAttackAction))
                    {
                        if (ActorManager.Singleton.m_switchCDTotal > 0)
                        {        //cd中,继续攻击
                            Self.FireNormalSkill();
                            return;
                        }
                        m_isAttacking = true;
                    }
                }
                if (ActorManager.Singleton.SwitchMainActor(false, m_isAttacking))
                {
                    Self.CurrentCmd = null;
                    m_isAttacking   = false;
                }
            }
            break;

            case Player.ENCmdType.enSkill:
            {
                int skillID = cmd.m_skillID;
                Actor.ActorSkillInfo info = Self.SkillBag.Find(item => item.SkillTableInfo.ID == skillID);
                if (IsFireSkill(skillID))
                {
                    GetRangeTargetList((ENTargetType)info.SkillTableInfo.TargetType, Self.CurrentTableInfo.AttackRange, Self.m_firstTargetType);
                    if (ActionTryFireSkill(skillID))
                    {
                        m_isAutoAttack = false;
                        m_lastSkillID  = skillID;
                        DelSkillHighlight();

                        Actor target = ActorManager.Singleton.Lookup(m_curTargetID);
                        if (target != null && ActorTargetManager.IsEnemy(Self, target))
                        {        //只对仇人进行循环普攻
                            Self.CurrentTarget        = target;
                            Self.CurrentCmd.m_skillID = Self.NormalSkillList[0];
                            Self.CurrentCmd.m_type    = Player.ENCmdType.enStop;     //enLoopNormalAttack;
                        }
                        else
                        {
                            Self.CurrentCmd = null;
                        }
                    }
                    else
                    {
                        if (m_targetIDList.Count == 0)
                        {
                            DelSkillHighlight();
                            Self.CurrentCmd = null;
                        }
                    }
                }
                else
                {
                    GetRangeTargetList((ENTargetType)info.SkillTableInfo.TargetType, Self.CurrentTableInfo.AttackRange);
                    if (m_targetIDList.Count != 0 && skillID != m_highlightSkillID)
                    {        //技能高亮的通知
                        AddSkillHighlight();
                        m_highlightSkillID = skillID;
                    }
                }
            }
            break;

            case Player.ENCmdType.enLoopNormalAttack:
            {
                int skillID = Self.CurrentCmd.m_skillID;
                if (Self.CurrentTargetIsDead)
                {        //循环攻击时 必须要有目标 目标不能死亡
                    Self.CurrentCmd = null;
                    return;
                }
                if (IsFireSkill(skillID))
                {
                    if (ActionTryFireSkill(skillID))
                    {
                        m_lastSkillID = skillID;
                    }
                }
            }
            break;

            default:
                break;
            }
        }
    }
示例#35
0
    public List<SkillInfo> ReadUserSkillTable()
    {
        List<SkillInfo> userSkillList = new List<SkillInfo>();

        sqlQuery = "select * from UserSkillTable";

        dbcmd.CommandText = sqlQuery;
        reader = dbcmd.ExecuteReader();

        while (reader.Read())
        {
            SkillInfo info = new SkillInfo ();

            info.skillCode 	= reader.GetInt32 (0);
            info.name 		= reader.GetString (1);
            info.prefabName	= reader.GetString (2);
            info.attribute	= reader.GetInt32 (3);
            info.demage 	= reader.GetInt32 (4);
            info.numberOfObject	= reader.GetInt32 (5);
            info.coolTime	= reader.GetFloat (6);
            info.useLimit	= reader.GetInt32 (7);
            info.etc1		= reader.GetInt32(8);
            info.etc2		= reader.GetInt32(9);
            info.etc3		= reader.GetInt32(10);
            info.ICon		= reader.GetString(11);

            userSkillList.Add(info);
        }

        reader.Close();
        reader = null;

        return userSkillList;
    }
示例#36
0
            public SkillPictureBox(SkillsForm parent, SkillInfo<SkillType> skillInfo, Vector2 position)
                : base(parent, position, _iconSize)
            {
                _knownSkills = parent.KnownSkills;

                SkillInfo = skillInfo;
                Sprite = new Grh(GrhInfo.GetData(SkillInfo.Icon));
                _cooldownManager = parent.CooldownManager;
            }
示例#37
0
 public HitBuff(SkillInfo skillinfo = null, float directon = 0, BaseActorObj actor = null) : base(BuffType.Hit)
 {
     skillinfo = skillinfo == null ? new SkillInfo() : skillinfo;
     Init(skillinfo, directon, actor);
 }
示例#38
0
    bool LookupTarget(SkillInfo info, out Actor skillTarget, out float closestDistance)
    {
        skillTarget     = null;
        closestDistance = float.MaxValue;
        //if (info.SkillTableInfo.SkillEffectType == (int)ENSkillEffectType.enRestore)
        //{
        //    return false;
        //}
        if (info.TargetType == (int)ENTargetType.enNullTarget)
        {//不需要目标就能释放的技能
            return(true);
        }
        //首先查看是否可对当前目标释放
        Actor curTarget = ActorManager.Singleton.Lookup(m_curTargetID);

        if (curTarget != null && !curTarget.IsDead)
        {
            float distance = ActorTargetManager.GetTargetDistance(Owner.MainPos, curTarget.MainPos);
            if (distance >= info.LeastAttackDistance)
            {//最小攻击距离外
                switch ((ENTargetType)info.TargetType)
                {
                case ENTargetType.enEnemy:
                {
                    if (ActorTargetManager.IsEnemy(Owner, curTarget))
                    {
                        skillTarget = curTarget;
                        return(true);
                    }
                }
                break;

                case ENTargetType.enFriendly:
                {
                    if (ActorTargetManager.IsFriendly(Owner, curTarget))
                    {
                        skillTarget = curTarget;
                        return(true);
                    }
                }
                break;

                case ENTargetType.enSelf:
                {
                    if (Owner == curTarget)
                    {
                        skillTarget = curTarget;
                        return(true);
                    }
                }
                break;

                case ENTargetType.enNullTarget:
                    break;

                case ENTargetType.enFriendlyAndSelf:
                {
                    if (ActorTargetManager.IsFriendly(Owner, curTarget) && Owner != curTarget)
                    {
                        skillTarget = curTarget;
                        return(true);
                    }
                }
                break;

                default:
                    break;
                }
            }
        }
        //不可以对当前目标释放,查找距离自己最近的

        for (int i = 0; i < m_targetIDList.Count; ++i)
        {
            Actor target = ActorManager.Singleton.Lookup(m_targetIDList[i]);
            if (target == null)
            {
                continue;
            }
            if (target.IsDead)
            {
                continue;
            }
            float distance = ActorTargetManager.GetTargetDistance(Owner.MainPos, target.MainPos);
            if (distance < info.LeastAttackDistance)
            {//最小攻击距离内
                continue;
            }
            switch ((ENTargetType)info.TargetType)
            {
            case ENTargetType.enEnemy:
            {
                if (!ActorTargetManager.IsEnemy(Owner, target))
                {
                    continue;
                }
            }
            break;

            case ENTargetType.enFriendly:
            {
                if (!ActorTargetManager.IsFriendly(Owner, target))
                {
                    continue;
                }
            }
            break;

            case ENTargetType.enSelf:
            {
                if (Owner != target)
                {
                    continue;
                }
            }
            break;

            case ENTargetType.enNullTarget:
                break;

            case ENTargetType.enFriendlyAndSelf:
            {
                if (!ActorTargetManager.IsFriendly(Owner, target) && Owner != target)
                {
                    continue;
                }
            }
            break;

            default:
                break;
            }
            if (m_firstTargetType != ActorType.enNone)
            {     //优先选择目标条件成立
                if (target.Type == m_firstTargetType)
                { //是优先选择的目标类型
                    if (skillTarget == null)
                    {
                        skillTarget     = target;
                        closestDistance = distance;
                    }
                    else
                    {
                        if (skillTarget.Type == m_firstTargetType)
                        {//已有优先目标,进行比较,取近的
                            if (distance < closestDistance)
                            {
                                skillTarget     = target;
                                closestDistance = distance;
                            }
                        }
                        else
                        {
                            skillTarget     = target;
                            closestDistance = distance;
                        }
                    }
                }
                else
                {
                    if (skillTarget == null)
                    {
                        skillTarget     = target;
                        closestDistance = distance;
                    }
                    else
                    {
                        if (skillTarget.Type != m_firstTargetType)
                        {
                            if (distance < closestDistance)
                            {
                                skillTarget     = target;
                                closestDistance = distance;
                            }
                        }
                    }
                }
            }
            else
            {
                if (distance < info.AttackDistance)
                {
                    skillTarget = target;
                    break;
                }
                else
                {
                    if (distance < closestDistance)
                    {
                        skillTarget     = target;
                        closestDistance = distance;
                    }
                }
            }
        }
        return(skillTarget != null);
    }
示例#39
0
 /// <summary>
 /// Triggered when a player attempts to use the skill shop
 /// </summary>
 public virtual void handlePlayerShopSkill(Player from, SkillInfo skill)
 {
 }
示例#40
0
        public static void Gain(Mobile from, Skill skill)
        {
            if (from.Region.IsPartOf(typeof(Regions.Jail)))
            {
                return;
            }

            if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
            {
                return;
            }

            if (skill.SkillName == SkillName.Focus && from is BaseCreature)
            {
                return;
            }

            if (skill.Base < skill.Cap && skill.Lock == SkillLock.Up)
            {
                int toGain = 1;

                if (skill.Base <= 10.0)
                {
                    toGain = Utility.Random(4) + 1;
                }

                Skills skills = from.Skills;

                if ((skills.Total / skills.Cap) >= Utility.RandomDouble())                    //( skills.Total >= skills.Cap )
                {
                    for (int i = 0; i < skills.Length; ++i)
                    {
                        Skill toLower = skills[i];

                        if (toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain)
                        {
                            toLower.BaseFixedPoint -= toGain;
                            break;
                        }
                    }
                }

                #region Mondain's Legacy
                if (from is PlayerMobile)
                {
                    if (Server.Engines.Quests.QuestHelper.EnhancedSkill((PlayerMobile)from, skill))
                    {
                        toGain *= Utility.RandomMinMax(2, 4);
                    }
                }
                #endregion

                if ((skills.Total + toGain) <= skills.Cap)
                {
                    skill.BaseFixedPoint += toGain;
                }

                if (from is PlayerMobile)

                {
                    PlayerMobile pm = (PlayerMobile)from;
                    pm.SkillGainTimes[skill.SkillID] = DateTime.Now;
                }
            }

            #region Mondain's Legacy
            if (from is PlayerMobile)
            {
                Server.Engines.Quests.QuestHelper.CheckSkill((PlayerMobile)from, skill);
            }
            #endregion

            if (skill.Lock == SkillLock.Up)
            {
                SkillInfo info = skill.Info;

                if (from.StrLock == StatLockType.Up && (info.StrGain / 33.3) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Str);
                }
                else if (from.DexLock == StatLockType.Up && (info.DexGain / 33.3) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Dex);
                }
                else if (from.IntLock == StatLockType.Up && (info.IntGain / 33.3) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Int);
                }

                else if (from.StrLock == StatLockType.Up)
                {
                    GainStat_GGS(from, Stat.Str);
                }
                else if (from.DexLock == StatLockType.Up)
                {
                    GainStat_GGS(from, Stat.Dex);
                }
                else if (from.IntLock == StatLockType.Up)
                {
                    GainStat_GGS(from, Stat.Int);
                }
            }
        }
示例#41
0
        public static void TryStatGain(SkillInfo info, Mobile from)
        {
            // Chance roll
            double chance = 0.0;

            if (from is BaseCreature && ((BaseCreature)from).Controlled)
            {
                chance = PetChanceToGainStats;
            }
            else
            {
                chance = PlayerChanceToGainStats;
            }
            if (Utility.RandomDouble() * 100.0 >= chance)
            {
                return;
            }

            // Selection
            StatLockType primaryLock   = StatLockType.Locked;
            StatLockType secondaryLock = StatLockType.Locked;

            switch (info.Primary)
            {
            case StatCode.Str: primaryLock = from.StrLock; break;

            case StatCode.Dex: primaryLock = from.DexLock; break;

            case StatCode.Int: primaryLock = from.IntLock; break;
            }
            switch (info.Secondary)
            {
            case StatCode.Str: secondaryLock = from.StrLock; break;

            case StatCode.Dex: secondaryLock = from.DexLock; break;

            case StatCode.Int: secondaryLock = from.IntLock; break;
            }

            // Gain
            // Decision block of both are selected to gain
            if (primaryLock == StatLockType.Up && secondaryLock == StatLockType.Up)
            {
                if (Utility.Random(4) == 0)
                {
                    GainStat(from, (Stat)info.Secondary);
                }
                else
                {
                    GainStat(from, (Stat)info.Primary);
                }
            }
            else             // Will not do anything if neither are selected to gain
            {
                if (primaryLock == StatLockType.Up)
                {
                    GainStat(from, (Stat)info.Primary);
                }
                else if (secondaryLock == StatLockType.Up)
                {
                    GainStat(from, (Stat)info.Secondary);
                }
            }
        }
示例#42
0
        public void playerEnterArena(Player player)
        {
            player.sendMessage(0, String.Format("Welcome to Cooperative mode, {0}", player._alias));

            if (Script_Multi._bCoopHappyHour)
            {
                player.sendMessage(0, "&Co-Op Happy hour is currently active, Enjoy!");
            }
            else
            {
                TimeSpan remaining = _baseScript.timeTo(Settings._coopHappyHourStart);
                player.sendMessage(0, String.Format("&Co-Op Happy hour starts in {0} hours & {1} minutes", remaining.Hours, remaining.Minutes));
            }

            //Obtain the Co-Op skill..
            SkillInfo coopskillInfo = _arena._server._assets.getSkillByID(200);



            //Add the skill!
            if (player.findSkill(200) == null)
            {
                player.skillModify(coopskillInfo, 1);
            }

            //Add the skill!
            if (player.findSkill(203) != null)
            {
                player._skills.Remove(203);
            }
            //Add the skill!
            if (player.findSkill(202) != null)
            {
                player._skills.Remove(202);
            }

            if (_botDifficulty <= 6)
            {
                player.sendMessage(2, String.Format("Powerups are enabled for this difficulty, {0}", player._alias));

                //Obtain the Co-Op skill..
                SkillInfo powerupskillInfo = _arena._server._assets.getSkillByID(201);

                //Add the skill!
                if (player.findSkill(201) == null)
                {
                    player.skillModify(powerupskillInfo, 1);
                }
            }
            else
            {
                player.sendMessage(2, String.Format("Powerups are disabled for this difficulty, {0}", player._alias));
                //Obtain the Powerup skill..
                SkillInfo powerupskillInfo2 = _arena._server._assets.getSkillByID(201);

                //Add the skill!
                if (player.findSkill(201) != null)
                {
                    player._skills.Remove(201);
                }
            }
        }
示例#43
0
 public MapPassiveInfo(XmlNode node)
 {
     SkillInfo = SkillInfoManager.Instance.GetInfoByID(node.Attributes["id"].Value);
 }
示例#44
0
    public void a(int A_0, bool A_1)
    {
        if (!A_1 || !dh.b(A_0))
        {
            goto Label_045E;
        }
        WorldObject obj2 = PluginCore.cq.aw.get_WorldFilter().get_Item(A_0);

        if (((obj2.get_ObjectClass() == 6) || (obj2.get_ObjectClass() == 11)) || ((obj2.get_ObjectClass() == 0x1d) || (obj2.get_ObjectClass() == 0x10)))
        {
            string str;
            if (!obj2.Exists(0x11) || (((str = obj2.get_Name()) != null) && (((str == "Eternal Health Kit") || (str == "Eternal Stamina Kit")) || (str == "Eternal Mana Kit"))))
            {
                if (obj2.get_SpellCount() > 0)
                {
                    MySpell spell = PluginCore.cq.e.b(obj2.Spell(0));
                    if ((spell == null) || (spell.Duration < 1200.0))
                    {
                        goto Label_045E;
                    }
                }
                string key = obj2.get_Name();
                if (key != null)
                {
                    int num2;
                    if (bx.k == null)
                    {
                        Dictionary <string, int> dictionary1 = new Dictionary <string, int>(0x27);
                        dictionary1.Add("Burning Coal", 0);
                        dictionary1.Add("Enhanced Mucor", 1);
                        dictionary1.Add("Gem of Impulse", 2);
                        dictionary1.Add("Refreshing Water", 3);
                        dictionary1.Add("Enhanced Health Elixir", 4);
                        dictionary1.Add("Enhanced Mana Elixir", 5);
                        dictionary1.Add("Black Market Health Elixir", 6);
                        dictionary1.Add("Black Market Mana Elixir", 7);
                        dictionary1.Add("Draught of Revitalization", 8);
                        dictionary1.Add("Gonjoku's Mana Infusion", 9);
                        dictionary1.Add("Harbinger Blood Infusion", 10);
                        dictionary1.Add("Platinum Spirits", 11);
                        dictionary1.Add("Potion of Black Fire", 12);
                        dictionary1.Add("Potion of Destiny's Wind", 13);
                        dictionary1.Add("Potion of Endless Vigor", 14);
                        dictionary1.Add("Coral Fragment", 15);
                        dictionary1.Add("Blue Gem", 0x10);
                        dictionary1.Add("Black Page of Salt and Ash", 0x11);
                        dictionary1.Add("Dull Gem", 0x12);
                        dictionary1.Add("Gem of Black Fire", 0x13);
                        dictionary1.Add("Gem of Harbinger's Acid Barrier", 20);
                        dictionary1.Add("Gem of Harbinger's Flame Barrier", 0x15);
                        dictionary1.Add("Gem of Harbinger's Frost Barrier", 0x16);
                        dictionary1.Add("Gem of Harbinger's Lightning Barrier", 0x17);
                        dictionary1.Add("Miyako's Moonstone", 0x18);
                        dictionary1.Add("Priceless Ore", 0x19);
                        dictionary1.Add("Rage of Grael Gem", 0x1a);
                        dictionary1.Add("Red Gem", 0x1b);
                        dictionary1.Add("Swamp Gem", 0x1c);
                        dictionary1.Add("Essence of Cave Penguin", 0x1d);
                        dictionary1.Add("Stout Lugian Ale", 30);
                        dictionary1.Add("Hearty Lugian Loaf", 0x1f);
                        dictionary1.Add("Pepper Jack Cheese", 0x20);
                        dictionary1.Add("Tasty Pudding", 0x21);
                        dictionary1.Add("Thick Lugian Stew", 0x22);
                        dictionary1.Add("Light Infused Healing Kit", 0x23);
                        dictionary1.Add("Sake", 0x24);
                        dictionary1.Add("Slice of Royal Wedding Cake", 0x25);
                        dictionary1.Add("Massive Mana Charge", 0x26);
                        bx.k = dictionary1;
                    }
                    if (bx.k.TryGetValue(key, out num2))
                    {
                        switch (num2)
                        {
                        case 0:
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                        case 6:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                        case 11:
                        case 12:
                        case 13:
                        case 14:
                        case 15:
                        case 0x10:
                        case 0x11:
                        case 0x12:
                        case 0x13:
                        case 20:
                        case 0x15:
                        case 0x16:
                        case 0x17:
                        case 0x18:
                        case 0x19:
                        case 0x1a:
                        case 0x1b:
                        case 0x1c:
                        case 0x1d:
                        case 30:
                        case 0x1f:
                        case 0x20:
                        case 0x21:
                        case 0x22:
                        case 0x23:
                        case 0x24:
                        case 0x25:
                        case 0x26:
                            goto Label_045E;
                        }
                    }
                }
                PluginCore.PC.h(A_0);
            }
            goto Label_045E;
        }
        if (!fn.a(obj2))
        {
            goto Label_045E;
        }
        if ((obj2.get_ObjectClass() == 1) || (obj2.get_ObjectClass() == 9))
        {
            SkillInfo o = null;
            try
            {
                int num = obj2.Values(0xd000020, 0);
                if (num != 0)
                {
                    o = PluginCore.cq.aw.get_CharacterFilter().get_Underlying().get_Skill((eSkillID)num);
                    if ((o.get_Training() != 1) && (o.get_Training() != null))
                    {
                        goto Label_041F;
                    }
                }
                goto Label_045E;
            }
            finally
            {
                if (o != null)
                {
                    Marshal.ReleaseComObject(o);
                }
            }
        }
Label_041F:
        if (obj2.Exists(0x69) && !obj2.Exists(0xab))
        {
            if (CoreManager.get_Current().get_CharacterFilter().get_Level() >= 120)
            {
                goto Label_045E;
            }
            ai.a("Note: since you are under level 120, untinkered items are being auto-added to your items list.");
        }
        PluginCore.PC.l(A_0);
Label_045E:
        if (this.r && (PluginCore.cq.u.b(b0.a.a) == 0))
        {
            PluginCore.e("Set default profile: Done scanning inventory.");
        }
    }
示例#45
0
        public static void Gain(Mobile from, Skill skill)
        {
            if (from.Region.IsPartOf(typeof(Regions.Jail)))
            {
                return;
            }

            if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
            {
                return;
            }

            if (skill.SkillName == SkillName.Focus && from is BaseCreature)
            {
                return;
            }

            if (skill.Base < skill.Cap && skill.Lock == SkillLock.Up)
            {
                int toGain = 1;

                if (skill.Base <= 10.0)
                {
                    toGain = Utility.Random(4) + 1;
                }

                Skills skills = from.Skills;

                if (from.Player && (skills.Total / skills.Cap) >= Utility.RandomDouble())                    //( skills.Total >= skills.Cap )
                {
                    for (int i = 0; i < skills.Length; ++i)
                    {
                        Skill toLower = skills[i];

                        if (toLower != skill && toLower.Lock == SkillLock.Down && toLower.BaseFixedPoint >= toGain)
                        {
                            toLower.BaseFixedPoint -= toGain;
                            break;
                        }
                    }
                }

                #region Scroll of Alacrity
                PlayerMobile pm = from as PlayerMobile;

                if (from is PlayerMobile)
                {
                    if (pm != null && skill.SkillName == pm.AcceleratedSkill && pm.AcceleratedStart > DateTime.Now)
                    {
                        toGain *= Utility.RandomMinMax(2, 5);
                    }
                }
                #endregion

                if (!from.Player || (skills.Total + toGain) <= skills.Cap)
                {
                    skill.BaseFixedPoint += toGain;
                }
            }

            if (skill.Lock == SkillLock.Up)
            {
                SkillInfo info = skill.Info;

                if (from.StrLock == StatLockType.Up && (info.StrGain / 20.0) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Str);
                }
                else if (from.DexLock == StatLockType.Up && (info.DexGain / 20.0) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Dex);
                }
                else if (from.IntLock == StatLockType.Up && (info.IntGain / 20.0) > Utility.RandomDouble())
                {
                    GainStat(from, Stat.Int);
                }
            }
        }
示例#46
0
 //-------
 public bool CreateSkill(SkillInfo objSkillInfo)
 {
     return(sBC.CreateSkill(objSkillInfo));
 }
示例#47
0
 public PlayerAction(BaseActorObj baseActorObj, SkillInfo skillInfo) : base(baseActorObj, skillInfo)
 {
     m_PlayerObj = baseActorObj as PlayerObj;
     SetStartDirection();
 }
示例#48
0
 public bool UpdateSkill(SkillInfo objSkillInfo)
 {
     return(sBC.UpdateSkill(objSkillInfo));
 }
示例#49
0
	void 	OnmultiUse(SkillInfo info){
		playerattackxu = PlayerAttackState.Skill_attack;
		CursorManager._instance.setLocalTarget ();
		islocking = true;
		this.infotarget = info;
	}
    private bool CombatHandler(EntityInfo npc, AiStateInfo info, long deltaTime)
    {
        info.Time += deltaTime;
        if (info.Time > 100)
        {
            info.Time = 0;
        }
        else
        {
            return(true);
        }

        if (npc.GetSkillStateInfo().IsSkillActivated())
        {
            return(true);
        }

        ScriptRuntime.Vector3 srcPos = npc.GetMovementStateInfo().GetPosition3D();
        float distSqrToHome          = Geometry.DistanceSquare(srcPos, info.HomePos);

        if (distSqrToHome > npc.GohomeRange * npc.GohomeRange)
        {
            AiCommand.AiStopPursue(npc);
            info.ChangeToState((int)AiStateId.Gohome);
            return(true);
        }

        ///
        EntityInfo     attackTarget = null;
        SkillStateInfo currSkInfo   = npc.GetSkillStateInfo();
        ///找到可以使用的技能
        SkillInfo skInfo = AiLogicUtility.NpcFindCanUseSkill(npc);

        AiCommand.AiSelectSkill(npc, skInfo);
        if (skInfo == null)
        {
            AiCommand.AiStopPursue(npc);
            info.ChangeToState((int)PredefinedAiStateId.Idle);
            return(false);
        }

        CharacterRelation relation = skInfo.ConfigData.targetType == (int)SkillTargetType.Friend ?
                                     CharacterRelation.RELATION_FRIEND :
                                     CharacterRelation.RELATION_ENEMY;

        attackTarget = AiLogicUtility.GetNearstTargetHelper(
            npc, skInfo.Distance, relation);

        if (attackTarget != null && null != skInfo) //攻击范围内找到可攻击目标
        {
            info.Target = attackTarget.GetId();
            ScriptRuntime.Vector3 targetPos = attackTarget.GetMovementStateInfo().GetPosition3D();
            float dir    = Geometry.GetYRadian(srcPos, targetPos);
            float curDir = npc.GetMovementStateInfo().GetFaceDir();
            if (Mathf.Abs(dir - curDir) > 0.157f)
            {
                npc.GetMovementStateInfo().SetWantedFaceDir(dir);
            }
            else
            {
                AiCommand.AiStopPursue(npc);
                AiCommand.AiSkill(npc, skInfo.SkillId); //攻击目标
            }
            return(true);
        }
        attackTarget = AiLogicUtility.GetNearstTargetHelper(
            npc, npc.ViewRange, relation);
        if (attackTarget != null)                                                         //视野范围内找到可攻击目标
        {
            AiCommand.AiPursue(npc, attackTarget.GetMovementStateInfo().GetPosition3D()); // 追赶目标
            return(true);
        }

        currSkInfo.SetCurSkillInfo(0);
        AiCommand.AiStopPursue(npc);
        return(true);
    }
示例#51
0
		public static void TryStatGain(SkillInfo info, Mobile from)
		{
			// Chance roll
			double chance = 0.0;
			if(from is BaseCreature && ((BaseCreature)from).Controlled)
				chance = PetChanceToGainStats;
			else
				chance = PlayerChanceToGainStats;
			if (Utility.RandomDouble() * 100.0 >= chance)
			{
				return;
			}

			// Selection
			StatLockType primaryLock = StatLockType.Locked;
			StatLockType secondaryLock = StatLockType.Locked;
			switch (info.Primary)
			{
				case StatCode.Str: primaryLock = from.StrLock; break;
				case StatCode.Dex: primaryLock = from.DexLock; break;
				case StatCode.Int: primaryLock = from.IntLock; break;
			}
			switch (info.Secondary)
			{
				case StatCode.Str: secondaryLock = from.StrLock; break;
				case StatCode.Dex: secondaryLock = from.DexLock; break;
				case StatCode.Int: secondaryLock = from.IntLock; break;
			}

			// Gain
			// Decision block of both are selected to gain
			if(primaryLock == StatLockType.Up && secondaryLock == StatLockType.Up)
			{
				if (Utility.Random(4) == 0)
					GainStat(from, (Stat)info.Secondary);
				else
					GainStat(from, (Stat)info.Primary);
			}
			else // Will not do anything if neither are selected to gain
			{
				if(primaryLock == StatLockType.Up)
					GainStat(from, (Stat)info.Primary);
				else if(secondaryLock == StatLockType.Up)
					GainStat(from, (Stat)info.Secondary);
			}
		}
示例#52
0
 public void NewSkill(ActorPC pc, SkillType type, SkillInfo skill)
 {
 }
示例#53
0
 public static void InvokeUnitStartedSkill(Unit unit, SkillInfo skillInfo)
 {
     UnitStartedSkill?.Invoke(unit, skillInfo);
 }
示例#54
0
 public void UpdateSkill(ActorPC pc, SkillType type, SkillInfo skill)
 {
 }
示例#55
0
 public void ChangeValueOfSkill2(SkillInfo skillInfo2, float physicalAdd, float magicAdd)
 {
     skillInfo2.attack_Physical = (int)(roleMain.attack_Physical * physicalAdd);
     skillInfo2.attack_Magic    = (int)(roleMain.attack_Magic * magicAdd);
 }
示例#56
0
 // Use this for initialization
 public NPCFlyItemAction(BaseActorObj baseActorObj, SkillInfo skillInfo) : base(baseActorObj, skillInfo)
 {
     _CountTime = Time.time + _Time;
     _Dir       = baseActorObj.transform.rotation * Vector3.right;
 }
示例#57
0
 public SkillLabel(Control parent, SkillInfo<SkillType> skillInfo, Vector2 position) : base(parent, position)
 {
     SkillInfo = skillInfo;
     Text = SkillInfo.DisplayName;
 }
示例#58
0
    void InitSkillInfoDict()
    {
        string text = skillsInfoText.text;

        string[] skillInfoArray = text.Split('\n');
        foreach (string skillInfoStr in skillInfoArray)
        {
            string[]  pa   = skillInfoStr.Split(',');
            SkillInfo info = new SkillInfo();
            info.id        = int.Parse(pa[0]);
            info.name      = pa[1];
            info.icon_name = pa[2];
            info.des       = pa[3];
            string str_applytype = pa[4];
            switch (str_applytype)
            {
            case "Passive":
                info.applyType = ApplyType.Passive;
                break;

            case "Buff":
                info.applyType = ApplyType.Buff;
                break;

            case "SingleTarget":
                info.applyType = ApplyType.SingleTarget;
                break;

            case "MultiTarget":
                info.applyType = ApplyType.MultiTarget;
                break;
            }
            string str_applypro = pa[5];
            switch (str_applypro)
            {
            case "Attack":
                info.applyProperty = ApplyProperty.Attack;
                break;

            case "Defend":
                info.applyProperty = ApplyProperty.Defend;
                break;

            case "Speed":
                info.applyProperty = ApplyProperty.Speed;
                break;

            case "AttackSpeed":
                info.applyProperty = ApplyProperty.AttackSpeed;
                break;

            case "HP":
                info.applyProperty = ApplyProperty.HP;
                break;

            case "MP":
                info.applyProperty = ApplyProperty.MP;
                break;
            }
            info.applyValue = int.Parse(pa[6]);
            info.applyTime  = int.Parse(pa[7]);
            info.mp         = int.Parse(pa[8]);
            info.coldTime   = int.Parse(pa[9]);
            switch (pa[10])
            {
            case "Swordman":
                info.applicableRole = ApplicableRole.Swordman;
                break;

            case "Magician":
                info.applicableRole = ApplicableRole.Magician;
                break;
            }
            info.level = int.Parse(pa[11]);
            switch (pa[12])
            {
            case "Self":
                info.releaseType = ReleaseType.Self;
                break;

            case "Enemy":
                info.releaseType = ReleaseType.Enemy;
                break;

            case "Positon":
                info.releaseType = ReleaseType.Position;
                break;
            }
            info.distance = float.Parse(pa[13]);
            info.efx_name = pa[14];
            info.aniname  = pa[15];
            info.anitime  = float.Parse(pa[16]);
            skillInfoDict.Add(info.id, info);
        }
    }
示例#59
0
 public abstract void UseSkill(SkillInfo info);
示例#60
0
        private void DescribeProperty(StringBuilder sb, Property prop)
        {
            foreach (var block in prop.info.blocks)
            {
                int value = prop.value;

                if (block.func == 5)
                {
                    sb.Append("\n");
                    sb.Append("+");
                    sb.Append(value);
                    sb.Append(" To Minimum Damage");
                    continue;
                }
                else if (block.func == 6)
                {
                    sb.Append("\n");
                    sb.Append("+");
                    sb.Append(value);
                    sb.Append(" To Maximum Damage");
                    continue;
                }
                else if (block.func == 7)
                {
                    sb.Append("\n");
                    sb.Append("+");
                    sb.Append(value);
                    sb.Append("% Enhanced Damage");
                    continue;
                }
                else if (block.func == 14)
                {
                    sb.Append("\nSocketed (");
                    sb.Append(prop.value);
                    sb.Append(")");
                }
                else if (block.func == 17)
                {
                    int characterLevel = 10;
                    int perLevel       = prop.param != null?int.Parse(prop.param) : 1;

                    value = perLevel * characterLevel;
                }
                if (block.stat == null)
                {
                    continue;
                }

                string sign = value > 0 ? "+" : "";
                string str1 = value > 0 ? block.stat.descPositive : block.stat.descNegative;
                sb.Append("\n");
                if (block.stat.descFunc == 1 || block.stat.descFunc == 12)
                {
                    if (block.stat.descVal == 1)
                    {
                        sb.Append(sign);
                        sb.Append(value);
                        sb.Append(" ");
                    }
                    sb.Append(str1);
                    if (block.stat.descVal == 2)
                    {
                        sb.Append(" ");
                        sb.Append(sign);
                        sb.Append(value);
                    }
                }
                else if (block.stat.descFunc == 2)
                {
                    if (block.stat.descVal == 1)
                    {
                        sb.Append(value);
                        sb.Append("% ");
                    }
                    sb.Append(str1);
                    if (block.stat.descVal == 2)
                    {
                        sb.Append(" ");
                        sb.Append(value);
                        sb.Append("%");
                    }
                }
                else if (block.stat.descFunc == 3)
                {
                    if (block.stat.descVal == 1)
                    {
                        sb.Append(value);
                        sb.Append(" ");
                    }
                    sb.Append(str1);
                    if (block.stat.descVal == 2)
                    {
                        sb.Append(" ");
                        sb.Append(value);
                    }
                }
                else if (block.stat.descFunc == 4)
                {
                    if (block.stat.descVal == 1)
                    {
                        sb.Append(sign);
                        sb.Append(value);
                        sb.Append("% ");
                    }
                    sb.Append(str1);
                    if (block.stat.descVal == 2)
                    {
                        sb.Append(" ");
                        sb.Append(sign);
                        sb.Append(value);
                        sb.Append("%");
                    }
                }
                else if (block.stat.descFunc == 5)
                {
                    sb.Append(value * 100 / 128);
                    sb.Append("% ");
                    sb.Append(str1);
                }
                else if (block.stat.descFunc == 6)
                {
                    sb.Append(sign);
                    sb.Append(value);
                    sb.Append(" ");
                    sb.Append(str1);
                    sb.Append(" ");
                    sb.Append(block.stat.desc2);
                }
                else if (block.stat.descFunc == 7)
                {
                    sb.Append(value);
                    sb.Append("% ");
                    sb.Append(str1);
                    sb.Append(" ");
                    sb.Append(block.stat.desc2);
                }
                else if (block.stat.descFunc == 8)
                {
                    sb.Append(sign);
                    sb.Append(value);
                    sb.Append("% ");
                    sb.Append(str1);
                    sb.Append(" ");
                    sb.Append(block.stat.desc2);
                }
                else if (block.stat.descFunc == 9)
                {
                    sb.Append(value);
                    sb.Append(" ");
                    sb.Append(str1);
                    sb.Append(" ");
                    sb.Append(block.stat.desc2);
                }
                else if (block.stat.descFunc == 10)
                {
                    sb.Append(value * 100 / 128);
                    sb.Append("% ");
                    sb.Append(str1);
                    sb.Append(" ");
                    sb.Append(block.stat.desc2);
                }
                else if (block.stat.descFunc == 11)                     // self-repair
                {
                    string description = Translation.Find("ModStre9u"); // the next line in translation table right after descpos
                    int    seconds     = 100 / int.Parse(prop.param);
                    description = description.ReplaceFirst("%d", "1");
                    description = description.ReplaceFirst("%d", seconds.ToString());
                    sb.Append(description);
                }
                else if (block.stat.descFunc == 13)
                {
                    sb.Append("+");
                    sb.Append(value);
                    sb.Append(" to ");
                    string className = CharStatsInfo.sheet[block.value].className;
                    sb.Append(className);
                    sb.Append(" Skill Levels");
                }
                else if (block.stat.descFunc == 14)
                {
                    string skillTabId = prop.param;
                    var    charStat   = CharStatsInfo.FindByCode(prop.classSpecific);
                    string className  = charStat != null ? charStat.className : "NULL";
                    sb.Append(sign);
                    sb.Append(value);
                    sb.Append(" to ");
                    sb.Append("skilltab" + skillTabId);
                    sb.Append(" Skill Levels (");
                    sb.Append(className);
                    sb.Append(" Only) " + block.stat.descPositive);
                }
                else if (block.stat.descFunc == 15)
                {
                    string skillId    = prop.param;
                    var    skillInfo  = SkillInfo.Find(skillId);
                    int    chance     = prop.min;
                    int    skillLevel = prop.max;
                    sb.Append(chance);
                    sb.Append("% to cast Level ");
                    sb.Append(skillLevel);
                    sb.Append(" ");
                    sb.Append(skillInfo.name);
                    sb.Append(" on ");
                    sb.Append(block.stat.itemEvent1);
                }
                else if (block.stat.descFunc == 16)
                {
                    sb.Append("Level [sLvl] [skill] Aura When Equipped");
                }
                else if (block.stat.descFunc == 17)
                {
                    sb.Append("[value] [string1] (Increases near [time]) ");
                }
                else if (block.stat.descFunc == 18)
                {
                    sb.Append("[value]% [string1] (Increases near [time])");
                }
                else if (block.stat.descFunc == 19)
                {
                    sb.Append("sprintf");
                }
                else if (block.stat.descFunc == 20)
                {
                    sb.Append(-value);
                    sb.Append("% ");
                    sb.Append(str1);
                }
                else if (block.stat.descFunc == 21)
                {
                    sb.Append(-value);
                    sb.Append(" ");
                    sb.Append(str1);
                }
                else if (block.stat.descFunc == 22)
                {
                    sb.Append("[value]% [string1] [montype]");
                }
                else if (block.stat.descFunc == 23)
                {
                    sb.Append("[value]% [string1] [monster]");
                }
                else if (block.stat.descFunc == 24)
                {
                    int    chargeCount = -prop.min;
                    int    skillLevel  = -prop.max;
                    string skillId     = prop.param;
                    var    skillInfo   = SkillInfo.Find(skillId);
                    sb.Append("Level ");
                    sb.Append(skillLevel);
                    sb.Append(" ");
                    sb.Append(skillInfo.name);
                    sb.Append(" (");
                    sb.Append(chargeCount);
                    sb.Append("/");
                    sb.Append(chargeCount);
                    sb.Append(" Charges)");
                }
                else if (block.stat.descFunc == 27)
                {
                    string skillId   = prop.param;
                    var    skillInfo = SkillInfo.Find(skillId);
                    var    className = CharStatsInfo.FindByCode(skillInfo.charClass).className;
                    sb.Append("+");
                    sb.Append(value);
                    sb.Append(" to ");
                    sb.Append(skillInfo.name);
                    sb.Append(" (");
                    sb.Append(className);
                    sb.Append(" Only)");
                }
                else if (block.stat.descFunc == 28)
                {
                    string skillId   = prop.param;
                    var    skillInfo = SkillInfo.Find(skillId);
                    sb.Append("+");
                    sb.Append(value);
                    sb.Append(" to ");
                    sb.Append(skillInfo.name);
                }
                else
                {
                    AppendColored(sb, block.statId + "(descFunc " + block.stat.descFunc + ")" + ": " + str1, Colors.ItemLowQualityHex);
                }
            }
        }