Пример #1
0
    public override bool OnFire(Transform playerTransform, Character character)
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); // TODO: always mouse pos?
        RaycastHit hit;
        Vector3 targetPos = playerTransform.position + (playerTransform.forward * 100);

        // test for collision
        if (Physics.Raycast(ray, out hit, 100F))
        {
            targetPos = hit.point;
            if (hit.collider.gameObject.tag == "mob")
            {
                var info = new SpellInfo { Damage = GetDamage(), Element = "Fire" };
                hit.collider.gameObject.SendMessage("OnSpellCast", info);
            }
        }

        // create particles
        _instance = Object.Instantiate(Prefab, playerTransform.position, playerTransform.rotation) as GameObject;
        if (_instance != null)
        {
            _instance.audio.Play();
            var instanceStraightScript = _instance.GetComponent<Straight>();
            instanceStraightScript.Speed = Speed;
            instanceStraightScript.Target = targetPos;
            instanceStraightScript.Moving = true;
        }

        return true;
    }
Пример #2
0
 public static void InitSpells()
 {
     Q = new SpellInfo(1100, .25f, 1800, 65);
     Q2 = new SpellInfo(1300, .25f, 1400, 0);
     W = new SpellInfo(700, .25f, 1000, 0);
     W2 = new SpellInfo(float.MaxValue, 0, 0, 0);
     E = new SpellInfo(125, .25f, 1400, 0);
     E2 = new SpellInfo(float.MaxValue, .25f, 1000, 0);
     R = new SpellInfo(375, .25f, 1000, 0);
 }
Пример #3
0
 void OnSpellCast(SpellInfo spellInfo)
 {
     Debug.Log("in OnSpellCast for NPC");
     Hp -= spellInfo.Damage;
     if (Hp > 0)
     {
         transform.gameObject.animation.Play("gethit");
         if (Hp % 2 == 0)
         {
             gameObject.audio.clip = hitAudio;
             gameObject.audio.Play();
         }
     }
 }
Пример #4
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.SoulSwapModCost, SpellIds.SoulSwapOverride));
 }
Пример #5
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.GenReplenishment));
 }
Пример #6
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.GlyphOfSuccubus, SpellIds.PriestShadowWordDeath));
 }
Пример #7
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.ImprovedSoulFirePct, SpellIds.ImprovedSoulFireState));
 }
Пример #8
0
 public PaladinSpell(Mobile caster, Item scroll, SpellInfo info)
     : base(caster, scroll, info)
 {
 }
Пример #9
0
 public TargetedSpellsong( Mobile caster, Item scroll, SpellInfo info )
     : base(caster, scroll, info)
 {
 }
Пример #10
0
 public override void SpellHitTarget(Unit target, SpellInfo spell)
 {
     GetScript().ProcessEventsFor(SmartEvents.SpellhitTarget, target, 0, 0, false, spell);
 }
Пример #11
0
 public override void SpellHit(Unit caster, SpellInfo spell)
 {
     GetScript().ProcessEventsFor(SmartEvents.SpellHit, caster, 0, 0, false, spell);
 }
Пример #12
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.Vengeance));
 }
Пример #13
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.Victorious, SpellIds.VictoriousRushHeal));
 }
Пример #14
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.ImpendingVictory));
 }
Пример #15
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.TraumaEffect));
 }
Пример #16
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.BloodthirstHeal));
 }
Пример #17
0
 private SpellInfo GetSpellFromString(String Source)
 {
     int StartSpellID=0, EndSpellID = 0, StartSpellName = 0, EndSpellName = 0, StartRank = 0, EndRank = 0;
     SpellInfo Result = new SpellInfo();
     try
     {
         for (int i = 0; i < Source.Length - 4; i++)
         {
             if (Source.Substring(i, 4) == "SID:")
             {
                 StartSpellID = 4;
             }
             if ((StartSpellID != 0) & (Source.Substring(i, 4) == ";SN:"))
             {
                 EndSpellID = i;
                 StartSpellName = i + 4;
             }
             if ((StartSpellName != 0) & (Source.Substring(i, 4) == ";SR:"))
             {
                 EndSpellName = i;
                 StartRank = i + 4;
             }
             if (StartRank != 0)
                 EndRank = Source.Length - 1;
         }
         Result.SpellID = Convert.ToInt32(Source.Substring(StartSpellID, EndSpellID - StartSpellID));
         Result.SpellName = Source.Substring(StartSpellName, EndSpellName - StartSpellName);
         Result.SpellRank = Convert.ToInt32(Source.Substring(StartRank, EndRank - StartRank));
     } catch (Exception) { }
     return Result;
 }
