65 lines
1.3 KiB
Plaintext
65 lines
1.3 KiB
Plaintext
void RemoveXPFromParty(int nXP, object oPC, int bAllParty=TRUE)
|
|
{
|
|
|
|
if (!bAllParty)
|
|
{
|
|
nXP=(GetXP(oPC)-nXP)>=0 ? GetXP(oPC)-nXP : 0;
|
|
SetXP(oPC, nXP);
|
|
}
|
|
else
|
|
{
|
|
object oMember=GetFirstFactionMember(oPC, TRUE);
|
|
|
|
while (GetIsObjectValid(oMember))
|
|
{
|
|
nXP=(GetXP(oMember)-nXP)>=0 ? GetXP(oMember)-nXP : 0;
|
|
SetXP(oMember, nXP);
|
|
oMember=GetNextFactionMember(oPC, TRUE);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void main()
|
|
{
|
|
object oPC;
|
|
|
|
if (!GetIsPC(GetItemActivatedTarget())
|
|
){
|
|
|
|
SendMessageToPC(GetItemActivator(), "Improper use of item!");
|
|
return;}
|
|
|
|
oPC = GetItemActivator();
|
|
|
|
AssignCommand(oPC, ClearAllActions());
|
|
|
|
object oTarget;
|
|
location lTarget;
|
|
oTarget = GetWaypointByTag("wp_tempcain");
|
|
|
|
lTarget = GetLocation(oTarget);
|
|
|
|
|
|
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
|
|
|
|
DelayCommand(1.5, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
|
|
|
|
oTarget = oPC;
|
|
|
|
|
|
int nInt;
|
|
nInt = GetObjectType(oTarget);
|
|
|
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMONDRAGON), oTarget);
|
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMONDRAGON), GetLocation(oTarget));
|
|
|
|
oPC = GetItemActivatedTarget();
|
|
|
|
RemoveXPFromParty(10, oPC, FALSE);
|
|
|
|
AssignCommand(oPC, TakeGoldFromCreature(5000, oPC, TRUE));
|
|
|
|
}
|
|
|