Esempio n. 1
0
        public static NPCObject Get(uint objectID)
        {
            if (objectID == 0)
            {
                return(null);
            }

            var obj = Envir.GetObject(objectID);

            if (obj != null && obj is NPCObject)
            {
                return(obj as NPCObject);
            }

            return(null);
        }
Esempio n. 2
0
        public float PriceRate(PlayerObject player, bool baseRate = false)
        {
            if (!(Envir.GetObject(player.NPCObjectID) is NPCObject callingNPC))
            {
                return(1F);
            }

            if (callingNPC.Conq == null || baseRate)
            {
                return(callingNPC.Info.Rate / 100F);
            }

            if (player.MyGuild != null && player.MyGuild.Guildindex == callingNPC.Conq.Owner)
            {
                return(callingNPC.Info.Rate / 100F);
            }
            else
            {
                return((((callingNPC.Info.Rate / 100F) * callingNPC.Conq.npcRate) + callingNPC.Info.Rate) / 100F);
            }
        }