The attached file contains code as well as an image for a necromancer's staff.
This staff empowers its owner to awake dead creatures and make them fight under his control.
- wizard_staff.png is the staff's image. It belongs to data/sprites/items/club/
- clubs.xml_patch.txt contains the (Eclipse-)patch for the staff's entry in the... well, clubs.xml
- EntityMap_patch.txt patches EntityMap.java to register the staff as a UsableItem. This is needed to add the "Use"-option to the items context menu. (it is a bit hacky as UsableItem.class extends StackableItem.class but there is no other option yet and it works fine)
- NecroStaff.java contains the whole process of summoning. First it randomly picks an undead creature up to a given level,then it looks for corpses within the staff's range. The first found corpse is replaced by the picked monster (that means: remove the corpse, create the monster^^). Finally the owner loses HP depending on the summoned creature's level. If there are no corpses in range the player only gets a message to step closer to one. The file belongs to src/games/stendhal/server/entity/item/
Please review NecroStaff.java carefully as i haven't coded in Java before.
Also some values have to be adjusted to make sure the staff is neither over- nor underpowered:
- the max. level of summoned undeads (i've set it to 26 to have several monsters that can be summoned)
- the staff's range (atm it's squaredistance 16)
- the amount of hp the owner loses (equal to the summoned creatures level atm)
tigertoes and i are thinking of a quest to obtain the stuff. Suggestions are always welcome.
gummipferd
Anonymous
code and image for a necromancers staff
ok. eclipse should be able to create a patch for the whole set of changes from the root directory of the stendhal project, which saves you and the patcher a lot of work. but this is ok for now
Ok, great. I'll put constants in instead of hardcoded numbers for those values you say might need adjusting.
Thanks for the patch.
It has been applied to cvs trunk.