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; }
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); }
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(); } } }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.SoulSwapModCost, SpellIds.SoulSwapOverride)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.GenReplenishment)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.GlyphOfSuccubus, SpellIds.PriestShadowWordDeath)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.ImprovedSoulFirePct, SpellIds.ImprovedSoulFireState)); }
public PaladinSpell(Mobile caster, Item scroll, SpellInfo info) : base(caster, scroll, info) { }
public TargetedSpellsong( Mobile caster, Item scroll, SpellInfo info ) : base(caster, scroll, info) { }
public override void SpellHitTarget(Unit target, SpellInfo spell) { GetScript().ProcessEventsFor(SmartEvents.SpellhitTarget, target, 0, 0, false, spell); }
public override void SpellHit(Unit caster, SpellInfo spell) { GetScript().ProcessEventsFor(SmartEvents.SpellHit, caster, 0, 0, false, spell); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.Vengeance)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.Victorious, SpellIds.VictoriousRushHeal)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.ImpendingVictory)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.TraumaEffect)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.BloodthirstHeal)); }
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; }
public ArcanistSpell(Mobile caster, Item scroll, SpellInfo info) : base(caster, scroll, info) { }
public MysticSpell(Mobile caster, Item scroll, SpellInfo info) : base(caster, scroll, info) { }
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); }
public ArcanistSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info ) { }
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); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.ShieldSlam)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.Soulshatter)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.NetherTalent, SpellIds.NetherWard, SpellIds.ShadowWard)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(_triggerSpell)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.SeedOfCorruptionGeneric)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.Immolate)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.GlyphOfSoulSwap, SpellIds.SoulSwapCdMarker, SpellIds.SoulSwapOverride)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.UnstableAfflictionDispel)); }
protected AreaSpellsong( Mobile caster, Item scroll, SpellInfo info ) : base(caster, scroll, info) { }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.CreateHealthstone)); }
public TransformationSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info ) { if (Body != caster.BodyValue) caster.Flying = false; }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.BaneOfDoomEffect)); }
/// <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; }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.DemonSoulImp, SpellIds.DemonSoulFelhunter, SpellIds.DemonSoulFelguard, SpellIds.DemonSoulSuccubus, SpellIds.DemonSoulVoidwalker)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.DemonicEmpowermentSuccubus, SpellIds.DemonicEmpowermentVoidwalker, SpellIds.DemonicEmpowermentFelguard, SpellIds.DemonicEmpowermentFelhunter, SpellIds.DemonicEmpowermentImp)); }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.GlyphOfDemonTraining, SpellIds.DevourMagicHeal)); }
public TransformationSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info ) { }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.FelSynergyHeal)); }
public NinjaSpell(Mobile caster, Item scroll, SpellInfo info) : base(caster, scroll, info) { }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.GlyphOfShadowflame)); }
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 ) { }
public override bool Validate(SpellInfo spellInfo) { return(ValidateSpellInfo(SpellIds.HauntHeal)); }
public SamuraiSpell(Mobile caster, Item scroll, SpellInfo info) : base(caster, scroll, info) { }
public SpellweavingSpell( Mobile caster, Item scroll, SpellInfo info ) : base(caster, scroll, info) { }