Initial commit. Updated release archive.
This commit is contained in:
57
_module/nss/ro_pvp_blueflag.nss
Normal file
57
_module/nss/ro_pvp_blueflag.nss
Normal file
@@ -0,0 +1,57 @@
|
||||
void main()
|
||||
{
|
||||
|
||||
object oPC = GetLastUsedBy();
|
||||
string sName = GetName(oPC);
|
||||
string sFlag = GetName (OBJECT_SELF);
|
||||
effect eBlueFlag;
|
||||
effect eRedFlag;
|
||||
eBlueFlag = SupernaturalEffect(EffectVisualEffect(VFX_DUR_FLAG_BLUE));
|
||||
eRedFlag = SupernaturalEffect(EffectVisualEffect(VFX_DUR_FLAG_RED));
|
||||
|
||||
if (!GetIsPC(oPC)) return;
|
||||
|
||||
//if PC is stealing flag, sets FX and variable
|
||||
if (GetLocalInt(oPC, "RedTeam") == 1)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBlueFlag, oPC);
|
||||
SetLocalInt(oPC, "HasFlag", 1);
|
||||
SendMessageToAllDMs (" "+ sName +" has stolen the "+ sFlag +" ");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//check if PC is not a member of any team, and asks if they want to join one
|
||||
if (GetLocalInt(oPC, "BlueTeam") != 1)
|
||||
{
|
||||
AssignCommand(OBJECT_SELF, ActionStartConversation(oPC, ""));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//rewards PC if delivers opposing flag
|
||||
|
||||
if (GetLocalInt(oPC, "HasFlag") == 1)
|
||||
{
|
||||
|
||||
SendMessageToAllDMs (" "+ sName +" has delivered the enemy flag ");
|
||||
SetLocalInt (oPC, "HasFlag", 0);
|
||||
|
||||
|
||||
//gives PC a score marker
|
||||
CreateItemOnObject("scoreartifact", oPC);
|
||||
|
||||
//removes flag effect
|
||||
effect eLoop=GetFirstEffect(oPC);
|
||||
while (GetIsEffectValid(eLoop))
|
||||
{
|
||||
if (GetEffectType(eLoop)==EFFECT_TYPE_VISUALEFFECT)
|
||||
RemoveEffect(oPC, eLoop);
|
||||
|
||||
eLoop=GetNextEffect(oPC);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user