Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

psSpell Class Reference

Represents a spell. More...

#include <psspell.h>

List of all members.

Public Member Functions

void Affect (gemActor *caster, gemObject *target, float range, float kFactor, float power, Client *client, csTicks castingDuration) const
bool CanCast (gemActor *caster, float kFactor, csString &reason, bool canCastAllSpells)
 Performs the necessary checks on the player to make sure they meet the requirements to cast this spell.
void Cast (gemActor *caster, float kFactor, Client *client) const
 Creates a new instance of this spell.
float ChanceOfCastSuccess (psCharacter *caster, float kFactor) const
float ChanceOfResearchSuccess (psCharacter *researcher)
const csString & GetDescription () const
csArray< psItemStats * > & GetGlyphList ()
int GetID () const
const csString & GetImage () const
const csString & GetName () const
int GetRealm ()
psWayGetWay ()
bool Load (iResultRow &row)
psSpellCost ManaCost (psCharacter *caster, float kFactor) const
bool MatchGlyphs (const csArray< psItemStats * > &glyphs)
 Takes a list of glyphs and compares them to the correct sequence to construct this spell.
float PowerLevel (psCharacter *caster, float kFactor) const
 psSpell ()
 ~psSpell ()
iScriptableVar implementation

Functions that implement the iScriptableVar interface.

double GetProperty (MathEnvironment *env, const char *ptr)
double CalcFunction (MathEnvironment *env, const char *functionName, const double *params)
const char * ToString ()

Protected Member Functions

bool AffectTarget (gemActor *caster, gemObject *origTarget, gemObject *target, float power, Client *client) const

Protected Attributes

MathExpressionaoeAngle
 AOE Angle: (Power, WaySkill, RelatedStat) -> Degrees.
MathExpressionaoeRadius
 AOE Radius: (Power, WaySkill, RelatedStat) -> Meters.
MathExpressioncastDuration
 Math for various properties. Casting duration: (Power, WaySkill, RelatedStat) -> Seconds.
csString castingEffect
csString description
csArray< psItemStats * > glyphList
 List of glyphs required to assemble the technique.
int id
csString image
float maxPower
 The Power (P) cap.
csString name
csString npcSpellCategory
 Name of category of spell, which will sent to npc perception system.
uint32_t npcSpellCategoryID
 Hash ID of category of spell, use in network compression to npc perception system.
float npcSpellRelativePower
 Relative Power of spell, used as a hint to npc perception system.
bool offensive
ProgressionScriptoutcome
 The progression script: (Power, Caster, Target) -> (side effects)
MathExpressionrange
 Maximum range to target allowed: (Power, WaySkill, RelatedStat) -> Meters.
int realm
int targetTypes
 Bit field if valid target types for this spell.
psWayway

Detailed Description

Represents a spell.

This is mostly data that is cached in from the database to represent what a spell is. It contains details such as the required glyphs as well as the effect of the spell.

Definition at line 74 of file psspell.h.


Constructor & Destructor Documentation

psSpell::psSpell ( )
psSpell::~psSpell ( )

Member Function Documentation

void psSpell::Affect ( gemActor caster,
gemObject target,
float  range,
float  kFactor,
float  power,
Client client,
csTicks  castingDuration 
) const
bool psSpell::AffectTarget ( gemActor caster,
gemObject origTarget,
gemObject target,
float  power,
Client client 
) const [protected]
double psSpell::CalcFunction ( MathEnvironment env,
const char *  functionName,
const double *  params 
) [virtual]

Implements iScriptableVar.

bool psSpell::CanCast ( gemActor caster,
float  kFactor,
csString &  reason,
bool  canCastAllSpells 
)

Performs the necessary checks on the player to make sure they meet the requirements to cast this spell.

1) The character is in PEACE or COMBAT modes. 2) The player has the required glyphs (or "cast all spells" privs) 3) The player has the required mana (or infinitemana set).

void psSpell::Cast ( gemActor caster,
float  kFactor,
Client client 
) const

Creates a new instance of this spell.

Parameters:
casterThe caster of the spell.
kFactorThe kFactor used.
clientThe client that cast the spell.
float psSpell::ChanceOfCastSuccess ( psCharacter caster,
float  kFactor 
) const
float psSpell::ChanceOfResearchSuccess ( psCharacter researcher)
const csString& psSpell::GetDescription ( ) const [inline]

Definition at line 93 of file psspell.h.

csArray<psItemStats*>& psSpell::GetGlyphList ( ) [inline]

Definition at line 137 of file psspell.h.

int psSpell::GetID ( ) const [inline]

Definition at line 81 of file psspell.h.

const csString& psSpell::GetImage ( ) const [inline]

Definition at line 89 of file psspell.h.

const csString& psSpell::GetName ( ) const [inline]

Definition at line 85 of file psspell.h.

double psSpell::GetProperty ( MathEnvironment env,
const char *  ptr 
) [virtual]

Implements iScriptableVar.

int psSpell::GetRealm ( ) [inline]

Definition at line 129 of file psspell.h.

psWay* psSpell::GetWay ( ) [inline]

Definition at line 133 of file psspell.h.

bool psSpell::Load ( iResultRow &  row)
psSpellCost psSpell::ManaCost ( psCharacter caster,
float  kFactor 
) const
bool psSpell::MatchGlyphs ( const csArray< psItemStats * > &  glyphs)

Takes a list of glyphs and compares them to the correct sequence to construct this spell.

float psSpell::PowerLevel ( psCharacter caster,
float  kFactor 
) const
const char* psSpell::ToString ( ) [inline, virtual]

Implements iScriptableVar.

Definition at line 148 of file psspell.h.


Member Data Documentation

AOE Angle: (Power, WaySkill, RelatedStat) -> Degrees.

Definition at line 180 of file psspell.h.

AOE Radius: (Power, WaySkill, RelatedStat) -> Meters.

Definition at line 178 of file psspell.h.

Math for various properties. Casting duration: (Power, WaySkill, RelatedStat) -> Seconds.

Definition at line 174 of file psspell.h.

csString psSpell::castingEffect [protected]

Definition at line 163 of file psspell.h.

csString psSpell::description [protected]

Definition at line 162 of file psspell.h.

List of glyphs required to assemble the technique.

Definition at line 185 of file psspell.h.

int psSpell::id [protected]

Definition at line 157 of file psspell.h.

csString psSpell::image [protected]

Definition at line 161 of file psspell.h.

float psSpell::maxPower [protected]

The Power (P) cap.

Definition at line 167 of file psspell.h.

csString psSpell::name [protected]

Definition at line 158 of file psspell.h.

csString psSpell::npcSpellCategory [protected]

Name of category of spell, which will sent to npc perception system.

Definition at line 188 of file psspell.h.

uint32_t psSpell::npcSpellCategoryID [protected]

Hash ID of category of spell, use in network compression to npc perception system.

Definition at line 191 of file psspell.h.

Relative Power of spell, used as a hint to npc perception system.

Definition at line 194 of file psspell.h.

bool psSpell::offensive [protected]

Definition at line 164 of file psspell.h.

The progression script: (Power, Caster, Target) -> (side effects)

Definition at line 182 of file psspell.h.

Maximum range to target allowed: (Power, WaySkill, RelatedStat) -> Meters.

Definition at line 176 of file psspell.h.

int psSpell::realm [protected]

Definition at line 160 of file psspell.h.

Bit field if valid target types for this spell.

Definition at line 170 of file psspell.h.

psWay* psSpell::way [protected]

Definition at line 159 of file psspell.h.


The documentation for this class was generated from the following file: