/* Copyright (C) 2007 This File is part of Core3. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Linking Engine3 statically or dynamically with other modules is making a combined work based on Engine3. Thus, the terms and conditions of the GNU Lesser General Public License cover the whole combination. In addition, as a special exception, the copyright holders of Engine3 give you permission to combine Engine3 program with free software programs or libraries that are released under the GNU LGPL and with code included in the standard release of Core3 under the GNU LGPL license (or modified versions of such code, with unchanged license). You may copy and distribute such a system following the terms of the GNU LGPL for Engine3 and the licenses of the other code concerned, provided that you include the source code of that other code when and as the GNU LGPL requires distribution of source code. Note that people who make modified versions of Engine3 are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. */ package server.zone.objects.creature; import engine.core.ManagedObject; import engine.util.u3d.Coordinate; import server.zone.objects.creature.CreatureObject; import server.zone.objects.creature.AiAgent; import server.zone.objects.group.GroupObject; import server.zone.packets.object.ObjectMenuResponse; include server.zone.packets.scene.AttributeListMessage; import server.zone.templates.mobile.CreatureTemplate; import server.zone.objects.creature.CreatureObject; import server.zone.Zone; class Creature extends AiAgent { @dereferenced private transient SortedVector alreadyHarvested; private boolean alreadyMilked; public Creature() { Logger.setLoggingName("Creature"); Logger.setLogging(false); Logger.setGlobalLogging(true); } /** * Initializes the transient members of SceneObject, must call the inherited object method first. * @pre {transient members are not initialized } * @post { transient members are initialized } */ public native void initializeTransientMembers(); public boolean isCreature() { return true; } public boolean isCamouflaged(CreatureObject target) { return isScentMasked(target) || isConcealed(target); } public native void runAway(CreatureObject target); @local public native void fillObjectMenuResponse(ObjectMenuResponse menuResponse, CreatureObject player); /** * Handles the radial selection sent by the client, must be overriden by inherited objects * @pre { this object is locked, player is locked } * @post { this object is locked, player is locked } * @param player CreatureObject that selected the option * @param selectedID selected menu id * @returns 0 if successfull */ public native int handleObjectMenuSelect(CreatureObject player, byte selectedID); public native void fillAttributeList(AttributeListMessage msg, CreatureObject object); public native void scheduleDespawn(); public native boolean hasOrganics(); public native boolean hasMilk(); public native boolean canHarvestMe(CreatureObject player); public native boolean hasSkillToHarvestMe(CreatureObject player); public native boolean canMilkMe(CreatureObject player); public native void addAlreadyHarvested(CreatureObject player); public native void setAlreadyMilked(boolean milked); public native void notifyDespawn(Zone zone); public boolean isBaby() { return super.baby; } public float getTame() { if (super.npcTemplate == null) return 0; return super.npcTemplate.getTame(); } public string getMeatType() { if (super.npcTemplate == null) return ""; return super.npcTemplate.getMeatType(); } public string getBoneType() { if (super.npcTemplate == null) return ""; return super.npcTemplate.getBoneType(); } public string getHideType() { if (super.npcTemplate == null) return ""; return super.npcTemplate.getHideType(); } public string getMilkType() { if (super.npcTemplate == null) return ""; return super.npcTemplate.getMilkType(); } public float getMilk() { if (super.npcTemplate == null) return 0; return super.npcTemplate.getMilk(); } public float getHideMax() { if (super.npcTemplate == null) return 0; return super.npcTemplate.getHideMax(); } public float getBoneMax() { if (super.npcTemplate == null) return 0; return super.npcTemplate.getBoneMax(); } public float getMeatMax() { if (super.npcTemplate == null) return 0; return super.npcTemplate.getMeatMax(); } }