public void AddFriend(string Name) { Player Plr = GetPlayer(); if (Plr == null) { return; } Name = Name.ToLower(); if (Name.Length <= 0 || Name.ToLower() == Plr.Name.ToLower()) { Plr.SendLocalizeString("", GameData.Localized_text.TEXT_SN_FRIENDSLIST_ERR_ADD_SELF); return; } Character_social Social = GetSocial(Name); if (Social != null && Social.Friend > 0) { Plr.SendLocalizeString("", GameData.Localized_text.TEXT_SN_FRIENDSLIST_ERR_EXISTS); return; } Character Char = CharMgr.GetCharacter(Name); if (Char == null) { Plr.SendLocalizeString("", GameData.Localized_text.TEXT_SN_LISTS_ERR_PLAYER_NOT_FOUND); return; } EventInterface Event = null; if (Social != null) { Social.Friend = 1; CharMgr.Database.SaveObject(Social); Event = EventInterface.GetEventInterface((uint)Social.DistCharacterId); } else { Social = new Character_social(); Social.CharacterId = Plr._Info.CharacterId; Social.DistName = Char.Name; Social.DistCharacterId = Char.CharacterId; Social.Friend = 1; Social.Ignore = 0; CharMgr.Database.AddObject(Social); Event = Load(Social); } SendFriends(Social); Plr.SendLocalizeString(Char.Name, GameData.Localized_text.TEXT_SN_FRIENDSLIST_ADD_SUCCESS); }
public TOTVL(ushort zoneid, ushort id, byte realm, Instance_Lockouts lockouts) : base(zoneid, id, realm, lockouts) { _evtInterface = new EventInterface(); ZoneID = zoneid; createPenulums(); StartFireTrap(); StartDartTrap(); }
public Object() { if (EvtInterface == null && !IsPlayer()) { EvtInterface = AddInterface <EventInterface>(); } ScrInterface = AddInterface <ScriptsInterface>(); IsActive = false; }
static public void BuildPlayerInfo(ref PacketOut Out, Character_social Social) { EventInterface Interface = Social.GetEvent <EventInterface>(); if (Interface != null && Interface.HasPlayer()) { BuildPlayerInfo(ref Out, Interface.GetPlayer()); } else { BuildPlayerInfo(ref Out, (uint)Social.DistCharacterId, Social.DistName, false, 0, 0, 0); } }
public override bool Load() { Evt = Obj.EvtInterface; if (Obj.IsUnit()) { Cbt = Obj.GetUnit().CbtInterface; Mvt = Obj.GetUnit().MvtInterface; } if(Evt != null) Evt.AddEvent(UpdateThink, BrainThinkTime, 0); return base.Load(); }
public override bool Load() { Evt = _Owner.EvtInterface; if (_Owner.IsUnit()) { Cbt = _Owner.GetUnit().CbtInterface; Mvt = _Owner.GetUnit().MvtInterface; } Evt.AddEvent(UpdateThink, BrainThinkTime + RandomMgr.Next(0, 2000), 0); Evt.AddEventNotify(EventName.ON_TARGET_DIE, OnTargetDie); return(base.Load()); }
public override void OnLoad() { SpawnPoint.X = X; SpawnPoint.Y = Y; SpawnPoint.Z = Z; SpawnHeading = Heading; if (EvtInterface == null) { EvtInterface = new EventInterface(this); } AiInterface.Load(); base.OnLoad(); }
public override bool Load() { Evt = _Owner.EvtInterface; if (_Owner.IsUnit()) { Cbt = _Owner.GetUnit().CbtInterface; Mvt = _Owner.GetUnit().MvtInterface; } Evt.AddEvent(UpdateThink, BrainThinkTime + RandomMgr.Next(0, 2000), 0); Evt.AddEventNotify(EventName.ON_TARGET_DIE, OnTargetDie); return base.Load(); }
public Player(GameClient Client, Character Info) : base() { Log.Success("Player", "Construction de " + Info.Name); _Client = Client; _Info = Info; _Value = Info.Value[0]; Name = Info.Name; SetFaction((byte)(8 * (8 * Info.Realm) + 6)); EvtInterface = EventInterface.GetEventInterface((uint)_Info.CharacterId); SocInterface = new SocialInterface(this); TokInterface = new TokInterface(this); }
public EventInterface Load(Character_social Social) { if (Social == null || Social.DistCharacterId == 0) { return(null); } EventInterface Interface = EventInterface.GetEventInterface((uint)Social.DistCharacterId); Interface.AddEventNotify(EventName.PLAYING, OnPlayerConnect, true); Interface.AddEventNotify(EventName.LEAVE, OnPlayerLeave, true); Social.Event = Interface; _Socials.Add(Social); return(Interface); }
public override bool Load() { Evt = Obj.EvtInterface; if (Obj.IsUnit()) { Cbt = Obj.GetUnit().CbtInterface; Mvt = Obj.GetUnit().MvtInterface; } if (Evt != null) { Evt.AddEvent(UpdateThink, BrainThinkTime, 0); } return(base.Load()); }
public void RemoveFriend(string Name) { Log.Success("RemoveFriend", "Name=" + Name); Player Plr = GetPlayer(); if (Plr == null) { return; } Name = Name.ToLower(); Character_social Social = GetSocial(Name); if (Social == null) { Plr.SendLocalizeString("", GameData.Localized_text.TEXT_SN_LISTS_ERR_PLAYER_NOT_FOUND); return; } EventInterface Interface = Social.GetEvent <EventInterface>(); if (Interface == null) { return; } Interface.RemoveEventNotify(EventName.PLAYING, OnPlayerConnect); Interface.RemoveEventNotify(EventName.LEAVE, OnPlayerLeave); PacketOut Out = new PacketOut((byte)Opcodes.F_SOCIAL_NETWORK); Out.WriteUInt16(0); Out.WriteByte(1); Out.WriteByte(1); // Count Out.WriteByte(1); Out.WriteUInt32((uint)Social.DistCharacterId); Plr.SendPacket(Out); Plr.SendLocalizeString(Social.DistName, GameData.Localized_text.TEXT_SN_FRIEND_REMOVE); _Socials.Remove(Social); CharMgr.Database.DeleteObject(Social); }
public Player(GameClient Client, Character Info) : base() { _Client = Client; _Info = Info; _Value = Info.Value; Name = Info.Name; Realm = (GameData.Realms)Info.Realm; SetPVPFlag(false); EvtInterface = AddInterface(EventInterface.GetEventInterface((uint)_Info.CharacterId)) as EventInterface; SocInterface = AddInterface <SocialInterface>(); TokInterface = AddInterface <TokInterface>(); MlInterface = AddInterface <MailInterface>(); EvtInterface.AddEventNotify(EventName.ON_MOVE, CancelQuit); EvtInterface.AddEventNotify(EventName.ON_RECEIVE_DAMAGE, CancelQuit); EvtInterface.AddEventNotify(EventName.ON_DEAL_DAMAGE, CancelQuit); EvtInterface.AddEventNotify(EventName.ON_START_CASTING, CancelQuit); }
public Instance(ushort zoneid, ushort id, byte realm, Instance_Lockouts lockouts) { Lockout = lockouts; ID = id; ZoneID = zoneid; Realm = realm; Region = new RegionMgr(zoneid, ZoneService.GetZoneRegion(zoneid)); InstanceService._InstanceInfo.TryGetValue(zoneid, out Info); LoadBossSpawns(); LoadSpawns(); // todo get the saved progress from group _running = true; _evtInterface = new EventInterface(); closetime = (TCPManager.GetTimeStamp() + 7200); new Thread(Update).Start(); Log.Success("Opening Instance", "Instance ID " + ID + " Map: " + Info.Name); if (zoneid == 179) { foreach (var p in GameObjectService.GameObjectSpawns.Where(e => e.Value.ZoneId == 179)) { if (p.Value.Entry == 98908) { GameObject go = new GameObject(p.Value); _Objects.Add(go); Region.AddObject(go, zoneid, true); } } if (_Objects.Count > 0) { LoadObjects(); } _evtInterface.AddEvent(UpdatePendulums, 7000, 0); } }
public override void OnLoad() { SpawnPoint.X = X; SpawnPoint.Y = Y; SpawnPoint.Z = Z; SpawnHeading = Heading; if (EvtInterface == null) EvtInterface = new EventInterface(this); AiInterface.Load(); base.OnLoad(); }
public Object() { if (!IsPlayer()) EvtInterface = new EventInterface(this); }