Наследование: MonoBehaviour
Пример #1
0
    public void OnCreatureKilled(Creature creature, Creature killer)
    {
        // Only drop once, from NPCs in the region
        if (_droppedScroll || creature.RegionId != Spawn.Location.RegionId || !creature.Has(CreatureStates.Npc))
            return;

        // Start dropping 100 minutes before spawn and stop when spawned.
        var time = GetTimeUntilSpawn();
        if (time.TotalMinutes >= 100 || time.Ticks == 0)
            return;

        // Chance = (100 - remaining minutes) / 4
        // 90 minutes =  2.5% chance
        // 60 minutes = 10.0% chance
        // 20 minutes = 20.0% chance
        //  2 minutes = 24.5% chance
        var chance = (100 - time.TotalMinutes) / 4;

        // Don't lock until here, to save time
        lock (_syncLock)
        {
            // Check again, for race conditions
            if (_droppedScroll)
                return;

            if (Random(100) < chance)
            {
                creature.Drops.Add(CreateFomorCommandScroll());
                _droppedScroll = true;
            }
        }
    }
Пример #2
0
        public CreatureLifeStats(Creature creature)
        {
            _hp = creature.GameStats.HpBase + creature.GameStats.HpStamina;
            _mp = creature.GameStats.MpBase + creature.GameStats.MpStamina;

            Creature = creature;
        }
Пример #3
0
        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("Wielding Dagger", LogDebugLevel.Medium);

            //Give player story. Mention level up if one will occur.

            if (Game.Dungeon.Player.PlayItemMovies)
            {
                //Screen.Instance.PlayMovie("plotbadge", true);
                //Screen.Instance.PlayMovie("multiattack", false);
            }

            //Messages
            Game.MessageQueue.AddMessage("This dagger is easily concealed and as sharp as hell.");

            //Screen.Instance.PlayMovie("plotbadge", true);

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.MultiAttack());
            //Screen.Instance.PlayMovie("multiattack", false);

            //Add any equipped (actually permanent) effects
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
Пример #4
0
	public void PlayerEquipsItem(Creature creature, Item item)
	{
		// Give Ranged Attack when equipping a (cross)bow
		if ((item.HasTag("/bow/|/bow01/|/crossbow/")) && !creature.Skills.Has(SkillId.RangedAttack))
			creature.Skills.Give(SkillId.RangedAttack, SkillRank.Novice);

		// Give Dice Tossing When equiping Dice
		if ((item.HasTag("/dice/")) && !creature.Skills.Has(SkillId.DiceTossing))
			creature.Skills.Give(SkillId.DiceTossing, SkillRank.Novice);

		// Give Playing Instrument when equipping an instrument
		if ((item.HasTag("/instrument/")) && !creature.Skills.Has(SkillId.PlayingInstrument))
			creature.Skills.Give(SkillId.PlayingInstrument, SkillRank.Novice);

		// Give Potion Making when equipping a Potion Concoction Kit
		if ((item.HasTag("/potion_making/kit/")) && !creature.Skills.Has(SkillId.PotionMaking))
			creature.Skills.Give(SkillId.PotionMaking, SkillRank.Novice);

		// Give Handicraft when equipping a Handicraft Kit
		if ((item.HasTag("/handicraft_kit/")) && !creature.Skills.Has(SkillId.Handicraft))
			creature.Skills.Give(SkillId.Handicraft, SkillRank.RF);

		// Give Tailoring when equipping a Tailoring Kit
		if ((item.HasTag("/tailor/kit/")) && !creature.Skills.Has(SkillId.Tailoring))
			creature.Skills.Give(SkillId.Tailoring, SkillRank.Novice);

		// Give Blacksmithing when equipping a Blacksmith Hammer
		if ((item.HasTag("/tool/blacksmith/")) && !creature.Skills.Has(SkillId.Blacksmithing))
			creature.Skills.Give(SkillId.Blacksmithing, SkillRank.Novice);
	}
Пример #5
0
    public override void Init(Creature ownerCreature, Weapon weapon, Weapon.FiringDesc targetAngle)
    {
        base.Init(ownerCreature, weapon, targetAngle);

        transform.parent = ownerCreature.WeaponHolder.transform;
        transform.localPosition = Vector3.zero;
    }
Пример #6
0
    public IEnumerator Unlock(Creature creature)
    {
        bool success = Random.Range(1, 100) < 75;

        if (success) {
            state = EntityStates.Closed;
            sfx.Play("Audio/Sfx/Door/door-open2", 0.7f, Random.Range(0.8f, 1.2f));
            if (creature is Player) {
                Speak("Success!", Color.white);
                Hud.instance.Log("You unlock the door.");
            }

        } else {
            sfx.Play("Audio/Sfx/Door/unlock", 0.7f, Random.Range(0.8f, 1.2f));
            if (creature is Player) {
                Speak("Locked", Color.white);
                Hud.instance.Log("The door is locked.");
            }
        }

        yield return new WaitForSeconds(0.25f);

        if (success) {
            StartCoroutine(Open(creature, true));
        }
    }
