public MonsterRecord(ushort id, string name, ContextActorLook look, bool isBoss, bool isMiniboss, short race, bool useSummonSlot, bool useBombSlot, List <MonsterDrop> drops, List <ushort> spells, List <MonsterGrade> grades, int minDroppedKamas, int maxDroppedKamas, int power, string behaviorName) { this.Id = id; this.Name = name; this.Look = look; this.IsBoss = isBoss; this.IsMiniBoss = isMiniboss; this.Race = race; this.UseSummonSlot = useSummonSlot; this.UseBombSlot = useBombSlot; this.Drops = drops; this.Spells = spells; this.Grades = grades; this.MinDroppedKamas = minDroppedKamas; this.MaxDroppedKamas = maxDroppedKamas; this.SpellRecords = Spells.ConvertAll <SpellRecord>(x => SpellRecord.GetSpellRecord(x)); this.Power = power; this.BehaviorName = behaviorName; }
public override bool Apply(Fighter[] targets) { SpellRecord record = SpellRecord.GetSpellRecord(this.Effect.DiceMin); foreach (var target in targets) { this.Source.ForceSpellCast(record, (sbyte)this.Effect.DiceMax, target.CellId); } return(true); }
public Spell GetSpell(AIUnit owner, byte slot, SummonerSpellId summonerSpell) { SpellRecord record = SpellRecord.GetSpell(summonerSpell.ToString()); if (record != null) { return(new Spell(owner, record, slot, SpellScriptManager.Instance.GetSpellScript(record, owner), true)); } else { return(null); } }
public Spell GetSpell(AIUnit owner, byte slot, string spellName) { SpellRecord record = owner.Record.GetSpellRecord(spellName); if (record != null) { return(new Spell(owner, record, slot, SpellScriptManager.Instance.GetSpellScript(record, owner), false)); } else { return(null); } }
protected Mark(short id, Fighter source, SpellLevelRecord spellLevel, EffectInstance effect, MapPoint centerPoint, Zone zone, Color color, MarkTriggerTypeEnum triggerType) { this.Id = id; this.Source = source; this.SpellLevel = spellLevel; this.BaseEffect = effect; this.CenterPoint = centerPoint; this.Zone = zone; this.Color = color; this.TriggerSpell = SpellRecord.GetSpellRecord(effect.DiceMin); this.BuildShapes(); this.TriggerType = triggerType; this.Active = true; }
public Spell GetSpell(AIUnit owner, byte slot, string spellName, bool isSummonerSpell = false) { SpellRecord record = null; record = SpellRecord.GetSpell(spellName); if (record != null) { return(new Spell(owner, record, slot, SpellScriptManager.Instance.GetSpellScript(record, owner), isSummonerSpell)); } else { return(null); } }
/// <summary> /// Teaches a new spell to the unit. Also sends the spell learning animation, if applicable. /// </summary> void AddSpell(Spell spell, bool sendPacket) { // make sure the char knows the skill that this spell belongs to if (spell.Ability != null) { var skill = OwnerChar.Skills[spell.Ability.Skill.Id]; if (skill == null) { // learn new skill skill = OwnerChar.Skills.Add(spell.Ability.Skill, true); } if (skill.CurrentTierSpell == null || skill.CurrentTierSpell.SkillTier < spell.SkillTier) { // upgrade tier skill.CurrentTierSpell = spell; } } if (!m_byId.ContainsKey(spell.SpellId)) { var owner = OwnerChar; var specIndex = GetSpecIndex(spell); var spells = GetSpellList(spell); var newRecord = new SpellRecord(spell.SpellId, owner.EntityId.Low, specIndex); newRecord.SaveLater(); spells.Add(newRecord); base.AddSpell(spell); } if (m_sendPackets && sendPacket) { if (spell.Level == 1) { Asda2SpellHandler.SendSkillLearnedFirstTimeResponse(OwnerChar.Client, spell.RealId, spell.CooldownTime); } Asda2SpellHandler.SendSkillLearnedResponse(SkillLearnStatus.Ok, OwnerChar, (uint)spell.RealId, spell.Level); //SpellHandler.SendLearnedSpell(owner.Client, spell.Id); /*if (!spell.IsPassive) * { * SpellHandler.SendVisual(owner, 362); // ouchy: Unnamed constants * }*/ } }
public override bool Apply(Fighter[] targets) { var target = Fight.GetFighter(CastPoint); if (target != null) { SpellBombRecord record = SpellBombRecord.GetSpellBombRecord(SpellLevel.SpellId); var level = SpellRecord.GetSpellRecord(record.CibleExplosionSpellId).GetLevel(SpellLevel.Grade); Source.ForceSpellCast(level, CastPoint.CellId); } else { MonsterRecord record = MonsterRecord.GetMonster(Effect.DiceMin); BombFighter fighter = new BombFighter(record, Source, Source.Team, CastPoint.CellId, SpellLevel.Grade, SpellLevel); Fight.AddBomb(fighter, Source); } return(true); }
public override void Execute(MonsterFighter fighter) { var summonSpell = fighter.Template.Spells.ConvertAll <SpellRecord>(x => SpellRecord.GetSpell(x)).Find(x => x.Category == SpellCategoryEnum.Summon); if (summonSpell != null && fighter.SummonCount <= 1) { var cells = ShapesProvider.GetSquare(fighter.CellId, false); var cell = cells.Find(x => !fighter.Fight.IsObstacle(x)); if (cell != 0) { fighter.CastSpellOnCell(summonSpell.Id, cell); } else { fighter.Fight.Reply("Unable to summon"); } } }