public override void SetDate(SkillDate[] date) { skill = new SkillBase[4]; skill[(int)SkillUseType.SkillUP] = new ContinuousFire( date[(int)SkillUseType.SkillUP]); skill[(int)SkillUseType.SkillDown] = null; skill[(int)SkillUseType.SkillRight] = new Snipe( date[(int)SkillUseType.SkillRight], gameObject); skill[(int)SkillUseType.SkillLeft] = new FireBomb (date[(int)SkillUseType.SkillLeft]); }
public override void SetDate(SkillDate[] date) { skill = new SkillBase[4]; skill[(int)SkillUseType.SkillUP] = new Slash(date[(int)SkillUseType.SkillUP]); skill[(int)SkillUseType.SkillDown] = new DefenceStance(date[(int)SkillUseType.SkillDown], gameObject); skill[(int)SkillUseType.SkillRight] = null; skill[(int)SkillUseType.SkillLeft] = new ShieldBash(date[(int)SkillUseType.SkillLeft], gameObject); }
public override void FinishSpellCast(GameLiving target) { if (m_spell.SubSpellID > 0) { Spell spell = SkillBase.GetSpellByID(m_spell.SubSpellID); if (spell != null && spell.SubSpellID == 0) { ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(m_caster, spell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); spellhandler.StartSpell(Caster); } } base.FinishSpellCast(target); }
public Mage(SkillBase skill) : base(skill, 5, 11, JobType.Mage) { _random = new Random(); }
protected void ApplyRelicEffect() { if (RelicSpell == null || m_spellHandler == null || m_gameSpellEffect == null) { return; } IList <GamePlayer> newPlayerlist = new List <GamePlayer>(); if (m_owner != null) { switch (RelicTarget.ToLower()) { case "self": newPlayerlist.Add(m_owner); break; case "group": if (m_owner.Group == null) { newPlayerlist.Add(m_owner); break; } else { foreach (GamePlayer plr in m_owner.Group.GetPlayersInTheGroup()) { if (plr != null && !newPlayerlist.Contains(plr) && m_owner.IsWithinRadius(plr, WorldMgr.VISIBILITY_DISTANCE)) { newPlayerlist.Add(plr); } } } break; case "realm": foreach (GamePlayer plr in m_owner.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE)) { if (plr != null && GameServer.ServerRules.IsAllowedToAttack(m_owner, plr, true) == false && !newPlayerlist.Contains(plr)) { newPlayerlist.Add(plr); } } break; } } lock (Playerlist) { foreach (GamePlayer plr in Playerlist) { if (plr == null) { continue; } if (!newPlayerlist.Contains(plr)) { try { lock (plr.EffectList) { GameSpellEffect check = SpellHandler.FindEffectOnTarget(plr, m_gameSpellEffect.Spell.SpellType); if (check != null) { check.Cancel(false); } } } catch (Exception e) { if (log.IsErrorEnabled) { log.Error("Minotaur Relics : Effect Cancel : " + e); } } } } foreach (GamePlayer plr in newPlayerlist) { if (plr == null) { continue; } try { lock (plr.EffectList) { GameSpellEffect check = SpellHandler.FindEffectOnTarget(plr, m_gameSpellEffect.Spell.SpellType); if (check == null) { ISpellHandler handler = ScriptMgr.CreateSpellHandler(plr, RelicSpell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); GameSpellEffect plreffect = null; if (handler != null) { plreffect = new GameSpellEffect(handler, RelicSpell.Duration, 0); } if (plreffect != null) { plreffect.Start(plr); } } } } catch (Exception e) { if (log.IsErrorEnabled) { log.Error("Minotaur Relics : Effect Start : " + e); } } } Playerlist = newPlayerlist; } }
/// <summary> /// Restore All Effect From PlayerXEffect Data Table /// </summary> public virtual void RestoreAllEffects() { GamePlayer player = m_owner as GamePlayer; if (player == null || player.DBCharacter == null || GameServer.Database == null) { return; } var effs = DOLDB <PlayerXEffect> .SelectObjects(DB.Column(nameof(PlayerXEffect.ChardID)).IsEqualTo(player.ObjectId)); if (effs == null) { return; } foreach (PlayerXEffect eff in effs) { GameServer.Database.DeleteObject(eff); } foreach (PlayerXEffect eff in effs.GroupBy(e => e.Var1).Select(e => e.First())) { if (eff.SpellLine == GlobalSpellsLines.Reserved_Spells) { continue; } bool good = true; Spell spell = SkillBase.GetSpellByID(eff.Var1); if (spell == null) { good = false; } SpellLine line = null; if (!Util.IsEmpty(eff.SpellLine)) { line = SkillBase.GetSpellLine(eff.SpellLine, false); if (line == null) { good = false; } } else { good = false; } if (good) { ISpellHandler handler = ScriptMgr.CreateSpellHandler(player, spell, line); GameSpellEffect e; e = new GameSpellEffect(handler, eff.Duration, spell.Frequency); e.RestoredEffect = true; int[] vars = { eff.Var1, eff.Var2, eff.Var3, eff.Var4, eff.Var5, eff.Var6 }; e.RestoreVars = vars; e.Start(player); } } }
/// <summary> /// Default getter for SpellLines /// Retrieve spell line depending on advanced class and class hint /// Order by Baseline /// </summary> /// <param name="living"></param> /// <param name="level">level is only used when called for pretending some level (for trainer display)</param> /// <returns></returns> protected virtual List <SpellLine> GetSpellLinesForLiving(GameLiving living, int level) { List <SpellLine> list = new List <SpellLine>(); IList <Tuple <SpellLine, int> > spsl = SkillBase.GetSpecsSpellLines(KeyName); // Get Spell Lines by order of appearance if (living is GamePlayer) { GamePlayer player = (GamePlayer)living; // select only spec line if is advanced class... var tmp = spsl.Where(item => (item.Item1.IsBaseLine || player.CharacterClass.HasAdvancedFromBaseClass())) .OrderBy(item => (item.Item1.IsBaseLine ? 0 : 1)).ThenBy(item => item.Item1.ID); // try with class hint var baseline = tmp.Where(item => item.Item1.IsBaseLine && item.Item2 == player.CharacterClass.ID); if (baseline.Any()) { foreach (Tuple <SpellLine, int> ls in baseline) { ls.Item1.Level = player.Level; list.Add(ls.Item1); } } else { foreach (Tuple <SpellLine, int> ls in tmp.Where(item => item.Item1.IsBaseLine && item.Item2 == 0)) { ls.Item1.Level = player.Level; list.Add(ls.Item1); } } // try spec with class hint var specline = tmp.Where(item => !item.Item1.IsBaseLine && item.Item2 == player.CharacterClass.ID); if (specline.Any()) { foreach (Tuple <SpellLine, int> ls in specline) { ls.Item1.Level = level; list.Add(ls.Item1); } } else { foreach (Tuple <SpellLine, int> ls in tmp.Where(item => !item.Item1.IsBaseLine && item.Item2 == 0)) { ls.Item1.Level = level; list.Add(ls.Item1); } } } else { // default - not a player, add all... foreach (Tuple <SpellLine, int> ls in spsl.OrderBy(item => (item.Item1.IsBaseLine ? 0 : 1)).ThenBy(item => item.Item1.ID)) { // default living spec is (Level * 0.66 + 1) on Live (no real proof...) // here : Level - (Level / 4) = 0.75 if (ls.Item1.IsBaseLine) { ls.Item1.Level = living.Level; } else { ls.Item1.Level = Math.Max(1, living.Level - (living.Level >> 2)); } list.Add(ls.Item1); } } return(list); }
public void PerformSkill(DPADController dpadController_) { SkillBase _assignedSkill = AssignedSkills[dpadController_]; if (_assignedSkill != null) { if (CheckCoolDown(dpadController_)) { string _message = null; // A partir daqui a skill temporaria do pool SkillBase _pooledSkill = (SkillBase)_assignedSkill.Pool.GetFromPool(); if (_pooledSkill != null) { _pooledSkill.Caster = myPlayer; // TODO CHANGE if (_pooledSkill.CastCheck(out _message)) { currentSkillBase = _pooledSkill; _pooledSkill.SpawnSkill(); skillon = true; this.SetCoolDown((int)_assignedSkill.SkillID, _assignedSkill.CoolDown); if (currentSkillBase.SkillBehaviour != SkillBehaviourEnum.Aura) { currentSkillBase = null; } } } } else { // Skill em cooldown } } }
/// <summary> /// 初始化 /// </summary> /// <param name="data"></param> public void Init(ActorLogicData data) { this.ActorLogicData = data; this.m_DefaultPosition = this.MyTransform.position; this.ActorAI = this.MyGameObject.AddComponent<ActorAIBase>(); this.ActorAI.InitStateMachine(this); foreach (var item0 in data.SkillList) { foreach (var item1 in item0.SkillList) { SkillBase skill = null; switch (item1.SkillType) { case SkillType.Active: skill = this.AddComponent<ActiveSkill>(); break; case SkillType.Passive: skill = this.AddComponent<PassiveSkill>(); break; case SkillType.Trigger: skill = this.AddComponent<TriggerSkill>(); break; case SkillType.Buff: skill = this.AddComponent<Buff>(); break; case SkillType.Debuff: skill = this.AddComponent<Debuff>(); break; case SkillType.Weather: skill = this.AddComponent<WeatherSkill>(); this.m_WeatherSkill = skill; break; case SkillType.First: skill = this.AddComponent<ActiveSkill>(); this.m_FirstSkill = skill; break; default: continue; } skill.Init(this, item0, item1); if (!(item1.SkillType == SkillType.Weather || item1.SkillType == SkillType.First || item1.SkillType == SkillType.Normal)) { this.m_SkillList.Add(skill); } } } this.m_NormalAttack = this.AddComponent<NormalAttack>(); this.m_NormalAttack.Init(this, data.GetNormalAttack()); }
public override bool CastSpell() { GamePlayer caster = (GamePlayer)m_caster; m_spellTarget = caster.TargetObject as GameLiving; GameSpellEffect effect = SpellHandler.FindEffectOnTarget(caster, "Chamber", m_spell.Name); if (effect != null && m_spell.Name == effect.Spell.Name) { ISpellHandler spellhandler = null; ISpellHandler spellhandler2 = null; ChamberSpellHandler chamber = (ChamberSpellHandler)effect.SpellHandler; GameSpellEffect PhaseShift = SpellHandler.FindEffectOnTarget(m_spellTarget, "Phaseshift"); SelectiveBlindnessEffect SelectiveBlindness = Caster.EffectList.GetOfType <SelectiveBlindnessEffect>(); spellhandler = ScriptMgr.CreateSpellHandler(caster, chamber.PrimarySpell, chamber.PrimarySpellLine); #region Pre-checks int duration = caster.GetSkillDisabledDuration(m_spell); if (duration > 0) { MessageToCaster("You must wait " + (duration / 1000 + 1) + " seconds to use this spell!", eChatType.CT_System); return(false); } if (caster.IsMoving || caster.IsStrafing) { MessageToCaster("You must be standing still to cast this spell!", eChatType.CT_System); return(false); } if (caster.IsSitting) { MessageToCaster("You can't cast this spell while sitting!", eChatType.CT_System); return(false); } if (m_spellTarget == null) { MessageToCaster("You must have a target!", eChatType.CT_SpellResisted); return(false); } if (!caster.IsAlive) { MessageToCaster("You cannot cast this dead!", eChatType.CT_SpellResisted); return(false); } if (!m_spellTarget.IsAlive) { MessageToCaster("You cannot cast this on the dead!", eChatType.CT_SpellResisted); return(false); } if (caster.IsMezzed || caster.IsStunned || caster.IsSilenced) { MessageToCaster("You can't use that in your state.", eChatType.CT_System); return(false); } if (!caster.TargetInView) { MessageToCaster("Your target is not visible!", eChatType.CT_SpellResisted); return(false); } if (caster.IsObjectInFront(m_spellTarget, 180) == false) { MessageToCaster("Your target is not in view!", eChatType.CT_SpellResisted); return(false); } if (caster.IsInvulnerableToAttack) { MessageToCaster("Your invunerable at the momment and cannot use that spell!", eChatType.CT_System); return(false); } if (m_spellTarget is GamePlayer) { if ((m_spellTarget as GamePlayer).IsInvulnerableToAttack) { MessageToCaster("Your target is invunerable at the momment and cannot be attacked!", eChatType.CT_System); return(false); } } if (!caster.IsWithinRadius(m_spellTarget, ((SpellHandler)spellhandler).CalculateSpellRange())) { MessageToCaster("That target is too far away!", eChatType.CT_SpellResisted); return(false); } if (PhaseShift != null) { MessageToCaster(m_spellTarget.Name + " is Phaseshifted and can't be attacked!", eChatType.CT_System); return(false); } if (SelectiveBlindness != null) { GameLiving EffectOwner = SelectiveBlindness.EffectSource; if (EffectOwner == m_spellTarget) { if (m_caster is GamePlayer) { ((GamePlayer)m_caster).Out.SendMessage(string.Format("{0} is invisible to you!", m_spellTarget.GetName(0, true)), eChatType.CT_Missed, eChatLoc.CL_SystemWindow); } return(false); } } if (m_spellTarget.HasAbility(Abilities.DamageImmunity)) { MessageToCaster(m_spellTarget.Name + " is immune to this effect!", eChatType.CT_SpellResisted); return(false); } if (GameServer.ServerRules.IsAllowedToAttack(Caster, m_spellTarget, true) && chamber.PrimarySpell.Target.ToLower() == "realm") { MessageToCaster("This spell only works on friendly targets!", eChatType.CT_System); return(false); } if (!GameServer.ServerRules.IsAllowedToAttack(Caster, m_spellTarget, true) && chamber.PrimarySpell.Target.ToLower() != "realm") { MessageToCaster("That target isn't attackable at this time!", eChatType.CT_System); return(false); } spellhandler.CastSpell(); #endregion if (chamber.SecondarySpell != null) { spellhandler2 = ScriptMgr.CreateSpellHandler(caster, chamber.SecondarySpell, chamber.SecondarySpellLine); spellhandler2.CastSpell(); } effect.Cancel(false); if (m_caster is GamePlayer) { GamePlayer player_Caster = Caster as GamePlayer; foreach (SpellLine spellline in player_Caster.GetSpellLines()) { foreach (Spell sp in SkillBase.GetSpellList(spellline.KeyName)) { if (sp.SpellType == m_spell.SpellType) { m_caster.DisableSkill(sp, sp.RecastDelay); } } } } else if (m_caster is GameNPC) { m_caster.DisableSkill(m_spell, m_spell.RecastDelay); } } else { base.CastSpell(); int duration = caster.GetSkillDisabledDuration(m_spell); if (Caster is GamePlayer && duration == 0) { ((GamePlayer)Caster).Out.SendMessage("Select the first spell for your " + Spell.Name + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); } } return(true); }
/// <summary> /// Called on every timer tick /// </summary> protected override void OnTick() { GamePlayer player = (GamePlayer)m_actionSource; if ((m_flagSpeedData & 0x200) != 0) { player.CurrentSpeed = (short)(-(m_flagSpeedData & 0x1ff)); // backward movement } else { player.CurrentSpeed = (short)(m_flagSpeedData & 0x1ff); // forward movement } player.IsStrafing = (m_flagSpeedData & 0x4000) != 0; player.TargetInView = (m_flagSpeedData & 0xa000) != 0; // why 2 bits? that has to be figured out player.GroundTargetInView = ((m_flagSpeedData & 0x1000) != 0); List <Tuple <SpellLine, List <Skill> > > snap = player.GetAllUsableListSpells(); Skill sk = null; SpellLine sl = null; // is spelline in index ? if (m_spellLineIndex < snap.Count) { int index = snap[m_spellLineIndex].Item2.FindIndex(s => s is Spell ? s.Level == m_spellLevel : (s is Styles.Style ? ((Styles.Style)s).SpecLevelRequirement == m_spellLevel : (s is Ability ? ((Ability)s).SpecLevelRequirement == m_spellLevel : false))); if (index > -1) { sk = snap[m_spellLineIndex].Item2[index]; } sl = snap[m_spellLineIndex].Item1; } if (sk is Spell && sl != null) { player.CastSpell((Spell)sk, sl); } else if (sk is Styles.Style) { player.ExecuteWeaponStyle((Styles.Style)sk); } else if (sk is Ability) { Ability ab = (Ability)sk; IAbilityActionHandler handler = SkillBase.GetAbilityActionHandler(ab.KeyName); if (handler != null) { handler.Execute(ab, player); } ab.Execute(player); } else { if (Log.IsWarnEnabled) { Log.Warn("Client <" + player.Client.Account.Name + "> requested incorrect spell at level " + m_spellLevel + " in spell-line " + ((sl == null || sl.Name == null) ? "unkown" : sl.Name)); } player.Out.SendMessage(string.Format("Error : Spell (Line {0}, Level {1}) can't be resolved...", m_spellLineIndex, m_spellLevel), eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow); } }
public void HandlePacket(GameClient client, GSPacketIn packet) { if (client.Account.PrivLevel == (int)ePrivLevel.Player) { GameTrainer trainer = client.Player.TargetObject as DOL.GS.GameTrainer; if (trainer == null || (trainer.CanTrain(client.Player) == false && trainer.CanTrainChampionLevels(client.Player) == false)) { client.Out.SendMessage("You must select a valid trainer for your class.", eChatType.CT_Important, eChatLoc.CL_ChatWindow); return; } } uint x = packet.ReadInt(); uint y = packet.ReadInt(); int idLine = packet.ReadByte(); int unk = packet.ReadByte(); int row = packet.ReadByte(); int skillIndex = packet.ReadByte(); // idline not null so this is a Champion level training window if (idLine > 0) { if (row > 0 && skillIndex > 0) { // Get Player CL Spec var clspec = client.Player.GetSpecList().Where(sp => sp is LiveChampionsSpecialization).Cast <LiveChampionsSpecialization>().FirstOrDefault(); // check if the tree can be used List <Tuple <MiniLineSpecialization, List <Tuple <Skill, byte> > > > tree = null; if (clspec != null) { tree = clspec.GetTrainerTreeDisplay(client.Player, clspec.RetrieveTypeForIndex(idLine)); } if (tree != null) { Tuple <byte, MiniLineSpecialization> skillstatus = clspec.GetSkillStatus(tree, row - 1, skillIndex - 1); if (skillstatus.Item1 == 1) { client.Out.SendMessage("You already have that ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (!(skillstatus.Item1 == 2)) { client.Out.SendMessage("You do not meet the requirements for that ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (client.Player.ChampionSpecialtyPoints < 1) { client.Out.SendMessage("You do not have enough champion specialty points for that ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } skillstatus.Item2.Level++; client.Player.AddSpecialization(skillstatus.Item2); client.Player.RefreshSpecDependantSkills(false); client.Player.Out.SendUpdatePlayer(); client.Player.Out.SendUpdatePoints(); client.Player.Out.SendUpdatePlayerSkills(); client.Player.UpdatePlayerStatus(); client.Player.Out.SendChampionTrainerWindow(idLine); return; } else { client.Out.SendMessage("Could not find Champion Spec!", eChatType.CT_System, eChatLoc.CL_SystemWindow); log.ErrorFormat("Could not find Champion Spec idline {0}, row {1}, skillindex {2}", idLine, row, skillIndex); } } } else { // Trainable Specs or RA's IList <Specialization> speclist = client.Player.GetSpecList().Where(e => e.Trainable).ToList(); if (skillIndex < speclist.Count) { Specialization spec = (Specialization)speclist[skillIndex]; if (spec.Level >= client.Player.BaseLevel) { client.Out.SendMessage("You can't train in this specialization again this level!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } // Graveen - autotrain 1.87 - allow players to train their AT specs even if no pts left int temp = client.Player.SkillSpecialtyPoints + client.Player.GetAutoTrainPoints(spec, 2); if (temp >= spec.Level + 1) { spec.Level++; client.Player.OnSkillTrained(spec); client.Out.SendUpdatePoints(); client.Out.SendTrainerWindow(); return; } else { client.Out.SendMessage("That specialization costs " + (spec.Level + 1) + " specialization points!", eChatType.CT_System, eChatLoc.CL_SystemWindow); client.Out.SendMessage("You don't have that many specialization points left for this level.", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } } else if (skillIndex >= 100) { // Realm Abilities var raList = SkillBase.GetClassRealmAbilities(client.Player.CharacterClass.ID).Where(ra => !(ra is RR5RealmAbility)); if (skillIndex < raList.Count() + 100) { RealmAbility ra = raList.ElementAtOrDefault(skillIndex - 100); if (ra != null) { ra.Level = client.Player.GetAbilityLevel(ra.KeyName); int cost = ra.CostForUpgrade(ra.Level); ra.Level++; if (client.Player.RealmSpecialtyPoints < cost) { client.Out.SendMessage(ra.Name + " costs " + (cost) + " realm ability points!", eChatType.CT_System, eChatLoc.CL_SystemWindow); client.Out.SendMessage("You don't have that many realm ability points left to get this.", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (!ra.CheckRequirement(client.Player)) { client.Out.SendMessage("You are not experienced enough to get " + ra.Name + " now. Come back later.", eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } client.Player.AddRealmAbility(ra, true); client.Out.SendUpdatePoints(); client.Out.SendUpdatePlayer(); client.Out.SendUpdatePlayerSkills(); client.Out.SendTrainerWindow(); } else { client.Out.SendMessage("Unfortunately your training failed. Please report that to admins or game master. Thank you.", eChatType.CT_System, eChatLoc.CL_SystemWindow); log.Error("Realm Ability " + ra.Name + "(" + ra.KeyName + ") unexpected not found"); } } } if (log.IsErrorEnabled) { log.Error("Player <" + client.Player.Name + "> requested to train incorrect skill index"); } } }
public DeffendSkill(IEntity entity, SkillBase baseSkill, int skillLevel) : base(entity, baseSkill, skillLevel) { }
/// <summary> /// スキルを発動する関数 /// </summary> /// <param name="skillNumber">スキルのID</param> /// <param name="skill">スキルクラス</param> /// <returns>true : 発動できる、 false : 発動できない</returns> public override bool UseSkill(int skillNumber, SkillBase skill) { // 詠唱を行うかのフラグ bool chantFlag = true; // 消費SPを超えているか、他の魔法を発動中ならば if (skill.GetSp() > SP || this.chantFlag) { // スキルを発動できない return false; } // SPを消費させる SP -= skill.GetSp(); // ステータスを攻撃中に変更する Attack(); // スキルのIDで処理分けを行う switch (skillNumber) { // 0番目のスキル(Fire) case 0: // メソッドの登録 this.magic = () => Fire(); break; // 1番目のスキル(バーン) case 1: // メソッドの登録 this.magic = () => Burn(); break; // 2番目のスキル(フレア) case 2: // メソッドの登録 this.magic = () => Flare(); break; // 3番目のスキル(メテオ) case 3: // メソッドの登録 this.magic = () => Meteo(); break; // 7番目のスキル(サンダー) case 7: this.magic = () => Thunder(); break; // 8番目のスキル(ショック) case 8: this.magic = () => Shock(); break; // 9番目のスキル(サンダーボルト) case 9: this.magic = () => ThunderVolt(); break; // 10番目のスキル(ヒール) case 10: this.magic = () => Heal(MouseRay.targetPlayer); break; // 12番目のスキル(リジェネ) case 12: this.magic = () => Regene(MouseRay.targetPlayer); break; // 13番目のスキル(ベネディクション) case 13: this.magic = () => Venediction(MouseRay.targetPlayer); break; // 14番目のスキル(コンバート) case 14: // SPが0ならば if (SP == 0) { // 発動できない return false; } this.magic = () => Convert(); // 詠唱を行うフラグを折る chantFlag = false; // モーションを再生する SetTrigger("Buffs"); break; // 15番目のスキル(エーテルフロー) case 15: // メソッドの登録 this.magic = () => EtherFlow(); // 詠唱を行うフラグを折る chantFlag = false; // モーションを再生する SetTrigger("Buffs"); break; } // 詠唱を行うかのフラグが立っていたら if (chantFlag) { // スキルの難易度で処理分けを行う(詠唱のモーションが違うため) switch (skill.GetDifficult()) { case 1: // 1等級魔法の詠唱を行う SetTrigger("FirstLevelMagic"); break; case 2: // 2等級魔法の詠唱を行う SetTrigger("SecondLevelMagic"); break; default: // 3等級魔法の詠唱を行う SetTrigger("ThirdLevelMagic"); break; } // 詠唱を行う StartCoroutine(Chant(skill.GetCastTime())); } // 詠唱を行うフラグを立てる this.chantFlag = true; // 魔法を発動できるのでtrueを返す return true; }
/// <summary> /// スキルを実際に使った処理 /// </summary> /// <param name="skillNumber">スキルの番号</param> /// <param name="skill">スキルのクラスの参照</param> /// <returns>スキルを使用できるかどうかのフラグ</returns> public override bool UseSkill(int skillNumber, SkillBase skill) { // 消費SPを超えているか、他の魔法を発動中ならば if (skill.GetSp() > SP && !attackFlag) { // スキルを発動できない return false; } // SPを消費させる SP -= skill.GetSp(); // ステータスを攻撃中に変更する Attack(); // スキルのIDで処理分けを行う switch (skillNumber) { // 0番目のスキル(ホークアイ) case 0: // メソッドの登録 this.useSkill = () => HawkEye(); SetTrigger("HawkEye"); break; // 1番目のスキル(イーグルアイ) case 1: // メソッドの登録 this.useSkill = () => EagleEye(); SetTrigger("HawkEye"); break; // 2番目のスキル(スピンキック) case 2: // スピンキックを行う this.SpinKick(); break; // 3番目のスキル(ヘヴィショット) case 3: // メソッドの登録 this.useSkill = () => HeavyShot(); SetTrigger("HeavyShot"); break; // 4番目のスキル(ピアシングアロー) case 4: this.useSkill = () => this.PiercingArrow(); SetTrigger("HeavyShot"); break; // 5番目のスキル(ベノムバイト) case 5: this.useSkill = () => VenomBite(); SetTrigger("HeavyShot"); break; // 6番目のスキル(サイドワインダー) case 6: this.useSkill = () => SideWinder(); SetTrigger("HeavyShot"); break; // 7番目のスキル(マジックアロー) case 7: this.useSkill = () => MagicArrow(); SetTrigger("NormalAttack1"); break; // 8番目のスキル(レイン・オブ・デス) case 8: this.useSkill = () => RainOfDeath(); SetTrigger("RainOfDeath"); break; // 9番目のスキル(ムーンサルト) case 9: this.MoonSault(); break; // 10番目のスキル(スナイパーショット) case 10: this.useSkill = () => this.SniperShot(); SetTrigger("SnaiperShot"); break; } // 攻撃したことにする Attack(); // 攻撃したフラグを立てる attackFlag = true; // 魔法を発動できるのでtrueを返す return true; }
/// <summary> /// 检测是否要使用技能 /// </summary> private void CheckSkill() { this.m_CurSkill = this.m_NormalAttack; }
protected override void OnTick() { GameLiving target = m_arrowTarget; GameLiving caster = (GameLiving)m_actionSource; if (target == null || !target.IsAlive || target.ObjectState != GameObject.eObjectState.Active || target.CurrentRegionID != caster.CurrentRegionID) { return; } int missrate = 100 - m_handler.CalculateToHitChance(target); // add defence bonus from last executed style if any AttackData targetAD = (AttackData)target.TempProperties.getProperty <object>(GameLiving.LAST_ATTACK_DATA, null); if (targetAD != null && targetAD.AttackResult == GameLiving.eAttackResult.HitStyle && targetAD.Style != null) { missrate += targetAD.Style.BonusToDefense; } // half of the damage is magical // subtract any spelldamage bonus and re-calculate after half damage is calculated AttackData ad = m_handler.CalculateDamageToTarget(target, 0.5 - caster.GetModified(eProperty.SpellDamage) * 0.01); // check for bladeturn miss if (ad.AttackResult == GameLiving.eAttackResult.Missed) { return; } if (Util.Chance(missrate)) { ad.AttackResult = GameLiving.eAttackResult.Missed; m_handler.MessageToCaster("You miss!", eChatType.CT_YouHit); m_handler.MessageToLiving(target, caster.GetName(0, false) + " missed!", eChatType.CT_Missed); target.OnAttackedByEnemy(ad); target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, caster); if (target is GameNPC npc) { if (npc.Brain is IOldAggressiveBrain aggroBrain) { aggroBrain.AddToAggroList(caster, 1); } } return; } ad.Damage = (int)(ad.Damage * (1.0 + caster.GetModified(eProperty.SpellDamage) * 0.01)); bool arrowBlock = false; if (target is GamePlayer player && !target.IsStunned && !target.IsMezzed && !target.IsSitting && m_handler.Spell.LifeDrainReturn != (int)Archery.eShotType.Critical) { InventoryItem lefthand = player.Inventory.GetItem(eInventorySlot.LeftHandWeapon); if (lefthand != null && (player.AttackWeapon == null || player.AttackWeapon.Item_Type == Slot.RIGHTHAND || player.AttackWeapon.Item_Type == Slot.LEFTHAND)) { if (target.IsObjectInFront(caster, 180) && lefthand.Object_Type == (int)eObjectType.Shield) { // TODO: shield size vs number of attackers not calculated double shield = 0.5 * player.GetModifiedSpecLevel(Specs.Shields); double blockchance = (player.Dexterity * 2 - 100) / 40.0 + shield + 0 * 3 + 5; blockchance += 30; blockchance -= target.GetConLevel(caster) * 5; if (blockchance >= 100) { blockchance = 99; } if (blockchance <= 0) { blockchance = 1; } if (target.IsEngaging) { EngageEffect engage = target.EffectList.GetOfType <EngageEffect>(); if (engage != null && target.AttackState && engage.EngageTarget == caster) { // Engage raised block change to 85% if attacker is engageTarget and player is in attackstate // You cannot engage a mob that was attacked within the last X seconds... if (engage.EngageTarget.LastAttackedByEnemyTick > engage.EngageTarget.CurrentRegion.Time - EngageAbilityHandler.ENGAGE_ATTACK_DELAY_TICK) { (engage.Owner as GamePlayer)?.Out.SendMessage($"{engage.EngageTarget.GetName(0, true)} has been attacked recently and you are unable to engage.", eChatType.CT_System, eChatLoc.CL_SystemWindow); } // Check if player has enough endurance left to engage else if (engage.Owner.Endurance < EngageAbilityHandler.ENGAGE_DURATION_LOST) { engage.Cancel(false); // if player ran out of endurance cancel engage effect } else { engage.Owner.Endurance -= EngageAbilityHandler.ENGAGE_DURATION_LOST; (engage.Owner as GamePlayer)?.Out.SendMessage("You concentrate on blocking the blow!", eChatType.CT_Skill, eChatLoc.CL_SystemWindow); if (blockchance < 85) { blockchance = 85; } } } } if (blockchance >= Util.Random(1, 100)) { arrowBlock = true; m_handler.MessageToLiving(player, $"You block {caster.GetName(0, false)}\'s arrow!", eChatType.CT_System); if (m_handler.Spell.Target.ToLower() != "area") { m_handler.MessageToCaster($"{player.GetName(0, true)} blocks your arrow!", eChatType.CT_System); m_handler.DamageTarget(ad, false, 0x02); } } } } } if (arrowBlock == false) { // now calculate the magical part of arrow damage (similar to bolt calculation). Part 1 Physical, Part 2 Magical double damage = m_handler.Spell.Damage / 2; // another half is physical damage if (target is GamePlayer gamePlayer) { ad.ArmorHitLocation = gamePlayer.CalculateArmorHitLocation(ad); } InventoryItem armor = null; if (target.Inventory != null) { armor = target.Inventory.GetItem((eInventorySlot)ad.ArmorHitLocation); } double ws = caster.Level * 8 * (1.0 + (caster.GetModified(eProperty.Dexterity) - 50) / 200.0); damage *= (ws + 90.68) / (target.GetArmorAF(ad.ArmorHitLocation) + 20 * 4.67); damage *= 1.0 - Math.Min(0.85, ad.Target.GetArmorAbsorb(ad.ArmorHitLocation)); ad.Modifier = (int)(damage * (ad.Target.GetResist(ad.DamageType) + SkillBase.GetArmorResist(armor, ad.DamageType)) / -100.0); damage += ad.Modifier; double effectiveness = caster.Effectiveness; effectiveness += caster.GetModified(eProperty.SpellDamage) * 0.01; damage = damage * effectiveness; damage *= 1.0 + RelicMgr.GetRelicBonusModifier(caster.Realm, eRelicType.Magic); if (damage < 0) { damage = 0; } ad.Damage += (int)damage; if (caster.AttackWeapon != null) { // Quality ad.Damage -= (int)(ad.Damage * (100 - caster.AttackWeapon.Quality) * .01); // Condition ad.Damage = (int)(ad.Damage * Math.Min(1.0, caster.AttackWeapon.Condition / (double)caster.AttackWeapon.MaxCondition)); // Patch Note: http://support.darkageofcamelot.com/kb/article.php?id=931 // - The Damage Per Second (DPS) of your bow will have an effect on your damage for archery shots. If the effective DPS // of your equipped bow is less than that of your max DPS for the level of archery shot you are using, the damage of your // shot will be reduced. Max DPS for a particular level can be found by using this equation: (.3 * level) + 1.2 int spellRequiredDPS = 12 + 3 * m_handler.Spell.Level; if (caster.AttackWeapon.DPS_AF < spellRequiredDPS) { double percentReduction = caster.AttackWeapon.DPS_AF / (double)spellRequiredDPS; ad.Damage = (int)(ad.Damage * percentReduction); } } if (ad.Damage < 0) { ad.Damage = 0; } ad.UncappedDamage = ad.Damage; ad.Damage = (int)Math.Min(ad.Damage, m_handler.DamageCap(effectiveness)); if (ad.CriticalDamage > 0) { if (m_handler.Spell.Target.ToLower() == "area") { ad.CriticalDamage = 0; } else { int critMax = target is GamePlayer ? ad.Damage / 2 : ad.Damage; ad.CriticalDamage = Util.Random(critMax / 10, critMax); } } target.ModifyAttack(ad); m_handler.SendDamageMessages(ad); m_handler.DamageTarget(ad, false, 0x14); target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, caster); } if (m_handler.Spell.SubSpellId != 0) { Spell subspell = SkillBase.GetSpellByID(m_handler.Spell.SubSpellId); if (subspell != null) { subspell.Level = m_handler.Spell.Level; ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(m_handler.Caster, subspell, SkillBase.GetSpellLine(GlobalSpellsLines.Combat_Styles_Effect)); spellhandler?.StartSpell(target); } } if (arrowBlock == false && m_handler.Caster.AttackWeapon != null && GlobalConstants.IsBowWeapon((eObjectType)m_handler.Caster.AttackWeapon.Object_Type)) { if (ad.AttackResult == GameLiving.eAttackResult.HitUnstyled || ad.AttackResult == GameLiving.eAttackResult.HitStyle) { caster.CheckWeaponMagicalEffect(ad, m_handler.Caster.AttackWeapon); } } }
public SpellDelve(Spell spell) { DelveType = "Spell"; Index = unchecked ((short)spell.InternalID); spellHandler = ScriptMgr.CreateSpellHandler(GamePlayer.CreateDummy(), spell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); }
public void AddSkill(GameObject player, int skID) { if (skID == 0) { Debug.LogError("SkillMgr ERROR: Null reference is not allowed"); } SkillBase skInstance ; skInstance = new SkillBase(player, skID); skills.Add(skInstance); Hashtable parm = new Hashtable(); parm.Add("activity","0"); player.GetComponent<Actor>().getFSMMgr.OnMessage(player, parm); }
/// <summary> /// Get Summarized "Hybrid" Spell Dictionary /// List Caster use basic Specialization Getter... /// This would have pretty much no reason to be used by GameLiving... (Maybe as a shortcut to force them to use their best spells...) /// </summary> /// <param name="living"></param> /// <returns></returns> protected override IDictionary <SpellLine, List <Skill> > GetLinesSpellsForLiving(GameLiving living, int level) { // An hybrid dictionary is composed of a spellline "base" // SpecLine and Baseline are mixed in spellline named "base" // baseline are displayed first (improvement are easier this way) // specline are displayed secondly (ordered in appareance order) // some class/spelline are allowed to display the "2 -best" spell // this is hardcoded in AllowMultipleSpellVersions... Dictionary <SpellLine, List <Skill> > buffer = new Dictionary <SpellLine, List <Skill> >(); List <SpellLine> lines = GetSpellLinesForLiving(living, level); foreach (SpellLine ls in lines) { // buffer shouldn't contain duplicate lines if (buffer.ContainsKey(ls)) { continue; } // Add to Dictionary buffer.Add(ls, new List <Skill>()); IEnumerable <Spell> lib = SkillBase.GetSpellList(ls.KeyName).Where(item => item.Level <= ls.Level); int take = 1; if ((living is GamePlayer) && AllowMultipleSpellVersions(ls, (GamePlayer)living)) { // Get 2-First Better Spell for each type // Chris Foster changed this to 1 so he could possibly get more spells on characters. take = 1; } IEnumerable <IEnumerable <Spell> > firstBetterSpellNoGroup = lib.Where(item => item.Group == 0) .GroupBy(item => new { item.SpellType, item.Target, item.IsAoE, item.IsInstantCast, item.HasSubSpell }) .Select(ins => ins.OrderByDescending(it => it.Level).Take(take)); IEnumerable <IEnumerable <Spell> > firstBetterSpellGroup = lib.Where(item => item.Group != 0) .GroupBy(item => item.Group) .Select(ins => ins.OrderByDescending(it => it.Level).Take(take)); // sort by reverse level for multiple version List <Spell> firstBetterSpellFinal = firstBetterSpellGroup.SelectMany(el => el).Union(firstBetterSpellNoGroup.SelectMany(el => el)) .Where(item => item != null).OrderByDescending(item => item.Level).ToList(); // Get Appearance Order // not group base IEnumerable <IEnumerable <Spell> > baseOrderNoGroup = lib.Where(item => item.Group == 0) .GroupBy(item => new { item.SpellType, item.Target, item.IsAoE, item.IsInstantCast, item.HasSubSpell }) .Select(ins => ins.OrderBy(it => it.Level).Take(take)); // group based IEnumerable <IEnumerable <Spell> > baseOrderGroup = lib.Where(item => item.Group != 0) .GroupBy(item => item.Group) .Select(ins => ins.OrderBy(it => it.Level).Take(take)); // Join and sort... IEnumerable <Spell> baseOrderFinal = baseOrderNoGroup.SelectMany(el => el).Union(baseOrderGroup.SelectMany(el => el)) .Where(item => item != null).OrderBy(item => item.Level); foreach (Spell sp in baseOrderFinal) { // replace each spell of order with their best equivalent int index = firstBetterSpellFinal.FindIndex(od => ((od.Group == 0 && sp.Group == 0) && (od.SpellType == sp.SpellType && od.Target == sp.Target && od.IsAoE == sp.IsAoE && od.HasSubSpell == sp.HasSubSpell && od.IsInstantCast == sp.IsInstantCast)) || (od.Group != 0 && od.Group == sp.Group)); if (index > -1) { buffer[ls].Add(firstBetterSpellFinal[index]); firstBetterSpellFinal.RemoveAt(index); } } } return(buffer); }
IEnumerator Knockback2A(SkillBase attackerSkill, float force, float time = 1) { float startTime = Time.time; float elapsedTime = 0f; //Debug.Log("밀림시작"); bool isTestA = transform.position.x < attackerSkill.transform.position.x; ProjectileNormal projectile = attackerSkill.GetComponent <ProjectileNormal>(); if (projectile) { if (projectile.isMoveForwardRight != isTestA) { yield break; } } //if(test != isTestA) //{ // test = isTestA; // yield break; //} if (transform.position.x < attackerSkill.transform.position.x) { force = -force; } //bool isTestA = transform.position.x < attackerSkill.transform.position.x; //bool isTestC = false; while (elapsedTime < 1) { if (this.isDie) { break; } yield return(null); // 시간 판단 elapsedTime = (Time.time - startTime) / time; //bool isTestB = transform.position.x < attackerSkill.transform.position.x; //isTestC = isTestA == isTestB; //if (isTestC) //{ //} //if (force < 0) //{ // Debug.Log("날라가"); //} //isBlockMove = true; Vector2 pushPoint = new Vector2(attackerSkill.transform.position.x + force, transform.position.y); //float dis = Vector2.Distance((Vector2.right * pushPoint.x), (Vector2.right * transform.position.x)); //if (dis < 2) //{ // break; //} if (attackerSkill.IsCastTargetInSkillRange()) { //transform.position = Vector2.Lerp(transform.position, pushPoint, elapsedTime); transform.position = Vector2.MoveTowards(transform.position, pushPoint, 1); } else { break; } } //isBlockMove = false; pushCoroutine = null; }
public override bool UseSkill(int skillNumber, SkillBase skill) { // デバッグ用 Debug.Log("Call UseSkil"); if (skill.GetSp() > SP || isUseSkills) { Debug.Log("Skill Cancel"); // スキル使用させない return false; } Debug.Log("Spend SP"); // SPを消費させる SP -= skill.GetSp(); // スキルを使用中に切り替える SkillFlag(); // スキルのIDで処理分けを行う switch (skillNumber) { case 0: this.StanceKongou(); break; case 1: this.StanceGale(); break; case 2: this.StanceGlen(); break; case 3: this.Renki(); break; case 4: this.Hakei(); break; case 5: this.Rengeki(); break; case 6: this.Seiken(); break; case 7: this.RotationKick(); break; case 8: this.Rasetu(); break; case 9: this.Sousyoda(); break; case 10: this.Souryu(); break; case 11: this.Kikou(); break; case 12: this.Renkan(); break; case 13: this.Musou(); break; } return true; }
/// <summary> /// Action /// </summary> /// <param></param> public override void Execute(GameLiving living) { if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) { return; } GamePlayer player = living as GamePlayer; if (player == null) { return; } Spell subspell = SkillBase.GetSpellByID(7063); ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(player, subspell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); if (player.Group == null) { spellhandler.StartSpell(player); } else { foreach (GamePlayer member in player.Group.GetPlayersInTheGroup()) { if (member != null) { spellhandler.StartSpell(member); } } } DisableSkill(living); }
IEnumerator AirborneA(SkillBase attackerSkill, float force, float time = 1) { float startTime = Time.time; float elapsedTime = 0f; //Debug.Log("밀림시작"); //? isBlockMove = false; float x = 5f; if (attackerSkill.owner.transform.position.x > transform.position.x) { x = -5f; } Vector3 destPos = transform.position + Vector3.right * x; Renderer r = skeletonAnimation.GetComponent <Renderer>(); Color curColor = new Color(1f, 0f, 0f, 0.5f); mpb.SetColor("_OverlayColor", curColor); r.SetPropertyBlock(mpb); beforeAirbornePos = transform.position; float deltaTime = 0f; float lastTime = Time.time; while (elapsedTime < 2f) { if (isDie) { break; } elapsedTime = Time.time - startTime; deltaTime = Time.time - lastTime; float y = skeletonAnimation.transform.localPosition.y + 8f; if (y > 8f) { y = 8f; } //pushPoint = new Vector2(skeletonAnimation.transform.position.x, y); skeletonAnimation.transform.localPosition = Vector3.Lerp(skeletonAnimation.transform.localPosition, Vector3.up * y, y * deltaTime * 0.5f); transform.position = Vector3.Lerp(transform.position, destPos, x * deltaTime * 0.5f); if (elapsedTime > 0.4f) { curColor = Color.Lerp(curColor, new Color(1f, 0f, 0f, 0f), elapsedTime - 0.4f); mpb.SetColor("_OverlayColor", curColor); r.SetPropertyBlock(mpb); } lastTime = Time.time; yield return(null); } airborneCoroutine = null; yield break; //orderController.enabled = false; Vector2 pushPoint = Vector2.zero; while (elapsedTime < 1 * Time.timeScale) { if (this.isDie) { break; } yield return(null); // 시간 판단 elapsedTime = (Time.time - startTime) / time; float y = skeletonAnimation.transform.position.y + force; if (y > -135.25f) { y = -135.25f; } pushPoint = new Vector2(skeletonAnimation.transform.position.x, y); skeletonAnimation.transform.position = Vector2.MoveTowards(skeletonAnimation.transform.position, pushPoint, 1 * Time.timeScale); } while (airborne) { if (isDie) { break; } skeletonAnimation.transform.position = pushPoint; yield return(null); } //orderController.enabled = true; airborneCoroutine = null; }
protected override void WriteItemData(GSTCPPacketOut pak, InventoryItem item) { if (item == null) { pak.Fill(0x00, 21); return; } pak.WriteByte((byte)item.Level); int value1; // some object types use this field to display count int value2; // some object types use this field to display count switch (item.Object_Type) { case (int)eObjectType.GenericItem: value1 = item.Count & 0xFF; value2 = (item.Count >> 8) & 0xFF; break; case (int)eObjectType.Arrow: case (int)eObjectType.Bolt: case (int)eObjectType.Poison: value1 = item.Count; value2 = item.SPD_ABS; break; case (int)eObjectType.Thrown: value1 = item.DPS_AF; value2 = item.Count; break; case (int)eObjectType.Instrument: value1 = (item.DPS_AF == 2 ? 0 : item.DPS_AF); value2 = 0; break; // unused case (int)eObjectType.Shield: value1 = item.Type_Damage; value2 = item.DPS_AF; break; case (int)eObjectType.AlchemyTincture: case (int)eObjectType.SpellcraftGem: value1 = 0; value2 = 0; /* * must contain the quality of gem for spell craft and think same for tincture */ break; case (int)eObjectType.HouseWallObject: case (int)eObjectType.HouseFloorObject: case (int)eObjectType.GardenObject: value1 = 0; value2 = item.SPD_ABS; /* * Value2 byte sets the width, only lower 4 bits 'seem' to be used (so 1-15 only) * * The byte used for "Hand" (IE: Mini-delve showing a weapon as Left-Hand * usabe/TwoHanded), the lower 4 bits store the height (1-15 only) */ break; default: value1 = item.DPS_AF; value2 = item.SPD_ABS; break; } pak.WriteByte((byte)value1); pak.WriteByte((byte)value2); if (item.Object_Type == (int)eObjectType.GardenObject) { pak.WriteByte((byte)(item.DPS_AF)); } else { pak.WriteByte((byte)(item.Hand << 6)); } pak.WriteByte((byte)((item.Type_Damage > 3 ? 0 : item.Type_Damage << 6) | item.Object_Type)); pak.WriteByte(0x00); //unk 1.112 pak.WriteShort((ushort)item.Weight); pak.WriteByte(item.ConditionPercent); // % of con pak.WriteByte(item.DurabilityPercent); // % of dur pak.WriteByte((byte)item.Quality); // % of qua pak.WriteByte((byte)item.Bonus); // % bonus pak.WriteByte((byte)item.BonusLevel); // 1.109 pak.WriteShort((ushort)item.Model); pak.WriteByte((byte)item.Extension); int flag = 0; int emblem = item.Emblem; int color = item.Color; if (emblem != 0) { pak.WriteShort((ushort)emblem); flag |= (emblem & 0x010000) >> 16; // = 1 for newGuildEmblem } else { pak.WriteShort((ushort)color); } // flag |= 0x01; // newGuildEmblem // Enable craft button if the item can be modified and the player has alchemy or spellcrafting eCraftingSkill skill = CraftingMgr.GetCraftingSkill(item); switch (skill) { case eCraftingSkill.ArmorCrafting: case eCraftingSkill.Fletching: case eCraftingSkill.Tailoring: case eCraftingSkill.WeaponCrafting: if (m_gameClient.Player.CraftingSkills.ContainsKey(eCraftingSkill.Alchemy) || m_gameClient.Player.CraftingSkills.ContainsKey(eCraftingSkill.SpellCrafting)) { flag |= 0x04; // enable craft button } break; default: break; } ushort icon1 = 0; ushort icon2 = 0; string spell_name1 = ""; string spell_name2 = ""; if (item.Object_Type != (int)eObjectType.AlchemyTincture) { if (item.SpellID > 0 /* && item.Charges > 0*/) { SpellLine chargeEffectsLine = SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects); if (chargeEffectsLine != null) { List <Spell> spells = SkillBase.GetSpellList(chargeEffectsLine.KeyName); foreach (Spell spl in spells) { if (spl.ID == item.SpellID) { flag |= 0x08; icon1 = spl.Icon; spell_name1 = spl.Name; // or best spl.Name ? break; } } } } if (item.SpellID1 > 0 /* && item.Charges > 0*/) { SpellLine chargeEffectsLine = SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects); if (chargeEffectsLine != null) { List <Spell> spells = SkillBase.GetSpellList(chargeEffectsLine.KeyName); foreach (Spell spl in spells) { if (spl.ID == item.SpellID1) { flag |= 0x10; icon2 = spl.Icon; spell_name2 = spl.Name; // or best spl.Name ? break; } } } } } pak.WriteByte((byte)flag); if ((flag & 0x08) == 0x08) { pak.WriteShort((ushort)icon1); pak.WritePascalString(spell_name1); } if ((flag & 0x10) == 0x10) { pak.WriteShort((ushort)icon2); pak.WritePascalString(spell_name2); } pak.WriteByte((byte)item.Effect); string name = item.Name; if (item.Count > 1) { name = item.Count + " " + name; } if (item.SellPrice > 0) { if (ServerProperties.Properties.CONSIGNMENT_USE_BP) { name += "[" + item.SellPrice.ToString() + " BP]"; } else { name += "[" + Money.GetString(item.SellPrice) + "]"; } } if (name == null) { name = ""; } if (name.Length > 55) { name = name.Substring(0, 55); } pak.WritePascalString(name); }
IEnumerator FallingDownA(SkillBase attackerSkill, float force, float time = 1) { if (beforeAirbornePos == Vector2.zero) { beforeAirbornePos = new Vector2(transform.position.x, transform.position.y); } float startTime = Time.time; float elapsedTime = 0f; //Debug.Log("밀림시작"); if (transform.position.x < attackerSkill.transform.position.x) { force = -force; } orderController.enabled = false; Vector2 fallDownPoint = new Vector2(beforeAirbornePos.x + force, beforeAirbornePos.y); if (airborneCoroutine != null) { StopCoroutine(airborneCoroutine); airborneCoroutine = null; } //얻어 맞는 순간 타격감 표현 Shake(0.4f, 0.1f, 0.06f); while (elapsedTime < 0.1f) { elapsedTime = Time.time - startTime; yield return(null); } startTime = Time.time; elapsedTime = 0f; float speed = 25f; float gravity = 10f; Vector2 startPos = skeletonAnimation.transform.localPosition; float deltaTime = 0f; float lastTime = Time.time; while (elapsedTime < 2f) { if (isDie) { break; } // 시간 판단 elapsedTime = Time.time - startTime; deltaTime = Time.time - lastTime; if (attackerSkill.IsCastTargetInSkillRange()) { //transform.position = Vector2.MoveTowards(transform.position, fallDownPoint, 0.5f * Time.timeScale); speed += gravity * deltaTime; skeletonAnimation.transform.localPosition = Vector2.MoveTowards(skeletonAnimation.transform.localPosition, Vector3.zero, speed * deltaTime); } else { break; } if (skeletonAnimation.transform.localPosition.y <= 0f) { skeletonAnimation.transform.localPosition = Vector3.zero; break; } lastTime = Time.time; yield return(null); } buffController.DetachBuff(buffController.buffList.Find(x => x.baseData.airborne)); //if (isDie) //{ // transform.position = fallDownPoint; // tomestone.transform.position = transform.position; //} //else //{ // transform.position = fallDownPoint; //} if (attackerSkill.owner.skillList.Find(x => x.skillData.id.Contains("Impact")) != null) { SkillBase skill = attackerSkill.owner.skillList.Find(x => x.skillData.id.Contains("Impact")); skill.castTarget = this; skill.Execute(); } orderController.enabled = true; falldownCoroutine = null; }
public static void PlayerSkillChanged(SkillBase skill) { onPlayerChangedSkill?.Invoke(skill); }
public override int CalcValueBase(GameLiving living, eProperty property) { int propertyIndex = (int)property; int debuff = Math.Abs(living.DebuffCategory[propertyIndex]); int racialBonus = (living is GamePlayer) ? SkillBase.GetRaceResist(((living as GamePlayer).Race), (eResist)property) : 0; int itemBonus = CalcValueFromItems(living, property); int buffBonus = CalcValueFromBuffs(living, property); switch (property) { case eProperty.Resist_Body: case eProperty.Resist_Cold: case eProperty.Resist_Energy: case eProperty.Resist_Heat: case eProperty.Resist_Matter: case eProperty.Resist_Natural: case eProperty.Resist_Spirit: debuff += Math.Abs(living.DebuffCategory[eProperty.MagicAbsorption]); buffBonus += living.BaseBuffBonusCategory[eProperty.MagicAbsorption]; break; } if (living is GameNPC) { // NPC buffs effects are halved compared to debuffs, so it takes 2% debuff to mitigate 1% buff // See PropertyChangingSpell.ApplyNpcEffect() for details. buffBonus = buffBonus << 1; int specDebuff = Math.Abs(living.SpecDebuffCategory[property]); switch (property) { case eProperty.Resist_Body: case eProperty.Resist_Cold: case eProperty.Resist_Energy: case eProperty.Resist_Heat: case eProperty.Resist_Matter: case eProperty.Resist_Natural: case eProperty.Resist_Spirit: specDebuff += Math.Abs(living.SpecDebuffCategory[eProperty.MagicAbsorption]); break; } buffBonus -= specDebuff; if (buffBonus > 0) { buffBonus = buffBonus >> 1; } } buffBonus -= Math.Abs(debuff); if (living is GamePlayer && buffBonus < 0) { itemBonus += buffBonus / 2; buffBonus = 0; if (itemBonus < 0) { itemBonus = 0; } } return(Math.Min(itemBonus + buffBonus + racialBonus, HardCap)); }
/// <summary> /// Getter for Ability with a "step" hint used to display future upgrade /// Return Abilities it lists depending on spec level /// Override to change the condition... /// </summary> /// <param name="living"></param> /// <param name="step">step is only used when called for pretending some level (for trainer display)</param> /// <returns></returns> public virtual List <Ability> PretendAbilitiesForLiving(GameLiving living, int step) { return(SkillBase.GetSpecAbilityList(KeyName, living is GamePlayer ? ((GamePlayer)living).CharacterClass.ID : 0) .Where(k => k.SpecLevelRequirement <= step) .OrderBy(k => k.SpecLevelRequirement).ToList()); }
/// <summary> /// Get spell attached to Ability Level. /// </summary> /// <param name="level"></param> /// <returns></returns> public Spell GetSpellForLevel(int level) { var line = SpellLine; return(line != null?SkillBase.GetSpellList(line.KeyName).FirstOrDefault(spell => spell.Level == level) : null); }
public HealSkill(IEntity entity, SkillBase baseSkill, int skillLevel) : base(entity, baseSkill, skillLevel) { }
public override bool WhisperReceive(GameLiving source, string str) { if (!base.WhisperReceive(source, str)) { return(false); } GamePlayer player = source as GamePlayer; if (player == null) { return(false); } if (str == "dostuff") { DoSomeStuff(15); return(true); } if (player.Level != 50) { player.Out.SendMessage("Your not strong enough to embrace the life of champions!", eChatType.CT_System, eChatLoc.CL_PopupWindow); return(false); } if (str == "champions") { if (player.Champion) { player.Out.SendMessage("You are already a champion!", eChatType.CT_System, eChatLoc.CL_PopupWindow); return(false); } player.Champion = true; player.SaveIntoDatabase(); player.Out.SendMessage("You have just embraced on the life of the champions!", eChatType.CT_System, eChatLoc.CL_PopupWindow); Interact(player); return(true); } if (str == "Agdranzt" && (player.Champion)) { if (player.ChampionLevel == player.ChampionMaxLevel) { player.Out.SendMessage("You are already at the maximum champion level!", eChatType.CT_System, eChatLoc.CL_PopupWindow); return(true); } do { player.ChampionExperience = +player.ChampionExperienceForNextLevel; CheckPromoteChampion(player); } while (player.ChampionLevel < player.ChampionMaxLevel); return(true); } //level respec for players if (str == "respec") { if (player.Champion && player.ChampionLevel >= 5) { player.RemoveSpellLine(GlobalSpellsLines.Champion_Spells + player.Name); SkillBase.UnRegisterSpellLine(GlobalSpellsLines.Champion_Spells + player.Name); player.ChampionSpells = ""; player.ChampionSpecialtyPoints = player.ChampionLevel; player.UpdateSpellLineLevels(true); player.RefreshSpecDependantSkills(true); player.Out.SendUpdatePlayer(); player.UpdatePlayerStatus(); player.Out.SendUpdatePlayerSkills(); player.SaveIntoDatabase(); player.Out.SendMessage("You might have to reconnect to our world to make the changes take effect.", eChatType.CT_System, eChatLoc.CL_PopupWindow); //There is a bug here that old spells will come back once buying new ones untill relog of character. you may want //to force the player to relog after they respec champion spells. } } int ctype = 0; switch (player.Realm) { case eRealm.Albion: { switch (str) { case "Acolyte": { ctype = 4; } break; case "Elementalist": { ctype = 5; } break; } } break; case eRealm.Hibernia: { switch (str) { case "Way of Nature": { ctype = 10; } break; case "Way of Magic": { ctype = 11; } break; } } break; case eRealm.Midgard: { switch (str) { case "Seer": { ctype = 8; } break; case "Mystic": { ctype = 9; } break; } } break; } if (ctype != 0) { player.TempProperties.setProperty("championtraining", ctype); player.Out.SendChampionTrainerWindow(ctype); } return(true); }
void Update() { if (state == State.delay) { delay -= Time.deltaTime; if (delay <= 0.0f) { state = State.start; } } if (state == State.start) { var skill = gameObject.GetComponent <Skill>(); if (!skill || !skill.startGo || !skill.targetGo) { StartTargetEvent(); return; } var mountStartGo = SkillBase.Find(skill.startGo.transform, mountOfStartGo); if (!mountStartGo) { mountStartGo = skill.startGo.transform; } mountTargetGo = SkillBase.Find(skill.targetGo.transform, mountOfTargetGo); if (!mountTargetGo) { mountTargetGo = skill.targetGo.transform; } particleGo = Instantiate(particle) as GameObject; if (particleGo.GetComponent <ParticleParentAutoDestroy>() == null) { particleGo.AddComponent <ParticleParentAutoDestroy>(); } particleGo.transform.localPosition = Vector3.zero; particleGo.transform.position = mountStartGo.transform.position; path = new Vector3[3]; path[0] = mountStartGo.transform.position; state = State.move; } else if (state == State.move) { if (!mountTargetGo || !particleGo) { StartTargetEvent(); return; } var distance = (mountTargetGo.transform.position - particleGo.transform.position).magnitude; if (distance <= 0.01f) { StartTargetEvent(); } else { path[2] = mountTargetGo.transform.position; var relative = path[2] - path[0]; var halfDis = relative.magnitude * 0.5f; path[1] = relative * 0.5f + new Vector3(halfDis * Mathf.Tan(Mathf.Deg2Rad * deviationDegree.x), halfDis * Mathf.Tan(Mathf.Deg2Rad * deviationDegree.y), halfDis * Mathf.Tan(Mathf.Deg2Rad * deviationDegree.z)); var pathLength = Spline.PathLength(path); if (movePosition > pathLength) { movePosition = pathLength; } movePosition = Mathf.MoveTowards(movePosition, pathLength, speed * Time.deltaTime); if (movePosition > pathLength) { movePosition = pathLength; } if (movePosition >= pathLength) { StartTargetEvent(); } else { var percentage = movePosition / pathLength; Vector3 curPos = Spline.InterpConstantSpeed(path, percentage); particleGo.transform.position = curPos; if (orientToPath) { particleGo.transform.LookAt(Spline.InterpConstantSpeed(path, percentage + 0.05f)); } } } } }
public IdentifySkill(ILiveEntity liveEntity, SkillBase baseSkill, int skillLevel) : base(liveEntity, baseSkill, skillLevel) { }
public override AttackData CalculateDamageToTarget(GameLiving target, double effectiveness) { GamePlayer player = Caster as GamePlayer; if (player == null) { return(null); } InventoryItem weapon = null; if (player.ActiveWeaponSlot.ToString() == "TwoHanded") { weapon = player.Inventory.GetItem((eInventorySlot)12); } if (player.ActiveWeaponSlot.ToString() == "Standard") { weapon = player.Inventory.GetItem((eInventorySlot)10); } if (weapon == null) { return(null); } //create the AttackData AttackData ad = new AttackData(); ad.Attacker = player; ad.Target = target; ad.Damage = 0; ad.CriticalDamage = 0; ad.WeaponSpeed = player.AttackSpeed(weapon) / 100; ad.DamageType = player.AttackDamageType(weapon); ad.Weapon = weapon; ad.IsOffHand = weapon.Hand == 2; //we need to figure out which armor piece they are going to hit. //figure out the attacktype switch (weapon.Item_Type) { default: case Slot.RIGHTHAND: case Slot.LEFTHAND: ad.AttackType = AttackData.eAttackType.MeleeOneHand; break; case Slot.TWOHAND: ad.AttackType = AttackData.eAttackType.MeleeTwoHand; break; } //Throw Weapon is subject to all the conventional attack results, parry, evade, block, etc. ad.AttackResult = ad.Target.CalculateEnemyAttackResult(ad, weapon); if (ad.AttackResult == GameLiving.eAttackResult.HitUnstyled || ad.AttackResult == GameLiving.eAttackResult.HitStyle) { //we only need to calculate the damage if the attack was a success. double damage = player.AttackDamage(weapon) * effectiveness; if (target is GamePlayer) { ad.ArmorHitLocation = ((GamePlayer)target).CalculateArmorHitLocation(ad); } InventoryItem armor = null; if (target.Inventory != null) { armor = target.Inventory.GetItem((eInventorySlot)ad.ArmorHitLocation); } //calculate the lowerboundary of the damage int lowerboundary = (player.WeaponSpecLevel(weapon) - 1) * 50 / (ad.Target.EffectiveLevel + 1) + 75; lowerboundary = Math.Max(lowerboundary, 75); lowerboundary = Math.Min(lowerboundary, 125); damage *= (player.GetWeaponSkill(weapon) + 90.68) / (ad.Target.GetArmorAF(ad.ArmorHitLocation) + 20 * 4.67); //If they have badge of Valor, we need to modify the damage if (ad.Attacker.EffectList.GetOfType <BadgeOfValorEffect>() != null) { damage *= 1.0 + Math.Min(0.85, ad.Target.GetArmorAbsorb(ad.ArmorHitLocation)); } else { damage *= 1.0 - Math.Min(0.85, ad.Target.GetArmorAbsorb(ad.ArmorHitLocation)); } damage *= (lowerboundary + Util.Random(50)) * 0.01; ad.Modifier = (int)(damage * (ad.Target.GetResist(ad.DamageType) + SkillBase.GetArmorResist(armor, ad.DamageType)) * -0.01); damage += ad.Modifier; int resist = (int)(damage * ad.Target.GetDamageResist(target.GetResistTypeForDamage(ad.DamageType)) * -0.01); eProperty property = ad.Target.GetResistTypeForDamage(ad.DamageType); int secondaryResistModifier = ad.Target.SpecBuffBonusCategory[(int)property]; int resistModifier = 0; resistModifier += (int)((ad.Damage + (double)resistModifier) * (double)secondaryResistModifier * -0.01); damage += resist; damage += resistModifier; ad.Modifier += resist; ad.Damage = (int)damage; ad.UncappedDamage = ad.Damage; ad.Damage = Math.Min(ad.Damage, (int)(player.UnstyledDamageCap(weapon) * effectiveness)); ad.Damage = (int)((double)ad.Damage * ServerProperties.Properties.PVP_MELEE_DAMAGE); if (ad.Damage == 0) { ad.AttackResult = DOL.GS.GameLiving.eAttackResult.Missed; } ad.CriticalDamage = player.GetMeleeCriticalDamage(ad, weapon); } else { //They failed, do they do not get disarmed, and the spell is not disabled for the full duration, //just the modified swing speed, this is in milliseconds int attackSpeed = player.AttackSpeed(weapon); player.TempProperties.setProperty(DISABLE, attackSpeed); } return(ad); }
/// <summary> /// we need to make use of the new poison fields /// </summary> public void ConvertDatabase() { log.Info("Database Version 3 Convert Started"); if (GameServer.Instance.Configuration.DBType == DOL.Database.Connection.ConnectionType.DATABASE_XML) { log.Info("You have an XML database loaded, this converter will only work with MySQL, skipping"); return; } var templates = DOLDB <ItemTemplate> .SelectObjects(DB.Column(nameof(ItemTemplate.SpellID)).IsEqualTo(0)); int count = 0; foreach (ItemTemplate template in templates) { SpellLine poisonLine = SkillBase.GetSpellLine(GlobalSpellsLines.Mundane_Poisons); if (poisonLine != null) { IList spells = SkillBase.GetSpellList(poisonLine.KeyName); if (spells != null) { foreach (Spell spl in spells) { if (spl.ID == template.SpellID) { template.PoisonSpellID = template.SpellID; template.SpellID = 0; template.PoisonCharges = template.Charges; template.Charges = 0; template.PoisonMaxCharges = template.MaxCharges; template.MaxCharges = 0; GameServer.Database.SaveObject(template); count++; break; } } } } } log.Info("Converted " + count + " templates"); var items = DOLDB <InventoryItem> .SelectObjects(DB.Column(nameof(InventoryItem.SpellID)).IsEqualTo(0)); count = 0; foreach (InventoryItem item in items) { foreach (ItemTemplate template in templates) { SpellLine poisonLine = SkillBase.GetSpellLine(GlobalSpellsLines.Mundane_Poisons); if (poisonLine != null) { IList spells = SkillBase.GetSpellList(poisonLine.KeyName); if (spells != null) { foreach (Spell spl in spells) { if (spl.ID == template.SpellID) { template.PoisonSpellID = template.SpellID; template.SpellID = 0; template.PoisonCharges = template.Charges; template.Charges = 0; template.PoisonMaxCharges = template.MaxCharges; template.MaxCharges = 0; GameServer.Database.SaveObject(template); count++; break; } } } } } } log.Info("Converted " + count + " items"); log.Info("Database Version 3 Convert Finished"); }
public override bool UseSkill(int skillNumber, SkillBase skill) { if (skill.GetSp() > SP || isUseSkills) { return false; } // SPを消費させる SP -= skill.GetSp(); // スキルを使用中に切り替える SkillFlag(); // スキルのIDで処理分けを行う switch (skillNumber) { case 0: this.Prov(); break; case 1: this.Berserk(); break; case 2: this.Warcry(); break; case 3: this.BloodRage(); break; case 4: this.Defender(); break; case 5: this.Lampart(); break; case 6: this.Sentinel(); break; case 7: this.PowerSlash(); break; case 8: this.Fastblade(); break; case 9: this.DashSword(); break; case 10: this.SonicBoom(); break; case 11: this.SpiritsWithIn(); break; case 12: this.DrainSword(); break; case 13: this.SpinSlash(); break; case 14: this.BoparuSword(); break; case 15: this.ShieldBash(); break; } return true; }
public void Text() { SkillBase skill = SkillControl.skills[skillId]; int next_lv = skill.GetLv() + 1; // 次のレベル表示 float now_atk = 1 + skill.GetAttack() - skill.GetBonus(); // 現在のダメージ倍率表示 float next_atk = 1 + skill.GetAttack(); // lvUp時のダメージ倍率表示 float now_effect = skill.GetEffectTime() - skill.GetBonus(); // 現在の効果時間表示 if (skill.GetLv() != 0) { // 1 = バフスキル, 2 = アタックスキル, 3 = 魔法? if (skill.GetSkillType() == 2 || skill.GetSkillType() == 3) { // 現在のスキル情報を表示させる クポ transform.Find(text_Array[0]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[1]).GetComponent <Text>().text = skill.GetLv().ToString(); transform.Find(text_Array[2]).GetComponent <Text>().text = skill.GetCoolTime().ToString(); transform.Find(text_Array[3]).GetComponent <Text>().text = now_atk.ToString("P0"); transform.Find(text_Array[4]).GetComponent <Text>().text = skill.GetSp().ToString(); // スキルがlv10を超えていたら クポ if (skill.GetLv() >= lvMax) { //スキルの未来予知の表記をさせないようにする クポ transform.Find(text_Array[5]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[6]).GetComponent <Text>().text = ("- -"); transform.Find(text_Array[7]).GetComponent <Text>().text = ("- -"); transform.Find(text_Array[8]).GetComponent <Text>().text = ("- -"); transform.Find(text_Array[9]).GetComponent <Text>().text = ("- - - -"); transform.Find(text_Array[10]).GetComponent <Text>().text = ("- -"); } else { // スキルの未来予知の表記をさせる クポ transform.Find(text_Array[5]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[6]).GetComponent <Text>().text = next_lv.ToString(); transform.Find(text_Array[7]).GetComponent <Text>().text = skill.GetCoolTime().ToString(); transform.Find(text_Array[8]).GetComponent <Text>().text = next_atk.ToString("P0"); transform.Find(text_Array[9]).GetComponent <Text>().text = skill.GetPoint().ToString(); transform.Find(text_Array[10]).GetComponent <Text>().text = skill.GetSp().ToString(); } } else if (skill.GetSkillType() == 1) //バフならば { // 現在のスキル情報を表示させる クポ transform.Find(text_Array[0]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[1]).GetComponent <Text>().text = skill.GetLv().ToString(); transform.Find(text_Array[2]).GetComponent <Text>().text = skill.GetCoolTime().ToString("0.0") + (" s"); transform.Find(text_Array[3]).GetComponent <Text>().text = now_effect.ToString("0.0") + (" s"); transform.Find(text_Array[4]).GetComponent <Text>().text = skill.GetSp().ToString(); // スキルがlv10を超えていたら クポ if (skill.GetLv() >= lvMax) { //スキルの未来予知の表記をさせないようにする クポ transform.Find(text_Array[5]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[6]).GetComponent <Text>().text = ("- -"); transform.Find(text_Array[7]).GetComponent <Text>().text = ("- -"); transform.Find(text_Array[8]).GetComponent <Text>().text = ("- -"); transform.Find(text_Array[9]).GetComponent <Text>().text = ("- - - -"); transform.Find(text_Array[10]).GetComponent <Text>().text = ("- -"); } else { // スキルの未来予知の表記をさせる クポ transform.Find(text_Array[5]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[6]).GetComponent <Text>().text = (skill.GetLv() + 1).ToString(); transform.Find(text_Array[7]).GetComponent <Text>().text = skill.GetCoolTime().ToString("0.0") + (" s"); transform.Find(text_Array[8]).GetComponent <Text>().text = skill.GetEffectTime().ToString("0.0") + (" s"); transform.Find(text_Array[9]).GetComponent <Text>().text = skill.GetPoint().ToString(); transform.Find(text_Array[10]).GetComponent <Text>().text = skill.GetSp().ToString(); } } } //ここにlv0の時、lv1の時のステータスを出させる if (skill.GetLv() == 0 && skill.GetSkillType() == 2 || skill.GetSkillType() == 3) { // 攻撃スキルの未来予知の表記をさせる クポ transform.Find(text_Array[5]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[6]).GetComponent <Text>().text = next_lv.ToString(); transform.Find(text_Array[7]).GetComponent <Text>().text = skill.GetCoolTime().ToString(); transform.Find(text_Array[8]).GetComponent <Text>().text = next_atk.ToString("P0"); transform.Find(text_Array[9]).GetComponent <Text>().text = skill.GetPoint().ToString(); transform.Find(text_Array[10]).GetComponent <Text>().text = skill.GetSp().ToString(); } else { // バフスキルの未来予知の表記をさせる クポ transform.Find(text_Array[5]).GetComponent <Text>().text = skill.GetName(); transform.Find(text_Array[6]).GetComponent <Text>().text = next_lv.ToString(); transform.Find(text_Array[7]).GetComponent <Text>().text = skill.GetCoolTime().ToString(); transform.Find(text_Array[8]).GetComponent <Text>().text = next_atk.ToString("P0"); transform.Find(text_Array[9]).GetComponent <Text>().text = skill.GetPoint().ToString(); transform.Find(text_Array[10]).GetComponent <Text>().text = skill.GetSp().ToString(); } }
/// <summary> /// Metodo responsavel por associar uma skill ao comando do DPAD /// </summary> /// <param name="dpadController_">Dpad controller.</param> /// <param name="spellBase_">Spell base.</param> public void AssignSkillToDPad(DPADController dpadController_, SkillBase spellBase_) { AssignedSkills[dpadController_] = spellBase_; }
public void OnCommand(GameClient client, string[] args) { if (args.Length < 2) { DisplaySyntax(client); return; } switch (args[1].ToLower()) { case "create": { if (args.Length != 7 || (!args[4].ToLower().Equals("group") && !args[4].ToLower().Equals("self") && !args[4].ToLower().Equals("realm"))) { DisplaySyntax(client); return; } DBMinotaurRelic relic = new DBMinotaurRelic(); relic.Name = args[2]; relic.SpawnHeading = client.Player.Heading; relic.SpawnX = client.Player.X; relic.SpawnY = client.Player.Y; relic.SpawnZ = client.Player.Z; relic.SpawnRegion = client.Player.CurrentRegionID; relic.relicTarget = args[4].ToLower(); try { relic.relicSpell = Convert.ToInt32(args[5]); relic.Model = Convert.ToUInt16(args[3]); relic.Effect = Convert.ToInt32(args[6]); } catch (Exception) { DisplaySyntax(client); return; } relic.RelicID = MinotaurRelicManager.GetRelicCount() + 1; GameServer.Database.AddObject(relic); MinotaurRelic rrelic = new MinotaurRelic(relic); rrelic.AddToWorld(); MinotaurRelicManager.AddRelic(rrelic); break; } case "movehere": { if (!(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; relic.Heading = client.Player.Heading; relic.X = client.Player.X; relic.Y = client.Player.Y; relic.Z = client.Player.Z; relic.CurrentRegionID = client.Player.CurrentRegionID; relic.SpawnHeading = client.Player.Heading; relic.SpawnX = client.Player.X; relic.SpawnY = client.Player.Y; relic.SpawnZ = client.Player.Z; relic.SpawnRegion = client.Player.CurrentRegionID; relic.SaveIntoDatabase(); break; } case "model": { if (args.Length != 3 || !(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; try { relic.Model = Convert.ToUInt16(args[2]); } catch (Exception) { DisplaySyntax(client); return; } relic.SaveIntoDatabase(); break; } case "name": { if (args.Length != 3 || !(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; relic.Name = args[2]; relic.SaveIntoDatabase(); break; } case "spell": { if (args.Length != 3 || !(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; try { relic.RelicSpellId = Convert.ToInt32(args[2]); } catch (Exception) { DisplaySyntax(client); return; } relic.SaveIntoDatabase(); break; } case "effect": { if (args.Length != 3 || !(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; try { relic.Effect = Convert.ToInt32(args[2]); } catch (Exception) { DisplaySyntax(client); return; } relic.SaveIntoDatabase(); break; } case "info": { if (!(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; var info = new List <string>(); info.Add("==========================="); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.RelicInfo")); info.Add("==========================="); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.Name", relic.Name)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.ID", relic.RelicId)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.CurrentXP", relic.Xp)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.Level", relic.Level)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.Effect", relic.Effect)); info.Add("==========================="); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.PositionInfo")); info.Add("==========================="); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpawnX", relic.SpawnX)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpawnY", relic.SpawnX)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpawnZ", relic.SpawnZ)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpawnHeading" + relic.SpawnHeading)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpawnRegion", relic.SpawnRegion)); info.Add("==========================="); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpellInfo")); info.Add("==========================="); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpellID", relic.RelicSpell)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpellTarget", relic.RelicTarget)); Spell spell = SkillBase.GetSpellByID(relic.RelicSpellId); if (spell != null) { info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpellName", spell.Name)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpellType", spell.SpellType)); info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Info.SpellDuration", spell.Duration / 1000)); } client.Out.SendCustomTextWindow("[ " + relic.Name + " ]", info); break; } case "despawn": { if (!(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; relic.Xp = 0; relic.RemoveFromWorld(); relic.RelicDispose(); break; } case "remove": { // Lifeflight: Added the option to remove a minorelic by supplying an ID. if (args.Length == 3) { int minorelicID = 0; try { minorelicID = Convert.ToInt32(args[2]); } catch (Exception) { } if (minorelicID == 0) { DisplaySyntax(client); return; } else { foreach (MinotaurRelic relic in MinotaurRelicManager.Minotaurrelics.Values) { if (relic != null) { if (relic.RelicId == minorelicID) { // there is a match! // remove it from the world relic.RemoveFromWorld(); client.Player.Out.SendMessage("Relic " + relic.RelicId + " has been removed from the world", eChatType.CT_System, eChatLoc.CL_SystemWindow); // remove it from the hashtable MinotaurRelicManager.RemoveRelic(relic); client.Player.Out.SendMessage("Relic " + relic.RelicId + " has been removed from the Minorelic Hash Table", eChatType.CT_System, eChatLoc.CL_SystemWindow); DataObject obj = GameServer.Database.FindObjectByKey <DBMinotaurRelic>(relic.RelicId); if (obj != null) { GameServer.Database.DeleteObject(obj); client.Player.Out.SendMessage("Relic " + relic.RelicId + " has been removed from the database!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } break; } } } } } else { if (!(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; relic.RemoveFromWorld(); client.Player.Out.SendMessage("Relic " + relic.RelicId + " has been removed from the world", eChatType.CT_System, eChatLoc.CL_SystemWindow); // remove it from the hashtable MinotaurRelicManager.RemoveRelic(relic); client.Player.Out.SendMessage("Relic " + relic.RelicId + " has been removed from the Minorelic Hash Table", eChatType.CT_System, eChatLoc.CL_SystemWindow); DataObject obj = GameServer.Database.FindObjectByKey <DBMinotaurRelic>(relic.RelicId); if (obj != null) { GameServer.Database.DeleteObject(obj); client.Player.Out.SendMessage("Relic " + relic.RelicId + " has been removed from the database!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } } break; } case "xp": { if (args.Length != 3 || !(client.Player.TargetObject is MinotaurRelic)) { DisplaySyntax(client); return; } MinotaurRelic relic = client.Player.TargetObject as MinotaurRelic; try { relic.Xp += Convert.ToInt32(args[2]); if (relic.Owner != null) { relic.Owner.Out.SendMinotaurRelicBarUpdate(relic.Owner, (int)relic.Xp); } } catch (Exception) { DisplaySyntax(client); return; } break; } case "showall": { var info = new List <string>(); if (args.Length > 2) { ushort region = 0; try { region = Convert.ToUInt16(args[2]); } catch (Exception) { return; } foreach (MinotaurRelic relic in MinotaurRelicManager.Minotaurrelics.Values) { if (relic != null && relic.CurrentRegionID == region) { info.Add(relic.ToString()); info.Add("==========================="); } } info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.ShowAll.Count", info.Count)); client.Out.SendCustomTextWindow(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.ShowAll.Infos"), info); return; } foreach (MinotaurRelic relic in MinotaurRelicManager.Minotaurrelics.Values) { if (relic != null) { info.Add(relic.ToString()); info.Add("==========================="); } } info.Add(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.ShowAll.Count", MinotaurRelicManager.Minotaurrelics.Count)); client.Out.SendCustomTextWindow(LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.ShowAll.Infos"), info); break; } case "spawn": { if (args.Length != 3) { DisplaySyntax(client); return; } MinotaurRelic relic = MinotaurRelicManager.GetRelic(Convert.ToInt32(args[2])); if (relic == null) { DisplaySyntax(client); return; } if (relic.Respawntimer == null) { DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.MinoRelic.Spawn.AlreadySpawned")); return; } relic.ManualRespawn(); break; } } }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (WorldMgr.GetDistance(this, source) > WorldMgr.INTERACT_DISTANCE) { ((GamePlayer)source).Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t.MLLevel == 0) { t.Out.SendMessage("You have not completed any MLs and therefore cannot respec them!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); return(false); } if (t != null && item != null && item.Id_nb == "mlrespectoken") { if (t.CharacterClass.ID == 1)//Paladin { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 2)//Armsman { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 3)//Scout { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 4)//Minstrel { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 5)//Theurgist { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 6)//Cleric { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 7)//Wizard { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 8)//Sorcerer { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 9)//Infiltrator { mlchoicea = (byte)eMLLine.Spymaster; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 10)//Frair { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 11)//Mercenary { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 12)//Necromancer { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 13)//Cabalist { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 19)//Reaver { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 21)//Thane { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 22)//Warrior { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 23)//Shadowblade { mlchoicea = (byte)eMLLine.Spymaster; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 24)//Skald { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 25)//Hunter { mlchoicea = (byte)eMLLine.Sojourner; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 26)//Healer { mlchoicea = (byte)eMLLine.Sojourner; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 27)//Spiritmaster { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 28)//Shaman { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 29)//Runemaster { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 30)//Bonedancer { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 31)//Berserker { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 32)//Savage { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 33)//Heretic { mlchoicea = (byte)eMLLine.Banelord; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 34)//Valkyrie { mlchoicea = (byte)eMLLine.Stormlord; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 39)//Bainshee { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 40)//Eldritch { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 41)//Enchanter { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 42)//Mentalist { mlchoicea = (byte)eMLLine.Stormlord; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 43)//Blademaster { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 44)//Hero { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 45)//Champion { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 46)//Warden { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 47)//Druid { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 48)//Bard { mlchoicea = (byte)eMLLine.Sojourner; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 49)//Nightshade { mlchoicea = (byte)eMLLine.Spymaster; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 50)//Ranger { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 55)//Animist { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 56)//Valewalker { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 58)//Vampiir { mlchoicea = (byte)eMLLine.Banelord; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 59)//Warlock { mlchoicea = (byte)eMLLine.Banelord; mlchoiceb = (byte)eMLLine.Convoker; } int i = 0; switch (t.MLLevel) { case (byte)eMLLine.Banelord: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Banelord"); } break; case (byte)eMLLine.BattleMaster: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Battlemaster"); } break; case (byte)eMLLine.Convoker: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Convoker"); } break; case (byte)eMLLine.Perfecter: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Perfecter"); } break; case (byte)eMLLine.Sojourner: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Sojourner"); } break; case (byte)eMLLine.Stormlord: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Stormlord"); } break; case (byte)eMLLine.Spymaster: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Spymaster"); } break; case (byte)eMLLine.Warlord: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Warlord"); } break; default: break; } if (t.MLLevel == mlchoicea) { mlfinish = mlchoiceb; } else { mlfinish = mlchoicea; } switch (mlfinish) { case (byte)eMLLine.Banelord: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Banelord")); } t.MLLevel = (byte)eMLLine.Banelord; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.BattleMaster: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Battlemaster")); } t.MLLevel = (byte)eMLLine.BattleMaster; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Convoker: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Convoker")); } t.MLLevel = (byte)eMLLine.Convoker; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Perfecter: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Perfecter")); } t.MLLevel = (byte)eMLLine.Perfecter; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Sojourner: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Sojourner")); } t.MLLevel = (byte)eMLLine.Sojourner; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Stormlord: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Stormlord")); } t.MLLevel = (byte)eMLLine.Stormlord; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Spymaster: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Spymaster")); } t.MLLevel = (byte)eMLLine.Spymaster; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Warlord: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Warlord")); } t.MLLevel = (byte)eMLLine.Warlord; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; default: break; } t.Out.SendPlayerQuit(false); t.Quit(true); t.SaveIntoDatabase(); } return(base.ReceiveItem(source, item)); }
/// <summary> /// スキルを使う処理 /// </summary> /// <param name="skillNumber">使うスキルの番号</param> public abstract bool UseSkill(int skillNumber, SkillBase skill);