Пример #7
0
        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("Book equipped", LogDebugLevel.Medium);

            Game.Dungeon.Player.PlotItemsFound++;

            //This is plot equipment

            //Give player story. Mention level up if one will occur.
            if (Game.Dungeon.Player.PlayItemMovies)
            {
                Screen.Instance.PlayMovie("plotbook", true);
            }

            //Messages
            Game.MessageQueue.AddMessage("Levelled up!");

            //Level up?
            Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.VaultBackstab());
            //Screen.Instance.PlayMovie("vaultbackstab", false);

            //Add any equipped (actually permanent) effects
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
Пример #8
0
        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("Wielding Long Sword", LogDebugLevel.Medium);

            //Give player story. Mention level up if one will occur.

            if (Game.Dungeon.Player.PlayItemMovies)
            {
                //Screen.Instance.PlayMovie("plotbadge", true);
                //Screen.Instance.PlayMovie("multiattack", false);
            }

            //Messages
            Game.MessageQueue.AddMessage("Five feet long and made of tempered steel this long sword is a weapon worthy of a Princess!");

            //Screen.Instance.PlayMovie("plotbadge", true);

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.MultiAttack());
            //Screen.Instance.PlayMovie("multiattack", false);

            //Add any equipped (actually permanent) effects
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
Пример #9
0
        public bool Use(Creature user)
        {
            //Currently healing is implemented as a player effect so we need to check the user is a player
            Player player = user as Player;

            //Not a player
            if (player == null)
            {
                return false;
            }

            Game.MessageQueue.AddMessage("You eat the berry.");

            //Apply the healing effect to the player

            int delta = (int)Math.Ceiling(Game.Dungeon.Player.MaxHitpointsStat / 4.0);
            if (delta < 10)
                delta = 10;

            int healing = 10 + Game.Random.Next(delta);
            player.AddEffect(new PlayerEffects.Healing(healing));

            //Add a message

            //This uses up the potion
            usedUp = true;

            return true;
        }
Пример #10
0
        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("FragGrenade equipped", LogDebugLevel.Medium);

            //Give player story. Mention level up if one will occur.

            if (Game.Dungeon.Player.PlayItemMovies)
            {
                //Screen.Instance.PlayMovie("plotbadge", true);
                //Screen.Instance.PlayMovie("multiattack", false);
            }

            //Messages
            //Game.MessageQueue.AddMessage("A fine short sword - good for slicing and dicing.");

            //Screen.Instance.PlayMovie("plotbadge", true);

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.MultiAttack());
            //Screen.Instance.PlayMovie("multiattack", false);

            //Add any equipped (actually permanent) effectsf
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
Пример #11
0
        public bool Use(Creature user)
        {
            //Currently healing is implemented as a player effect so we need to check the user is a player
            Player player = user as Player;

            //Not a player
            if (player == null)
            {
                return false;
            }

            //Add a message
            Game.MessageQueue.AddMessage("You drink the potion.");

            //Apply the speed up effect to the player
            //Duration note 100 is normally 1 turn for a non-sped up player

            int duration = 30 * Creature.turnTicks + Game.Random.Next(50 * Creature.turnTicks);
            int speedUpAmount = 75 + Game.Random.Next(50);

            player.AddEffect(new PlayerEffects.SpeedUp(duration, speedUpAmount));

            //This uses up the potion
            usedUp = true;

            return true;
        }
    public override void Init(Creature ownerCreature, Weapon weapon, Weapon.FiringDesc targetAngle)
    {
        base.Init(ownerCreature, weapon, targetAngle);

        m_weapon = weapon as GuidedRocketLauncher;
        m_selfDestoryTime = Time.time + 5f;
    }
    new void OnEnable()
    {
        base.OnEnable();

        m_lastSearchTime = 0f;
        m_target = null;
    }
Пример #14
0
        public bool Use(Creature user)
        {
            //Currently healing is implemented as a player effect so we need to check the user is a player
            Player player = user as Player;

            //Not a player
            if (player == null)
            {
                return false;
            }

            //Add a message
            Game.MessageQueue.AddMessage("You eat the berry.");

            //Apply the healing effect to the player
            //Duration note 100 is normally 1 turn for a non-sped up player

            int duration = 10 * Creature.turnTicks + Game.Random.Next(20 * Creature.turnTicks);
            int toHitUp = 1 + Game.Random.Next(3);

            player.AddEffect(new PlayerEffects.ToHitUp(duration, toHitUp));

            //This uses up the potion
            usedUp = true;

            return true;
        }
