TurnsToSeconds(int)
ターン数を秒数に変換する
float TurnsToSeconds( int nTurns );
Parameters
nTurns
秒数に変換したいターン数(整数値)
Description
nTurnsで表されたターン数を秒数に変換し返す。
1ターン60.0秒で計算される。
Remarks
ApplyEffectToObjectはエフェクトの効果時間を秒単位で設定するが、それをターン単位にしたい場合にこの関数が使用される。ゲーム内のほとんどの呪文効果の設定に使われている。
Version
1.22
Example
// NPCの簡単なカスタム呪文。呪文はキャスターのレベル毎に1ターンの効果時間。
void main(){
int nDurationOfSpell = GetCasterLevel(OBJECT_SELF);
effect eBonusToApply = EffectAttackIncrease(1);
object oTargetOfSpell = GetSpellTargetObject();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonusToApply, oTargetOfSpell, TurnsToSeconds(nDurationOfSpell));
}
See Also
| functions: | GetTimeSecond | RoundsToSeconds |
| categories: | Time Functions | Type Casting/Conversion Functions |
author: Charles Feduke, editor: Jeff Lindsey, additional contributor(s): John Shuell, JP team: ngtaicho, Rainie
Send comments on this topic.