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

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

Go to the documentation of this file.
00001   /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
00002     || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net]  ||
00003     ||                                                                         ||
00004     || This software is free software released under GPL2 license.             ||
00005     || You can find detailed license information in nox-wizard.cpp file.       ||
00006     ||                                                                         ||
00007     || For any question post to NoX-Wizard forums.                             ||
00008     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
00009 
00015 #ifndef __MAGIC_H__
00016 #define __MAGIC_H__
00017 
00018 #include "nxwcommn.h"
00019 #include "targeting.h"
00020 #include "packets.h"
00021 #include "menu.h"
00022 
00023 
00025 #define SPELLFLAG_NOUSEMANA 0x1
00026 
00027 #define SPELLFLAG_DONTCRIMINAL 0x2
00028 
00029 #define SPELLFLAG_DONTREQREAGENTS 0x4
00030 
00031 #define SPELLFLAG_DONTCHECKSPELLBOOK 0x8
00032 
00034 #define SPELLFLAG_PARAMISSKILLTOUSE 0x10
00035 
00036 #define SPELLFLAG_PARAMISDAMAGE 0x20
00037 
00038 #define SPELLFLAG_PARAMISBONUS 0x20
00039 
00040 #define SPELLFLAG_PARAMISNPCNUMBER 0x20
00041 
00042 #define SPELLFLAG_PARAMISDURATION 0x80
00043 
00045  #define SPELLFLAG_DONTUSEPARTICLES 0x100
00046 
00047 #define SPELLFLAG_DONTREFLECT 0x200
00048 
00049 #define SPELLFLAG_IGNORERESISTANCE 0x400
00050 
00051 #define SPELLFLAG_IGNORETOWNLIMITS 0x800
00052 
00054 #define SPELLFLAG_DONTCHECKSKILL 0x1000
00055 
00056  #define SPELLFLAG_SILENTSPELL  0x2000
00057 
00058  #define SPELLFLAG_IMMOBLESPELL 0x4000
00059 
00060 #define SPELLFLAG_BONUSCHANCE  0x8000
00061 
00063 #define SPELLFLAGS_NPCDEFAULT (SPELLFLAG_DONTCRIMINAL|SPELLFLAG_DONTREQREAGENTS|SPELLFLAG_DONTCHECKSPELLBOOK|SPELLFLAG_IGNORETOWNLIMITS|SPELLFLAG_DONTCHECKSKILL)
00064 
00068 namespace magic {
00069 
00074         class cPolymorphMenu : public cIconListMenu {
00075         public:
00076                 cPolymorphMenu( P_CHAR pc );
00077                 virtual void handleButton( NXWCLIENT ps, cClientPacket* pkg  );
00078         };
00079 
00084         class cCreateFoodMenu : public cIconListMenu {
00085         public:
00086                 cCreateFoodMenu( P_CHAR pc );
00087                 virtual void handleButton( NXWCLIENT ps, cClientPacket* pkg  );
00088         };
00089 
00094         class cSummonCreatureMenu : public cIconListMenu {
00095         public:
00096                 cSummonCreatureMenu( P_CHAR pc );
00097                 virtual void handleButton( NXWCLIENT ps, cClientPacket* pkg  );
00098         };
00099 
00100 
00101 
00105         enum SpellId {
00106                 // Level 1
00107                 SPELL_CLUMSY = 0,
00108                 SPELL_CREATEFOOD,
00109                 SPELL_FEEBLEMIND,
00110                 SPELL_HEAL,
00111                 SPELL_MAGICARROW,
00112                 SPELL_NIGHTSIGHT,
00113                 SPELL_REACTIVEARMOUR,
00114                 SPELL_WEAKEN,
00115                 // Level 2
00116                 SPELL_AGILITY,
00117                 SPELL_CUNNING,
00118                 SPELL_CURE,
00119                 SPELL_HARM,
00120                 SPELL_TRAP,
00121                 SPELL_UNTRAP,
00122                 SPELL_PROTECTION,
00123                 SPELL_STRENGHT,
00124                 // Level 3
00125                 SPELL_BLESS,
00126                 SPELL_FIREBALL,
00127                 SPELL_LOCK,
00128                 SPELL_POISON,
00129                 SPELL_TELEKINESYS,
00130                 SPELL_TELEPORT,
00131                 SPELL_UNLOCK,
00132                 SPELL_WALLSTONE,
00133                 // Level 4
00134                 SPELL_ARCHCURE,
00135                 SPELL_ARCHPROTECTION,
00136                 SPELL_CURSE,
00137                 SPELL_FIREFIELD,
00138                 SPELL_GREATHEAL,
00139                 SPELL_LIGHTNING,
00140                 SPELL_MANADRAIN,
00141                 SPELL_RECALL,
00142                 // Level 5
00143                 SPELL_BLADESPIRITS,
00144                 SPELL_DISPELFIELD,
00145                 SPELL_INCOGNITO,
00146                 SPELL_REFLECTION,
00147                 SPELL_MINDBLAST,
00148                 SPELL_PARALYZE,
00149                 SPELL_POISONFIELD,
00150                 SPELL_SUMMON,
00151                 // Level 6
00152                 SPELL_DISPEL,
00153                 SPELL_ENERGYBOLT,
00154                 SPELL_EXPLOSION,
00155                 SPELL_INVISIBILITY,
00156                 SPELL_MARK,
00157                 SPELL_MASSCURSE,
00158                 SPELL_PARALYZEFIELD,
00159                 SPELL_REVEAL,
00160                 // Level 7
00161                 SPELL_CHAINLIGHTNING,
00162                 SPELL_ENERGYFIELD,
00163                 SPELL_FLAMESTRIKE,
00164                 SPELL_GATE,
00165                 SPELL_MANAVAMPIRE,
00166                 SPELL_MASSDISPEL,
00167                 SPELL_METEORSWARM,
00168                 SPELL_POLYMORPH,
00169                 // Level 8
00170                 SPELL_EARTHQUAKE,
00171                 SPELL_ENERGYVORTEX,
00172                 SPELL_RESURRECTION,
00173                 SPELL_SUMMON_AIR,
00174                 SPELL_SUMMON_DEAMON,
00175                 SPELL_SUMMON_EARTH,
00176                 SPELL_SUMMON_FIRE,
00177                 SPELL_SUMMON_WATER,
00178 
00179                 MAX_SPELLS,
00180                 SPELL_INVALID = -1
00181         };
00182 
00183         enum CastingType {
00184                 CASTINGTYPE_SPELL = 0,
00185                 CASTINGTYPE_SCROLL,
00186                 CASTINGTYPE_ITEM,
00187                 CASTINGTYPE_NOMANAITEM,
00188                 CASTINGTYPE_NPC
00189         };
00190 
00191         struct reag_st
00192         {
00193                 UI32 ginseng;
00194                 UI32 moss;
00195                 UI32 drake;
00196                 UI32 pearl;
00197                 UI32 silk;
00198                 UI32 ash;
00199                 UI32 shade;
00200                 UI32 garlic;
00201         };
00202         
00203         struct g_Spell
00204         {
00205                 bool enabled;           // spell enabled?
00206                 int circle;             // circle number
00207                 int mana;                       // mana requirements
00208                 int loskill;            // low magery skill req.
00209                 int hiskill;            // high magery skill req.
00210                 int sclo;                       // low magery skill req. if using scroll
00211                 int schi;                       // high magery skill req. if using scroll
00212                 //char mantra[27];      // words of power
00213                 std::string mantra;     // words of power
00214                 int action;             // character action
00215                 int delay;                      // spell delay
00216                 reag_st reagents;       // reagents req.
00217                 //char strToSay[102]; // string visualized with targ. system
00218                 std::string strToSay; // string visualized with targ. system
00219                 bool reflect;           // 1=spell reflectable, 0=spell not reflectable
00220                 bool runic;
00221                 int lodamage;
00222                 int hidamage;
00223                 bool attackSpell;
00224                 int areasize;
00225                 int alwaysflag;
00226                 DamageType damagetype;
00227         };
00228 
00229         enum {  TARGTYPE_NONE = 0, TARGTYPE_XYZ, TARGTYPE_ITEM, TARGTYPE_CHAR,
00230                 TARGTYPE_CONTAINERORDOOR, TARGTYPE_CONTAINER, TARGTYPE_RUNE };
00231 
00232         extern g_Spell g_Spells[MAX_SPELLS];
00233 
00234         LOGICAL checkMagicalSpeech( P_CHAR pc, char* speech );
00235         bool beginCasting (SpellId num, NXWCLIENT s, CastingType type);
00236         SpellId spellNumberFromScrollId(int id);
00237         void castSpell(SpellId spellnumber, TargetLocation& dest, P_CHAR src = NULL, int flags = 0, int param = 0);
00238         void castAreaAttackSpell (UI16 x, UI16 y, SpellId spellnum, P_CHAR pcaster = NULL);
00239         void loadSpellsFromScript();
00240         bool spellRequiresTarget(SpellId spellnum);
00241         P_CHAR summon (P_CHAR owner, int npctype, int duration, bool bTamed = true, int x = INVALID, int y = INVALID, int z = INVALID);
00242         bool checkGateCollision( P_CHAR pc );
00243         UI32 getCastingTime( SpellId spell );
00244 
00245 
00246 } // namespace
00247 
00248 #endif //__MAGIC_H__
SourceForge.net Logo