POT
POT
POT
Main menu

Download

Forum

SVN

Class: OTS_Spell

Source Location: /classes/OTS_Spell.php

Class OTS_Spell

Class Overview

Wrapper for spell info.

Wrapper for spell info.

Located in /classes/OTS_Spell.php [line 41]



		
				Author(s):
		
API Tags:
Property-read:  int $type: Spell type.
Property-read:  string $name: Spell name.
Property-read:  int $id: Spell ID.
Property-read:  string $words: Spell formula.
Property-read:  bool $agressive: Does spell marks action as an attack.
Property-read:  int $charges: Rune charges count.
Property-read:  int $level: Required level.
Property-read:  int $magicLevel: Required magic level.
Property-read:  int $mana: Mana usage.
Property-read:  int $soul: Soul points usage.
Property-read:  bool $hasParams: Does spell has any arguments.
Property-read:  bool $enabled: Is spell enabled.
Property-read:  bool $farUseAllowed: Can the spell be used from distance.
Property-read:  bool $premium: Does spell requires PACC.
Property-read:  bool $learnNeeded: Does the spell needs to be learned.
Property-read:  OTS_ItemType|null $conjure: Conjure item type.
Property-read:  OTS_ItemType|null $reagent: Item required to cast this spell.
Property-read:  int $conjuresCount: Amount of items created with conjure cast.
Property-read:  array $vocations: List of vocations allowed to use.

Information Tags:
Version:  0.1.3
Version:  0.0.7
Since:  0.0.7

Methods

[ Top ]
Method Summary
OTS_Spell   __construct()   Sets spell info.
OTS_Item   createConjure()   Creates conjure item.
int   getCharges()   Number of rune charges.
OTS_ItemType|null   getConjure()   Returns item type of conjured item.
int   getConjureCount()   Returns amount of items conjured by this spell.
int   getConjureId()  
int   getID()   Returns rune item id.
int   getLevel()   Level required for use.
int   getMagicLevel()   Magic level required to cast.
int   getMana()   Mana cost.
string   getName()   Returns spell name.
OTS_ItemType|null   getReagent()   Returns item type of reagent item.
int   getReagentId()  
int   getSoul()   Soul points cost.
int   getType()   Returns spell type.
array   getVocations()   Returns list of vocations that are allowed to learn this spell.
string   getWords()   Returns spell formula.
bool   hasParams()   Checks if spell has parameter.
bool   isAggresive()  
bool   isAggressive()   Checks if spell is threated as unfriendly by other creatures.
bool   isEnabled()   Checks if spell is enabled.
bool   isFarUseAllowed()   Checks if distance use allowed.
bool   isLearnNeeded()   Checks if spell needs to be learned.
bool   isPremium()   Checks if spell requires PACC.
mixed   __get()   Magic PHP5 method.
string   __toString()   Returns string representation of XML.

[ Top ]
Methods
Constructor __construct  [line 63]

  OTS_Spell __construct( int $type, $spell  )

Sets spell info.

Sets spell info.

Parameters:
int   $type:  Spell type.
DOMElement   $spell:  Spell info.

API Tags:
Access:  public

Information Tags:
Version:  0.0.7
Since:  0.0.7

[ Top ]
createConjure  [line 341]

  OTS_Item createConjure( )

Creates conjure item.

Creates conjure item. Note: You need to have global items list resource loaded in order to use this method.


API Tags:
Return:  Conjured item.
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Throws:  E_OTS_NotLoaded When there is no global items list available.
Since:  0.0.7
Since:  0.1.0

[ Top ]
getCharges  [line 141]

  int getCharges( )

Number of rune charges.

Number of rune charges.


API Tags:
Return:  Rune charges.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getConjure  [line 267]

  OTS_ItemType|null getConjure( )

Returns item type of conjured item.

Returns item type of conjured item. Note: You need to have global items list resource loaded in order to use this method.


API Tags:
Return:  Returns item type of conjure item (null if not exists).
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Throws:  E_OTS_NotLoaded When there is no global items list available.
Since:  0.0.7
Since:  0.1.0

[ Top ]
getConjureCount  [line 305]

  int getConjureCount( )

Returns amount of items conjured by this spell.

Returns amount of items conjured by this spell.


API Tags:
Return:  Items count.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getConjureId  [line 249]

  int getConjureId( )


API Tags:
Return:  Item ID.
Deprecated:  0.1.0 Use getConjure()->getId().
Access:  public