Пример #15
0
 private void Debug(ref Creature Creature_Editor)
 {
     Layout.Bool("Player", ref Creature_Editor.Player);
     Layout.Float("Storey", ref Creature_Editor.Storey);
     Layout.Float("Height", ref Creature_Editor.Height);
     EditorGUILayout.PropertyField(AI,true);
 }
Пример #16
0
        public bool Equip(Creature user)
        {
            //LogFile.Log.LogEntryDebug("Glove equipped", LogDebugLevel.Medium);

            //This is plot equipment
            //Game.Dungeon.Player.PlotItemsFound++;

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.VaultBackstab());

            //Play movies if set
            if (Game.Dungeon.Player.PlayItemMovies)
            {
                //Screen.Instance.PlayMovie("plotglove", true);
                //Screen.Instance.PlayMovie("vaultbackstab", false);
            }

            //Messages
            Game.MessageQueue.AddMessage("Your reflection in the orb seems to stretch away forever. All around you distances distort and become shorter.");
            //Game.MessageQueue.AddMessage("Learnt Vault Backstab!");

            return true;
        }
Пример #17
0
	public void OnPlayerEntersRegion(Creature creature)
	{
		if (!creature.IsPlayer)
			return;

		// Set BGM if there is one set for creature's region, this will
		// replace BGMs set before.
		Track track;
		if (_regions.TryGetValue(creature.RegionId, out track))
		{
			Send.SetBgm(creature, track.FileName, track.Repeat);
			_playerStorage[creature.EntityId] = track.FileName;
			return;
		}

		// If no BGM is available for the new region, but one was set before,
		// unset it.
		lock (_playerStorage)
		{
			if (_playerStorage.ContainsKey(creature.EntityId))
			{
				Send.UnsetBgm(creature, _playerStorage[creature.EntityId]);
				_playerStorage.Remove(creature.EntityId);
			}
		}
	}
Пример #18
0
	public override bool Route(Creature creature, Item item, ref string dungeonName)
	{
		// Fiodh Int 1
		if (item.Info.Id == 63119) // Fiodh Intermediate Fomor Pass for One
		{
			dungeonName = "gairech_fiodh_middle_1_dungeon";
			return true;
		}

		// Fiodh Int 2
		// TODO: Party check
		if (item.Info.Id == 63120) // Fiodh Intermediate Fomor Pass for Two
		{
			dungeonName = "gairech_fiodh_middle_2_dungeon";
			return true;
		}

		// Fiodh Int 4
		// TODO: Party check
		if (item.Info.Id == 63121) // Fiodh Intermediate Fomor Pass for Four
		{
			dungeonName = "gairech_fiodh_middle_4_dungeon";
			return true;
		}

		dungeonName = "gairech_fiodh_dungeon";
		return true;
	}
Пример #19
0
 public override void Damage(int damage, Creature source)
 {
     if (source != null)
     {
         FollowOrder(source);
     }
 }
	public override void OnUse(Creature creature, Item item, string parameter)
	{
		var rnd = RandomProvider.Get();
		var rndItem = Item.GetRandomDrop(rnd, items);

		creature.AcquireItem(rndItem);
	}
Пример #21
0
        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("Wielding God Sword", LogDebugLevel.Medium);

            //Give player story. Mention level up if one will occur.

            if (Game.Dungeon.Player.PlayItemMovies)
            {
                //Screen.Instance.PlayMovie("plotbadge", true);
                //Screen.Instance.PlayMovie("multiattack", false);
            }

            //Messages
            Game.MessageQueue.AddMessage("Wielding the Sword of God! You feel power flowing up your arm!");

            //Screen.Instance.PlayMovie("plotbadge", true);

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            //Game.Dungeon.LearnMove(new SpecialMoves.MultiAttack());
            //Screen.Instance.PlayMovie("multiattack", false);

            //Add any equipped (actually permanent) effects
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
Пример #22
0
	public void OnCreatureFinishedProductionOrCollection(Creature creature, bool success)
	{
		// the Butterfingers
		// Show if failed collecting or production something 5 times in a
		// rown, give it at 10 fails in a row.
		// ------------------------------------------------------------------
		if (creature.Titles.IsUsable(20))
			return;

		if (success)
		{
			creature.Vars.Temp["ButterfingerFailCounter"] = 0;
			return;
		}

		if (creature.Vars.Temp["ButterfingerFailCounter"] == null)
			creature.Vars.Temp["ButterfingerFailCounter"] = 0;

		var count = (int)creature.Vars.Temp["ButterfingerFailCounter"];
		count++;

		if (count >= 10)
		{
			creature.Titles.Enable(20);
			count = 0;
		}
		else if (count >= 5)
		{
			creature.Titles.Show(20);
		}

		creature.Vars.Temp["ButterfingerFailCounter"] = count;
	}
Пример #23
0
    public override bool Use(Creature obj)
    {
        switch(RefItemID)
        {
        case 21:
            obj.WeaponHolder.ActiveWeaponSkillFire(Const.NuclearRefItemId, obj.transform.eulerAngles.y);
            break;
        case 22:
            return obj.ApplyMachoSkill();
        case 23:
            return obj.ApplyHealingSkill();
        case 24:
            return obj.ApplyDamageMultiplySkill();
        case 25:
            Weapon weapon = obj.WeaponHolder.GetPassiveSkillWeapon(130);
            if (weapon != null)
            {
                weapon.LevelUp();
            }
            else
            {
                obj.EquipPassiveSkillWeapon(new ItemWeaponData(130), new RefMob.WeaponDesc());
            }
            break;

        }
        return true;
    }
Пример #24
0
 public void Cast(Creature caster)
 {
     if (OnCast != null)
     {
         OnCast(caster);
     }
 }
Пример #25
0
        public bool Equip(Creature user)
        {
            LogFile.Log.LogEntryDebug("Boots equipped", LogDebugLevel.Medium);

            Game.Dungeon.Player.PlotItemsFound++;

            //This is plot equipment

            //Give player story. Mention level up if one will occur.

            if (Game.Dungeon.Player.PlayItemMovies)
            {
                Screen.Instance.PlayMovie("plotboots", true);
                Screen.Instance.PlayMovie("wallvault", false);
            }

            //Messages
            //Game.MessageQueue.AddMessage("Levelled up!");
            Game.MessageQueue.AddMessage("Learnt Charge Attack!");

            //Screen.Instance.PlayMovie("plotboots", true);

            //Level up?
            //Game.Dungeon.Player.LevelUp();

            //Add move?
            Game.Dungeon.LearnMove(new SpecialMoves.ChargeAttack());
            //Screen.Instance.PlayMovie("wallvault", false);

            //Add permanent speed increase
            //Game.Dungeon.Player.Speed += 10;

            return true;
        }
Пример #26
0
 public void addCreature(Creature cr)
 {
     creatures.Add(cr);
     if (creatures.Count > 1) {
         Console.WriteLine((creatures[creatures.Count-2] as Creature).name + " позвал " + (creatures[creatures.Count-1] as Creature).name + "\n");
     }
 }
Пример #27
0
        public void CalculateCost(Creature creature, Point endPoint, bool improved)
        {
            //H = Math.Max(Math.Abs(Position.X - endPoint.X), Math.Abs(Position.Y - endPoint.Y)) * 30;
            //   H = (Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y))*10;
            //H = Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y);

            if (!improved)
            {
                int xDistance = Math.Abs(PositionX - endPoint.X);
                int yDistance = Math.Abs(PositionY - endPoint.Y);
                if (xDistance > yDistance)
                    H = 14 * yDistance + 10 * (xDistance - yDistance);
                else
                    H = 14 * xDistance + 10 * (yDistance - xDistance);
            }
            else
                H = 0;

            if (Parent != null)
                if (type)
                    G = Parent.G + 10;
                else
                    G = Parent.G + 14;
            else
                G = 0;
            Cost = G + H;
              //  if (creature != null)
             //   Cost += (int)(100 / creature.Body.GetWalkSpeed(creature.Map.terrain[PositionX, PositionY]));
        }
Пример #28
0
        public void CalculateCost(TileMap tileMap, Creature creature, Point endPoint,byte additionalCost, bool improved)
        {
            //H = Math.Max(Math.Abs(Position.X - endPoint.X), Math.Abs(Position.Y - endPoint.Y)) * 30;
            //   H = (Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y))*10;
            //H = Math.Abs(Position.X - endPoint.X) + Math.Abs(Position.Y - endPoint.Y);
            if(false)
            if (!improved)
            {
                int xDistance = Math.Abs(PositionX - endPoint.X);
                int yDistance = Math.Abs(PositionY - endPoint.Y);
                if (xDistance > yDistance)
                    H = 14 * yDistance + 10 * (xDistance - yDistance);
                else
                    H = 14 * xDistance + 10 * (yDistance - xDistance);
            }
            else
                H = 0;

             //   H = (Math.Abs(PositionX - endPoint.X) - Math.Abs(PositionY - endPoint.Y)) * 10;

            if (Parent != null)
                if (type)
                    G = Parent.G + 10;
                else
                    G = Parent.G + 14;
            else
                G = 0;
            Cost = G + H;//+ (tileMap[PositionX, PositionY] != CellType.Ladder ? 10000 : 0) + additionalCost
                  // + (tileMap[PositionX, PositionY + 1] == CellType.Wall ? 0 : 5000);

            //  if (creature != null)
            //   Cost += (int)(100 / creature.Body.GetWalkSpeed(creature.Map.terrain[PositionX, PositionY]));
        }