Пример #18
0
 public ArcanistSpell(Mobile caster, Item scroll, SpellInfo info)
     : base(caster, scroll, info)
 {
 }
Пример #19
0
 public MysticSpell(Mobile caster, Item scroll, SpellInfo info)
     : base(caster, scroll, info)
 {
 }
Пример #20
0
        bool Create(ulong lowGuid, uint conversationEntry, Map map, Unit creator, Position pos, List <ObjectGuid> participants, SpellInfo spellInfo = null)
        {
            ConversationTemplate conversationTemplate = Global.ConversationDataStorage.GetConversationTemplate(conversationEntry);

            //ASSERT(conversationTemplate);

            _creatorGuid  = creator.GetGUID();
            _participants = participants;

            SetMap(map);
            Relocate(pos);

            _Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid));
            PhasingHandler.InheritPhaseShift(this, creator);

            SetEntry(conversationEntry);
            SetObjectScale(1.0f);

            SetUpdateFieldValue(m_values.ModifyValue(m_conversationData).ModifyValue(m_conversationData.LastLineEndTime), conversationTemplate.LastLineEndTime);
            _duration     = conversationTemplate.LastLineEndTime;
            _textureKitId = conversationTemplate.TextureKitId;

            for (ushort actorIndex = 0; actorIndex < conversationTemplate.Actors.Count; ++actorIndex)
            {
                ConversationActorTemplate actor = conversationTemplate.Actors[actorIndex];
                if (actor != null)
                {
                    ConversationActor actorField = new ConversationActor();
                    actorField.CreatureID            = actor.CreatureId;
                    actorField.CreatureDisplayInfoID = actor.CreatureModelId;
                    actorField.Type = ConversationActorType.CreatureActor;

                    AddDynamicUpdateFieldValue(m_values.ModifyValue(m_conversationData).ModifyValue(m_conversationData.Actors), actorField);
                }
            }

            for (ushort actorIndex = 0; actorIndex < conversationTemplate.ActorGuids.Count; ++actorIndex)
            {
                ulong actorGuid = conversationTemplate.ActorGuids[actorIndex];
                if (actorGuid == 0)
                {
                    continue;
                }

                foreach (var creature in map.GetCreatureBySpawnIdStore().LookupByKey(actorGuid))
                {
                    // we just need the last one, overriding is legit
                    AddActor(creature.GetGUID(), actorIndex);
                }
            }

            Global.ScriptMgr.OnConversationCreate(this, creator);

            List <ushort>           actorIndices = new List <ushort>();
            List <ConversationLine> lines        = new List <ConversationLine>();

            foreach (ConversationLineTemplate line in conversationTemplate.Lines)
            {
                actorIndices.Add(line.ActorIdx);

                ConversationLine lineField = new ConversationLine();
                lineField.ConversationLineID = line.Id;
                lineField.StartTime          = line.StartTime;
                lineField.UiCameraID         = line.UiCameraID;
                lineField.ActorIndex         = line.ActorIdx;
                lineField.Flags = line.Flags;

                lines.Add(lineField);
            }

            SetUpdateFieldValue(m_values.ModifyValue(m_conversationData).ModifyValue(m_conversationData.Lines), lines);

            Global.ScriptMgr.OnConversationCreate(this, creator);

            // All actors need to be set
            foreach (ushort actorIndex in actorIndices)
            {
                ConversationActor actor = actorIndex < m_conversationData.Actors.Size() ? m_conversationData.Actors[actorIndex] : null;
                if (actor == null || (actor.CreatureID == 0 && actor.ActorGUID.IsEmpty() && actor.NoActorObject == 0))
                {
                    Log.outError(LogFilter.Conversation, $"Failed to create conversation (Id: {conversationEntry}) due to missing actor (Idx: {actorIndex}).");
                    return(false);
                }
            }

            if (!GetMap().AddToMap(this))
            {
                return(false);
            }

            return(true);
        }
