From: Miguel A. B. L. <ari...@us...> - 2005-10-20 17:42:14
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2905/src/games/stendhal/server/entity Modified Files: RPEntity.java Log Message: Added money. Still need to add something to join two money objects. Missing number of coins at inventory Index: RPEntity.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/RPEntity.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** RPEntity.java 11 Oct 2005 14:59:38 -0000 1.55 --- RPEntity.java 20 Oct 2005 17:42:00 -0000 1.56 *************** *** 14,20 **** import games.stendhal.common.Level; import games.stendhal.server.Path; ! import games.stendhal.server.entity.item.Corpse; ! import games.stendhal.server.entity.item.Item; import games.stendhal.server.rule.ActionManager; import java.util.ArrayList; --- 14,20 ---- import games.stendhal.common.Level; + import games.stendhal.common.Rand; import games.stendhal.server.Path; ! import games.stendhal.server.entity.item.*; import games.stendhal.server.rule.ActionManager; import java.util.ArrayList; *************** *** 410,413 **** --- 410,423 ---- // Add a corpse Corpse corpse=new Corpse(this); + + // Add some reward inside the corpse + int amount=(int)(getXP()/100)+(Rand.roll1D6()-3); + if(amount>0) + { + Money money=(Money)world.getRuleManager().getEntityManager().getItem("money"); + money.setQuantity(amount); + corpse.add(money); + } + IRPZone zone=world.getRPZone(getID()); zone.assignRPObjectID(corpse); |