Пример #29
0
	void OnCollisionEnter2D(Collision2D col){
		collisionCreature = col.gameObject.GetComponent<Creature>();

		if(collisionCreature && !died){
			collisionCreature.TakeDamage(Random.Range(5, 25));
		}
	}
Пример #30
0
 void Awake()
 {
     Rigidbody = GetComponent<Rigidbody>();
     CapsuleCollider = GetComponent<CapsuleCollider>();
     Creature = GetComponent<Creature>();
     TargetPosition = transform.position;
 }
 private static bool Prefix(Creature __instance)
 {
     return(!Instance.IsTimeFrozen);
 }
Пример #32
0
 public virtual void OnAttacked(Creature attacker, int damage)
 {
 }
Пример #33
0
 public virtual void OnAttack(Creature target)
 {
 }
            public override void OnCreatureCreate(Creature creature)
            {
                var  players        = instance.GetPlayers();
                Team TeamInInstance = 0;

                if (!players.Empty())
                {
                    Player player = players.First();
                    if (player)
                    {
                        TeamInInstance = player.GetTeam();
                    }
                }

                switch (creature.GetEntry())
                {
                // Champions
                case VehicleIds.MOKRA_SKILLCRUSHER_MOUNT:
                    if (TeamInInstance == Team.Horde)
                    {
                        creature.UpdateEntry(VehicleIds.MARSHAL_JACOB_ALERIUS_MOUNT);
                    }
                    break;

                case VehicleIds.ERESSEA_DAWNSINGER_MOUNT:
                    if (TeamInInstance == Team.Horde)
                    {
                        creature.UpdateEntry(VehicleIds.AMBROSE_BOLTSPARK_MOUNT);
                    }
                    break;

                case VehicleIds.RUNOK_WILDMANE_MOUNT:
                    if (TeamInInstance == Team.Horde)
                    {
                        creature.UpdateEntry(VehicleIds.COLOSOS_MOUNT);
                    }
                    break;

                case VehicleIds.ZUL_TORE_MOUNT:
                    if (TeamInInstance == Team.Horde)
                    {
                        creature.UpdateEntry(VehicleIds.EVENSONG_MOUNT);
                    }
                    break;

                case VehicleIds.DEATHSTALKER_VESCERI_MOUNT:
                    if (TeamInInstance == Team.Horde)
                    {
                        creature.UpdateEntry(VehicleIds.LANA_STOUTHAMMER_MOUNT);
                    }
                    break;

                // Coliseum Announcer || Just NPC_JAEREN must be spawned.
                case CreatureIds.JAEREN:
                    uiAnnouncerGUID = creature.GetGUID();
                    if (TeamInInstance == Team.Alliance)
                    {
                        creature.UpdateEntry(CreatureIds.ARELAS);
                    }
                    break;

                case VehicleIds.ARGENT_WARHORSE:
                case VehicleIds.ARGENT_BATTLEWORG:
                    VehicleList.Add(creature.GetGUID());
                    break;

                case CreatureIds.EADRIC:
                case CreatureIds.PALETRESS:
                    uiArgentChampionGUID = creature.GetGUID();
                    break;
                }
            }
 public static T GetTrialOfTheChampionAI <T>(Creature creature) where T : CreatureAI
 {
     return(GetInstanceAI <T>(creature, "instance_trial_of_the_champion"));
 }
            public override void SetData(uint uiType, uint uiData)
            {
                switch (uiType)
                {
                case (uint)Data.DATA_MOVEMENT_DONE:
                    uiMovementDone = (ushort)uiData;
                    if (uiMovementDone == 3)
                    {
                        Creature pAnnouncer = instance.GetCreature(uiAnnouncerGUID);
                        if (pAnnouncer)
                        {
                            pAnnouncer.GetAI().SetData((uint)Data.DATA_IN_POSITION, 0);
                        }
                    }
                    break;

                case (uint)Data.BOSS_GRAND_CHAMPIONS:
                    m_auiEncounter[0] = (EncounterState)uiData;
                    if (uiData == (uint)EncounterState.InProgress)
                    {
                        foreach (var guid in VehicleList)
                        {
                            Creature summon = instance.GetCreature(guid);
                            if (summon)
                            {
                                summon.RemoveFromWorld();
                            }
                        }
                    }
                    else if (uiData == (uint)EncounterState.Done)
                    {
                        ++uiGrandChampionsDeaths;
                        if (uiGrandChampionsDeaths == 3)
                        {
                            Creature pAnnouncer = instance.GetCreature(uiAnnouncerGUID);
                            if (pAnnouncer)
                            {
                                pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f);
                                pAnnouncer.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
                                pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.CHAMPIONS_LOOT_H : GameObjectIds.CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000);
                            }
                        }
                    }
                    break;

                case (uint)Data.DATA_ARGENT_SOLDIER_DEFEATED:
                    uiArgentSoldierDeaths = (byte)uiData;
                    if (uiArgentSoldierDeaths == 9)
                    {
                        Creature pBoss = instance.GetCreature(uiArgentChampionGUID);
                        if (pBoss)
                        {
                            pBoss.GetMotionMaster().MovePoint(0, 746.88f, 618.74f, 411.06f);
                            pBoss.RemoveFlag(UnitFields.Flags, UnitFlags.NonAttackable);
                            pBoss.SetReactState(ReactStates.Aggressive);
                        }
                    }
                    break;

                case (uint)Data.BOSS_ARGENT_CHALLENGE_E:
                {
                    m_auiEncounter[1] = (EncounterState)uiData;
                    Creature pAnnouncer = instance.GetCreature(uiAnnouncerGUID);
                    if (pAnnouncer)
                    {
                        pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f);
                        pAnnouncer.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
                        pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.EADRIC_LOOT_H : GameObjectIds.EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000);
                    }
                }
                break;

                case (uint)Data.BOSS_ARGENT_CHALLENGE_P:
                {
                    m_auiEncounter[2] = (EncounterState)uiData;
                    Creature pAnnouncer = instance.GetCreature(uiAnnouncerGUID);
                    if (pAnnouncer)
                    {
                        pAnnouncer.GetMotionMaster().MovePoint(0, 748.309f, 619.487f, 411.171f);
                        pAnnouncer.SetFlag(UnitFields.NpcFlags, NPCFlags.Gossip);
                        pAnnouncer.SummonGameObject(instance.IsHeroic() ? GameObjectIds.PALETRESS_LOOT_H : GameObjectIds.PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, Quaternion.fromEulerAnglesZYX(1.42f, 0.0f, 0.0f), 90000);
                    }
                }
                break;
                }

                if (uiData == (uint)EncounterState.Done)
                {
                    SaveToDB();
                }
            }
