GetCharacterLevel(object)
クリーチャーが持っている3つのクラスの合計レベルを返します。
int GetCharacterLevel( object oTarget );
Parameters
oTarget
合計レベルを調べたいクリーチャー。
Description
最大3つまでのクラスレベルの合計を足しこんで1つの値として返します。
GetHitDice関数が使えるようになる前に使用されていました。
Requirements
#include "NW_I0_GENERIC"
Version
1.22
Example
// Example 1 - Gets the total levels of the creature that attacked // the calling object (must be a PC or Creature) and then gets // the total levels of the object being attacked. The two values // are compared, and a string is spoken based on the result. #include "NW_I0_GENERIC" void main(){ // Make sure script isn't misplace...will only work on creatures. if (GetObjectType(OBJECT_SELF) != OBJECT_TYPE_CREATURE) return; // Get the creature that last attacked me. object oCreature = GetLastAttacker(OBJECT_SELF); // Get out if it is not a creature (PC or mob) if (GetObjectType(oCreature) != OBJECT_TYPE_CREATURE) return; // Get the challenge rating of the creature. int nHisLevels = GetCharacterLevel(oCreature); // Get my challenge rating. int nMyLevels = GetCharacterLevel(OBJECT_SELF); // Just for fun... if (nMyLevels <= nHisLevels) { SpeakString("Ok, I'm scared!",TALKVOLUME_TALK); } else { SpeakString("I'm gonna whoop 'em good!",TALKVOLUME_TALK); } }
See Also
functions: | GetCasterLevel | GetLevelByClass | GetLevelByPosition |
categories: | Combat Information Functions | Get Data from Creature Functions |
author: Brett Lathrope, editor: John Shuell, JP team: marshall
Send comments on this topic.