Пример #21
0
		public ArcanistSpell( Mobile caster, Item scroll, SpellInfo info )
			: base( caster, scroll, info )
		{
		}
Пример #22
0
        public static Conversation CreateConversation(uint conversationEntry, Unit creator, Position pos, List <ObjectGuid> participants, SpellInfo spellInfo = null)
        {
            ConversationTemplate conversationTemplate = Global.ConversationDataStorage.GetConversationTemplate(conversationEntry);

            if (conversationTemplate == null)
            {
                return(null);
            }

            ulong lowGuid = creator.GetMap().GenerateLowGuid(HighGuid.Conversation);

            Conversation conversation = new Conversation();

            if (!conversation.Create(lowGuid, conversationEntry, creator.GetMap(), creator, pos, participants, spellInfo))
            {
                return(null);
            }

            return(conversation);
        }
Пример #23
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.ShieldSlam));
 }
Пример #24
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.Soulshatter));
 }
Пример #25
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.NetherTalent, SpellIds.NetherWard, SpellIds.ShadowWard));
 }
Пример #26
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(_triggerSpell));
 }
Пример #27
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.SeedOfCorruptionGeneric));
 }
Пример #28
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.Immolate));
 }
Пример #29
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.GlyphOfSoulSwap, SpellIds.SoulSwapCdMarker, SpellIds.SoulSwapOverride));
 }
Пример #30
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.UnstableAfflictionDispel));
 }
Пример #31
0
 protected AreaSpellsong( Mobile caster, Item scroll, SpellInfo info )
     : base(caster, scroll, info)
 {
 }
Пример #32
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.CreateHealthstone));
 }
Пример #33
0
		public TransformationSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
		{
			if (Body != caster.BodyValue)
				caster.Flying = false;
		}
Пример #34
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.BaneOfDoomEffect));
 }
Пример #35
0
            /// <summary>
            /// Conjures the specified spell.
            /// </summary>
            /// <param name="info">Information about the spell to conjure.</param>
            /// <returns>
            /// The spell that was conjured.
            /// </returns>
            internal Spell Conjure(SpellInfo info)
            {
                Mana -= info.Cost;
                ManaSpent += info.Cost;

                Spell spell = info.Conjure();

                _spells.Add(spell);

                return spell;
            }
Пример #36
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.DemonSoulImp, SpellIds.DemonSoulFelhunter, SpellIds.DemonSoulFelguard, SpellIds.DemonSoulSuccubus, SpellIds.DemonSoulVoidwalker));
 }
Пример #37
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.DemonicEmpowermentSuccubus, SpellIds.DemonicEmpowermentVoidwalker, SpellIds.DemonicEmpowermentFelguard, SpellIds.DemonicEmpowermentFelhunter, SpellIds.DemonicEmpowermentImp));
 }
Пример #38
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.GlyphOfDemonTraining, SpellIds.DevourMagicHeal));
 }
		public TransformationSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
		{
		}
Пример #40
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.FelSynergyHeal));
 }
Пример #41
0
 public NinjaSpell(Mobile caster, Item scroll, SpellInfo info)
     : base(caster, scroll, info)
 {
 }
Пример #42
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.GlyphOfShadowflame));
 }
Пример #43
0
		public override double CastDelayFastScalar{ get{ return (Core.SE? base.CastDelayFastScalar : 0); } } // Necromancer spells are not affected by fast cast items, though they are by fast cast recovery

		public NecromancerSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
		{
		}
Пример #44
0
 public override bool Validate(SpellInfo spellInfo)
 {
     return(ValidateSpellInfo(SpellIds.HauntHeal));
 }
Пример #45
0
 public SamuraiSpell(Mobile caster, Item scroll, SpellInfo info)
     : base(caster, scroll, info)
 {
 }
Пример #46
0
 public SpellweavingSpell( Mobile caster, Item scroll, SpellInfo info )
     : base(caster, scroll, info)
 {
 }