Пример #37
0
 protected override void Hit(Creature attacker, Creature attacked)
 {
     attacked.Health -= attacker.Attack;
 }
Пример #38
0
 public Finder(Creature own)
 {
     Own = own;
 }
Пример #39
0
 /// <summary>
 /// Returns elemental damage multiplier for this skill.
 /// </summary>
 /// <param name="attacker"></param>
 /// <param name="target"></param>
 /// <returns></returns>
 protected override float GetElementalDamageMultiplier(Creature attacker, Creature target)
 {
     return(attacker.CalculateElementalDamageMultiplier(Creature.MaxElementalAffinity, 0, 0, target));
 }
Пример #40
0
 public Tile Find(Creature goal)
 {
     Goal = goal.Tr.position;
     return(Find(Own.Tr.position, Own.CurrentTile, goal.CurrentTile, Own.Params.NoseParam.SenseRadius, Own.Params.BodyParam.GetHeightStairs(), FinderType.Path));
 }
 // Token: 0x060024F7 RID: 9463 RVA: 0x0023DA8C File Offset: 0x0023BC8C
 public GamePadInstruction(Overseer overseer, OverseerHologram.Message message, Creature communicateWith, float importance) : base(overseer, message, communicateWith, importance)
 {
     this.socket = new OverseerDroughtTutorialBehavior.GamePadStickSocket(this, this.totalSprites);
     base.AddPart(this.socket);
     base.AddPart(new OverseerDroughtTutorialBehavior.GamePadStick(this, this.totalSprites, this.socket));
     this.silhouette = new OverseerDroughtTutorialBehavior.GamePadSilhouette(this, this.totalSprites);
     base.AddPart(this.silhouette);
     this.buttons = new OverseerDroughtTutorialBehavior.GamePadButton[3];
     for (int i = 0; i < this.buttons.Length; i++)
     {
         this.buttons[i] = new OverseerDroughtTutorialBehavior.GamePadButton(this, this.totalSprites);
         base.AddPart(this.buttons[i]);
     }
     if (overseer.abstractCreature.world.game.rainWorld.options.controls[0].preset == Options.ControlSetup.Preset.XBox)
     {
         this.PickUp.symbol      = "X";
         this.Jump.symbol        = "A";
         this.Throw.symbol       = "B";
         this.PickUp.buttonColor = new Color(0.2f, 0.6f, 1f);
         this.Jump.buttonColor   = new Color(0.4f, 1f, 0.2f);
         this.Throw.buttonColor  = new Color(1f, 0.2f, 0.2f);
     }
     else
     {
         this.PickUp.symbol      = "Square";
         this.Jump.symbol        = "Cross";
         this.Throw.symbol       = "Circle";
         this.PickUp.buttonColor = new Color(0.9f, 0.3f, 1f);
         this.Jump.buttonColor   = new Color(0.5f, 0.5f, 1f);
         this.Throw.buttonColor  = new Color(1f, 0.3f, 0.3f);
     }
     this.parts = new OverseerHologram.HologramPart[4];
     this.partsRemainVisible = new int[this.parts.Length];
     this.parts[0]           = this.socket;
     this.parts[1]           = this.buttons[0];
     this.parts[2]           = this.buttons[1];
     this.parts[3]           = this.buttons[2];
 }
