The script is a tag-based on acquire event, so I was just going to set the local int on all the members of the acquirer's faction.
Is there a better way?
Modifié par M. Rieder, 13 juin 2011 - 11:58 .
Modifié par M. Rieder, 13 juin 2011 - 11:58 .
Guest_Chaos Wielder_*
M. Rieder wrote...
The script is a tag-based on acquire event, so I was just going to set the local int on all the members of the acquirer's faction.
object oPC = GetModuleItemAcquiredBy(); object oItem = GetModuleItemAcquired();
if (GetIsPC(oKiller) || GetIsPC(GetMaster(oKiller)) )
{
// do stuff
}
void CSLPartySplitDelayed(object oPC, int nSplitGold)
{
int nCount = 0;
object oParty = GetFirstFactionMember(oPC, TRUE);
while (GetIsObjectValid(oParty)) {
nCount++;
oParty = GetNextFactionMember(oPC, TRUE);
}
int nShare = nSplitGold / nCount;
oParty = GetFirstFactionMember(oPC, TRUE);
while (GetIsObjectValid(oParty)) {
GiveGoldToCreature(oParty, nShare);
if (oPC==oParty) SendMessageToPC(oParty, "You split " + IntToString(nSplitGold) + " gold amoung " + IntToString(nCount) + CSLAddS(" party member", nCount) + ". Your share was " + IntToString(nShare) + ".");
else SendMessageToPC(oParty, GetFirstName(oPC) + " has split party gold. Your share was " + IntToString(nShare) + ".");
oParty = GetNextFactionMember(oPC, TRUE);
}
}
void CSLPartySplit(object oPC, int nSplitGold)
{
if (nSplitGold<100) {
SendMessageToPC(oPC, "You must specify how much gold to split with your Party (100 gold minimum).");
return;
}
int nGold = GetGold(oPC);
if (nSplitGold > nGold) {
SendMessageToPC(oPC, "You do not have that much gold to split with your Party.");
return;
}
TakeGoldFromCreature(nSplitGold, oPC); // PC LOSES ALL THE GOLD, GETS SOME BACK IN DELAY
DelayCommand(0.5f, CSLPartySplitDelayed(oPC, nSplitGold));
}
Modifié par painofdungeoneternal, 13 juin 2011 - 10:05 .
void main(string sCategoryTag, int nEntryID, int bAllPartyMembers, int bAllPlayers, int bAllowOverrideHigher)
{
object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());
AddJournalQuestEntry(sCategoryTag, nEntryID, oPC, bAllPartyMembers, bAllPlayers, bAllowOverrideHigher);
}