public void InteractWith(Character character, NpcActionTypeEnum actionType) { if (character.Busy) { return; } if (actionType == NpcActionTypeEnum.Talk && CinematicProvider.Instance.IsNpcHandled(character, SpawnRecord.Id)) { var npcPoint = new Maps.MapPoint((short)this.CellId); character.SetDirection(character.Point.OrientationTo(npcPoint, true)); character.RandomTalkEmote(); CinematicProvider.Instance.TalkToNpc(character, SpawnRecord.Id); return; } NpcActionRecord action = GetAction(actionType); if (action != null) { NpcActionProvider.Handle(character, this, action); } else if (character.Client.Account.Role > ServerRoleEnum.Player) { character.Reply("No (" + actionType + ") action linked to this npc...(" + SpawnRecord.Id + ")"); } }
public void InteractWith(NpcActionTypeEnum actionType, Character dialoguer) { if (this.CanInteractWith(actionType, dialoguer)) { var infoDialog = new PrismInfoDialog(dialoguer, this); infoDialog.Open(); } }
public void InteractWith(NpcActionTypeEnum actionType, Character dialoguer) { if (this.CanInteractWith(actionType, dialoguer)) { TaxCollectorInfoDialog taxCollectorInfoDialog = new TaxCollectorInfoDialog(dialoguer, this); taxCollectorInfoDialog.Open(); } }
public void InteractWith(NpcActionTypeEnum actionType, Character dialoguer) { if (this.CanInteractWith(actionType, dialoguer)) { NpcAction npcAction = this.Actions.First((NpcAction entry) => entry.ActionType == actionType && entry.CanExecute(this, dialoguer)); npcAction.Execute(this, dialoguer); this.OnInteracted(actionType, npcAction, dialoguer); } }
private void OnInteracted(NpcActionTypeEnum actionType, NpcAction action, Character character) { Action <Npc, NpcActionTypeEnum, NpcAction, Character> interacted = this.Interacted; if (interacted != null) { interacted(this, actionType, action, character); } }
private void OnInteracted(NpcActionTypeEnum actionType, NpcAction action, Character character) { character.OnInteractingWith(this, actionType, action); var handler = Interacted; if (handler != null) { handler(this, actionType, action, character); } }
public void InteractWith(NpcActionTypeEnum actionType, Character dialoguer) { if (!CanInteractWith(actionType, dialoguer)) { return; } var dialog = new TaxCollectorInfoDialog(dialoguer, this); dialog.Open(); }
public void InteractWith(NpcActionTypeEnum actionType, Character dialoguer) { if (!CanInteractWith(actionType, dialoguer)) { return; } var action = Actions.Where(entry => entry.ActionType.Contains(actionType) && entry.CanExecute(this, dialoguer)).OrderBy(x => x.Priority).First(); action.Execute(this, dialoguer); OnInteracted(actionType, action, dialoguer); }
public bool CanInteractWith(NpcActionTypeEnum action, Character dialoguer) { if (dialoguer.Map != Position.Map || dialoguer.IsFighting() || dialoguer.IsInRequest() || dialoguer.IsGhost()) { return(false); } if (dialoguer.IsBusy()) { dialoguer.Dialog.Close(); } return(Actions.Count > 0 && Actions.Any(entry => entry.ActionType.Contains(action) && entry.CanExecute(this, dialoguer))); }
public NpcActionAttribute(NpcActionTypeEnum actionType) { this.ActionType = actionType; }
public static List <NpcActionRecord> GetActionByType(NpcActionTypeEnum type) { return(NpcsActions.FindAll(x => x.ActionIdEnum == type)); }
public bool CanInteractWith(NpcActionTypeEnum action, Character dialoguer) { return(!(dialoguer.Map != this.Position.Map) && this.Actions.Count > 0 && this.Actions.Any((NpcAction entry) => entry.ActionType == action && entry.CanExecute(this, dialoguer))); }
public bool CanInteractWith(NpcActionTypeEnum action, Character dialoguer) { throw new NotImplementedException(); }
private void CharacterOnInteractingWith(Character character, Npc npc, NpcActionTypeEnum actionType, NpcAction action) { }
private NpcActionRecord GetAction(NpcActionTypeEnum actionType) { return(ActionsRecord.Find(x => x.ActionIdEnum == actionType)); }
public bool CanInteractWith(NpcActionTypeEnum action, Character dialoguer) { return(this.CanBeSee(dialoguer) && action == NpcActionTypeEnum.ACTION_TALK); }
public static NpcActionsRecord GetNpcAction(int npcid, NpcActionTypeEnum type) { return(NpcsActions.Find(x => x.NpcId == npcid && x.ActionType == type)); }