示例#1
0
        static public void GeneratePQuestObjective(PQuest_Objective Obj, PQuest_Info Q)
        {
            switch ((Objective_Type)Obj.Type)
            {
            case Objective_Type.QUEST_KILL_PLAYERS:
            {
                if (Obj.Description.Length < 1)
                {
                    Obj.Description = "Enemy Players";
                }
            } break;

            case Objective_Type.QUEST_SPEACK_TO:
                goto case Objective_Type.QUEST_KILL_MOB;

            case Objective_Type.QUEST_KILL_MOB:
            {
                uint ObjID = 0;
                uint.TryParse(Obj.ObjectId, out ObjID);

                if (ObjID != 0)
                {
                    Obj.Creature = GetCreatureProto(ObjID);
                }

                if (Obj.Description.Length < 1 && Obj.Creature != null)
                {
                    Obj.Description = Obj.Creature.Name;
                }
            } break;

            case Objective_Type.QUEST_GET_ITEM:
            {
                uint ObjID = 0;
                uint.TryParse(Obj.ObjectId, out ObjID);

                if (ObjID != 0)
                {
                    Obj.Item = GetItem_Info(ObjID);
                }
            }
            break;
            }
            ;
        }
示例#2
0
        public static void GeneratePQuestObjective(PQuest_Objective Obj, PQuest_Info Q)
        {
            switch ((Objective_Type)Obj.Type)
            {
            case Objective_Type.QUEST_KILL_PLAYERS:
            {
                if (Obj.Description.Length < 1)
                {
                    Obj.Description = "Enemy Players";
                }
            }
            break;

            case Objective_Type.QUEST_SPEAK_TO:
                goto case Objective_Type.QUEST_KILL_MOB;

            case Objective_Type.QUEST_PROTECT_UNIT:
                goto case Objective_Type.QUEST_KILL_MOB;

            case Objective_Type.QUEST_KILL_MOB:
            {
                uint ObjID = 0;
                uint.TryParse(Obj.ObjectId, out ObjID);

                if (ObjID != 0)
                {
                    Obj.Creature = CreatureService.GetCreatureProto(ObjID);
                }

                if (Obj.Description.Length < 1 && Obj.Creature != null)
                {
                    Obj.Description = Obj.Creature.Name;
                }
            }
            break;

            case Objective_Type.QUEST_KILL_GO:
            {
                uint ObjID = 0;
                uint.TryParse(Obj.ObjectId, out ObjID);

                if (ObjID != 0)
                {
                    Obj.GameObject = GameObjectService.GetGameObjectProto(ObjID);
                }

                if (Obj.Description.Length < 1 && Obj.GameObject != null)
                {
                    Obj.Description = "Destroy " + Obj.Creature.Name;
                }
            }
            break;

            case Objective_Type.QUEST_USE_GO:
            {
                uint ObjID = 0;
                uint.TryParse(Obj.ObjectId, out ObjID);

                if (ObjID != 0)
                {
                    Obj.GameObject = GameObjectService.GetGameObjectProto(ObjID);
                }

                if (Obj.Description.Length < 1 && Obj.GameObject != null)
                {
                    Obj.Description = "Use " + Obj.GameObject.Name;
                }
            }
            break;

            case Objective_Type.QUEST_GET_ITEM:
            {
                uint ObjID = 0;
                uint.TryParse(Obj.ObjectId, out ObjID);

                if (ObjID != 0)
                {
                    Obj.Item = ItemService.GetItem_Info(ObjID);
                }
            }
            break;
            }
        }