Пример #42
0
        /// <summary>
        /// Bolt specific use code.
        /// </summary>
        /// <param name="attacker"></param>
        /// <param name="skill"></param>
        /// <param name="target"></param>
        protected override void UseSkillOnTarget(Creature attacker, Skill skill, Creature mainTarget)
        {
            // Create actions
            var aAction = new AttackerAction(CombatActionType.RangeHit, attacker, mainTarget.EntityId);

            aAction.Set(AttackerOptions.Result);

            var cap = new CombatActionPack(attacker, skill.Info.Id, aAction);

            // Get targets
            // Add the main target as first target, so it gets the first hit,
            // and the full damage.
            var targets = new List <Creature>();

            targets.Add(mainTarget);

            var inSplashRange = attacker.GetTargetableCreaturesAround(mainTarget.GetPosition(), SplashRange);

            targets.AddRange(inSplashRange.Where(a => a != mainTarget));

            // Damage
            var damage = this.GetDamage(attacker, skill);

            var max = Math.Min(targets.Count, skill.Stacks);

            for (int i = 0; i < max; ++i)
            {
                var target       = targets[i];
                var targetDamage = damage;

                target.StopMove();

                var tAction = new TargetAction(CombatActionType.TakeHit, target, attacker, skill.Info.Id);
                tAction.Set(TargetOptions.Result);
                tAction.Stun = TargetStun;

                // Full damage for the first target, -10% for every subsequent one.
                targetDamage -= (targetDamage * 0.1f) * i;

                // Reduce damage
                Defense.Handle(aAction, tAction, ref targetDamage);
                SkillHelper.HandleMagicDefenseProtection(target, ref targetDamage);
                ManaShield.Handle(target, ref targetDamage, tAction);

                // Mana Deflector
                var delayReduction = ManaDeflector.Handle(attacker, target, ref targetDamage, tAction);

                // Deal damage
                if (targetDamage > 0)
                {
                    target.TakeDamage(tAction.Damage = targetDamage, attacker);
                }

                if (target == mainTarget)
                {
                    target.Aggro(attacker);
                }

                // Reduce stun, based on ping
                if (delayReduction > 0)
                {
                    tAction.Stun = (short)Math.Max(0, tAction.Stun - (tAction.Stun / 100 * delayReduction));
                }

                // Death/Knockback
                if (target.IsDead)
                {
                    tAction.Set(TargetOptions.FinishingKnockDown);
                }
                else
                {
                    // If knocked down, instant recovery,
                    // if repeat hit, knock down,
                    // otherwise potential knock back.
                    if (target.IsKnockedDown)
                    {
                        tAction.Stun = 0;
                    }
                    else if (target.Stability < MinStability)
                    {
                        tAction.Set(TargetOptions.KnockDown);
                    }
                    else
                    {
                        // If number of stacks is greater than the number of
                        // targets hit, the targets are knocked back, which is
                        // done by reducing the stability to min here.
                        // Targets with high enough Mana Deflector might
                        // negate this knock back, by reducing the stability
                        // reduction to 0.
                        var stabilityReduction = (skill.Stacks > targets.Count ? OverchargeStabilityReduction : StabilityReduction);

                        // Reduce reduction, based on ping
                        // While the Wiki says that "the Knockdown Gauge [does not]
                        // build up", tests show that it does. However, it's
                        // reduced, assumedly based on the MD rank.
                        if (delayReduction > 0)
                        {
                            stabilityReduction = (short)Math.Max(0, stabilityReduction - (stabilityReduction / 100 * delayReduction));
                        }

                        target.Stability -= stabilityReduction;

                        if (target.IsUnstable)
                        {
                            tAction.Set(TargetOptions.KnockBack);
                        }
                    }
                }

                if (tAction.IsKnockBack)
                {
                    attacker.Shove(target, KnockbackDistance);
                }

                cap.Add(tAction);
            }

            // Override stun set by defense
            aAction.Stun = AttackerStun;

            Send.Effect(attacker, Effect.UseMagic, EffectSkillName);
            Send.SkillUseStun(attacker, skill.Info.Id, aAction.Stun, 1);

            skill.Stacks = 0;

            cap.Handle();
        }
