GetCasterLevel(object)
プレイヤーキャラクターまたはクリーチャーの呪文修得レベルを返します。
int GetCasterLevel( object oCreature );
Parameters
oCreature
呪文修得レベルを調べたいPCまたはクリーチャー。
Description
指定したクリーチャーの呪文修得レベルを取得します。
0を返した場合はエラーです。
Remarks
この関数はPCまたはクリーチャーに対してのみ使われます。
Version
1.22
Example
// Example 1 - Gets the casting level of the object that last cast
// a spell, if that object is a PC or Creature. For fun, the object
// then says its caster level.
void main(){
// Get the object that last cast a spell.
object oCreature = GetLastSpellCaster();
// Get out if it is not a creature (PC or mob)
if (GetObjectType(oCreature) != OBJECT_TYPE_CREATURE) return;
// Get the casting level of the creature.
int nCLevel = GetCasterLevel(oCreature);
// Just for fun...
string sLevel = IntToString(nCLevel);
AssignCommand(oCreature,SpeakString("I'm a level " + sLevel + " caster!",TALKVOLUME_TALK));
}
See Also
| functions: | GetCharacterLevel | GetLastSpellCaster |
| categories: | Get Data from Creature Functions |
author: Brett Lathrope, JP team: marshall
Send comments on this topic.