summaryrefslogtreecommitdiff
path: root/src/npc.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-05-17Remove Monster, Player, and NPC classesJared Adams1-76/+0
Instead of having these three subclasses with minor differences, this commit merges them back into Being. In the future, we can make Beings that are talkable to some, attackable by others, etc. This also puts back support for monster equipment. Also changes remaining references to Being::Type and the constants to refer to ActorSprite::Type. Reviewed-by: Freeyorp
2010-05-06Add support for floor item spritesJared Adams1-32/+2
This commit adds a sprite hierarchy (Sprite->ImageSprite,AnimatedSprite,CompundSprite; CompoundSprite,Actor->ActorSprite;ActorSprite->Being,FloorItem) to collect common functionailty into new base classes which will make other Mantis tickets easier to do. Also allows monsters to use particle effects. Reviewed-by: Bertram
2010-04-16Add race support for eAthenaJared Adams1-16/+24
The job/class field is used to select the race. If the given race isn't defined, it falls back on the first race (so servers can use jobs/classes without races). Also rename job to subtype for Being and subclasses, and begin support for changing monster and NPC subtypes on the fly (particle effects still need to be reset when they change). Reviewed-by: Bertram
2010-03-12Split Palette into Theme and UserPaletteJared Adams1-1/+5
Themes can now control the colors they use. Colors in the Viewport (being names, particles, etc) can still be changed by the user. Also make ProgressBars more easily colored. DyePalette was made more flexible in the process. Also fixes comparing strings of different lengths insensitively. Reviewed-by: Thorbjørn Lindeijer
2010-02-28Removed a few pointless const qualifiersThorbjørn Lindeijer1-1/+1
Reviewed-by: Jared Adams
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-13Make NPC dialogs instance instead of globalJared Adams1-8/+3
This change allows players to talk to multiple NPCs at a time (if the server agrees). Manaserv's netcode allows multiple commerce instances too. eAthena's is limited to one commerce instance, due to protocol limitations.
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2010-01-10Fix handling of NPC talking statusJared Adams1-4/+13
2009-12-16Stored the cached config value which says if non-crucial particle effects ↵Philipp Sehmisch1-1/+1
are enabled or not in a static member of class Particle instead of an instanced member of Being.
2009-08-14Add functions to more easily work with equipmentJared Adams1-1/+8
Move hair changes back over to them; related server change was reverted. Also move NPCs back over to extending Player. NPCs will have equipment in the future too, but for now, disable that part while we finish the system.
2009-08-13Clean up Being and it's derivativesJared Adams1-33/+3
Move stuff only needed for Players into Player (like slots and sprite limits). Move name handling into Being (no need for three copies of this code). Clean up terminology (including Map terminology). Remove hair-related variables.
2009-08-13Make NPC inherit from Being instead of PlayerJared Adams1-12/+1
No need for NPCs to inherit from Player. Player has functions NPC doesn't need and overrides that NPC doesn't need. This change reduces the number of functions needed to be overrided by NPC.
2009-05-05Remove debug code that was accidentally committedJared Adams1-25/+0
2009-05-05Remove extra check on player targetJared Adams1-0/+25
~Being does this too, so let's leave it there.
2009-05-01Merge the NPC dialogs into oneJared Adams1-1/+0
Also add support for the new TMWServ NPC packets
2009-04-29Removed underscores from some non-conforming filenamesBjørn Lindeijer1-1/+1
We don't use underscores in the filenames generally, and let's be consistent on that matter.
2009-04-05Implement TMWServ's NpcHandlerJared Adams1-11/+2
2009-03-31Add first draft of net handlersJared Adams1-5/+4
eAthena NPC handler has been implemented and is being used for NPC interraction.
2009-03-27Clean up of most of the Network pointersBjørn Lindeijer1-9/+0
Now that messages can be sent without requiring a pointer to the Network instance, a lot of cleanup was possible.
2009-03-27Made eAthena's Network class statically accessibleBjørn Lindeijer1-2/+1
Now the instance doesn't need to be passed into the MessageOut class anymore. Expect a lot of cleanup in the next commit.
2009-03-27Fixed some positioning issuesBjørn Lindeijer1-11/+5
Started with not being able to click NPCs properly, and I ended up correcting the draw positions of overhead text, targets and sprite ordering. It's now a bit more straight-forward. The position of a being is simply in the middle of the sprite at the bottom. When drawing the sprite, an offset remains because all the sprites are compensating for getting drawn half a tile to the left and one tile up.
2009-03-27Fixed position of dots on minimapBjørn Lindeijer1-9/+5
Also made mPx and mPy private and synchronize with mPos on setPosition(). The side effects of setting destination and clearing the path have been removed from setPosition(). Only the tmwserv PlayerHandler seemed to rely on that feature. Mantis-issue: 672
2009-03-26Fix talking to NPCsJared Adams1-1/+1
2009-03-25Merge branch 'eathena/master'Bjørn Lindeijer1-90/+18
Conflicts: A lot of files.
2009-03-23Move all TMWServ-specific code to net/tmwservJared Adams1-1/+1
Also fix several instances where the same net handler was being used for both servers, and a few other related oddities.
2009-03-22Merged the tmwserv client with the eAthena clientBjørn Lindeijer1-4/+44
This merge involved major changes on both sides, and as such took several weeks. Lots of things are expected to be broken now, however, we now have a single code base to improve and extend, which can be compiled to support either eAthena or tmwserv. In the coming months, the plan is to work towards a client that supports both eAthena and tmwserv, without needing to be recompiled. Conflicts: Everywhere!
2009-03-12Make use of the new available colorsMajin Sniper1-2/+4
This patch lets all being derivatives use the palette to set their name's colors. Text Particle Effects all respect the new settings. Some widgets were updated to use the colors.
2009-03-06Got rid of Sint{8,16,32} and Uint32 for being IDBjørn Lindeijer1-1/+1
Using unsigned rarely makes sense, especially when the server doesn't use it either. Other uses of unsigned should be reviewed. In all other cases, int is the fastest integer type on any architecture. Using 8 or 16 bits can basically only be a memory optimization.
2009-02-26Merge branch 'aethyra/master'Bjørn Lindeijer1-7/+4
Conflicts: data/graphics/images/login_wallpaper.png src/being.cpp src/beingmanager.cpp src/engine.cpp src/game.cpp src/gui/buysell.cpp src/gui/buysell.h src/gui/gui.h src/gui/npc_text.cpp src/gui/npc_text.h src/gui/npcintegerdialog.cpp src/gui/npclistdialog.cpp src/gui/npclistdialog.h src/gui/npcstringdialog.cpp src/gui/sell.cpp src/gui/shop.cpp src/gui/table.cpp src/net/beinghandler.cpp src/net/npchandler.cpp src/net/playerhandler.cpp src/npc.cpp src/npc.h src/shopitem.cpp src/shopitem.h src/utils/stringutils.cpp src/utils/stringutils.h src/utils/trim.h
2009-02-25Fix NPC handling to not need a handle on the NPCIra Rice1-63/+2
Loosely based on TMW commit f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1 Signed-off-by: Ira Rice <irarice@gmail.com>
2009-02-25Prevent duplicate NPC talking when using keyboardJared Adams1-2/+5
Based on commit a1e483913672e55704e8fbafeff5ea0ccc0c9b07 from Aethyra.
2009-02-25Fix NPC handling to not need a handle on the NPCJared Adams1-65/+2
The Being ID is used instead, as that is all that was ever really needed.
2009-02-25Don't delete the Being in the NPC classJared Adams1-4/+1
The BeingManager will clean it up when it's next cleared. One hanging Being isn't too much. A reference count system like resources use might be a better way to handle Beings.
2009-02-25If no network is set, then don't continueIra Rice1-1/+10
Based on TMW commit a996d4bff3cc5a35ee5cdb6cb5bdef920cf44120 Signed-off-by: Ira Rice <irarice@gmail.com>
2009-02-25Fix some problems with deleting NPCs earlyJared Adams1-9/+3
2009-02-25If no network is set, then don't continueJared Adams1-0/+2
Only checks in these two palces for now, as missing network in the others would indicate a design flaw.
2009-02-25Don't delete the current NPC too earlyJared Adams1-3/+11
2009-02-24Cleaned up some code, as well as removed redundant talk client requestingIra Rice1-3/+9
(which would happen from using the keyboard instead of the mouse). Signed-off-by: Ira Rice <irarice@gmail.com>
2009-02-24Don't set current_npc when initiating interractionJared Adams1-1/+0
Let it be set by the netcode if the NPC responds. This caused a movement bug if they didn't.
2009-02-24Don't set current_npc when initiating interractionJared Adams1-1/+0
Let it be set by the netcode if the NPC responds. This caused a movement bug if they didn't.
2009-02-24Remove debug statement that should've been removedJared Adams1-1/+0
It was for testing and shouldn't have been committed
2009-02-18Centralize current_npc cleanupJared Adams1-1/+17
2009-02-17Merge branch 'aethyra/master'Bjørn Lindeijer1-4/+0
Conflicts: src/gui/npc_text.cpp src/gui/npc_text.h src/gui/npcintegerdialog.cpp src/gui/npclistdialog.cpp src/gui/npcstringdialog.cpp src/net/npchandler.cpp src/npc.cpp
2009-02-16Moved target unsetting on NPCs and monsters to the being class. This isIra Rice1-4/+0
done to ensure that the client doesn't crash if the target dies and is removed from the map (since target drawing is based off of the specific target reporting its x and y coordinates). Signed-off-by: Ira Rice <irarice@gmail.com>
2009-02-16Don't arbitrarily unset player target on NPC deletionBjørn Lindeijer1-9/+5
When an NPC got deleted it would reset the player target. I'm assuming what was meant was to reset the target when the deleted NPC was the target.
2009-02-16Fixed up NPC dialogs to behave more like eAthena expects.Jared Adams1-2/+2
2009-02-16Don't arbitrarily unset player target on NPC deletionBjørn Lindeijer1-9/+5
When an NPC got deleted it would reset the player target. I'm assuming what was meant was to reset the target when the deleted NPC was the target.
2009-02-16Add next/close buttons for NPCsJared Adams1-2/+2
And keep the text dialog open for the whole transaction, logging user input and keep a full record of text from the NPC (for the current transaction only).