public override bool OnEnterCombat(Object npc = null, object instigator = null) { Creature c = Obj as Creature; c.Say("Come, mortals, and bathe in my Power!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY); c.BuffInterface.RemoveBuffByEntry(14897); // Removing Iron Body NewBuff newBuff = c.BuffInterface.GetBuff(14897, null); if (newBuff != null) { newBuff.RemoveBuff(true); } if (c != null) { c.IsInvulnerable = false; Stage = -1; var prms = new List <object>() { 100523, 1110218, 1118213, 19460, (int)Obj.Heading, (uint)0 }; // Solithex Soulstone c.EvtInterface.AddEvent(SpawnGO, 100, 1, prms); prms = new List <object>() { 100524, 1110226, 1118211, 19459, (int)Obj.Heading, (uint)0 }; // Solithex Barrier c.EvtInterface.AddEvent(SpawnGO, 100, 1, prms); } return(false); }
/// <summary> /// Invoked by buff interface to keep track of aao buff. /// </summary> /// <param name="aaoBuff">Buff that was created</param> private void AaoAssigned(NewBuff aaoBuff) { if (aaoBuff == null) { return; } Realms aaoRealm = GetAaoRealm(_againstAllOddsMult); short aaoValue = (short)(Math.Abs(_againstAllOddsMult) * 20); float aaoBonus = Math.Abs(_againstAllOddsMult) * 0.2f; if (aaoRealm == aaoBuff.Caster.Realm) { lock (_orderAAOBuffs) _orderAAOBuffs.Add(aaoBuff); aaoBuff.AddBuffParameter(1, 1); aaoBuff.AddBuffParameter(2, aaoValue); aaoBuff.AddBuffParameter(3, aaoValue); aaoBuff.AddBuffParameter(4, aaoValue); ((Player)aaoBuff.Caster).AAOBonus = aaoBonus; } else { aaoBuff.BuffHasExpired = true; } }
/// <summary> /// Callback to start the channel proper /// </summary> public void ChannelInitialization(NewBuff channelBuff) { // Was cancelled before the channel callback if (_channelInfo == null || _host == null || _host.IsDead) { if (channelBuff != null) { channelBuff.BuffHasExpired = true; _channelBuff = null; } } // Couldn't create a channel buff, so cancel else if (channelBuff == null) { _parent.CancelCast(0); _channelInfo = null; } // Successful link else { _channelBuff = channelBuff; _channelBuff.ChannelHandler = this; // Oil if (_host is Siege) { _channelBuff.OptionalObject = _host; } _host.BuffInterface.NotifyAbilityCasted(_channelInfo); } }
public override void NotifyInteractionComplete(NewBuff b) { if (CapturingPlayer == null || HeldState == EHeldState.Inactive) { return; } PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECT_DEATH, 12); Out.WriteUInt16(Oid); Out.WriteByte(1); Out.WriteByte(0); Out.WriteUInt16(0); Out.Fill(0, 6); DispatchPacket(Out, true); SetHeldState(EHeldState.Carried); Holder = CapturingPlayer; CapturingPlayer = null; BuffInfo buffInfo = AbilityMgr.GetBuffInfo(BuffId); Holder.BuffInterface.QueueBuff(new BuffQueueInfo(Holder, 1, buffInfo, HoldObjectBuff.GetNew, HoldObjectCallback)); OnPickupAction?.Invoke(this, Holder); }
public override void NotifyInteractionComplete(NewBuff b) { if (InteractPlayer != null && _onBombPlanted != null) { _onBombPlanted(this, InteractPlayer); } }
public void TickPoints(NewBuff hostBuff, HoldObject ball, long tick) { if (tick >= _pointDelayTime) { if (TooCloseToSpawn((Player)hostBuff.Caster)) { if (Info.MapId == 31 || Info.MapId == 232 || Info.MapId == 133) { for (int i = 0; i < 2; i++) { foreach (Player player in Players[i]) { if (player.Realm == hostBuff.Caster.Realm) { player.SendClientMessage("The gods are displeased with your cowardice and snatched " + ball.name + " back to its place", ChatLogFilters.CHATLOGFILTERS_C_WHITE_L); } else { player.SendClientMessage("The enemy team displeased their gods, " + ball.name + " has been taken back to its resting place", ChatLogFilters.CHATLOGFILTERS_C_WHITE_L); } } } ball.ResetFromHeld(); } } else { GivePoints((hostBuff.Caster.Realm == Realms.REALMS_REALM_ORDER ? 1 : 2), (uint)(2 * ((_murderballTicks[ball] / 3) + 1))); } } ++_murderballTicks[ball]; }
public override void OnDie(Object Obj) { Creature c = Obj as Creature; Stage = -1; stuffInRange.Clear(); foreach (Creature crea in addList) { crea.Destroy(); } foreach (GameObject go in goList) { go.Destroy(); } addList = new List <Creature>(); goList = new List <GameObject>(); foreach (Object o in c.ObjectsInRange) { Creature creature = o as Creature; if (creature != null && creature.Entry == 38907 && !creature.IsDead) { creature.BuffInterface.RemoveBuffByEntry(14897); NewBuff newBuff = creature.BuffInterface.GetBuff(14897, null); if (newBuff != null) { newBuff.RemoveBuff(true); } break; } } }
public override bool OnLeaveCombat(Object npc = null, object instigator = null) { Creature c = Obj as Creature; c.IsInvulnerable = false; Stage = -1; foreach (Creature creature in addList) { creature.Destroy(); } foreach (GameObject go in goList) { go.Destroy(); } addList = new List <Creature>(); goList = new List <GameObject>(); if (c != null && !c.IsDead) { c.BuffInterface.RemoveBuffByEntry(13155); NewBuff newBuff = c.BuffInterface.GetBuff(13155, null); if (newBuff != null) { newBuff.RemoveBuff(true); } } return(false); }
public override void NotifyInteractionComplete(NewBuff b) { Player plrCaster = (Player)b.Caster; _interactors.Remove(plrCaster); _interactionBuffs.Remove((InteractionBuff)b); }
public override bool OnEnterCombat(Object npc = null, object instigator = null) { Creature c = Obj as Creature; c.IsInvulnerable = false; Stage = -1; var prms = new List <object>() { 36598, (Obj.WorldPosition.X + 250 - (50 * random.Next(1, 11))), (Obj.WorldPosition.Y + 250 - (50 * random.Next(1, 11))), Obj.WorldPosition.Z, Obj.Heading }; // Spawn snotling c.EvtInterface.AddEvent(SpawnAdds, 100, 1, prms); c.EvtInterface.AddEvent(SpawnSnotlings, 100, 1); c.EvtInterface.AddEvent(SpawnSnotlings, 60 * 1000, 0); c.Say("Com 'er Chipfang, we 'l show 'em!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_SAY); c.BuffInterface.RemoveBuffByEntry(13155); // Removing rage NewBuff newBuff = c.BuffInterface.GetBuff(13155, null); if (newBuff != null) { newBuff.RemoveBuff(true); } return(false); }
public bool CheckHP(Object Obj, object instigator) { Creature c = Obj as Creature; if (c != null) { if (Stage < 0 && !c.IsDead) { Stage = 0; // Setting control value to 0 } else if (c.Health < c.TotalHealth * 0.05 && Stage < 1 && !c.IsDead) { foreach (Player player in Obj.PlayersInRange.ToList()) { player.BuffInterface.RemoveBuffByEntry(5240); // Removing Disable NewBuff newBuff = player.BuffInterface.GetBuff(5240, null); if (newBuff != null) { newBuff.RemoveBuff(true); } player.BuffInterface.RemoveBuffByEntry(5239); // Removing Disable newBuff = player.BuffInterface.GetBuff(5239, null); if (newBuff != null) { newBuff.RemoveBuff(true); } } Stage = 1; } } return(false); }
public override void NotifyInteractionComplete(NewBuff b) { HandleInteractionEvents(CapturingPlayer); _onCapture?.Invoke(CapturingPlayer, this); base.NotifyInteractionComplete(b); }
public override bool OnLeaveCombat(Object npc = null, object instigator = null) { Creature c = Obj as Creature; c.IsInvulnerable = false; Stage = -1; foreach (Creature creature in addList) { creature.Destroy(); } foreach (GameObject go in goList) { go.Destroy(); } foreach (Object obj in c.ObjectsInRange.ToList()) { GameObject go = obj as GameObject; if (go != null && go.Entry == 2000561) { go.Destroy(); } if (go != null && go.Entry == 100523) { go.Destroy(); } if (go != null && go.Entry == 100524) { go.Destroy(); } Creature creature = obj as Creature; if (creature != null && creature.Entry == 2000876) { creature.Destroy(); } if (creature != null && creature.Entry == 42211) { creature.Destroy(); } } addList = new List <Creature>(); goList = new List <GameObject>(); c.BuffInterface.RemoveBuffByEntry(14897); // Removing Iron Body NewBuff newBuff = c.BuffInterface.GetBuff(14897, null); if (newBuff != null) { newBuff.RemoveBuff(true); } return(false); }
// cross thread public void RegisterOYG(NewBuff B) { if (B != null) { lock (_groupPendingTargetList) _groupPendingTargetList.Add(B); (B as OYGBuff).MasterAuraBuff = this; } }
public void Interrupt() { _channelInfo = null; if (_channelBuff != null && !_channelBuff.BuffHasExpired) { _channelBuff.RemoveBuff(true); } _channelBuff = null; }
public override void NotifyInteractionComplete(NewBuff b) { if (Locked || CapturingPlayer == null) { CapturingPlayer = null; return; } OwningRealm = CapturingPlayer.Realm; CapturingPlayer = null; PacketOut Out = new PacketOut((byte)Opcodes.F_PLAY_SOUND); Out.WriteByte(0); Out.WriteUInt16(OwningRealm == Realms.REALMS_REALM_ORDER ? (ushort)0x0C : (ushort)0x332); Out.Fill(0, 10); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(OwningRealm == Realms.REALMS_REALM_ORDER ? "Order" : "Destruction"); sb.Append(" "); sb.Append(_captureAnnouncement); sb.Append(" "); sb.Append(ObjectiveName + "!"); foreach (Object obj in Region.Objects) { Player plr = obj as Player; if (plr != null) { plr.SendLocalizeString(sb.ToString(), ChatLogFilters.CHATLOGFILTERS_C_WHITE, Localized_text.CHAT_TAG_DEFAULT); SendObjectiveState(plr); } } _onCapture(this); foreach (Player plr in PlayersInRange) { UpdateGlow(plr); } foreach (Player plr in PlayersInCloseRange[0]) { SendObjectiveInfo(plr); SendRealmBonus(plr); plr.SendPacket(Out); } foreach (Player plr in PlayersInCloseRange[1]) { SendObjectiveInfo(plr); SendRealmBonus(plr); plr.SendPacket(Out); } }
public override void NotifyInteractionBroken(NewBuff b) { lock (_capturing) { if (b.Caster is Player && _capturing.Contains((Player)b.Caster)) { _capturing.Remove((Player)b.Caster); } } }
public override void NotifyInteractionComplete(NewBuff b) { this.CapturingPlayer.SendClientMessage(CapturingPlayer?.Name + $" has claimed {this.Keep.Info.Name} for {this.CapturingPlayer.GldInterface.Guild.Info.Name}"); BattlefrontLogger.Info(CapturingPlayer?.Name + $" has claimed {this.Keep.Info.Name} for {this.CapturingPlayer.GldInterface.Guild.Info.Name}"); this.ClaimingGuild = this.CapturingPlayer.GldInterface.Guild; this.OwningRealm = this.CapturingPlayer.Realm; _captureInProgress = false; CapturingPlayer = null; this.Keep.OnGuildClaimInteracted(this.ClaimingGuild.Info.GuildId); }
/// <summary> /// 402, 403 = Unstoppable /// 408 = Immovable /// </summary> private void RemoveAllCCImmunitiesFromPlayers() { foreach (var plr in PlayersInRange) { plr.BuffInterface.RemoveBuffByEntry(408); // Removing Immunity NewBuff newBuff = plr.BuffInterface.GetBuff(408, null); if (newBuff != null) { newBuff.RemoveBuff(true); } } }
public override void NotifyInteractionComplete(NewBuff b) { if (Open) { if (HoldOwner != (int)b.Caster.Realm) { EvtInterface.RemoveEvent(Capture); } else { return; //no need to capture twice } HoldOwner = (int)b.Caster.Realm; Owner = 0; List <Player> capturing = new List <Player>(); lock (_capturing) { if (b.Caster is Player && _capturing.Contains((Player)b.Caster)) { _capturing.Remove((Player)b.Caster); } capturing = _capturing.ToList(); } //abort anyone else trying to capture foreach (var c in capturing) { var captureBuff = c.BuffInterface.GetBuff(60000, c); if (captureBuff != null) { captureBuff.RemoveBuff(true); } } HoldStartTime = TCPManager.GetTimeStampMS(); if (OnHold != null) { OnHold(this); } if (HoldDuration == 0) { Capture(); } else { EvtInterface.AddEvent(Capture, HoldDuration, 1); } } }
public virtual void HoldObjectCallback(NewBuff b) { if (b == null) { HolderDied(); } else if (Holder != null) { MyBuff = (HoldObjectBuff)b; MyBuff.HeldObject = this; OnBuffCallback?.Invoke(b); } }
/// <summary> /// Invoked by buff interface to remove field of glory if necessary. /// </summary> /// <param name="fogBuff">Buff that was created</param> public void FogAssigned(NewBuff fogBuff) { if (fogBuff == null || !(fogBuff.Caster is Player)) { return; } lock (_playersInLakeSet) { if (!_playersInLakeSet.Contains(fogBuff.Caster)) { fogBuff.BuffHasExpired = true; } } }
public void RegisterUserBuff(NewBuff b) { if (b != null) { if (_interactors.Contains((Player)b.Target)) { _interactionBuffs.Add(b); } else { b.BuffHasExpired = true; } } }
public bool CheckHP(Object Obj, object instigator) { GameObject go = this.Obj as GameObject; // We are casting the script initiator as a Creature if (Stage < 0 && !go.IsDead) { Stage = 0; // Setting control value to 0 } if (go.Health < go.TotalHealth * 0.1) { go.PlayEffect(2185); go.Say("*** The cursed gem breaks into milion pieces! ***", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_EMOTE); foreach (Object o in go.ObjectsInRange.ToList()) { Player plr = o as Player; if (plr != null) { plr.BuffInterface.RemoveBuffByEntry(13058); // Removing killer dot NewBuff newBuff = plr.BuffInterface.GetBuff(13058, null); if (newBuff != null) { newBuff.RemoveBuff(true); } plr.SendClientMessage("The sinister force that consumed your soul is lifted from you!", SystemData.ChatLogFilters.CHATLOGFILTERS_MONSTER_EMOTE); } Creature c = o as Creature; if (c != null && c.Entry == 42207) { c.BuffInterface.RemoveBuffByEntry(14897); // Removing Iron Body NewBuff newBuff = c.BuffInterface.GetBuff(14897, null); if (newBuff != null) { newBuff.RemoveBuff(true); } } go.Destroy(); } Stage = 1; } return(false); }
public void Update(long tick) { // Target is dead. if (_target.IsDead) { SendChannelEnd(); _channelInfo = null; _channelBuff = null; _parent.NotifyChannelEnded(); } // Cast finishes if (_channelInfo != null) { if (TCPManager.GetTimeStampMS() >= _channelStartTime + _channelInfo.CastTime) { SendChannelEnd(); _parent.NotifyChannelEnded(); _channelInfo = null; _channelBuff = null; } else if (TCPManager.GetTimeStampMS() >= _nextTickTime) { if (_channelInfo.ApCost > 0 && !_host.ConsumeActionPoints(_channelInfo.ApCost)) { _parent.CancelCast((byte)GameData.AbilityResult.ABILITYRESULT_AP); } else if (_playerHost != null && _channelInfo.SpecialCost > 3 && !_playerHost.CrrInterface.ConsumeResource((byte)_channelInfo.SpecialCost, true)) { _parent.CancelCast(1); } else if (_target != _host && !_host.IsInCastRange(_target, Math.Max((uint)25, _channelInfo.Range))) { _parent.CancelCast((byte)GameData.AbilityResult.ABILITYRESULT_OUTOFRANGE); } else if (_checkVisibility && !_host.LOSHit(_target)) { _parent.CancelCast((byte)GameData.AbilityResult.ABILITYRESULT_NOT_VISIBLE); } else { _nextTickTime += 1000; } } } }
public void PassPreviousBounces(NewBuff B) { if (B == null) { Log.Error("Bouncing Buff", "Received NULL buff!"); return; } BouncingBuff bBuff = B as BouncingBuff; if (bBuff == null) { Log.Error("Bouncing Buff", "Received buff was not a BouncingBuff!"); return; } bBuff.previousPlayers.AddRange(previousPlayers); }
private static void AddLavaBuff(NewBuff lavaBuff) { if (lavaBuff == null) { return; } if (_lavaBuffs.ContainsKey(lavaBuff.Caster)) { _lavaBuffs[lavaBuff.Caster] = lavaBuff; } else { _lavaBuffs.Add(lavaBuff.Caster, lavaBuff); } }
public void RemoveVanityPet() { Owner.Companion.Dismiss(null, null); Owner.Companion = null; NewBuff vanityPet = Owner.BuffInterface.GetBuff(15188, null); if (vanityPet != null) { Owner.BuffInterface.RemoveBuffByEntry(15188); } vanityPet = Owner.BuffInterface.GetBuff(15190, null); if (vanityPet != null) { Owner.BuffInterface.RemoveBuffByEntry(15188); } }
public override void HoldObjectCallback(NewBuff b) { if (b == null) { HolderDied(); } else if (Holder != null) { MyBuff = (HoldObjectBuff)b; MyBuff.DefaultLine = 2; MyBuff.DefaultValue = 5; MyBuff.FlagEffect = GameData.FLAG_EFFECTS.Bomb; MyBuff.HeldObject = this; OnBuffCallback?.Invoke(b); } }
public override void LinkToCaptureBuff(NewBuff b) { if (b != null) { if (!_interactors.Contains((Player)b.Caster)) { InteractionBuff captureBuff = (InteractionBuff)b; captureBuff.SetObject(this); _interactors.Add((Player)b.Caster); _interactionBuffs.Add(captureBuff); } else { b.BuffHasExpired = true; } } }