public void EventOnSkillsUpdated() { if (mSkills == null) { mSkills = GetComponent <PlayerSkills>(); } if (mCharacter == null) { } var eventInstance = new ItemGeneric { ItemId = nebulaObject.Id, ItemType = (byte)ItemType.Avatar, CustomEventCode = (byte)CustomEventCode.SkillsUpdated, EventData = mSkills.GetInfo(), GameReferenceId = nebulaObject.Id, CharacterId = mCharacter.characterId }; var eData = new EventData((byte)EventCode.ItemGeneric, eventInstance); SendParameters sendParameters = new SendParameters { Unreliable = false, ChannelId = Settings.ItemEventChannel }; this.Peer.SendEvent(eData, sendParameters); }
public override void Start() { if (!m_StartCalled) { m_StartCalled = true; mShip = RequireComponent <PlayerShip>(); mTarget = RequireComponent <PlayerTarget>(); mCharacter = RequireComponent <PlayerCharacterObject>(); mAI = RequireComponent <AIState>(); mRace = RequireComponent <RaceableObject>(); mMessage = RequireComponent <MmoMessageComponent>(); mDamagable = RequireComponent <ShipBasedDamagableObject>(); mWeapon = RequireComponent <ShipWeapon>(); mSkills = RequireComponent <PlayerSkills>(); mBonuses = RequireComponent <PlayerBonuses>(); mPassiveBonuses = GetComponent <PassiveBonusesComponent>(); mCharacter.SetCharacterId((string)nebulaObject.Tag((byte)PlayerTags.CharacterId)); mCharacter.SetCharacterName((string)nebulaObject.Tag((byte)PlayerTags.Name)); printPropertiesTimer = printPropertiesInterval; if (application.serverActors.ContainsKey(nebulaObject.Id)) { MmoActor old; if (application.serverActors.TryRemove(nebulaObject.Id, out old)) { log.Info("successfully remove actor before replacing with new [red]"); } } if (application.serverActors.TryAdd(nebulaObject.Id, this)) { log.Info("successfully added actor to server actors [red]"); } //create chest on killing when player die mDamagable.SetCreateChestOnKilling(true); mDamagable.SetIgnoreDamageInterval(30); mDamagable.SetIgnoreDamageAtStart(true); } }
public void Replace(PlayerSkills other) { this.useSkills = other.useSkills; }