Clone of UAS2 @ https://github.com/drudgedance/uas2

Object.h 93KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602
  1. /*
  2. * This file is part of UAS2.
  3. *
  4. * UAS2 is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * UAS2 is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. * You should have received a copy of the GNU General Public License
  14. * along with UASv1; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. /**
  18. * @file Object.h
  19. * Implements general functionality for all objects.
  20. * All object types inherit from this class.
  21. */
  22. #ifndef __OBJECT_H
  23. #define __OBJECT_H
  24. #include <string>
  25. #include "math.h"
  26. #include <algorithm>
  27. #include "stdio.h"
  28. #include "stdlib.h"
  29. #include "Message.h"
  30. #include "cModels.h"
  31. #include "cMagicModels.h"
  32. #include "cItemModels.h"
  33. /*
  34. * **Item Types**
  35. * 0 - General Items (Calling stone, Wasp wings, etc)
  36. * 1 - Weapons*
  37. * 2 - Food*
  38. * 3 - Armor*
  39. * 4 - Books*
  40. * 5 - Scrolls*
  41. * 6 - Healing Kits*
  42. * 7 - Lock Picks/Keys*
  43. * 8 - Wands/Casting items*
  44. * 9 - Pyreals*
  45. * 10 - Mana Stones*
  46. * 11 - Missile Weapon/Ammo*
  47. * 12 - Shield*
  48. * 13 - Spell Components*
  49. * 14 - Gems*
  50. * 15 - Trade Notes*
  51. * 16 - Trade Skill Items*
  52. * 17 - Plants*
  53. * 18 - Clothes*
  54. * 19 - Jewelry*
  55. * 20 - Containers/packs*
  56. * 21 - Salvage*
  57. * 22 - Foci*
  58. */
  59. //Cubem0j0: Apparently added as skill IDs
  60. #define SKILL_AXE 0x01
  61. #define SKILL_BOW 0x02
  62. #define SKILL_CROSSBOW 0x03
  63. #define SKILL_DAGGER 0x04
  64. #define SKILL_MACE 0x05
  65. #define SKILL_MELEE_DEFENSE 0x06
  66. #define SKILL_MISSLE_DEFENSE 0x07
  67. #define SKILL_SPEAR 0x09
  68. #define SKILL_STAFF 0x0A
  69. #define SKILL_SWORD 0x0B
  70. #define SKILL_THROWN_WEAPONS 0x0C
  71. #define SKILL_UNARMED_COMBAT 0x0D
  72. #define SKILL_ARCANE_LORE 0x0E
  73. #define SKILL_MAGIC_DEFENSE 0x0F
  74. #define SKILL_MANA_CONVERSION 0x10
  75. #define SKILL_ITEM_TINKERING 0x12
  76. #define SKILL_ASSESS_PERSON 0x13
  77. #define SKILL_DECEPTION 0x14
  78. #define SKILL_HEALING 0x15
  79. #define SKILL_JUMP 0x16
  80. #define SKILL_LOCKPICK 0x17
  81. #define SKILL_RUN 0x18
  82. #define SKILL_ASSESS_CREATURE 0x1B
  83. #define SKILL_WEAPON_TINKERING 0x1C
  84. #define SKILL_ARMOR_TINKERING 0x1D
  85. #define SKILL_MAGIC_ITEM_TINKERING 0x1E
  86. #define SKILL_CREATURE_ENCHANTMENT 0x1F
  87. #define SKILL_ITEM_ENCHANTMENT 0x20
  88. #define SKILL_LIFE_MAGIC 0x21
  89. #define SKILL_WAR_MAGIC 0x22
  90. #define SKILL_LEADERSHIP 0x23
  91. #define SKILL_LOYALTY 0x24
  92. #define SKILL_FLETCHING 0x25
  93. #define SKILL_ALCHEMY 0x26
  94. #define SKILL_COOKING 0x27
  95. #define SKILL_SALVAGE 0x28
  96. #define PAI 3.14159265
  97. class cWeapon;
  98. class cWand;
  99. class cArmor;
  100. class cDoor;
  101. class cChest;
  102. class cFood;
  103. struct cVital {
  104. WORD m_wID; //Store in database.
  105. DWORD m_dwIncreases; //Store in database.
  106. DWORD m_dwCurrent; //Do not store in database. Can be calculated from m_dwIncreases.
  107. DWORD m_dwXP; //Do not store in database. Can be calculated from m_dwIncreases.
  108. long m_lTrueCurrent;
  109. inline cVital& operator=( DWORD dw )
  110. {
  111. long lDiff = dw - m_dwCurrent;
  112. m_dwCurrent = dw;
  113. m_dwIncreases += lDiff;
  114. return *this;
  115. }
  116. };
  117. typedef struct cObjStats
  118. {
  119. DWORD m_dwLevel;
  120. DWORD m_dwStr;
  121. DWORD m_dwEnd;
  122. DWORD m_dwQuick;
  123. DWORD m_dwCoord;
  124. DWORD m_dwFocus;
  125. DWORD m_dwSelf;
  126. DWORD m_dwSpecies;
  127. cObjStats( )
  128. {
  129. m_dwLevel = 0x1;
  130. m_dwStr = 0x0;
  131. m_dwEnd = 0x0;
  132. m_dwQuick = 0x0;
  133. m_dwCoord = 0x0;
  134. m_dwFocus = 0x0;
  135. m_dwSelf = 0x0;
  136. m_dwSpecies = 0x28;
  137. }
  138. } cObjStats;
  139. struct cAttribute {
  140. WORD m_wID; //Store in database.
  141. DWORD m_dwIncrement; //Store in database.
  142. DWORD m_dwCurrent; //Store in database.
  143. DWORD m_dwXP; //Store in database.
  144. inline cAttribute& operator=( DWORD dw )
  145. {
  146. m_dwCurrent = dw;
  147. return *this;
  148. }
  149. inline DWORD operator+( cAttribute& rhv )
  150. {
  151. return m_dwCurrent + rhv.m_dwCurrent;
  152. }
  153. inline DWORD operator/( DWORD dw )
  154. {
  155. return m_dwCurrent / dw;
  156. }
  157. };
  158. struct cSkill {
  159. WORD m_wID; // Store in database.
  160. WORD m_wStatus; // Store in database.
  161. DWORD m_dwIncreases; // Store in database.
  162. DWORD m_dwTotal; // Do not store in database.
  163. DWORD m_dwBase; // Do not store in database.
  164. DWORD m_dwBonus; // Do not store in database.
  165. DWORD m_dwXP; // Do not store in database. Can be calculated from m_dwStatus and m_dwIncreases.
  166. DWORD m_dwFreeXP; // Do not store in database. Can be calculated from m_dwStatus.
  167. inline cSkill& operator=( DWORD dw )
  168. {
  169. m_dwIncreases = dw;
  170. return *this;
  171. }
  172. inline cSkill& operator=( cAttribute& rhv )
  173. {
  174. m_dwIncreases = rhv.m_dwCurrent;
  175. return *this;
  176. }
  177. };
  178. struct cStats {
  179. DWORD m_dwLevel;
  180. cAttribute m_lpcAttributes[6];
  181. cVital m_lpcVitals[3];
  182. cSkill m_lpcSkills[40];
  183. };
  184. int calc_vec_to_deg(int vx, int vy);
  185. class cObject
  186. {
  187. friend class cDatabase;
  188. friend class cPortalDat;
  189. public:
  190. /**
  191. * A constructor.
  192. */
  193. cObject ( cLocation *pcLoc )
  194. {
  195. if ( pcLoc )
  196. SetLocation( pcLoc );
  197. m_bInventorySequence = -1;
  198. m_wPositionSequence = 0;
  199. m_wNumPortals = 0;
  200. m_wNumLogins = 0x3C;
  201. m_fEquipped = 0;
  202. m_fIsOwned = FALSE;
  203. m_fIsCasting = FALSE;
  204. m_wModelSeq = 0x0;
  205. m_bWearSeq = 0x0;
  206. m_wNumAnims = 0x0000;
  207. m_wCurAnim = 0x0000;
  208. m_wMeleeSequence = 0x0000;
  209. m_dwF7B0Sequence = 0x00000000;
  210. m_bStatSequence = 0x00;
  211. m_fDeadOrAlive = true;
  212. }
  213. /**
  214. * A constructor.
  215. */
  216. cObject( )
  217. {
  218. m_bInventorySequence = -1;
  219. m_wPositionSequence = 0;
  220. m_wNumLogins = 0x3C;
  221. m_fEquipped = 0;
  222. m_fIsOwned = FALSE;
  223. m_fIsCasting = FALSE;
  224. m_wNumAnims = 0x0000;
  225. m_wCurAnim = 0x0000;
  226. m_wMeleeSequence = 0x0000;
  227. m_dwF7B0Sequence = 0x00000000;
  228. m_bStatSequence = 0x00;
  229. m_fDeadOrAlive = true;
  230. }
  231. virtual ~cObject( ) {}
  232. void SetLocation( double dNS, double dEW );
  233. inline void SetLocation( cLocation& Loc )
  234. {
  235. m_Location.m_dwLandBlock = Loc.m_dwLandBlock;
  236. m_Location.m_flX = Loc.m_flX;
  237. m_Location.m_flY = Loc.m_flY;
  238. m_Location.m_flZ = Loc.m_flZ;
  239. m_Location.m_flA = Loc.m_flA;
  240. m_Location.m_flB = Loc.m_flB;
  241. m_Location.m_flC = Loc.m_flC;
  242. m_Location.m_flW = Loc.m_flW;
  243. }
  244. inline void SetLocation( cLocation *pcLoc )
  245. {
  246. m_Location.m_dwLandBlock = pcLoc->m_dwLandBlock;
  247. m_Location.m_flX = pcLoc->m_flX;
  248. m_Location.m_flY = pcLoc->m_flY;
  249. m_Location.m_flZ = pcLoc->m_flZ;
  250. m_Location.m_flA = pcLoc->m_flA;
  251. m_Location.m_flB = pcLoc->m_flB;
  252. m_Location.m_flC = pcLoc->m_flC;
  253. m_Location.m_flW = pcLoc->m_flW;
  254. }
  255. inline void SetLocation( DWORD dwLandBlock, float flX, float flY, float flZ, float flA, float flW )
  256. {
  257. m_Location.m_dwLandBlock = dwLandBlock;
  258. m_Location.m_flX = flX;
  259. m_Location.m_flY = flY;
  260. m_Location.m_flZ = flZ;
  261. m_Location.m_flA = flA;
  262. m_Location.m_flW = flW;
  263. }
  264. inline void SetSpawnLoc( cLocation *pcLoc )
  265. {
  266. m_SpawnLoc.m_dwLandBlock = pcLoc->m_dwLandBlock;
  267. m_SpawnLoc.m_flX = pcLoc->m_flX;
  268. m_SpawnLoc.m_flY = pcLoc->m_flY;
  269. m_SpawnLoc.m_flZ = pcLoc->m_flZ;
  270. m_SpawnLoc.m_flA = pcLoc->m_flA;
  271. m_SpawnLoc.m_flB = pcLoc->m_flB;
  272. m_SpawnLoc.m_flC = pcLoc->m_flC;
  273. m_SpawnLoc.m_flW = pcLoc->m_flW;
  274. }
  275. inline void SetSpawnLoc( cLocation& Loc )
  276. {
  277. m_SpawnLoc.m_dwLandBlock = Loc.m_dwLandBlock;
  278. m_SpawnLoc.m_flX = Loc.m_flX;
  279. m_SpawnLoc.m_flY = Loc.m_flY;
  280. m_SpawnLoc.m_flZ = Loc.m_flZ;
  281. m_SpawnLoc.m_flA = Loc.m_flA;
  282. m_SpawnLoc.m_flB = Loc.m_flB;
  283. m_SpawnLoc.m_flC = Loc.m_flC;
  284. m_SpawnLoc.m_flW = Loc.m_flW;
  285. }
  286. //Cube: No longer need this.
  287. //cItemModels *cfim;
  288. virtual cMessage LocationPacket ( );
  289. virtual cMessage CreatePacket ( ) = 0;
  290. virtual cMessage Animation ( WORD wAnim, float flPlaySpeed );
  291. virtual cMessage Animation ( WORD wAnim, float flPlaySpeed, BYTE bActivity );
  292. virtual void Assess ( cClient *pcAssesser ){}
  293. virtual void Action ( cClient *pcActioner ) = 0;
  294. virtual void Attack ( cClient *pcAttacker, float flDamageSlider, DWORD F7B0Sequence );
  295. virtual void SpellAttack ( cClient *pcAttacker, cObject *pcWarSpell, DWORD F7B0Sequence );
  296. virtual cMessage AdjustBar ( DWORD dwGUID, DWORD F7B0Sequence );
  297. // Remove the object
  298. static cMessage RemoveObj ( DWORD dwGUID );
  299. //Enters/exits combat stance
  300. virtual cMessage ChangeCombatMode( bool fMode );
  301. // Chooses a combat animation
  302. virtual cMessage CombatAnimation ( DWORD dwTarget, WORD wAttackAnim );
  303. // Calculates objects melee damage
  304. virtual DWORD CalculateDamage ( int strength, float flPower, float flResistance );
  305. // Turn to Face Target
  306. virtual cMessage TurnToTarget ( float flHeading, DWORD dwTargetGUID );
  307. virtual float GetRange ( DWORD dwTargetLandblock, float flTarX, float flTarY, float flTarZ);
  308. virtual float GetHeadingTarget( DWORD dwTargetLandblock, float flTarX, float flTarY, float flTarZ );
  309. virtual cMessage MoveToTarget ( cClient *pcWho );
  310. virtual cMessage MoveTarget ( cClient *pcWho );
  311. virtual cMessage ReturnToSpawn ( );
  312. virtual void ReSpawn ( cObject *pcObject );
  313. virtual cLocation CoordLoc ( float dNS, float dEW );
  314. cLocation EstimateLoc ( float flHeading, float flSpeed, float flDistToTarget,float flTime );
  315. virtual cMessage SetPosition ( );
  316. // virtual void Split ( cClient* who, DWORD item_guid, DWORD slot, DWORD value );
  317. virtual inline DWORD GetMonsterModelID( )
  318. {
  319. return m_dwMonsterModel;
  320. }
  321. virtual inline DWORD GetItemModelID()
  322. {
  323. return m_dwItemModelID;
  324. }
  325. // Returns the GUID of the object
  326. inline DWORD GetGUID()
  327. {
  328. return m_dwGUID;
  329. }
  330. inline DWORD SetGUID(cObject *pcObj, DWORD nGUID)
  331. {
  332. pcObj->m_dwGUID = nGUID;
  333. return pcObj->m_dwGUID;
  334. }
  335. // Returns Container ID
  336. inline DWORD GetContainer(DWORD dwGUID)
  337. {
  338. return m_dwContainer;
  339. }
  340. // Object name
  341. inline const char *Name()
  342. {
  343. return m_strName.c_str();
  344. }
  345. inline const char *TokenlessName()
  346. {
  347. const char *szName = m_strName.c_str();
  348. if ( *szName == '+' ) return szName + 1;
  349. else return szName;
  350. }
  351. inline void SetStatic( BOOL state )
  352. {
  353. m_fStatic = state;
  354. }
  355. inline BOOL IsStatic()
  356. {
  357. return m_fStatic;
  358. }
  359. /*
  360. Cubem0j0: Had to add this. Objects need a type. Before I added this when you used an object it
  361. looked for the landblock info. If it was not there (that item was in a container) then the program
  362. crashed.
  363. Object types:
  364. 2 = Stamina food
  365. */
  366. void SetType(int type)
  367. {
  368. item_type = type;
  369. }
  370. int GetType()
  371. {
  372. return item_type;
  373. }
  374. //Cubem0j0: Adding a way to set a state on an object..currently used in corpses
  375. void SetState(int state)
  376. {
  377. m_wState = state;
  378. }
  379. int GetState()
  380. {
  381. return m_wState;
  382. }
  383. cLocation m_Location;
  384. cLocation m_SpawnLoc;
  385. BYTE m_bInventorySequence;
  386. WORD m_wPositionSequence;
  387. WORD m_wNumLogins;
  388. WORD m_wNumPortals;
  389. int m_fEquipped;
  390. BOOL m_fIsOwned;
  391. BOOL m_fIsCasting;
  392. DWORD m_dwContainer;
  393. WORD m_wModelSeq;
  394. BYTE m_bWearSeq;
  395. WORD m_wNumEquips;
  396. WORD m_wState;
  397. WORD m_wNumAnims;
  398. DWORD m_dwDoorState;
  399. WORD m_wPortalMode;
  400. DWORD m_dwObjectFlags1;
  401. DWORD m_dwObjectFlags2;
  402. cLocation m_LSLoc;
  403. cLocation m_HRLoc;
  404. std::string m_strName;
  405. std::string m_strDescription;
  406. WORD m_wCurAnim;
  407. WORD m_wMeleeSequence;
  408. DWORD m_dwF7B0Sequence;
  409. DWORD m_dwConfirmSequence;
  410. BYTE m_bStatSequence;
  411. bool m_fCombatMode;
  412. BYTE m_bIdleAnim;
  413. cVelocity m_Velocity;
  414. DWORD m_dwReSpawn;
  415. DWORD m_dwDecay;
  416. DWORD m_dwChase;
  417. DWORD m_dwInfluence;
  418. DWORD m_dwExp_Value;
  419. bool m_fDeadOrAlive;
  420. DWORD m_dwSpellModel;
  421. DWORD m_dwSpellID;
  422. DWORD m_dwFlagCount;
  423. int item_type;
  424. WORD m_wUses;
  425. DWORD m_dwItemModelID;
  426. float m_fApproachDistance;
  427. // DWORD m_dwHouseType;
  428. DWORD m_dwHouseGUID;
  429. DWORD m_dwOwnerID;
  430. DWORD m_dwQuantity;
  431. //k109: Item specific stuff
  432. //Food
  433. DWORD m_dwVitalID;
  434. DWORD m_dwAmount;
  435. //Armor
  436. DWORD m_dwActivate_Req_SkillID;
  437. DWORD m_dwActivate_Req_Skill_Level;
  438. DWORD m_dwArmor_Level;
  439. float m_fProt_Slashing;
  440. float m_fProt_Piercing;
  441. float m_fProt_Bludgeon;
  442. float m_fProt_Fire;
  443. float m_fProt_Cold;
  444. float m_fProt_Acid;
  445. float m_fProt_Electric;
  446. //Pyreals
  447. DWORD m_dwValue;
  448. WORD m_wStack;
  449. WORD m_wStackLimit;
  450. /* Palettes are unique to each apparel item */
  451. //(Texture and model information is constant and populated to the item model)
  452. // Item palette vectors
  453. int m_intColor;
  454. BYTE m_bPaletteChange;
  455. DWORD m_wPaletteVector;
  456. sPaletteChange m_vectorPal[255];
  457. // Item clothing palette vectors
  458. BYTE m_bWearPaletteChange;
  459. DWORD m_wWearPaletteVector;
  460. sPaletteChange m_WearVectorPal[255];
  461. //the object's enchantment list
  462. std::list< cEnchantment * > m_lstEnchantments;
  463. protected:
  464. DWORD m_dwGUID;
  465. DWORD m_dwModel;
  466. WORD m_wIcon;
  467. BOOL m_fSelectable;
  468. float m_flScale;
  469. BOOL m_fStatic;
  470. DWORD m_dwMode;
  471. DWORD m_dwMonsterModel;
  472. };
  473. class cBiotic : public cObject
  474. {
  475. public:
  476. cBiotic ( cLocation *pcLoc )
  477. : cObject( pcLoc )
  478. {
  479. m_bInventorySequence = -1;
  480. m_wPositionSequence = 0;
  481. m_wNumPortals = 0;
  482. m_wNumLogins = 0x3C;
  483. m_fIsOwned = FALSE;
  484. }
  485. cBiotic( )
  486. {
  487. m_bInventorySequence = -1;
  488. m_wPositionSequence = 0;
  489. m_wNumPortals = 0;
  490. m_wNumLogins = 0x3C;
  491. }
  492. virtual ~cBiotic( ) {}
  493. virtual void Action( cClient *pcClient ) {}
  494. protected:
  495. cStats m_Stats;
  496. };
  497. #define NPCMODE_SINGLE 1
  498. #define NPCMODE_MULTI 2
  499. #define NPCMODE_RANDOM 3
  500. class cNPC : public cObject
  501. {
  502. friend class cClient;
  503. public:
  504. cNPC();
  505. /**
  506. * A constructor.
  507. *
  508. * Called whenever an NPC object is initialized.
  509. */
  510. cNPC(DWORD dwGUID, DWORD dwNPCModelID, char *szName, WORD wGender, cLocation *pcLoc = NULL, DWORD dwSellCategories = 0x00000000 );
  511. void Assess (cClient *pcAssesser );
  512. cMessage CreatePacket ( );
  513. void Action (cClient* who);
  514. //Cube: Give item, for quests, etc.
  515. void GiveItem (cClient *who, DWORD itemid, DWORD npcid);
  516. //Cube: Buy Item from Vendor
  517. void BuyItem (cClient *who, DWORD VendorID, DWORD ItemID);
  518. //Cube: Splitting out the Approach Vendor message into its own function
  519. void ApproachVendor (cClient *who);
  520. DWORD m_dwNPCModelID;
  521. //Cube: This is to add digit grouping to experience award messages. There is probably a better way of doing this :p
  522. /*
  523. char* c_exp_reward(DWORD exp_r)
  524. {
  525. //Set up
  526. char message[30];
  527. char comma[] = ",";
  528. itoa(exp_r,message,10);
  529. if (strlen(message) > 3 && strlen(message) < 6)
  530. {
  531. //copy a comma into the current string
  532. memcpy(message,comma,1);
  533. }
  534. if (strlen(message) > 6 && strlen(message) < 9)
  535. {
  536. memcpy(message,comma,1);
  537. memcpy(message,comma,1);
  538. }
  539. if (strlen(message) > 9)
  540. {
  541. memcpy(message,comma,1);
  542. memcpy(message,comma,1);
  543. memcpy(message,comma,1);
  544. }
  545. return message;
  546. }
  547. */
  548. virtual ~cNPC( ) {}
  549. void SetMode(DWORD mode)
  550. {
  551. m_dwMode = mode;
  552. }
  553. void SetModel(WORD wNPCModel)
  554. {
  555. m_wNPCModel = wNPCModel;
  556. }
  557. void SetNumMessages(int num)
  558. {
  559. iNumMessages = num;
  560. }
  561. int GetNumMessages()
  562. {
  563. return iNumMessages;
  564. }
  565. DWORD GetMode()
  566. {
  567. return m_dwMode;
  568. }
  569. //Cubem0j0: Is NPC a vendor?
  570. void SetIsVendor(int vend)
  571. {
  572. IsVendor = vend;
  573. }
  574. int GetIsVendor()
  575. {
  576. return IsVendor;
  577. }
  578. //Cubem0j0: Get/Set npc_id variable
  579. void Set_npc_id(int npcid)
  580. {
  581. npc_id = npcid;
  582. }
  583. int Get_npc_id()
  584. {
  585. return npc_id;
  586. }
  587. void SetString(std::string str,int index)
  588. {
  589. if(index<0||index>15)
  590. {
  591. return;
  592. }
  593. vsMessages[index] = str;
  594. }
  595. //Cubem0j0: Need a way to find the GUIDs of items in a vendors inventory
  596. // inline void SetVendorListID(DWORD ID)
  597. // {
  598. // vendor_item_ids.push_back(ID);
  599. // }
  600. //CubeM0j0: Inventory stuff...
  601. inline void AddInventory( cObject *pcObject )
  602. {
  603. m_NPC_lstInventory.push_back( pcObject );
  604. pcObject->m_fIsOwned = TRUE;
  605. pcObject->m_dwContainer = m_dwGUID;
  606. }
  607. inline void RemoveInventory( cObject *pcObject )
  608. {
  609. iterObject_lst itObject = std::find( m_NPC_lstInventory.begin( ), m_NPC_lstInventory.end( ), pcObject );
  610. if ( itObject != m_NPC_lstInventory.end( ) )
  611. m_NPC_lstInventory.erase( itObject );
  612. pcObject->m_fIsOwned = FALSE;
  613. pcObject->m_dwContainer = NULL;
  614. }
  615. inline cObject *FindInventory( DWORD dwGUID )
  616. {
  617. for ( iterObject_lst itObject = m_NPC_lstInventory.begin( ); itObject != m_NPC_lstInventory.end( ); ++itObject )
  618. {
  619. if ( dwGUID == (*itObject)->GetGUID( ) )
  620. return *itObject;
  621. }
  622. return NULL;
  623. }
  624. inline void DeleteFromInventory( cObject *pcObject )
  625. {
  626. iterObject_lst itObject = std::find( m_NPC_lstInventory.begin( ), m_NPC_lstInventory.end( ), pcObject );
  627. if ( itObject != m_NPC_lstInventory.end( ) )
  628. m_NPC_lstInventory.erase( itObject );
  629. }
  630. cObjStats m_NPCStats;
  631. DWORD m_qitem_id1;
  632. //k109: Added this to try and get the items in vendor inventory to ID.
  633. DWORD m_npc_target_id;
  634. //This may work better, an array for vendor item id's
  635. DWORD v_guids[255];
  636. std::list< cNPC * > npc_ids;
  637. private:
  638. int npc_id;
  639. int IsVendor;
  640. int iNumMessages;
  641. WORD m_wGender;
  642. std::string vsMessages[32];
  643. DWORD m_dwMode;
  644. WORD m_wNPCModel;
  645. DWORD m_dwSellCategories;
  646. //Cubem0j0: Add NPC Inventory...
  647. std::list< cObject * > m_NPC_lstInventory;
  648. };
  649. class cLifestone : public cObject
  650. {
  651. public:
  652. cLifestone();
  653. /**
  654. * A constructor.
  655. *
  656. * Called whenever a lifestone object is initialized.
  657. */
  658. cLifestone(WORD type, DWORD dwGUID, cLocation *pcLoc, char *szName, char *szDesc);
  659. virtual ~cLifestone() {}
  660. void Assess (cClient *pcAssesser );
  661. cMessage CreatePacket();
  662. void Action(cClient* who);
  663. void SetMode(DWORD mode)
  664. {
  665. m_dwMode = mode;
  666. }
  667. DWORD GetMode()
  668. {
  669. return m_dwMode;
  670. }
  671. void SetData(WORD wAnimConfig, WORD wSoundSet,WORD wModel,WORD wIcon, DWORD dwObject1, DWORD dwObject2)
  672. {
  673. m_wAnimConfig = wAnimConfig;
  674. m_wSoundSet = wSoundSet;
  675. m_wModel = wModel;
  676. m_wIcon = wIcon;
  677. m_dwObjectsFlag1 = dwObject1;
  678. m_dwObjectsFlag2 = dwObject2;
  679. }
  680. private:
  681. DWORD m_dwMode;
  682. DWORD m_dwType;
  683. WORD m_wModel;
  684. WORD m_wIcon;
  685. WORD m_wSoundSet;
  686. WORD m_wPortalMode;
  687. WORD m_wAnimConfig;
  688. DWORD m_dwObjectsFlag1;
  689. DWORD m_dwObjectsFlag2;
  690. };
  691. class cPortal : public cObject
  692. {
  693. public:
  694. cPortal ( );
  695. /**
  696. * A constructor.
  697. *
  698. * Called whenever a portal object is initialized.
  699. */
  700. cPortal ( DWORD dwGUID, DWORD dwColor, cLocation *Loc, cLocation *destLoc, char *szName, char *szDescription, DWORD dwLowerRestrict, DWORD dwHigherRestrict );
  701. //cPortal ( DWORD dwGUID, cLocation& Loc, DOUBLE dNS, DOUBLE dEW, char *szName, DWORD dwLowerRestrict, DWORD dwHigherRestrict );
  702. virtual ~cPortal ( ) {}
  703. void Assess ( cClient *pcAssesser );
  704. void Use ( cClient *pcUser );
  705. void Action ( cClient *who );
  706. cMessage CreatePacket( );
  707. inline void SetDestination( cLocation *pcLoc )
  708. {
  709. m_cDestination.m_dwLandBlock = pcLoc->m_dwLandBlock;
  710. m_cDestination.m_flX = pcLoc->m_flX;
  711. m_cDestination.m_flY = pcLoc->m_flY;
  712. m_cDestination.m_flZ = pcLoc->m_flZ;
  713. m_cDestination.m_flA = pcLoc->m_flA;
  714. m_cDestination.m_flB = pcLoc->m_flB;
  715. m_cDestination.m_flC = pcLoc->m_flC;
  716. m_cDestination.m_flW = pcLoc->m_flW;
  717. }
  718. private:
  719. cLocation m_cWorldLoc;
  720. cLocation m_cDestination;
  721. //DWORD m_dwLandblock;
  722. //float m_flX;
  723. //float m_flY;
  724. //float m_flZ;
  725. //float m_fHeading;
  726. DWORD m_dwLowerRestriction;
  727. DWORD m_dwHigherRestriction;
  728. DWORD m_dwType;
  729. WORD m_wModel;
  730. WORD m_wIcon;
  731. WORD m_wPortalMode;
  732. WORD m_wAnimConfig;
  733. DWORD m_dwObjectsFlag1;
  734. DWORD m_dwObjectsFlag2;
  735. };
  736. class cAbiotic : public cObject
  737. {
  738. public:
  739. cAbiotic( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwWeight, DWORD dwValue, BOOL fSelectable = TRUE, BOOL fEquippable = TRUE, BOOL fStackable = FALSE, BOOL fIsOwned = FALSE, DWORD dwContainer = 0 )
  740. {
  741. m_dwGUID = dwGUID;
  742. m_dwModel = dwModel;
  743. m_flScale = flScale;
  744. m_wIcon = dwIcon;
  745. m_strName = strName;
  746. m_strDescription = strDescription;
  747. m_fSelectable = fSelectable;
  748. m_dwWeight = dwWeight;
  749. m_dwValue = dwValue;
  750. m_fIsOwned = fIsOwned;
  751. m_dwContainer = dwContainer;
  752. m_fEquippable = fEquippable;
  753. m_fIsStackable = fStackable;
  754. m_fIsSolid = fSolid;
  755. m_fIsOwned = FALSE;
  756. m_wState = 0;
  757. m_dwDoorState = 0x0CL;
  758. m_bInventorySequence= -1;
  759. m_wPositionSequence = 0;
  760. m_wNumPortals = 0;
  761. m_wNumLogins = 0x3C;
  762. m_fEquipped = 0;
  763. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  764. }
  765. cAbiotic( ) {}
  766. virtual ~cAbiotic( ) {}
  767. cMessage CreatePacket ( );
  768. cMessage Animation ( WORD wAnim, float flPlaySpeed ) { return *((cMessage *)NULL); }
  769. void Assess ( cClient *pcAssesser );
  770. void Use ( cClient *pcAssesser ) {}
  771. void Action ( cClient *pcClient ) {}
  772. void SetContainer( DWORD dwGUID );
  773. protected:
  774. DWORD m_dwWeight;
  775. DWORD m_dwValue;
  776. BOOL m_fIsStackable;
  777. BOOL m_fEquippable;
  778. BOOL m_fIsSolid;
  779. std::string m_strDescription;
  780. };
  781. /************************************
  782. * Cubem0j0: ITEM CLASSES
  783. *
  784. * These classes define items.
  785. ************************************/
  786. /************************************
  787. * Cubem0j0: item class - Misc
  788. ************************************/
  789. class cMisc : public cObject
  790. {
  791. public:
  792. /**
  793. * A constructor.
  794. *
  795. * Called whenever a miscellaneous object is initialized in the world.
  796. */
  797. cMisc( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  798. {
  799. m_dwGUID = dwGUID;
  800. m_dwModel = dwModel;
  801. m_flScale = flScale;
  802. m_wIcon = dwIcon;
  803. m_strName = strName;
  804. m_strDescription = strDescription;
  805. m_bInventorySequence= -1;
  806. m_wPositionSequence = 0;
  807. m_wNumPortals = 0;
  808. m_wNumLogins = 0x3C;
  809. m_fEquipped = 0;
  810. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  811. }
  812. /**
  813. * A constructor.
  814. *
  815. * Called whenever a miscellaneous object is initialized in a container.
  816. */
  817. cMisc( DWORD dwGUID, DWORD Container, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  818. {
  819. m_dwGUID = dwGUID;
  820. m_dwModel = dwModel;
  821. m_flScale = flScale;
  822. m_wIcon = dwIcon;
  823. m_strName = strName;
  824. m_strDescription = strDescription;
  825. m_bInventorySequence= -1;
  826. m_wPositionSequence = 0;
  827. m_wNumPortals = 0;
  828. m_wNumLogins = 0x3C;
  829. m_fEquipped = 0;
  830. }
  831. cMisc( ) {}
  832. virtual ~cMisc( ) {}
  833. cMessage CreatePacket ( );
  834. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  835. void Assess ( cClient *pcAssesser );
  836. void Action ( cClient* who );
  837. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  838. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  839. DWORD m_dwItemModelID;
  840. protected:
  841. DWORD m_dwWeight;
  842. DWORD m_dwValue;
  843. BOOL m_fIsStackable;
  844. BOOL m_fEquippable;
  845. BOOL m_fIsSolid;
  846. std::string m_strDescription;
  847. };
  848. /************************************
  849. * Cubem0j0: item class - Food
  850. ************************************/
  851. class cFood : public cObject
  852. {
  853. public:
  854. /**
  855. * A constructor.
  856. *
  857. * Called whenever a food object is initialized in the world.
  858. */
  859. cFood( DWORD dwGUID, cLocation& Loc, DWORD dwModel, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wBurden, DWORD dwVitalID, DWORD dwAmount ) : m_dwItemModelID( dwModel )
  860. {
  861. m_dwGUID = dwGUID;
  862. m_dwModel = dwModel;
  863. m_wIcon = dwIcon;
  864. m_strName = strName;
  865. m_strDescription = strDescription;
  866. m_wBurden = wBurden;
  867. m_dwValue = dwValue;
  868. m_dwVitalID = dwVitalID;
  869. m_dwAmount = dwAmount;
  870. m_bInventorySequence= -1;
  871. m_wPositionSequence = 0;
  872. m_wNumPortals = 0;
  873. m_wNumLogins = 0x3C;
  874. m_fEquipped = 0;
  875. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  876. }
  877. /**
  878. * A constructor.
  879. *
  880. * Called whenever a food object is initialized in a container.
  881. */
  882. cFood( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wStack, WORD wBurden, DWORD dwVitalID, DWORD dwVitalAffect) : m_dwItemModelID( dwModel )
  883. {
  884. m_dwGUID = dwGUID;
  885. m_dwModel = dwModel;
  886. m_wIcon = dwIcon;
  887. m_strName = strName;
  888. m_strDescription = strDescription;
  889. m_wBurden = wBurden;
  890. m_dwValue = dwValue;
  891. m_dwVitalID = dwVitalID;
  892. m_wStack = wStack;
  893. m_dwContainer = dwContainer;
  894. m_dwVitalAffect = dwVitalAffect;
  895. m_bInventorySequence= -1;
  896. m_wPositionSequence = 0;
  897. m_wNumPortals = 0;
  898. m_wNumLogins = 0x3C;
  899. m_fEquipped = 0;
  900. }
  901. cFood( ) {}
  902. virtual ~cFood( ) {}
  903. cMessage CreatePacket ( );
  904. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  905. cMessage Animation ( WORD wAnim, float flPlaySpeed ) { return *((cMessage *)NULL); }
  906. void Assess ( cClient *pcAssesser );
  907. void Action ( cClient* who );
  908. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  909. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  910. DWORD m_dwItemModelID;
  911. protected:
  912. DWORD m_dwValue;
  913. WORD m_wBurden;
  914. DWORD m_dwVitalID;
  915. WORD m_wStack;
  916. DWORD m_dwVitalAffect;
  917. std::string m_strDescription;
  918. };
  919. /************************************
  920. * Cubem0j0: item class - Armor
  921. ************************************/
  922. class cArmor : public cObject
  923. {
  924. public:
  925. /**
  926. * A constructor.
  927. *
  928. * Called whenever an armor object is initialized in the world.
  929. */
  930. cArmor( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  931. {
  932. m_dwGUID = dwGUID;
  933. m_dwModel = dwModel;
  934. m_flScale = flScale;
  935. m_wIcon = dwIcon;
  936. m_strName = strName;
  937. m_strDescription = strDescription;
  938. // m_wWeight = wWeight;
  939. // m_dwValue = dwValue;
  940. m_bInventorySequence= -1;
  941. m_wPositionSequence = 0;
  942. m_wNumPortals = 0;
  943. m_wNumLogins = 0x3C;
  944. m_fEquipped = 0;
  945. m_bWearPaletteChange= 0;
  946. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  947. }
  948. /**
  949. * A constructor.
  950. *
  951. * Called whenever an armor object is initialized in a container.
  952. */
  953. cArmor( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wBurden, DWORD dwArmor_Level, float fProt_Slashing, float fProt_Piercing, float fProt_Bludgeon, float fProt_Fire, float fProt_Cold, float fProt_Acid, float fProt_Electric) : m_dwItemModelID( dwModel )
  954. //BOOL fSelectable = TRUE, BOOL fEquippable = FALSE, BOOL fStackable = TRUE, BOOL fIsOwned = TRUE
  955. {
  956. m_dwGUID = dwGUID;
  957. m_dwModel = dwModel;
  958. m_flScale = flScale;
  959. m_wIcon = dwIcon;
  960. m_strName = strName;
  961. m_strDescription = strDescription;
  962. // m_fSelectable = fSelectable;
  963. m_wBurden = wBurden;
  964. m_dwValue = dwValue;
  965. // m_fIsOwned = fIsOwned;
  966. m_dwContainer = dwContainer;
  967. // m_fEquippable = fEquippable;
  968. // m_fIsStackable = fStackable;
  969. m_fIsSolid = fSolid;
  970. m_fIsOwned = TRUE;
  971. m_dwArmor_Level = dwArmor_Level;
  972. m_fProt_Slashing = fProt_Slashing;
  973. m_fProt_Piercing = fProt_Piercing;
  974. m_fProt_Bludgeon = fProt_Bludgeon;
  975. m_fProt_Fire = fProt_Fire;
  976. m_fProt_Cold = fProt_Cold;
  977. m_fProt_Acid = fProt_Acid;
  978. m_fProt_Electric = fProt_Electric;
  979. m_bInventorySequence= -1;
  980. m_wPositionSequence = 0;
  981. m_wNumPortals = 0;
  982. m_wNumLogins = 0x3C;
  983. m_fEquipped = 0;
  984. m_bWearPaletteChange= 0;
  985. }
  986. cArmor( ) {}
  987. virtual ~cArmor( ) {}
  988. cMessage CreatePacket ( );
  989. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  990. void Assess ( cClient *pcAssesser );
  991. void Action ( cClient* who );
  992. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  993. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  994. inline DWORD GetSlashProt ( ) { return m_fProt_Slashing; }
  995. DWORD m_dwItemModelID;
  996. protected:
  997. DWORD m_dwValue;
  998. WORD m_wBurden;
  999. BOOL m_fIsStackable;
  1000. BOOL m_fEquippable;
  1001. BOOL m_fIsSolid;
  1002. DWORD m_dwActivate_Req_SkillID;
  1003. DWORD m_dwActivate_Req_Skill_Level;
  1004. DWORD m_dwArmor_Level;
  1005. float m_fProt_Slashing;
  1006. float m_fProt_Piercing;
  1007. float m_fProt_Bludgeon;
  1008. float m_fProt_Fire;
  1009. float m_fProt_Cold;
  1010. float m_fProt_Acid;
  1011. float m_fProt_Electric;
  1012. std::string m_strDescription;
  1013. };
  1014. /************************************
  1015. * Cubem0j0: item class - Scrolls
  1016. ************************************/
  1017. class cScrolls : public cObject
  1018. {
  1019. public:
  1020. /**
  1021. * A constructor.
  1022. *
  1023. * Called whenever a scroll object is initialized in the world.
  1024. */
  1025. cScrolls( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1026. {
  1027. m_dwGUID = dwGUID;
  1028. m_dwModel = dwModel;
  1029. m_flScale = flScale;
  1030. m_wIcon = dwIcon;
  1031. m_strName = strName;
  1032. m_strDescription = strDescription;
  1033. m_bInventorySequence= -1;
  1034. m_wPositionSequence = 0;
  1035. m_wNumPortals = 0;
  1036. m_wNumLogins = 0x3C;
  1037. m_fEquipped = 0;
  1038. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1039. }
  1040. /**
  1041. * A constructor.
  1042. *
  1043. * Called whenever a scroll object is initialized in a container.
  1044. */
  1045. cScrolls( DWORD dwGUID, DWORD Container, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1046. {
  1047. m_dwGUID = dwGUID;
  1048. m_dwModel = dwModel;
  1049. m_flScale = flScale;
  1050. m_wIcon = dwIcon;
  1051. m_strName = strName;
  1052. m_strDescription = strDescription;
  1053. m_bInventorySequence= -1;
  1054. m_wPositionSequence = 0;
  1055. m_wNumPortals = 0;
  1056. m_wNumLogins = 0x3C;
  1057. m_fEquipped = 0;
  1058. }
  1059. cScrolls( ) {}
  1060. virtual ~cScrolls( ) {}
  1061. cMessage CreatePacket ( );
  1062. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1063. void Assess ( cClient *pcAssesser );
  1064. void Action ( cClient* who );
  1065. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1066. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1067. DWORD m_dwItemModelID;
  1068. protected:
  1069. DWORD m_dwWeight;
  1070. DWORD m_dwValue;
  1071. BOOL m_fIsStackable;
  1072. BOOL m_fEquippable;
  1073. BOOL m_fIsSolid;
  1074. std::string m_strDescription;
  1075. };
  1076. /************************************
  1077. * Cubem0j0: item class - Healing Kits
  1078. ************************************/
  1079. class cHealingKits : public cObject
  1080. {
  1081. public:
  1082. /**
  1083. * A constructor.
  1084. *
  1085. * Called whenever a healing kit object is initialized.
  1086. */
  1087. cHealingKits( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight, WORD wUses, WORD wUseLimit) : m_dwItemModelID( dwModel )
  1088. {
  1089. m_dwGUID = dwGUID;
  1090. m_dwModel = dwModel;
  1091. m_flScale = flScale;
  1092. m_wIcon = dwIcon;
  1093. m_strName = strName;
  1094. m_strDescription = strDescription;
  1095. dwValue = m_dwValue;
  1096. wWeight = m_wWeight;
  1097. m_wUses = wUses;
  1098. m_wUseLimit = wUseLimit;
  1099. m_bInventorySequence= -1;
  1100. m_wPositionSequence = 0;
  1101. m_wNumPortals = 0;
  1102. m_wNumLogins = 0x3C;
  1103. m_fEquipped = 0;
  1104. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1105. }
  1106. cHealingKits( ) {}
  1107. virtual ~cHealingKits( ) {}
  1108. cMessage CreatePacket ( );
  1109. void Assess ( cClient *pcAssesser );
  1110. void Action ( cClient* who );
  1111. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1112. DWORD m_dwItemModelID;
  1113. protected:
  1114. WORD m_wWeight;
  1115. DWORD m_dwValue;
  1116. DWORD m_wUses;
  1117. DWORD m_wUseLimit;
  1118. BOOL m_fIsStackable;
  1119. BOOL m_fEquippable;
  1120. BOOL m_fIsSolid;
  1121. std::string m_strDescription;
  1122. };
  1123. /************************************
  1124. * Cubem0j0: item class - Gems
  1125. ************************************/
  1126. class cGems : public cObject
  1127. {
  1128. public:
  1129. /**
  1130. * A constructor.
  1131. *
  1132. * Called whenever a gem object is initialized in the world.
  1133. */
  1134. cGems( DWORD dwGUID, cLocation& Loc, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1135. {
  1136. m_dwGUID = dwGUID;
  1137. m_dwModel = dwModel;
  1138. m_wIcon = wIcon;
  1139. m_strName = strName;
  1140. m_strDescription = strDescription;
  1141. m_bInventorySequence= -1;
  1142. m_wPositionSequence = 0;
  1143. m_wNumPortals = 0;
  1144. m_wNumLogins = 0x3C;
  1145. m_fEquipped = 0;
  1146. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1147. }
  1148. /**
  1149. * A constructor.
  1150. *
  1151. * Called whenever a gem object is initialized in a container.
  1152. */
  1153. cGems( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight) : m_dwItemModelID( dwModel )
  1154. {
  1155. m_dwGUID = dwGUID;
  1156. m_dwModel = dwModel;
  1157. m_wIcon = wIcon;
  1158. m_strName = strName;
  1159. m_strDescription = strDescription;
  1160. m_dwValue = dwValue;
  1161. m_wWeight = wWeight;
  1162. m_bInventorySequence= -1;
  1163. m_wPositionSequence = 0;
  1164. m_wNumPortals = 0;
  1165. m_wNumLogins = 0x3C;
  1166. m_fEquipped = 0;
  1167. }
  1168. cGems( ) {}
  1169. virtual ~cGems( ) {}
  1170. cMessage CreatePacket ( );
  1171. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1172. void Assess ( cClient *pcAssesser );
  1173. void Action ( cClient* who );
  1174. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1175. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1176. DWORD m_dwItemModelID;
  1177. protected:
  1178. WORD m_wWeight;
  1179. DWORD m_dwValue;
  1180. BOOL m_fIsStackable;
  1181. BOOL m_fEquippable;
  1182. BOOL m_fIsSolid;
  1183. std::string m_strDescription;
  1184. };
  1185. /************************************
  1186. * Cubem0j0: item class - Books
  1187. ************************************/
  1188. class cBooks : public cObject
  1189. {
  1190. public:
  1191. /**
  1192. * A constructor.
  1193. *
  1194. * Called whenever a book object is initialized in the world.
  1195. */
  1196. cBooks( DWORD dwGUID, cLocation& Loc, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1197. {
  1198. m_dwGUID = dwGUID;
  1199. m_dwModel = dwModel;
  1200. m_wIcon = wIcon;
  1201. m_strName = strName;
  1202. m_strDescription = strDescription;
  1203. m_bInventorySequence= -1;
  1204. m_wPositionSequence = 0;
  1205. m_wNumPortals = 0;
  1206. m_wNumLogins = 0x3C;
  1207. m_fEquipped = 0;
  1208. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1209. }
  1210. /**
  1211. * A constructor.
  1212. *
  1213. * Called whenever a book object is initialized in a container.
  1214. */
  1215. cBooks( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wBurden) : m_dwItemModelID( dwModel )
  1216. /*
  1217. , DWORD ContentPages, DWORD UsedPages, DWORD TotalPages,
  1218. std::string strAuthor, std::string strTitle, std::string strComment, std::string strCommentAuthor, std::string strPage1, std::string strPage2, std::string strPage3, std::string strPage4, std::string strPage5,
  1219. std::string strPage6, std::string strPage7, std::string strPage8, std::string strPage9) : m_dwItemModelID( dwModel )
  1220. */
  1221. {
  1222. m_dwGUID = dwGUID;
  1223. m_dwModel = dwModel;
  1224. m_wIcon = wIcon;
  1225. m_strName = strName;
  1226. m_strDescription = strDescription;
  1227. m_wBurden = wBurden;
  1228. m_dwValue = dwValue;
  1229. m_bInventorySequence= -1;
  1230. m_wPositionSequence = 0;
  1231. m_wNumPortals = 0;
  1232. m_wNumLogins = 0x3C;
  1233. m_fEquipped = 0;
  1234. }
  1235. cBooks( ) {}
  1236. virtual ~cBooks( ) {}
  1237. cMessage CreatePacket ( );
  1238. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1239. void Assess ( cClient *pcAssesser );
  1240. void Action ( cClient* who );
  1241. void Read ( cClient* who, DWORD GUID, DWORD PageNumber );
  1242. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1243. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1244. DWORD m_dwItemModelID;
  1245. protected:
  1246. WORD m_wBurden;
  1247. DWORD m_dwValue;
  1248. BOOL m_fIsStackable;
  1249. BOOL m_fEquippable;
  1250. BOOL m_fIsSolid;
  1251. std::string m_strDescription;
  1252. };
  1253. /************************************
  1254. * Cubem0j0: item class - Manastones
  1255. ************************************/
  1256. class cManaStones : public cObject
  1257. {
  1258. public:
  1259. /**
  1260. * A constructor.
  1261. *
  1262. * Called whenever a mana stone object is initialized in the world.
  1263. */
  1264. cManaStones( DWORD dwGUID, cLocation& Loc, DWORD dwModel, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1265. {
  1266. m_dwGUID = dwGUID;
  1267. m_dwModel = dwModel;
  1268. m_wIcon = dwIcon;
  1269. m_strName = strName;
  1270. m_strDescription = strDescription;
  1271. m_bInventorySequence= -1;
  1272. m_wPositionSequence = 0;
  1273. m_wNumPortals = 0;
  1274. m_wNumLogins = 0x3C;
  1275. m_fEquipped = 0;
  1276. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1277. }
  1278. /**
  1279. * A constructor.
  1280. *
  1281. * Called whenever a mana stone object is initialized in a container.
  1282. */
  1283. cManaStones( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight) : m_dwItemModelID( dwModel )
  1284. {
  1285. m_dwGUID = dwGUID;
  1286. m_dwModel = dwModel;
  1287. m_wIcon = dwIcon;
  1288. m_strName = strName;
  1289. m_strDescription = strDescription;
  1290. m_wWeight = wWeight;
  1291. m_dwValue = dwValue;
  1292. m_dwContainer = dwContainer;
  1293. // m_bInventorySequence= -1;
  1294. m_wPositionSequence = 0;
  1295. m_wNumPortals = 0;
  1296. m_wNumLogins = 0x0;
  1297. m_fEquipped = 0;
  1298. }
  1299. cManaStones( ) {}
  1300. virtual ~cManaStones( ) {}
  1301. cMessage CreatePacket ( );
  1302. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1303. void Assess ( cClient *pcAssesser );
  1304. void Action ( cClient* who );
  1305. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1306. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1307. DWORD m_dwItemModelID;
  1308. protected:
  1309. WORD m_wWeight;
  1310. DWORD m_dwValue;
  1311. std::string m_strDescription;
  1312. };
  1313. /************************************
  1314. * Cubem0j0: item class - Lockpicks
  1315. ************************************/
  1316. class cLockpicks : public cObject
  1317. {
  1318. public:
  1319. /**
  1320. * A constructor.
  1321. *
  1322. * Called whenever a lockpick object is initialized in the world.
  1323. */
  1324. cLockpicks( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1325. {
  1326. m_dwGUID = dwGUID;
  1327. m_dwModel = dwModel;
  1328. m_flScale = flScale;
  1329. m_wIcon = dwIcon;
  1330. m_strName = strName;
  1331. m_strDescription = strDescription;
  1332. m_bInventorySequence= -1;
  1333. m_wPositionSequence = 0;
  1334. m_wNumPortals = 0;
  1335. m_wNumLogins = 0x3C;
  1336. m_fEquipped = 0;
  1337. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1338. }
  1339. /**
  1340. * A constructor.
  1341. *
  1342. * Called whenever a lockpick object is initialized in a container.
  1343. */
  1344. cLockpicks( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, WORD wUses, WORD wUseLimit) : m_dwItemModelID( dwModel )
  1345. {
  1346. m_dwGUID = dwGUID;
  1347. m_dwModel = dwModel;
  1348. m_flScale = flScale;
  1349. m_wIcon = dwIcon;
  1350. m_strName = strName;
  1351. m_strDescription = strDescription;
  1352. m_dwContainer = dwContainer;
  1353. m_wUses = wUses;
  1354. m_wUseLimit = wUseLimit;
  1355. m_bInventorySequence= -1;
  1356. m_wPositionSequence = 0;
  1357. m_wNumPortals = 0;
  1358. m_wNumLogins = 0x3C;
  1359. m_fEquipped = 0;
  1360. }
  1361. cLockpicks( ) {}
  1362. virtual ~cLockpicks( ) {}
  1363. cMessage CreatePacket ( );
  1364. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1365. void Assess ( cClient *pcAssesser );
  1366. void Action ( cClient* who );
  1367. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1368. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1369. DWORD m_dwItemModelID;
  1370. protected:
  1371. DWORD m_dwWeight;
  1372. DWORD m_dwValue;
  1373. BOOL m_fIsStackable;
  1374. BOOL m_fEquippable;
  1375. BOOL m_fIsSolid;
  1376. WORD m_wUses;
  1377. WORD m_wUseLimit;
  1378. std::string m_strDescription;
  1379. };
  1380. /************************************
  1381. * Cubem0j0: item class - TradeSkillMats
  1382. ************************************/
  1383. class cTradeSkillMats : public cObject
  1384. {
  1385. public:
  1386. /**
  1387. * A constructor.
  1388. *
  1389. * Called whenever a trade skill material object is initialized in the world.
  1390. */
  1391. cTradeSkillMats( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1392. {
  1393. m_dwGUID = dwGUID;
  1394. m_dwModel = dwModel;
  1395. m_flScale = flScale;
  1396. m_wIcon = dwIcon;
  1397. m_strName = strName;
  1398. m_strDescription = strDescription;
  1399. m_bInventorySequence= -1;
  1400. m_wPositionSequence = 0;
  1401. m_wNumPortals = 0;
  1402. m_wNumLogins = 0x3C;
  1403. m_fEquipped = 0;
  1404. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1405. }
  1406. /**
  1407. * A constructor.
  1408. *
  1409. * Called whenever a trade skill material object is initialized in a container.
  1410. */
  1411. cTradeSkillMats( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight, BOOL fSelectable = TRUE, BOOL fEquippable = FALSE, BOOL fStackable = TRUE, BOOL fIsOwned = TRUE ) : m_dwItemModelID( dwModel )
  1412. {
  1413. m_dwGUID = dwGUID;
  1414. m_dwModel = dwModel;
  1415. m_flScale = flScale;
  1416. m_wIcon = dwIcon;
  1417. m_strName = strName;
  1418. m_strDescription = strDescription;
  1419. m_fSelectable = fSelectable;
  1420. m_wWeight = wWeight;
  1421. m_dwValue = dwValue;
  1422. m_fIsOwned = fIsOwned;
  1423. m_dwContainer = dwContainer;
  1424. m_fEquippable = fEquippable;
  1425. m_fIsStackable = fStackable;
  1426. m_fIsSolid = fSolid;
  1427. m_fIsOwned = TRUE;
  1428. m_bInventorySequence= -1;
  1429. m_wPositionSequence = 0;
  1430. m_wNumPortals = 0;
  1431. m_wNumLogins = 0x3C;
  1432. m_fEquipped = 0;
  1433. }
  1434. cTradeSkillMats( ) {}
  1435. virtual ~cTradeSkillMats( ) {}
  1436. cMessage CreatePacket ( );
  1437. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1438. void Assess ( cClient *pcAssesser );
  1439. void Action ( cClient* who );
  1440. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1441. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1442. DWORD m_dwItemModelID;
  1443. protected:
  1444. WORD m_wWeight;
  1445. DWORD m_dwValue;
  1446. BOOL m_fIsStackable;
  1447. BOOL m_fEquippable;
  1448. BOOL m_fIsSolid;
  1449. std::string m_strDescription;
  1450. };
  1451. /************************************
  1452. * Cubem0j0: item class - Casting Items (Wands, Orbs, etc)
  1453. ************************************/
  1454. class cWands : public cObject
  1455. {
  1456. public:
  1457. /**
  1458. * A constructor.
  1459. *
  1460. * Called whenever a casting object is initialized in the world.
  1461. */
  1462. cWands( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1463. {
  1464. m_dwGUID = dwGUID;
  1465. m_dwModel = dwModel;
  1466. m_flScale = flScale;
  1467. m_wIcon = dwIcon;
  1468. m_strName = strName;
  1469. m_strDescription = strDescription;
  1470. m_bInventorySequence= -1;
  1471. m_wPositionSequence = 0;
  1472. m_wNumPortals = 0;
  1473. m_wNumLogins = 0x3C;
  1474. m_fEquipped = 0;
  1475. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1476. }
  1477. /**
  1478. * A constructor.
  1479. *
  1480. * Called whenever a casting object is initialized in a container.
  1481. */
  1482. cWands( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight, BOOL fSelectable = TRUE, BOOL fEquippable = FALSE, BOOL fStackable = TRUE, BOOL fIsOwned = TRUE ) : m_dwItemModelID( dwModel )
  1483. {
  1484. m_dwGUID = dwGUID;
  1485. m_dwModel = dwModel;
  1486. m_flScale = flScale;
  1487. m_wIcon = dwIcon;
  1488. m_strName = strName;
  1489. m_strDescription = strDescription;
  1490. m_fSelectable = fSelectable;
  1491. m_wWeight = wWeight;
  1492. m_dwValue = dwValue;
  1493. m_fIsOwned = fIsOwned;
  1494. m_dwContainer = dwContainer;
  1495. m_fEquippable = fEquippable;
  1496. m_fIsStackable = fStackable;
  1497. m_fIsSolid = fSolid;
  1498. m_fIsOwned = TRUE;
  1499. m_bInventorySequence= -1;
  1500. m_wPositionSequence = 0;
  1501. m_wNumPortals = 0;
  1502. m_wNumLogins = 0x3C;
  1503. m_fEquipped = 0;
  1504. }
  1505. cWands( ) {}
  1506. virtual ~cWands( ) {}
  1507. cMessage CreatePacket ( );
  1508. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1509. void Assess ( cClient *pcAssesser );
  1510. void Action ( cClient* who );
  1511. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1512. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1513. DWORD m_dwItemModelID;
  1514. protected:
  1515. WORD m_wWeight;
  1516. DWORD m_dwValue;
  1517. BOOL m_fIsStackable;
  1518. BOOL m_fEquippable;
  1519. BOOL m_fIsSolid;
  1520. std::string m_strDescription;
  1521. };
  1522. /************************************
  1523. * Cubem0j0: item class - Spell Components
  1524. ************************************/
  1525. class cSpellComps : public cObject
  1526. {
  1527. public:
  1528. /**
  1529. * A constructor.
  1530. *
  1531. * Called whenever a spell component object is initialized in the world.
  1532. */
  1533. cSpellComps( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1534. {
  1535. m_dwGUID = dwGUID;
  1536. m_dwModel = dwModel;
  1537. m_flScale = flScale;
  1538. m_wIcon = dwIcon;
  1539. m_strName = strName;
  1540. m_strDescription = strDescription;
  1541. m_bInventorySequence= -1;
  1542. m_wPositionSequence = 0;
  1543. m_wNumPortals = 0;
  1544. m_wNumLogins = 0x3C;
  1545. m_fEquipped = 0;
  1546. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1547. }
  1548. /**
  1549. * A constructor.
  1550. *
  1551. * Called whenever a spell component object is initialized in a container.
  1552. */
  1553. cSpellComps( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wStack, WORD wWeight ) : m_dwItemModelID( dwModel )
  1554. {
  1555. m_dwGUID = dwGUID;
  1556. m_dwModel = dwModel;
  1557. m_wIcon = dwIcon;
  1558. m_strName = strName;
  1559. m_strDescription = strDescription;
  1560. m_wWeight = wWeight;
  1561. m_dwValue = dwValue;
  1562. m_dwContainer = dwContainer;
  1563. m_wStack = wStack;
  1564. m_bInventorySequence= -1;
  1565. m_wPositionSequence = 0;
  1566. m_wNumPortals = 0;
  1567. m_wNumLogins = 0x3C;
  1568. m_fEquipped = 0;
  1569. }
  1570. cSpellComps( ) {}
  1571. virtual ~cSpellComps( ) {}
  1572. cMessage CreatePacket ( );
  1573. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1574. void Assess ( cClient *pcAssesser );
  1575. void Action ( cClient* who );
  1576. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1577. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1578. DWORD m_dwItemModelID;
  1579. protected:
  1580. WORD m_wWeight;
  1581. WORD m_wStack;
  1582. DWORD m_dwValue;
  1583. std::string m_strDescription;
  1584. };
  1585. /************************************
  1586. * Cubem0j0: item class - Plants
  1587. ************************************/
  1588. class cPlants : public cObject
  1589. {
  1590. public:
  1591. /**
  1592. * A constructor.
  1593. *
  1594. * Called whenever a plant object is initialized in the world.
  1595. */
  1596. cPlants( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1597. {
  1598. m_dwGUID = dwGUID;
  1599. m_dwModel = dwModel;
  1600. m_flScale = flScale;
  1601. m_wIcon = dwIcon;
  1602. m_strName = strName;
  1603. m_strDescription = strDescription;
  1604. m_bInventorySequence= -1;
  1605. m_wPositionSequence = 0;
  1606. m_wNumPortals = 0;
  1607. m_wNumLogins = 0x3C;
  1608. m_fEquipped = 0;
  1609. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1610. }
  1611. /**
  1612. * A constructor.
  1613. *
  1614. * Called whenever a plant object is initialized a container.
  1615. */
  1616. cPlants( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, DWORD wWeight ) : m_dwItemModelID( dwModel )
  1617. {
  1618. m_dwGUID = dwGUID;
  1619. m_dwModel = dwModel;
  1620. m_flScale = flScale;
  1621. m_wIcon = dwIcon;
  1622. m_strName = strName;
  1623. m_strDescription = strDescription;
  1624. m_wWeight = wWeight;
  1625. m_dwValue = dwValue;
  1626. m_dwContainer = dwContainer;
  1627. m_bInventorySequence= -1;
  1628. m_wPositionSequence = 0;
  1629. m_wNumPortals = 0;
  1630. m_wNumLogins = 0x3C;
  1631. m_fEquipped = 0;
  1632. }
  1633. cPlants( ) {}
  1634. virtual ~cPlants( ) {}
  1635. cMessage CreatePacket ( );
  1636. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1637. void Assess ( cClient *pcAssesser );
  1638. void Action ( cClient* who );
  1639. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1640. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1641. DWORD m_dwItemModelID;
  1642. protected:
  1643. WORD m_wWeight;
  1644. DWORD m_dwValue;
  1645. std::string m_strDescription;
  1646. };
  1647. /************************************
  1648. * Cubem0j0: item class - Ammunition
  1649. ************************************/
  1650. class cAmmo : public cObject
  1651. {
  1652. public:
  1653. /**
  1654. * A constructor.
  1655. *
  1656. * Called whenever an ammunition object is initialized in the world.
  1657. */
  1658. cAmmo( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1659. {
  1660. m_dwGUID = dwGUID;
  1661. m_dwModel = dwModel;
  1662. m_flScale = flScale;
  1663. m_wIcon = dwIcon;
  1664. m_strName = strName;
  1665. m_strDescription = strDescription;
  1666. m_bInventorySequence= -1;
  1667. m_wPositionSequence = 0;
  1668. m_wNumPortals = 0;
  1669. m_wNumLogins = 0x3C;
  1670. m_fEquipped = 0;
  1671. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1672. }
  1673. /**
  1674. * A constructor.
  1675. *
  1676. * Called whenever an ammunition object is initialized in a container.
  1677. */
  1678. cAmmo( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight, WORD wStack, WORD wStackLimit ) : m_dwItemModelID( dwModel )
  1679. {
  1680. m_dwGUID = dwGUID;
  1681. m_dwModel = dwModel;
  1682. m_wIcon = dwIcon;
  1683. m_strName = strName;
  1684. m_strDescription = strDescription;
  1685. m_wWeight = wWeight;
  1686. m_dwValue = dwValue;
  1687. m_dwContainer = dwContainer;
  1688. m_wStack = wStack;
  1689. m_wStackLimit = wStackLimit;
  1690. m_bInventorySequence= -1;
  1691. m_wPositionSequence = 0;
  1692. m_wNumPortals = 0;
  1693. m_wNumLogins = 0x3C;
  1694. m_fEquipped = 0;
  1695. }
  1696. cAmmo( ) {}
  1697. virtual ~cAmmo( ) {}
  1698. cMessage CreatePacket ( );
  1699. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1700. void Assess ( cClient *pcAssesser );
  1701. void Action ( cClient* who );
  1702. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1703. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1704. DWORD m_dwItemModelID;
  1705. protected:
  1706. WORD m_wWeight;
  1707. DWORD m_dwValue;
  1708. BOOL m_fIsStackable;
  1709. BOOL m_fEquippable;
  1710. BOOL m_fIsSolid;
  1711. WORD m_wStack;
  1712. WORD m_wStackLimit;
  1713. std::string m_strDescription;
  1714. };
  1715. /************************************
  1716. * Cubem0j0: item class - Weapon
  1717. ************************************/
  1718. class cWeapon : public cObject
  1719. {
  1720. public:
  1721. /**
  1722. * A constructor.
  1723. *
  1724. * Called whenever a weapon object is initialized in the world.
  1725. */
  1726. cWeapon( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription,
  1727. DWORD dwValue, WORD wWeight, BYTE bWieldType, DWORD dwIconHighlight, float fWorkmanship, DWORD dwMaterialType, DWORD dwWeaponDamage,
  1728. DWORD dwWeaponSpeed, DWORD dwWeaponSkill, DWORD dwDamageType, double dWeaponVariance, double dWeaponModifier, double dWeaponPower,
  1729. double dWeaponAttack) : m_dwItemModelID( dwModel )
  1730. {
  1731. m_dwGUID = dwGUID;
  1732. m_dwModel = dwModel;
  1733. m_flScale = flScale;
  1734. m_wIcon = dwIcon;
  1735. m_strName = strName;
  1736. m_strDescription = strDescription;
  1737. m_wWeight = wWeight;
  1738. m_dwValue = dwValue;
  1739. m_bWieldType = bWieldType;
  1740. m_wIconHighlight = dwIconHighlight;
  1741. m_fWorkmanShip = fWorkmanship;
  1742. m_dwMaterialType = dwMaterialType;
  1743. m_dwWeaponDamage = dwWeaponDamage;
  1744. m_dwWeaponSpeed = dwWeaponSpeed;
  1745. m_dwWeaponSkill = dwWeaponSkill;
  1746. m_dwDamageType = dwDamageType;
  1747. m_dWeaponVariance = dWeaponVariance;
  1748. m_dWeaponModifier = dWeaponModifier;
  1749. m_dWeaponPower = dWeaponPower;
  1750. m_dWeaponAttack = dWeaponAttack;
  1751. m_bInventorySequence= -1;
  1752. m_wPositionSequence = 0;
  1753. m_wNumPortals = 0;
  1754. m_wNumLogins = 0x3C;
  1755. m_fEquipped = 0;
  1756. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1757. }
  1758. /**
  1759. * A constructor.
  1760. *
  1761. * Called whenever a weapon object is initialized in a container.
  1762. */
  1763. cWeapon( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription,
  1764. DWORD dwValue, WORD wWeight, BYTE bWieldType, DWORD dwIconHighlight, float fWorkmanship, DWORD dwMaterialType, DWORD dwWeaponDamage,
  1765. DWORD dwWeaponSpeed, DWORD dwWeaponSkill, DWORD dwDamageType, double dWeaponVariance, double dWeaponModifier, double dWeaponPower,
  1766. double dWeaponAttack ) : m_dwItemModelID( dwModel )
  1767. {
  1768. m_dwGUID = dwGUID;
  1769. m_dwModel = dwModel;
  1770. m_flScale = flScale;
  1771. m_wIcon = dwIcon;
  1772. m_strName = strName;
  1773. m_strDescription = strDescription;
  1774. // m_fSelectable = fSelectable;
  1775. m_wWeight = wWeight;
  1776. m_dwValue = dwValue;
  1777. m_bWieldType = bWieldType;
  1778. m_wIconHighlight = dwIconHighlight;
  1779. m_fWorkmanShip = fWorkmanship;
  1780. m_dwMaterialType = dwMaterialType;
  1781. m_dwWeaponDamage = dwWeaponDamage;
  1782. m_dwWeaponSpeed = dwWeaponSpeed;
  1783. m_dwWeaponSkill = dwWeaponSkill;
  1784. m_dwDamageType = dwDamageType;
  1785. m_dWeaponVariance = dWeaponVariance;
  1786. m_dWeaponModifier = dWeaponModifier;
  1787. m_dWeaponPower = dWeaponPower;
  1788. m_dWeaponAttack = dWeaponAttack;
  1789. // m_fIsOwned = fIsOwned;
  1790. // m_dwContainer = dwContainer;
  1791. // m_fEquippable = fEquippable;
  1792. // m_fIsStackable = fStackable;
  1793. // m_fIsSolid = fSolid;
  1794. // m_fIsOwned = TRUE;
  1795. m_bInventorySequence= -1;
  1796. m_wPositionSequence = 0;
  1797. m_wNumPortals = 0;
  1798. m_wNumLogins = 0x3C;
  1799. m_fEquipped = 0;
  1800. }
  1801. cWeapon( ) {}
  1802. virtual ~cWeapon( ) {}
  1803. cMessage CreatePacket ( );
  1804. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1805. void Assess ( cClient *pcAssesser );
  1806. void Action ( cClient* who );
  1807. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1808. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1809. inline DWORD GetItemValue ( ) { return m_dwValue; }
  1810. int GetIsUAWeapon()
  1811. {
  1812. return isUAWeapon;
  1813. }
  1814. DWORD m_dwItemModelID;
  1815. BYTE m_bWieldType;
  1816. int isUAWeapon;
  1817. DWORD m_dwDamageType;
  1818. protected:
  1819. WORD m_wWeight;
  1820. DWORD m_dwValue;
  1821. DWORD m_wIconHighlight;
  1822. float m_fWorkmanShip;
  1823. DWORD m_dwMaterialType;
  1824. DWORD m_dwWeaponDamage;
  1825. DWORD m_dwWeaponSpeed;
  1826. DWORD m_dwWeaponSkill;
  1827. double m_dWeaponVariance;
  1828. double m_dWeaponModifier;
  1829. double m_dWeaponPower;
  1830. double m_dWeaponAttack;
  1831. BOOL m_fIsStackable;
  1832. BOOL m_fEquippable;
  1833. BOOL m_fIsSolid;
  1834. std::string m_strDescription;
  1835. };
  1836. /************************************
  1837. * Cubem0j0: item class - Salvage
  1838. ************************************/
  1839. class cSalvage : public cObject
  1840. {
  1841. public:
  1842. /**
  1843. * A constructor.
  1844. *
  1845. * Called whenever a salvage object is initialized in the world.
  1846. */
  1847. cSalvage( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  1848. {
  1849. m_dwGUID = dwGUID;
  1850. m_dwModel = dwModel;
  1851. m_flScale = flScale;
  1852. m_wIcon = dwIcon;
  1853. m_strName = strName;
  1854. m_strDescription = strDescription;
  1855. m_bInventorySequence= -1;
  1856. m_wPositionSequence = 0;
  1857. m_wNumPortals = 0;
  1858. m_wNumLogins = 0x3C;
  1859. m_fEquipped = 0;
  1860. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1861. }
  1862. /**
  1863. * A constructor.
  1864. *
  1865. * Called whenever a salvage object is initialized in a container.
  1866. */
  1867. cSalvage( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight) : m_dwItemModelID( dwModel )
  1868. {
  1869. m_dwGUID = dwGUID;
  1870. m_dwModel = dwModel;
  1871. m_flScale = flScale;
  1872. m_wIcon = dwIcon;
  1873. m_strName = strName;
  1874. m_strDescription = strDescription;
  1875. m_wWeight = wWeight;
  1876. m_dwValue = dwValue;
  1877. m_bInventorySequence= -1;
  1878. m_wPositionSequence = 0;
  1879. m_wNumPortals = 0;
  1880. m_wNumLogins = 0x3C;
  1881. m_fEquipped = 0;
  1882. }
  1883. cSalvage( ) {}
  1884. virtual ~cSalvage( ) {}
  1885. cMessage CreatePacket ( );
  1886. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1887. void Assess ( cClient *pcAssesser );
  1888. void Action ( cClient* who );
  1889. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1890. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1891. DWORD m_dwItemModelID;
  1892. protected:
  1893. WORD m_wWeight;
  1894. DWORD m_dwValue;
  1895. BOOL m_fIsStackable;
  1896. BOOL m_fEquippable;
  1897. BOOL m_fIsSolid;
  1898. std::string m_strDescription;
  1899. };
  1900. /************************************
  1901. * Cubem0j0: item class - Pyreals
  1902. ************************************/
  1903. class cPyreals : public cObject
  1904. {
  1905. public:
  1906. /**
  1907. * A constructor.
  1908. *
  1909. * Called whenever a pyreal object is initialized in the world.
  1910. */
  1911. cPyreals( DWORD dwGUID, cLocation& Loc, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wStack, WORD wStackLimit) : m_dwItemModelID( dwModel )
  1912. {
  1913. m_dwGUID = dwGUID;
  1914. m_dwModel = dwModel;
  1915. m_wIcon = wIcon;
  1916. m_strName = strName;
  1917. m_strDescription = strDescription;
  1918. m_dwValue = dwValue;
  1919. m_wStack = wStack;
  1920. m_wStackLimit = wStackLimit;
  1921. m_bInventorySequence= -1;
  1922. m_wPositionSequence = 0;
  1923. m_wNumPortals = 0;
  1924. m_wNumLogins = 0x3C;
  1925. m_fEquipped = 0;
  1926. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  1927. }
  1928. /**
  1929. * A constructor.
  1930. *
  1931. * Called whenever a pyreal object is initialized in a container.
  1932. */
  1933. cPyreals( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wStack, WORD wStackLimit) : m_dwItemModelID( dwModel )
  1934. {
  1935. m_dwGUID = dwGUID;
  1936. m_dwModel = dwModel;
  1937. m_wIcon = wIcon;
  1938. m_strName = strName;
  1939. m_strDescription = strDescription;
  1940. m_dwValue = dwValue;
  1941. m_wStack = wStack;
  1942. m_wStackLimit = wStackLimit;
  1943. m_bInventorySequence= -1;
  1944. m_wPositionSequence = 0;
  1945. m_wNumPortals = 0;
  1946. m_wNumLogins = 0x3C;
  1947. m_fEquipped = 0;
  1948. }
  1949. cPyreals( ) {}
  1950. virtual ~cPyreals( ) {}
  1951. cMessage CreatePacket ( );
  1952. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  1953. void Assess ( cClient *pcAssesser );
  1954. void Action ( cClient* who );
  1955. void Stack ( cClient* who, DWORD item1, DWORD item2, DWORD amount);
  1956. void Split ( cClient* who, DWORD item_guid, DWORD slot, DWORD value );
  1957. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  1958. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  1959. DWORD m_dwItemModelID;
  1960. WORD GetStack()
  1961. {
  1962. return m_wStack;
  1963. }
  1964. WORD SetStack(WORD amount)
  1965. {
  1966. m_wStack = amount;
  1967. }
  1968. protected:
  1969. WORD m_wStack;
  1970. WORD m_wStackLimit;
  1971. DWORD m_dwWeight;
  1972. DWORD m_dwValue;
  1973. BOOL m_fIsStackable;
  1974. BOOL m_fEquippable;
  1975. BOOL m_fIsSolid;
  1976. std::string m_strDescription;
  1977. };
  1978. /************************************
  1979. * Cubem0j0: item class - Trade Notes
  1980. ************************************/
  1981. class cTradeNotes : public cObject
  1982. {
  1983. public:
  1984. /**
  1985. * A constructor.
  1986. *
  1987. * Called whenever a trade note object is initialized in the world.
  1988. */
  1989. cTradeNotes( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, WORD wIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight) : m_dwItemModelID( dwModel )
  1990. {
  1991. m_dwGUID = dwGUID;
  1992. m_dwModel = dwModel;
  1993. m_flScale = flScale;
  1994. m_wIcon = wIcon;
  1995. m_strName = strName;
  1996. m_strDescription = strDescription;
  1997. m_wWeight = wWeight;
  1998. m_dwValue = dwValue;
  1999. m_bInventorySequence= -1;
  2000. m_wPositionSequence = 0;
  2001. m_wNumPortals = 0;
  2002. m_wNumLogins = 0x3C;
  2003. m_fEquipped = 0;
  2004. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  2005. }
  2006. /**
  2007. * A constructor.
  2008. *
  2009. * Called whenever a trade note object is initialized in a container.
  2010. */
  2011. cTradeNotes( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight) : m_dwItemModelID( dwModel )
  2012. {
  2013. m_dwGUID = dwGUID;
  2014. m_dwModel = dwModel;
  2015. m_flScale = flScale;
  2016. m_wIcon = dwIcon;
  2017. m_strName = strName;
  2018. m_strDescription = strDescription;
  2019. m_wWeight = wWeight;
  2020. m_dwValue = dwValue;
  2021. m_bInventorySequence= -1;
  2022. m_wPositionSequence = 0;
  2023. m_wNumPortals = 0;
  2024. m_wNumLogins = 0x3C;
  2025. m_fEquipped = 0;
  2026. }
  2027. cTradeNotes( ) {}
  2028. virtual ~cTradeNotes( ) {}
  2029. cMessage CreatePacket ( );
  2030. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  2031. void Assess ( cClient *pcAssesser );
  2032. void Action ( cClient* who );
  2033. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  2034. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  2035. DWORD m_dwItemModelID;
  2036. protected:
  2037. WORD m_wWeight;
  2038. DWORD m_dwValue;
  2039. BOOL m_fIsStackable;
  2040. BOOL m_fEquippable;
  2041. BOOL m_fIsSolid;
  2042. std::string m_strDescription;
  2043. };
  2044. /************************************
  2045. * Cubem0j0: item class - Jewelry
  2046. ************************************/
  2047. class cJewelry : public cObject
  2048. {
  2049. public:
  2050. /**
  2051. * A constructor.
  2052. *
  2053. * Called whenever a jewelry object is initialized in the world.
  2054. */
  2055. cJewelry( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  2056. {
  2057. m_dwGUID = dwGUID;
  2058. m_dwModel = dwModel;
  2059. m_flScale = flScale;
  2060. m_wIcon = dwIcon;
  2061. m_strName = strName;
  2062. m_strDescription = strDescription;
  2063. m_bInventorySequence= -1;
  2064. m_wPositionSequence = 0;
  2065. m_wNumPortals = 0;
  2066. m_wNumLogins = 0x3C;
  2067. m_fEquipped = 0;
  2068. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  2069. }
  2070. /**
  2071. * A constructor.
  2072. *
  2073. * Called whenever a jewelry object is initialized in a container.
  2074. */
  2075. cJewelry( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight) : m_dwItemModelID( dwModel )
  2076. {
  2077. m_dwGUID = dwGUID;
  2078. m_dwModel = dwModel;
  2079. m_flScale = flScale;
  2080. m_wIcon = dwIcon;
  2081. m_strName = strName;
  2082. m_strDescription = strDescription;
  2083. m_wWeight = wWeight;
  2084. m_dwValue = dwValue;
  2085. m_bInventorySequence= -1;
  2086. m_wPositionSequence = 0;
  2087. m_wNumPortals = 0;
  2088. m_wNumLogins = 0x3C;
  2089. m_fEquipped = 0;
  2090. }
  2091. cJewelry( ) {}
  2092. virtual ~cJewelry( ) {}
  2093. cMessage CreatePacket ( );
  2094. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  2095. void Assess ( cClient *pcAssesser );
  2096. void Action ( cClient* who );
  2097. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  2098. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  2099. DWORD m_dwItemModelID;
  2100. protected:
  2101. WORD m_wWeight;
  2102. DWORD m_dwValue;
  2103. BOOL m_fIsStackable;
  2104. BOOL m_fEquippable;
  2105. BOOL m_fIsSolid;
  2106. std::string m_strDescription;
  2107. };
  2108. /************************************
  2109. * Cubem0j0: item class - Foci
  2110. ************************************/
  2111. class cFoci : public cObject
  2112. {
  2113. public:
  2114. /**
  2115. * A constructor.
  2116. *
  2117. * Called whenever a foci object is initialized in the world.
  2118. */
  2119. cFoci( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  2120. {
  2121. m_dwGUID = dwGUID;
  2122. m_dwModel = dwModel;
  2123. m_flScale = flScale;
  2124. m_wIcon = dwIcon;
  2125. m_strName = strName;
  2126. m_strDescription = strDescription;
  2127. // m_wWeight = wWeight;
  2128. // m_dwValue = dwValue;
  2129. m_bInventorySequence= -1;
  2130. m_wPositionSequence = 0;
  2131. m_wNumPortals = 0;
  2132. m_wNumLogins = 0x3C;
  2133. m_fEquipped = 0;
  2134. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  2135. }
  2136. /**
  2137. * A constructor.
  2138. *
  2139. * Called whenever a foci object is initialized in a container.
  2140. */
  2141. cFoci( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight, BOOL fSelectable = TRUE, BOOL fEquippable = FALSE, BOOL fStackable = TRUE, BOOL fIsOwned = TRUE ) : m_dwItemModelID( dwModel )
  2142. {
  2143. m_dwGUID = dwGUID;
  2144. m_dwModel = dwModel;
  2145. m_flScale = flScale;
  2146. m_wIcon = dwIcon;
  2147. m_strName = strName;
  2148. m_strDescription = strDescription;
  2149. m_fSelectable = fSelectable;
  2150. m_wWeight = wWeight;
  2151. m_dwValue = dwValue;
  2152. m_fIsOwned = fIsOwned;
  2153. m_dwContainer = dwContainer;
  2154. m_fEquippable = fEquippable;
  2155. m_fIsStackable = fStackable;
  2156. m_fIsSolid = fSolid;
  2157. m_fIsOwned = TRUE;
  2158. m_bInventorySequence= -1;
  2159. m_wPositionSequence = 0;
  2160. m_wNumPortals = 0;
  2161. m_wNumLogins = 0x3C;
  2162. m_fEquipped = 0;
  2163. }
  2164. cFoci( ) {}
  2165. virtual ~cFoci( ) {}
  2166. cMessage CreatePacket ( );
  2167. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  2168. void Assess ( cClient *pcAssesser );
  2169. void Action ( cClient* who );
  2170. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  2171. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  2172. DWORD m_dwItemModelID;
  2173. protected:
  2174. WORD m_wWeight;
  2175. DWORD m_dwValue;
  2176. BOOL m_fIsStackable;
  2177. BOOL m_fEquippable;
  2178. BOOL m_fIsSolid;
  2179. std::string m_strDescription;
  2180. };
  2181. /************************************
  2182. * Cubem0j0: item class - Packs
  2183. ************************************/
  2184. class cPack : public cObject
  2185. {
  2186. public:
  2187. /**
  2188. * A constructor.
  2189. *
  2190. * Called whenever a pack object is initialized in the world.
  2191. */
  2192. cPack( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  2193. {
  2194. m_dwGUID = dwGUID;
  2195. m_dwModel = dwModel;
  2196. m_flScale = flScale;
  2197. m_wIcon = dwIcon;
  2198. m_strName = strName;
  2199. m_strDescription = strDescription;
  2200. // m_wWeight = wWeight;
  2201. // m_dwValue = dwValue;
  2202. m_bInventorySequence= -1;
  2203. m_wPositionSequence = 0;
  2204. m_wNumPortals = 0;
  2205. m_wNumLogins = 0x3C;
  2206. m_fEquipped = 0;
  2207. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  2208. }
  2209. /**
  2210. * A constructor.
  2211. *
  2212. * Called whenever a pack object is initialized in a container.
  2213. */
  2214. cPack( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight, BOOL fSelectable = TRUE, BOOL fEquippable = FALSE, BOOL fStackable = TRUE, BOOL fIsOwned = TRUE ) : m_dwItemModelID( dwModel )
  2215. {
  2216. m_dwGUID = dwGUID;
  2217. m_dwModel = dwModel;
  2218. m_flScale = flScale;
  2219. m_wIcon = dwIcon;
  2220. m_strName = strName;
  2221. m_strDescription = strDescription;
  2222. m_fSelectable = fSelectable;
  2223. m_wWeight = wWeight;
  2224. m_dwValue = dwValue;
  2225. m_fIsOwned = fIsOwned;
  2226. m_dwContainer = dwContainer;
  2227. m_fEquippable = fEquippable;
  2228. m_fIsStackable = fStackable;
  2229. m_fIsSolid = fSolid;
  2230. m_fIsOwned = TRUE;
  2231. m_bInventorySequence= -1;
  2232. m_wPositionSequence = 0;
  2233. m_wNumPortals = 0;
  2234. m_wNumLogins = 0x3C;
  2235. m_fEquipped = 0;
  2236. }
  2237. cPack( ) {}
  2238. virtual ~cPack( ) {}
  2239. cMessage CreatePacket ( );
  2240. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  2241. void Assess ( cClient *pcAssesser );
  2242. void Action ( cClient* who );
  2243. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  2244. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  2245. DWORD m_dwItemModelID;
  2246. protected:
  2247. WORD m_wWeight;
  2248. DWORD m_dwValue;
  2249. BOOL m_fIsStackable;
  2250. BOOL m_fEquippable;
  2251. BOOL m_fIsSolid;
  2252. std::string m_strDescription;
  2253. };
  2254. /************************************
  2255. * Cubem0j0: item class - Clothes
  2256. ************************************/
  2257. class cClothes : public cObject
  2258. {
  2259. public:
  2260. /**
  2261. * A constructor.
  2262. *
  2263. * Called whenever a clothing object is initialized in the world.
  2264. */
  2265. cClothes( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription) : m_dwItemModelID( dwModel )
  2266. {
  2267. m_dwGUID = dwGUID;
  2268. m_dwModel = dwModel;
  2269. m_flScale = flScale;
  2270. m_wIcon = dwIcon;
  2271. m_strName = strName;
  2272. m_strDescription = strDescription;
  2273. // m_wWeight = wWeight;
  2274. // m_dwValue = dwValue;
  2275. m_bInventorySequence= -1;
  2276. m_wPositionSequence = 0;
  2277. m_wNumPortals = 0;
  2278. m_wNumLogins = 0x3C;
  2279. m_fEquipped = 0;
  2280. m_bWearPaletteChange= 0;
  2281. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  2282. }
  2283. /**
  2284. * A constructor.
  2285. *
  2286. * Called whenever a clothing object is initialized in a container.
  2287. */
  2288. cClothes( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wWeight, BOOL fSelectable = TRUE, BOOL fEquippable = FALSE, BOOL fStackable = TRUE, BOOL fIsOwned = TRUE ) : m_dwItemModelID( dwModel )
  2289. {
  2290. m_dwGUID = dwGUID;
  2291. m_dwModel = dwModel;
  2292. m_flScale = flScale;
  2293. m_wIcon = dwIcon;
  2294. m_strName = strName;
  2295. m_strDescription = strDescription;
  2296. m_fSelectable = fSelectable;
  2297. m_wWeight = wWeight;
  2298. m_dwValue = dwValue;
  2299. m_fIsOwned = fIsOwned;
  2300. m_dwContainer = dwContainer;
  2301. m_fEquippable = fEquippable;
  2302. m_fIsStackable = fStackable;
  2303. m_fIsSolid = fSolid;
  2304. m_fIsOwned = TRUE;
  2305. // m_dwArmorLevel = dwArmor_Level;
  2306. // m_fProt_Slashing = fProt_Slashing;
  2307. // m_fProt_Piercing = fProt_Piercing;
  2308. // m_fProt_Bludgeon = fProt_Bludgeon;
  2309. // m_fProt_Fire = fProt_Fire;
  2310. // m_fProt_Cold = fProt_Cold;
  2311. // m_fProt_Acid = fProt_Acid;
  2312. // m_fProt_Electric = fProt_Electric;
  2313. m_bInventorySequence= -1;
  2314. m_wPositionSequence = 0;
  2315. m_wNumPortals = 0;
  2316. m_wNumLogins = 0x3C;
  2317. m_fEquipped = 0;
  2318. m_bWearPaletteChange= 0;
  2319. }
  2320. cClothes( ) {}
  2321. virtual ~cClothes( ) {}
  2322. cMessage CreatePacket ( );
  2323. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  2324. void Assess ( cClient *pcAssesser );
  2325. void Action ( cClient* who );
  2326. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  2327. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  2328. DWORD m_dwItemModelID;
  2329. protected:
  2330. WORD m_wWeight;
  2331. DWORD m_dwValue;
  2332. BOOL m_fIsStackable;
  2333. BOOL m_fEquippable;
  2334. BOOL m_fIsSolid;
  2335. DWORD m_dwActivate_Req_SkillID;
  2336. DWORD m_dwActivate_Req_Skill_Level;
  2337. DWORD m_dwArmor_Level;
  2338. float m_fProt_Slashing;
  2339. float m_fProt_Piercing;
  2340. float m_fProt_Bludgeon;
  2341. float m_fProt_Fire;
  2342. float m_fProt_Cold;
  2343. float m_fProt_Acid;
  2344. float m_fProt_Electric;
  2345. std::string m_strDescription;
  2346. };
  2347. /************************************
  2348. * Cubem0j0: item class - Shields
  2349. ************************************/
  2350. class cShield : public cObject
  2351. {
  2352. public:
  2353. /**
  2354. * A constructor.
  2355. *
  2356. * Called whenever a shield object is initialized the world.
  2357. */
  2358. cShield( DWORD dwGUID, cLocation& Loc, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wBurden, DWORD ArmorLevel) : m_dwItemModelID( dwModel )
  2359. {
  2360. m_dwGUID = dwGUID;
  2361. m_dwModel = dwModel;
  2362. m_wIcon = wIcon;
  2363. m_strName = strName;
  2364. m_strDescription = strDescription;
  2365. m_wBurden = wBurden;
  2366. m_dwValue = dwValue;
  2367. m_dwArmorLevel = ArmorLevel;
  2368. m_bInventorySequence= -1;
  2369. m_wPositionSequence = 0;
  2370. m_wNumPortals = 0;
  2371. m_wNumLogins = 0x3C;
  2372. m_fEquipped = 0;
  2373. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  2374. }
  2375. /**
  2376. * A constructor.
  2377. *
  2378. * Called whenever a shield object is initialized in a container.
  2379. */
  2380. cShield( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, WORD wIcon, std::string strName, std::string strDescription, DWORD dwValue, WORD wBurden, DWORD ArmorLevel) : m_dwItemModelID( dwModel )
  2381. {
  2382. m_dwGUID = dwGUID;
  2383. m_dwModel = dwModel;
  2384. m_wIcon = wIcon;
  2385. m_strName = strName;
  2386. m_strDescription = strDescription;
  2387. m_wBurden = wBurden;
  2388. m_dwValue = dwValue;
  2389. m_dwContainer = dwContainer;
  2390. m_dwArmorLevel = ArmorLevel;
  2391. m_bInventorySequence= -1;
  2392. m_wPositionSequence = 0;
  2393. m_wNumPortals = 0;
  2394. m_wNumLogins = 0x3C;
  2395. m_fEquipped = 0;
  2396. }
  2397. cShield( ) {}
  2398. virtual ~cShield( ) {}
  2399. cMessage CreatePacket ( );
  2400. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  2401. void Assess ( cClient *pcAssesser );
  2402. void Action ( cClient* who );
  2403. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  2404. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  2405. DWORD m_dwItemModelID;
  2406. DWORD m_dwArmorLevel;
  2407. protected:
  2408. WORD m_wBurden;
  2409. DWORD m_dwValue;
  2410. BOOL m_fIsStackable;
  2411. BOOL m_fEquippable;
  2412. BOOL m_fIsSolid;
  2413. std::string m_strDescription;
  2414. };
  2415. /************************************
  2416. * Cubem0j0: Container Classes
  2417. *
  2418. * These classes spawn items in containers
  2419. * I needed these for healing kits, etc.
  2420. * Anything that uses the 0x0035 as its use
  2421. * message.
  2422. ************************************/
  2423. /************************************
  2424. * Cubem0j0: cHealingCon
  2425. ************************************/
  2426. class cHealingCon : public cObject
  2427. {
  2428. public:
  2429. /**
  2430. * A constructor.
  2431. *
  2432. * Called whenever a healing container object is initialized in the world.
  2433. */
  2434. cHealingCon( DWORD dwGUID, DWORD dwContainer, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwWeight, DWORD dwValue, WORD wUses, WORD wUseLimit, BOOL fSelectable = TRUE, BOOL fEquippable = FALSE, BOOL fStackable = TRUE, BOOL fIsOwned = TRUE ) : m_dwItemModelID( dwModel )
  2435. {
  2436. m_dwGUID = dwGUID;
  2437. m_dwModel = dwModel;
  2438. m_flScale = flScale;
  2439. m_wIcon = dwIcon;
  2440. m_strName = strName;
  2441. m_strDescription = strDescription;
  2442. m_fSelectable = fSelectable;
  2443. m_dwWeight = dwWeight;
  2444. m_dwValue = dwValue;
  2445. m_wUses = wUses;
  2446. m_wUseLimit = wUseLimit;
  2447. m_fIsOwned = fIsOwned;
  2448. m_dwContainer = dwContainer;
  2449. m_fEquippable = fEquippable;
  2450. m_fIsStackable = fStackable;
  2451. m_fIsSolid = fSolid;
  2452. m_fIsOwned = TRUE;
  2453. m_bInventorySequence= -1;
  2454. m_wPositionSequence = 0;
  2455. m_wNumPortals = 0;
  2456. m_wNumLogins = 0x3C;
  2457. m_fEquipped = 0;
  2458. }
  2459. cHealingCon( ) {}
  2460. virtual ~cHealingCon( ) {}
  2461. cMessage CreatePacket();
  2462. cMessage CreatePacketContainer ( DWORD Container, DWORD ItemModelID );
  2463. cMessage Animation ( WORD wAnim, float flPlaySpeed ) { return *((cMessage *)NULL); }
  2464. void Assess ( cClient *pcAssesser );
  2465. void Action ( cClient* who );
  2466. void SetContainer( DWORD dwGUID );
  2467. inline DWORD GetItemModelID ( ) { return m_dwItemModelID; }
  2468. inline DWORD GetContainerID ( ) { return m_dwContainer; }
  2469. DWORD m_dwItemModelID;
  2470. protected:
  2471. DWORD m_dwWeight;
  2472. DWORD m_dwValue;
  2473. WORD m_wUses;
  2474. WORD m_wUseLimit;
  2475. BOOL m_fIsStackable;
  2476. BOOL m_fEquippable;
  2477. BOOL m_fIsSolid;
  2478. std::string m_strDescription;
  2479. };
  2480. class cEquipment
  2481. {
  2482. public:
  2483. cArmor* ca_Shield;
  2484. cArmor* ca_Helmet;
  2485. cArmor* ca_UpperArm;
  2486. cArmor* ca_LowerArm;
  2487. cArmor* ca_Breastplate;
  2488. cArmor* ca_Girth;
  2489. cArmor* ca_UpperLegs;
  2490. cArmor* ca_LowerLegs;
  2491. // cJewerly* cj_Neck;
  2492. // cJewerly* cj_LeftRing;
  2493. // cJewerly* cj_RightRing;
  2494. // cJewerly* cj_LeftBracelet;
  2495. // cJewerly* cj_RightBracelet;
  2496. cWeapon* cw_Weapon;
  2497. };
  2498. class cInventory
  2499. {
  2500. public:
  2501. std::vector< cObject * > m_vInventoryObjects;
  2502. cEquipment *m_cEquipment;
  2503. };
  2504. #define PK_ALTAR 1
  2505. #define NPK_ALTAR 0
  2506. //857
  2507. //846
  2508. //************************************
  2509. //* Object class - Altars
  2510. //************************************
  2511. class cAltar: public cObject
  2512. {
  2513. public:
  2514. cAltar ();
  2515. /**
  2516. * A constructor.
  2517. *
  2518. * Called whenever an altar object is initialized.
  2519. */
  2520. cAltar (DWORD dwType, DWORD dwGUID, cLocation *pcLoc, char* strName, char* strDesc);// :
  2521. /*cAbiotic( dwGUID, *pcLoc,(type ? 857 : 846), 1, TRUE, 2323,
  2522. (type ? "Altar to Bael'Zharon" : "Altar to Asheron"),
  2523. (type ? "Double click to go PK" : "Double Click to go NPK")
  2524. , 1000, 1000, TRUE, FALSE, FALSE, FALSE), dwType(type ? 1:0)
  2525. {
  2526. m_fStatic = TRUE;
  2527. }
  2528. */
  2529. virtual ~cAltar (){}
  2530. void Assess (cClient *pcAssesser );
  2531. cMessage CreatePacket();
  2532. void Action(cClient* who);
  2533. void SetMode(DWORD mode)
  2534. {
  2535. m_dwMode = mode;
  2536. }
  2537. DWORD GetMode()
  2538. {
  2539. return m_dwMode;
  2540. }
  2541. void SetData(WORD wAnimConfig, WORD wSoundSet,WORD wModel,WORD wIcon, DWORD dwObject)
  2542. {
  2543. m_wAnimConfig = wAnimConfig;
  2544. m_wSoundSet = wSoundSet;
  2545. m_wModel = wModel;
  2546. m_wIcon = wIcon;
  2547. }
  2548. private:
  2549. DWORD m_dwType;
  2550. WORD m_wModel;
  2551. WORD m_wIcon;
  2552. WORD m_wSoundSet;
  2553. WORD m_wAnimConfig;
  2554. DWORD dwType; //0 = NPK 1 = PK
  2555. };
  2556. #define DOOR_OPEN 1
  2557. #define DOOR_CLOSED 0
  2558. //************************************
  2559. //* Object class - Doors
  2560. //************************************
  2561. class cDoor : public cObject
  2562. {
  2563. friend class cClient;
  2564. public:
  2565. cDoor ();
  2566. /**
  2567. * A constructor.
  2568. *
  2569. * Called whenever a door object is initialized.
  2570. */
  2571. cDoor ( WORD type, DWORD dwGUID, cLocation *pcLoc, char *szName, char *szDesc );
  2572. virtual ~cDoor ( ) {}
  2573. void Assess ( cClient *pcAssesser );
  2574. void Action (cClient* who);
  2575. cMessage CreatePacket( );
  2576. void SetMode(DWORD mode)
  2577. {
  2578. m_dwMode = mode;
  2579. }
  2580. DWORD GetMode()
  2581. {
  2582. return m_dwMode;
  2583. }
  2584. void SetData(WORD wAnimConfig, WORD wSoundSet,WORD wModel,WORD wIcon)
  2585. {
  2586. m_wAnimConfig = wAnimConfig;
  2587. m_wSoundSet = wSoundSet;
  2588. m_wModel = wModel;
  2589. m_wIcon = wIcon;
  2590. }
  2591. private:
  2592. DWORD m_dwMode;
  2593. DWORD m_dwType;
  2594. WORD m_wModel;
  2595. WORD m_wIcon;
  2596. WORD m_wSoundSet;
  2597. WORD m_wPortalMode;
  2598. WORD m_wAnimConfig;
  2599. };
  2600. //************************************
  2601. //* Object class - World Objects (town signs, wells, etc)
  2602. //************************************
  2603. class cWorldObject : public cObject
  2604. {
  2605. public:
  2606. cWorldObject();
  2607. /**
  2608. * A constructor.
  2609. *
  2610. * Called whenever a world object is initialized.
  2611. */
  2612. cWorldObject(WORD type, DWORD dwGUID, cLocation *pcLoc, char *szName, char *szDesc);
  2613. virtual ~cWorldObject() {}
  2614. void Assess (cClient *pcAssesser );
  2615. cMessage CreatePacket();
  2616. void Action(cClient* who);
  2617. // * Cubem0j0: Set the type of object
  2618. // * 0 = Unselectable
  2619. // * 1 = Selectable
  2620. // * 2 = Well/Fountain
  2621. void SetObjectType(int ot)
  2622. {
  2623. iObjectType = ot;
  2624. }
  2625. int GetObjectType()
  2626. {
  2627. return iObjectType;
  2628. }
  2629. void SetData(WORD wModel,WORD wIcon)
  2630. {
  2631. m_wModel = wModel;
  2632. m_wIcon = wIcon;
  2633. }
  2634. private:
  2635. int iObjectType;
  2636. DWORD m_dwMode;
  2637. DWORD m_dwType;
  2638. WORD m_wModel;
  2639. WORD m_wIcon;
  2640. WORD m_wPortalMode;
  2641. };
  2642. //************************************
  2643. //* Object class - Merchant Signs
  2644. //************************************
  2645. class cMerchantSign : public cObject
  2646. {
  2647. public:
  2648. /**
  2649. * A constructor.
  2650. *
  2651. * Called whenever a merchant sign object is initialized.
  2652. */
  2653. cMerchantSign( DWORD dwGUID, cLocation& Loc, DWORD dwModel, float flScale, BOOL fSolid, DWORD dwIcon, std::string strName, std::string strDescription, DWORD dwWeight, DWORD dwValue, BOOL fSelectable = TRUE, BOOL fEquippable = TRUE, BOOL fStackable = FALSE, BOOL fIsOwned = FALSE, DWORD dwContainer = 0 ) : m_dwWOModelID( dwModel )
  2654. {
  2655. m_dwGUID = dwGUID;
  2656. m_dwModel = dwModel;
  2657. m_flScale = flScale;
  2658. m_wIcon = dwIcon;
  2659. m_strName = strName;
  2660. m_strDescription = strDescription;
  2661. m_fSelectable = fSelectable;
  2662. m_dwWeight = dwWeight;
  2663. m_dwValue = dwValue;
  2664. m_fIsOwned = fIsOwned;
  2665. m_dwContainer = dwContainer;
  2666. m_fEquippable = fEquippable;
  2667. m_fIsStackable = fStackable;
  2668. m_fIsSolid = fSolid;
  2669. // m_fIsOwned = FALSE;
  2670. // m_wState = 0;
  2671. // m_dwDoorState = 0x0CL;
  2672. m_bInventorySequence= -1;
  2673. m_wPositionSequence = 0;
  2674. m_wNumPortals = 0;
  2675. m_wNumLogins = 0x3C;
  2676. m_fEquipped = 0;
  2677. CopyMemory( &m_Location, &Loc, sizeof( cLocation ) );
  2678. }
  2679. cMerchantSign( ) {}
  2680. virtual ~cMerchantSign( ) {}
  2681. cMessage CreatePacket ( );
  2682. cMessage Animation ( WORD wAnim, float flPlaySpeed ) { return *((cMessage *)NULL); }
  2683. void Assess ( cClient *pcAssesser );
  2684. void Action ( cClient* who );
  2685. // void SetContainer( DWORD dwGUID );
  2686. inline DWORD GetWorldObject ( ) { return m_dwWOModelID; }
  2687. void SetObjectType(int ot)
  2688. {
  2689. iObjectType = ot;
  2690. }
  2691. int GetObjectType()
  2692. {
  2693. return iObjectType;
  2694. }
  2695. protected:
  2696. int iObjectType;
  2697. DWORD m_dwWOModelID;
  2698. DWORD m_dwWeight;
  2699. DWORD m_dwValue;
  2700. BOOL m_fIsStackable;
  2701. BOOL m_fEquippable;
  2702. BOOL m_fIsSolid;
  2703. std::string m_strDescription;
  2704. };
  2705. //************************************
  2706. //* World objects - Chest Containers
  2707. //************************************
  2708. class cChest : public cObject
  2709. {
  2710. friend class cClient;
  2711. public:
  2712. cChest ();
  2713. /**
  2714. * A constructor.
  2715. *
  2716. * Called whenever a chest object is initialized.
  2717. */
  2718. cChest ( WORD type, DWORD dwGUID, cLocation *pcLoc, char *szName, char *szDesc );
  2719. virtual ~cChest ( ) {}
  2720. void Assess ( cClient *pcAssesser );
  2721. void Action (cClient* who);
  2722. cMessage CreatePacket( );
  2723. void SetMode(DWORD mode)
  2724. {
  2725. m_dwMode = mode;
  2726. }
  2727. DWORD GetMode()
  2728. {
  2729. return m_dwMode;
  2730. }
  2731. //Cubem0j0: Set locked status based on database
  2732. void SetIsLocked(int locked)
  2733. {
  2734. IsLocked = locked;
  2735. }
  2736. int GetIsLocked()
  2737. {
  2738. return IsLocked;
  2739. }
  2740. //Cubem0j0: If this object is locked, how hard is it to open.
  2741. void SetLDiff(int ldiff)
  2742. {
  2743. LockDiff = ldiff;
  2744. }
  2745. int GetLDiff()
  2746. {
  2747. return LockDiff;
  2748. }
  2749. void SetData(WORD wAnimConfig, WORD wSoundSet,WORD wModel,WORD wIcon, DWORD dwObject1, DWORD dwObject2)
  2750. {
  2751. m_wAnimConfig = wAnimConfig;
  2752. m_wSoundSet = wSoundSet;
  2753. m_wModel = wModel;
  2754. m_wIcon = wIcon;
  2755. m_dwObjectsFlag1 = dwObject1;
  2756. m_dwObjectsFlag2 = dwObject2;
  2757. }
  2758. private:
  2759. DWORD m_dwMode;
  2760. DWORD m_dwType;
  2761. WORD m_wModel;
  2762. WORD m_wIcon;
  2763. WORD m_wSoundSet;
  2764. WORD m_wPortalMode;
  2765. WORD m_wAnimConfig;
  2766. DWORD m_dwObjectsFlag1;
  2767. DWORD m_dwObjectsFlag2;
  2768. int IsLocked;
  2769. int LockDiff;
  2770. };
  2771. //************************************
  2772. //* World objects - Corpse Containers
  2773. //************************************
  2774. class cCorpse : public cObject
  2775. {
  2776. friend class cClient;
  2777. friend class cMonster;
  2778. public:
  2779. cCorpse () {};
  2780. /**
  2781. * A constructor.
  2782. *
  2783. * Called whenever a corpse object is initialized.
  2784. */
  2785. cCorpse ( WORD type, DWORD dwGUID, cLocation& Loc, char *szName, char *szDesc );
  2786. virtual ~cCorpse ( ) {}
  2787. void Assess ( cClient *pcAssesser );
  2788. void Action (cClient* who);
  2789. cMessage CreatePacket ( );
  2790. //Returns the GUID of the object
  2791. inline DWORD GetCorpseGUID( )
  2792. {
  2793. return m_dwGUID;
  2794. }
  2795. //Cube: This is the MonsterModelID for the corpse.
  2796. inline DWORD GetType()
  2797. {
  2798. return m_dwType;
  2799. }
  2800. void SetMode(DWORD mode)
  2801. {
  2802. m_dwMode = mode;
  2803. }
  2804. DWORD GetMode()
  2805. {
  2806. return m_dwMode;
  2807. }
  2808. void SetData(WORD wAnimConfig, WORD wSoundSet,WORD wModel,WORD wIcon, DWORD MonsterModelID, float flScale)
  2809. {
  2810. m_wAnimConfig = wAnimConfig;
  2811. m_wSoundSet = wSoundSet;
  2812. m_wModel = wModel;
  2813. m_wIcon = wIcon;
  2814. m_MonsterModelID = MonsterModelID;
  2815. m_flScale = flScale;
  2816. }
  2817. //CubeM0j0: Inventory stuff...
  2818. inline void AddInventory( cObject *pcObject )
  2819. {
  2820. m_cor_lstInventory.push_back( pcObject );
  2821. pcObject->m_fIsOwned = TRUE;
  2822. pcObject->m_dwContainer = m_dwGUID;
  2823. }
  2824. inline void RemoveInventory( cObject *pcObject )
  2825. {
  2826. iterObject_lst itObject = std::find( m_cor_lstInventory.begin( ), m_cor_lstInventory.end( ), pcObject );
  2827. if ( itObject != m_cor_lstInventory.end( ) )
  2828. m_cor_lstInventory.erase( itObject );
  2829. pcObject->m_fIsOwned = FALSE;
  2830. pcObject->m_dwContainer = NULL;
  2831. }
  2832. inline cObject *FindInventory( DWORD dwGUID )
  2833. {
  2834. for ( iterObject_lst itObject = m_cor_lstInventory.begin( ); itObject != m_cor_lstInventory.end( ); ++itObject )
  2835. {
  2836. if ( dwGUID == (*itObject)->GetGUID( ) )
  2837. return *itObject;
  2838. }
  2839. return NULL;
  2840. }
  2841. inline void DeleteFromInventory( cObject *pcObject )
  2842. {
  2843. iterObject_lst itObject = std::find( m_cor_lstInventory.begin( ), m_cor_lstInventory.end( ), pcObject );
  2844. if ( itObject != m_cor_lstInventory.end( ) )
  2845. m_cor_lstInventory.erase( itObject );
  2846. }
  2847. //Cubem0j0: Add Corpse Inventory...
  2848. private:
  2849. DWORD m_dwMode;
  2850. DWORD m_dwType;
  2851. WORD m_wModel;
  2852. WORD m_wIcon;
  2853. WORD m_wSoundSet;
  2854. WORD m_wPortalMode;
  2855. WORD m_wAnimConfig;
  2856. DWORD m_MonsterModelID;
  2857. float m_flScale;
  2858. //the corpse's inventory list
  2859. std::list< cObject * > m_cor_lstInventory;
  2860. };
  2861. //************************************
  2862. //* World objects - Covenant Crystals
  2863. //************************************
  2864. class cCovenant: public cObject
  2865. {
  2866. friend class cClient;
  2867. public:
  2868. cCovenant();
  2869. /**
  2870. * A constructor.
  2871. *
  2872. * Called whenever a covenant crystal object is initialized.
  2873. */
  2874. cCovenant( WORD type, DWORD dwGUID, DWORD houseID, char *szName, char *szDescription, cLocation *pcLoc = NULL );
  2875. void Assess (cClient *pcAssesser );
  2876. cMessage CreatePacket( );
  2877. void Action(cClient* who);
  2878. virtual ~cCovenant( ) {}
  2879. void SetMode(DWORD mode)
  2880. {
  2881. m_dwMode = mode;
  2882. }
  2883. void SetGUID(DWORD GUID)
  2884. {
  2885. m_dwGUID = GUID;
  2886. }
  2887. void SetOwner(DWORD ownerID)
  2888. {
  2889. m_dwOwnerID = ownerID;
  2890. }
  2891. void SetData(DWORD wAnimConfig,WORD wModel,WORD wIcon)
  2892. {
  2893. m_wAnimConfig = wAnimConfig;
  2894. m_wModel = wModel;
  2895. m_wIcon = wIcon;
  2896. }
  2897. private:
  2898. DWORD m_dwType; //0 = Open, 1 = Closed
  2899. DWORD m_dwHouseID;
  2900. WORD m_wModel;
  2901. WORD m_wIcon;
  2902. WORD m_wAnimConfig;
  2903. DWORD m_dwHouseType;
  2904. };
  2905. #define HOUSE_FORSALE 1
  2906. #define HOUSE_OWNED 2
  2907. #define HOUSE_OPEN 3
  2908. #define HOUSE_CLOSED 4
  2909. //************************************
  2910. //* World objects - House Objects
  2911. //************************************
  2912. class cHouse : public cObject
  2913. {
  2914. friend class cClient;
  2915. public:
  2916. cHouse();
  2917. /**
  2918. * A constructor.
  2919. *
  2920. * Called whenever a house object is initialized.
  2921. */
  2922. cHouse( char *szName, char *szDescription, WORD type, DWORD GUID, cLocation *pcLoc = NULL );
  2923. virtual ~cHouse( ) {}
  2924. void cHouse::Assess ( cClient *pcAssesser );
  2925. cMessage cHouse::CreatePacket();
  2926. void cHouse::Action(cClient* who);
  2927. void SetGUID(DWORD GUID)
  2928. {
  2929. m_dwGUID = GUID;
  2930. }
  2931. void SetOwner(DWORD ownerID)
  2932. {
  2933. m_dwOwnerID = ownerID;
  2934. }
  2935. void SetData(WORD wModel,WORD wIcon)
  2936. {
  2937. m_wModel = wModel;
  2938. m_wIcon = wIcon;
  2939. }
  2940. void SetIsOpen(DWORD open)
  2941. {
  2942. IsOpen = open;
  2943. }
  2944. private:
  2945. WORD m_wModel;
  2946. WORD m_wIcon;
  2947. DWORD IsOpen;
  2948. };
  2949. //************************************
  2950. //* World objects - Housing Hooks
  2951. //************************************
  2952. class cHooks: public cObject
  2953. {
  2954. friend class cClient;
  2955. public:
  2956. cHooks();
  2957. /**
  2958. * A constructor.
  2959. *
  2960. * Called whenever a housing hook object is initialized.
  2961. */
  2962. cHooks( WORD type, DWORD dwGUID, DWORD houseID, char *szName, char *szDescription, cLocation *pcLoc = NULL );
  2963. void Assess (cClient *pcAssesser );
  2964. cMessage CreatePacket( );
  2965. void Action(cClient* who);
  2966. virtual ~cHooks( ) {}
  2967. void SetMode(DWORD mode)
  2968. {
  2969. m_dwMode = mode;
  2970. }
  2971. void SetGUID(DWORD GUID)
  2972. {
  2973. m_dwGUID = GUID;
  2974. }
  2975. void Set_hook_id(int hookid)
  2976. {
  2977. hook_id = hookid;
  2978. }
  2979. int Get_hook_id()
  2980. {
  2981. return hook_id;
  2982. }
  2983. /*
  2984. inline void SetItem( cObject *pcObject )
  2985. {
  2986. m_hook_item = pcObject;
  2987. m_hook_item->m_fIsOwned = TRUE;
  2988. m_hook_item->m_dwContainer = m_dwGUID;
  2989. }
  2990. inline void RemoveItem()
  2991. {
  2992. m_hook_item = NULL;
  2993. m_hook_item->m_fIsOwned = FALSE;
  2994. m_hook_item->m_dwContainer = NULL;
  2995. }
  2996. void SetIsUsed(int used)
  2997. {
  2998. IsUsed = used;
  2999. }
  3000. int GetIsUsed()
  3001. {
  3002. return IsUsed;
  3003. }
  3004. */
  3005. void SetData(WORD wAnimConfig,WORD wSoundSet,WORD wModel,WORD wIcon)
  3006. {
  3007. m_wAnimConfig = wAnimConfig;
  3008. m_wSoundSet = wSoundSet;
  3009. m_wModel = wModel;
  3010. m_wIcon = wIcon;
  3011. }
  3012. DWORD v_guids[255];
  3013. DWORD m_dwHouseID;
  3014. private:
  3015. int IsUsed;
  3016. DWORD m_dwType;
  3017. WORD m_wModel;
  3018. WORD m_wIcon;
  3019. WORD m_wSoundSet;
  3020. WORD m_wAnimConfig;
  3021. int hook_id;
  3022. // cObject *m_hook_item;
  3023. // DWORD hook_item_id;
  3024. };
  3025. //************************************
  3026. //* World objects - Housing Storage Chests
  3027. //************************************
  3028. class cStorage: public cObject
  3029. {
  3030. friend class cClient;
  3031. public:
  3032. cStorage();
  3033. /**
  3034. * A constructor.
  3035. *
  3036. * Called whenever a housing storage chest object is initialized.
  3037. */
  3038. cStorage( WORD type, DWORD dwGUID, DWORD houseID, char *szName, char *szDescription, cLocation *pcLoc = NULL );
  3039. void Assess (cClient *pcAssesser );
  3040. cMessage CreatePacket( );
  3041. void Action(cClient* who);
  3042. virtual ~cStorage( ) {}
  3043. void SetMode(DWORD mode)
  3044. {
  3045. m_dwMode = mode;
  3046. }
  3047. DWORD GetMode()
  3048. {
  3049. return m_dwMode;
  3050. }
  3051. void SetGUID(DWORD GUID)
  3052. {
  3053. m_dwGUID = GUID;
  3054. }
  3055. void SetData(WORD wAnimConfig,WORD wSoundSet,WORD wModel,WORD wIcon)
  3056. {
  3057. m_wAnimConfig = wAnimConfig;
  3058. m_wSoundSet = wSoundSet;
  3059. m_wModel = wModel;
  3060. m_wIcon = wIcon;
  3061. }
  3062. DWORD m_dwHouseID;
  3063. private:
  3064. DWORD m_dwType;
  3065. WORD m_wModel;
  3066. WORD m_wIcon;
  3067. WORD m_wSoundSet;
  3068. WORD m_wPortalMode;
  3069. WORD m_wAnimConfig;
  3070. };
  3071. //************************************
  3072. //* World objects - War Spells
  3073. //************************************
  3074. class cWarSpell : public cObject
  3075. {
  3076. friend class cClient;
  3077. public:
  3078. //WarSpell();
  3079. /**
  3080. * A constructor.
  3081. *
  3082. * Called whenever a warspell object is initialized.
  3083. */
  3084. cWarSpell(DWORD dwGUID, DWORD dwSpellID, cLocation& Loc, cVelocity tarVel, DWORD dwSpellModel)
  3085. {
  3086. m_wPositionSequence = 0;
  3087. m_wNumPortals = 0;
  3088. m_wNumLogins = 0x1;
  3089. m_fStatic = FALSE;
  3090. SetLocation(Loc);
  3091. m_dwGUID = dwGUID;
  3092. m_dwSpellModel = dwSpellModel;
  3093. m_dwSpellID = dwSpellID;
  3094. m_strName = "War Spell";
  3095. m_Velocity = tarVel;
  3096. m_Location.m_flX += tarVel.m_dx;
  3097. m_Location.m_flY += tarVel.m_dy;
  3098. m_Location.m_flZ += 1.4f + tarVel.m_dz;
  3099. };
  3100. virtual ~cWarSpell(){};
  3101. cMessage cWarSpell::CreatePacket();
  3102. void cWarSpell::Assess (cClient *pcAssesser );
  3103. void cWarSpell::Action(cClient* who);
  3104. static int cWarSpell::Move( LPVOID wp, LPVOID lp );
  3105. cMessage cWarSpell::WarParticle(cWarSpell* pcWarSpell,DWORD dwEffect,float flSpeed);
  3106. cMessage cWarSpell::SpellAnim(cWarSpell* pcWarSpell,WORD wWarAnim,WORD wWarAnim2);
  3107. cMessage cWarSpell::SetPosition();
  3108. cMessage cWarSpell::SpellImpact(cWarSpell* pcWarSpell,DWORD dwEffect,float flSpeed);
  3109. cMessage cWarSpell::SpellVis(cWarSpell* pcWarSpell);
  3110. };
  3111. //************************************
  3112. //* World objects - Monsters
  3113. //************************************
  3114. class cMonster : public cObject
  3115. {
  3116. friend class cClient;
  3117. friend class SimpleAI;
  3118. public:
  3119. // cMonster ();
  3120. /**
  3121. * A constructor.
  3122. *
  3123. * Called whenever a monster object is initialized.
  3124. */
  3125. cMonster ( DWORD dwGUID, DWORD dwMonsterID, cLocation *pcLoc, char *szName, char *szDesc, cMonStats *pcmsStats, DWORD dwRespawn, DWORD dwDecay, DWORD dwChase, DWORD dwInfluence, DWORD dwExp_Value, DWORD dwHealth, DWORD dwStamina, DWORD dwMana );
  3126. virtual ~cMonster ( ) {}
  3127. void Assess ( cClient *pcAssesser );
  3128. void Action ( cClient* who );
  3129. void Attack ( cClient* who, float flDamageSlider, DWORD F7B0Sequence );
  3130. void SpellAttack ( cClient* who, cWarSpell *pcWarSpell, DWORD F7B0Sequence );
  3131. static int DeathAnimation ( LPVOID wp, LPVOID lp );
  3132. cMessage CreatePacket ( );
  3133. cMessage Animation ( WORD wAnim, float flPlaySpeed = 1.0f );
  3134. cMessage DoDamageMessage ( DWORD F7B0seq, std::string target, DWORD damagetype, double severity, DWORD amount );
  3135. cMessage RecieveDamageMessage ( DWORD F7B0seq, std::string giver, DWORD damagetype, double severity, DWORD amount, DWORD location );
  3136. cMessage DecrementHealth ( DWORD dwGUID, WORD amount, signed int &newhealth );
  3137. cMessage SetHealth ( DWORD dwNewHealth );
  3138. cMessage AdjustBar ( DWORD dwGUID, DWORD F7B0Sequence );
  3139. cMessage ChangeCombatMode ( bool fMode );
  3140. cMessage CombatAnimation ( DWORD dwTarget, WORD wAttackAnim );
  3141. cMessage TurnToTarget ( float flHeading, DWORD dwTargetGUID );
  3142. cMessage MoveToTarget ( cClient *pcWho );
  3143. cMessage MoveTarget ( cClient *pcWho );
  3144. cMessage ReturnToSpawn ( );
  3145. void ReSpawn ( cObject *pcObject );
  3146. void RemoveMonster ( cObject *pcObject );
  3147. void MonsterCorpse ( );
  3148. cMessage SetPosition ( );
  3149. inline DWORD GetMonsterModelID ( ) { return m_dwMonsterModelID; }
  3150. inline WORD GetTotalHealth ( ) { return m_dwCurrenthealth; }
  3151. DWORD m_dwMonsterModelID;
  3152. // bool m_fDeadOrAlive;
  3153. WORD m_wNumMovements;
  3154. WORD m_wNumAnimInteracts;
  3155. WORD m_wNumBubbleModes;
  3156. WORD m_wNumJumps;
  3157. WORD m_wNumPortals;
  3158. WORD m_wAnimCount;
  3159. WORD m_wNumOverrides;
  3160. WORD m_wNumLogins;
  3161. // Character Stats
  3162. DWORD m_dwLevel;
  3163. DWORD m_dwCurrenthealth;
  3164. DWORD m_dwMaxHealth;
  3165. DWORD m_dwStr;
  3166. DWORD m_dwEnd;
  3167. DWORD m_dwQuick;
  3168. DWORD m_dwCoord;
  3169. DWORD m_dwFocus;
  3170. DWORD m_dwSelf;
  3171. DWORD m_dwCurrentStamina;
  3172. DWORD m_dwCurrentMana;
  3173. DWORD m_dwMaxStamina;
  3174. DWORD m_dwMaxMana;
  3175. DWORD m_dwSpecies;
  3176. WORD m_wCurAnim;
  3177. WORD m_wMeleeSequence;
  3178. DWORD m_dwF7B0Sequence;
  3179. BYTE m_bStatSequence;
  3180. DWORD m_dwUnknownCount;
  3181. BYTE m_bInitialAnimation[200];
  3182. BYTE m_bCombatMode;
  3183. cLocation m_TargetLocation;
  3184. int m_iPosUpdateCount;
  3185. bool m_fHasTarget;
  3186. DWORD m_dwTargetGUID;
  3187. };
  3188. #endif // #ifndef __OBJECT_H