Пример #43
0
        public PetAI(Creature c) : base(c)
        {
            i_tracker = new TimeTracker(5000);

            UpdateAllies();
        }
Пример #44
0
        /// <summary>
        /// Returns damage for attacker using skill.
        /// </summary>
        /// <param name="attacker"></param>
        /// <param name="skill"></param>
        /// <returns></returns>
        protected override float GetDamage(Creature attacker, Skill skill)
        {
            var damage = attacker.GetRndMagicDamage(skill, skill.RankData.Var1, skill.RankData.Var2);

            return(damage);
        }
Пример #45
0
 /// <summary>
 /// Modifies favor of the NPC towards the other creature.
 /// </summary>
 /// <param name="other"></param>
 /// <param name="value"></param>
 /// <returns>New favor value</returns>
 public int ModifyFavor(Creature other, int value)
 {
     return(this.SetFavor(other, this.GetFavor(other) + value));
 }
 // Token: 0x060024ED RID: 9453 RVA: 0x0023D6E0 File Offset: 0x0023B8E0
 public KeyBoardInstruction(Overseer overseer, OverseerHologram.Message message, Creature communicateWith, float importance) : base(overseer, message, communicateWith, importance)
 {
     this.keys = new OverseerDroughtTutorialBehavior.KeyBoardKey[7];
     for (int i = 0; i < this.keys.Length; i++)
     {
         this.keys[i] = new OverseerDroughtTutorialBehavior.KeyBoardKey(this, this.totalSprites);
         base.AddPart(this.keys[i]);
     }
     this.Down.offset   = new Vector2(35f, 0f);
     this.Right.offset  = new Vector2(70f, 0f);
     this.Up.offset     = new Vector2(35f, 35f);
     this.Throw.offset  = new Vector2(-45f, 0f);
     this.Jump.offset   = new Vector2(-80f, 0f);
     this.PickUp.offset = new Vector2(-125f, 0f);
     this.PickUp.MakeWider(10f);
     this.Down.symbol          = "Arrow";
     this.Right.symbol         = "Arrow";
     this.Up.symbol            = "Arrow";
     this.Left.symbol          = "Arrow";
     this.Left.symbolRotation  = -90f;
     this.Right.symbolRotation = 90f;
     this.Down.symbolRotation  = 180f;
     this.PickUp.symbol        = "Shift";
     this.Jump.symbol          = "Z";
     this.Throw.symbol         = "X";
 }
Пример #47
0
 public override bool CanUse(Creature target, bool isInCombat, out string whyNot)
 {
     whyNot = null;
     return(true);
 }
Пример #48
0
 /// <summary>
 /// Modifies how much the other creature is stressing the NPC.
 /// </summary>
 /// <param name="other"></param>
 /// <param name="value"></param>
 /// <returns>New stress value</returns>
 public int ModifyStress(Creature other, int value)
 {
     return(this.SetStress(other, this.GetStress(other) + value));
 }
Пример #49
0
 public virtual void OnCreatureCreate(Creature creature)
 {
 }
Пример #50
0
 /// <summary>
 /// Sets how well the NPC remembers the other creature.
 /// </summary>
 /// <param name="other"></param>
 /// <param name="value"></param>
 /// <returns>New memory value</returns>
 public int ModifyMemory(Creature other, int value)
 {
     return(this.SetMemory(other, this.GetMemory(other) + value));
 }
Пример #51
0
 public npc_scarlet_miner_cart(Creature creature) : base(creature)
 {
     me.SetDisplayFromModel(0); // Modelid2
 }
Пример #52
0
 public virtual void OnCreatureRemove(Creature creature)
 {
 }
Пример #53
0
 public npc_ros_dark_rider(Creature creature) : base(creature)
 {
 }
Пример #54
0
 public CreatureKeywords(Creature creature)
 {
     _creature = creature;
     _list     = new List <ushort>();
 }
Пример #55
0
 public npc_dark_rider_of_acherus(Creature creature) : base(creature)
 {
     Initialize();
 }
Пример #56
0
 public npc_dkc1_gothik(Creature creature) : base(creature)
 {
 }
Пример #57
0
 public npc_death_knight_initiateAI(Creature creature) : base(creature)
 {
     Initialize();
 }
Пример #58
0
 public npc_salanar_the_horseman(Creature creature) : base(creature)
 {
 }
Пример #59
0
 public npc_unworthy_initiate_anchor(Creature creature) : base(creature)
 {
 }
Пример #60
0
 public override CreatureAI GetAI(Creature creature)
 {
     return(new npc_death_knight_initiateAI(creature));
 }