Information Tags:
Version:  0.0.7
Since:  0.0.7

[ Top ]
getID  [line 96]

  int getID( )

Returns rune item id.

Returns rune item id.


API Tags:
Return:  Rune item ID.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getLevel  [line 152]

  int getLevel( )

Level required for use.

Level required for use.


API Tags:
Return:  Required level.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getMagicLevel  [line 163]

  int getMagicLevel( )

Magic level required to cast.

Magic level required to cast.


API Tags:
Return:  Required magic level.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getMana  [line 174]

  int getMana( )

Mana cost.

Mana cost.


API Tags:
Return:  Mana usage.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getName  [line 85]

  string getName( )

Returns spell name.

Returns spell name.


API Tags:
Return:  Name.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getReagent  [line 294]

  OTS_ItemType|null getReagent( )

Returns item type of reagent item.

Returns item type of reagent item. Note: You need to have global items list resource loaded in order to use this method.


API Tags:
Return:  Returns item type of reagent item (null if not exists).
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Throws:  E_OTS_NotLoaded When there is no global items list available.
Since:  0.0.7
Since:  0.1.0

[ Top ]
getReagentId  [line 276]

  int getReagentId( )


API Tags:
Return:  Reagent ID.
Deprecated:  0.1.0 Use getReagent()->getId().
Access:  public

Information Tags:
Version:  0.0.7
Since:  0.0.7

[ Top ]
getSoul  [line 185]

  int getSoul( )

Soul points cost.

Soul points cost.


API Tags:
Return:  Soul points usage.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getType  [line 74]

  int getType( )

Returns spell type.

Returns spell type.


API Tags:
Return:  Spell type.
Access:  public

Information Tags:
Version:  0.0.7
Since:  0.0.7

[ Top ]
getVocations  [line 316]

  array getVocations( )

Returns list of vocations that are allowed to learn this spell.

Returns list of vocations that are allowed to learn this spell.


API Tags:
Return:  List of vocation names.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
getWords  [line 107]

  string getWords( )

Returns spell formula.

Returns spell formula.


API Tags:
Return:  Formula.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
hasParams  [line 196]

  bool hasParams( )

Checks if spell has parameter.

Checks if spell has parameter.


API Tags:
Return:  True if spell takes a parameter.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
isAggresive  [line 130]

  bool isAggresive( )


API Tags:
Return:  Is spell aggressive.
Deprecated:  0.1.0 Use isAggressive().
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.7
Since:  0.0.7

[ Top ]
isAggressive  [line 120]

  bool isAggressive( )

Checks if spell is threated as unfriendly by other creatures.

Checks if spell is threated as unfriendly by other creatures.


API Tags:
Return:  Is spell aggressive.
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.1.0
Since:  0.0.7

[ Top ]
isEnabled  [line 207]

  bool isEnabled( )

Checks if spell is enabled.

Checks if spell is enabled.


API Tags:
Return:  Is spell enabled.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
isFarUseAllowed  [line 218]

  bool isFarUseAllowed( )

Checks if distance use allowed.

Checks if distance use allowed.


API Tags:
Return:  Is it possible to use this spell from distance.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
isLearnNeeded  [line 240]

  bool isLearnNeeded( )

Checks if spell needs to be learned.

Checks if spell needs to be learned.


API Tags:
Return:  Does this spell need to be learned.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
isPremium  [line 229]

  bool isPremium( )

Checks if spell requires PACC.

Checks if spell requires PACC.


API Tags:
Return:  Is spell only for Premium Account.
Access:  public

Information Tags:
Version:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.0.7

[ Top ]
__get  [line 359]

  mixed __get( string $name  )

Magic PHP5 method.

Magic PHP5 method.

Parameters:
string   $name:  Property name.

API Tags:
Return:  Property value.
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.7
Throws:  OutOfBoundsException For non-supported properties.
Throws:  E_OTS_NotLoaded When there is no global items list available.
Since:  0.0.7
Throws:  DOMException On DOM operation error.
Since:  0.1.0

[ Top ]
__toString  [line 436]

  string __toString( )

Returns string representation of XML.

Returns string representation of XML. If any display driver is currently loaded then it uses it's method. Otherwise just returns spell XML format.


API Tags:
Return:  String representation of object.
Access:  public

Information Tags:
Version:  0.1.3
Version:  0.0.7
Since:  0.0.7
Since:  0.1.0

[ Top ]