ApplyPenalty(object)
PCの蘇生の際にペナルティを適用します。
void ApplyPenalty( object oDead );
Parameters
oDead
蘇生するPC
Description
プレイヤーの蘇生の際にXPとGPにペナルティを適用します。
Requirements
#include "nw_o0_respawn"
Version
1.22
Example
// この関数のversion1.22用ソース
void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
int nPenalty = 50 * GetHitDice(oDead);
int nHD = GetHitDice(oDead);
// * 蘇生でレベルを失うことはない
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oDead, nNewXP);
int nGoldToTake = FloatToInt(0.10 * GetGold(oDead));
// * 上限10000gpを奪う
if (nGoldToTake > 10000)
{
nGoldToTake = 10000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));
}
See Also
| categories: | PC Only Functions |
author: Tom Cassiotis, JP team: Rainie
Send comments on this topic.