Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/home/groups/n/no/noxwizard/cvs/src/pointer.h

Go to the documentation of this file.
00001   /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
00002     || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net]  ||
00003     ||                                                                         ||
00004     || This software is free software released under GPL2 license.             ||
00005     || You can find detailed license information in nox-wizard.cpp file.       ||
00006     ||                                                                         ||
00007     || For any question post to NoX-Wizard forums.                             ||
00008     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
00009 
00015 #ifndef __POINTERS_H__
00016 #define __POINTERS_H__
00017 
00018 void getWorldCoordsFromSerial (int sr, UI16& px, UI16& py, SI08& pz, int& ch, int& it);
00019 
00020 
00024 namespace pointers {
00025 
00027 
00031         extern std::map<SERIAL, vector <P_CHAR> > pStableMap;
00032         extern std::map<SERIAL, P_CHAR > pMounted;
00033 
00034         extern std::map<SERIAL, vector <P_CHAR> > pOwnCharMap;
00035         extern std::map<SERIAL, vector <P_ITEM> > pOwnItemMap;
00036 
00037         extern std::map<SERIAL, vector <P_ITEM> > pContMap;
00038 
00039         extern std::map<SERIAL, vector <P_CHAR> > pMultiCharMap;
00040         extern std::map<SERIAL, vector <P_ITEM> > pMultiItemMap;
00042 
00043         void init();
00044         void delChar(P_CHAR pc);
00045         void delItem(P_ITEM pi);
00046         
00047         void updContMap(P_ITEM pi);
00048         
00049         void addToStableMap(P_CHAR pet);
00050         void delFromStableMap(P_CHAR pet);
00051 
00052         void addToOwnerMap( P_CHAR pet );
00053         void delFromOwnerMap( P_CHAR pet );
00054         void addToOwnerMap( P_ITEM pi );
00055         void delFromOwnerMap( P_ITEM pi );
00056 
00057         void addToMultiMap( P_CHAR pc );
00058         void delFromMultiMap( P_CHAR pc );
00059         void addToMultiMap( P_ITEM pi );
00060         void delFromMultiMap( P_ITEM pi );
00061         
00062         P_CHAR findCharBySerial(int serial);
00063         P_ITEM findItemBySerial(int serial);
00064         P_CHAR findCharBySerPtr(unsigned char *p);
00065         P_ITEM findItemBySerPtr(unsigned char *p);
00066         P_ITEM containerSearch(int serial, int *index);
00067         P_ITEM containerSearchFor(const int serial, int *index, short id, short color);
00068         UI32 containerCountItems(SERIAL serial, short id, short color, LOGICAL bAddAmounts = true, LOGICAL recurseSubpack=true);
00069         UI32 containerCountItemsByID(SERIAL serial, UI32 scriptID, LOGICAL bAddAmounts);
00070         UI32 containerCountItemsByType(SERIAL serial, UI32 type, LOGICAL bAddAmounts=true, LOGICAL recurseSubpack=true);
00071 
00072         P_CHAR stableSearch(int serial, int *index);
00073 #ifdef SPAR_LOCATION_MAP
00074         //
00075         // Sparhawk:    mapRegion replacement (work in progress)
00076         //
00077         enum
00078         {
00079                 NONE            =   0,
00080                 ONLINE          =   1,
00081                 OFFLINE         =   2,
00082                 NPC             =   4,
00083                 EXCLUDESELF     =   8,
00084                 DEAD            =  16,
00085                 PARTYMEMBER     =  32,
00086                 GUILDMEMBER     =  64,
00087                 COMBATTARGET    = 128
00088         };
00089 
00090         void            addToLocationMap( const P_OBJECT pObject );
00091         void            updateLocationMap( const P_OBJECT pObject );
00092         void            delFromLocationMap( const P_OBJECT pObject );
00093 
00094         void            showCharLocationMap();
00095         void            addCharToLocationMap( const P_CHAR who );
00096         void            delCharFromLocationMap( const P_CHAR who );
00097         PCHAR_VECTOR*   getNearbyChars( P_OBJECT pObject, UI32 range, UI32 flags = 0 );
00098         PCHAR_VECTOR*   getNearbyChars( UI32 x, UI32 y, UI32 range, UI32 flags = 0, P_CHAR pSelf = 0 );
00099 
00100         void            showItemLocationMap();
00101         void            addItemToLocationMap( const P_ITEM what );
00102         void            delItemFromLocationMap( const P_ITEM what );
00103         PITEM_VECTOR*   getNearbyItems( cObject* pObject, UI32 range, UI32 flags = 0 );
00104         PITEM_VECTOR*   getNearbyItems( UI32 x, UI32 y, UI32 range, UI32 flags = 0, P_ITEM pSelf = 0 );
00105 #endif
00106 }
00107 
00108 #endif
SourceForge.net Logo